@elastic/eui 72.2.0 → 74.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_theme_dark.css +15 -67
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +15 -67
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +56 -101
- package/es/components/basic_table/basic_table.styles.js +45 -0
- package/es/components/datagrid/controls/column_selector.js +23 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/es/components/datagrid/data_grid.a11y.js +3 -2
- package/es/components/modal/confirm_modal.js +5 -3
- package/es/components/modal/modal.a11y.js +1 -1
- package/es/components/modal/modal_header_title.js +12 -3
- package/es/components/notification/notification_event.a11y.js +113 -0
- package/es/components/page/page_header/page_header.a11y.js +32 -0
- package/es/components/portal/portal.a11y.js +70 -0
- package/es/components/resizable_container/resizable_panel.js +5 -0
- package/es/components/tool_tip/tool_tip.js +10 -5
- package/es/components/tool_tip/tool_tip_manager.js +42 -0
- package/es/services/security/get_secure_rel_for_target.js +2 -8
- package/es/services/theme/hooks.js +18 -0
- package/es/services/theme/index.js +1 -1
- package/eui.d.ts +57 -19
- package/i18ntokens.json +54 -38
- package/lib/components/basic_table/basic_table.js +56 -100
- package/lib/components/basic_table/basic_table.styles.js +54 -0
- package/lib/components/datagrid/controls/column_selector.js +21 -6
- package/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/lib/components/modal/confirm_modal.js +5 -3
- package/lib/components/modal/modal.a11y.js +1 -1
- package/lib/components/modal/modal_header_title.js +12 -3
- package/lib/components/notification/notification_event.a11y.js +117 -0
- package/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/lib/components/portal/portal.a11y.js +73 -0
- package/lib/components/resizable_container/resizable_panel.js +5 -0
- package/lib/components/tool_tip/tool_tip.js +13 -7
- package/lib/components/tool_tip/tool_tip_manager.js +50 -0
- package/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/lib/services/theme/hooks.js +22 -2
- package/lib/services/theme/index.js +6 -0
- package/optimize/es/components/basic_table/basic_table.js +56 -101
- package/optimize/es/components/basic_table/basic_table.styles.js +45 -0
- package/optimize/es/components/datagrid/controls/column_selector.js +22 -7
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/es/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/es/components/modal/confirm_modal.js +4 -3
- package/optimize/es/components/modal/modal.a11y.js +1 -1
- package/optimize/es/components/modal/modal_header_title.js +4 -2
- package/optimize/es/components/notification/notification_event.a11y.js +103 -0
- package/optimize/es/components/page/page_header/page_header.a11y.js +32 -0
- package/optimize/es/components/portal/portal.a11y.js +60 -0
- package/optimize/es/components/tool_tip/tool_tip.js +10 -5
- package/optimize/es/components/tool_tip/tool_tip_manager.js +41 -0
- package/optimize/es/services/security/get_secure_rel_for_target.js +2 -8
- package/optimize/es/services/theme/hooks.js +18 -0
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +56 -95
- package/optimize/lib/components/basic_table/basic_table.styles.js +56 -0
- package/optimize/lib/components/datagrid/controls/column_selector.js +21 -6
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/lib/components/modal/confirm_modal.js +4 -3
- package/optimize/lib/components/modal/modal.a11y.js +1 -1
- package/optimize/lib/components/modal/modal_header_title.js +4 -2
- package/optimize/lib/components/notification/notification_event.a11y.js +117 -0
- package/optimize/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/optimize/lib/components/portal/portal.a11y.js +73 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +13 -7
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +49 -0
- package/optimize/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/optimize/lib/services/theme/hooks.js +22 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/package.json +1 -1
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +14 -13
- package/src/components/index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +56 -95
- package/test-env/components/basic_table/basic_table.styles.js +56 -0
- package/test-env/components/datagrid/controls/column_selector.js +21 -6
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/test-env/components/datagrid/data_grid.a11y.js +3 -2
- package/test-env/components/modal/confirm_modal.js +5 -3
- package/test-env/components/modal/modal.a11y.js +1 -1
- package/test-env/components/modal/modal_header_title.js +12 -3
- package/test-env/components/notification/notification_event.a11y.js +117 -0
- package/test-env/components/page/page_header/page_header.a11y.js +40 -0
- package/test-env/components/portal/portal.a11y.js +73 -0
- package/test-env/components/resizable_container/resizable_panel.js +5 -0
- package/test-env/components/tool_tip/tool_tip.js +13 -7
- package/test-env/components/tool_tip/tool_tip_manager.js +49 -0
- package/test-env/services/security/get_secure_rel_for_target.js +2 -9
- package/test-env/services/theme/hooks.js +22 -2
- package/test-env/services/theme/index.js +6 -0
- package/es/services/url.js +0 -23
- package/lib/services/url.js +0 -32
- package/optimize/es/services/url.js +0 -23
- package/optimize/lib/services/url.js +0 -32
- package/src/components/basic_table/_basic_table.scss +0 -41
- package/src/components/basic_table/_index.scss +0 -1
- package/test-env/services/url.js +0 -32
|
@@ -89,7 +89,9 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
89
89
|
var dragHandleAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSortingDraggable.dragHandleAriaLabel', 'Drag handle');
|
|
90
90
|
return (0, _react2.jsx)(_drag_and_drop.EuiDraggable, _extends({
|
|
91
91
|
draggableId: id,
|
|
92
|
-
index: index
|
|
92
|
+
index: index,
|
|
93
|
+
hasInteractiveChildren: true,
|
|
94
|
+
customDragHandle: true
|
|
93
95
|
}, rest), function (provided, state) {
|
|
94
96
|
return (0, _react2.jsx)("div", {
|
|
95
97
|
className: "euiDataGridColumnSorting__item ".concat(state.isDragging && 'euiDataGridColumnSorting__item-isDragging')
|
|
@@ -131,18 +133,25 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
131
133
|
sorting.onSort(nextColumns);
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
|
-
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
136
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, _extends({
|
|
137
|
+
className: "euiDataGridColumnSorting__name" // This extra column name flex item affords the column more grabbable real estate
|
|
138
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
139
|
+
|
|
140
|
+
}, provided.dragHandleProps, {
|
|
141
|
+
tabIndex: -1,
|
|
142
|
+
"aria-hidden": true
|
|
143
|
+
}), (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
144
|
+
gutterSize: "xs",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
responsive: false
|
|
147
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
135
148
|
grow: false
|
|
136
149
|
}, (0, _react2.jsx)(_token.EuiToken, {
|
|
137
150
|
color: schemaDetails != null ? schemaDetails.color : undefined,
|
|
138
151
|
iconType: schemaDetails != null ? schemaDetails.icon : 'tokenString'
|
|
139
|
-
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
140
|
-
"aria-hidden": true
|
|
141
|
-
}, (0, _react2.jsx)(_text.EuiText, {
|
|
152
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_text.EuiText, {
|
|
142
153
|
size: "xs"
|
|
143
|
-
}, (0, _react2.jsx)("p", null, display))), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
144
|
-
className: "euiDataGridColumnSorting__orderButtons"
|
|
145
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
154
|
+
}, (0, _react2.jsx)("p", null, display))))), (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
146
155
|
token: "euiColumnSortingDraggable.toggleLegend",
|
|
147
156
|
default: "Select sorting method for {display}",
|
|
148
157
|
values: {
|
|
@@ -188,7 +188,7 @@ describe('EuiDataGrid', function () {
|
|
|
188
188
|
it('has zero violations on first render', function () {
|
|
189
189
|
cy.checkAxe();
|
|
190
190
|
});
|
|
191
|
-
it('has zero violations when the columns
|
|
191
|
+
it('has zero violations when the columns visibility menu is open', function () {
|
|
192
192
|
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
193
193
|
cy.checkAxe();
|
|
194
194
|
});
|
|
@@ -241,9 +241,10 @@ describe('EuiDataGrid', function () {
|
|
|
241
241
|
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').find('button.euiButtonIcon').last().realClick();
|
|
242
242
|
cy.checkAxe();
|
|
243
243
|
});
|
|
244
|
-
it('has zero violations when the
|
|
244
|
+
it('has zero violations on sort and when the columns sorting menu is open', function () {
|
|
245
245
|
cy.get('button.euiDataGridHeaderCell__button').last().realClick();
|
|
246
246
|
cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
|
|
247
|
+
cy.get('button[data-test-subj="dataGridColumnSortingPopover"]').realClick();
|
|
247
248
|
cy.checkAxe();
|
|
248
249
|
});
|
|
249
250
|
it('has zero violations when fullscreen is open', function () {
|
|
@@ -33,7 +33,7 @@ var _text = require("../text");
|
|
|
33
33
|
|
|
34
34
|
var _react2 = require("@emotion/react");
|
|
35
35
|
|
|
36
|
-
var _excluded = ["children", "title", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
36
|
+
var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
@@ -67,6 +67,7 @@ exports.CANCEL_BUTTON = CANCEL_BUTTON;
|
|
|
67
67
|
var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
68
68
|
var children = _ref.children,
|
|
69
69
|
title = _ref.title,
|
|
70
|
+
titleProps = _ref.titleProps,
|
|
70
71
|
onCancel = _ref.onCancel,
|
|
71
72
|
onConfirm = _ref.onConfirm,
|
|
72
73
|
cancelButtonText = _ref.cancelButtonText,
|
|
@@ -118,9 +119,9 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
|
118
119
|
var modalTitle;
|
|
119
120
|
|
|
120
121
|
if (title) {
|
|
121
|
-
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, {
|
|
122
|
+
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, _extends({
|
|
122
123
|
"data-test-subj": "confirmModalTitleText"
|
|
123
|
-
}, title));
|
|
124
|
+
}, titleProps), title));
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
var message;
|
|
@@ -159,6 +160,7 @@ EuiConfirmModal.propTypes = {
|
|
|
159
160
|
*/
|
|
160
161
|
children: _propTypes.default.node,
|
|
161
162
|
title: _propTypes.default.node,
|
|
163
|
+
titleProps: _propTypes.default.any,
|
|
162
164
|
cancelButtonText: _propTypes.default.node,
|
|
163
165
|
confirmButtonText: _propTypes.default.node,
|
|
164
166
|
onCancel: _propTypes.default.func.isRequired,
|
|
@@ -47,7 +47,7 @@ var Modal = function Modal() {
|
|
|
47
47
|
};
|
|
48
48
|
return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButton, {
|
|
49
49
|
onClick: showModal
|
|
50
|
-
}, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null,
|
|
50
|
+
}, "Show confirm modal"), isModalVisible && (0, _react2.jsx)(_index.EuiModal, modalProps, (0, _react2.jsx)(_index.EuiModalHeader, null, (0, _react2.jsx)(_index.EuiModalHeaderTitle, null, "Title of modal")), (0, _react2.jsx)(_index.EuiModalBody, null, (0, _react2.jsx)("p", null, "This is a simple modal body")), (0, _react2.jsx)(_index.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButton, {
|
|
51
51
|
onClick: closeModal,
|
|
52
52
|
fill: true
|
|
53
53
|
}, "Close"))));
|
|
@@ -15,7 +15,7 @@ var _title = require("../title");
|
|
|
15
15
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
|
-
var _excluded = ["className", "children"];
|
|
18
|
+
var _excluded = ["className", "children", "component"];
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -28,13 +28,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
28
|
var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
|
|
29
29
|
var className = _ref.className,
|
|
30
30
|
children = _ref.children,
|
|
31
|
+
_ref$component = _ref.component,
|
|
32
|
+
Component = _ref$component === void 0 ? 'h1' : _ref$component,
|
|
31
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
34
|
|
|
33
35
|
var classes = (0, _classnames.default)('euiModalHeader__title', className);
|
|
34
36
|
return (0, _react2.jsx)(_title.EuiTitle, _extends({
|
|
35
37
|
size: "m",
|
|
36
38
|
className: classes
|
|
37
|
-
}, rest),
|
|
39
|
+
}, rest), (0, _react2.jsx)(Component, null, children));
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
exports.EuiModalHeaderTitle = EuiModalHeaderTitle;
|
|
@@ -42,5 +44,12 @@ EuiModalHeaderTitle.propTypes = {
|
|
|
42
44
|
className: _propTypes.default.string,
|
|
43
45
|
"aria-label": _propTypes.default.string,
|
|
44
46
|
"data-test-subj": _propTypes.default.string,
|
|
45
|
-
css: _propTypes.default.any
|
|
47
|
+
css: _propTypes.default.any,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The tag to render. Can be changed to a lower heading
|
|
51
|
+
* level like `h2` or a container `div`.
|
|
52
|
+
* @default h1
|
|
53
|
+
*/
|
|
54
|
+
component: _propTypes.default.any
|
|
46
55
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
|
|
7
|
+
var _context_menu = require("../context_menu");
|
|
8
|
+
|
|
9
|
+
var _notification_event = require("./notification_event");
|
|
10
|
+
|
|
11
|
+
var _panel = require("../panel");
|
|
12
|
+
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
|
|
21
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
26
|
+
|
|
27
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
28
|
+
|
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
+
|
|
31
|
+
var NotificationEvent = function NotificationEvent() {
|
|
32
|
+
var _useState = (0, _react.useState)(false),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
isRead = _useState2[0],
|
|
35
|
+
setIsRead = _useState2[1];
|
|
36
|
+
|
|
37
|
+
var onRead = function onRead(id, isRead) {
|
|
38
|
+
setIsRead(!isRead);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var onOpenContextMenu = function onOpenContextMenu(id) {
|
|
42
|
+
return [(0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
43
|
+
key: "contextMenuItemA",
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return onRead(id, isRead);
|
|
46
|
+
}
|
|
47
|
+
}, isRead ? 'Mark as unread' : 'Mark as read'), (0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
48
|
+
key: "contextMenuItemB",
|
|
49
|
+
onClick: function onClick() {}
|
|
50
|
+
}, "View messages like this"), (0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
51
|
+
key: "contextMenuItemC",
|
|
52
|
+
onClick: function onClick() {}
|
|
53
|
+
}, "Don\u2019t notify me about this")];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (0, _react2.jsx)(_panel.EuiPanel, {
|
|
57
|
+
paddingSize: "none",
|
|
58
|
+
hasShadow: true,
|
|
59
|
+
style: {
|
|
60
|
+
maxWidth: '540px'
|
|
61
|
+
}
|
|
62
|
+
}, (0, _react2.jsx)(_notification_event.EuiNotificationEvent, {
|
|
63
|
+
id: "cy-eui-notification-1",
|
|
64
|
+
type: "Report",
|
|
65
|
+
iconType: "logoKibana",
|
|
66
|
+
iconAriaLabel: "Kibana",
|
|
67
|
+
time: "1 min ago",
|
|
68
|
+
title: "[Error Monitoring Report] is generated",
|
|
69
|
+
primaryAction: "Download",
|
|
70
|
+
primaryActionProps: {
|
|
71
|
+
iconType: 'download'
|
|
72
|
+
},
|
|
73
|
+
messages: ['The reported was generated at 17:12:16 GMT+4'],
|
|
74
|
+
isRead: isRead,
|
|
75
|
+
onRead: onRead,
|
|
76
|
+
onOpenContextMenu: onOpenContextMenu,
|
|
77
|
+
onClickPrimaryAction: function onClickPrimaryAction() {},
|
|
78
|
+
onClickTitle: function onClickTitle() {}
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
describe('EuiNotificationEvent', function () {
|
|
83
|
+
beforeEach(function () {
|
|
84
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
85
|
+
|
|
86
|
+
cy.realMount((0, _react2.jsx)(NotificationEvent, null));
|
|
87
|
+
cy.get('article.euiNotificationEvent').should('exist');
|
|
88
|
+
});
|
|
89
|
+
describe('Automated accessibility check', function () {
|
|
90
|
+
it('has zero violations on first render', function () {
|
|
91
|
+
cy.checkAxe();
|
|
92
|
+
});
|
|
93
|
+
it('has zero violations when popover is open', function () {
|
|
94
|
+
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
|
|
95
|
+
cy.get('div.euiPopover__panel').should('exist');
|
|
96
|
+
cy.checkAxe();
|
|
97
|
+
});
|
|
98
|
+
it('has zero violations after the Mark as read button is clicked', function () {
|
|
99
|
+
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
|
|
100
|
+
cy.get('div.euiPopover__panel').should('exist');
|
|
101
|
+
cy.get('div.euiPopover__panel button').first().realClick();
|
|
102
|
+
cy.checkAxe();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('Keyboard accessibility', function () {
|
|
106
|
+
it('has zero violations when the popover is opened by keyboard', function () {
|
|
107
|
+
cy.repeatRealPress('Tab');
|
|
108
|
+
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').should('have.focus');
|
|
109
|
+
cy.realPress('Enter');
|
|
110
|
+
cy.get('div.euiPopover__panel').should('exist');
|
|
111
|
+
cy.checkAxe();
|
|
112
|
+
cy.realPress('Escape');
|
|
113
|
+
cy.get('div.euiPopover__panel').should('not.exist');
|
|
114
|
+
cy.checkAxe();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _button = require("../../button");
|
|
6
|
+
|
|
7
|
+
var _page_header = require("./page_header");
|
|
8
|
+
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../../cypress/support"/>
|
|
21
|
+
describe('EuiPageHeader', function () {
|
|
22
|
+
beforeEach(function () {
|
|
23
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
24
|
+
|
|
25
|
+
cy.realMount((0, _react2.jsx)(_page_header.EuiPageHeader, {
|
|
26
|
+
pageTitle: "Page title",
|
|
27
|
+
iconType: "logoKibana",
|
|
28
|
+
description: "This description should be describing the current page as depicted by the page title. It will never extend beneath the right side content.",
|
|
29
|
+
rightSideItems: [(0, _react2.jsx)(_button.EuiButton, {
|
|
30
|
+
fill: true
|
|
31
|
+
}, "Add something"), (0, _react2.jsx)(_button.EuiButton, null, "Do something")]
|
|
32
|
+
}));
|
|
33
|
+
cy.get('h1.euiTitle').should('exist');
|
|
34
|
+
});
|
|
35
|
+
describe('Automated accessibility check', function () {
|
|
36
|
+
it('has zero violations on first render', function () {
|
|
37
|
+
cy.checkAxe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
|
|
7
|
+
var _button = require("../button");
|
|
8
|
+
|
|
9
|
+
var _portal = require("./portal");
|
|
10
|
+
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
|
|
13
|
+
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); }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
|
+
|
|
19
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
|
+
|
|
21
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
22
|
+
|
|
23
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
24
|
+
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
26
|
+
|
|
27
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
+
|
|
29
|
+
var Portal = function Portal() {
|
|
30
|
+
var _useState = (0, _react.useState)(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
isPortalVisible = _useState2[0],
|
|
33
|
+
setIsPortalVisible = _useState2[1];
|
|
34
|
+
|
|
35
|
+
var togglePortal = function togglePortal() {
|
|
36
|
+
setIsPortalVisible(!isPortalVisible);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var closePortal = function closePortal() {
|
|
40
|
+
setIsPortalVisible(false);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var customPortal;
|
|
44
|
+
|
|
45
|
+
if (isPortalVisible) {
|
|
46
|
+
customPortal = (0, _react2.jsx)(_portal.EuiPortal, null, (0, _react2.jsx)("div", null, "This is the portal. Click anywhere to close."), (0, _react2.jsx)(_button.EuiButton, {
|
|
47
|
+
onClick: closePortal
|
|
48
|
+
}, "Close portal"));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButton, {
|
|
52
|
+
onClick: togglePortal
|
|
53
|
+
}, "View guide"), customPortal);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
describe('EuiPortal', function () {
|
|
57
|
+
beforeEach(function () {
|
|
58
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
59
|
+
|
|
60
|
+
cy.realMount((0, _react2.jsx)(Portal, null));
|
|
61
|
+
cy.get('div[data-relative-to-header="above"]').should('not.exist');
|
|
62
|
+
});
|
|
63
|
+
describe('Automated accessibility check', function () {
|
|
64
|
+
it('has zero violations on first render', function () {
|
|
65
|
+
cy.checkAxe();
|
|
66
|
+
});
|
|
67
|
+
it('has zero violations after the portal is activated', function () {
|
|
68
|
+
cy.get('button[type="button"]').contains('View guide').realClick();
|
|
69
|
+
cy.get('div[data-euiportal="true"]').should('exist');
|
|
70
|
+
cy.checkAxe();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -329,6 +329,11 @@ EuiResizablePanel.propTypes = {
|
|
|
329
329
|
*/
|
|
330
330
|
style: _propTypes.default.any,
|
|
331
331
|
|
|
332
|
+
/**
|
|
333
|
+
* tabIndex={0} provides full keyboard access when content overflows `<EuiResizablePanel />`
|
|
334
|
+
*/
|
|
335
|
+
tabIndex: _propTypes.default.number,
|
|
336
|
+
|
|
332
337
|
/**
|
|
333
338
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
334
339
|
*/
|
|
@@ -15,19 +15,21 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
|
|
16
16
|
var _common = require("../common");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _services = require("../../services");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _react2 = require("../../services/react");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _resize_observer = require("../observer/resize_observer");
|
|
23
|
+
|
|
24
|
+
var _portal = require("../portal");
|
|
23
25
|
|
|
24
26
|
var _tool_tip_popover = require("./tool_tip_popover");
|
|
25
27
|
|
|
26
|
-
var
|
|
28
|
+
var _tool_tip_anchor = require("./tool_tip_anchor");
|
|
27
29
|
|
|
28
|
-
var
|
|
30
|
+
var _tool_tip_arrow = require("./tool_tip_arrow");
|
|
29
31
|
|
|
30
|
-
var
|
|
32
|
+
var _tool_tip_manager = require("./tool_tip_manager");
|
|
31
33
|
|
|
32
34
|
var _react3 = require("@emotion/react");
|
|
33
35
|
|
|
@@ -162,9 +164,11 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
162
164
|
if (!_this.timeoutId) {
|
|
163
165
|
_this.timeoutId = setTimeout(function () {
|
|
164
166
|
(0, _react2.enqueueStateChange)(function () {
|
|
165
|
-
|
|
167
|
+
_this.setState({
|
|
166
168
|
visible: true
|
|
167
169
|
});
|
|
170
|
+
|
|
171
|
+
_tool_tip_manager.toolTipManager.registerTooltip(_this.hideToolTip);
|
|
168
172
|
});
|
|
169
173
|
}, delayToMsMap[_this.props.delay]);
|
|
170
174
|
}
|
|
@@ -225,6 +229,8 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
225
229
|
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
226
230
|
arrowStyles: undefined
|
|
227
231
|
});
|
|
232
|
+
|
|
233
|
+
_tool_tip_manager.toolTipManager.deregisterToolTip(_this.hideToolTip);
|
|
228
234
|
}
|
|
229
235
|
});
|
|
230
236
|
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toolTipManager = void 0;
|
|
7
|
+
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
|
|
10
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Manager utility that ensures only one tooltip is visible at a time
|
|
22
|
+
*
|
|
23
|
+
* UX rationale (primarily for mouse-only users):
|
|
24
|
+
* @see https://github.com/elastic/kibana/issues/144482
|
|
25
|
+
* @see https://github.com/elastic/eui/issues/5883
|
|
26
|
+
*/
|
|
27
|
+
var ToolTipManager = function ToolTipManager() {
|
|
28
|
+
var _this = this;
|
|
29
|
+
|
|
30
|
+
_classCallCheck(this, ToolTipManager);
|
|
31
|
+
|
|
32
|
+
_defineProperty(this, "toolTipsToHide", new Set());
|
|
33
|
+
|
|
34
|
+
_defineProperty(this, "registerTooltip", function (hideCallback) {
|
|
35
|
+
_this.toolTipsToHide.forEach(function (hide) {
|
|
36
|
+
return hide();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
_this.toolTipsToHide.clear();
|
|
40
|
+
|
|
41
|
+
_this.toolTipsToHide.add(hideCallback);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
_defineProperty(this, "deregisterToolTip", function (hideCallback) {
|
|
45
|
+
_this.toolTipsToHide.delete(hideCallback);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var toolTipManager = new ToolTipManager();
|
|
50
|
+
exports.toolTipManager = toolTipManager;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getSecureRelForTarget = void 0;
|
|
7
7
|
|
|
8
|
-
var _url = require("../url");
|
|
9
|
-
|
|
10
8
|
/*
|
|
11
9
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
10
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -20,18 +18,13 @@ var _url = require("../url");
|
|
|
20
18
|
* https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
|
|
21
19
|
*/
|
|
22
20
|
var getSecureRelForTarget = function getSecureRelForTarget(_ref) {
|
|
23
|
-
var
|
|
24
|
-
_ref$target = _ref.target,
|
|
21
|
+
var _ref$target = _ref.target,
|
|
25
22
|
target = _ref$target === void 0 ? '' : _ref$target,
|
|
26
23
|
rel = _ref.rel;
|
|
27
|
-
var isElasticHref = !!href && (0, _url.isDomainSecure)(href);
|
|
28
24
|
var relParts = !!rel ? rel.split(' ').filter(function (part) {
|
|
29
25
|
return !!part.length && part !== 'noreferrer';
|
|
30
26
|
}) : [];
|
|
31
|
-
|
|
32
|
-
if (!isElasticHref) {
|
|
33
|
-
relParts.push('noreferrer');
|
|
34
|
-
}
|
|
27
|
+
relParts.push('noreferrer');
|
|
35
28
|
|
|
36
29
|
if (target.includes('_blank') && relParts.indexOf('noopener') === -1) {
|
|
37
30
|
relParts.push('noopener');
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.withEuiTheme = exports.useEuiTheme = void 0;
|
|
8
|
+
exports.withEuiTheme = exports.useEuiTheme = exports.RenderWithEuiTheme = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -22,6 +22,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
22
22
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
23
|
|
|
24
24
|
var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
|
|
25
|
+
/**
|
|
26
|
+
* Hook for function components
|
|
27
|
+
*/
|
|
25
28
|
|
|
26
29
|
var useEuiTheme = function useEuiTheme() {
|
|
27
30
|
var theme = (0, _react.useContext)(_context.EuiThemeContext);
|
|
@@ -57,6 +60,10 @@ var useEuiTheme = function useEuiTheme() {
|
|
|
57
60
|
}, [theme, colorMode, modifications]);
|
|
58
61
|
return assembledTheme;
|
|
59
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* HOC for class components
|
|
65
|
+
*/
|
|
66
|
+
|
|
60
67
|
|
|
61
68
|
exports.useEuiTheme = useEuiTheme;
|
|
62
69
|
|
|
@@ -77,5 +84,18 @@ var withEuiTheme = function withEuiTheme(Component) {
|
|
|
77
84
|
WithEuiTheme.displayName = componentName;
|
|
78
85
|
return WithEuiTheme;
|
|
79
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Render prop alternative for complex class components
|
|
89
|
+
* Most useful for scenarios where a HOC may interfere with typing
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
exports.withEuiTheme = withEuiTheme;
|
|
94
|
+
|
|
95
|
+
var RenderWithEuiTheme = function RenderWithEuiTheme(_ref) {
|
|
96
|
+
var children = _ref.children;
|
|
97
|
+
var theme = useEuiTheme();
|
|
98
|
+
return children(theme);
|
|
99
|
+
};
|
|
80
100
|
|
|
81
|
-
exports.
|
|
101
|
+
exports.RenderWithEuiTheme = RenderWithEuiTheme;
|
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "EuiThemeProvider", {
|
|
|
45
45
|
return _provider.EuiThemeProvider;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "RenderWithEuiTheme", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _hooks.RenderWithEuiTheme;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "buildTheme", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function get() {
|