@elastic/eui 91.3.0 → 92.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +0 -513
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +0 -513
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/basic_table/basic_table.js +25 -22
  7. package/es/components/basic_table/collapsed_item_actions.js +14 -15
  8. package/es/components/basic_table/expanded_item_actions.js +4 -4
  9. package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
  10. package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  11. package/es/components/filter_group/filter_button.js +20 -13
  12. package/es/components/filter_group/filter_button.styles.js +11 -20
  13. package/es/components/flyout/flyout.js +4 -4
  14. package/es/components/flyout/flyout_resizable.js +127 -0
  15. package/es/components/flyout/flyout_resizable.styles.js +27 -0
  16. package/es/components/flyout/index.js +2 -1
  17. package/es/components/form/range/dual_range.js +15 -66
  18. package/es/components/form/range/range.js +6 -5
  19. package/es/components/form/range/range_slider.js +28 -22
  20. package/es/components/form/text_area/text_area.js +39 -3
  21. package/es/components/index.js +0 -2
  22. package/es/components/markdown_editor/markdown_editor.js +12 -13
  23. package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  24. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  25. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
  26. package/es/components/tree_view/tree_view.js +23 -25
  27. package/es/utils/prop_types/is.js +2 -2
  28. package/eui.d.ts +830 -1145
  29. package/i18ntokens.json +121 -373
  30. package/lib/components/basic_table/basic_table.js +25 -22
  31. package/lib/components/basic_table/collapsed_item_actions.js +14 -15
  32. package/lib/components/basic_table/expanded_item_actions.js +4 -4
  33. package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
  34. package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  35. package/lib/components/filter_group/filter_button.js +20 -13
  36. package/lib/components/filter_group/filter_button.styles.js +11 -20
  37. package/lib/components/flyout/flyout.js +4 -4
  38. package/lib/components/flyout/flyout_resizable.js +136 -0
  39. package/lib/components/flyout/flyout_resizable.styles.js +32 -0
  40. package/lib/components/flyout/index.js +8 -1
  41. package/lib/components/form/range/dual_range.js +15 -66
  42. package/lib/components/form/range/range.js +6 -5
  43. package/lib/components/form/range/range_slider.js +27 -21
  44. package/lib/components/form/text_area/text_area.js +42 -3
  45. package/lib/components/index.js +0 -22
  46. package/lib/components/markdown_editor/markdown_editor.js +12 -13
  47. package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  48. package/lib/components/pagination/pagination_button.js +79 -2
  49. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  50. package/lib/components/tree_view/tree_view.js +23 -25
  51. package/lib/utils/prop_types/is.js +2 -2
  52. package/optimize/es/components/basic_table/basic_table.js +25 -22
  53. package/optimize/es/components/basic_table/collapsed_item_actions.js +14 -15
  54. package/optimize/es/components/basic_table/expanded_item_actions.js +4 -4
  55. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
  56. package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  57. package/optimize/es/components/filter_group/filter_button.js +20 -13
  58. package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
  59. package/optimize/es/components/flyout/flyout.js +4 -4
  60. package/optimize/es/components/flyout/flyout_resizable.js +121 -0
  61. package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
  62. package/optimize/es/components/flyout/index.js +2 -1
  63. package/optimize/es/components/form/range/dual_range.js +15 -66
  64. package/optimize/es/components/form/range/range.js +6 -5
  65. package/optimize/es/components/form/range/range_slider.js +26 -21
  66. package/optimize/es/components/form/text_area/text_area.js +29 -3
  67. package/optimize/es/components/index.js +0 -2
  68. package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
  69. package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  70. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  71. package/optimize/es/components/tree_view/tree_view.js +23 -25
  72. package/optimize/es/utils/prop_types/is.js +2 -2
  73. package/optimize/lib/components/basic_table/basic_table.js +25 -22
  74. package/optimize/lib/components/basic_table/collapsed_item_actions.js +14 -15
  75. package/optimize/lib/components/basic_table/expanded_item_actions.js +4 -4
  76. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
  77. package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  78. package/optimize/lib/components/filter_group/filter_button.js +20 -13
  79. package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
  80. package/optimize/lib/components/flyout/flyout.js +4 -4
  81. package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
  82. package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
  83. package/optimize/lib/components/flyout/index.js +8 -1
  84. package/optimize/lib/components/form/range/dual_range.js +15 -66
  85. package/optimize/lib/components/form/range/range.js +6 -5
  86. package/optimize/lib/components/form/range/range_slider.js +26 -21
  87. package/optimize/lib/components/form/text_area/text_area.js +32 -3
  88. package/optimize/lib/components/index.js +0 -22
  89. package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
  90. package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  91. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  92. package/optimize/lib/components/tree_view/tree_view.js +23 -25
  93. package/optimize/lib/utils/prop_types/is.js +2 -2
  94. package/package.json +3 -5
  95. package/src/components/index.scss +0 -2
  96. package/test-env/components/basic_table/basic_table.js +25 -22
  97. package/test-env/components/basic_table/collapsed_item_actions.js +14 -15
  98. package/test-env/components/basic_table/expanded_item_actions.js +4 -4
  99. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -3
  100. package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  101. package/test-env/components/filter_group/filter_button.js +20 -13
  102. package/test-env/components/filter_group/filter_button.styles.js +11 -20
  103. package/test-env/components/flyout/flyout_resizable.js +131 -0
  104. package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
  105. package/test-env/components/flyout/index.js +8 -1
  106. package/test-env/components/form/range/dual_range.js +15 -66
  107. package/test-env/components/form/range/range.js +6 -5
  108. package/test-env/components/form/range/range_slider.js +27 -21
  109. package/test-env/components/form/text_area/text_area.js +42 -3
  110. package/test-env/components/index.js +0 -22
  111. package/test-env/components/markdown_editor/markdown_editor.js +12 -13
  112. package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  113. package/test-env/components/pagination/pagination_button.js +79 -2
  114. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  115. package/test-env/components/tree_view/tree_view.js +23 -25
  116. package/test-env/utils/prop_types/is.js +2 -2
  117. package/es/components/control_bar/control_bar.a11y.js +0 -133
  118. package/es/components/control_bar/control_bar.js +0 -609
  119. package/es/components/control_bar/index.js +0 -9
  120. package/es/components/notification/index.js +0 -9
  121. package/es/components/notification/notification_event.a11y.js +0 -104
  122. package/es/components/notification/notification_event.js +0 -288
  123. package/es/components/notification/notification_event_messages.js +0 -79
  124. package/es/components/notification/notification_event_meta.js +0 -148
  125. package/es/components/notification/notification_event_read_button.js +0 -86
  126. package/es/components/notification/notification_event_read_icon.js +0 -77
  127. package/lib/components/control_bar/control_bar.a11y.js +0 -134
  128. package/lib/components/control_bar/control_bar.js +0 -441
  129. package/lib/components/control_bar/index.js +0 -12
  130. package/lib/components/notification/index.js +0 -12
  131. package/lib/components/notification/notification_event.a11y.js +0 -105
  132. package/lib/components/notification/notification_event.js +0 -297
  133. package/lib/components/notification/notification_event_messages.js +0 -88
  134. package/lib/components/notification/notification_event_meta.js +0 -157
  135. package/lib/components/notification/notification_event_read_button.js +0 -93
  136. package/lib/components/notification/notification_event_read_icon.js +0 -64
  137. package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
  138. package/optimize/es/components/control_bar/control_bar.js +0 -308
  139. package/optimize/es/components/control_bar/index.js +0 -9
  140. package/optimize/es/components/notification/index.js +0 -9
  141. package/optimize/es/components/notification/notification_event.a11y.js +0 -99
  142. package/optimize/es/components/notification/notification_event.js +0 -114
  143. package/optimize/es/components/notification/notification_event_messages.js +0 -63
  144. package/optimize/es/components/notification/notification_event_meta.js +0 -106
  145. package/optimize/es/components/notification/notification_event_read_button.js +0 -44
  146. package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
  147. package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
  148. package/optimize/lib/components/control_bar/control_bar.js +0 -301
  149. package/optimize/lib/components/control_bar/index.js +0 -12
  150. package/optimize/lib/components/notification/index.js +0 -12
  151. package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
  152. package/optimize/lib/components/notification/notification_event.js +0 -123
  153. package/optimize/lib/components/notification/notification_event_messages.js +0 -74
  154. package/optimize/lib/components/notification/notification_event_meta.js +0 -117
  155. package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
  156. package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
  157. package/src/components/control_bar/_control_bar.scss +0 -232
  158. package/src/components/control_bar/_index.scss +0 -2
  159. package/src/components/control_bar/_variables.scss +0 -12
  160. package/src/components/notification/_index.scss +0 -5
  161. package/src/components/notification/_notification_event.scss +0 -40
  162. package/src/components/notification/_notification_event_messages.scss +0 -17
  163. package/src/components/notification/_notification_event_meta.scss +0 -44
  164. package/src/components/notification/_notification_event_read_button.scss +0 -5
  165. package/src/components/notification/_notification_event_read_icon.scss +0 -12
  166. package/test-env/components/control_bar/control_bar.a11y.js +0 -134
  167. package/test-env/components/control_bar/control_bar.js +0 -436
  168. package/test-env/components/control_bar/index.js +0 -12
  169. package/test-env/components/notification/index.js +0 -12
  170. package/test-env/components/notification/notification_event.a11y.js +0 -105
  171. package/test-env/components/notification/notification_event.js +0 -296
  172. package/test-env/components/notification/notification_event_messages.js +0 -85
  173. package/test-env/components/notification/notification_event_meta.js +0 -154
  174. package/test-env/components/notification/notification_event_read_button.js +0 -92
  175. package/test-env/components/notification/notification_event_read_icon.js +0 -63
@@ -441,7 +441,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
441
441
  var sortDirection = _this2.resolveColumnSortDirection(column);
442
442
  items.push({
443
443
  name: column.name,
444
- key: "_data_s_".concat(column.field, "_").concat(index),
444
+ key: "_data_s_".concat(String(column.field), "_").concat(index),
445
445
  onSort: _this2.resolveColumnOnSort(column),
446
446
  isSorted: !!sortDirection,
447
447
  isSortAscending: sortDirection ? _services.SortDirection.isAsc(sortDirection) : undefined
@@ -594,11 +594,11 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
594
594
  }
595
595
  }
596
596
  headers.push((0, _react2.jsx)(_table.EuiTableHeaderCell, _extends({
597
- key: "_data_h_".concat(field, "_").concat(index),
597
+ key: "_data_h_".concat(String(field), "_").concat(index),
598
598
  align: columnAlign,
599
599
  width: width,
600
600
  mobileOptions: mobileOptions,
601
- "data-test-subj": "tableHeaderCell_".concat(field, "_").concat(index),
601
+ "data-test-subj": "tableHeaderCell_".concat(String(field), "_").concat(index),
602
602
  description: description
603
603
  }, sorting), name));
604
604
  });
@@ -635,7 +635,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
635
635
 
636
636
  if (footer) {
637
637
  footers.push((0, _react2.jsx)(_table.EuiTableFooterCell, {
638
- key: "footer_".concat(field, "_").concat(footers.length - 1),
638
+ key: "footer_".concat(String(field), "_").concat(footers.length - 1),
639
639
  align: align
640
640
  }, footer));
641
641
  hasDefinedFooter = true;
@@ -818,19 +818,22 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
818
818
  }, {
819
819
  key: "renderItemActionsCell",
820
820
  value: function renderItemActionsCell(itemId, item, column, columnIndex) {
821
- var _this7 = this;
822
- var actionEnabled = function actionEnabled(action) {
823
- return _this7.state.selection.length === 0 && (!action.enabled || action.enabled(item));
824
- };
821
+ // Disable all actions if any row(s) are selected
822
+ var allDisabled = this.state.selection.length > 0;
825
823
  var actualActions = column.actions.filter(function (action) {
826
824
  return !action.available || action.available(item);
827
825
  });
828
826
  if (actualActions.length > 2) {
829
- // if any of the actions `isPrimary`, add them inline as well, but only the first 2
830
- var primaryActions = actualActions.filter(function (o) {
831
- return o.isPrimary;
832
- });
833
- actualActions = primaryActions.slice(0, 2);
827
+ if (allDisabled) {
828
+ // If all actions are disabled, do not show any actions but the popover toggle
829
+ actualActions = [];
830
+ } else {
831
+ // if any of the actions `isPrimary`, add them inline as well, but only the first 2
832
+ var primaryActions = actualActions.filter(function (o) {
833
+ return o.isPrimary;
834
+ });
835
+ actualActions = primaryActions.slice(0, 2);
836
+ }
834
837
 
835
838
  // if we have more than 1 action, we don't show them all in the cell, instead we
836
839
  // put them all in a popover tool. This effectively means we can only have a maximum
@@ -843,18 +846,18 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
843
846
  render: function render(item) {
844
847
  return (0, _react2.jsx)(_collapsed_item_actions.CollapsedItemActions, {
845
848
  actions: column.actions,
849
+ actionsDisabled: allDisabled,
846
850
  itemId: itemId,
847
- item: item,
848
- actionEnabled: actionEnabled
851
+ item: item
849
852
  });
850
853
  }
851
854
  });
852
855
  }
853
856
  var tools = (0, _react2.jsx)(_expanded_item_actions.ExpandedItemActions, {
854
857
  actions: actualActions,
858
+ actionsDisabled: allDisabled,
855
859
  itemId: itemId,
856
- item: item,
857
- actionEnabled: actionEnabled
860
+ item: item
858
861
  });
859
862
  var key = "record_actions_".concat(itemId, "_").concat(columnIndex);
860
863
  return (0, _react2.jsx)(_table.EuiTableRowCell, {
@@ -872,7 +875,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
872
875
  var field = column.field,
873
876
  render = column.render,
874
877
  dataType = column.dataType;
875
- var key = "_data_column_".concat(field, "_").concat(itemId, "_").concat(columnIndex);
878
+ var key = "_data_column_".concat(String(field), "_").concat(itemId, "_").concat(columnIndex);
876
879
  var contentRenderer = render || this.getRendererForDataType(dataType);
877
880
  var value = (0, _objects.get)(item, field);
878
881
  var content = contentRenderer(value, item);
@@ -941,7 +944,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
941
944
  }, {
942
945
  key: "renderPaginationBar",
943
946
  value: function renderPaginationBar() {
944
- var _this8 = this;
947
+ var _this7 = this;
945
948
  var _this$props11 = this.props,
946
949
  error = _this$props11.error,
947
950
  pagination = _this$props11.pagination,
@@ -960,9 +963,9 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
960
963
  }, function (tablePagination) {
961
964
  return (0, _react2.jsx)(_pagination_bar.PaginationBar, {
962
965
  pagination: pagination,
963
- onPageSizeChange: _this8.onPageSizeChange.bind(_this8),
964
- onPageChange: _this8.onPageChange.bind(_this8),
965
- "aria-controls": _this8.tableId,
966
+ onPageSizeChange: _this7.onPageSizeChange.bind(_this7),
967
+ onPageChange: _this7.onPageChange.bind(_this7),
968
+ "aria-controls": _this7.tableId,
966
969
  "aria-label": tablePagination
967
970
  });
968
971
  });
@@ -32,16 +32,12 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
32
32
  var actions = _ref.actions,
33
33
  itemId = _ref.itemId,
34
34
  item = _ref.item,
35
- actionEnabled = _ref.actionEnabled,
35
+ actionsDisabled = _ref.actionsDisabled,
36
36
  className = _ref.className;
37
37
  var _useState = (0, _react.useState)(false),
38
38
  _useState2 = _slicedToArray(_useState, 2),
39
39
  popoverOpen = _useState2[0],
40
40
  setPopoverOpen = _useState2[1];
41
- var _useState3 = (0, _react.useState)(true),
42
- _useState4 = _slicedToArray(_useState3, 2),
43
- allDisabled = _useState4[0],
44
- setAllDisabled = _useState4[1];
45
41
  var onClickItem = (0, _react.useCallback)(function (onClickAction) {
46
42
  setPopoverOpen(false);
47
43
  onClickAction === null || onClickAction === void 0 ? void 0 : onClickAction();
@@ -51,8 +47,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
51
47
  var _action$available, _action$available2;
52
48
  var available = (_action$available = (_action$available2 = action.available) === null || _action$available2 === void 0 ? void 0 : _action$available2.call(action, item)) !== null && _action$available !== void 0 ? _action$available : true;
53
49
  if (!available) return controls;
54
- var enabled = actionEnabled(action);
55
- if (enabled) setAllDisabled(false);
50
+ var enabled = action.enabled == null || action.enabled(item);
56
51
  if ((0, _action_types.isCustomItemAction)(action)) {
57
52
  var customAction = action;
58
53
  var actionControl = customAction.render(item, enabled);
@@ -83,7 +78,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
83
78
  controls.push((0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
84
79
  key: index,
85
80
  className: "euiBasicTable__collapsedAction",
86
- disabled: !enabled,
81
+ disabled: !enabled && !actionsDisabled,
87
82
  href: href,
88
83
  target: target,
89
84
  icon: icon,
@@ -101,17 +96,21 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
101
96
  }
102
97
  return controls;
103
98
  }, []);
104
- }, [actions, actionEnabled, item, onClickItem]);
99
+ }, [actions, actionsDisabled, item, onClickItem]);
105
100
  var popoverButton = (0, _react2.jsx)(_i18n.EuiI18n, {
106
- token: "euiCollapsedItemActions.allActions",
107
- default: "All actions"
108
- }, function (allActions) {
101
+ tokens: ['euiCollapsedItemActions.allActions', 'euiCollapsedItemActions.allActionsDisabled'],
102
+ defaults: ['All actions', 'Individual item actions are disabled when rows are being selected.']
103
+ }, function (_ref2) {
104
+ var _ref3 = _slicedToArray(_ref2, 2),
105
+ allActions = _ref3[0],
106
+ allActionsDisabled = _ref3[1];
109
107
  return (0, _react2.jsx)(_button.EuiButtonIcon, {
110
108
  className: className,
111
- "aria-label": allActions,
109
+ "aria-label": actionsDisabled ? allActionsDisabled : allActions,
110
+ title: actionsDisabled ? allActionsDisabled : undefined,
112
111
  iconType: "boxesHorizontal",
113
112
  color: "text",
114
- isDisabled: allDisabled,
113
+ isDisabled: actionsDisabled,
115
114
  onClick: function onClick() {
116
115
  return setPopoverOpen(function (isOpen) {
117
116
  return !isOpen;
@@ -120,7 +119,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
120
119
  "data-test-subj": "euiCollapsedItemActionsButton"
121
120
  });
122
121
  });
123
- var withTooltip = !allDisabled && (0, _react2.jsx)(_i18n.EuiI18n, {
122
+ var withTooltip = !actionsDisabled && (0, _react2.jsx)(_i18n.EuiI18n, {
124
123
  token: "euiCollapsedItemActions.allActions",
125
124
  default: "All actions"
126
125
  }, function (allActions) {
@@ -23,7 +23,7 @@ var ExpandedItemActions = function ExpandedItemActions(_ref) {
23
23
  var actions = _ref.actions,
24
24
  itemId = _ref.itemId,
25
25
  item = _ref.item,
26
- actionEnabled = _ref.actionEnabled,
26
+ actionsDisabled = _ref.actionsDisabled,
27
27
  className = _ref.className;
28
28
  var moreThanThree = actions.length > 2;
29
29
  return (0, _react2.jsx)(_react.default.Fragment, null, actions.reduce(function (tools, action, index) {
@@ -31,7 +31,7 @@ var ExpandedItemActions = function ExpandedItemActions(_ref) {
31
31
  if (!available) {
32
32
  return tools;
33
33
  }
34
- var enabled = actionEnabled(action);
34
+ var enabled = action.enabled == null || action.enabled(item);
35
35
  var key = "item_action_".concat(itemId, "_").concat(index);
36
36
  var classes = (0, _classnames.default)(className, {
37
37
  expandedItemActions__completelyHide: moreThanThree && index < 2
@@ -43,7 +43,7 @@ var ExpandedItemActions = function ExpandedItemActions(_ref) {
43
43
  className: classes,
44
44
  index: index,
45
45
  action: action,
46
- enabled: enabled,
46
+ enabled: enabled && !actionsDisabled,
47
47
  item: item
48
48
  }));
49
49
  } else {
@@ -51,7 +51,7 @@ var ExpandedItemActions = function ExpandedItemActions(_ref) {
51
51
  key: key,
52
52
  className: classes,
53
53
  action: action,
54
- enabled: enabled,
54
+ enabled: enabled && !actionsDisabled,
55
55
  item: item
56
56
  }));
57
57
  }
@@ -133,7 +133,8 @@ var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
133
133
  });
134
134
  },
135
135
  "aria-describedby": "".concat(sortingAriaId, " ").concat(actionsAriaId),
136
- ref: actionsButtonRef
136
+ ref: actionsButtonRef,
137
+ "data-test-subj": "dataGridHeaderCellActionButton-".concat(id)
137
138
  }, cellContent, (0, _react2.jsx)(_popover.EuiPopover, _extends({
138
139
  display: "block",
139
140
  panelPaddingSize: "none",
@@ -155,8 +156,7 @@ var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
155
156
  }, (0, _react2.jsx)(_icon.EuiIcon, {
156
157
  type: "boxesVertical",
157
158
  size: "s",
158
- color: "text",
159
- "data-test-subj": "dataGridHeaderCellActionButton-".concat(id)
159
+ color: "text"
160
160
  })),
161
161
  isOpen: isPopoverOpen,
162
162
  closePopover: function closePopover() {
@@ -77,7 +77,7 @@ var DragAndDrop = function DragAndDrop() {
77
77
  beforeEach(function () {
78
78
  cy.realMount((0, _react2.jsx)(DragAndDrop, null));
79
79
  });
80
- describe('EuiControlBar', function () {
80
+ describe('EuiDragDrop', function () {
81
81
  describe('Automated accessibility check', function () {
82
82
  it('has zero violations on render', function () {
83
83
  cy.checkAxe();
@@ -24,12 +24,12 @@ var _excluded = ["children", "className", "iconType", "iconSide", "color", "badg
24
24
  * Side Public License, v 1.
25
25
  */
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
28
27
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
28
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
30
29
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
30
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
32
31
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
32
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
33
33
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
34
34
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
35
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -75,6 +75,10 @@ var EuiFilterButton = function EuiFilterButton(_ref) {
75
75
  'euiFilterButton-hasActiveFilters': hasActiveFilters,
76
76
  'euiFilterButton-hasNotification': numFiltersDefined
77
77
  }, className);
78
+
79
+ /**
80
+ * Badge
81
+ */
78
82
  var showBadge = numFiltersDefined || numActiveFiltersDefined;
79
83
  var badgeCount = numActiveFilters || numFilters;
80
84
  var activeBadgeLabel = (0, _i18n.useEuiI18n)('euiFilterButton.filterBadgeActiveAriaLabel', '{count} active filters', {
@@ -83,9 +87,6 @@ var EuiFilterButton = function EuiFilterButton(_ref) {
83
87
  var availableBadgeLabel = (0, _i18n.useEuiI18n)('euiFilterButton.filterBadgeAvailableAriaLabel', '{count} available filters', {
84
88
  count: badgeCount
85
89
  });
86
- var buttonTextClassNames = (0, _classnames.default)('euiFilterButton__text', {
87
- 'euiFilterButton__text-hasNotification': showBadge
88
- }, textProps && textProps.className);
89
90
  var badgeContent = showBadge && (0, _react2.jsx)(_badge.EuiNotificationBadge, {
90
91
  className: "euiFilterButton__notification",
91
92
  css: [notificationStyles.euiFilterButton__notification, isDisabled && notificationStyles.disabled, ";label:badgeContent;"],
@@ -93,18 +94,27 @@ var EuiFilterButton = function EuiFilterButton(_ref) {
93
94
  color: isDisabled || !hasActiveFilters ? 'subdued' : badgeColor,
94
95
  role: "marquee" // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/marquee_role
95
96
  }, badgeCount);
97
+
98
+ /**
99
+ * Text
100
+ */
101
+ var buttonTextClassNames = (0, _classnames.default)('euiFilterButton__text', {
102
+ 'euiFilterButton__text-hasNotification': showBadge
103
+ }, textProps && textProps.className);
104
+ var textCssStyles = [textStyles.euiFilterButton__text, showBadge && textStyles.hasNotification, textProps && textProps.css];
96
105
  var _useInnerText = (0, _inner_text.useInnerText)(),
97
106
  _useInnerText2 = _slicedToArray(_useInnerText, 2),
98
107
  ref = _useInnerText2[0],
99
108
  innerText = _useInnerText2[1];
100
109
  var dataText = children && typeof children === 'string' ? children : innerText;
101
- var buttonContents = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
110
+ var textContent = (0, _react2.jsx)("span", _extends({
102
111
  ref: ref,
103
- className: "euiFilterButton__textShift",
104
- css: textStyles.euiFilterButton__textShift,
105
112
  "data-text": dataText,
106
113
  title: dataText
107
- }, children), badgeContent);
114
+ }, textProps, {
115
+ className: buttonTextClassNames,
116
+ css: textCssStyles
117
+ }), children);
108
118
  return (0, _react2.jsx)(_button_empty.EuiButtonEmpty, _extends({
109
119
  className: classes,
110
120
  css: cssStyles,
@@ -113,14 +123,11 @@ var EuiFilterButton = function EuiFilterButton(_ref) {
113
123
  iconSide: iconSide,
114
124
  iconType: iconType,
115
125
  type: type,
116
- textProps: _objectSpread(_objectSpread({}, textProps), {}, {
117
- className: buttonTextClassNames,
118
- css: [textStyles.euiFilterButton__text, showBadge && textStyles.hasNotification, textProps && textProps.css]
119
- }),
126
+ textProps: false,
120
127
  contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
121
128
  css: [contentStyles.euiFilterButton__content, iconType && contentStyles.hasIcon, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
122
129
  })
123
- }, rest), buttonContents);
130
+ }, rest), textContent, badgeContent);
124
131
  };
125
132
  exports.EuiFilterButton = EuiFilterButton;
126
133
  EuiFilterButton.propTypes = {
@@ -14,8 +14,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
14
14
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
15
  * Side Public License, v 1.
16
16
  */
17
- var euiFilterButtonDisplay = function euiFilterButtonDisplay(_ref5) {
18
- var euiTheme = _ref5.euiTheme;
17
+ var euiFilterButtonDisplay = function euiFilterButtonDisplay(_ref4) {
18
+ var euiTheme = _ref4.euiTheme;
19
19
  return {
20
20
  flex: '1 1 auto',
21
21
  minInlineSize: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
@@ -24,7 +24,7 @@ var euiFilterButtonDisplay = function euiFilterButtonDisplay(_ref5) {
24
24
  };
25
25
  };
26
26
  exports.euiFilterButtonDisplay = euiFilterButtonDisplay;
27
- var _ref4 = process.env.NODE_ENV === "production" ? {
27
+ var _ref3 = process.env.NODE_ENV === "production" ? {
28
28
  name: "jkp921-noGrow",
29
29
  styles: "flex-grow:0;label:noGrow;"
30
30
  } : {
@@ -43,9 +43,9 @@ var euiFilterButtonStyles = function euiFilterButtonStyles(euiThemeContext) {
43
43
  // Bottom borders are needed for responsive flex-wrap behavior
44
44
  var bottomBoxShadow = "0 ".concat(euiTheme.border.width.thin, " 0 0 ").concat(borderColor);
45
45
  return {
46
- euiFilterButton: /*#__PURE__*/(0, _react.css)(euiFilterButtonDisplay(euiThemeContext), " ", (0, _global_styling.logicalCSS)('height', controlHeight), " border-radius:0;box-shadow:", leftBoxShadow, ",", bottomBoxShadow, ";&:hover:not(:disabled),&:focus:not(:disabled){text-decoration:none;.euiFilterButton__textShift{text-decoration:underline;}}&:focus-visible{outline-offset:-", euiTheme.focus.width, ";};label:euiFilterButton;"),
46
+ euiFilterButton: /*#__PURE__*/(0, _react.css)(euiFilterButtonDisplay(euiThemeContext), " ", (0, _global_styling.logicalCSS)('height', controlHeight), " border-radius:0;box-shadow:", leftBoxShadow, ",", bottomBoxShadow, ";&:hover:not(:disabled),&:focus:not(:disabled){text-decoration:none;.euiFilterButton__text{text-decoration:underline;}}&:focus-visible{outline-offset:-", euiTheme.focus.width, ";};label:euiFilterButton;"),
47
47
  withNext: /*#__PURE__*/(0, _react.css)("&+.euiFilterButton{", (0, _global_styling.logicalCSS)('margin-left', "-".concat(euiTheme.size.xs)), "box-shadow:", bottomBoxShadow, ";};label:withNext;"),
48
- noGrow: _ref4,
48
+ noGrow: _ref3,
49
49
  hasNotification: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
50
50
  return x * 6;
51
51
  })), ";;label:hasNotification;"),
@@ -69,27 +69,18 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
69
69
  styles: "cursor:inherit;label:euiFilterButton__notification;",
70
70
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
71
71
  };
72
- var _ref3 = process.env.NODE_ENV === "production" ? {
73
- name: "f0jxzj-hasIcon",
74
- styles: "justify-content:space-between;label:hasIcon;"
75
- } : {
76
- name: "f0jxzj-hasIcon",
77
- styles: "justify-content:space-between;label:hasIcon;",
78
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
79
- };
80
- var euiFilterButtonChildStyles = function euiFilterButtonChildStyles(_ref6) {
81
- var euiTheme = _ref6.euiTheme;
72
+ var euiFilterButtonChildStyles = function euiFilterButtonChildStyles(_ref5) {
73
+ var euiTheme = _ref5.euiTheme;
82
74
  return {
83
75
  content: {
84
76
  euiFilterButton__content: /*#__PURE__*/(0, _react.css)(";label:euiFilterButton__content;"),
85
- hasIcon: _ref3
77
+ hasIcon: /*#__PURE__*/(0, _react.css)("&>.euiIcon:last-child{", (0, _global_styling.logicalCSS)('margin-left', 'auto'), ";};label:hasIcon;")
86
78
  },
87
79
  text: {
88
- euiFilterButton__text: /*#__PURE__*/(0, _react.css)(";label:euiFilterButton__text;"),
89
- hasNotification: /*#__PURE__*/(0, _react.css)("display:flex;align-items:center;gap:", euiTheme.size.s, ";;label:hasNotification;"),
90
- euiFilterButton__textShift: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextShift)('bold', 'data-text', euiTheme), " ", (0, _global_styling.euiTextTruncate)(), " ", (0, _global_styling.logicalCSS)('min-width', (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
80
+ euiFilterButton__text: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextShift)('bold', 'data-text', euiTheme), " ", (0, _global_styling.euiTextTruncate)(), ";;label:euiFilterButton__text;"),
81
+ hasNotification: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
91
82
  return x * 3;
92
- })), ";;label:euiFilterButton__textShift;")
83
+ })), ";;label:hasNotification;")
93
84
  },
94
85
  notification: {
95
86
  euiFilterButton__notification: _ref2,
@@ -122,18 +122,18 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
122
122
  */
123
123
  if (isPushed) {
124
124
  if (side === 'right') {
125
- document.body.style.paddingRight = "".concat(dimensions.width, "px");
125
+ document.body.style.paddingInlineEnd = "".concat(dimensions.width, "px");
126
126
  } else if (side === 'left') {
127
- document.body.style.paddingLeft = "".concat(dimensions.width, "px");
127
+ document.body.style.paddingInlineStart = "".concat(dimensions.width, "px");
128
128
  }
129
129
  }
130
130
  return function () {
131
131
  document.body.classList.remove('euiBody--hasFlyout');
132
132
  if (isPushed) {
133
133
  if (side === 'right') {
134
- document.body.style.paddingRight = '';
134
+ document.body.style.paddingInlineEnd = '';
135
135
  } else if (side === 'left') {
136
- document.body.style.paddingLeft = '';
136
+ document.body.style.paddingInlineStart = '';
137
137
  }
138
138
  }
139
139
  };
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EuiFlyoutResizable = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _services = require("../../services");
10
+ var _resizable_container = require("../resizable_container");
11
+ var _flyout = require("./flyout");
12
+ var _flyout_resizable = require("./flyout_resizable.styles");
13
+ var _react2 = require("@emotion/react");
14
+ var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
15
+ /*
16
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
+ * or more contributor license agreements. Licensed under the Elastic License
18
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
19
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
20
+ * Side Public License, v 1.
21
+ */
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
29
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
32
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
33
+ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
34
+ var size = _ref.size,
35
+ maxWidth = _ref.maxWidth,
36
+ _ref$minWidth = _ref.minWidth,
37
+ minWidth = _ref$minWidth === void 0 ? 200 : _ref$minWidth,
38
+ _ref$side = _ref.side,
39
+ side = _ref$side === void 0 ? 'right' : _ref$side,
40
+ children = _ref.children,
41
+ rest = _objectWithoutProperties(_ref, _excluded);
42
+ var euiTheme = (0, _services.useEuiTheme)();
43
+ var styles = (0, _flyout_resizable.euiFlyoutResizableButtonStyles)(euiTheme);
44
+ var cssStyles = [styles.euiFlyoutResizableButton, styles[side]];
45
+ var getFlyoutMinMaxWidth = (0, _react.useCallback)(function (width) {
46
+ return Math.min(Math.max(width, minWidth), maxWidth || Infinity, window.innerWidth - 20 // Leave some offset
47
+ );
48
+ }, [minWidth, maxWidth]);
49
+ var _useState = (0, _react.useState)(0),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ flyoutWidth = _useState2[0],
52
+ setFlyoutWidth = _useState2[1];
53
+
54
+ // Must use state for the flyout ref in order for the useEffect to be correctly called after render
55
+ var _useState3 = (0, _react.useState)(null),
56
+ _useState4 = _slicedToArray(_useState3, 2),
57
+ flyoutRef = _useState4[0],
58
+ setFlyoutRef = _useState4[1];
59
+ var setRefs = (0, _services.useCombinedRefs)([setFlyoutRef, ref]);
60
+ (0, _react.useEffect)(function () {
61
+ setFlyoutWidth(flyoutRef ? getFlyoutMinMaxWidth(flyoutRef.offsetWidth) : 0);
62
+ }, [flyoutRef, getFlyoutMinMaxWidth, size]);
63
+
64
+ // Initial numbers to calculate from, on resize drag start
65
+ var initialWidth = (0, _react.useRef)(0);
66
+ var initialMouseX = (0, _react.useRef)(0);
67
+
68
+ // Account for flyout side and logical property direction
69
+ var direction = (0, _react.useMemo)(function () {
70
+ var modifier = side === 'right' ? -1 : 1;
71
+ if (flyoutRef) {
72
+ var languageDirection = window.getComputedStyle(flyoutRef).direction;
73
+ if (languageDirection === 'rtl') modifier *= -1;
74
+ }
75
+ return modifier;
76
+ }, [side, flyoutRef]);
77
+ var onMouseMove = (0, _react.useCallback)(function (e) {
78
+ var mouseOffset = getMouseOrTouchX(e) - initialMouseX.current;
79
+ var changedFlyoutWidth = initialWidth.current + mouseOffset * direction;
80
+ setFlyoutWidth(getFlyoutMinMaxWidth(changedFlyoutWidth));
81
+ }, [getFlyoutMinMaxWidth, direction]);
82
+ var onMouseUp = (0, _react.useCallback)(function () {
83
+ initialMouseX.current = 0;
84
+ window.removeEventListener('mousemove', onMouseMove);
85
+ window.removeEventListener('mouseup', onMouseUp);
86
+ window.removeEventListener('touchmove', onMouseMove);
87
+ window.removeEventListener('touchend', onMouseUp);
88
+ }, [onMouseMove]);
89
+ var onMouseDown = (0, _react.useCallback)(function (e) {
90
+ var _flyoutRef$offsetWidt;
91
+ initialMouseX.current = getMouseOrTouchX(e);
92
+ initialWidth.current = (_flyoutRef$offsetWidt = flyoutRef === null || flyoutRef === void 0 ? void 0 : flyoutRef.offsetWidth) !== null && _flyoutRef$offsetWidt !== void 0 ? _flyoutRef$offsetWidt : 0;
93
+
94
+ // Window event listeners instead of React events are used
95
+ // in case the user's mouse leaves the component
96
+ window.addEventListener('mousemove', onMouseMove);
97
+ window.addEventListener('mouseup', onMouseUp);
98
+ window.addEventListener('touchmove', onMouseMove);
99
+ window.addEventListener('touchend', onMouseUp);
100
+ }, [flyoutRef, onMouseMove, onMouseUp]);
101
+ var onKeyDown = (0, _react.useCallback)(function (e) {
102
+ var KEYBOARD_OFFSET = 10;
103
+ switch (e.key) {
104
+ case _services.keys.ARROW_RIGHT:
105
+ e.preventDefault(); // Safari+VO will screen reader navigate off the button otherwise
106
+ setFlyoutWidth(function (flyoutWidth) {
107
+ return getFlyoutMinMaxWidth(flyoutWidth + KEYBOARD_OFFSET * direction);
108
+ });
109
+ break;
110
+ case _services.keys.ARROW_LEFT:
111
+ e.preventDefault(); // Safari+VO will screen reader navigate off the button otherwise
112
+ setFlyoutWidth(function (flyoutWidth) {
113
+ return getFlyoutMinMaxWidth(flyoutWidth - KEYBOARD_OFFSET * direction);
114
+ });
115
+ }
116
+ }, [getFlyoutMinMaxWidth, direction]);
117
+ return (0, _react2.jsx)(_flyout.EuiFlyout, _extends({}, rest, {
118
+ size: flyoutWidth || size,
119
+ maxWidth: maxWidth,
120
+ side: side,
121
+ ref: setRefs
122
+ }), (0, _react2.jsx)(_resizable_container.EuiResizableButton, {
123
+ isHorizontal: true,
124
+ css: cssStyles,
125
+ onMouseDown: onMouseDown,
126
+ onTouchStart: onMouseDown,
127
+ onKeyDown: onKeyDown
128
+ }), children);
129
+ });
130
+ exports.EuiFlyoutResizable = EuiFlyoutResizable;
131
+ EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
132
+ var getMouseOrTouchX = function getMouseOrTouchX(e) {
133
+ // Some Typescript fooling is needed here
134
+ var x = e.targetTouches ? e.targetTouches[0].pageX : e.pageX;
135
+ return x;
136
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutResizableButtonStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../global_styling");
9
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
10
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
11
+ * or more contributor license agreements. Licensed under the Elastic License
12
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
13
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
14
+ * Side Public License, v 1.
15
+ */
16
+ var _ref = process.env.NODE_ENV === "production" ? {
17
+ name: "6syi0e-euiFlyoutResizableButton",
18
+ styles: "position:absolute;&::before,&::after{background-color:transparent;};label:euiFlyoutResizableButton;"
19
+ } : {
20
+ name: "6syi0e-euiFlyoutResizableButton",
21
+ styles: "position:absolute;&::before,&::after{background-color:transparent;};label:euiFlyoutResizableButton;",
22
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
23
+ };
24
+ var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(_ref2) {
25
+ var euiTheme = _ref2.euiTheme;
26
+ return {
27
+ euiFlyoutResizableButton: _ref,
28
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', "-".concat(euiTheme.border.width.thin)), ";;label:left;"),
29
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', "-".concat(euiTheme.border.width.thin)), ";;label:right;")
30
+ };
31
+ };
32
+ exports.euiFlyoutResizableButtonStyles = euiFlyoutResizableButtonStyles;
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "EuiFlyoutHeader", {
27
27
  return _flyout_header.EuiFlyoutHeader;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "EuiFlyoutResizable", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _flyout_resizable.EuiFlyoutResizable;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "euiFlyoutSlideInLeft", {
31
37
  enumerable: true,
32
38
  get: function get() {
@@ -43,4 +49,5 @@ var _flyout = require("./flyout");
43
49
  var _flyout_body = require("./flyout_body");
44
50
  var _flyout_footer = require("./flyout_footer");
45
51
  var _flyout_header = require("./flyout_header");
46
- var _flyout2 = require("./flyout.styles");
52
+ var _flyout2 = require("./flyout.styles");
53
+ var _flyout_resizable = require("./flyout_resizable");