@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,301 +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.EuiControlBar = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
16
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
20
|
-
var _services = require("../../services");
|
|
21
|
-
var _accessibility = require("../accessibility");
|
|
22
|
-
var _breadcrumbs = require("../breadcrumbs");
|
|
23
|
-
var _button = require("../button");
|
|
24
|
-
var _i18n = require("../i18n");
|
|
25
|
-
var _icon = require("../icon");
|
|
26
|
-
var _portal = require("../portal");
|
|
27
|
-
var _react2 = require("@emotion/react");
|
|
28
|
-
var _excluded = ["children", "className", "showContent", "controls", "size", "leftOffset", "rightOffset", "maxHeight", "showOnMobile", "style", "position", "bodyClassName", "landmarkHeading"],
|
|
29
|
-
_excluded2 = ["controlType", "id", "color", "label", "className"],
|
|
30
|
-
_excluded3 = ["controlType", "id", "iconType", "className", "color", "onClick", "href"],
|
|
31
|
-
_excluded4 = ["controlType", "id", "text", "className"],
|
|
32
|
-
_excluded5 = ["controlType", "id", "label", "onClick", "className"],
|
|
33
|
-
_excluded6 = ["controlType", "id"];
|
|
34
|
-
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); }
|
|
35
|
-
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; }
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
38
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
39
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*
|
|
40
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
41
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
42
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
43
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
44
|
-
* Side Public License, v 1.
|
|
45
|
-
*/ /**
|
|
46
|
-
* Extends EuiButton excluding `size`. Requires `label` as the `children`.
|
|
47
|
-
*/ /**
|
|
48
|
-
* Creates a `button` visually styles as a tab.
|
|
49
|
-
* Requires `label` as the `children`.
|
|
50
|
-
* `onClick` must be provided to handle the content swapping.
|
|
51
|
-
*/ /**
|
|
52
|
-
* Extends EuiBreadcrumbs
|
|
53
|
-
*/ /**
|
|
54
|
-
* Simple div controlling color and size text output.
|
|
55
|
-
* Requires `label` as the `children`.
|
|
56
|
-
*/ /**
|
|
57
|
-
* Custom props specific to the icon control type
|
|
58
|
-
*/ /**
|
|
59
|
-
* Icon can extend EuiIcon
|
|
60
|
-
* Had to omit `onClick` as it's a valid prop of SVGElement
|
|
61
|
-
* Also omits `type` and `id` as these are also specific to icon control
|
|
62
|
-
*/ /**
|
|
63
|
-
* Icon can extend EuiButtonIcon
|
|
64
|
-
* Also omits `iconType` and `id` as these are also specific to icon control
|
|
65
|
-
*/ /**
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
/**
|
|
69
|
-
* @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
|
|
70
|
-
* overlap with other existing EUI components. We recommend using EuiBottomBar instead,
|
|
71
|
-
* or copying this component into your own application for usage if necessary.
|
|
72
|
-
*
|
|
73
|
-
* The component will be permanently removed in December 2023.
|
|
74
|
-
*/
|
|
75
|
-
var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
76
|
-
(0, _inherits2.default)(EuiControlBar, _Component);
|
|
77
|
-
var _super = _createSuper(EuiControlBar);
|
|
78
|
-
function EuiControlBar() {
|
|
79
|
-
var _this;
|
|
80
|
-
(0, _classCallCheck2.default)(this, EuiControlBar);
|
|
81
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
82
|
-
args[_key] = arguments[_key];
|
|
83
|
-
}
|
|
84
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
85
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bar", null);
|
|
86
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
87
|
-
selectedTab: ''
|
|
88
|
-
});
|
|
89
|
-
return _this;
|
|
90
|
-
}
|
|
91
|
-
(0, _createClass2.default)(EuiControlBar, [{
|
|
92
|
-
key: "componentDidMount",
|
|
93
|
-
value: function componentDidMount() {
|
|
94
|
-
if (this.props.position === 'fixed') {
|
|
95
|
-
var height = this.bar ? this.bar.clientHeight : -1;
|
|
96
|
-
document.body.style.paddingBottom = "".concat(height, "px");
|
|
97
|
-
if (this.props.bodyClassName) {
|
|
98
|
-
document.body.classList.add(this.props.bodyClassName);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}, {
|
|
103
|
-
key: "componentWillUnmount",
|
|
104
|
-
value: function componentWillUnmount() {
|
|
105
|
-
document.body.style.paddingBottom = '';
|
|
106
|
-
if (this.props.bodyClassName) {
|
|
107
|
-
document.body.classList.remove(this.props.bodyClassName);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
key: "render",
|
|
112
|
-
value: function render() {
|
|
113
|
-
var _this2 = this;
|
|
114
|
-
var _this$props = this.props,
|
|
115
|
-
children = _this$props.children,
|
|
116
|
-
className = _this$props.className,
|
|
117
|
-
showContent = _this$props.showContent,
|
|
118
|
-
controls = _this$props.controls,
|
|
119
|
-
size = _this$props.size,
|
|
120
|
-
leftOffset = _this$props.leftOffset,
|
|
121
|
-
rightOffset = _this$props.rightOffset,
|
|
122
|
-
maxHeight = _this$props.maxHeight,
|
|
123
|
-
showOnMobile = _this$props.showOnMobile,
|
|
124
|
-
style = _this$props.style,
|
|
125
|
-
position = _this$props.position,
|
|
126
|
-
bodyClassName = _this$props.bodyClassName,
|
|
127
|
-
landmarkHeading = _this$props.landmarkHeading,
|
|
128
|
-
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
129
|
-
var styles = _objectSpread(_objectSpread({}, style), {}, {
|
|
130
|
-
left: leftOffset,
|
|
131
|
-
right: rightOffset,
|
|
132
|
-
maxHeight: maxHeight
|
|
133
|
-
});
|
|
134
|
-
var classes = (0, _classnames.default)('euiControlBar', className, {
|
|
135
|
-
'euiControlBar-isOpen': showContent,
|
|
136
|
-
'euiControlBar--large': size === 'l',
|
|
137
|
-
'euiControlBar--medium': size === 'm',
|
|
138
|
-
'euiControlBar--small': size === 's',
|
|
139
|
-
'euiControlBar--fixed': position === 'fixed',
|
|
140
|
-
'euiControlBar--absolute': position === 'absolute',
|
|
141
|
-
'euiControlBar--relative': position === 'relative',
|
|
142
|
-
'euiControlBar--showOnMobile': showOnMobile
|
|
143
|
-
});
|
|
144
|
-
var handleTabClick = function handleTabClick(control, e) {
|
|
145
|
-
_this2.setState({
|
|
146
|
-
selectedTab: control.id
|
|
147
|
-
}, function () {
|
|
148
|
-
control.onClick(e);
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
var controlItem = function controlItem(control, index) {
|
|
152
|
-
switch (control.controlType) {
|
|
153
|
-
case 'button':
|
|
154
|
-
{
|
|
155
|
-
var controlType = control.controlType,
|
|
156
|
-
id = control.id,
|
|
157
|
-
color = control.color,
|
|
158
|
-
label = control.label,
|
|
159
|
-
_className = control.className,
|
|
160
|
-
_rest = (0, _objectWithoutProperties2.default)(control, _excluded2);
|
|
161
|
-
return (0, _react2.jsx)(_button.EuiButton, (0, _extends2.default)({
|
|
162
|
-
key: id + index,
|
|
163
|
-
className: (0, _classnames.default)('euiControlBar__button', _className),
|
|
164
|
-
color: color
|
|
165
|
-
}, _rest, {
|
|
166
|
-
size: "s"
|
|
167
|
-
}), label);
|
|
168
|
-
}
|
|
169
|
-
case 'icon':
|
|
170
|
-
{
|
|
171
|
-
var _controlType = control.controlType,
|
|
172
|
-
_id = control.id,
|
|
173
|
-
iconType = control.iconType,
|
|
174
|
-
_className2 = control.className,
|
|
175
|
-
_control$color = control.color,
|
|
176
|
-
_color = _control$color === void 0 ? 'text' : _control$color,
|
|
177
|
-
onClick = control.onClick,
|
|
178
|
-
href = control.href,
|
|
179
|
-
_rest2 = (0, _objectWithoutProperties2.default)(control, _excluded3);
|
|
180
|
-
return onClick || href ? (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
|
|
181
|
-
key: _id + index,
|
|
182
|
-
className: (0, _classnames.default)('euiControlBar__buttonIcon', _className2),
|
|
183
|
-
onClick: onClick,
|
|
184
|
-
href: href,
|
|
185
|
-
color: _color
|
|
186
|
-
}, _rest2, {
|
|
187
|
-
iconType: iconType
|
|
188
|
-
})) : (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
|
|
189
|
-
key: _id + index,
|
|
190
|
-
className: (0, _classnames.default)('euiControlBar__icon', _className2),
|
|
191
|
-
type: iconType,
|
|
192
|
-
color: _color
|
|
193
|
-
}, _rest2));
|
|
194
|
-
}
|
|
195
|
-
case 'divider':
|
|
196
|
-
return (0, _react2.jsx)("div", {
|
|
197
|
-
key: control.controlType + index,
|
|
198
|
-
className: "euiControlBar__divider"
|
|
199
|
-
});
|
|
200
|
-
case 'spacer':
|
|
201
|
-
return (0, _react2.jsx)("div", {
|
|
202
|
-
key: control.controlType + index,
|
|
203
|
-
className: "euiControlBar__spacer"
|
|
204
|
-
});
|
|
205
|
-
case 'text':
|
|
206
|
-
{
|
|
207
|
-
var _controlType2 = control.controlType,
|
|
208
|
-
_id2 = control.id,
|
|
209
|
-
text = control.text,
|
|
210
|
-
_className3 = control.className,
|
|
211
|
-
_rest3 = (0, _objectWithoutProperties2.default)(control, _excluded4);
|
|
212
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
213
|
-
key: _id2,
|
|
214
|
-
className: (0, _classnames.default)('euiControlBar__text', _className3)
|
|
215
|
-
}, _rest3), text);
|
|
216
|
-
}
|
|
217
|
-
case 'tab':
|
|
218
|
-
{
|
|
219
|
-
var _controlType3 = control.controlType,
|
|
220
|
-
_id3 = control.id,
|
|
221
|
-
_label = control.label,
|
|
222
|
-
_onClick = control.onClick,
|
|
223
|
-
_className4 = control.className,
|
|
224
|
-
_rest4 = (0, _objectWithoutProperties2.default)(control, _excluded5);
|
|
225
|
-
var tabClasses = (0, _classnames.default)('euiControlBar__tab', {
|
|
226
|
-
'euiControlBar__tab--active': showContent && _id3 === _this2.state.selectedTab
|
|
227
|
-
}, _className4);
|
|
228
|
-
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
229
|
-
key: _id3 + index,
|
|
230
|
-
className: tabClasses,
|
|
231
|
-
onClick: function onClick(event) {
|
|
232
|
-
return handleTabClick(control, event);
|
|
233
|
-
}
|
|
234
|
-
}, _rest4), _label);
|
|
235
|
-
}
|
|
236
|
-
case 'breadcrumbs':
|
|
237
|
-
{
|
|
238
|
-
var _controlType4 = control.controlType,
|
|
239
|
-
_id4 = control.id,
|
|
240
|
-
_rest5 = (0, _objectWithoutProperties2.default)(control, _excluded6);
|
|
241
|
-
return (0, _react2.jsx)(_breadcrumbs.EuiBreadcrumbs, (0, _extends2.default)({
|
|
242
|
-
className: "euiControlBar__breadcrumbs",
|
|
243
|
-
key: control.id
|
|
244
|
-
}, _rest5));
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var controlBar = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
249
|
-
token: "euiControlBar.screenReaderHeading",
|
|
250
|
-
default: "Page level controls"
|
|
251
|
-
}, function (screenReaderHeading) {
|
|
252
|
-
return (0, _react2.jsx)(_services.EuiThemeProvider, {
|
|
253
|
-
colorMode: "dark",
|
|
254
|
-
wrapperProps: {
|
|
255
|
-
cloneElement: true
|
|
256
|
-
}
|
|
257
|
-
}, (0, _react2.jsx)("section", (0, _extends2.default)({
|
|
258
|
-
className: classes
|
|
259
|
-
// Though it would be better to use aria-labelledby than aria-label
|
|
260
|
-
// and not repeat the same string twice, a bug in voiceover won't list
|
|
261
|
-
// some landmarks in the rotor without an aria-label
|
|
262
|
-
,
|
|
263
|
-
"aria-label": landmarkHeading ? landmarkHeading : screenReaderHeading
|
|
264
|
-
}, rest, {
|
|
265
|
-
style: styles
|
|
266
|
-
}), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("h2", null, landmarkHeading ? landmarkHeading : screenReaderHeading)), (0, _react2.jsx)("div", {
|
|
267
|
-
className: "euiControlBar__controls",
|
|
268
|
-
ref: function ref(node) {
|
|
269
|
-
_this2.bar = node;
|
|
270
|
-
}
|
|
271
|
-
}, controls.map(function (control, index) {
|
|
272
|
-
return controlItem(control, index);
|
|
273
|
-
})), _this2.props.showContent ? (0, _react2.jsx)("div", {
|
|
274
|
-
className: "euiControlBar__content"
|
|
275
|
-
}, children) : null));
|
|
276
|
-
});
|
|
277
|
-
return position === 'fixed' ? (0, _react2.jsx)(_portal.EuiPortal, null, controlBar, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
278
|
-
"aria-live": "assertive"
|
|
279
|
-
}, landmarkHeading ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
280
|
-
token: "euiControlBar.customScreenReaderAnnouncement",
|
|
281
|
-
default: "There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.",
|
|
282
|
-
values: {
|
|
283
|
-
landmarkHeading: landmarkHeading
|
|
284
|
-
}
|
|
285
|
-
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
286
|
-
token: "euiControlBar.screenReaderAnnouncement",
|
|
287
|
-
default: "There is a new region landmark with page level controls at the end of the document."
|
|
288
|
-
})))) : controlBar;
|
|
289
|
-
}
|
|
290
|
-
}]);
|
|
291
|
-
return EuiControlBar;
|
|
292
|
-
}(_react.Component);
|
|
293
|
-
exports.EuiControlBar = EuiControlBar;
|
|
294
|
-
(0, _defineProperty2.default)(EuiControlBar, "defaultProps", {
|
|
295
|
-
leftOffset: 0,
|
|
296
|
-
rightOffset: 0,
|
|
297
|
-
position: 'fixed',
|
|
298
|
-
size: 'l',
|
|
299
|
-
showContent: false,
|
|
300
|
-
showOnMobile: false
|
|
301
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "EuiControlBar", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _control_bar.EuiControlBar;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _control_bar = require("./control_bar");
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "EuiNotificationEvent", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _notification_event.EuiNotificationEvent;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _notification_event = require("./notification_event");
|
|
@@ -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,123 +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 _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _notification_event_meta = require("./notification_event_meta");
|
|
14
|
-
var _notification_event_messages = require("./notification_event_messages");
|
|
15
|
-
var _notification_event_read_button = require("./notification_event_read_button");
|
|
16
|
-
var _button = require("../button");
|
|
17
|
-
var _link = require("../link");
|
|
18
|
-
var _services = require("../../services");
|
|
19
|
-
var _notification_event_read_icon = require("./notification_event_read_icon");
|
|
20
|
-
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["id", "type", "severity", "badgeColor", "iconType", "iconAriaLabel", "time", "title", "isRead", "primaryAction", "primaryActionProps", "messages", "onRead", "onOpenContextMenu", "onClickTitle", "onClickPrimaryAction", "headingLevel", "className"];
|
|
22
|
-
/*
|
|
23
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
25
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
26
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
27
|
-
* Side Public License, v 1.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated
|
|
31
|
-
*/
|
|
32
|
-
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); }
|
|
33
|
-
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; }
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated - EuiNotificationEvent is scheduled for deprecation due to low internal usage and high
|
|
36
|
-
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
37
|
-
*
|
|
38
|
-
* The component will be permanently removed in December 2023.
|
|
39
|
-
*/
|
|
40
|
-
var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
41
|
-
var id = _ref.id,
|
|
42
|
-
type = _ref.type,
|
|
43
|
-
severity = _ref.severity,
|
|
44
|
-
badgeColor = _ref.badgeColor,
|
|
45
|
-
iconType = _ref.iconType,
|
|
46
|
-
iconAriaLabel = _ref.iconAriaLabel,
|
|
47
|
-
time = _ref.time,
|
|
48
|
-
title = _ref.title,
|
|
49
|
-
isRead = _ref.isRead,
|
|
50
|
-
primaryAction = _ref.primaryAction,
|
|
51
|
-
primaryActionProps = _ref.primaryActionProps,
|
|
52
|
-
messages = _ref.messages,
|
|
53
|
-
onRead = _ref.onRead,
|
|
54
|
-
onOpenContextMenu = _ref.onOpenContextMenu,
|
|
55
|
-
onClickTitle = _ref.onClickTitle,
|
|
56
|
-
onClickPrimaryAction = _ref.onClickPrimaryAction,
|
|
57
|
-
_ref$headingLevel = _ref.headingLevel,
|
|
58
|
-
headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
|
|
59
|
-
className = _ref.className,
|
|
60
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
61
|
-
var classes = (0, _classnames.default)('euiNotificationEvent', {
|
|
62
|
-
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
63
|
-
}, className);
|
|
64
|
-
var classesTitle = (0, _classnames.default)('euiNotificationEvent__title', {
|
|
65
|
-
'euiNotificationEvent__title--isRead': isRead
|
|
66
|
-
});
|
|
67
|
-
var randomHeadingId = (0, _services.useGeneratedHtmlId)();
|
|
68
|
-
var titleProps = {
|
|
69
|
-
id: randomHeadingId,
|
|
70
|
-
className: classesTitle,
|
|
71
|
-
'data-test-subj': "".concat(id, "-notificationEventTitle")
|
|
72
|
-
};
|
|
73
|
-
return (0, _react2.jsx)("article", (0, _extends2.default)({
|
|
74
|
-
"aria-labelledby": randomHeadingId,
|
|
75
|
-
className: classes,
|
|
76
|
-
key: id
|
|
77
|
-
}, rest), typeof isRead === 'boolean' && (0, _react2.jsx)("div", {
|
|
78
|
-
className: "euiNotificationEvent__readButton"
|
|
79
|
-
}, !!onRead ? (0, _react2.jsx)(_notification_event_read_button.EuiNotificationEventReadButton, {
|
|
80
|
-
isRead: isRead,
|
|
81
|
-
onClick: function onClick() {
|
|
82
|
-
return onRead(id, isRead);
|
|
83
|
-
},
|
|
84
|
-
eventName: title,
|
|
85
|
-
id: id
|
|
86
|
-
}) : (0, _react2.jsx)(_notification_event_read_icon.EuiNotificationEventReadIcon, {
|
|
87
|
-
id: id,
|
|
88
|
-
isRead: isRead,
|
|
89
|
-
eventName: title
|
|
90
|
-
})), (0, _react2.jsx)("div", {
|
|
91
|
-
className: "euiNotificationEvent__content"
|
|
92
|
-
}, (0, _react2.jsx)(_notification_event_meta.EuiNotificationEventMeta, {
|
|
93
|
-
id: id,
|
|
94
|
-
type: type,
|
|
95
|
-
severity: severity,
|
|
96
|
-
badgeColor: badgeColor,
|
|
97
|
-
iconType: iconType,
|
|
98
|
-
iconAriaLabel: iconAriaLabel,
|
|
99
|
-
time: time,
|
|
100
|
-
onOpenContextMenu: onOpenContextMenu ? function () {
|
|
101
|
-
return onOpenContextMenu(id);
|
|
102
|
-
} : undefined,
|
|
103
|
-
eventName: title
|
|
104
|
-
}), onClickTitle ? (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({
|
|
105
|
-
onClick: function onClick() {
|
|
106
|
-
return onClickTitle(id);
|
|
107
|
-
}
|
|
108
|
-
}, titleProps), /*#__PURE__*/(0, _react.createElement)(headingLevel, null, title)) : /*#__PURE__*/(0, _react.createElement)(headingLevel, titleProps, title), (0, _react2.jsx)(_notification_event_messages.EuiNotificationEventMessages, {
|
|
109
|
-
messages: messages,
|
|
110
|
-
eventName: title
|
|
111
|
-
}), onClickPrimaryAction && primaryAction && (0, _react2.jsx)("div", {
|
|
112
|
-
className: "euiNotificationEvent__primaryAction"
|
|
113
|
-
}, (0, _react2.jsx)(_button.EuiButtonEmpty, (0, _extends2.default)({
|
|
114
|
-
flush: "left",
|
|
115
|
-
size: "s"
|
|
116
|
-
}, primaryActionProps, {
|
|
117
|
-
onClick: function onClick() {
|
|
118
|
-
return onClickPrimaryAction === null || onClickPrimaryAction === void 0 ? void 0 : onClickPrimaryAction(id);
|
|
119
|
-
},
|
|
120
|
-
"data-test-subj": "".concat(id, "-notificationEventPrimaryAction")
|
|
121
|
-
}), primaryAction))));
|
|
122
|
-
};
|
|
123
|
-
exports.EuiNotificationEvent = EuiNotificationEvent;
|
|
@@ -1,74 +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 _accordion = require("../accordion");
|
|
12
|
-
var _services = require("../../services");
|
|
13
|
-
var _i18n = require("../i18n");
|
|
14
|
-
var _text = require("../text");
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
16
|
-
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); }
|
|
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
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
21
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
22
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
23
|
-
* Side Public License, v 1.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
var EuiNotificationEventMessages = function EuiNotificationEventMessages(_ref) {
|
|
27
|
-
var messages = _ref.messages,
|
|
28
|
-
eventName = _ref.eventName;
|
|
29
|
-
var _useState = (0, _react.useState)(false),
|
|
30
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
31
|
-
isOpen = _useState2[0],
|
|
32
|
-
setIsOpen = _useState2[1];
|
|
33
|
-
var messagesLength = messages.length;
|
|
34
|
-
var accordionId = (0, _services.useGeneratedHtmlId)({
|
|
35
|
-
prefix: 'euiNotificationEventMessagesAccordion'
|
|
36
|
-
});
|
|
37
|
-
var accordionButtonText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionButtonText', '+ {messagesLength} more', {
|
|
38
|
-
messagesLength: messagesLength - 1
|
|
39
|
-
});
|
|
40
|
-
var accordionAriaLabelButtonText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionAriaLabelButtonText', '+ {messagesLength} messages for {eventName}', {
|
|
41
|
-
messagesLength: messagesLength - 1,
|
|
42
|
-
eventName: eventName
|
|
43
|
-
});
|
|
44
|
-
var accordionHideText = (0, _i18n.useEuiI18n)('euiNotificationEventMessages.accordionHideText', 'hide');
|
|
45
|
-
var buttonContentText = isOpen ? "".concat(accordionButtonText, " (").concat(accordionHideText, ")") : accordionButtonText;
|
|
46
|
-
return (0, _react2.jsx)("div", {
|
|
47
|
-
className: "euiNotificationEventMessages"
|
|
48
|
-
}, messages && messagesLength === 1 ? (0, _react2.jsx)(_text.EuiText, {
|
|
49
|
-
size: "s",
|
|
50
|
-
color: "subdued"
|
|
51
|
-
}, (0, _react2.jsx)("p", null, messages)) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_text.EuiText, {
|
|
52
|
-
size: "s",
|
|
53
|
-
color: "subdued"
|
|
54
|
-
}, (0, _react2.jsx)("p", null, messages[0])), (0, _react2.jsx)(_accordion.EuiAccordion, {
|
|
55
|
-
onToggle: setIsOpen,
|
|
56
|
-
buttonProps: {
|
|
57
|
-
'aria-label': accordionAriaLabelButtonText
|
|
58
|
-
},
|
|
59
|
-
id: accordionId,
|
|
60
|
-
className: "euiNotificationEventMessages__accordion",
|
|
61
|
-
buttonContent: buttonContentText,
|
|
62
|
-
buttonClassName: "euiNotificationEventMessages__accordionButton",
|
|
63
|
-
arrowDisplay: "none"
|
|
64
|
-
}, (0, _react2.jsx)("div", {
|
|
65
|
-
className: "euiNotificationEventMessages__accordionContent"
|
|
66
|
-
}, messages.map(function (notification, index) {
|
|
67
|
-
return (0, _react2.jsx)(_text.EuiText, {
|
|
68
|
-
size: "s",
|
|
69
|
-
key: index,
|
|
70
|
-
color: "subdued"
|
|
71
|
-
}, (0, _react2.jsx)("p", null, notification));
|
|
72
|
-
}).slice(1)))));
|
|
73
|
-
};
|
|
74
|
-
exports.EuiNotificationEventMessages = EuiNotificationEventMessages;
|