@elastic/eui 72.1.0 → 73.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/CHANGELOG.md +6185 -0
- package/dist/eui_theme_dark.css +15 -15
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +15 -15
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +1 -1
- 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/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/es/components/image/image.js +9 -2
- package/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/es/components/image/image_wrapper.js +3 -1
- package/es/components/markdown_editor/markdown_format.styles.js +2 -5
- 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/text/text.styles.js +6 -3
- package/es/components/tool_tip/icon_tip.js +8 -0
- package/es/components/tool_tip/tool_tip.js +34 -6
- package/es/components/tool_tip/tool_tip_manager.js +42 -0
- package/es/components/tour/tour.styles.js +1 -1
- package/eui.d.ts +23 -1
- package/i18ntokens.json +36 -20
- package/lib/components/accordion/accordion.js +1 -1
- 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/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/lib/components/image/image.js +9 -2
- package/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/lib/components/image/image_wrapper.js +3 -1
- package/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- 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/text/text.styles.js +5 -2
- package/lib/components/tool_tip/icon_tip.js +8 -0
- package/lib/components/tool_tip/tool_tip.js +37 -8
- package/lib/components/tool_tip/tool_tip_manager.js +50 -0
- package/lib/components/tour/tour.styles.js +1 -1
- package/optimize/es/components/accordion/accordion.js +1 -1
- 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/image/image.js +4 -2
- package/optimize/es/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/es/components/image/image_wrapper.js +3 -1
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -5
- 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/text/text.styles.js +6 -3
- package/optimize/es/components/tool_tip/tool_tip.js +26 -6
- package/optimize/es/components/tool_tip/tool_tip_manager.js +41 -0
- package/optimize/es/components/tour/tour.styles.js +1 -1
- package/optimize/lib/components/accordion/accordion.js +1 -1
- 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/image/image.js +4 -2
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +3 -1
- package/optimize/lib/components/image/image_wrapper.js +3 -1
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +1 -4
- 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/text/text.styles.js +5 -2
- package/optimize/lib/components/tool_tip/tool_tip.js +29 -8
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +49 -0
- package/optimize/lib/components/tour/tour.styles.js +1 -1
- package/package.json +2 -2
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +14 -13
- package/src/components/date_picker/react-datepicker/LICENSE +21 -0
- package/src/components/date_picker/react-datepicker/README.md +168 -0
- package/src/components/markdown_editor/_markdown_format.scss +0 -4
- package/src/services/theme/README.md +153 -0
- package/src/test/README.md +59 -0
- package/test-env/components/accordion/accordion.js +1 -1
- 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/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +8 -0
- package/test-env/components/image/image.js +9 -2
- package/test-env/components/image/image_fullscreen_wrapper.js +3 -1
- package/test-env/components/image/image_wrapper.js +3 -1
- package/test-env/components/markdown_editor/markdown_format.styles.js +1 -4
- 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/text/text.styles.js +5 -2
- package/test-env/components/tool_tip/icon_tip.js +8 -0
- package/test-env/components/tool_tip/tool_tip.js +37 -8
- package/test-env/components/tool_tip/tool_tip_manager.js +49 -0
- package/test-env/components/tour/tour.styles.js +1 -1
|
@@ -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
|
+
});
|
|
@@ -66,7 +66,10 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
66
66
|
return x * 2;
|
|
67
67
|
});
|
|
68
68
|
var headingMarginBottom = marginSize;
|
|
69
|
-
|
|
69
|
+
var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
70
|
+
return x / 4;
|
|
71
|
+
});
|
|
72
|
+
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(fontSize)), "\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
|
|
70
73
|
_customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
|
|
71
74
|
};
|
|
72
75
|
/**
|
|
@@ -77,7 +80,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
77
80
|
var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
78
81
|
var euiTheme = euiThemeContext.euiTheme;
|
|
79
82
|
return {
|
|
80
|
-
euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote
|
|
83
|
+
euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
81
84
|
return x / 2;
|
|
82
85
|
}), ";};label:euiText;"),
|
|
83
86
|
constrainedWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
@@ -93,6 +93,14 @@ EuiIconTip.propTypes = {
|
|
|
93
93
|
*/
|
|
94
94
|
id: _propTypes.default.string,
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
98
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
99
|
+
*
|
|
100
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
101
|
+
*/
|
|
102
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
103
|
+
|
|
96
104
|
/**
|
|
97
105
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
98
106
|
* hidden.
|
|
@@ -15,23 +15,25 @@ 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
|
|
|
34
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
36
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
35
37
|
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
39
|
|
|
@@ -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
|
});
|
|
@@ -266,18 +272,32 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
266
272
|
key: "componentDidMount",
|
|
267
273
|
value: function componentDidMount() {
|
|
268
274
|
this._isMounted = true;
|
|
275
|
+
|
|
276
|
+
if (this.props.repositionOnScroll) {
|
|
277
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
278
|
+
}
|
|
269
279
|
}
|
|
270
280
|
}, {
|
|
271
281
|
key: "componentWillUnmount",
|
|
272
282
|
value: function componentWillUnmount() {
|
|
273
283
|
this.clearAnimationTimeout();
|
|
274
284
|
this._isMounted = false;
|
|
285
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
275
286
|
}
|
|
276
287
|
}, {
|
|
277
288
|
key: "componentDidUpdate",
|
|
278
289
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
279
290
|
if (prevState.visible === false && this.state.visible === true) {
|
|
280
291
|
requestAnimationFrame(this.testAnchor);
|
|
292
|
+
} // update scroll listener
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
if (prevProps.repositionOnScroll !== this.props.repositionOnScroll) {
|
|
296
|
+
if (this.props.repositionOnScroll) {
|
|
297
|
+
window.addEventListener('scroll', this.positionToolTip, true);
|
|
298
|
+
} else {
|
|
299
|
+
window.removeEventListener('scroll', this.positionToolTip, true);
|
|
300
|
+
}
|
|
281
301
|
}
|
|
282
302
|
}
|
|
283
303
|
}, {
|
|
@@ -292,6 +312,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
292
312
|
title = _this$props.title,
|
|
293
313
|
delay = _this$props.delay,
|
|
294
314
|
display = _this$props.display,
|
|
315
|
+
repositionOnScroll = _this$props.repositionOnScroll,
|
|
295
316
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
296
317
|
|
|
297
318
|
var _this$state = this.state,
|
|
@@ -402,6 +423,14 @@ EuiToolTip.propTypes = {
|
|
|
402
423
|
*/
|
|
403
424
|
position: _propTypes.default.oneOf(["top", "right", "bottom", "left"]).isRequired,
|
|
404
425
|
|
|
426
|
+
/**
|
|
427
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
428
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
429
|
+
*
|
|
430
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
431
|
+
*/
|
|
432
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
433
|
+
|
|
405
434
|
/**
|
|
406
435
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
407
436
|
* hidden.
|
|
@@ -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;
|
|
@@ -67,7 +67,7 @@ var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
|
67
67
|
euiTourHeader: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', 'none'), ";", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
68
68
|
// Elements
|
|
69
69
|
euiTourHeader__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
70
|
-
euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:euiTourHeader__subtitle;")
|
|
70
|
+
euiTourHeader__subtitle: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -221,7 +221,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
221
221
|
css: cssSpinnerStyles
|
|
222
222
|
}), ___EmotionJSX(EuiText, {
|
|
223
223
|
size: "s"
|
|
224
|
-
}, ___EmotionJSX("p", null, isLoadingMessage
|
|
224
|
+
}, ___EmotionJSX("p", null, isLoadingMessage !== true ? isLoadingMessage : ___EmotionJSX(EuiI18n, {
|
|
225
225
|
token: "euiAccordion.isLoading",
|
|
226
226
|
default: "Loading"
|
|
227
227
|
}))));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
|
|
4
5
|
/*
|
|
@@ -11,7 +12,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
11
12
|
import React, { Fragment, useState, useMemo, useCallback } from 'react';
|
|
12
13
|
import classNames from 'classnames';
|
|
13
14
|
import { EuiPopover, EuiPopoverFooter, EuiPopoverTitle } from '../../popover';
|
|
14
|
-
import { EuiI18n } from '../../i18n';
|
|
15
|
+
import { EuiI18n, useEuiI18n } from '../../i18n';
|
|
15
16
|
import { EuiButtonEmpty } from '../../button';
|
|
16
17
|
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
|
|
17
18
|
import { EuiSwitch, EuiFieldText } from '../../form';
|
|
@@ -79,6 +80,8 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
79
80
|
}, [sortedColumns, columnSearchText, displayValues]);
|
|
80
81
|
var isDragEnabled = allowColumnReorder && columnSearchText.length === 0; // only allow drag-and-drop when not filtering columns
|
|
81
82
|
|
|
83
|
+
var dragHandleAriaLabel = useEuiI18n('euiColumnSelector.dragHandleAriaLabel', 'Drag handle');
|
|
84
|
+
|
|
82
85
|
var buttonText = ___EmotionJSX(EuiI18n, {
|
|
83
86
|
token: "euiColumnSelector.button",
|
|
84
87
|
default: "Columns"
|
|
@@ -151,18 +154,23 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
151
154
|
key: id,
|
|
152
155
|
draggableId: id,
|
|
153
156
|
index: index,
|
|
154
|
-
isDragDisabled: !isDragEnabled
|
|
157
|
+
isDragDisabled: !isDragEnabled,
|
|
158
|
+
hasInteractiveChildren: true,
|
|
159
|
+
customDragHandle: true
|
|
155
160
|
}, function (provided, state) {
|
|
156
161
|
return ___EmotionJSX("div", {
|
|
157
162
|
className: "euiDataGridColumnSelector__item ".concat(state.isDragging && 'euiDataGridColumnSelector__item-isDragging'),
|
|
158
163
|
"data-test-subj": "dataGridColumnSelectorColumnItem-".concat(id)
|
|
159
164
|
}, ___EmotionJSX(EuiFlexGroup, {
|
|
160
165
|
responsive: false,
|
|
161
|
-
gutterSize: "
|
|
166
|
+
gutterSize: "s",
|
|
162
167
|
alignItems: "center"
|
|
163
|
-
},
|
|
168
|
+
}, allowColumnHiding && ___EmotionJSX(EuiFlexItem, {
|
|
169
|
+
grow: false
|
|
170
|
+
}, ___EmotionJSX(EuiSwitch, {
|
|
164
171
|
name: id,
|
|
165
172
|
label: displayValues[id] || id,
|
|
173
|
+
showLabel: false,
|
|
166
174
|
checked: visibleColumnIds.has(id),
|
|
167
175
|
compressed: true,
|
|
168
176
|
className: "euiSwitch--mini",
|
|
@@ -174,11 +182,18 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
174
182
|
setVisibleColumns(nextVisibleColumns);
|
|
175
183
|
},
|
|
176
184
|
"data-test-subj": "dataGridColumnSelectorToggleColumnVisibility-".concat(id)
|
|
177
|
-
})
|
|
185
|
+
})), ___EmotionJSX(EuiFlexItem // This extra column name flex item affords the column more grabbable real estate
|
|
186
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
187
|
+
, _extends({}, provided.dragHandleProps, {
|
|
188
|
+
"aria-hidden": true,
|
|
189
|
+
tabIndex: -1
|
|
190
|
+
}), ___EmotionJSX("span", {
|
|
178
191
|
className: "euiDataGridColumnSelector__itemLabel"
|
|
179
|
-
}, id)), isDragEnabled && ___EmotionJSX(EuiFlexItem, {
|
|
192
|
+
}, displayValues[id] || id)), isDragEnabled && ___EmotionJSX(EuiFlexItem, _extends({
|
|
180
193
|
grow: false
|
|
181
|
-
},
|
|
194
|
+
}, provided.dragHandleProps, {
|
|
195
|
+
"aria-label": dragHandleAriaLabel
|
|
196
|
+
}), ___EmotionJSX(EuiIcon, {
|
|
182
197
|
type: "grab",
|
|
183
198
|
color: "subdued"
|
|
184
199
|
}))));
|
|
@@ -56,7 +56,9 @@ export var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSorting
|
|
|
56
56
|
var dragHandleAriaLabel = useEuiI18n('euiColumnSortingDraggable.dragHandleAriaLabel', 'Drag handle');
|
|
57
57
|
return ___EmotionJSX(EuiDraggable, _extends({
|
|
58
58
|
draggableId: id,
|
|
59
|
-
index: index
|
|
59
|
+
index: index,
|
|
60
|
+
hasInteractiveChildren: true,
|
|
61
|
+
customDragHandle: true
|
|
60
62
|
}, rest), function (provided, state) {
|
|
61
63
|
return ___EmotionJSX("div", {
|
|
62
64
|
className: "euiDataGridColumnSorting__item ".concat(state.isDragging && 'euiDataGridColumnSorting__item-isDragging')
|
|
@@ -98,18 +100,25 @@ export var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSorting
|
|
|
98
100
|
sorting.onSort(nextColumns);
|
|
99
101
|
}
|
|
100
102
|
});
|
|
101
|
-
})), ___EmotionJSX(EuiFlexItem, {
|
|
103
|
+
})), ___EmotionJSX(EuiFlexItem, _extends({
|
|
104
|
+
className: "euiDataGridColumnSorting__name" // This extra column name flex item affords the column more grabbable real estate
|
|
105
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
106
|
+
|
|
107
|
+
}, provided.dragHandleProps, {
|
|
108
|
+
tabIndex: -1,
|
|
109
|
+
"aria-hidden": true
|
|
110
|
+
}), ___EmotionJSX(EuiFlexGroup, {
|
|
111
|
+
gutterSize: "xs",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
responsive: false
|
|
114
|
+
}, ___EmotionJSX(EuiFlexItem, {
|
|
102
115
|
grow: false
|
|
103
116
|
}, ___EmotionJSX(EuiToken, {
|
|
104
117
|
color: schemaDetails != null ? schemaDetails.color : undefined,
|
|
105
118
|
iconType: schemaDetails != null ? schemaDetails.icon : 'tokenString'
|
|
106
|
-
})), ___EmotionJSX(EuiFlexItem, {
|
|
107
|
-
"aria-hidden": true
|
|
108
|
-
}, ___EmotionJSX(EuiText, {
|
|
119
|
+
})), ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiText, {
|
|
109
120
|
size: "xs"
|
|
110
|
-
}, ___EmotionJSX("p", null, display))), ___EmotionJSX(EuiFlexItem, {
|
|
111
|
-
className: "euiDataGridColumnSorting__orderButtons"
|
|
112
|
-
}, ___EmotionJSX(EuiI18n, {
|
|
121
|
+
}, ___EmotionJSX("p", null, display))))), ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiI18n, {
|
|
113
122
|
token: "euiColumnSortingDraggable.toggleLegend",
|
|
114
123
|
default: "Select sorting method for {display}",
|
|
115
124
|
values: {
|
|
@@ -167,7 +167,7 @@ describe('EuiDataGrid', function () {
|
|
|
167
167
|
it('has zero violations on first render', function () {
|
|
168
168
|
cy.checkAxe();
|
|
169
169
|
});
|
|
170
|
-
it('has zero violations when the columns
|
|
170
|
+
it('has zero violations when the columns visibility menu is open', function () {
|
|
171
171
|
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
172
172
|
cy.checkAxe();
|
|
173
173
|
});
|
|
@@ -220,9 +220,10 @@ describe('EuiDataGrid', function () {
|
|
|
220
220
|
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').find('button.euiButtonIcon').last().realClick();
|
|
221
221
|
cy.checkAxe();
|
|
222
222
|
});
|
|
223
|
-
it('has zero violations when the
|
|
223
|
+
it('has zero violations on sort and when the columns sorting menu is open', function () {
|
|
224
224
|
cy.get('button.euiDataGridHeaderCell__button').last().realClick();
|
|
225
225
|
cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
|
|
226
|
+
cy.get('button[data-test-subj="dataGridColumnSortingPopover"]').realClick();
|
|
226
227
|
cy.checkAxe();
|
|
227
228
|
});
|
|
228
229
|
it('has zero violations when fullscreen is open', function () {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin"];
|
|
5
|
+
var _excluded = ["className", "alt", "url", "src", "size", "hasShadow", "style", "wrapperProps", "fullScreenIconColor", "allowFullScreen", "caption", "float", "margin", "onFullScreen"];
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
@@ -38,6 +38,7 @@ export var EuiImage = function EuiImage(_ref) {
|
|
|
38
38
|
caption = _ref.caption,
|
|
39
39
|
float = _ref.float,
|
|
40
40
|
margin = _ref.margin,
|
|
41
|
+
onFullScreen = _ref.onFullScreen,
|
|
41
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
43
|
|
|
43
44
|
var _useState = useState(false),
|
|
@@ -68,7 +69,8 @@ export var EuiImage = function EuiImage(_ref) {
|
|
|
68
69
|
alt: alt,
|
|
69
70
|
caption: caption,
|
|
70
71
|
float: float,
|
|
71
|
-
margin: margin
|
|
72
|
+
margin: margin,
|
|
73
|
+
onFullScreen: onFullScreen
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
var commonImgProps = _objectSpread({
|