@elastic/eui 116.3.1 → 116.4.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 (183) hide show
  1. package/es/components/banner/banner.js +1 -2
  2. package/es/components/banner/banner.styles.js +1 -1
  3. package/es/components/basic_table/basic_table.js +35 -5
  4. package/es/components/basic_table/basic_table.styles.js +19 -1
  5. package/es/components/basic_table/in_memory_table.js +17 -0
  6. package/es/components/basic_table/index.js +2 -1
  7. package/es/components/basic_table/pagination_bar.js +19 -4
  8. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  9. package/es/components/basic_table/panel.styles.js +14 -0
  10. package/es/components/basic_table/use_panel_props.js +28 -0
  11. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  12. package/es/components/flyout/flyout.component.js +10 -6
  13. package/es/components/flyout/flyout_menu.js +122 -19
  14. package/es/components/flyout/flyout_menu.styles.js +2 -1
  15. package/es/components/flyout/manager/actions.js +20 -0
  16. package/es/components/flyout/manager/flyout_child.js +23 -1
  17. package/es/components/flyout/manager/flyout_managed.js +65 -19
  18. package/es/components/flyout/manager/hooks.js +1 -1
  19. package/es/components/flyout/manager/index.js +2 -2
  20. package/es/components/flyout/manager/reducer.js +32 -8
  21. package/es/components/flyout/manager/selectors.js +8 -2
  22. package/es/components/flyout/manager/store.js +35 -2
  23. package/es/components/flyout/use_flyout_menu.js +2 -2
  24. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  25. package/es/components/notification_icon/assets/info_fill.js +34 -0
  26. package/es/components/notification_icon/assets/warning_static.js +40 -0
  27. package/es/components/notification_icon/notification_icon.js +87 -0
  28. package/es/components/notification_icon/notification_icon.styles.js +22 -0
  29. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  30. package/es/components/toast/global_toast_list.js +132 -6
  31. package/es/components/toast/global_toast_list.styles.js +31 -7
  32. package/es/components/toast/toast.js +242 -47
  33. package/es/components/toast/toast.styles.js +35 -47
  34. package/es/components/toast/toast_action.js +34 -0
  35. package/es/components/toast/types.js +9 -0
  36. package/es/components/tool_tip/tool_tip.js +3 -3
  37. package/eui.d.ts +1203 -971
  38. package/i18ntokens.json +1582 -1546
  39. package/lib/components/banner/banner.js +1 -2
  40. package/lib/components/banner/banner.styles.js +1 -1
  41. package/lib/components/basic_table/basic_table.js +34 -4
  42. package/lib/components/basic_table/basic_table.styles.js +19 -1
  43. package/lib/components/basic_table/in_memory_table.js +17 -0
  44. package/lib/components/basic_table/index.js +8 -1
  45. package/lib/components/basic_table/pagination_bar.js +19 -4
  46. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  47. package/lib/components/basic_table/panel.styles.js +20 -0
  48. package/lib/components/basic_table/use_panel_props.js +33 -0
  49. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  50. package/lib/components/flyout/flyout.component.js +10 -6
  51. package/lib/components/flyout/flyout_menu.js +120 -19
  52. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  53. package/lib/components/flyout/manager/actions.js +21 -1
  54. package/lib/components/flyout/manager/flyout_child.js +23 -1
  55. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  56. package/lib/components/flyout/manager/hooks.js +6 -0
  57. package/lib/components/flyout/manager/index.js +12 -0
  58. package/lib/components/flyout/manager/reducer.js +31 -7
  59. package/lib/components/flyout/manager/selectors.js +9 -3
  60. package/lib/components/flyout/manager/store.js +34 -1
  61. package/lib/components/flyout/use_flyout_menu.js +2 -2
  62. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  63. package/lib/components/notification_icon/assets/info_fill.js +41 -0
  64. package/lib/components/notification_icon/assets/warning_static.js +47 -0
  65. package/lib/components/notification_icon/notification_icon.js +93 -0
  66. package/lib/components/notification_icon/notification_icon.styles.js +28 -0
  67. package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  68. package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  69. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  70. package/lib/components/toast/global_toast_list.js +132 -6
  71. package/lib/components/toast/global_toast_list.styles.js +31 -8
  72. package/lib/components/toast/toast.js +244 -47
  73. package/lib/components/toast/toast.styles.js +32 -45
  74. package/lib/components/toast/toast_action.js +40 -0
  75. package/lib/components/toast/types.js +15 -0
  76. package/lib/components/tool_tip/tool_tip.js +2 -2
  77. package/optimize/es/components/banner/banner.js +1 -2
  78. package/optimize/es/components/banner/banner.styles.js +1 -1
  79. package/optimize/es/components/basic_table/basic_table.js +18 -5
  80. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  81. package/optimize/es/components/basic_table/index.js +2 -1
  82. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  83. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  84. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  85. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  86. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  87. package/optimize/es/components/flyout/flyout.component.js +10 -6
  88. package/optimize/es/components/flyout/flyout_menu.js +99 -18
  89. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  90. package/optimize/es/components/flyout/manager/actions.js +20 -0
  91. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  92. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  93. package/optimize/es/components/flyout/manager/index.js +2 -2
  94. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  95. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  96. package/optimize/es/components/flyout/manager/store.js +35 -2
  97. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  98. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  99. package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
  100. package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
  101. package/optimize/es/components/notification_icon/notification_icon.js +77 -0
  102. package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
  103. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  104. package/optimize/es/components/toast/global_toast_list.js +31 -6
  105. package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
  106. package/optimize/es/components/toast/toast.js +143 -47
  107. package/optimize/es/components/toast/toast.styles.js +35 -47
  108. package/optimize/es/components/toast/toast_action.js +33 -0
  109. package/optimize/es/components/toast/types.js +9 -0
  110. package/optimize/es/components/tool_tip/tool_tip.js +3 -3
  111. package/optimize/lib/components/banner/banner.js +1 -2
  112. package/optimize/lib/components/banner/banner.styles.js +1 -1
  113. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  114. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  115. package/optimize/lib/components/basic_table/index.js +8 -1
  116. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  117. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  118. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  119. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  120. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  121. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  122. package/optimize/lib/components/flyout/flyout_menu.js +98 -18
  123. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  124. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  125. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  126. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  127. package/optimize/lib/components/flyout/manager/index.js +12 -0
  128. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  129. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  130. package/optimize/lib/components/flyout/manager/store.js +34 -1
  131. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  132. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  133. package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
  134. package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
  135. package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
  136. package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
  137. package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  138. package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  139. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  140. package/optimize/lib/components/toast/global_toast_list.js +31 -6
  141. package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
  142. package/optimize/lib/components/toast/toast.js +146 -47
  143. package/optimize/lib/components/toast/toast.styles.js +33 -45
  144. package/optimize/lib/components/toast/toast_action.js +39 -0
  145. package/optimize/lib/components/toast/types.js +15 -0
  146. package/optimize/lib/components/tool_tip/tool_tip.js +2 -2
  147. package/package.json +7 -5
  148. package/test-env/components/banner/banner.js +1 -2
  149. package/test-env/components/banner/banner.styles.js +1 -1
  150. package/test-env/components/basic_table/basic_table.js +34 -4
  151. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  152. package/test-env/components/basic_table/in_memory_table.js +17 -0
  153. package/test-env/components/basic_table/index.js +8 -1
  154. package/test-env/components/basic_table/pagination_bar.js +19 -4
  155. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  156. package/test-env/components/basic_table/panel.styles.js +20 -0
  157. package/test-env/components/basic_table/use_panel_props.js +33 -0
  158. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  159. package/test-env/components/flyout/flyout.component.js +10 -6
  160. package/test-env/components/flyout/flyout_menu.js +121 -19
  161. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  162. package/test-env/components/flyout/manager/actions.js +21 -1
  163. package/test-env/components/flyout/manager/flyout_child.js +23 -1
  164. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  165. package/test-env/components/flyout/manager/hooks.js +6 -0
  166. package/test-env/components/flyout/manager/index.js +12 -0
  167. package/test-env/components/flyout/manager/reducer.js +31 -7
  168. package/test-env/components/flyout/manager/selectors.js +9 -3
  169. package/test-env/components/flyout/manager/store.js +34 -1
  170. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  171. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  172. package/test-env/components/notification_icon/assets/info_fill.js +41 -0
  173. package/test-env/components/notification_icon/assets/warning_static.js +47 -0
  174. package/test-env/components/notification_icon/notification_icon.js +46 -0
  175. package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
  176. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  177. package/test-env/components/toast/global_toast_list.js +132 -6
  178. package/test-env/components/toast/global_toast_list.styles.js +30 -7
  179. package/test-env/components/toast/toast.js +242 -47
  180. package/test-env/components/toast/toast.styles.js +33 -45
  181. package/test-env/components/toast/toast_action.js +39 -0
  182. package/test-env/components/toast/types.js +15 -0
  183. package/test-env/components/tool_tip/tool_tip.js +2 -2
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -9,12 +8,7 @@ exports.isIconShape = exports.ICON_SIDES = exports.EuiFormControlLayoutIcons = v
9
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
- var _react = _interopRequireWildcard(require("react"));
11
+ var _react = _interopRequireDefault(require("react"));
18
12
  var _services = require("../../../services");
19
13
  var _icon = require("../../icon");
20
14
  var _loading = require("../../loading");
@@ -23,10 +17,7 @@ var _form_control_layout_custom_icon = require("./form_control_layout_custom_ico
23
17
  var _form_control_layout_icons = require("./form_control_layout_icons.styles");
24
18
  var _react2 = require("@emotion/react");
25
19
  var _excluded = ["ref", "side"];
26
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
29
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*
20
+ /*
30
21
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
31
22
  * or more contributor license agreements. Licensed under the Elastic License
32
23
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
@@ -37,111 +28,99 @@ var ICON_SIDES = exports.ICON_SIDES = ['left', 'right'];
37
28
  var isIconShape = exports.isIconShape = function isIconShape(icon) {
38
29
  return !!icon && icon.hasOwnProperty('type');
39
30
  };
40
- var EuiFormControlLayoutIcons = exports.EuiFormControlLayoutIcons = /*#__PURE__*/function (_Component) {
41
- function EuiFormControlLayoutIcons() {
42
- (0, _classCallCheck2.default)(this, EuiFormControlLayoutIcons);
43
- return _callSuper(this, EuiFormControlLayoutIcons, arguments);
31
+ var EuiFormControlLayoutIcons = exports.EuiFormControlLayoutIcons = function EuiFormControlLayoutIcons(_ref) {
32
+ var _ref$side = _ref.side,
33
+ side = _ref$side === void 0 ? 'left' : _ref$side,
34
+ _ref$iconsPosition = _ref.iconsPosition,
35
+ iconsPosition = _ref$iconsPosition === void 0 ? 'absolute' : _ref$iconsPosition,
36
+ compressed = _ref.compressed,
37
+ isDisabled = _ref.isDisabled,
38
+ icon = _ref.icon,
39
+ clear = _ref.clear,
40
+ isLoading = _ref.isLoading,
41
+ isInvalid = _ref.isInvalid,
42
+ isDropdown = _ref.isDropdown;
43
+ var euiThemeContext = (0, _services.useEuiTheme)();
44
+ var styles = (0, _form_control_layout_icons.euiFormControlLayoutIconsStyles)(euiThemeContext);
45
+ var cssStyles = [styles.euiFormControlLayoutIcons, compressed ? styles.compressed : styles.uncompressed].concat((0, _toConsumableArray2.default)(iconsPosition === 'absolute' ? [styles.position.absolute.absolute, compressed ? styles.position.absolute.compressed[side] : styles.position.absolute.uncompressed[side]] : [styles.position.static.static, compressed ? styles.position.static.compressed : styles.position.static.uncompressed]), [isDisabled && styles.disabled]);
46
+ return (0, _react2.jsx)("div", {
47
+ css: cssStyles,
48
+ className: "euiFormControlLayoutIcons"
49
+ }, (0, _react2.jsx)(ClearButton, {
50
+ clear: clear,
51
+ isDisabled: isDisabled
52
+ }), (0, _react2.jsx)(LoadingSpinner, {
53
+ isLoading: isLoading
54
+ }), (0, _react2.jsx)(InvalidIcon, {
55
+ isInvalid: isInvalid
56
+ }), (0, _react2.jsx)(CustomIcon, {
57
+ icon: icon,
58
+ isDisabled: isDisabled
59
+ }), (0, _react2.jsx)(DropdownIcon, {
60
+ isDropdown: isDropdown,
61
+ isDisabled: isDisabled
62
+ }));
63
+ };
64
+ var CustomIcon = function CustomIcon(_ref2) {
65
+ var icon = _ref2.icon,
66
+ isDisabled = _ref2.isDisabled;
67
+ if (!icon) {
68
+ return null;
44
69
  }
45
- (0, _inherits2.default)(EuiFormControlLayoutIcons, _Component);
46
- return (0, _createClass2.default)(EuiFormControlLayoutIcons, [{
47
- key: "render",
48
- value: function render() {
49
- var _this$props = this.props,
50
- _this$props$side = _this$props.side,
51
- side = _this$props$side === void 0 ? 'left' : _this$props$side,
52
- _this$props$iconsPosi = _this$props.iconsPosition,
53
- iconsPosition = _this$props$iconsPosi === void 0 ? 'absolute' : _this$props$iconsPosi,
54
- compressed = _this$props.compressed,
55
- isDisabled = _this$props.isDisabled;
56
- var customIcon = this.renderCustomIcon();
57
- var loadingSpinner = this.renderLoadingSpinner();
58
- var clearButton = this.renderClearButton();
59
- var invalidIcon = this.renderInvalidIcon();
60
- var dropdownIcon = this.renderDropdownIcon();
61
- return (0, _react2.jsx)(_services.RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
62
- var styles = stylesMemoizer(_form_control_layout_icons.euiFormControlLayoutIconsStyles);
63
- var cssStyles = [styles.euiFormControlLayoutIcons, compressed ? styles.compressed : styles.uncompressed].concat((0, _toConsumableArray2.default)(iconsPosition === 'absolute' ? [styles.position.absolute.absolute, compressed ? styles.position.absolute.compressed[side] : styles.position.absolute.uncompressed[side]] : [styles.position.static.static, compressed ? styles.position.static.compressed : styles.position.static.uncompressed]), [isDisabled && styles.disabled]);
64
- return (0, _react2.jsx)("div", {
65
- css: cssStyles,
66
- className: "euiFormControlLayoutIcons"
67
- }, clearButton, loadingSpinner, invalidIcon, customIcon, dropdownIcon);
68
- });
69
- }
70
- }, {
71
- key: "renderCustomIcon",
72
- value: function renderCustomIcon() {
73
- var _this$props2 = this.props,
74
- icon = _this$props2.icon,
75
- isDisabled = _this$props2.isDisabled;
76
- if (!icon) {
77
- return null;
78
- }
79
70
 
80
- // Normalize the icon to an object if it's a string.
81
- var iconProps = isIconShape(icon) ? icon : {
82
- type: icon
83
- };
84
- var iconRef = iconProps.ref,
85
- side = iconProps.side,
86
- iconRest = (0, _objectWithoutProperties2.default)(iconProps, _excluded);
87
- return (0, _react2.jsx)(_form_control_layout_custom_icon.EuiFormControlLayoutCustomIcon, (0, _extends2.default)({
88
- size: "m",
89
- disabled: isDisabled,
90
- iconRef: iconRef
91
- }, iconRest));
92
- }
93
- }, {
94
- key: "renderDropdownIcon",
95
- value: function renderDropdownIcon() {
96
- var _this$props3 = this.props,
97
- isDropdown = _this$props3.isDropdown,
98
- isDisabled = _this$props3.isDisabled;
99
- if (!isDropdown) {
100
- return null;
101
- }
102
- return (0, _react2.jsx)(_form_control_layout_custom_icon.EuiFormControlLayoutCustomIcon, {
103
- size: "m",
104
- disabled: isDisabled,
105
- type: "chevronSingleDown"
106
- });
107
- }
108
- }, {
109
- key: "renderLoadingSpinner",
110
- value: function renderLoadingSpinner() {
111
- var isLoading = this.props.isLoading;
112
- if (!isLoading) {
113
- return null;
114
- }
115
- return (0, _react2.jsx)(_loading.EuiLoadingSpinner, {
116
- size: "m"
117
- });
118
- }
119
- }, {
120
- key: "renderClearButton",
121
- value: function renderClearButton() {
122
- var _this$props4 = this.props,
123
- clear = _this$props4.clear,
124
- isDisabled = _this$props4.isDisabled;
125
- if (!clear) {
126
- return null;
127
- }
128
- return (0, _react2.jsx)(_form_control_layout_clear_button.EuiFormControlLayoutClearButton, (0, _extends2.default)({
129
- size: "m",
130
- disabled: isDisabled
131
- }, clear));
132
- }
133
- }, {
134
- key: "renderInvalidIcon",
135
- value: function renderInvalidIcon() {
136
- var isInvalid = this.props.isInvalid;
137
- if (!isInvalid) {
138
- return null;
139
- }
140
- return (0, _react2.jsx)(_icon.EuiIcon, {
141
- size: "m",
142
- color: "danger",
143
- type: "warning"
144
- });
145
- }
146
- }]);
147
- }(_react.Component);
71
+ // Normalize the icon to an object if it's a string.
72
+ var iconProps = isIconShape(icon) ? icon : {
73
+ type: icon
74
+ };
75
+ var iconRef = iconProps.ref,
76
+ side = iconProps.side,
77
+ iconRest = (0, _objectWithoutProperties2.default)(iconProps, _excluded);
78
+ return (0, _react2.jsx)(_form_control_layout_custom_icon.EuiFormControlLayoutCustomIcon, (0, _extends2.default)({
79
+ size: "m",
80
+ disabled: isDisabled,
81
+ iconRef: iconRef
82
+ }, iconRest));
83
+ };
84
+ var DropdownIcon = function DropdownIcon(_ref3) {
85
+ var isDropdown = _ref3.isDropdown,
86
+ isDisabled = _ref3.isDisabled;
87
+ if (!isDropdown) {
88
+ return null;
89
+ }
90
+ return (0, _react2.jsx)(_form_control_layout_custom_icon.EuiFormControlLayoutCustomIcon, {
91
+ size: "m",
92
+ disabled: isDisabled,
93
+ type: "chevronSingleDown"
94
+ });
95
+ };
96
+ var LoadingSpinner = function LoadingSpinner(_ref4) {
97
+ var isLoading = _ref4.isLoading;
98
+ if (!isLoading) {
99
+ return null;
100
+ }
101
+ return (0, _react2.jsx)(_loading.EuiLoadingSpinner, {
102
+ size: "m"
103
+ });
104
+ };
105
+ var ClearButton = function ClearButton(_ref5) {
106
+ var clear = _ref5.clear,
107
+ isDisabled = _ref5.isDisabled;
108
+ if (!clear) {
109
+ return null;
110
+ }
111
+ return (0, _react2.jsx)(_form_control_layout_clear_button.EuiFormControlLayoutClearButton, (0, _extends2.default)({
112
+ size: "m",
113
+ disabled: isDisabled
114
+ }, clear));
115
+ };
116
+ var InvalidIcon = function InvalidIcon(_ref6) {
117
+ var isInvalid = _ref6.isInvalid;
118
+ if (!isInvalid) {
119
+ return null;
120
+ }
121
+ return (0, _react2.jsx)(_icon.EuiIcon, {
122
+ size: "m",
123
+ color: "danger",
124
+ type: "warning"
125
+ });
126
+ };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.icon = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _react2 = require("@emotion/react");
13
+ var _excluded = ["title", "titleId"];
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ var EuiIconInfoFill = function EuiIconInfoFill(_ref) {
25
+ var title = _ref.title,
26
+ titleId = _ref.titleId,
27
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
28
+ return (0, _react2.jsx)("svg", (0, _extends2.default)({
29
+ xmlns: "http://www.w3.org/2000/svg",
30
+ width: 16,
31
+ height: 16,
32
+ fill: "none",
33
+ viewBox: "0 0 16 16",
34
+ "aria-labelledby": titleId
35
+ }, props), title ? (0, _react2.jsx)("title", {
36
+ id: titleId
37
+ }, title) : null, (0, _react2.jsx)("path", {
38
+ d: "M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1ZM6.5 7v1h1v3H6v1h4v-1H8.5V7h-2ZM8 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
39
+ }));
40
+ };
41
+ var icon = exports.icon = EuiIconInfoFill;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.icon = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _react2 = require("@emotion/react");
13
+ var _excluded = ["title", "titleId"];
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ var EuiIconWarningStatic = function EuiIconWarningStatic(_ref) {
25
+ var title = _ref.title,
26
+ titleId = _ref.titleId,
27
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
28
+ return (0, _react2.jsx)("svg", (0, _extends2.default)({
29
+ xmlns: "http://www.w3.org/2000/svg",
30
+ width: 16,
31
+ height: 16,
32
+ fill: "none",
33
+ viewBox: "0 0 16 16",
34
+ "aria-labelledby": titleId
35
+ }, props), title ? (0, _react2.jsx)("title", {
36
+ id: titleId
37
+ }, title) : null, (0, _react2.jsx)("path", {
38
+ fill: "#FACB3D",
39
+ fillRule: "evenodd",
40
+ d: "M8 1a1 1 0 0 1 .863.496l7 12A1 1 0 0 1 15 15H1a1 1 0 0 1-.864-1.504l7-12A1 1 0 0 1 8 1Z",
41
+ clipRule: "evenodd"
42
+ }), (0, _react2.jsx)("path", {
43
+ fill: "#825803",
44
+ d: "M7 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0ZM7.5 10V5h1v5h-1Z"
45
+ }));
46
+ };
47
+ var icon = exports.icon = EuiIconWarningStatic;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.NOTIFICATION_ICONS_MAP = exports.EuiNotificationIcon = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _services = require("../../services");
13
+ var _icon = require("../icon/icon");
14
+ var _error_fill = require("../icon/assets/error_fill");
15
+ var _check_circle_fill = require("../icon/assets/check_circle_fill");
16
+ var _info_fill = require("./assets/info_fill");
17
+ var _warning_static = require("./assets/warning_static");
18
+ var _notification_icon = require("./notification_icon.styles");
19
+ var _react2 = require("@emotion/react");
20
+ var _excluded = ["className", "type", "size", "css"];
21
+ /*
22
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
+ * or more contributor license agreements. Licensed under the Elastic License
24
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
25
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
26
+ * Side Public License, v 1.
27
+ */
28
+ var TYPES = ['info', 'success', 'warning', 'error'];
29
+ var NOTIFICATION_ICONS_MAP = exports.NOTIFICATION_ICONS_MAP = {
30
+ info: {
31
+ name: 'infoFill',
32
+ icon: _info_fill.icon
33
+ },
34
+ success: {
35
+ name: 'checkCircleFill',
36
+ icon: _check_circle_fill.icon
37
+ },
38
+ warning: {
39
+ name: 'warningStatic',
40
+ icon: _warning_static.icon
41
+ },
42
+ error: {
43
+ name: 'errorFill',
44
+ icon: _error_fill.icon
45
+ }
46
+ };
47
+ var ICON_TYPES_MAP = {
48
+ info: {
49
+ icon: NOTIFICATION_ICONS_MAP.info.icon,
50
+ color: 'primary'
51
+ },
52
+ success: {
53
+ icon: NOTIFICATION_ICONS_MAP.success.icon,
54
+ color: 'success'
55
+ },
56
+ warning: {
57
+ icon: NOTIFICATION_ICONS_MAP.warning.icon
58
+ },
59
+ error: {
60
+ icon: NOTIFICATION_ICONS_MAP.error.icon,
61
+ color: 'danger'
62
+ }
63
+ };
64
+ var EuiNotificationIcon = exports.EuiNotificationIcon = function EuiNotificationIcon(_ref) {
65
+ var className = _ref.className,
66
+ type = _ref.type,
67
+ _ref$size = _ref.size,
68
+ size = _ref$size === void 0 ? 'm' : _ref$size,
69
+ css = _ref.css,
70
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
71
+ var Icon = ICON_TYPES_MAP[type];
72
+ var classes = (0, _classnames.default)('euiNotificationIcon', className);
73
+ var styles = (0, _services.useEuiMemoizedStyles)(_notification_icon.euiNotificationIconStyles);
74
+ var cssStyles = [styles.euiNotificationIcon, size === 'l' && styles.size[size], css];
75
+ return (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({}, rest, {
76
+ className: classes,
77
+ css: cssStyles,
78
+ type: Icon.icon,
79
+ color: Icon.color,
80
+ "aria-hidden": "true",
81
+ size: size
82
+ }));
83
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiNotificationIconStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _euiThemeCommon = require("@elastic/eui-theme-common");
9
+ /*
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
+
17
+ var euiNotificationIconStyles = exports.euiNotificationIconStyles = function euiNotificationIconStyles(_ref) {
18
+ var euiTheme = _ref.euiTheme;
19
+ var sizeL = (0, _euiThemeCommon.mathWithUnits)(euiTheme.size.base, function (x) {
20
+ return x * 1.25;
21
+ });
22
+ return {
23
+ euiNotificationIcon: /*#__PURE__*/(0, _react.css)(";label:euiNotificationIcon;"),
24
+ size: {
25
+ l: /*#__PURE__*/(0, _react.css)("block-size:", sizeL, ";inline-size:", sizeL, ";;label:l;")
26
+ }
27
+ };
28
+ };
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM6.5 7V8H7.5V11H6V12H10V11H8.5V7H6.5ZM8 4C7.44772 4 7 4.44772 7 5C7 5.55228 7.44772 6 8 6C8.55228 6 9 5.55228 9 5C9 4.44772 8.55228 4 8 4Z" />
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.00021 1C8.35577 1.00002 8.68427 1.18902 8.86349 1.49609L15.8635 13.4961C16.0439 13.8054 16.0457 14.1876 15.8674 14.498C15.6891 14.8085 15.3583 15 15.0002 15H1.00021C0.642148 15 0.311364 14.8085 0.133026 14.498C-0.0452792 14.1876 -0.0443711 13.8054 0.135956 13.4961L7.13596 1.49609C7.31517 1.18888 7.64455 1 8.00021 1Z" fill="#FACB3D"/>
3
+ <path d="M7.00024 12C7.00024 11.4477 7.44796 11 8.00024 11C8.5525 11 9.00024 11.4477 9.00024 12C9.00024 12.5523 8.5525 13 8.00024 13C7.44796 13 7.00024 12.5523 7.00024 12Z" fill="#825803"/>
4
+ <path d="M7.50024 10V5H8.50024V10H7.50024Z" fill="#825803"/>
5
+ </svg>
@@ -7,13 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiTableSortMobile = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
12
  var _react = _interopRequireWildcard(require("react"));
18
13
  var _classnames = _interopRequireDefault(require("classnames"));
19
14
  var _button_empty = require("../../button/button_empty");
@@ -23,87 +18,70 @@ var _i18n = require("../../i18n");
23
18
  var _table_sort_mobile_item = require("./table_sort_mobile_item");
24
19
  var _react2 = require("@emotion/react");
25
20
  var _excluded = ["className", "anchorPosition", "items"];
26
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
29
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*
21
+ /*
30
22
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
31
23
  * or more contributor license agreements. Licensed under the Elastic License
32
24
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
33
25
  * in compliance with, at your election, the Elastic License 2.0 or the Server
34
26
  * Side Public License, v 1.
35
27
  */
36
- var EuiTableSortMobile = exports.EuiTableSortMobile = /*#__PURE__*/function (_Component) {
37
- function EuiTableSortMobile() {
38
- var _this;
39
- (0, _classCallCheck2.default)(this, EuiTableSortMobile);
40
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
41
- args[_key] = arguments[_key];
42
- }
43
- _this = _callSuper(this, EuiTableSortMobile, [].concat(args));
44
- (0, _defineProperty2.default)(_this, "state", {
45
- isPopoverOpen: false
46
- });
47
- (0, _defineProperty2.default)(_this, "onButtonClick", function () {
48
- _this.setState({
49
- isPopoverOpen: !_this.state.isPopoverOpen
50
- });
51
- });
52
- (0, _defineProperty2.default)(_this, "closePopover", function () {
53
- _this.setState({
54
- isPopoverOpen: false
55
- });
56
- });
57
- // Aligns the button to the right even when it's the only element present
58
- (0, _defineProperty2.default)(_this, "euiTableSortMobileStyles", {
59
- marginInlineStart: 'auto',
60
- label: 'euiTableSortMobile'
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ // Aligns the button to the right even when it's the only element present
31
+ var euiTableSortMobileStyles = {
32
+ marginInlineStart: 'auto',
33
+ label: 'euiTableSortMobile'
34
+ };
35
+ var EuiTableSortMobile = exports.EuiTableSortMobile = function EuiTableSortMobile(_ref) {
36
+ var className = _ref.className,
37
+ anchorPosition = _ref.anchorPosition,
38
+ items = _ref.items,
39
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
40
+ var _useState = (0, _react.useState)(false),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ isPopoverOpen = _useState2[0],
43
+ setIsPopoverOpen = _useState2[1];
44
+ var classes = (0, _classnames.default)('euiTableSortMobile', className);
45
+ var onButtonClick = function onButtonClick() {
46
+ setIsPopoverOpen(function (isOpen) {
47
+ return !isOpen;
61
48
  });
62
- return _this;
63
- }
64
- (0, _inherits2.default)(EuiTableSortMobile, _Component);
65
- return (0, _createClass2.default)(EuiTableSortMobile, [{
66
- key: "render",
67
- value: function render() {
68
- var _this$props = this.props,
69
- className = _this$props.className,
70
- anchorPosition = _this$props.anchorPosition,
71
- items = _this$props.items,
72
- rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
73
- var classes = (0, _classnames.default)('euiTableSortMobile', className);
74
- var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
75
- iconType: "chevronSingleDown",
76
- iconSide: "right",
77
- onClick: this.onButtonClick.bind(this),
78
- flush: "right",
79
- size: "xs"
80
- }, (0, _react2.jsx)(_i18n.EuiI18n, {
81
- token: "euiTableSortMobile.sorting",
82
- default: "Sorting"
83
- }));
84
- var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
85
- button: mobileSortButton,
86
- isOpen: this.state.isPopoverOpen,
87
- closePopover: this.closePopover,
88
- anchorPosition: anchorPosition || 'downRight',
89
- panelPaddingSize: "none"
90
- }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
91
- style: {
92
- minWidth: 200
93
- },
94
- items: items && items.length ? items.map(function (item) {
95
- return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
96
- key: item.key,
97
- onSort: item.onSort,
98
- isSorted: item.isSorted,
99
- isSortAscending: item.isSortAscending
100
- }, item.name);
101
- }) : undefined
102
- }));
103
- return (0, _react2.jsx)("div", {
104
- className: classes,
105
- css: this.euiTableSortMobileStyles
106
- }, mobileSortPopover);
107
- }
108
- }]);
109
- }(_react.Component);
49
+ };
50
+ var closePopover = function closePopover() {
51
+ setIsPopoverOpen(false);
52
+ };
53
+ var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
54
+ iconType: "chevronSingleDown",
55
+ iconSide: "right",
56
+ onClick: onButtonClick,
57
+ flush: "right",
58
+ size: "xs"
59
+ }, (0, _react2.jsx)(_i18n.EuiI18n, {
60
+ token: "euiTableSortMobile.sorting",
61
+ default: "Sorting"
62
+ }));
63
+ var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
64
+ button: mobileSortButton,
65
+ isOpen: isPopoverOpen,
66
+ closePopover: closePopover,
67
+ anchorPosition: anchorPosition || 'downRight',
68
+ panelPaddingSize: "none"
69
+ }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
70
+ style: {
71
+ minWidth: 200
72
+ },
73
+ items: items !== null && items !== void 0 && items.length ? items.map(function (item) {
74
+ return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
75
+ key: item.key,
76
+ onSort: item.onSort,
77
+ isSorted: item.isSorted,
78
+ isSortAscending: item.isSortAscending
79
+ }, item.name);
80
+ }) : undefined
81
+ }));
82
+ return (0, _react2.jsx)("div", {
83
+ className: classes,
84
+ css: euiTableSortMobileStyles
85
+ }, mobileSortPopover);
86
+ };
87
+ EuiTableSortMobile.displayName = 'EuiTableSortMobile';