@elastic/eui 122.1.0 → 123.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-icons.json +94 -94
- package/es/components/datagrid/body/data_grid_body_virtualized.js +119 -36
- package/es/components/datagrid/utils/row_heights.js +4 -1
- package/es/components/flyout/flyout.component.js +129 -55
- package/es/components/flyout/flyout_menu/action_button.js +15 -21
- package/es/components/flyout/flyout_menu/flyout_menu.js +40 -46
- package/es/components/flyout/manager/flyout_managed.js +24 -6
- package/es/components/form/described_form_group/described_form_group.js +17 -4
- package/es/components/tabs/tabbed_content/tabbed_content.js +93 -138
- package/es/components/text_truncate/text_truncate.js +9 -4
- package/eui.d.ts +32 -58
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +119 -36
- package/lib/components/datagrid/utils/row_heights.js +4 -1
- package/lib/components/flyout/flyout.component.js +134 -62
- package/lib/components/flyout/flyout_menu/action_button.js +18 -23
- package/lib/components/flyout/flyout_menu/flyout_menu.js +40 -46
- package/lib/components/flyout/manager/flyout_managed.js +23 -5
- package/lib/components/form/described_form_group/described_form_group.js +19 -3
- package/lib/components/tabs/tabbed_content/tabbed_content.js +98 -142
- package/lib/components/text_truncate/text_truncate.js +9 -4
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +116 -36
- package/optimize/es/components/datagrid/utils/row_heights.js +4 -1
- package/optimize/es/components/flyout/flyout.component.js +124 -50
- package/optimize/es/components/flyout/flyout_menu/action_button.js +14 -21
- package/optimize/es/components/flyout/manager/flyout_managed.js +24 -6
- package/optimize/es/components/form/described_form_group/described_form_group.js +17 -4
- package/optimize/es/components/tabs/tabbed_content/tabbed_content.js +87 -131
- package/optimize/es/components/text_truncate/text_truncate.js +4 -3
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +116 -36
- package/optimize/lib/components/datagrid/utils/row_heights.js +4 -1
- package/optimize/lib/components/flyout/flyout.component.js +123 -49
- package/optimize/lib/components/flyout/flyout_menu/action_button.js +14 -22
- package/optimize/lib/components/flyout/manager/flyout_managed.js +23 -5
- package/optimize/lib/components/form/described_form_group/described_form_group.js +19 -3
- package/optimize/lib/components/tabs/tabbed_content/tabbed_content.js +87 -131
- package/optimize/lib/components/text_truncate/text_truncate.js +4 -3
- package/package.json +2 -2
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +119 -36
- package/test-env/components/datagrid/utils/row_heights.js +4 -1
- package/test-env/components/flyout/flyout.component.js +123 -49
- package/test-env/components/flyout/flyout_menu/action_button.js +14 -22
- package/test-env/components/flyout/flyout_menu/flyout_menu.js +40 -46
- package/test-env/components/flyout/manager/flyout_managed.js +23 -5
- package/test-env/components/form/described_form_group/described_form_group.js +19 -3
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +88 -132
- package/test-env/components/text_truncate/text_truncate.js +9 -4
|
@@ -1,13 +1,14 @@
|
|
|
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.EuiDescribedFormGroup = 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _services = require("../../../services");
|
|
@@ -17,7 +18,7 @@ var _flex = require("../../flex");
|
|
|
17
18
|
var _eui_form_context = require("../eui_form_context");
|
|
18
19
|
var _described_form_group = require("./described_form_group.styles");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["children", "className", "gutterSize", "fullWidth", "ratio", "titleSize", "title", "description", "descriptionFlexItemProps", "fieldFlexItemProps"];
|
|
21
|
+
var _excluded = ["children", "className", "gutterSize", "fullWidth", "ratio", "titleSize", "title", "description", "descriptionFlexItemProps", "fieldFlexItemProps", "aria-label", "aria-labelledby"];
|
|
21
22
|
/*
|
|
22
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -25,6 +26,8 @@ var _excluded = ["children", "className", "gutterSize", "fullWidth", "ratio", "t
|
|
|
25
26
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
27
|
* Side Public License, v 1.
|
|
27
28
|
*/
|
|
29
|
+
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); }
|
|
30
|
+
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
31
|
/**
|
|
29
32
|
* @see {@link https://eui.elastic.co/docs/components/forms/layouts/described-groups/|EuiDescribedFormGroup documentation}
|
|
30
33
|
*/
|
|
@@ -45,7 +48,15 @@ var EuiDescribedFormGroup = exports.EuiDescribedFormGroup = function EuiDescribe
|
|
|
45
48
|
description = props.description,
|
|
46
49
|
descriptionFlexItemProps = props.descriptionFlexItemProps,
|
|
47
50
|
fieldFlexItemProps = props.fieldFlexItemProps,
|
|
51
|
+
ariaLabel = props['aria-label'],
|
|
52
|
+
ariaLabelledby = props['aria-labelledby'],
|
|
48
53
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
54
|
+
var generatedTitleId = (0, _services.useGeneratedHtmlId)({
|
|
55
|
+
prefix: 'euiDescribedFormGroupTitle'
|
|
56
|
+
});
|
|
57
|
+
// Reuse an `id` already set on the title element, so that consumers
|
|
58
|
+
// referencing it from their own `aria-labelledby` keep working
|
|
59
|
+
var titleId = /*#__PURE__*/(0, _react.isValidElement)(title) && title.props.id || generatedTitleId;
|
|
49
60
|
var styles = (0, _services.useEuiMemoizedStyles)(_described_form_group.euiDescribedFormGroupStyles);
|
|
50
61
|
var cssStyles = [styles.euiDescribedFormGroup, fullWidth ? styles.fullWidth : styles.formWidth];
|
|
51
62
|
var descriptionColumnStyles = [styles.euiDescribedFormGroup__descriptionColumn, descriptionFlexItemProps === null || descriptionFlexItemProps === void 0 ? void 0 : descriptionFlexItemProps.css];
|
|
@@ -79,7 +90,11 @@ var EuiDescribedFormGroup = exports.EuiDescribedFormGroup = function EuiDescribe
|
|
|
79
90
|
break;
|
|
80
91
|
}
|
|
81
92
|
return (0, _react2.jsx)(_flex.EuiFlexGroup, (0, _extends2.default)({
|
|
82
|
-
role: "group"
|
|
93
|
+
role: "group",
|
|
94
|
+
"aria-label": ariaLabel
|
|
95
|
+
// The title names the group, unless the consumer provides their own label
|
|
96
|
+
,
|
|
97
|
+
"aria-labelledby": ariaLabelledby !== null && ariaLabelledby !== void 0 ? ariaLabelledby : ariaLabel == null ? titleId : undefined
|
|
83
98
|
}, rest, {
|
|
84
99
|
css: cssStyles,
|
|
85
100
|
className: classes,
|
|
@@ -91,6 +106,7 @@ var EuiDescribedFormGroup = exports.EuiDescribedFormGroup = function EuiDescribe
|
|
|
91
106
|
css: descriptionColumnStyles,
|
|
92
107
|
className: (0, _classnames.default)('euiDescribedFormGroup__descriptionColumn', descriptionFlexItemProps === null || descriptionFlexItemProps === void 0 ? void 0 : descriptionFlexItemProps.className)
|
|
93
108
|
}), (0, _react2.jsx)(_title.EuiTitle, {
|
|
109
|
+
id: titleId,
|
|
94
110
|
size: titleSize,
|
|
95
111
|
className: "euiDescribedFormGroup__title"
|
|
96
112
|
}, title), renderedDescription), (0, _react2.jsx)(_flex.EuiFlexItem, (0, _extends2.default)({
|
|
@@ -7,27 +7,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.EuiTabbedContent = exports.AUTOFOCUS = 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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
var _services = require("../../../services");
|
|
20
14
|
var _tabs = require("../tabs");
|
|
21
15
|
var _tab = require("../tab");
|
|
16
|
+
var _services = require("../../../services");
|
|
22
17
|
var _react2 = require("@emotion/react");
|
|
23
|
-
var _excluded = ["className", "expand", "initialSelectedTab", "onTabClick", "selectedTab", "size", "tabs"
|
|
18
|
+
var _excluded = ["autoFocus", "className", "expand", "initialSelectedTab", "onTabClick", "selectedTab", "size", "tabs"],
|
|
24
19
|
_excluded2 = ["id", "name", "content"];
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
-
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)); }
|
|
30
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*
|
|
20
|
+
/*
|
|
31
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
32
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
33
23
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
@@ -37,129 +27,94 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
37
27
|
/**
|
|
38
28
|
* Marked as const so type is `['initial', 'selected']` instead of `string[]`
|
|
39
29
|
*/
|
|
30
|
+
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); }
|
|
31
|
+
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; }
|
|
40
32
|
var AUTOFOCUS = exports.AUTOFOCUS = ['initial', 'selected'];
|
|
41
|
-
var EuiTabbedContent = exports.EuiTabbedContent =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!externalSelectedTab) {
|
|
83
|
-
_this.setState({
|
|
84
|
-
selectedTabId: selectedTab.id
|
|
85
|
-
}, function () {
|
|
86
|
-
_this.focusTab();
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
var initialSelectedTab = props.initialSelectedTab,
|
|
91
|
-
_selectedTab = props.selectedTab,
|
|
92
|
-
tabs = props.tabs;
|
|
33
|
+
var EuiTabbedContent = exports.EuiTabbedContent = function EuiTabbedContent(_ref) {
|
|
34
|
+
var _ref$autoFocus = _ref.autoFocus,
|
|
35
|
+
autoFocus = _ref$autoFocus === void 0 ? 'initial' : _ref$autoFocus,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
expand = _ref.expand,
|
|
38
|
+
initialSelectedTab = _ref.initialSelectedTab,
|
|
39
|
+
onTabClick = _ref.onTabClick,
|
|
40
|
+
externalSelectedTab = _ref.selectedTab,
|
|
41
|
+
size = _ref.size,
|
|
42
|
+
tabs = _ref.tabs,
|
|
43
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
|
+
var rootId = (0, _services.useGeneratedHtmlId)();
|
|
45
|
+
var tabsRef = (0, _react.useRef)(null);
|
|
46
|
+
var inFocusRef = (0, _react.useRef)(false);
|
|
47
|
+
var _useState = (0, _react.useState)(function () {
|
|
48
|
+
return externalSelectedTab ? undefined : (initialSelectedTab === null || initialSelectedTab === void 0 ? void 0 : initialSelectedTab.id) || tabs[0].id;
|
|
49
|
+
}),
|
|
50
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
|
+
selectedTabId = _useState2[0],
|
|
52
|
+
setSelectedTabId = _useState2[1];
|
|
53
|
+
var focusTab = function focusTab(id) {
|
|
54
|
+
var _tabsRef$current;
|
|
55
|
+
var targetTab = (_tabsRef$current = tabsRef.current) === null || _tabsRef$current === void 0 ? void 0 : _tabsRef$current.querySelector("#".concat(id));
|
|
56
|
+
targetTab === null || targetTab === void 0 || targetTab.focus();
|
|
57
|
+
};
|
|
58
|
+
var initializeFocus = function initializeFocus() {
|
|
59
|
+
if (!inFocusRef.current && autoFocus === 'selected') {
|
|
60
|
+
inFocusRef.current = true;
|
|
61
|
+
focusTab(selectedTabId);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var removeFocus = function removeFocus(blurEvent) {
|
|
65
|
+
// only set inFocus to false if the wrapping div doesn't contain the now-focusing element
|
|
66
|
+
var currentTarget = blurEvent.currentTarget;
|
|
67
|
+
var relatedTarget = blurEvent.relatedTarget;
|
|
68
|
+
if (currentTarget.contains(relatedTarget) === false) {
|
|
69
|
+
inFocusRef.current = false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var handleTabClick = function handleTabClick(tab) {
|
|
73
|
+
onTabClick === null || onTabClick === void 0 || onTabClick(tab);
|
|
93
74
|
|
|
94
75
|
// Only track selection state if it's not controlled externally.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
76
|
+
if (!externalSelectedTab) {
|
|
77
|
+
setSelectedTabId(tab.id);
|
|
78
|
+
focusTab(tab.id);
|
|
98
79
|
}
|
|
99
|
-
|
|
100
|
-
selectedTabId: selectedTabId,
|
|
101
|
-
inFocus: false
|
|
102
|
-
};
|
|
103
|
-
return _this;
|
|
104
|
-
}
|
|
105
|
-
(0, _inherits2.default)(EuiTabbedContent, _Component);
|
|
106
|
-
return (0, _createClass2.default)(EuiTabbedContent, [{
|
|
107
|
-
key: "render",
|
|
108
|
-
value: function render() {
|
|
109
|
-
var _this2 = this;
|
|
110
|
-
var _this$props2 = this.props,
|
|
111
|
-
className = _this$props2.className,
|
|
112
|
-
expand = _this$props2.expand,
|
|
113
|
-
initialSelectedTab = _this$props2.initialSelectedTab,
|
|
114
|
-
onTabClick = _this$props2.onTabClick,
|
|
115
|
-
externalSelectedTab = _this$props2.selectedTab,
|
|
116
|
-
size = _this$props2.size,
|
|
117
|
-
tabs = _this$props2.tabs,
|
|
118
|
-
autoFocus = _this$props2.autoFocus,
|
|
119
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
|
|
80
|
+
};
|
|
120
81
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
82
|
+
// Allow the consumer to control tab selection.
|
|
83
|
+
var selectedTab = externalSelectedTab || tabs.find(function (tab) {
|
|
84
|
+
return tab.id === selectedTabId;
|
|
85
|
+
}) || tabs[0]; // Fall back to the first tab if a selected tab can't be found
|
|
125
86
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
}]);
|
|
159
|
-
}(_react.Component);
|
|
160
|
-
(0, _defineProperty2.default)(EuiTabbedContent, "defaultProps", {
|
|
161
|
-
autoFocus: 'initial'
|
|
162
|
-
});
|
|
87
|
+
var selectedTabContent = selectedTab.content,
|
|
88
|
+
selectedTabContentId = selectedTab.id;
|
|
89
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
90
|
+
className: className
|
|
91
|
+
}, rest), (0, _react2.jsx)(_tabs.EuiTabs, {
|
|
92
|
+
ref: tabsRef,
|
|
93
|
+
expand: expand,
|
|
94
|
+
size: size,
|
|
95
|
+
onFocus: initializeFocus,
|
|
96
|
+
onBlur: removeFocus
|
|
97
|
+
}, tabs.map(function (tab) {
|
|
98
|
+
var id = tab.id,
|
|
99
|
+
name = tab.name,
|
|
100
|
+
content = tab.content,
|
|
101
|
+
tabProps = (0, _objectWithoutProperties2.default)(tab, _excluded2);
|
|
102
|
+
return (0, _react2.jsx)(_tab.EuiTab, (0, _extends2.default)({
|
|
103
|
+
key: id,
|
|
104
|
+
id: id
|
|
105
|
+
}, tabProps, {
|
|
106
|
+
onClick: function onClick() {
|
|
107
|
+
return handleTabClick(tab);
|
|
108
|
+
},
|
|
109
|
+
isSelected: tab === selectedTab,
|
|
110
|
+
"aria-controls": rootId
|
|
111
|
+
}), name);
|
|
112
|
+
})), (0, _react2.jsx)("div", {
|
|
113
|
+
role: "tabpanel",
|
|
114
|
+
id: rootId,
|
|
115
|
+
"aria-labelledby": selectedTabContentId
|
|
116
|
+
}, selectedTabContent));
|
|
117
|
+
};
|
|
163
118
|
EuiTabbedContent.propTypes = {
|
|
164
119
|
className: _propTypes.default.string,
|
|
165
120
|
"aria-label": _propTypes.default.string,
|
|
@@ -235,4 +190,5 @@ EuiTabbedContent.propTypes = {
|
|
|
235
190
|
"data-test-subj": _propTypes.default.string,
|
|
236
191
|
css: _propTypes.default.any
|
|
237
192
|
}).isRequired).isRequired
|
|
238
|
-
};
|
|
193
|
+
};
|
|
194
|
+
EuiTabbedContent.displayName = 'EuiTabbedContent';
|
|
@@ -19,7 +19,7 @@ var _utils = require("./utils");
|
|
|
19
19
|
var _text_truncate = require("./text_truncate.styles");
|
|
20
20
|
var _react2 = require("@emotion/react");
|
|
21
21
|
var _excluded = ["width", "onResize"],
|
|
22
|
-
_excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "calculationDelayMs", "containerRef", "className"],
|
|
22
|
+
_excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "calculationDelayMs", "containerRef", "className", "toolTipProps"],
|
|
23
23
|
_excluded3 = ["onResize"];
|
|
24
24
|
/*
|
|
25
25
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -108,7 +108,11 @@ EuiTextTruncate.propTypes = {
|
|
|
108
108
|
* fonts are done loading or layout is done shifting or settling. Adding a delay
|
|
109
109
|
* may help resolve any rendering issues.
|
|
110
110
|
*/
|
|
111
|
-
calculationDelayMs: _propTypes.default.number
|
|
111
|
+
calculationDelayMs: _propTypes.default.number,
|
|
112
|
+
/**
|
|
113
|
+
* Placement of the tooltip that shows the full text while truncating.
|
|
114
|
+
*/
|
|
115
|
+
toolTipProps: _propTypes.default.any
|
|
112
116
|
};
|
|
113
117
|
var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
114
118
|
var width = _ref2.width,
|
|
@@ -124,6 +128,7 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
124
128
|
calculationDelayMs = _ref2.calculationDelayMs,
|
|
125
129
|
containerRef = _ref2.containerRef,
|
|
126
130
|
className = _ref2.className,
|
|
131
|
+
toolTipProps = _ref2.toolTipProps,
|
|
127
132
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
128
133
|
// Note: This needs to be a state and not a ref to trigger a rerender on mount
|
|
129
134
|
var _useState = (0, _react.useState)(null),
|
|
@@ -225,11 +230,11 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
225
230
|
className: "euiTextTruncate__fullText",
|
|
226
231
|
"data-test-subj": "fullText"
|
|
227
232
|
}, children ? children(text) : text));
|
|
228
|
-
return isTruncating ? (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
233
|
+
return isTruncating ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
229
234
|
content: text,
|
|
230
235
|
disableScreenReaderOutput: true,
|
|
231
236
|
display: "block"
|
|
232
|
-
}, content) : content;
|
|
237
|
+
}, toolTipProps), content) : content;
|
|
233
238
|
};
|
|
234
239
|
EuiTextTruncateWithWidth.propTypes = {
|
|
235
240
|
width: _propTypes.default.number.isRequired,
|