@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
|
@@ -39,7 +39,7 @@ var _text = require("../text");
|
|
|
39
39
|
|
|
40
40
|
var _react2 = require("@emotion/react");
|
|
41
41
|
|
|
42
|
-
var _excluded = ["children", "title", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
42
|
+
var _excluded = ["children", "title", "titleProps", "onCancel", "onConfirm", "cancelButtonText", "confirmButtonText", "confirmButtonDisabled", "className", "buttonColor", "defaultFocusedButton", "isLoading"];
|
|
43
43
|
|
|
44
44
|
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); }
|
|
45
45
|
|
|
@@ -53,6 +53,7 @@ exports.CANCEL_BUTTON = CANCEL_BUTTON;
|
|
|
53
53
|
var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
54
54
|
var children = _ref.children,
|
|
55
55
|
title = _ref.title,
|
|
56
|
+
titleProps = _ref.titleProps,
|
|
56
57
|
onCancel = _ref.onCancel,
|
|
57
58
|
onConfirm = _ref.onConfirm,
|
|
58
59
|
cancelButtonText = _ref.cancelButtonText,
|
|
@@ -104,9 +105,9 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
|
|
|
104
105
|
var modalTitle;
|
|
105
106
|
|
|
106
107
|
if (title) {
|
|
107
|
-
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, {
|
|
108
|
+
modalTitle = (0, _react2.jsx)(_modal_header.EuiModalHeader, null, (0, _react2.jsx)(_modal_header_title.EuiModalHeaderTitle, (0, _extends2.default)({
|
|
108
109
|
"data-test-subj": "confirmModalTitleText"
|
|
109
|
-
}, title));
|
|
110
|
+
}, titleProps), title));
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
var message;
|
|
@@ -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"))));
|
|
@@ -19,17 +19,19 @@ var _title = require("../title");
|
|
|
19
19
|
|
|
20
20
|
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
22
|
-
var _excluded = ["className", "children"];
|
|
22
|
+
var _excluded = ["className", "children", "component"];
|
|
23
23
|
|
|
24
24
|
var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
|
|
25
25
|
var className = _ref.className,
|
|
26
26
|
children = _ref.children,
|
|
27
|
+
_ref$component = _ref.component,
|
|
28
|
+
Component = _ref$component === void 0 ? 'h1' : _ref$component,
|
|
27
29
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
30
|
var classes = (0, _classnames.default)('euiModalHeader__title', className);
|
|
29
31
|
return (0, _react2.jsx)(_title.EuiTitle, (0, _extends2.default)({
|
|
30
32
|
size: "m",
|
|
31
33
|
className: classes
|
|
32
|
-
}, rest),
|
|
34
|
+
}, rest), (0, _react2.jsx)(Component, null, children));
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
exports.EuiModalHeaderTitle = EuiModalHeaderTitle;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
|
|
11
|
+
var _context_menu = require("../context_menu");
|
|
12
|
+
|
|
13
|
+
var _notification_event = require("./notification_event");
|
|
14
|
+
|
|
15
|
+
var _panel = require("../panel");
|
|
16
|
+
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
18
|
+
|
|
19
|
+
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); }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
25
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
26
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
27
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
28
|
+
* Side Public License, v 1.
|
|
29
|
+
*/
|
|
30
|
+
/// <reference types="../../../cypress/support"/>
|
|
31
|
+
var NotificationEvent = function NotificationEvent() {
|
|
32
|
+
var _useState = (0, _react.useState)(false),
|
|
33
|
+
_useState2 = (0, _slicedToArray2.default)(_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 _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _button = require("../../button");
|
|
8
|
+
|
|
9
|
+
var _page_header = require("./page_header");
|
|
10
|
+
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
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
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
|
|
11
|
+
var _button = require("../button");
|
|
12
|
+
|
|
13
|
+
var _portal = require("./portal");
|
|
14
|
+
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
24
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
25
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
|
+
* Side Public License, v 1.
|
|
27
|
+
*/
|
|
28
|
+
/// <reference types="../../../cypress/support"/>
|
|
29
|
+
var Portal = function Portal() {
|
|
30
|
+
var _useState = (0, _react.useState)(false),
|
|
31
|
+
_useState2 = (0, _slicedToArray2.default)(_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
|
+
});
|
|
@@ -33,19 +33,21 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
33
33
|
|
|
34
34
|
var _common = require("../common");
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _services = require("../../services");
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _react2 = require("../../services/react");
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _resize_observer = require("../observer/resize_observer");
|
|
41
|
+
|
|
42
|
+
var _portal = require("../portal");
|
|
41
43
|
|
|
42
44
|
var _tool_tip_popover = require("./tool_tip_popover");
|
|
43
45
|
|
|
44
|
-
var
|
|
46
|
+
var _tool_tip_anchor = require("./tool_tip_anchor");
|
|
45
47
|
|
|
46
|
-
var
|
|
48
|
+
var _tool_tip_arrow = require("./tool_tip_arrow");
|
|
47
49
|
|
|
48
|
-
var
|
|
50
|
+
var _tool_tip_manager = require("./tool_tip_manager");
|
|
49
51
|
|
|
50
52
|
var _react3 = require("@emotion/react");
|
|
51
53
|
|
|
@@ -144,9 +146,11 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
144
146
|
if (!_this.timeoutId) {
|
|
145
147
|
_this.timeoutId = setTimeout(function () {
|
|
146
148
|
(0, _react2.enqueueStateChange)(function () {
|
|
147
|
-
|
|
149
|
+
_this.setState({
|
|
148
150
|
visible: true
|
|
149
151
|
});
|
|
152
|
+
|
|
153
|
+
_tool_tip_manager.toolTipManager.registerTooltip(_this.hideToolTip);
|
|
150
154
|
});
|
|
151
155
|
}, delayToMsMap[_this.props.delay]);
|
|
152
156
|
}
|
|
@@ -205,6 +209,8 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
205
209
|
toolTipStyles: DEFAULT_TOOLTIP_STYLES,
|
|
206
210
|
arrowStyles: undefined
|
|
207
211
|
});
|
|
212
|
+
|
|
213
|
+
_tool_tip_manager.toolTipManager.deregisterToolTip(_this.hideToolTip);
|
|
208
214
|
}
|
|
209
215
|
});
|
|
210
216
|
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.toolTipManager = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
16
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
17
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
18
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
19
|
+
* Side Public License, v 1.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Manager utility that ensures only one tooltip is visible at a time
|
|
24
|
+
*
|
|
25
|
+
* UX rationale (primarily for mouse-only users):
|
|
26
|
+
* @see https://github.com/elastic/kibana/issues/144482
|
|
27
|
+
* @see https://github.com/elastic/eui/issues/5883
|
|
28
|
+
*/
|
|
29
|
+
var ToolTipManager = function ToolTipManager() {
|
|
30
|
+
var _this = this;
|
|
31
|
+
|
|
32
|
+
(0, _classCallCheck2.default)(this, ToolTipManager);
|
|
33
|
+
(0, _defineProperty2.default)(this, "toolTipsToHide", new Set());
|
|
34
|
+
(0, _defineProperty2.default)(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
|
+
(0, _defineProperty2.default)(this, "deregisterToolTip", function (hideCallback) {
|
|
44
|
+
_this.toolTipsToHide.delete(hideCallback);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var toolTipManager = new ToolTipManager();
|
|
49
|
+
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');
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.withEuiTheme = exports.useEuiTheme = void 0;
|
|
10
|
+
exports.withEuiTheme = exports.useEuiTheme = exports.RenderWithEuiTheme = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -31,6 +31,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
31
31
|
* Side Public License, v 1.
|
|
32
32
|
*/
|
|
33
33
|
var providerMessage = "`EuiProvider` is missing which can result in negative effects.\nWrap your component in `EuiProvider`: https://ela.st/euiprovider.";
|
|
34
|
+
/**
|
|
35
|
+
* Hook for function components
|
|
36
|
+
*/
|
|
34
37
|
|
|
35
38
|
var useEuiTheme = function useEuiTheme() {
|
|
36
39
|
var theme = (0, _react.useContext)(_context.EuiThemeContext);
|
|
@@ -66,6 +69,10 @@ var useEuiTheme = function useEuiTheme() {
|
|
|
66
69
|
}, [theme, colorMode, modifications]);
|
|
67
70
|
return assembledTheme;
|
|
68
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* HOC for class components
|
|
74
|
+
*/
|
|
75
|
+
|
|
69
76
|
|
|
70
77
|
exports.useEuiTheme = useEuiTheme;
|
|
71
78
|
|
|
@@ -86,5 +93,18 @@ var withEuiTheme = function withEuiTheme(Component) {
|
|
|
86
93
|
WithEuiTheme.displayName = componentName;
|
|
87
94
|
return WithEuiTheme;
|
|
88
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Render prop alternative for complex class components
|
|
98
|
+
* Most useful for scenarios where a HOC may interfere with typing
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
exports.withEuiTheme = withEuiTheme;
|
|
103
|
+
|
|
104
|
+
var RenderWithEuiTheme = function RenderWithEuiTheme(_ref) {
|
|
105
|
+
var children = _ref.children;
|
|
106
|
+
var theme = useEuiTheme();
|
|
107
|
+
return children(theme);
|
|
108
|
+
};
|
|
89
109
|
|
|
90
|
-
exports.
|
|
110
|
+
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() {
|
package/package.json
CHANGED
|
@@ -20,23 +20,24 @@
|
|
|
20
20
|
outline-offset: -$euiFocusRingSize;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.
|
|
23
|
+
.euiDataGridColumnSorting__name {
|
|
24
24
|
@include euiBreakpoint('xs', 's') {
|
|
25
|
-
padding-
|
|
25
|
+
padding-right: $euiSizeXS;
|
|
26
26
|
}
|
|
27
|
-
padding-
|
|
27
|
+
padding-right: $euiSizeL;
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
.euiDataGridColumnSorting__order {
|
|
31
|
+
@include euiBreakpoint('xs', 's') {
|
|
32
|
+
min-width: unset;
|
|
33
|
+
}
|
|
34
|
+
min-width: 200px;
|
|
35
|
+
|
|
36
|
+
.euiButtonGroup__buttons {
|
|
34
37
|
border: none;
|
|
38
|
+
}
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// stylelint-disable-next-line declaration-no-important
|
|
39
|
-
font-size: $euiFontSizeXS !important;
|
|
40
|
-
}
|
|
40
|
+
.euiButtonGroupButton {
|
|
41
|
+
font-size: $euiFontSizeXS;
|
|
41
42
|
}
|
|
42
43
|
}
|