@elastic/eui 116.3.0 → 116.3.1-snapshot.1782218964187
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/es/components/avatar/avatar.js +4 -0
- package/es/components/avatar/avatar.styles.js +16 -16
- package/es/components/banner/banner.js +1 -2
- package/es/components/banner/banner.styles.js +1 -1
- package/es/components/basic_table/basic_table.js +35 -5
- package/es/components/basic_table/basic_table.styles.js +19 -1
- package/es/components/basic_table/in_memory_table.js +17 -0
- package/es/components/basic_table/index.js +2 -1
- package/es/components/basic_table/pagination_bar.js +19 -4
- package/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/es/components/basic_table/panel.styles.js +14 -0
- package/es/components/basic_table/use_panel_props.js +28 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
- package/es/components/flyout/flyout.component.js +10 -6
- package/es/components/flyout/flyout_menu.js +122 -19
- package/es/components/flyout/flyout_menu.styles.js +2 -1
- package/es/components/flyout/manager/actions.js +20 -0
- package/es/components/flyout/manager/flyout_child.js +23 -1
- package/es/components/flyout/manager/flyout_managed.js +65 -19
- package/es/components/flyout/manager/hooks.js +1 -1
- package/es/components/flyout/manager/index.js +2 -2
- package/es/components/flyout/manager/reducer.js +32 -8
- package/es/components/flyout/manager/selectors.js +8 -2
- package/es/components/flyout/manager/store.js +35 -2
- package/es/components/flyout/use_flyout_menu.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
- package/es/components/notification_icon/assets/info_fill.js +34 -0
- package/es/components/notification_icon/assets/warning_static.js +40 -0
- package/es/components/notification_icon/notification_icon.js +87 -0
- package/es/components/notification_icon/notification_icon.styles.js +22 -0
- package/es/components/table/mobile/table_sort_mobile.js +64 -103
- package/es/components/table/store/use_unique_column_id.js +25 -0
- package/es/components/table/table_header_cell.js +7 -8
- package/es/components/table/table_header_cell_checkbox.js +5 -6
- package/es/components/toast/global_toast_list.js +132 -6
- package/es/components/toast/global_toast_list.styles.js +31 -7
- package/es/components/toast/toast.js +242 -47
- package/es/components/toast/toast.styles.js +35 -47
- package/es/components/toast/toast_action.js +34 -0
- package/es/components/toast/types.js +9 -0
- package/es/components/tool_tip/tool_tip.js +61 -30
- package/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/eui.d.ts +811 -552
- package/i18ntokens.json +981 -927
- package/lib/components/avatar/avatar.js +4 -0
- package/lib/components/avatar/avatar.styles.js +16 -16
- package/lib/components/banner/banner.js +1 -2
- package/lib/components/banner/banner.styles.js +1 -1
- package/lib/components/basic_table/basic_table.js +34 -4
- package/lib/components/basic_table/basic_table.styles.js +19 -1
- package/lib/components/basic_table/in_memory_table.js +17 -0
- package/lib/components/basic_table/index.js +8 -1
- package/lib/components/basic_table/pagination_bar.js +19 -4
- package/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/lib/components/basic_table/panel.styles.js +20 -0
- package/lib/components/basic_table/use_panel_props.js +33 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
- package/lib/components/flyout/flyout.component.js +10 -6
- package/lib/components/flyout/flyout_menu.js +120 -19
- package/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/lib/components/flyout/manager/actions.js +21 -1
- package/lib/components/flyout/manager/flyout_child.js +23 -1
- package/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/lib/components/flyout/manager/hooks.js +6 -0
- package/lib/components/flyout/manager/index.js +12 -0
- package/lib/components/flyout/manager/reducer.js +31 -7
- package/lib/components/flyout/manager/selectors.js +9 -3
- package/lib/components/flyout/manager/store.js +34 -1
- package/lib/components/flyout/use_flyout_menu.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
- package/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/lib/components/notification_icon/notification_icon.js +93 -0
- package/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- package/lib/components/table/mobile/table_sort_mobile.js +71 -108
- package/lib/components/table/store/use_unique_column_id.js +34 -0
- package/lib/components/table/table_header_cell.js +7 -8
- package/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/lib/components/toast/global_toast_list.js +132 -6
- package/lib/components/toast/global_toast_list.styles.js +31 -8
- package/lib/components/toast/toast.js +244 -47
- package/lib/components/toast/toast.styles.js +32 -45
- package/lib/components/toast/toast_action.js +40 -0
- package/lib/components/toast/types.js +15 -0
- package/lib/components/tool_tip/tool_tip.js +59 -29
- package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/es/components/avatar/avatar.js +4 -0
- package/optimize/es/components/avatar/avatar.styles.js +16 -16
- package/optimize/es/components/banner/banner.js +1 -2
- package/optimize/es/components/banner/banner.styles.js +1 -1
- package/optimize/es/components/basic_table/basic_table.js +18 -5
- package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/es/components/basic_table/index.js +2 -1
- package/optimize/es/components/basic_table/pagination_bar.js +19 -4
- package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
- package/optimize/es/components/basic_table/panel.styles.js +14 -0
- package/optimize/es/components/basic_table/use_panel_props.js +28 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
- package/optimize/es/components/flyout/flyout.component.js +10 -6
- package/optimize/es/components/flyout/flyout_menu.js +99 -18
- package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/es/components/flyout/manager/actions.js +20 -0
- package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
- package/optimize/es/components/flyout/manager/hooks.js +1 -1
- package/optimize/es/components/flyout/manager/index.js +2 -2
- package/optimize/es/components/flyout/manager/reducer.js +32 -8
- package/optimize/es/components/flyout/manager/selectors.js +8 -2
- package/optimize/es/components/flyout/manager/store.js +35 -2
- package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
- package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
- package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
- package/optimize/es/components/notification_icon/notification_icon.js +77 -0
- package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
- package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
- package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
- package/optimize/es/components/table/table_header_cell.js +7 -8
- package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/es/components/toast/global_toast_list.js +31 -6
- package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
- package/optimize/es/components/toast/toast.js +143 -47
- package/optimize/es/components/toast/toast.styles.js +35 -47
- package/optimize/es/components/toast/toast_action.js +33 -0
- package/optimize/es/components/toast/types.js +9 -0
- package/optimize/es/components/tool_tip/tool_tip.js +58 -30
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
- package/optimize/lib/components/avatar/avatar.js +4 -0
- package/optimize/lib/components/avatar/avatar.styles.js +16 -16
- package/optimize/lib/components/banner/banner.js +1 -2
- package/optimize/lib/components/banner/banner.styles.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +17 -4
- package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
- package/optimize/lib/components/basic_table/index.js +8 -1
- package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
- package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
- package/optimize/lib/components/basic_table/panel.styles.js +20 -0
- package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
- package/optimize/lib/components/flyout/flyout.component.js +10 -6
- package/optimize/lib/components/flyout/flyout_menu.js +98 -18
- package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
- package/optimize/lib/components/flyout/manager/actions.js +21 -1
- package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
- package/optimize/lib/components/flyout/manager/hooks.js +6 -0
- package/optimize/lib/components/flyout/manager/index.js +12 -0
- package/optimize/lib/components/flyout/manager/reducer.js +31 -7
- package/optimize/lib/components/flyout/manager/selectors.js +9 -3
- package/optimize/lib/components/flyout/manager/store.js +34 -1
- package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
- package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
- package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
- package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
- package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
- package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
- package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
- package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
- package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
- package/optimize/lib/components/table/table_header_cell.js +7 -8
- package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
- package/optimize/lib/components/toast/global_toast_list.js +31 -6
- package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
- package/optimize/lib/components/toast/toast.js +146 -47
- package/optimize/lib/components/toast/toast.styles.js +33 -45
- package/optimize/lib/components/toast/toast_action.js +39 -0
- package/optimize/lib/components/toast/types.js +15 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
- package/package.json +9 -6
- package/test-env/components/avatar/avatar.js +4 -0
- package/test-env/components/avatar/avatar.styles.js +16 -16
- package/test-env/components/banner/banner.js +1 -2
- package/test-env/components/banner/banner.styles.js +1 -1
- package/test-env/components/basic_table/basic_table.js +34 -4
- package/test-env/components/basic_table/basic_table.styles.js +19 -1
- package/test-env/components/basic_table/in_memory_table.js +17 -0
- package/test-env/components/basic_table/index.js +8 -1
- package/test-env/components/basic_table/pagination_bar.js +19 -4
- package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
- package/test-env/components/basic_table/panel.styles.js +20 -0
- package/test-env/components/basic_table/use_panel_props.js +33 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
- package/test-env/components/flyout/flyout.component.js +10 -6
- package/test-env/components/flyout/flyout_menu.js +121 -19
- package/test-env/components/flyout/flyout_menu.styles.js +2 -1
- package/test-env/components/flyout/manager/actions.js +21 -1
- package/test-env/components/flyout/manager/flyout_child.js +23 -1
- package/test-env/components/flyout/manager/flyout_managed.js +41 -17
- package/test-env/components/flyout/manager/hooks.js +6 -0
- package/test-env/components/flyout/manager/index.js +12 -0
- package/test-env/components/flyout/manager/reducer.js +31 -7
- package/test-env/components/flyout/manager/selectors.js +9 -3
- package/test-env/components/flyout/manager/store.js +34 -1
- package/test-env/components/flyout/use_flyout_menu.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
- package/test-env/components/notification_icon/assets/info_fill.js +41 -0
- package/test-env/components/notification_icon/assets/warning_static.js +47 -0
- package/test-env/components/notification_icon/notification_icon.js +46 -0
- package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
- package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
- package/test-env/components/table/store/use_unique_column_id.js +34 -0
- package/test-env/components/table/table_header_cell.js +7 -8
- package/test-env/components/table/table_header_cell_checkbox.js +5 -6
- package/test-env/components/toast/global_toast_list.js +132 -6
- package/test-env/components/toast/global_toast_list.styles.js +30 -7
- package/test-env/components/toast/toast.js +242 -47
- package/test-env/components/toast/toast.styles.js +33 -45
- package/test-env/components/toast/toast_action.js +39 -0
- package/test-env/components/toast/types.js +15 -0
- package/test-env/components/tool_tip/tool_tip.js +57 -29
- package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
- package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconWarningStatic = function EuiIconWarningStatic(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 16,
|
|
23
|
+
height: 16,
|
|
24
|
+
fill: "none",
|
|
25
|
+
viewBox: "0 0 16 16",
|
|
26
|
+
"aria-labelledby": titleId
|
|
27
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
28
|
+
id: titleId
|
|
29
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
+
fill: "#FACB3D",
|
|
31
|
+
fillRule: "evenodd",
|
|
32
|
+
d: "M8 1a1 1 0 0 1 .863.496l7 12A1 1 0 0 1 15 15H1a1 1 0 0 1-.864-1.504l7-12A1 1 0 0 1 8 1Z",
|
|
33
|
+
clipRule: "evenodd"
|
|
34
|
+
}), ___EmotionJSX("path", {
|
|
35
|
+
fill: "#825803",
|
|
36
|
+
d: "M7 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0ZM7.5 10V5h1v5h-1Z"
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
export var icon = EuiIconWarningStatic;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "type", "size", "css"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import classNames from 'classnames';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
15
|
+
import { EuiIcon } from '../icon/icon';
|
|
16
|
+
import { icon as EuiIconErrorFill } from '../icon/assets/error_fill';
|
|
17
|
+
import { icon as EuiIconCheckCircleFill } from '../icon/assets/check_circle_fill';
|
|
18
|
+
import { icon as EuiIconInfoFill } from './assets/info_fill';
|
|
19
|
+
import { icon as EuiIconWarningStatic } from './assets/warning_static';
|
|
20
|
+
import { euiNotificationIconStyles } from './notification_icon.styles';
|
|
21
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
|
+
var TYPES = ['info', 'success', 'warning', 'error'];
|
|
23
|
+
export var NOTIFICATION_ICONS_MAP = {
|
|
24
|
+
info: {
|
|
25
|
+
name: 'infoFill',
|
|
26
|
+
icon: EuiIconInfoFill
|
|
27
|
+
},
|
|
28
|
+
success: {
|
|
29
|
+
name: 'checkCircleFill',
|
|
30
|
+
icon: EuiIconCheckCircleFill
|
|
31
|
+
},
|
|
32
|
+
warning: {
|
|
33
|
+
name: 'warningStatic',
|
|
34
|
+
icon: EuiIconWarningStatic
|
|
35
|
+
},
|
|
36
|
+
error: {
|
|
37
|
+
name: 'errorFill',
|
|
38
|
+
icon: EuiIconErrorFill
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var ICON_TYPES_MAP = {
|
|
42
|
+
info: {
|
|
43
|
+
icon: NOTIFICATION_ICONS_MAP.info.icon,
|
|
44
|
+
color: 'primary'
|
|
45
|
+
},
|
|
46
|
+
success: {
|
|
47
|
+
icon: NOTIFICATION_ICONS_MAP.success.icon,
|
|
48
|
+
color: 'success'
|
|
49
|
+
},
|
|
50
|
+
warning: {
|
|
51
|
+
icon: NOTIFICATION_ICONS_MAP.warning.icon
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
icon: NOTIFICATION_ICONS_MAP.error.icon,
|
|
55
|
+
color: 'danger'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export var EuiNotificationIcon = function EuiNotificationIcon(_ref) {
|
|
59
|
+
var className = _ref.className,
|
|
60
|
+
type = _ref.type,
|
|
61
|
+
_ref$size = _ref.size,
|
|
62
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
63
|
+
css = _ref.css,
|
|
64
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
65
|
+
var Icon = ICON_TYPES_MAP[type];
|
|
66
|
+
var classes = classNames('euiNotificationIcon', className);
|
|
67
|
+
var styles = useEuiMemoizedStyles(euiNotificationIconStyles);
|
|
68
|
+
var cssStyles = [styles.euiNotificationIcon, size === 'l' && styles.size[size], css];
|
|
69
|
+
return ___EmotionJSX(EuiIcon, _extends({}, rest, {
|
|
70
|
+
className: classes,
|
|
71
|
+
css: cssStyles,
|
|
72
|
+
type: Icon.icon,
|
|
73
|
+
color: Icon.color,
|
|
74
|
+
"aria-hidden": "true",
|
|
75
|
+
size: size
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
import { mathWithUnits } from '@elastic/eui-theme-common';
|
|
11
|
+
export var euiNotificationIconStyles = function euiNotificationIconStyles(_ref) {
|
|
12
|
+
var euiTheme = _ref.euiTheme;
|
|
13
|
+
var sizeL = mathWithUnits(euiTheme.size.base, function (x) {
|
|
14
|
+
return x * 1.25;
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
euiNotificationIcon: /*#__PURE__*/css(";label:euiNotificationIcon;"),
|
|
18
|
+
size: {
|
|
19
|
+
l: /*#__PURE__*/css("block-size:", sizeL, ";inline-size:", sizeL, ";;label:l;")
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
4
|
var _excluded = ["className", "anchorPosition", "items"];
|
|
10
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
5
|
/*
|
|
13
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,7 +10,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
17
10
|
* Side Public License, v 1.
|
|
18
11
|
*/
|
|
19
12
|
|
|
20
|
-
import React, {
|
|
13
|
+
import React, { useState } from 'react';
|
|
21
14
|
import classNames from 'classnames';
|
|
22
15
|
import { EuiButtonEmpty } from '../../button/button_empty';
|
|
23
16
|
import { EuiPopover } from '../../popover';
|
|
@@ -25,77 +18,61 @@ import { EuiContextMenuPanel } from '../../context_menu';
|
|
|
25
18
|
import { EuiI18n } from '../../i18n';
|
|
26
19
|
import { EuiTableSortMobileItem } from './table_sort_mobile_item';
|
|
27
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
// Aligns the button to the right even when it's the only element present
|
|
22
|
+
var euiTableSortMobileStyles = {
|
|
23
|
+
marginInlineStart: 'auto',
|
|
24
|
+
label: 'euiTableSortMobile'
|
|
25
|
+
};
|
|
26
|
+
export var EuiTableSortMobile = function EuiTableSortMobile(_ref) {
|
|
27
|
+
var className = _ref.className,
|
|
28
|
+
anchorPosition = _ref.anchorPosition,
|
|
29
|
+
items = _ref.items,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
var _useState = useState(false),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
isPopoverOpen = _useState2[0],
|
|
34
|
+
setIsPopoverOpen = _useState2[1];
|
|
35
|
+
var classes = classNames('euiTableSortMobile', className);
|
|
36
|
+
var onButtonClick = function onButtonClick() {
|
|
37
|
+
setIsPopoverOpen(function (isOpen) {
|
|
38
|
+
return !isOpen;
|
|
38
39
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
isOpen: this.state.isPopoverOpen,
|
|
79
|
-
closePopover: this.closePopover,
|
|
80
|
-
anchorPosition: anchorPosition || 'downRight',
|
|
81
|
-
panelPaddingSize: "none"
|
|
82
|
-
}, rest), ___EmotionJSX(EuiContextMenuPanel, {
|
|
83
|
-
style: {
|
|
84
|
-
minWidth: 200
|
|
85
|
-
},
|
|
86
|
-
items: items && items.length ? items.map(function (item) {
|
|
87
|
-
return ___EmotionJSX(EuiTableSortMobileItem, {
|
|
88
|
-
key: item.key,
|
|
89
|
-
onSort: item.onSort,
|
|
90
|
-
isSorted: item.isSorted,
|
|
91
|
-
isSortAscending: item.isSortAscending
|
|
92
|
-
}, item.name);
|
|
93
|
-
}) : undefined
|
|
94
|
-
}));
|
|
95
|
-
return ___EmotionJSX("div", {
|
|
96
|
-
className: classes,
|
|
97
|
-
css: this.euiTableSortMobileStyles
|
|
98
|
-
}, mobileSortPopover);
|
|
99
|
-
}
|
|
100
|
-
}]);
|
|
101
|
-
}(Component);
|
|
40
|
+
};
|
|
41
|
+
var closePopover = function closePopover() {
|
|
42
|
+
setIsPopoverOpen(false);
|
|
43
|
+
};
|
|
44
|
+
var mobileSortButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
45
|
+
iconType: "chevronSingleDown",
|
|
46
|
+
iconSide: "right",
|
|
47
|
+
onClick: onButtonClick,
|
|
48
|
+
flush: "right",
|
|
49
|
+
size: "xs"
|
|
50
|
+
}, ___EmotionJSX(EuiI18n, {
|
|
51
|
+
token: "euiTableSortMobile.sorting",
|
|
52
|
+
default: "Sorting"
|
|
53
|
+
}));
|
|
54
|
+
var mobileSortPopover = ___EmotionJSX(EuiPopover, _extends({
|
|
55
|
+
button: mobileSortButton,
|
|
56
|
+
isOpen: isPopoverOpen,
|
|
57
|
+
closePopover: closePopover,
|
|
58
|
+
anchorPosition: anchorPosition || 'downRight',
|
|
59
|
+
panelPaddingSize: "none"
|
|
60
|
+
}, rest), ___EmotionJSX(EuiContextMenuPanel, {
|
|
61
|
+
style: {
|
|
62
|
+
minWidth: 200
|
|
63
|
+
},
|
|
64
|
+
items: items !== null && items !== void 0 && items.length ? items.map(function (item) {
|
|
65
|
+
return ___EmotionJSX(EuiTableSortMobileItem, {
|
|
66
|
+
key: item.key,
|
|
67
|
+
onSort: item.onSort,
|
|
68
|
+
isSorted: item.isSorted,
|
|
69
|
+
isSortAscending: item.isSortAscending
|
|
70
|
+
}, item.name);
|
|
71
|
+
}) : undefined
|
|
72
|
+
}));
|
|
73
|
+
return ___EmotionJSX("div", {
|
|
74
|
+
className: classes,
|
|
75
|
+
css: euiTableSortMobileStyles
|
|
76
|
+
}, mobileSortPopover);
|
|
77
|
+
};
|
|
78
|
+
EuiTableSortMobile.displayName = 'EuiTableSortMobile';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React, { useId, useRef } from 'react';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
|
+
var useEuiTableStoreUniqueColumnIdFallback = function useEuiTableStoreUniqueColumnIdFallback() {
|
|
12
|
+
var ref = useRef(uuidv4());
|
|
13
|
+
return ref.current;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns a stable unique column ID to be used when registering columns.
|
|
18
|
+
* It uses `React.useId()` when available and falls back to UUID v4 on React 17.
|
|
19
|
+
*
|
|
20
|
+
* This is needed so that static `uuid` mocks don't break column registration
|
|
21
|
+
* (at least in React 18+; in older versions this function would need
|
|
22
|
+
* to be mocked to return something unique, but stable).
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export var useEuiTableStoreUniqueColumnId = 'useId' in React ? useId : useEuiTableStoreUniqueColumnIdFallback;
|
|
@@ -15,7 +15,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
import React, { useEffect, useCallback, useRef } from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import { useEuiMemoizedStyles, LEFT_ALIGNMENT } from '../../services';
|
|
18
|
-
import { useGeneratedHtmlId } from '../../services/accessibility/html_id_generator';
|
|
19
18
|
import { EuiI18n } from '../i18n';
|
|
20
19
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
21
20
|
import { EuiIcon } from '../icon';
|
|
@@ -27,6 +26,7 @@ import { EuiTableCellContent } from './_table_cell_content';
|
|
|
27
26
|
import { euiTableHeaderFooterCellStyles, _useEuiTableStickyCellStyles } from './table_cells_shared.styles';
|
|
28
27
|
import { useEuiTableColumnDataStore } from './store/provider';
|
|
29
28
|
import { useEuiTableWithinStickyHeader } from './sticky_header';
|
|
29
|
+
import { useEuiTableStoreUniqueColumnId } from './store/use_unique_column_id';
|
|
30
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
31
31
|
var CellContents = function CellContents(_ref) {
|
|
32
32
|
var className = _ref.className,
|
|
@@ -104,7 +104,7 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
|
|
|
104
104
|
sticky = _ref2.sticky,
|
|
105
105
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
106
106
|
var selfRef = useRef(null);
|
|
107
|
-
var
|
|
107
|
+
var storeCellId = useEuiTableStoreUniqueColumnId();
|
|
108
108
|
var store = useEuiTableColumnDataStore();
|
|
109
109
|
var isWithinStickyHeader = useEuiTableWithinStickyHeader();
|
|
110
110
|
var styles = useEuiMemoizedStyles(euiTableHeaderFooterCellStyles);
|
|
@@ -169,15 +169,15 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
|
|
|
169
169
|
if (!entry) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
store.updateColumnWidth(
|
|
173
|
-
}, [store,
|
|
172
|
+
store.updateColumnWidth(storeCellId, entry.contentRect.width);
|
|
173
|
+
}, [store, storeCellId]);
|
|
174
174
|
useEffect(function () {
|
|
175
175
|
// Don't register the column inside the sticky header as the original
|
|
176
176
|
// column is already registered. This would cause an infinite loop.
|
|
177
177
|
if (isWithinStickyHeader || !selfRef.current || !renderHeaderCellRef.current) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
var unregisterColumn = store.registerColumn(
|
|
180
|
+
var unregisterColumn = store.registerColumn(storeCellId, {
|
|
181
181
|
renderHeaderCellRef: renderHeaderCellRef,
|
|
182
182
|
// getBoundingClientRect is not the cheapest, but we call it only once
|
|
183
183
|
currentWidth: selfRef.current.getBoundingClientRect().width
|
|
@@ -199,8 +199,7 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
|
|
|
199
199
|
unregisterColumn();
|
|
200
200
|
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect();
|
|
201
201
|
};
|
|
202
|
-
|
|
203
|
-
}, [store, internalCellId, isWithinStickyHeader]);
|
|
202
|
+
}, [store, isWithinStickyHeader, handleResize, storeCellId]);
|
|
204
203
|
|
|
205
204
|
// Notify the store on every render so the sticky header stays in sync.
|
|
206
205
|
// React's reconciliation will efficiently handle any duplicate renders.
|
|
@@ -215,7 +214,7 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
|
|
|
215
214
|
if (!selfRef.current) {
|
|
216
215
|
return;
|
|
217
216
|
}
|
|
218
|
-
store.updateColumn(
|
|
217
|
+
store.updateColumn(storeCellId, {
|
|
219
218
|
renderHeaderCellRef: renderHeaderCellRef
|
|
220
219
|
});
|
|
221
220
|
});
|
|
@@ -12,11 +12,11 @@ var _excluded = ["children", "className", "scope", "style", "width", "minWidth",
|
|
|
12
12
|
import React, { useEffect, useRef } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiMemoizedStyles } from '../../services';
|
|
15
|
-
import { useGeneratedHtmlId } from '../../services/accessibility/html_id_generator';
|
|
16
15
|
import { resolveWidthPropsAsStyle } from './utils';
|
|
17
16
|
import { euiTableCellCheckboxStyles } from './table_cells_shared.styles';
|
|
18
17
|
import { useEuiTableColumnDataStore } from './store/provider';
|
|
19
18
|
import { useEuiTableWithinStickyHeader } from './sticky_header';
|
|
19
|
+
import { useEuiTableStoreUniqueColumnId } from './store/use_unique_column_id';
|
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
21
|
export var EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(props) {
|
|
22
22
|
var children = props.children,
|
|
@@ -29,7 +29,7 @@ export var EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(prop
|
|
|
29
29
|
maxWidth = props.maxWidth,
|
|
30
30
|
append = props.append,
|
|
31
31
|
rest = _objectWithoutProperties(props, _excluded);
|
|
32
|
-
var
|
|
32
|
+
var storeCellId = useEuiTableStoreUniqueColumnId();
|
|
33
33
|
var store = useEuiTableColumnDataStore();
|
|
34
34
|
var isWithinStickyHeader = useEuiTableWithinStickyHeader();
|
|
35
35
|
var styles = useEuiMemoizedStyles(euiTableCellCheckboxStyles);
|
|
@@ -56,21 +56,20 @@ export var EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(prop
|
|
|
56
56
|
if (isWithinStickyHeader) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
var unregisterColumn = store.registerColumn(
|
|
59
|
+
var unregisterColumn = store.registerColumn(storeCellId, {
|
|
60
60
|
renderHeaderCellRef: renderHeaderCellRef
|
|
61
61
|
});
|
|
62
62
|
return function () {
|
|
63
63
|
unregisterColumn();
|
|
64
64
|
};
|
|
65
|
-
|
|
66
|
-
}, [store, internalCellId, isWithinStickyHeader]);
|
|
65
|
+
}, [store, isWithinStickyHeader, storeCellId]);
|
|
67
66
|
useEffect(function () {
|
|
68
67
|
// Notify the store on every render so the sticky header stays in sync.
|
|
69
68
|
// React's reconciliation will efficiently handle any duplicate renders.
|
|
70
69
|
if (isWithinStickyHeader) {
|
|
71
70
|
return;
|
|
72
71
|
}
|
|
73
|
-
store.updateColumn(
|
|
72
|
+
store.updateColumn(storeCellId, {
|
|
74
73
|
renderHeaderCellRef: renderHeaderCellRef
|
|
75
74
|
});
|
|
76
75
|
});
|
|
@@ -3,7 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt"],
|
|
6
|
+
var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt", "showNotificationBadge"],
|
|
7
7
|
_excluded2 = ["text", "toastLifeTimeMs"];
|
|
8
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -25,6 +25,7 @@ import { EuiToast } from './toast';
|
|
|
25
25
|
import { euiGlobalToastListStyles } from './global_toast_list.styles';
|
|
26
26
|
import { EuiButton } from '../button';
|
|
27
27
|
import { EuiI18n } from '../i18n';
|
|
28
|
+
import { EuiNotificationBadge } from '../badge';
|
|
28
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
30
|
var sideToClassNameMap = {
|
|
30
31
|
left: 'euiGlobalToastList--left',
|
|
@@ -44,6 +45,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
44
45
|
side = _ref$side === void 0 ? 'right' : _ref$side,
|
|
45
46
|
_ref$showClearAllButt = _ref.showClearAllButtonAt,
|
|
46
47
|
showClearAllButtonAt = _ref$showClearAllButt === void 0 ? CLEAR_ALL_TOASTS_THRESHOLD_DEFAULT : _ref$showClearAllButt,
|
|
48
|
+
_ref$showNotification = _ref.showNotificationBadge,
|
|
49
|
+
showNotificationBadge = _ref$showNotification === void 0 ? false : _ref$showNotification,
|
|
47
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
51
|
var _useState = useState({}),
|
|
49
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -218,8 +221,9 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
218
221
|
var renderedToasts = useMemo(function () {
|
|
219
222
|
return toasts.map(function (toast) {
|
|
220
223
|
var text = toast.text,
|
|
221
|
-
|
|
224
|
+
perToastLifeTimeMs = toast.toastLifeTimeMs,
|
|
222
225
|
rest = _objectWithoutProperties(toast, _excluded2);
|
|
226
|
+
var effectiveLifeTimeMs = perToastLifeTimeMs !== null && perToastLifeTimeMs !== void 0 ? perToastLifeTimeMs : toastLifeTimeMs;
|
|
223
227
|
var onClose = function onClose() {
|
|
224
228
|
return dismissToast(toast);
|
|
225
229
|
};
|
|
@@ -230,9 +234,12 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
230
234
|
onClose: onClose,
|
|
231
235
|
onFocus: onMouseEnter,
|
|
232
236
|
onBlur: onMouseLeave
|
|
233
|
-
}, rest
|
|
237
|
+
}, rest, {
|
|
238
|
+
animationMs: effectiveLifeTimeMs,
|
|
239
|
+
text: text
|
|
240
|
+
})));
|
|
234
241
|
});
|
|
235
|
-
}, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
|
|
242
|
+
}, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave, toastLifeTimeMs]);
|
|
236
243
|
var clearAllButton = useMemo(function () {
|
|
237
244
|
if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
|
|
238
245
|
return ___EmotionJSX(EuiI18n, {
|
|
@@ -246,7 +253,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
246
253
|
return ___EmotionJSX(EuiGlobalToastListItem, {
|
|
247
254
|
isDismissed: false
|
|
248
255
|
}, ___EmotionJSX(EuiButton, {
|
|
249
|
-
|
|
256
|
+
fullWidth: true,
|
|
257
|
+
size: "s",
|
|
250
258
|
color: "text",
|
|
251
259
|
onClick: function onClick() {
|
|
252
260
|
toasts.forEach(function (toast) {
|
|
@@ -262,11 +270,28 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
262
270
|
}
|
|
263
271
|
}, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
|
|
264
272
|
var classes = classNames('euiGlobalToastList', className);
|
|
273
|
+
var hasContent = renderedToasts.length > 0 || clearAllButton != null;
|
|
274
|
+
var notificationBadge = useMemo(function () {
|
|
275
|
+
var _toastIdToDismissedMa, _toasts$;
|
|
276
|
+
var toastWasDismissed = (_toastIdToDismissedMa = toastIdToDismissedMap[(_toasts$ = toasts[0]) === null || _toasts$ === void 0 ? void 0 : _toasts$.id]) !== null && _toastIdToDismissedMa !== void 0 ? _toastIdToDismissedMa : false;
|
|
277
|
+
var isListEmpty = toasts.every(function (t) {
|
|
278
|
+
return toastIdToDismissedMap[t.id];
|
|
279
|
+
});
|
|
280
|
+
return showNotificationBadge && toasts.length > 0 && ___EmotionJSX(EuiNotificationBadge, {
|
|
281
|
+
className: "euiGlobalToastList__countBadge",
|
|
282
|
+
css: [styles.notificationBadge.notificationBadge, toastWasDismissed && styles.notificationBadge.hasFadeOut, isListEmpty && styles.notificationBadge.hasFadeOut, ";label:notificationBadge;"],
|
|
283
|
+
size: "m",
|
|
284
|
+
color: "subdued",
|
|
285
|
+
"data-test-subj": "euiGlobalToastListNotificationBadge"
|
|
286
|
+
}, toasts.length);
|
|
287
|
+
}, [showNotificationBadge, toasts, toastIdToDismissedMap, styles]);
|
|
265
288
|
return ___EmotionJSX("div", _extends({
|
|
266
289
|
"aria-live": "polite",
|
|
267
290
|
role: "log",
|
|
268
291
|
ref: listElement,
|
|
269
292
|
css: cssStyles,
|
|
270
293
|
className: classes
|
|
271
|
-
}, rest),
|
|
294
|
+
}, rest), hasContent && ___EmotionJSX("div", {
|
|
295
|
+
css: styles.content
|
|
296
|
+
}, notificationBadge, renderedToasts, clearAllButton));
|
|
272
297
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
4
|
/*
|
|
4
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -9,26 +10,49 @@ var _templateObject;
|
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
import { css, keyframes } from '@emotion/react';
|
|
12
|
-
import { euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
|
|
13
|
+
import { euiCanAnimate, euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "ox3d1t-hasFadeOut",
|
|
16
|
+
styles: "opacity:0;label:hasFadeOut;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "ox3d1t-hasFadeOut",
|
|
19
|
+
styles: "opacity:0;label:hasFadeOut;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
23
|
+
name: "19mjubd-content",
|
|
24
|
+
styles: "position:relative;label:content;"
|
|
25
|
+
} : {
|
|
26
|
+
name: "19mjubd-content",
|
|
27
|
+
styles: "position:relative;label:content;",
|
|
28
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
+
};
|
|
13
30
|
export var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
|
|
14
31
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
|
-
var euiToastWidth = euiTheme.base *
|
|
32
|
+
var euiToastWidth = euiTheme.base * 27.5; // 440px -> results in 360px toast width
|
|
33
|
+
|
|
34
|
+
var showNotificationBadge = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from { opacity: 0; }\n to { opacity: 1; }\n "])));
|
|
16
35
|
return {
|
|
17
36
|
/**
|
|
18
37
|
* 1. Allow list to expand as items are added, but cap it at the screen height.
|
|
19
38
|
* 2. Allow some padding for shadow
|
|
20
39
|
*/
|
|
21
40
|
// Base
|
|
22
|
-
euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), " ", logicalCSS('width', "".concat(euiToastWidth, "px")), logicalCSS('max-height', '100vh'), logicalCSSWithFallback('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), " ", logicalCSS('padding-right', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{&:not(:empty){", logicalCSS('left', 0), " ", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
|
|
41
|
+
euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), " ", logicalCSS('width', "".concat(euiToastWidth, "px")), logicalCSS('max-height', '100vh'), logicalCSSWithFallback('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:hover .euiToastDecor::before,&:focus-within .euiToastDecor::before{animation-play-state:paused;}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), " ", logicalCSS('padding-right', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{&:not(:empty){", logicalCSS('left', 0), " ", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
|
|
42
|
+
content: _ref2,
|
|
43
|
+
notificationBadge: {
|
|
44
|
+
notificationBadge: /*#__PURE__*/css("position:absolute;inset-block-start:-", euiTheme.size.s, ";inset-inline-start:-", euiTheme.size.s, ";z-index:", Number(euiTheme.levels.content) + 1, ";", euiCanAnimate, "{animation:", euiTheme.animation.normal, " ", showNotificationBadge, " ", euiTheme.animation.resistance, ";transition:opacity ", euiTheme.animation.fast, ";};label:notificationBadge;"),
|
|
45
|
+
hasFadeOut: _ref
|
|
46
|
+
},
|
|
23
47
|
// Variants
|
|
24
48
|
right: /*#__PURE__*/css("&:not(:empty){", logicalCSS('right', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
|
|
25
49
|
left: /*#__PURE__*/css("&:not(:empty){", logicalCSS('left', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;"),
|
|
26
50
|
euiGlobalToastListDismissButton: /*#__PURE__*/css("position:sticky;", logicalCSS('bottom', '0%'), ";;label:euiGlobalToastListDismissButton;")
|
|
27
51
|
};
|
|
28
52
|
};
|
|
29
|
-
export var euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(
|
|
30
|
-
var euiTheme =
|
|
31
|
-
var euiShowToast = keyframes(
|
|
53
|
+
export var euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref3) {
|
|
54
|
+
var euiTheme = _ref3.euiTheme;
|
|
55
|
+
var euiShowToast = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n from {\n transform: translateY(", ") scale(.9);\n opacity: 0;\n }\n\n to {\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n"])), euiTheme.size.l);
|
|
32
56
|
return {
|
|
33
57
|
// Base
|
|
34
58
|
euiGlobalToastListItem: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-bottom', euiTheme.size.base), " animation:", euiTheme.animation.normal, " ", euiShowToast, " ", euiTheme.animation.resistance, ";opacity:1;&:first-child{", logicalCSS('margin-top', 'auto'), ";}&:last-child{", logicalCSS('margin-bottom', 0), ";};label:euiGlobalToastListItem;"),
|