@elastic/eui 91.3.1 → 92.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -513
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -513
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +5 -5
- package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/es/components/filter_group/filter_button.js +20 -13
- package/es/components/filter_group/filter_button.styles.js +11 -20
- package/es/components/flyout/flyout.js +4 -4
- package/es/components/flyout/flyout_resizable.js +127 -0
- package/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/es/components/flyout/index.js +2 -1
- package/es/components/form/range/dual_range.js +15 -66
- package/es/components/form/range/range.js +6 -5
- package/es/components/form/range/range_slider.js +28 -22
- package/es/components/form/text_area/text_area.js +39 -3
- package/es/components/index.js +0 -2
- package/es/components/markdown_editor/markdown_editor.js +12 -13
- package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
- package/es/components/tree_view/tree_view.js +23 -25
- package/es/utils/prop_types/is.js +2 -2
- package/eui.d.ts +825 -1141
- package/i18ntokens.json +68 -338
- package/lib/components/basic_table/basic_table.js +5 -5
- package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/lib/components/filter_group/filter_button.js +20 -13
- package/lib/components/filter_group/filter_button.styles.js +11 -20
- package/lib/components/flyout/flyout.js +4 -4
- package/lib/components/flyout/flyout_resizable.js +136 -0
- package/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/lib/components/flyout/index.js +8 -1
- package/lib/components/form/range/dual_range.js +15 -66
- package/lib/components/form/range/range.js +6 -5
- package/lib/components/form/range/range_slider.js +27 -21
- package/lib/components/form/text_area/text_area.js +42 -3
- package/lib/components/index.js +0 -22
- package/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/lib/components/pagination/pagination_button.js +79 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/tree_view/tree_view.js +23 -25
- package/lib/utils/prop_types/is.js +2 -2
- package/optimize/es/components/basic_table/basic_table.js +5 -5
- package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/es/components/filter_group/filter_button.js +20 -13
- package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/es/components/flyout/flyout.js +4 -4
- package/optimize/es/components/flyout/flyout_resizable.js +121 -0
- package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
- package/optimize/es/components/flyout/index.js +2 -1
- package/optimize/es/components/form/range/dual_range.js +15 -66
- package/optimize/es/components/form/range/range.js +6 -5
- package/optimize/es/components/form/range/range_slider.js +26 -21
- package/optimize/es/components/form/text_area/text_area.js +29 -3
- package/optimize/es/components/index.js +0 -2
- package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/es/components/tree_view/tree_view.js +23 -25
- package/optimize/es/utils/prop_types/is.js +2 -2
- package/optimize/lib/components/basic_table/basic_table.js +5 -5
- package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/optimize/lib/components/filter_group/filter_button.js +20 -13
- package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
- package/optimize/lib/components/flyout/flyout.js +4 -4
- package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
- package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
- package/optimize/lib/components/flyout/index.js +8 -1
- package/optimize/lib/components/form/range/dual_range.js +15 -66
- package/optimize/lib/components/form/range/range.js +6 -5
- package/optimize/lib/components/form/range/range_slider.js +26 -21
- package/optimize/lib/components/form/text_area/text_area.js +32 -3
- package/optimize/lib/components/index.js +0 -22
- package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
- package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/optimize/lib/components/tree_view/tree_view.js +23 -25
- package/optimize/lib/utils/prop_types/is.js +2 -2
- package/package.json +2 -2
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +5 -5
- package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
- package/test-env/components/filter_group/filter_button.js +20 -13
- package/test-env/components/filter_group/filter_button.styles.js +11 -20
- package/test-env/components/flyout/flyout_resizable.js +131 -0
- package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
- package/test-env/components/flyout/index.js +8 -1
- package/test-env/components/form/range/dual_range.js +15 -66
- package/test-env/components/form/range/range.js +6 -5
- package/test-env/components/form/range/range_slider.js +27 -21
- package/test-env/components/form/text_area/text_area.js +42 -3
- package/test-env/components/index.js +0 -22
- package/test-env/components/markdown_editor/markdown_editor.js +12 -13
- package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
- package/test-env/components/pagination/pagination_button.js +79 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/tree_view/tree_view.js +23 -25
- package/test-env/utils/prop_types/is.js +2 -2
- package/es/components/control_bar/control_bar.a11y.js +0 -133
- package/es/components/control_bar/control_bar.js +0 -609
- package/es/components/control_bar/index.js +0 -9
- package/es/components/notification/index.js +0 -9
- package/es/components/notification/notification_event.a11y.js +0 -104
- package/es/components/notification/notification_event.js +0 -288
- package/es/components/notification/notification_event_messages.js +0 -79
- package/es/components/notification/notification_event_meta.js +0 -148
- package/es/components/notification/notification_event_read_button.js +0 -86
- package/es/components/notification/notification_event_read_icon.js +0 -77
- package/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/lib/components/control_bar/control_bar.js +0 -441
- package/lib/components/control_bar/index.js +0 -12
- package/lib/components/notification/index.js +0 -12
- package/lib/components/notification/notification_event.a11y.js +0 -105
- package/lib/components/notification/notification_event.js +0 -297
- package/lib/components/notification/notification_event_messages.js +0 -88
- package/lib/components/notification/notification_event_meta.js +0 -157
- package/lib/components/notification/notification_event_read_button.js +0 -93
- package/lib/components/notification/notification_event_read_icon.js +0 -64
- package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
- package/optimize/es/components/control_bar/control_bar.js +0 -308
- package/optimize/es/components/control_bar/index.js +0 -9
- package/optimize/es/components/notification/index.js +0 -9
- package/optimize/es/components/notification/notification_event.a11y.js +0 -99
- package/optimize/es/components/notification/notification_event.js +0 -114
- package/optimize/es/components/notification/notification_event_messages.js +0 -63
- package/optimize/es/components/notification/notification_event_meta.js +0 -106
- package/optimize/es/components/notification/notification_event_read_button.js +0 -44
- package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
- package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
- package/optimize/lib/components/control_bar/control_bar.js +0 -301
- package/optimize/lib/components/control_bar/index.js +0 -12
- package/optimize/lib/components/notification/index.js +0 -12
- package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
- package/optimize/lib/components/notification/notification_event.js +0 -123
- package/optimize/lib/components/notification/notification_event_messages.js +0 -74
- package/optimize/lib/components/notification/notification_event_meta.js +0 -117
- package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
- package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
- package/src/components/control_bar/_control_bar.scss +0 -232
- package/src/components/control_bar/_index.scss +0 -2
- package/src/components/control_bar/_variables.scss +0 -12
- package/src/components/notification/_index.scss +0 -5
- package/src/components/notification/_notification_event.scss +0 -40
- package/src/components/notification/_notification_event_messages.scss +0 -17
- package/src/components/notification/_notification_event_meta.scss +0 -44
- package/src/components/notification/_notification_event_read_button.scss +0 -5
- package/src/components/notification/_notification_event_read_icon.scss +0 -12
- package/test-env/components/control_bar/control_bar.a11y.js +0 -134
- package/test-env/components/control_bar/control_bar.js +0 -436
- package/test-env/components/control_bar/index.js +0 -12
- package/test-env/components/notification/index.js +0 -12
- package/test-env/components/notification/notification_event.a11y.js +0 -105
- package/test-env/components/notification/notification_event.js +0 -296
- package/test-env/components/notification/notification_event_messages.js +0 -85
- package/test-env/components/notification/notification_event_meta.js +0 -154
- package/test-env/components/notification/notification_event_read_button.js +0 -92
- package/test-env/components/notification/notification_event_read_icon.js +0 -63
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
6
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
-
var _context_menu = require("../context_menu");
|
|
8
|
-
var _notification_event = require("./notification_event");
|
|
9
|
-
var _panel = require("../panel");
|
|
10
|
-
var _react2 = require("@emotion/react");
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
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
|
-
|
|
21
|
-
/// <reference types="cypress" />
|
|
22
|
-
/// <reference types="cypress-real-events" />
|
|
23
|
-
/// <reference types="../../../cypress/support" />
|
|
24
|
-
|
|
25
|
-
var NotificationEvent = function NotificationEvent() {
|
|
26
|
-
var _useState = (0, _react.useState)(false),
|
|
27
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
|
-
isRead = _useState2[0],
|
|
29
|
-
setIsRead = _useState2[1];
|
|
30
|
-
var onRead = function onRead(id, isRead) {
|
|
31
|
-
setIsRead(!isRead);
|
|
32
|
-
};
|
|
33
|
-
var onOpenContextMenu = function onOpenContextMenu(id) {
|
|
34
|
-
return [(0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
35
|
-
key: "contextMenuItemA",
|
|
36
|
-
onClick: function onClick() {
|
|
37
|
-
return onRead(id, isRead);
|
|
38
|
-
}
|
|
39
|
-
}, isRead ? 'Mark as unread' : 'Mark as read'), (0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
40
|
-
key: "contextMenuItemB",
|
|
41
|
-
onClick: function onClick() {}
|
|
42
|
-
}, "View messages like this"), (0, _react2.jsx)(_context_menu.EuiContextMenuItem, {
|
|
43
|
-
key: "contextMenuItemC",
|
|
44
|
-
onClick: function onClick() {}
|
|
45
|
-
}, "Don\u2019t notify me about this")];
|
|
46
|
-
};
|
|
47
|
-
return (0, _react2.jsx)(_panel.EuiPanel, {
|
|
48
|
-
paddingSize: "none",
|
|
49
|
-
hasShadow: true,
|
|
50
|
-
style: {
|
|
51
|
-
maxWidth: '540px'
|
|
52
|
-
}
|
|
53
|
-
}, (0, _react2.jsx)(_notification_event.EuiNotificationEvent, {
|
|
54
|
-
id: "cy-eui-notification-1",
|
|
55
|
-
type: "Report",
|
|
56
|
-
iconType: "logoKibana",
|
|
57
|
-
iconAriaLabel: "Kibana",
|
|
58
|
-
time: "1 min ago",
|
|
59
|
-
title: "[Error Monitoring Report] is generated",
|
|
60
|
-
primaryAction: "Download",
|
|
61
|
-
primaryActionProps: {
|
|
62
|
-
iconType: 'download'
|
|
63
|
-
},
|
|
64
|
-
messages: ['The reported was generated at 17:12:16 GMT+4'],
|
|
65
|
-
isRead: isRead,
|
|
66
|
-
onRead: onRead,
|
|
67
|
-
onOpenContextMenu: onOpenContextMenu,
|
|
68
|
-
onClickPrimaryAction: function onClickPrimaryAction() {},
|
|
69
|
-
onClickTitle: function onClickTitle() {}
|
|
70
|
-
}));
|
|
71
|
-
};
|
|
72
|
-
describe('EuiNotificationEvent', function () {
|
|
73
|
-
beforeEach(function () {
|
|
74
|
-
cy.viewport(1024, 768); // medium breakpoint
|
|
75
|
-
cy.realMount((0, _react2.jsx)(NotificationEvent, null));
|
|
76
|
-
cy.get('article.euiNotificationEvent').should('exist');
|
|
77
|
-
});
|
|
78
|
-
describe('Automated accessibility check', function () {
|
|
79
|
-
it('has zero violations on first render', function () {
|
|
80
|
-
cy.checkAxe();
|
|
81
|
-
});
|
|
82
|
-
it('has zero violations when popover is open', function () {
|
|
83
|
-
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
|
|
84
|
-
cy.get('div.euiPopover__panel').should('exist');
|
|
85
|
-
cy.checkAxe();
|
|
86
|
-
});
|
|
87
|
-
it('has zero violations after the Mark as read button is clicked', function () {
|
|
88
|
-
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
|
|
89
|
-
cy.get('div.euiPopover__panel').should('exist');
|
|
90
|
-
cy.get('div.euiPopover__panel button').first().realClick();
|
|
91
|
-
cy.checkAxe();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
describe('Keyboard accessibility', function () {
|
|
95
|
-
it('has zero violations when the popover is opened by keyboard', function () {
|
|
96
|
-
cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').focus();
|
|
97
|
-
cy.realPress('Enter');
|
|
98
|
-
cy.get('div.euiPopover__panel').should('exist');
|
|
99
|
-
cy.checkAxe();
|
|
100
|
-
cy.realPress('Escape');
|
|
101
|
-
cy.get('div.euiPopover__panel').should('not.exist');
|
|
102
|
-
cy.checkAxe();
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.EuiNotificationEvent = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
var _notification_event_meta = require("./notification_event_meta");
|
|
15
|
-
var _notification_event_messages = require("./notification_event_messages");
|
|
16
|
-
var _notification_event_read_button = require("./notification_event_read_button");
|
|
17
|
-
var _button = require("../button");
|
|
18
|
-
var _link = require("../link");
|
|
19
|
-
var _services = require("../../services");
|
|
20
|
-
var _notification_event_read_icon = require("./notification_event_read_icon");
|
|
21
|
-
var _react2 = require("@emotion/react");
|
|
22
|
-
var _excluded = ["id", "type", "severity", "badgeColor", "iconType", "iconAriaLabel", "time", "title", "isRead", "primaryAction", "primaryActionProps", "messages", "onRead", "onOpenContextMenu", "onClickTitle", "onClickPrimaryAction", "headingLevel", "className"];
|
|
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
|
-
/**
|
|
31
|
-
* @deprecated
|
|
32
|
-
*/
|
|
33
|
-
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); }
|
|
34
|
-
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; }
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated - EuiNotificationEvent is scheduled for deprecation due to low internal usage and high
|
|
37
|
-
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
38
|
-
*
|
|
39
|
-
* The component will be permanently removed in December 2023.
|
|
40
|
-
*/
|
|
41
|
-
var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
42
|
-
var id = _ref.id,
|
|
43
|
-
type = _ref.type,
|
|
44
|
-
severity = _ref.severity,
|
|
45
|
-
badgeColor = _ref.badgeColor,
|
|
46
|
-
iconType = _ref.iconType,
|
|
47
|
-
iconAriaLabel = _ref.iconAriaLabel,
|
|
48
|
-
time = _ref.time,
|
|
49
|
-
title = _ref.title,
|
|
50
|
-
isRead = _ref.isRead,
|
|
51
|
-
primaryAction = _ref.primaryAction,
|
|
52
|
-
primaryActionProps = _ref.primaryActionProps,
|
|
53
|
-
messages = _ref.messages,
|
|
54
|
-
onRead = _ref.onRead,
|
|
55
|
-
onOpenContextMenu = _ref.onOpenContextMenu,
|
|
56
|
-
onClickTitle = _ref.onClickTitle,
|
|
57
|
-
onClickPrimaryAction = _ref.onClickPrimaryAction,
|
|
58
|
-
_ref$headingLevel = _ref.headingLevel,
|
|
59
|
-
headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
|
|
60
|
-
className = _ref.className,
|
|
61
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
62
|
-
var classes = (0, _classnames.default)('euiNotificationEvent', {
|
|
63
|
-
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
64
|
-
}, className);
|
|
65
|
-
var classesTitle = (0, _classnames.default)('euiNotificationEvent__title', {
|
|
66
|
-
'euiNotificationEvent__title--isRead': isRead
|
|
67
|
-
});
|
|
68
|
-
var randomHeadingId = (0, _services.useGeneratedHtmlId)();
|
|
69
|
-
var titleProps = {
|
|
70
|
-
id: randomHeadingId,
|
|
71
|
-
className: classesTitle,
|
|
72
|
-
'data-test-subj': "".concat(id, "-notificationEventTitle")
|
|
73
|
-
};
|
|
74
|
-
return (0, _react2.jsx)("article", (0, _extends2.default)({
|
|
75
|
-
"aria-labelledby": randomHeadingId,
|
|
76
|
-
className: classes,
|
|
77
|
-
key: id
|
|
78
|
-
}, rest), typeof isRead === 'boolean' && (0, _react2.jsx)("div", {
|
|
79
|
-
className: "euiNotificationEvent__readButton"
|
|
80
|
-
}, !!onRead ? (0, _react2.jsx)(_notification_event_read_button.EuiNotificationEventReadButton, {
|
|
81
|
-
isRead: isRead,
|
|
82
|
-
onClick: function onClick() {
|
|
83
|
-
return onRead(id, isRead);
|
|
84
|
-
},
|
|
85
|
-
eventName: title,
|
|
86
|
-
id: id
|
|
87
|
-
}) : (0, _react2.jsx)(_notification_event_read_icon.EuiNotificationEventReadIcon, {
|
|
88
|
-
id: id,
|
|
89
|
-
isRead: isRead,
|
|
90
|
-
eventName: title
|
|
91
|
-
})), (0, _react2.jsx)("div", {
|
|
92
|
-
className: "euiNotificationEvent__content"
|
|
93
|
-
}, (0, _react2.jsx)(_notification_event_meta.EuiNotificationEventMeta, {
|
|
94
|
-
id: id,
|
|
95
|
-
type: type,
|
|
96
|
-
severity: severity,
|
|
97
|
-
badgeColor: badgeColor,
|
|
98
|
-
iconType: iconType,
|
|
99
|
-
iconAriaLabel: iconAriaLabel,
|
|
100
|
-
time: time,
|
|
101
|
-
onOpenContextMenu: onOpenContextMenu ? function () {
|
|
102
|
-
return onOpenContextMenu(id);
|
|
103
|
-
} : undefined,
|
|
104
|
-
eventName: title
|
|
105
|
-
}), onClickTitle ? (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({
|
|
106
|
-
onClick: function onClick() {
|
|
107
|
-
return onClickTitle(id);
|
|
108
|
-
}
|
|
109
|
-
}, titleProps), /*#__PURE__*/(0, _react.createElement)(headingLevel, null, title)) : /*#__PURE__*/(0, _react.createElement)(headingLevel, titleProps, title), (0, _react2.jsx)(_notification_event_messages.EuiNotificationEventMessages, {
|
|
110
|
-
messages: messages,
|
|
111
|
-
eventName: title
|
|
112
|
-
}), onClickPrimaryAction && primaryAction && (0, _react2.jsx)("div", {
|
|
113
|
-
className: "euiNotificationEvent__primaryAction"
|
|
114
|
-
}, (0, _react2.jsx)(_button.EuiButtonEmpty, (0, _extends2.default)({
|
|
115
|
-
flush: "left",
|
|
116
|
-
size: "s"
|
|
117
|
-
}, primaryActionProps, {
|
|
118
|
-
onClick: function onClick() {
|
|
119
|
-
return onClickPrimaryAction === null || onClickPrimaryAction === void 0 ? void 0 : onClickPrimaryAction(id);
|
|
120
|
-
},
|
|
121
|
-
"data-test-subj": "".concat(id, "-notificationEventPrimaryAction")
|
|
122
|
-
}), primaryAction))));
|
|
123
|
-
};
|
|
124
|
-
exports.EuiNotificationEvent = EuiNotificationEvent;
|
|
125
|
-
EuiNotificationEvent.propTypes = {
|
|
126
|
-
/**
|
|
127
|
-
* Type of event (e.g. "Alert", "Cloud", etc..). Shows inside a badge.
|
|
128
|
-
*/
|
|
129
|
-
type: _propTypes.default.string.isRequired,
|
|
130
|
-
/**
|
|
131
|
-
* Type of severity (e.g. "Critical", "Warning", etc..). Shows as a text after the `type` following the format "Alert: Critical".
|
|
132
|
-
*/
|
|
133
|
-
severity: _propTypes.default.string,
|
|
134
|
-
/**
|
|
135
|
-
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
136
|
-
*/
|
|
137
|
-
badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
|
|
138
|
-
/**
|
|
139
|
-
* The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
|
|
140
|
-
*/
|
|
141
|
-
iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
|
|
142
|
-
/**
|
|
143
|
-
* Specify an `aria-label` for the icon.
|
|
144
|
-
* If no `aria-label` is passed we assume the icon is purely decorative.
|
|
145
|
-
*/
|
|
146
|
-
iconAriaLabel: _propTypes.default.string,
|
|
147
|
-
/**
|
|
148
|
-
* Indicates when the event was received.
|
|
149
|
-
*/
|
|
150
|
-
time: _propTypes.default.node.isRequired,
|
|
151
|
-
"aria-label": _propTypes.default.string,
|
|
152
|
-
"aria-labelledby": _propTypes.default.string,
|
|
153
|
-
/**
|
|
154
|
-
* Size of the icon only.
|
|
155
|
-
* This will not affect the overall size of the button
|
|
156
|
-
*/
|
|
157
|
-
iconSize: _propTypes.default.any,
|
|
158
|
-
/**
|
|
159
|
-
* Sets the display style for matching other EuiButton types.
|
|
160
|
-
* `base` is equivalent to a typical EuiButton
|
|
161
|
-
* `fill` is equivalent to a filled EuiButton
|
|
162
|
-
* `empty` (default) is equivalent to an EuiButtonEmpty
|
|
163
|
-
*/
|
|
164
|
-
display: _propTypes.default.any,
|
|
165
|
-
/**
|
|
166
|
-
* Disables the button and changes the icon to a loading spinner
|
|
167
|
-
*/
|
|
168
|
-
isLoading: _propTypes.default.bool,
|
|
169
|
-
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
170
|
-
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
171
|
-
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
172
|
-
/**
|
|
173
|
-
* A unique identifier
|
|
174
|
-
*/
|
|
175
|
-
id: _propTypes.default.string.isRequired,
|
|
176
|
-
/**
|
|
177
|
-
* The title of the event.
|
|
178
|
-
*/
|
|
179
|
-
title: _propTypes.default.string.isRequired,
|
|
180
|
-
/**
|
|
181
|
-
* The heading level of the title.
|
|
182
|
-
*/
|
|
183
|
-
headingLevel: _propTypes.default.oneOf(["h2", "h3", "h4", "h5", "h6"]),
|
|
184
|
-
/**
|
|
185
|
-
* Returns the `id` and applies an `onClick` handler to the title.
|
|
186
|
-
*/
|
|
187
|
-
onClickTitle: _propTypes.default.func,
|
|
188
|
-
/**
|
|
189
|
-
* The label of the primary action
|
|
190
|
-
*/
|
|
191
|
-
primaryAction: _propTypes.default.string,
|
|
192
|
-
/**
|
|
193
|
-
* Apply more props to the `primaryAction` button. See #EuiPrimaryActionProps.
|
|
194
|
-
*/
|
|
195
|
-
primaryActionProps: _propTypes.default.shape({
|
|
196
|
-
href: _propTypes.default.string,
|
|
197
|
-
onClick: _propTypes.default.func,
|
|
198
|
-
/**
|
|
199
|
-
* Any of the named color palette options.
|
|
200
|
-
*/
|
|
201
|
-
color: _propTypes.default.any,
|
|
202
|
-
size: _propTypes.default.any,
|
|
203
|
-
/**
|
|
204
|
-
* Ensure the text of the button sits flush to the left, right, or both sides of its container
|
|
205
|
-
*/
|
|
206
|
-
/**
|
|
207
|
-
* Ensure the text of the button sits flush to the left, right, or both sides of its container
|
|
208
|
-
*/
|
|
209
|
-
flush: _propTypes.default.any,
|
|
210
|
-
/**
|
|
211
|
-
* `disabled` is also allowed
|
|
212
|
-
*/
|
|
213
|
-
/**
|
|
214
|
-
* `disabled` is also allowed
|
|
215
|
-
*/
|
|
216
|
-
isDisabled: _propTypes.default.bool,
|
|
217
|
-
/**
|
|
218
|
-
* Force disables the button and changes the icon to a loading spinner
|
|
219
|
-
*/
|
|
220
|
-
/**
|
|
221
|
-
* Force disables the button and changes the icon to a loading spinner
|
|
222
|
-
*/
|
|
223
|
-
isLoading: _propTypes.default.bool,
|
|
224
|
-
/**
|
|
225
|
-
* Applies the boolean state as the `aria-pressed` property to create a toggle button.
|
|
226
|
-
* *Only use when the readable text does not change between states.*
|
|
227
|
-
*/
|
|
228
|
-
/**
|
|
229
|
-
* Applies the boolean state as the `aria-pressed` property to create a toggle button.
|
|
230
|
-
* *Only use when the readable text does not change between states.*
|
|
231
|
-
*/
|
|
232
|
-
isSelected: _propTypes.default.bool,
|
|
233
|
-
target: _propTypes.default.string,
|
|
234
|
-
rel: _propTypes.default.string,
|
|
235
|
-
type: _propTypes.default.oneOf(["button", "submit"]),
|
|
236
|
-
buttonRef: _propTypes.default.any,
|
|
237
|
-
/**
|
|
238
|
-
* Object of props passed to the `<span>` wrapping the button's content
|
|
239
|
-
*/
|
|
240
|
-
/**
|
|
241
|
-
* Object of props passed to the `<span>` wrapping the button's content
|
|
242
|
-
*/
|
|
243
|
-
contentProps: _propTypes.default.shape({
|
|
244
|
-
className: _propTypes.default.string,
|
|
245
|
-
"aria-label": _propTypes.default.string,
|
|
246
|
-
"data-test-subj": _propTypes.default.string,
|
|
247
|
-
css: _propTypes.default.any
|
|
248
|
-
}),
|
|
249
|
-
/**
|
|
250
|
-
* Any `type` accepted by EuiIcon
|
|
251
|
-
*/
|
|
252
|
-
iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
|
|
253
|
-
/**
|
|
254
|
-
* Can only be one side `left` or `right`
|
|
255
|
-
*/
|
|
256
|
-
iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
|
|
257
|
-
/**
|
|
258
|
-
* Object of props passed to the `<span>` wrapping the content's text/children only (not icon)
|
|
259
|
-
*
|
|
260
|
-
* This span wrapper can be removed by passing `textProps={false}`.
|
|
261
|
-
*/
|
|
262
|
-
textProps: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
263
|
-
className: _propTypes.default.string,
|
|
264
|
-
"aria-label": _propTypes.default.string,
|
|
265
|
-
"data-test-subj": _propTypes.default.string,
|
|
266
|
-
css: _propTypes.default.any,
|
|
267
|
-
ref: _propTypes.default.any,
|
|
268
|
-
"data-text": _propTypes.default.string
|
|
269
|
-
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
270
|
-
iconSize: _propTypes.default.any,
|
|
271
|
-
className: _propTypes.default.string,
|
|
272
|
-
"aria-label": _propTypes.default.string,
|
|
273
|
-
"data-test-subj": _propTypes.default.string,
|
|
274
|
-
css: _propTypes.default.any
|
|
275
|
-
}),
|
|
276
|
-
/**
|
|
277
|
-
* Returns the `id` and applies an `onClick` handler to the `primaryAction`.
|
|
278
|
-
*/
|
|
279
|
-
onClickPrimaryAction: _propTypes.default.func,
|
|
280
|
-
/**
|
|
281
|
-
* Notification messages as an array of strings. More than one message wraps in an accordion.
|
|
282
|
-
*/
|
|
283
|
-
messages: _propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired,
|
|
284
|
-
/**
|
|
285
|
-
* Shows an indicator of the read state of the event. Leave as `undefined` to hide the indicator.
|
|
286
|
-
*/
|
|
287
|
-
isRead: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf([undefined])]),
|
|
288
|
-
/**
|
|
289
|
-
* Returns the `id` and `isRead` state. Applies an `onClick` handler to the `read` indicator.
|
|
290
|
-
*/
|
|
291
|
-
onRead: _propTypes.default.func,
|
|
292
|
-
/**
|
|
293
|
-
* Provided the `id` of the event must return an array of #EuiContextMenuItem elements.
|
|
294
|
-
*/
|
|
295
|
-
onOpenContextMenu: _propTypes.default.func
|
|
296
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.EuiNotificationEventMessages = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _accordion = require("../accordion");
|
|
13
|
-
var _services = require("../../services");
|
|
14
|
-
var _i18n = require("../i18n");
|
|
15
|
-
var _text = require("../text");
|
|
16
|
-
var _react2 = require("@emotion/react");
|
|
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
|
-
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; }
|
|
19
|
-
/*
|
|
20
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
22
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
23
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
|
-
* Side Public License, v 1.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
var EuiNotificationEventMessages = function EuiNotificationEventMessages(_ref) {
|
|
28
|
-
var messages = _ref.messages,
|
|
29
|
-
eventName = _ref.eventName;
|
|
30
|
-
var _useState = (0, _react.useState)(false),
|
|
31
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
|
-
isOpen = _useState2[0],
|
|
33
|
-
setIsOpen = _useState2[1];
|
|
34
|
-
var messagesLength = messages.length;
|
|
35
|
-
var accordionId = (0, _services.useGeneratedHtmlId)({
|
|
36
|
-
prefix: 'euiNotificationEventMessagesAccordion'
|
|
37
|
-
});
|
|
38
|
-
var accordionButtonText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionButtonText', '+ {messagesLength} more', {
|
|
39
|
-
messagesLength: messagesLength - 1
|
|
40
|
-
});
|
|
41
|
-
var accordionAriaLabelButtonText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionAriaLabelButtonText', '+ {messagesLength} messages for {eventName}', {
|
|
42
|
-
messagesLength: messagesLength - 1,
|
|
43
|
-
eventName: eventName
|
|
44
|
-
});
|
|
45
|
-
var accordionHideText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionHideText', 'hide');
|
|
46
|
-
var buttonContentText = isOpen ? "".concat(accordionButtonText, " (").concat(accordionHideText, ")") : accordionButtonText;
|
|
47
|
-
return (0, _react2.jsx)("div", {
|
|
48
|
-
className: "euiNotificationEventMessages"
|
|
49
|
-
}, messages && messagesLength === 1 ? (0, _react2.jsx)(_text.EuiText, {
|
|
50
|
-
size: "s",
|
|
51
|
-
color: "subdued"
|
|
52
|
-
}, (0, _react2.jsx)("p", null, messages)) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_text.EuiText, {
|
|
53
|
-
size: "s",
|
|
54
|
-
color: "subdued"
|
|
55
|
-
}, (0, _react2.jsx)("p", null, messages[0])), (0, _react2.jsx)(_accordion.EuiAccordion, {
|
|
56
|
-
onToggle: setIsOpen,
|
|
57
|
-
buttonProps: {
|
|
58
|
-
'aria-label': accordionAriaLabelButtonText
|
|
59
|
-
},
|
|
60
|
-
id: accordionId,
|
|
61
|
-
className: "euiNotificationEventMessages__accordion",
|
|
62
|
-
buttonContent: buttonContentText,
|
|
63
|
-
buttonClassName: "euiNotificationEventMessages__accordionButton",
|
|
64
|
-
arrowDisplay: "none"
|
|
65
|
-
}, (0, _react2.jsx)("div", {
|
|
66
|
-
className: "euiNotificationEventMessages__accordionContent"
|
|
67
|
-
}, messages.map(function (notification, index) {
|
|
68
|
-
return (0, _react2.jsx)(_text.EuiText, {
|
|
69
|
-
size: "s",
|
|
70
|
-
key: index,
|
|
71
|
-
color: "subdued"
|
|
72
|
-
}, (0, _react2.jsx)("p", null, notification));
|
|
73
|
-
}).slice(1)))));
|
|
74
|
-
};
|
|
75
|
-
exports.EuiNotificationEventMessages = EuiNotificationEventMessages;
|
|
76
|
-
EuiNotificationEventMessages.propTypes = {
|
|
77
|
-
/*
|
|
78
|
-
* An array of strings that get individually wrapped in `<p>` tags
|
|
79
|
-
*/
|
|
80
|
-
messages: _propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired,
|
|
81
|
-
/**
|
|
82
|
-
* A unique, human-friendly name for the event to be used in aria attributes (e.g. "alert-critical-01", "cloud-no-severity-12", etc..).
|
|
83
|
-
*/
|
|
84
|
-
eventName: _propTypes.default.string.isRequired
|
|
85
|
-
};
|