@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.
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -513
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -513
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +25 -22
- package/es/components/basic_table/collapsed_item_actions.js +14 -15
- package/es/components/basic_table/expanded_item_actions.js +4 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/es/components/filter_group/filter_button.js +20 -13
- package/es/components/filter_group/filter_button.styles.js +11 -20
- package/es/components/flyout/flyout.js +4 -4
- package/es/components/flyout/flyout_resizable.js +127 -0
- package/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/es/components/flyout/index.js +2 -1
- package/es/components/form/range/dual_range.js +15 -66
- package/es/components/form/range/range.js +6 -5
- package/es/components/form/range/range_slider.js +28 -22
- package/es/components/form/text_area/text_area.js +39 -3
- package/es/components/index.js +0 -2
- package/es/components/markdown_editor/markdown_editor.js +12 -13
- package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
- package/es/components/tree_view/tree_view.js +23 -25
- package/es/utils/prop_types/is.js +2 -2
- package/eui.d.ts +830 -1145
- package/i18ntokens.json +121 -373
- package/lib/components/basic_table/basic_table.js +25 -22
- package/lib/components/basic_table/collapsed_item_actions.js +14 -15
- package/lib/components/basic_table/expanded_item_actions.js +4 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/lib/components/filter_group/filter_button.js +20 -13
- package/lib/components/filter_group/filter_button.styles.js +11 -20
- package/lib/components/flyout/flyout.js +4 -4
- package/lib/components/flyout/flyout_resizable.js +136 -0
- package/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/lib/components/flyout/index.js +8 -1
- package/lib/components/form/range/dual_range.js +15 -66
- package/lib/components/form/range/range.js +6 -5
- package/lib/components/form/range/range_slider.js +27 -21
- package/lib/components/form/text_area/text_area.js +42 -3
- package/lib/components/index.js +0 -22
- package/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/lib/components/pagination/pagination_button.js +79 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/tree_view/tree_view.js +23 -25
- package/lib/utils/prop_types/is.js +2 -2
- package/optimize/es/components/basic_table/basic_table.js +25 -22
- package/optimize/es/components/basic_table/collapsed_item_actions.js +14 -15
- package/optimize/es/components/basic_table/expanded_item_actions.js +4 -4
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/es/components/filter_group/filter_button.js +20 -13
- package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/es/components/flyout/flyout.js +4 -4
- package/optimize/es/components/flyout/flyout_resizable.js +121 -0
- package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/optimize/es/components/flyout/index.js +2 -1
- package/optimize/es/components/form/range/dual_range.js +15 -66
- package/optimize/es/components/form/range/range.js +6 -5
- package/optimize/es/components/form/range/range_slider.js +26 -21
- package/optimize/es/components/form/text_area/text_area.js +29 -3
- package/optimize/es/components/index.js +0 -2
- package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/es/components/tree_view/tree_view.js +23 -25
- package/optimize/es/utils/prop_types/is.js +2 -2
- package/optimize/lib/components/basic_table/basic_table.js +25 -22
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +14 -15
- package/optimize/lib/components/basic_table/expanded_item_actions.js +4 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/lib/components/filter_group/filter_button.js +20 -13
- package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/lib/components/flyout/flyout.js +4 -4
- package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
- package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/optimize/lib/components/flyout/index.js +8 -1
- package/optimize/lib/components/form/range/dual_range.js +15 -66
- package/optimize/lib/components/form/range/range.js +6 -5
- package/optimize/lib/components/form/range/range_slider.js +26 -21
- package/optimize/lib/components/form/text_area/text_area.js +32 -3
- package/optimize/lib/components/index.js +0 -22
- package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/lib/components/tree_view/tree_view.js +23 -25
- package/optimize/lib/utils/prop_types/is.js +2 -2
- package/package.json +3 -5
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +25 -22
- package/test-env/components/basic_table/collapsed_item_actions.js +14 -15
- package/test-env/components/basic_table/expanded_item_actions.js +4 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/test-env/components/filter_group/filter_button.js +20 -13
- package/test-env/components/filter_group/filter_button.styles.js +11 -20
- package/test-env/components/flyout/flyout_resizable.js +131 -0
- package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
- package/test-env/components/flyout/index.js +8 -1
- package/test-env/components/form/range/dual_range.js +15 -66
- package/test-env/components/form/range/range.js +6 -5
- package/test-env/components/form/range/range_slider.js +27 -21
- package/test-env/components/form/text_area/text_area.js +42 -3
- package/test-env/components/index.js +0 -22
- package/test-env/components/markdown_editor/markdown_editor.js +12 -13
- package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/test-env/components/pagination/pagination_button.js +79 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/tree_view/tree_view.js +23 -25
- package/test-env/utils/prop_types/is.js +2 -2
- package/es/components/control_bar/control_bar.a11y.js +0 -133
- package/es/components/control_bar/control_bar.js +0 -609
- package/es/components/control_bar/index.js +0 -9
- package/es/components/notification/index.js +0 -9
- package/es/components/notification/notification_event.a11y.js +0 -104
- package/es/components/notification/notification_event.js +0 -288
- package/es/components/notification/notification_event_messages.js +0 -79
- package/es/components/notification/notification_event_meta.js +0 -148
- package/es/components/notification/notification_event_read_button.js +0 -86
- package/es/components/notification/notification_event_read_icon.js +0 -77
- package/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/lib/components/control_bar/control_bar.js +0 -441
- package/lib/components/control_bar/index.js +0 -12
- package/lib/components/notification/index.js +0 -12
- package/lib/components/notification/notification_event.a11y.js +0 -105
- package/lib/components/notification/notification_event.js +0 -297
- package/lib/components/notification/notification_event_messages.js +0 -88
- package/lib/components/notification/notification_event_meta.js +0 -157
- package/lib/components/notification/notification_event_read_button.js +0 -93
- package/lib/components/notification/notification_event_read_icon.js +0 -64
- package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
- package/optimize/es/components/control_bar/control_bar.js +0 -308
- package/optimize/es/components/control_bar/index.js +0 -9
- package/optimize/es/components/notification/index.js +0 -9
- package/optimize/es/components/notification/notification_event.a11y.js +0 -99
- package/optimize/es/components/notification/notification_event.js +0 -114
- package/optimize/es/components/notification/notification_event_messages.js +0 -63
- package/optimize/es/components/notification/notification_event_meta.js +0 -106
- package/optimize/es/components/notification/notification_event_read_button.js +0 -44
- package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
- package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/optimize/lib/components/control_bar/control_bar.js +0 -301
- package/optimize/lib/components/control_bar/index.js +0 -12
- package/optimize/lib/components/notification/index.js +0 -12
- package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
- package/optimize/lib/components/notification/notification_event.js +0 -123
- package/optimize/lib/components/notification/notification_event_messages.js +0 -74
- package/optimize/lib/components/notification/notification_event_meta.js +0 -117
- package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
- package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
- package/src/components/control_bar/_control_bar.scss +0 -232
- package/src/components/control_bar/_index.scss +0 -2
- package/src/components/control_bar/_variables.scss +0 -12
- package/src/components/notification/_index.scss +0 -5
- package/src/components/notification/_notification_event.scss +0 -40
- package/src/components/notification/_notification_event_messages.scss +0 -17
- package/src/components/notification/_notification_event_meta.scss +0 -44
- package/src/components/notification/_notification_event_read_button.scss +0 -5
- package/src/components/notification/_notification_event_read_icon.scss +0 -12
- package/test-env/components/control_bar/control_bar.a11y.js +0 -134
- package/test-env/components/control_bar/control_bar.js +0 -436
- package/test-env/components/control_bar/index.js +0 -12
- package/test-env/components/notification/index.js +0 -12
- package/test-env/components/notification/notification_event.a11y.js +0 -105
- package/test-env/components/notification/notification_event.js +0 -296
- package/test-env/components/notification/notification_event_messages.js +0 -85
- package/test-env/components/notification/notification_event_meta.js +0 -154
- package/test-env/components/notification/notification_event_read_button.js +0 -92
- package/test-env/components/notification/notification_event_read_icon.js +0 -63
|
@@ -65,9 +65,10 @@ var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
65
65
|
_this.props.onChange(e, isValid);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
68
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setTrackWidth", function (_ref) {
|
|
69
|
+
var width = _ref.width;
|
|
69
70
|
_this.setState({
|
|
70
|
-
trackWidth:
|
|
71
|
+
trackWidth: width
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
74
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onInputFocus", function (e) {
|
|
@@ -111,8 +112,8 @@ var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
111
112
|
key: "render",
|
|
112
113
|
value: function render() {
|
|
113
114
|
var _this2 = this;
|
|
114
|
-
var
|
|
115
|
-
defaultFullWidth =
|
|
115
|
+
var _ref2 = this.context,
|
|
116
|
+
defaultFullWidth = _ref2.defaultFullWidth;
|
|
116
117
|
var _this$props = this.props,
|
|
117
118
|
className = _this$props.className,
|
|
118
119
|
compressed = _this$props.compressed,
|
|
@@ -218,7 +219,7 @@ var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
218
219
|
"aria-hidden": !!showInput,
|
|
219
220
|
thumbColor: thumbColor
|
|
220
221
|
}, rest, {
|
|
221
|
-
|
|
222
|
+
onResize: this.setTrackWidth
|
|
222
223
|
})), showRange && this.isValid && (0, _react2.jsx)(_range_highlight.EuiRangeHighlight, {
|
|
223
224
|
showTicks: showTicks,
|
|
224
225
|
min: Number(min),
|
|
@@ -13,10 +13,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _services = require("../../../services");
|
|
15
15
|
var _global_styling = require("../../../global_styling");
|
|
16
|
+
var _resize_observer = require("../../observer/resize_observer");
|
|
16
17
|
var _range_levels_colors = require("./range_levels_colors");
|
|
17
18
|
var _range_slider = require("./range_slider.styles");
|
|
18
19
|
var _react2 = require("@emotion/react");
|
|
19
|
-
var _excluded = ["className", "disabled", "id", "max", "min", "name", "step", "onChange", "tabIndex", "value", "style", "showTicks", "showRange", "thumbColor"];
|
|
20
|
+
var _excluded = ["className", "disabled", "id", "max", "min", "name", "step", "onChange", "tabIndex", "value", "style", "showTicks", "showRange", "thumbColor", "onResize"];
|
|
20
21
|
/*
|
|
21
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
22
23
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -28,7 +29,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
28
29
|
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; }
|
|
29
30
|
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; }
|
|
30
31
|
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) { (0, _defineProperty2.default)(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; }
|
|
31
|
-
var EuiRangeSlider =
|
|
32
|
+
var EuiRangeSlider = function EuiRangeSlider(_ref) {
|
|
32
33
|
var className = _ref.className,
|
|
33
34
|
disabled = _ref.disabled,
|
|
34
35
|
id = _ref.id,
|
|
@@ -43,6 +44,7 @@ var EuiRangeSlider = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
43
44
|
showTicks = _ref.showTicks,
|
|
44
45
|
showRange = _ref.showRange,
|
|
45
46
|
thumbColor = _ref.thumbColor,
|
|
47
|
+
onResize = _ref.onResize,
|
|
46
48
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
49
|
var classes = (0, _classnames.default)('euiRangeSlider', className);
|
|
48
50
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
@@ -54,22 +56,25 @@ var EuiRangeSlider = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
54
56
|
color: thumbColor && (0, _range_levels_colors.euiRangeLevelColor)(thumbColor, euiTheme.euiTheme)
|
|
55
57
|
}, style));
|
|
56
58
|
}, [thumbColor, euiTheme, style]);
|
|
57
|
-
return (0, _react2.jsx)(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
return (0, _react2.jsx)(_resize_observer.EuiResizeObserver, {
|
|
60
|
+
onResize: onResize
|
|
61
|
+
}, function (resizeRef) {
|
|
62
|
+
return (0, _react2.jsx)("input", (0, _extends2.default)({
|
|
63
|
+
ref: resizeRef,
|
|
64
|
+
type: "range",
|
|
65
|
+
id: id,
|
|
66
|
+
name: name,
|
|
67
|
+
className: classes,
|
|
68
|
+
css: cssStyles,
|
|
69
|
+
min: min,
|
|
70
|
+
max: max,
|
|
71
|
+
step: step,
|
|
72
|
+
value: value,
|
|
73
|
+
disabled: disabled,
|
|
74
|
+
onChange: onChange,
|
|
75
|
+
style: sliderStyle,
|
|
76
|
+
tabIndex: tabIndex
|
|
77
|
+
}, rest));
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.EuiRangeSlider = EuiRangeSlider;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.RESIZE = exports.EuiTextArea = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _services = require("../../../services");
|
|
12
14
|
var _form_control_layout = require("../form_control_layout");
|
|
13
15
|
var _validatable_control = require("../validatable_control");
|
|
14
16
|
var _eui_form_context = require("../eui_form_context");
|
|
15
17
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "inputRef", "isLoading", "isInvalid", "name", "placeholder", "resize", "rows"];
|
|
18
|
+
var _excluded = ["children", "className", "compressed", "fullWidth", "id", "icon", "inputRef", "isLoading", "isInvalid", "isClearable", "name", "placeholder", "resize", "rows"];
|
|
17
19
|
/*
|
|
18
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -21,6 +23,8 @@ var _excluded = ["children", "className", "compressed", "fullWidth", "id", "inpu
|
|
|
21
23
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
22
24
|
* Side Public License, v 1.
|
|
23
25
|
*/
|
|
26
|
+
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); }
|
|
27
|
+
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
28
|
var resizeToClassNameMap = {
|
|
25
29
|
vertical: 'euiTextArea--resizeVertical',
|
|
26
30
|
horizontal: 'euiTextArea--resizeHorizontal',
|
|
@@ -38,9 +42,11 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
38
42
|
_props$fullWidth = props.fullWidth,
|
|
39
43
|
fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
|
|
40
44
|
id = props.id,
|
|
45
|
+
icon = props.icon,
|
|
41
46
|
inputRef = props.inputRef,
|
|
42
47
|
isLoading = props.isLoading,
|
|
43
48
|
isInvalid = props.isInvalid,
|
|
49
|
+
isClearable = props.isClearable,
|
|
44
50
|
name = props.name,
|
|
45
51
|
placeholder = props.placeholder,
|
|
46
52
|
_props$resize = props.resize,
|
|
@@ -59,10 +65,33 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
59
65
|
} else {
|
|
60
66
|
definedRows = 6;
|
|
61
67
|
}
|
|
68
|
+
var ref = (0, _react.useRef)(null);
|
|
69
|
+
var refs = (0, _services.useCombinedRefs)([ref, inputRef]);
|
|
70
|
+
var clear = (0, _react.useMemo)(function () {
|
|
71
|
+
if (isClearable) {
|
|
72
|
+
return {
|
|
73
|
+
onClick: function onClick() {
|
|
74
|
+
if (ref.current) {
|
|
75
|
+
ref.current.value = '';
|
|
76
|
+
var event = new Event('input', {
|
|
77
|
+
bubbles: true,
|
|
78
|
+
cancelable: false
|
|
79
|
+
});
|
|
80
|
+
ref.current.dispatchEvent(event);
|
|
81
|
+
ref.current.focus(); // set focus back to the textarea
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
'data-test-subj': 'clearTextAreaButton'
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}, [isClearable]);
|
|
62
89
|
return (0, _react2.jsx)(_form_control_layout.EuiFormControlLayout, {
|
|
63
90
|
fullWidth: fullWidth,
|
|
64
91
|
isLoading: isLoading,
|
|
65
92
|
isInvalid: isInvalid,
|
|
93
|
+
clear: clear,
|
|
94
|
+
icon: icon,
|
|
66
95
|
className: "euiFormControlLayout--euiTextArea"
|
|
67
96
|
}, (0, _react2.jsx)(_validatable_control.EuiValidatableControl, {
|
|
68
97
|
isInvalid: isInvalid
|
|
@@ -72,7 +101,7 @@ var EuiTextArea = function EuiTextArea(props) {
|
|
|
72
101
|
rows: definedRows,
|
|
73
102
|
name: name,
|
|
74
103
|
id: id,
|
|
75
|
-
ref:
|
|
104
|
+
ref: refs,
|
|
76
105
|
placeholder: placeholder
|
|
77
106
|
}), children)));
|
|
78
107
|
};
|
|
@@ -223,17 +223,6 @@ Object.keys(_context_menu).forEach(function (key) {
|
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
|
-
var _control_bar = require("./control_bar");
|
|
227
|
-
Object.keys(_control_bar).forEach(function (key) {
|
|
228
|
-
if (key === "default" || key === "__esModule") return;
|
|
229
|
-
if (key in exports && exports[key] === _control_bar[key]) return;
|
|
230
|
-
Object.defineProperty(exports, key, {
|
|
231
|
-
enumerable: true,
|
|
232
|
-
get: function get() {
|
|
233
|
-
return _control_bar[key];
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
226
|
var _copy = require("./copy");
|
|
238
227
|
Object.keys(_copy).forEach(function (key) {
|
|
239
228
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -597,17 +586,6 @@ Object.keys(_mutation_observer).forEach(function (key) {
|
|
|
597
586
|
}
|
|
598
587
|
});
|
|
599
588
|
});
|
|
600
|
-
var _notification = require("./notification");
|
|
601
|
-
Object.keys(_notification).forEach(function (key) {
|
|
602
|
-
if (key === "default" || key === "__esModule") return;
|
|
603
|
-
if (key in exports && exports[key] === _notification[key]) return;
|
|
604
|
-
Object.defineProperty(exports, key, {
|
|
605
|
-
enumerable: true,
|
|
606
|
-
get: function get() {
|
|
607
|
-
return _notification[key];
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
});
|
|
611
589
|
var _outside_click_detector = require("./outside_click_detector");
|
|
612
590
|
Object.keys(_outside_click_detector).forEach(function (key) {
|
|
613
591
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -266,20 +266,19 @@ var EuiMarkdownEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
266
266
|
setEditorToolbarHeight(editorToolbarRef.current.offsetHeight);
|
|
267
267
|
}, [setEditorToolbarHeight]);
|
|
268
268
|
(0, _react.useEffect)(function () {
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
269
|
+
if (height === 'full' || currentHeight === 'full') return;
|
|
270
|
+
if (isPreviewing && autoExpandPreview && previewRef.current.scrollHeight > currentHeight) {
|
|
271
|
+
// scrollHeight does not include the border or margin
|
|
272
|
+
// so we ask for the computed value for those,
|
|
273
|
+
// which is always in pixels because getComputedValue
|
|
274
|
+
// returns the resolved values
|
|
275
|
+
var elementComputedStyle = window.getComputedStyle(previewRef.current);
|
|
276
|
+
var borderWidth = parseFloat(elementComputedStyle.borderTopWidth) + parseFloat(elementComputedStyle.borderBottomWidth);
|
|
277
|
+
var marginWidth = parseFloat(elementComputedStyle.marginTop) + parseFloat(elementComputedStyle.marginBottom);
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
279
|
+
// then add an extra pixel for safety and because the scrollHeight value is rounded
|
|
280
|
+
var extraHeight = borderWidth + marginWidth + 1;
|
|
281
|
+
setCurrentHeight(previewRef.current.scrollHeight + extraHeight);
|
|
283
282
|
}
|
|
284
283
|
}, [currentHeight, isPreviewing, height, autoExpandPreview]);
|
|
285
284
|
var previewHeight = height === 'full' ? "calc(100% - ".concat(editorFooterHeight, "px)") : currentHeight;
|
|
@@ -62,7 +62,7 @@ var _EuiPageBottomBar = function _EuiPageBottomBar(_ref2) {
|
|
|
62
62
|
// Hide the overflow in case of larger flex margins than padding
|
|
63
63
|
,
|
|
64
64
|
css: _ref
|
|
65
|
-
// Using
|
|
65
|
+
// Using object here because of the possible conflict with overriding props and position `sticky`
|
|
66
66
|
}, rest), (0, _react.jsx)(_page_section.EuiPageSection, {
|
|
67
67
|
paddingSize: paddingSize,
|
|
68
68
|
restrictWidth: restrictWidth
|
|
@@ -217,7 +217,7 @@ var EuiSelectableListItem = /*#__PURE__*/function (_Component) {
|
|
|
217
217
|
onFocusBadgeNode = (0, _react2.jsx)(_badge.EuiBadge, (0, _extends2.default)({
|
|
218
218
|
className: "euiSelectableListItem__onFocusBadge"
|
|
219
219
|
}, defaultOnFocusBadgeProps));
|
|
220
|
-
} else if (
|
|
220
|
+
} else if (typeof onFocusBadge !== 'boolean' && !!onFocusBadge) {
|
|
221
221
|
var _children = onFocusBadge.children,
|
|
222
222
|
_className = onFocusBadge.className,
|
|
223
223
|
restBadgeProps = (0, _objectWithoutProperties2.default)(onFocusBadge, _excluded2);
|
|
@@ -50,34 +50,12 @@ var displayToClassNameMap = {
|
|
|
50
50
|
var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
51
51
|
(0, _inherits2.default)(EuiTreeView, _Component);
|
|
52
52
|
var _super = _createSuper(EuiTreeView);
|
|
53
|
-
function EuiTreeView() {
|
|
53
|
+
function EuiTreeView(props, context) {
|
|
54
54
|
var _this;
|
|
55
55
|
(0, _classCallCheck2.default)(this, EuiTreeView);
|
|
56
|
-
|
|
57
|
-
args[_key] = arguments[_key];
|
|
58
|
-
}
|
|
59
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
56
|
+
_this = _super.call(this, props, context);
|
|
60
57
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "treeIdGenerator", (0, _services.htmlIdGenerator)('euiTreeView'));
|
|
61
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isNested",
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
63
|
-
openItems: _this.props.expandByDefault ? _this.props.items.map(function (_ref) {
|
|
64
|
-
var id = _ref.id,
|
|
65
|
-
children = _ref.children;
|
|
66
|
-
return children ? id : null;
|
|
67
|
-
}).filter(function (x) {
|
|
68
|
-
return x != null;
|
|
69
|
-
}) : _this.props.items.map(function (_ref2) {
|
|
70
|
-
var id = _ref2.id,
|
|
71
|
-
children = _ref2.children,
|
|
72
|
-
isExpanded = _ref2.isExpanded;
|
|
73
|
-
return children && isExpanded ? id : null;
|
|
74
|
-
}).filter(function (x) {
|
|
75
|
-
return x != null;
|
|
76
|
-
}),
|
|
77
|
-
activeItem: '',
|
|
78
|
-
treeID: getTreeId(_this.props.id, _this.context, _this.treeIdGenerator),
|
|
79
|
-
expandChildNodes: _this.props.expandByDefault || false
|
|
80
|
-
});
|
|
58
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isNested", void 0);
|
|
81
59
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "buttonRef", []);
|
|
82
60
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setButtonRef", function (ref, index) {
|
|
83
61
|
_this.buttonRef[index] = ref;
|
|
@@ -172,6 +150,26 @@ var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
|
172
150
|
_this.buttonRef[index].focus();
|
|
173
151
|
}
|
|
174
152
|
});
|
|
153
|
+
_this.isNested = !!_this.context;
|
|
154
|
+
_this.state = {
|
|
155
|
+
openItems: _this.props.expandByDefault ? _this.props.items.map(function (_ref) {
|
|
156
|
+
var id = _ref.id,
|
|
157
|
+
children = _ref.children;
|
|
158
|
+
return children ? id : null;
|
|
159
|
+
}).filter(function (x) {
|
|
160
|
+
return x != null;
|
|
161
|
+
}) : _this.props.items.map(function (_ref2) {
|
|
162
|
+
var id = _ref2.id,
|
|
163
|
+
children = _ref2.children,
|
|
164
|
+
isExpanded = _ref2.isExpanded;
|
|
165
|
+
return children && isExpanded ? id : null;
|
|
166
|
+
}).filter(function (x) {
|
|
167
|
+
return x != null;
|
|
168
|
+
}),
|
|
169
|
+
activeItem: '',
|
|
170
|
+
treeID: getTreeId(_this.props.id, context, _this.treeIdGenerator),
|
|
171
|
+
expandChildNodes: _this.props.expandByDefault || false
|
|
172
|
+
};
|
|
175
173
|
return _this;
|
|
176
174
|
}
|
|
177
175
|
(0, _createClass2.default)(EuiTreeView, [{
|
|
@@ -18,7 +18,7 @@ var is = function is(expectedValue) {
|
|
|
18
18
|
var compName = componentName || 'ANONYMOUS';
|
|
19
19
|
var value = props[propName];
|
|
20
20
|
if (value !== expectedValue) {
|
|
21
|
-
return new Error("[".concat(propName, "] property in [").concat(compName, "] component is expected to equal [").concat(expectedValue, "] but\n [").concat(value, "] was provided instead."));
|
|
21
|
+
return new Error("[".concat(propName.toString(), "] property in [").concat(compName, "] component is expected to equal [").concat(expectedValue, "] but\n [").concat(value, "] was provided instead."));
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
};
|
|
@@ -26,7 +26,7 @@ var is = function is(expectedValue) {
|
|
|
26
26
|
var compName = componentName || 'ANONYMOUS';
|
|
27
27
|
var value = props[propName];
|
|
28
28
|
if ((0, _predicate.isNil)(value)) {
|
|
29
|
-
return new Error("[".concat(propName, "] property in [").concat(compName, "] component is required but seems to be missing"));
|
|
29
|
+
return new Error("[".concat(propName.toString(), "] property in [").concat(compName, "] component is required but seems to be missing"));
|
|
30
30
|
}
|
|
31
31
|
return validator(props, propName, componentName);
|
|
32
32
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "92.0.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
8
8
|
"types": "eui.d.ts",
|
|
9
|
-
"docker_image": "20.
|
|
9
|
+
"docker_image": "20.10.0",
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": "16.x || 18.x || >=20.x"
|
|
12
12
|
},
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
18
|
"start": "cross-env BABEL_MODULES=false webpack serve --config=src-docs/webpack.config.js",
|
|
19
|
-
"test-docker": "node ./scripts/test-docker.js",
|
|
20
|
-
"test-a11y-docker": "node ./scripts/test-a11y-docker.js",
|
|
21
19
|
"build-docs": "cross-env BABEL_MODULES=false cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 webpack --config=src-docs/webpack.config.js",
|
|
22
20
|
"build": "yarn extract-i18n-strings && node ./scripts/compile-clean.js && node ./scripts/compile-eui.js && yarn compile-scss",
|
|
23
21
|
"build-pack": "yarn build && npm pack",
|
|
@@ -111,7 +109,7 @@
|
|
|
111
109
|
"@cypress/react": "^7.0.3",
|
|
112
110
|
"@cypress/react18": "^2.0.0",
|
|
113
111
|
"@cypress/webpack-dev-server": "^1.7.0",
|
|
114
|
-
"@elastic/charts": "^
|
|
112
|
+
"@elastic/charts": "^61.2.0",
|
|
115
113
|
"@elastic/datemath": "^5.0.3",
|
|
116
114
|
"@emotion/babel-preset-css-prop": "^11.11.0",
|
|
117
115
|
"@emotion/cache": "^11.11.0",
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
@import 'color_picker/index';
|
|
4
4
|
@import 'combo_box/index';
|
|
5
|
-
@import 'control_bar/index';
|
|
6
5
|
@import 'date_picker/index';
|
|
7
6
|
@import 'datagrid/index';
|
|
8
7
|
@import 'empty_prompt/index';
|
|
9
8
|
@import 'form/index';
|
|
10
9
|
@import 'markdown_editor/index';
|
|
11
|
-
@import 'notification/index';
|
|
12
10
|
@import 'tree_view/index';
|
|
13
11
|
@import 'side_nav/index';
|
|
14
12
|
@import 'search_bar/index';
|
|
@@ -431,7 +431,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
431
431
|
var sortDirection = _this2.resolveColumnSortDirection(column);
|
|
432
432
|
items.push({
|
|
433
433
|
name: column.name,
|
|
434
|
-
key: "_data_s_".concat(column.field, "_").concat(index),
|
|
434
|
+
key: "_data_s_".concat(String(column.field), "_").concat(index),
|
|
435
435
|
onSort: _this2.resolveColumnOnSort(column),
|
|
436
436
|
isSorted: !!sortDirection,
|
|
437
437
|
isSortAscending: sortDirection ? _services.SortDirection.isAsc(sortDirection) : undefined
|
|
@@ -584,11 +584,11 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
headers.push((0, _react2.jsx)(_table.EuiTableHeaderCell, (0, _extends2.default)({
|
|
587
|
-
key: "_data_h_".concat(field, "_").concat(index),
|
|
587
|
+
key: "_data_h_".concat(String(field), "_").concat(index),
|
|
588
588
|
align: columnAlign,
|
|
589
589
|
width: width,
|
|
590
590
|
mobileOptions: mobileOptions,
|
|
591
|
-
"data-test-subj": "tableHeaderCell_".concat(field, "_").concat(index),
|
|
591
|
+
"data-test-subj": "tableHeaderCell_".concat(String(field), "_").concat(index),
|
|
592
592
|
description: description
|
|
593
593
|
}, sorting), name));
|
|
594
594
|
});
|
|
@@ -625,7 +625,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
625
625
|
|
|
626
626
|
if (footer) {
|
|
627
627
|
footers.push((0, _react2.jsx)(_table.EuiTableFooterCell, {
|
|
628
|
-
key: "footer_".concat(field, "_").concat(footers.length - 1),
|
|
628
|
+
key: "footer_".concat(String(field), "_").concat(footers.length - 1),
|
|
629
629
|
align: align
|
|
630
630
|
}, footer));
|
|
631
631
|
hasDefinedFooter = true;
|
|
@@ -808,19 +808,22 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
808
808
|
}, {
|
|
809
809
|
key: "renderItemActionsCell",
|
|
810
810
|
value: function renderItemActionsCell(itemId, item, column, columnIndex) {
|
|
811
|
-
|
|
812
|
-
var
|
|
813
|
-
return _this7.state.selection.length === 0 && (!action.enabled || action.enabled(item));
|
|
814
|
-
};
|
|
811
|
+
// Disable all actions if any row(s) are selected
|
|
812
|
+
var allDisabled = this.state.selection.length > 0;
|
|
815
813
|
var actualActions = column.actions.filter(function (action) {
|
|
816
814
|
return !action.available || action.available(item);
|
|
817
815
|
});
|
|
818
816
|
if (actualActions.length > 2) {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
|
|
817
|
+
if (allDisabled) {
|
|
818
|
+
// If all actions are disabled, do not show any actions but the popover toggle
|
|
819
|
+
actualActions = [];
|
|
820
|
+
} else {
|
|
821
|
+
// if any of the actions `isPrimary`, add them inline as well, but only the first 2
|
|
822
|
+
var primaryActions = actualActions.filter(function (o) {
|
|
823
|
+
return o.isPrimary;
|
|
824
|
+
});
|
|
825
|
+
actualActions = primaryActions.slice(0, 2);
|
|
826
|
+
}
|
|
824
827
|
|
|
825
828
|
// if we have more than 1 action, we don't show them all in the cell, instead we
|
|
826
829
|
// put them all in a popover tool. This effectively means we can only have a maximum
|
|
@@ -833,18 +836,18 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
833
836
|
render: function render(item) {
|
|
834
837
|
return (0, _react2.jsx)(_collapsed_item_actions.CollapsedItemActions, {
|
|
835
838
|
actions: column.actions,
|
|
839
|
+
actionsDisabled: allDisabled,
|
|
836
840
|
itemId: itemId,
|
|
837
|
-
item: item
|
|
838
|
-
actionEnabled: actionEnabled
|
|
841
|
+
item: item
|
|
839
842
|
});
|
|
840
843
|
}
|
|
841
844
|
});
|
|
842
845
|
}
|
|
843
846
|
var tools = (0, _react2.jsx)(_expanded_item_actions.ExpandedItemActions, {
|
|
844
847
|
actions: actualActions,
|
|
848
|
+
actionsDisabled: allDisabled,
|
|
845
849
|
itemId: itemId,
|
|
846
|
-
item: item
|
|
847
|
-
actionEnabled: actionEnabled
|
|
850
|
+
item: item
|
|
848
851
|
});
|
|
849
852
|
var key = "record_actions_".concat(itemId, "_").concat(columnIndex);
|
|
850
853
|
return (0, _react2.jsx)(_table.EuiTableRowCell, {
|
|
@@ -862,7 +865,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
862
865
|
var field = column.field,
|
|
863
866
|
render = column.render,
|
|
864
867
|
dataType = column.dataType;
|
|
865
|
-
var key = "_data_column_".concat(field, "_").concat(itemId, "_").concat(columnIndex);
|
|
868
|
+
var key = "_data_column_".concat(String(field), "_").concat(itemId, "_").concat(columnIndex);
|
|
866
869
|
var contentRenderer = render || this.getRendererForDataType(dataType);
|
|
867
870
|
var value = (0, _objects.get)(item, field);
|
|
868
871
|
var content = contentRenderer(value, item);
|
|
@@ -931,7 +934,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
931
934
|
}, {
|
|
932
935
|
key: "renderPaginationBar",
|
|
933
936
|
value: function renderPaginationBar() {
|
|
934
|
-
var
|
|
937
|
+
var _this7 = this;
|
|
935
938
|
var _this$props11 = this.props,
|
|
936
939
|
error = _this$props11.error,
|
|
937
940
|
pagination = _this$props11.pagination,
|
|
@@ -950,9 +953,9 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
950
953
|
}, function (tablePagination) {
|
|
951
954
|
return (0, _react2.jsx)(_pagination_bar.PaginationBar, {
|
|
952
955
|
pagination: pagination,
|
|
953
|
-
onPageSizeChange:
|
|
954
|
-
onPageChange:
|
|
955
|
-
"aria-controls":
|
|
956
|
+
onPageSizeChange: _this7.onPageSizeChange.bind(_this7),
|
|
957
|
+
onPageChange: _this7.onPageChange.bind(_this7),
|
|
958
|
+
"aria-controls": _this7.tableId,
|
|
956
959
|
"aria-label": tablePagination
|
|
957
960
|
});
|
|
958
961
|
});
|
|
@@ -30,16 +30,12 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
30
30
|
var actions = _ref.actions,
|
|
31
31
|
itemId = _ref.itemId,
|
|
32
32
|
item = _ref.item,
|
|
33
|
-
|
|
33
|
+
actionsDisabled = _ref.actionsDisabled,
|
|
34
34
|
className = _ref.className;
|
|
35
35
|
var _useState = (0, _react.useState)(false),
|
|
36
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
37
|
popoverOpen = _useState2[0],
|
|
38
38
|
setPopoverOpen = _useState2[1];
|
|
39
|
-
var _useState3 = (0, _react.useState)(true),
|
|
40
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
-
allDisabled = _useState4[0],
|
|
42
|
-
setAllDisabled = _useState4[1];
|
|
43
39
|
var onClickItem = (0, _react.useCallback)(function (onClickAction) {
|
|
44
40
|
setPopoverOpen(false);
|
|
45
41
|
onClickAction === null || onClickAction === void 0 ? void 0 : onClickAction();
|
|
@@ -49,8 +45,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
49
45
|
var _action$available, _action$available2;
|
|
50
46
|
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;
|
|
51
47
|
if (!available) return controls;
|
|
52
|
-
var enabled =
|
|
53
|
-
if (enabled) setAllDisabled(false);
|
|
48
|
+
var enabled = action.enabled == null || action.enabled(item);
|
|
54
49
|
if ((0, _action_types.isCustomItemAction)(action)) {
|
|
55
50
|
var customAction = action;
|
|
56
51
|
var actionControl = customAction.render(item, enabled);
|
|
@@ -81,7 +76,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
81
76
|
controls.push((0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
82
77
|
key: index,
|
|
83
78
|
className: "euiBasicTable__collapsedAction",
|
|
84
|
-
disabled: !enabled,
|
|
79
|
+
disabled: !enabled && !actionsDisabled,
|
|
85
80
|
href: href,
|
|
86
81
|
target: target,
|
|
87
82
|
icon: icon,
|
|
@@ -99,17 +94,21 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
99
94
|
}
|
|
100
95
|
return controls;
|
|
101
96
|
}, []);
|
|
102
|
-
}, [actions,
|
|
97
|
+
}, [actions, actionsDisabled, item, onClickItem]);
|
|
103
98
|
var popoverButton = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}, function (
|
|
99
|
+
tokens: ['euiCollapsedItemActions.allActions', 'euiCollapsedItemActions.allActionsDisabled'],
|
|
100
|
+
defaults: ['All actions', 'Individual item actions are disabled when rows are being selected.']
|
|
101
|
+
}, function (_ref2) {
|
|
102
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
103
|
+
allActions = _ref3[0],
|
|
104
|
+
allActionsDisabled = _ref3[1];
|
|
107
105
|
return (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
108
106
|
className: className,
|
|
109
|
-
"aria-label": allActions,
|
|
107
|
+
"aria-label": actionsDisabled ? allActionsDisabled : allActions,
|
|
108
|
+
title: actionsDisabled ? allActionsDisabled : undefined,
|
|
110
109
|
iconType: "boxesHorizontal",
|
|
111
110
|
color: "text",
|
|
112
|
-
isDisabled:
|
|
111
|
+
isDisabled: actionsDisabled,
|
|
113
112
|
onClick: function onClick() {
|
|
114
113
|
return setPopoverOpen(function (isOpen) {
|
|
115
114
|
return !isOpen;
|
|
@@ -118,7 +117,7 @@ var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
|
118
117
|
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
119
118
|
});
|
|
120
119
|
});
|
|
121
|
-
var withTooltip = !
|
|
120
|
+
var withTooltip = !actionsDisabled && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
122
121
|
token: "euiCollapsedItemActions.allActions",
|
|
123
122
|
default: "All actions"
|
|
124
123
|
}, 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
|
-
|
|
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 =
|
|
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
|
}
|