@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
@@ -17,13 +17,16 @@ var _button = require("../button");
17
17
  var _flex = require("../flex");
18
18
  var _list_group = require("../list_group");
19
19
  var _popover = require("../popover");
20
+ var _accessibility = require("../accessibility");
21
+ var _text = require("../text");
20
22
  var _title = require("../title");
23
+ var _tool_tip = require("../tool_tip");
21
24
  var _flyout_close_button = require("./_flyout_close_button");
22
25
  var _flyout_menu = require("./flyout_menu.styles");
23
26
  var _flyout_menu_context = require("./flyout_menu_context");
24
27
  var _i18n = require("../i18n");
25
28
  var _react2 = require("@emotion/react");
26
- var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType"];
29
+ var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType", "pagination"];
27
30
  /*
28
31
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
29
32
  * or more contributor license agreements. Licensed under the Elastic License
@@ -34,6 +37,9 @@ var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton"
34
37
  /**
35
38
  * History item for the flyout menu history popover
36
39
  */
40
+ /**
41
+ * Pagination configuration for the flyout menu
42
+ */
37
43
  /**
38
44
  * Custom action item for the flyout menu component
39
45
  */
@@ -89,6 +95,73 @@ var HistoryPopover = function HistoryPopover(_ref) {
89
95
  }, item.title);
90
96
  })));
91
97
  };
98
+ var PaginationControls = function PaginationControls(_ref2) {
99
+ var pagination = _ref2.pagination,
100
+ styles = _ref2.styles;
101
+ var currentIndex = pagination.currentIndex,
102
+ total = pagination.total,
103
+ onPrevious = pagination.onPrevious,
104
+ onNext = pagination.onNext;
105
+ var prevLabel = (0, _i18n.useEuiI18n)('euiFlyoutMenu.pagination.previous', 'Previous');
106
+ var nextLabel = (0, _i18n.useEuiI18n)('euiFlyoutMenu.pagination.next', 'Next');
107
+ var isPrevDisabled = currentIndex === 0;
108
+ var isNextDisabled = currentIndex === total - 1;
109
+ var prevButton = (0, _react2.jsx)(_button.EuiButtonIcon, {
110
+ iconType: "chevronSingleUp",
111
+ color: "text",
112
+ size: "xs",
113
+ "aria-label": prevLabel,
114
+ onClick: onPrevious,
115
+ isDisabled: isPrevDisabled,
116
+ "data-test-subj": "euiFlyoutMenuPaginationPrev"
117
+ });
118
+ var nextButton = (0, _react2.jsx)(_button.EuiButtonIcon, {
119
+ iconType: "chevronSingleDown",
120
+ color: "text",
121
+ size: "xs",
122
+ "aria-label": nextLabel,
123
+ onClick: onNext,
124
+ isDisabled: isNextDisabled,
125
+ "data-test-subj": "euiFlyoutMenuPaginationNext"
126
+ });
127
+ return (0, _react2.jsx)(_flex.EuiFlexItem, {
128
+ grow: false
129
+ }, (0, _react2.jsx)(_flex.EuiFlexGroup, {
130
+ gutterSize: "xs",
131
+ alignItems: "center",
132
+ responsive: false
133
+ }, (0, _react2.jsx)(_flex.EuiFlexItem, {
134
+ grow: false
135
+ }, isPrevDisabled ? prevButton : (0, _react2.jsx)(_tool_tip.EuiToolTip, {
136
+ content: prevLabel,
137
+ disableScreenReaderOutput: true
138
+ }, prevButton)), (0, _react2.jsx)(_flex.EuiFlexItem, {
139
+ grow: false
140
+ }, (0, _react2.jsx)(_text.EuiText, {
141
+ size: "s",
142
+ css: styles.euiFlyoutMenu__paginationCounter,
143
+ "aria-hidden": "true"
144
+ }, (0, _react2.jsx)(_i18n.EuiI18n, {
145
+ token: "euiFlyoutMenu.pagination.counter",
146
+ default: "{position} of {total}",
147
+ values: {
148
+ position: currentIndex + 1,
149
+ total: total
150
+ }
151
+ })), (0, _react2.jsx)(_accessibility.EuiScreenReaderLive, null, (0, _react2.jsx)(_i18n.EuiI18n, {
152
+ token: "euiFlyoutMenu.pagination.counter",
153
+ default: "{position} of {total}",
154
+ values: {
155
+ position: currentIndex + 1,
156
+ total: total
157
+ }
158
+ }))), (0, _react2.jsx)(_flex.EuiFlexItem, {
159
+ grow: false
160
+ }, isNextDisabled ? nextButton : (0, _react2.jsx)(_tool_tip.EuiToolTip, {
161
+ content: nextLabel,
162
+ disableScreenReaderOutput: true
163
+ }, nextButton))));
164
+ };
92
165
 
93
166
  /**
94
167
  * The component for the top menu bar inside a flyout. Since this is a private
@@ -99,24 +172,26 @@ var HistoryPopover = function HistoryPopover(_ref) {
99
172
  *
100
173
  * @private
101
174
  */
102
- var EuiFlyoutMenu = exports.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 = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
175
+ var EuiFlyoutMenu = exports.EuiFlyoutMenu = function EuiFlyoutMenu(_ref3) {
176
+ var className = _ref3.className,
177
+ title = _ref3.title,
178
+ titleId = _ref3.titleId,
179
+ _ref3$hideTitle = _ref3.hideTitle,
180
+ hideTitle = _ref3$hideTitle === void 0 ? true : _ref3$hideTitle,
181
+ hideCloseButton = _ref3.hideCloseButton,
182
+ _ref3$historyItems = _ref3.historyItems,
183
+ historyItems = _ref3$historyItems === void 0 ? [] : _ref3$historyItems,
184
+ showBackButton = _ref3.showBackButton,
185
+ backButtonProps = _ref3.backButtonProps,
186
+ customActions = _ref3.customActions,
187
+ _iconType = _ref3.iconType,
188
+ pagination = _ref3.pagination,
189
+ rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
116
190
  var _useContext = (0, _react.useContext)(_flyout_menu_context.EuiFlyoutMenuContext),
117
191
  onClose = _useContext.onClose;
118
192
  var styles = (0, _services.useEuiMemoizedStyles)(_flyout_menu.euiFlyoutMenuStyles);
119
193
  var classes = (0, _classnames.default)('euiFlyoutMenu', className);
194
+ var showPaginationControls = pagination != null && pagination.total > 1;
120
195
  var titleNode;
121
196
  if (title) {
122
197
  titleNode = (0, _react2.jsx)(_title.EuiTitle, {
@@ -127,7 +202,9 @@ var EuiFlyoutMenu = exports.EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
127
202
  }, title));
128
203
  }
129
204
  var handleClose = function handleClose(event) {
130
- onClose === null || onClose === void 0 || onClose(event);
205
+ onClose === null || onClose === void 0 || onClose(event, {
206
+ reason: 'close-button'
207
+ });
131
208
  };
132
209
  var closeButton = (0, _react2.jsx)(_flyout_close_button.EuiFlyoutCloseButton, {
133
210
  onClose: handleClose,
@@ -143,13 +220,16 @@ var EuiFlyoutMenu = exports.EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
143
220
  justifyContent: "spaceBetween",
144
221
  gutterSize: "none",
145
222
  responsive: false
146
- }, showBackButton && (0, _react2.jsx)(_flex.EuiFlexItem, {
223
+ }, showPaginationControls ? (0, _react2.jsx)(PaginationControls, {
224
+ pagination: pagination,
225
+ styles: styles
226
+ }) : (0, _react2.jsx)(_react.default.Fragment, null, showBackButton && (0, _react2.jsx)(_flex.EuiFlexItem, {
147
227
  grow: false
148
228
  }, (0, _react2.jsx)(BackButton, backButtonProps)), historyItems.length > 0 && (0, _react2.jsx)(_flex.EuiFlexItem, {
149
229
  grow: false
150
230
  }, (0, _react2.jsx)(HistoryPopover, {
151
231
  items: historyItems
152
- })), titleNode && (0, _react2.jsx)(_flex.EuiFlexItem, {
232
+ }))), titleNode && (0, _react2.jsx)(_flex.EuiFlexItem, {
153
233
  grow: false
154
234
  }, titleNode), (0, _react2.jsx)(_flex.EuiFlexItem, {
155
235
  grow: true
@@ -251,5 +331,27 @@ EuiFlyoutMenu.propTypes = {
251
331
  * Aria label for the action button
252
332
  */
253
333
  "aria-label": _propTypes.default.string.isRequired
254
- }).isRequired)
334
+ }).isRequired),
335
+ /**
336
+ * Enables Prev/Next navigation controls and a position counter in the menu bar.
337
+ * Pagination replaces back/history navigation in the left menu slot.
338
+ */
339
+ pagination: _propTypes.default.shape({
340
+ /**
341
+ * Zero-based index of the currently displayed item
342
+ */
343
+ currentIndex: _propTypes.default.number.isRequired,
344
+ /**
345
+ * Total number of items
346
+ */
347
+ total: _propTypes.default.number.isRequired,
348
+ /**
349
+ * Called when the user clicks the Previous button
350
+ */
351
+ onPrevious: _propTypes.default.func.isRequired,
352
+ /**
353
+ * Called when the user clicks the Next button
354
+ */
355
+ onNext: _propTypes.default.func.isRequired
356
+ })
255
357
  };
@@ -20,6 +20,7 @@ var euiFlyoutMenuStyles = exports.euiFlyoutMenuStyles = function euiFlyoutMenuSt
20
20
  euiFlyoutMenu__container: /*#__PURE__*/(0, _react.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;"),
21
21
  euiFlyoutMenu__spacer: /*#__PURE__*/(0, _react.css)("padding-inline:", euiTheme.size.m, ";;label:euiFlyoutMenu__spacer;"),
22
22
  euiFlyoutMenu__actions: /*#__PURE__*/(0, _react.css)("block-size:calc(", euiTheme.size.m, " * 1.8);;label:euiFlyoutMenu__actions;"),
23
- euiFlyoutMenu__hiddenTitle: /*#__PURE__*/(0, _react.css)((0, _accessibility.euiScreenReaderOnly)(), ";;label:euiFlyoutMenu__hiddenTitle;")
23
+ euiFlyoutMenu__hiddenTitle: /*#__PURE__*/(0, _react.css)((0, _accessibility.euiScreenReaderOnly)(), ";;label:euiFlyoutMenu__hiddenTitle;"),
24
+ euiFlyoutMenu__paginationCounter: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.textSubdued, ";white-space:nowrap;;label:euiFlyoutMenu__paginationCounter;")
24
25
  };
25
26
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setReferenceWidth = exports.setPushPadding = exports.setLayoutMode = exports.setFlyoutWidth = exports.setContainerElement = exports.setActivityStage = exports.setActiveFlyout = exports.goToFlyout = exports.goBack = exports.closeUnmanagedFlyout = exports.closeFlyout = exports.closeAllFlyouts = exports.addUnmanagedFlyout = exports.addFlyout = exports.ACTION_SET_WIDTH = exports.ACTION_SET_REFERENCE_WIDTH = exports.ACTION_SET_PUSH_PADDING = exports.ACTION_SET_LAYOUT_MODE = exports.ACTION_SET_CONTAINER_ELEMENT = exports.ACTION_SET_ACTIVITY_STAGE = exports.ACTION_SET_ACTIVE = exports.ACTION_GO_TO_FLYOUT = exports.ACTION_GO_BACK = exports.ACTION_CLOSE_UNMANAGED_FLYOUT = exports.ACTION_CLOSE_ALL = exports.ACTION_CLOSE = exports.ACTION_ADD_UNMANAGED_FLYOUT = exports.ACTION_ADD = void 0;
6
+ exports.setReferenceWidth = exports.setPushPadding = exports.setPagination = exports.setLayoutMode = exports.setFlyoutWidth = exports.setContainerElement = exports.setActivityStage = exports.setActiveFlyout = exports.goToFlyout = exports.goBack = exports.closeUnmanagedFlyout = exports.closeFlyout = exports.closeAllFlyouts = exports.addUnmanagedFlyout = exports.addFlyout = exports.ACTION_SET_WIDTH = exports.ACTION_SET_REFERENCE_WIDTH = exports.ACTION_SET_PUSH_PADDING = exports.ACTION_SET_PAGINATION = exports.ACTION_SET_LAYOUT_MODE = exports.ACTION_SET_CONTAINER_ELEMENT = exports.ACTION_SET_ACTIVITY_STAGE = exports.ACTION_SET_ACTIVE = exports.ACTION_GO_TO_FLYOUT = exports.ACTION_GO_BACK = exports.ACTION_CLOSE_UNMANAGED_FLYOUT = exports.ACTION_CLOSE_ALL = exports.ACTION_CLOSE = exports.ACTION_ADD_UNMANAGED_FLYOUT = exports.ACTION_ADD = void 0;
7
7
  var _const = require("./const");
8
8
  /*
9
9
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -24,6 +24,8 @@ var ACTION_CLOSE_ALL = exports.ACTION_CLOSE_ALL = "".concat(PREFIX, "/closeAll")
24
24
  var ACTION_SET_ACTIVE = exports.ACTION_SET_ACTIVE = "".concat(PREFIX, "/setActive");
25
25
  /** Dispatched when an active flyout's pixel width changes (for responsive layout). */
26
26
  var ACTION_SET_WIDTH = exports.ACTION_SET_WIDTH = "".concat(PREFIX, "/setWidth");
27
+ /** Dispatched to set a flyout's menu pagination. */
28
+ var ACTION_SET_PAGINATION = exports.ACTION_SET_PAGINATION = "".concat(PREFIX, "/setPagination");
27
29
  /** Dispatched to switch layout mode between `side-by-side` and `stacked`. */
28
30
  var ACTION_SET_LAYOUT_MODE = exports.ACTION_SET_LAYOUT_MODE = "".concat(PREFIX, "/setLayoutMode");
29
31
  /** Dispatched to update a flyout's activity stage (e.g., opening -> active). */
@@ -54,6 +56,8 @@ var ACTION_CLOSE_UNMANAGED_FLYOUT = exports.ACTION_CLOSE_UNMANAGED_FLYOUT = "".c
54
56
 
55
57
  /** Update a flyout's measured width in pixels. */
56
58
 
59
+ /** Set the manager pagination value for a flyout. */
60
+
57
61
  /** Change how flyouts are arranged: `side-by-side` or `stacked`. */
58
62
 
59
63
  /** Set a specific flyout's activity stage. */
@@ -128,6 +132,22 @@ var setFlyoutWidth = exports.setFlyoutWidth = function setFlyoutWidth(flyoutId,
128
132
  };
129
133
  };
130
134
 
135
+ /**
136
+ * Set (or clear) the menu pagination config for a flyout. When set, this
137
+ * overrides any pagination passed via `flyoutMenuProps.pagination` on the
138
+ * flyout itself, allowing reactive updates from a different React root.
139
+ *
140
+ * Only works for managed flyouts. Unmanaged flyouts (session={false}) must use
141
+ * the `flyoutMenuProps.pagination` prop instead.
142
+ */
143
+ var setPagination = exports.setPagination = function setPagination(flyoutId, pagination) {
144
+ return {
145
+ type: ACTION_SET_PAGINATION,
146
+ flyoutId: flyoutId,
147
+ pagination: pagination
148
+ };
149
+ };
150
+
131
151
  /** Switch layout mode between `side-by-side` and `stacked`. */
132
152
  var setLayoutMode = exports.setLayoutMode = function setLayoutMode(layoutMode) {
133
153
  return {
@@ -152,7 +152,29 @@ EuiFlyoutChild.propTypes = {
152
152
  * Aria label for the action button
153
153
  */
154
154
  "aria-label": _propTypes.default.string.isRequired
155
- }).isRequired)
155
+ }).isRequired),
156
+ /**
157
+ * Enables Prev/Next navigation controls and a position counter in the menu bar.
158
+ * Pagination replaces back/history navigation in the left menu slot.
159
+ */
160
+ pagination: _propTypes.default.shape({
161
+ /**
162
+ * Zero-based index of the currently displayed item
163
+ */
164
+ currentIndex: _propTypes.default.number.isRequired,
165
+ /**
166
+ * Total number of items
167
+ */
168
+ total: _propTypes.default.number.isRequired,
169
+ /**
170
+ * Called when the user clicks the Previous button
171
+ */
172
+ onPrevious: _propTypes.default.func.isRequired,
173
+ /**
174
+ * Called when the user clicks the Next button
175
+ */
176
+ onNext: _propTypes.default.func.isRequired
177
+ })
156
178
  }),
157
179
  onActive: _propTypes.default.func
158
180
  };
@@ -150,10 +150,10 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
150
150
 
151
151
  // Stabilize the onClose callback
152
152
  var onCloseCallbackRef = (0, _react.useRef)();
153
- onCloseCallbackRef.current = function (e) {
153
+ onCloseCallbackRef.current = function (e, meta) {
154
154
  if (onCloseProp) {
155
155
  var event = e || new MouseEvent('click');
156
- onCloseProp(event);
156
+ onCloseProp(event, meta);
157
157
  }
158
158
  };
159
159
 
@@ -178,17 +178,20 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
178
178
  (0, _react.useLayoutEffect)(function () {
179
179
  addFlyout(flyoutId, title, level, size, level === _const.LEVEL_MAIN ? historyKey : undefined, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
180
180
  return function () {
181
- var currentStoreState = (0, _store.getFlyoutManagerStore)().getState();
182
- var stillInStore = currentStoreState.flyouts.some(function (f) {
181
+ var store = (0, _store.getFlyoutManagerStore)();
182
+ var stillInStore = store.getState().flyouts.some(function (f) {
183
183
  return f.flyoutId === flyoutId;
184
184
  });
185
185
  if (stillInStore) {
186
186
  // Normal cleanup (deps changed or explicit close via isOpen=false)
187
187
  level === _const.LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
188
188
  } else if (wasRegisteredRef.current) {
189
- var _onCloseCallbackRef$c;
190
- // Cascade close: was registered but removed externally (e.g. main closed)
191
- (_onCloseCallbackRef$c = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c === void 0 || _onCloseCallbackRef$c.call(onCloseCallbackRef, new MouseEvent('navigation'));
189
+ var _onCloseCallbackRef$c, _store$consumeCloseMe;
190
+ // Removed externally while mounted: forward the store-stamped reason
191
+ // (e.g. `navigation-back` from goBack), defaulting to cascade.
192
+ (_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 : {
193
+ reason: 'navigation-cascade'
194
+ });
192
195
  }
193
196
  wasRegisteredRef.current = false;
194
197
  };
@@ -201,11 +204,16 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
201
204
  wasRegisteredRef.current = true;
202
205
  }
203
206
 
204
- // If flyout was previously registered, is marked as open, but no longer exists in manager state,
205
- // it was removed via navigation (Back button) - trigger close callback
207
+ // If flyout was previously registered, is marked as open, but no longer
208
+ // exists in manager state, it was removed externally while still mounted.
209
+ // Forward the store-stamped reason (e.g. `navigation-back` from goBack);
210
+ // any other removal (e.g. a closeAllFlyouts cascade reaching a backgrounded
211
+ // flyout) defaults to `navigation-cascade`.
206
212
  if (wasRegisteredRef.current && !flyoutExistsInManager) {
207
- var _onCloseCallbackRef$c2;
208
- (_onCloseCallbackRef$c2 = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c2 === void 0 || _onCloseCallbackRef$c2.call(onCloseCallbackRef, new MouseEvent('navigation'));
213
+ var _onCloseCallbackRef$c2, _getFlyoutManagerStor;
214
+ (_onCloseCallbackRef$c2 = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c2 === void 0 || _onCloseCallbackRef$c2.call(onCloseCallbackRef, new MouseEvent('navigation'), (_getFlyoutManagerStor = (0, _store.getFlyoutManagerStore)().consumeCloseMeta(flyoutId)) !== null && _getFlyoutManagerStor !== void 0 ? _getFlyoutManagerStor : {
215
+ reason: 'navigation-cascade'
216
+ });
209
217
  wasRegisteredRef.current = false; // Reset to avoid repeated calls
210
218
  }
211
219
  }, [flyoutExistsInManager, flyoutId]);
@@ -229,7 +237,12 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
229
237
  width = _useResizeObserver.width;
230
238
 
231
239
  // Pass the stabilized onClose callback to the flyout menu context
232
- var onClose = function onClose(e) {
240
+ var onClose = function onClose(e, meta) {
241
+ // Clear before flushSync so that effects flushed synchronously inside it
242
+ // (the navigation-back detector) see wasRegisteredRef = false and do not
243
+ // misidentify this user-initiated close as a Back-button navigation.
244
+ wasRegisteredRef.current = false;
245
+
233
246
  // CRITICAL: Update manager state FIRST before allowing React to unmount
234
247
  // This prevents race conditions during portal → inline DOM transitions
235
248
  // and ensures cascade close logic runs before DOM cleanup begins
@@ -237,10 +250,9 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
237
250
  (0, _reactDom.flushSync)(function () {
238
251
  level === _const.LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
239
252
  });
240
- wasRegisteredRef.current = false; // Prevent cleanup from double-firing onClose
241
253
  if (onCloseCallbackRef.current) {
242
254
  var event = e || new MouseEvent('click');
243
- onCloseCallbackRef.current(event);
255
+ onCloseCallbackRef.current(event, meta);
244
256
  }
245
257
  };
246
258
 
@@ -269,11 +281,23 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
269
281
  } : undefined;
270
282
  }, [level, goBack]);
271
283
  var showBackButton = historyItems ? historyItems.length > 0 : false;
284
+
285
+ // When the store has a defined pagination value it takes precedence; the
286
+ // prop acts as a fallback for callers that don't use the cross-root store.
287
+ // Using both simultaneously is not supported and will log a warning in dev.
288
+ var storePagination = (0, _hooks.useFlyoutPagination)(flyoutId);
289
+ var propPagination = _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.pagination;
290
+ if (process.env.NODE_ENV === 'development' && storePagination != null && propPagination != null) {
291
+ 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.');
292
+ }
293
+ var pagination = storePagination !== null && storePagination !== void 0 ? storePagination : propPagination;
294
+ var showPaginationControls = pagination != null && pagination.total > 1;
272
295
  var flyoutMenuProps = _objectSpread(_objectSpread({}, _flyoutMenuProps), {}, {
273
- historyItems: historyItems,
274
- showBackButton: showBackButton,
296
+ historyItems: showPaginationControls ? [] : historyItems,
297
+ showBackButton: showPaginationControls ? false : showBackButton,
275
298
  backButtonProps: backButtonProps,
276
- title: title
299
+ title: title,
300
+ pagination: pagination
277
301
  });
278
302
  return (0, _react2.jsx)(_context.EuiFlyoutIsManagedProvider, {
279
303
  isManaged: true
@@ -29,6 +29,12 @@ Object.defineProperty(exports, "useFlyoutLayoutMode", {
29
29
  }
30
30
  });
31
31
  exports.useFlyoutManager = void 0;
32
+ Object.defineProperty(exports, "useFlyoutPagination", {
33
+ enumerable: true,
34
+ get: function get() {
35
+ return _selectors.useFlyoutPagination;
36
+ }
37
+ });
32
38
  Object.defineProperty(exports, "useFlyoutWidth", {
33
39
  enumerable: true,
34
40
  get: function get() {
@@ -81,6 +81,12 @@ Object.defineProperty(exports, "setFlyoutWidthAction", {
81
81
  return _actions.setFlyoutWidth;
82
82
  }
83
83
  });
84
+ Object.defineProperty(exports, "setPaginationAction", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _actions.setPagination;
88
+ }
89
+ });
84
90
  Object.defineProperty(exports, "setPushPaddingAction", {
85
91
  enumerable: true,
86
92
  get: function get() {
@@ -123,6 +129,12 @@ Object.defineProperty(exports, "useFlyoutManager", {
123
129
  return _hooks.useFlyoutManager;
124
130
  }
125
131
  });
132
+ Object.defineProperty(exports, "useFlyoutPagination", {
133
+ enumerable: true,
134
+ get: function get() {
135
+ return _hooks.useFlyoutPagination;
136
+ }
137
+ });
126
138
  Object.defineProperty(exports, "useFlyoutWidth", {
127
139
  enumerable: true,
128
140
  get: function get() {
@@ -357,6 +357,30 @@ function flyoutManagerReducer() {
357
357
  });
358
358
  }
359
359
 
360
+ // Update a flyout's menu pagination. No-op if unchanged or missing.
361
+ case _actions.ACTION_SET_PAGINATION:
362
+ {
363
+ var _flyoutId2 = action.flyoutId,
364
+ pagination = action.pagination;
365
+ var target = state.flyouts.find(function (f) {
366
+ return f.flyoutId === _flyoutId2;
367
+ });
368
+ if (!target) {
369
+ return state;
370
+ }
371
+ if (target.pagination === pagination) {
372
+ return state;
373
+ }
374
+ var _updatedFlyouts = state.flyouts.map(function (flyout) {
375
+ return flyout.flyoutId === _flyoutId2 ? _objectSpread(_objectSpread({}, flyout), {}, {
376
+ pagination: pagination
377
+ }) : flyout;
378
+ });
379
+ return _objectSpread(_objectSpread({}, state), {}, {
380
+ flyouts: _updatedFlyouts
381
+ });
382
+ }
383
+
360
384
  // Switch global layout mode for managed flyouts.
361
385
  case _actions.ACTION_SET_LAYOUT_MODE:
362
386
  {
@@ -368,14 +392,14 @@ function flyoutManagerReducer() {
368
392
  // Update a flyout's activity stage in state
369
393
  case _actions.ACTION_SET_ACTIVITY_STAGE:
370
394
  {
371
- var _flyoutId2 = action.flyoutId;
372
- var _updatedFlyouts = state.flyouts.map(function (flyout) {
373
- return flyout.flyoutId === _flyoutId2 ? _objectSpread(_objectSpread({}, flyout), {}, {
395
+ var _flyoutId3 = action.flyoutId;
396
+ var _updatedFlyouts2 = state.flyouts.map(function (flyout) {
397
+ return flyout.flyoutId === _flyoutId3 ? _objectSpread(_objectSpread({}, flyout), {}, {
374
398
  activityStage: action.activityStage
375
399
  }) : flyout;
376
400
  });
377
401
  return _objectSpread(_objectSpread({}, state), {}, {
378
- flyouts: _updatedFlyouts
402
+ flyouts: _updatedFlyouts2
379
403
  });
380
404
  }
381
405
 
@@ -429,7 +453,7 @@ function flyoutManagerReducer() {
429
453
  // Navigate to a specific flyout (by main session or by child in current session's history)
430
454
  case _actions.ACTION_GO_TO_FLYOUT:
431
455
  {
432
- var _flyoutId3 = action.flyoutId,
456
+ var _flyoutId4 = action.flyoutId,
433
457
  _level = action.level;
434
458
  var _currentSessionIndex4 = state.sessions.length - 1;
435
459
  if (_level === _const.LEVEL_CHILD && state.sessions.length > 0) {
@@ -437,7 +461,7 @@ function flyoutManagerReducer() {
437
461
  var _currentSession3 = state.sessions[_currentSessionIndex4];
438
462
  var _childHistory2 = (_currentSession3$chil = _currentSession3.childHistory) !== null && _currentSession3$chil !== void 0 ? _currentSession3$chil : [];
439
463
  var targetIndex = _childHistory2.findIndex(function (entry) {
440
- return entry.flyoutId === _flyoutId3;
464
+ return entry.flyoutId === _flyoutId4;
441
465
  });
442
466
  if (targetIndex === -1) {
443
467
  return state; // Target child not in history
@@ -469,7 +493,7 @@ function flyoutManagerReducer() {
469
493
 
470
494
  // Navigate by main flyout: remove all sessions after the target
471
495
  var targetSessionIndex = state.sessions.findIndex(function (session) {
472
- return session.mainFlyoutId === _flyoutId3;
496
+ return session.mainFlyoutId === _flyoutId4;
473
497
  });
474
498
  if (targetSessionIndex === -1) {
475
499
  return state; // Target flyout not found
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useSession = exports.usePushPaddingOffsets = exports.useParentFlyoutSize = exports.useIsFlyoutRegistered = exports.useIsFlyoutActive = exports.useHasPushPadding = exports.useHasChildFlyout = exports.useHasActiveSession = exports.useFlyoutWidth = exports.useFlyoutMinWidth = exports.useFlyout = exports.useCurrentSession = exports.useCurrentMainFlyout = exports.useCurrentFlyoutZIndexRef = exports.useCurrentChildFlyout = void 0;
6
+ exports.useSession = exports.usePushPaddingOffsets = exports.useParentFlyoutSize = exports.useIsFlyoutRegistered = exports.useIsFlyoutActive = exports.useHasPushPadding = exports.useHasChildFlyout = exports.useHasActiveSession = exports.useFlyoutWidth = exports.useFlyoutPagination = exports.useFlyoutMinWidth = exports.useFlyout = exports.useCurrentSession = exports.useCurrentMainFlyout = exports.useCurrentFlyoutZIndexRef = exports.useCurrentChildFlyout = void 0;
7
7
  var _provider = require("./provider");
8
8
  var _react = require("react");
9
9
  /*
@@ -80,10 +80,16 @@ var useFlyoutWidth = exports.useFlyoutWidth = function useFlyoutWidth(flyoutId)
80
80
  return (_useFlyout = useFlyout(flyoutId)) === null || _useFlyout === void 0 ? void 0 : _useFlyout.width;
81
81
  };
82
82
 
83
+ /** Returns the store pagination override for a flyout, if set. */
84
+ var useFlyoutPagination = exports.useFlyoutPagination = function useFlyoutPagination(flyoutId) {
85
+ var _useFlyout2;
86
+ return (_useFlyout2 = useFlyout(flyoutId)) === null || _useFlyout2 === void 0 ? void 0 : _useFlyout2.pagination;
87
+ };
88
+
83
89
  /** The configured minWidth (px) of the specified flyout, or `undefined` if not set. */
84
90
  var useFlyoutMinWidth = exports.useFlyoutMinWidth = function useFlyoutMinWidth(flyoutId) {
85
- var _useFlyout2;
86
- return (_useFlyout2 = useFlyout(flyoutId)) === null || _useFlyout2 === void 0 ? void 0 : _useFlyout2.minWidth;
91
+ var _useFlyout3;
92
+ return (_useFlyout3 = useFlyout(flyoutId)) === null || _useFlyout3 === void 0 ? void 0 : _useFlyout3.minWidth;
87
93
  };
88
94
 
89
95
  /** The configured size of the parent (main) flyout for a given child flyout ID. */
@@ -26,6 +26,13 @@ function createStore() {
26
26
  var currentState = initial;
27
27
  var listeners = new Set();
28
28
  var eventListeners = new Set();
29
+
30
+ // Transient, one-shot close annotations keyed by flyoutId. `goBack` stamps the
31
+ // flyouts it removes so the managed flyout can report `navigation-back`; any
32
+ // other removal (e.g. closeAllFlyouts cascade) leaves no stamp and defaults to
33
+ // `navigation-cascade`. Kept off reducer state because it is a per-close
34
+ // annotation, not persistent state.
35
+ var pendingCloseMeta = new Map();
29
36
  var getState = function getState() {
30
37
  return currentState;
31
38
  };
@@ -169,6 +176,9 @@ function createStore() {
169
176
  setFlyoutWidth: function setFlyoutWidth(flyoutId, width) {
170
177
  return dispatch((0, _actions.setFlyoutWidth)(flyoutId, width));
171
178
  },
179
+ setPagination: function setPagination(flyoutId, pagination) {
180
+ return dispatch((0, _actions.setPagination)(flyoutId, pagination));
181
+ },
172
182
  setPushPadding: function setPushPadding(side, width) {
173
183
  return dispatch((0, _actions.setPushPadding)(side, width));
174
184
  },
@@ -176,7 +186,23 @@ function createStore() {
176
186
  return dispatch((0, _actions.setContainerElement)(element));
177
187
  },
178
188
  goBack: function goBack() {
179
- return dispatch((0, _actions.goBack)());
189
+ // Stamp the flyouts goBack removes as `navigation-back` (vs. the default
190
+ // `navigation-cascade`) BEFORE dispatching. dispatch synchronously flushes
191
+ // subscribers, which can consume the meta during unmount, so peek the pure
192
+ // reducer to learn which flyouts go away and stamp them first.
193
+ var action = (0, _actions.goBack)();
194
+ var nextState = (0, _reducer.flyoutManagerReducer)(currentState, action);
195
+ var remaining = new Set(nextState.flyouts.map(function (f) {
196
+ return f.flyoutId;
197
+ }));
198
+ currentState.flyouts.forEach(function (f) {
199
+ if (!remaining.has(f.flyoutId)) {
200
+ pendingCloseMeta.set(f.flyoutId, {
201
+ reason: 'navigation-back'
202
+ });
203
+ }
204
+ });
205
+ dispatch(action);
180
206
  },
181
207
  goToFlyout: function goToFlyout(flyoutId, level) {
182
208
  return dispatch((0, _actions.goToFlyout)(flyoutId, level));
@@ -187,6 +213,13 @@ function createStore() {
187
213
  closeUnmanagedFlyout: function closeUnmanagedFlyout(flyoutId) {
188
214
  return dispatch((0, _actions.closeUnmanagedFlyout)(flyoutId));
189
215
  },
216
+ consumeCloseMeta: function consumeCloseMeta(flyoutId) {
217
+ var meta = pendingCloseMeta.get(flyoutId);
218
+ if (meta) {
219
+ pendingCloseMeta.delete(flyoutId);
220
+ }
221
+ return meta;
222
+ },
190
223
  historyItems: computeHistoryItems(dispatch) // Initialize with current state
191
224
  };
192
225
  return store;
@@ -45,10 +45,10 @@ var useEuiFlyoutMenu = exports.useEuiFlyoutMenu = function useEuiFlyoutMenu(_ref
45
45
  }, [hasMenu, _titleId, generatedMenuId]);
46
46
 
47
47
  // Determine if the menu has any content
48
- // hasBackButton or hasHistory or hasCustomActions or hasVisibleTitle
48
+ // hasBackButton or hasHistory or hasCustomActions or hasVisibleTitle or hasPagination
49
49
  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 ||
50
50
  // Component defaults to hiding the title, so only explicit false means the title will be visible
51
- !!(flyoutMenuProps.title && flyoutMenuProps.hideTitle === false));
51
+ !!(flyoutMenuProps.title && flyoutMenuProps.hideTitle === false) || !!(flyoutMenuProps.pagination && flyoutMenuProps.pagination.total > 1));
52
52
 
53
53
  // Determine if the menu should be rendered based on the display mode and menu content
54
54
  var shouldRenderMenu = (0, _react.useMemo)(function () {
@@ -24,7 +24,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
24
24
  var euiFieldPasswordStyles = exports.euiFieldPasswordStyles = function euiFieldPasswordStyles(euiThemeContext) {
25
25
  var formStyles = (0, _form.euiFormControlStyles)(euiThemeContext);
26
26
  return {
27
- euiFieldPassword: /*#__PURE__*/(0, _react.css)(formStyles.shared, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldPassword;"),
27
+ euiFieldPassword: /*#__PURE__*/(0, _react.css)(formStyles.shared, " &:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldPassword;"),
28
28
  // Only remove Edge's internal reveal button if we're providing a custom one
29
29
  // This pseudo-element is still supported in Chromium-based Edge.
30
30
  withToggle: _ref,
@@ -17,7 +17,7 @@ var _form = require("../form.styles");
17
17
  var euiFieldSearchStyles = exports.euiFieldSearchStyles = function euiFieldSearchStyles(euiThemeContext) {
18
18
  var formStyles = (0, _form.euiFormControlStyles)(euiThemeContext);
19
19
  return {
20
- euiFieldSearch: /*#__PURE__*/(0, _react.css)("-webkit-appearance:textfield;&::-webkit-search-decoration,&::-webkit-search-cancel-button{-webkit-appearance:none;}", formStyles.shared, " &:invalid{", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldSearch;"),
20
+ euiFieldSearch: /*#__PURE__*/(0, _react.css)("-webkit-appearance:textfield;&::-webkit-search-decoration,&::-webkit-search-cancel-button{-webkit-appearance:none;}", formStyles.shared, " &:is(:invalid, [aria-invalid='true']){", formStyles.invalid, ";}&:focus{", formStyles.focus, ";}&:disabled{", formStyles.disabled, ";}&[readOnly]{", formStyles.readOnly, ";}&:autofill{", formStyles.autoFill, ";};label:euiFieldSearch;"),
21
21
  // Skip the css() on the default height to avoid generating a className
22
22
  uncompressed: formStyles.uncompressed,
23
23
  compressed: /*#__PURE__*/(0, _react.css)(formStyles.compressed, ";label:compressed;"),