@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
|
@@ -75,6 +75,7 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
75
75
|
var classes = classNames('euiAvatar', _defineProperty(_defineProperty(_defineProperty({}, "euiAvatar--".concat(size), size), "euiAvatar--".concat(type), type), 'euiAvatar-isDisabled', isDisabled), className);
|
|
76
76
|
var styles = useEuiMemoizedStyles(euiAvatarStyles);
|
|
77
77
|
var cssStyles = [styles.euiAvatar, styles[type], styles[size], styles[casing], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
|
|
78
|
+
var tooltipCssStyles = [styles.tooltip[type]];
|
|
78
79
|
var avatarStyle = useMemo(function () {
|
|
79
80
|
if (imageUrl) {
|
|
80
81
|
return {
|
|
@@ -129,6 +130,9 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
129
130
|
// It already has `aria-label`, the tooltip is only visual.
|
|
130
131
|
return name ? ___EmotionJSX(EuiToolTip, {
|
|
131
132
|
content: name,
|
|
133
|
+
anchorProps: {
|
|
134
|
+
css: tooltipCssStyles
|
|
135
|
+
},
|
|
132
136
|
disableScreenReaderOutput: true
|
|
133
137
|
}, avatarNode) : avatarNode;
|
|
134
138
|
};
|
|
@@ -9,9 +9,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalSizeCSS, mathWithUnits } from '../../global_styling';
|
|
12
|
-
var _avatarSize = function _avatarSize(
|
|
13
|
-
var size =
|
|
14
|
-
fontSize =
|
|
12
|
+
var _avatarSize = function _avatarSize(_ref6) {
|
|
13
|
+
var size = _ref6.size,
|
|
14
|
+
fontSize = _ref6.fontSize;
|
|
15
15
|
return "\n ".concat(logicalSizeCSS(size), ";\n font-size: ").concat(fontSize, ";\n ");
|
|
16
16
|
};
|
|
17
17
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -54,24 +54,20 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
54
54
|
styles: "cursor:not-allowed;filter:grayscale(100%);label:isDisabled;",
|
|
55
55
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
56
56
|
};
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
64
|
-
};
|
|
65
|
-
export var euiAvatarStyles = function euiAvatarStyles(_ref8) {
|
|
66
|
-
var euiTheme = _ref8.euiTheme;
|
|
57
|
+
export var euiAvatarStyles = function euiAvatarStyles(_ref7) {
|
|
58
|
+
var euiTheme = _ref7.euiTheme;
|
|
59
|
+
var borderRadius = {
|
|
60
|
+
user: '50%',
|
|
61
|
+
space: euiTheme.border.radius.medium
|
|
62
|
+
};
|
|
67
63
|
return {
|
|
68
64
|
// Base
|
|
69
65
|
euiAvatar: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;background-size:cover;background-color:", euiTheme.colors.lightShade, ";overflow:hidden;font-weight:", euiTheme.font.weight.medium, ";;label:euiAvatar;"),
|
|
70
66
|
// Variants
|
|
71
67
|
plain: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";;label:plain;"),
|
|
72
68
|
subdued: /*#__PURE__*/css("background-color:", euiTheme.colors.lightestShade, ";;label:subdued;"),
|
|
73
|
-
user:
|
|
74
|
-
space: /*#__PURE__*/css("border-radius:",
|
|
69
|
+
user: /*#__PURE__*/css("border-radius:", borderRadius.user, ";;label:user;"),
|
|
70
|
+
space: /*#__PURE__*/css("border-radius:", borderRadius.space, ";;label:space;"),
|
|
75
71
|
// States
|
|
76
72
|
isDisabled: _ref5,
|
|
77
73
|
// Sizes
|
|
@@ -101,6 +97,10 @@ export var euiAvatarStyles = function euiAvatarStyles(_ref8) {
|
|
|
101
97
|
capitalize: _ref4,
|
|
102
98
|
uppercase: _ref3,
|
|
103
99
|
lowercase: _ref2,
|
|
104
|
-
none: _ref
|
|
100
|
+
none: _ref,
|
|
101
|
+
tooltip: {
|
|
102
|
+
user: /*#__PURE__*/css("border-radius:", borderRadius.user, ";;label:user;"),
|
|
103
|
+
space: /*#__PURE__*/css("border-radius:", borderRadius.space, ";;label:space;")
|
|
104
|
+
}
|
|
105
105
|
};
|
|
106
106
|
};
|
|
@@ -50,8 +50,7 @@ export var EuiBanner = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
50
|
var headingSize = size === 's' ? 'xxs' : 'xs';
|
|
51
51
|
var primaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary;
|
|
52
52
|
var secondaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary;
|
|
53
|
-
|
|
54
|
-
var hasActions = Boolean(primaryActionProps);
|
|
53
|
+
var hasActions = Boolean(primaryActionProps) || Boolean(secondaryActionProps);
|
|
55
54
|
var componentClass = 'euiBanner';
|
|
56
55
|
var classes = classNames(componentClass, className);
|
|
57
56
|
var backgroundColorStyles = useEuiBackgroundColorCSS()[color];
|
|
@@ -60,7 +60,7 @@ export var euiBannerStyles = function euiBannerStyles(_ref3) {
|
|
|
60
60
|
}), ";;label:body;"),
|
|
61
61
|
// At size `s` the content slot becomes a block container so the title and
|
|
62
62
|
// text flow inline. Other sizes keep the flex column with a fixed gap.
|
|
63
|
-
content: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;max-inline-size:", TEXT_MAX_WIDTH, "px;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";[data-size='s'] &{display:block;>*+*:not(.euiButtonIcon){margin-block-start:", euiTheme.size.s, ";}};label:content;"),
|
|
63
|
+
content: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;max-inline-size:", TEXT_MAX_WIDTH, "px;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";[data-size='s'] &{display:block;>*+*:not(.euiButtonIcon){margin-block-start:", euiTheme.size.s, ";}}[data-size='m'] &{>.euiText+*{margin-block-start:", euiTheme.size.s, ";}};label:content;"),
|
|
64
64
|
title: _ref,
|
|
65
65
|
text: /*#__PURE__*/css("[data-size='s'] &{display:inline;&::before{content:'\xB7';display:inline-block;inline-size:calc(", euiTheme.size.s, " + ", euiTheme.size.xxs, ");text-align:center;color:", euiTheme.colors.textHeading, ";}};label:text;"),
|
|
66
66
|
actions: /*#__PURE__*/css("display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:", euiTheme.size.s, ";@container ", CONTAINER_NAME, " ", CQC_BREAKPOINT_NARROWEST, "{flex-wrap:wrap;>*{inline-size:100%;}}", withContainerQuery({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar", "stickyHeader"],
|
|
1
|
+
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar", "stickyHeader", "panelled"],
|
|
2
2
|
_excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
|
|
3
3
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
4
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -56,7 +56,7 @@ import { EuiScreenReaderOnly } from '../accessibility';
|
|
|
56
56
|
import { EuiI18n } from '../i18n';
|
|
57
57
|
import { EuiDelayRender } from '../delay_render';
|
|
58
58
|
import { htmlIdGenerator } from '../../services/accessibility';
|
|
59
|
-
import { euiBasicTableBodyLoading, safariLoadingWorkaround } from './basic_table.styles';
|
|
59
|
+
import { euiBasicTableBodyLoading, euiBasicTableWrapperPanelledStyles, safariLoadingWorkaround } from './basic_table.styles';
|
|
60
60
|
import { EuiToolTip } from '../tool_tip';
|
|
61
61
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
62
62
|
var dataTypesProfiles = {
|
|
@@ -376,6 +376,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
376
376
|
scrollableInline = _this$props2.scrollableInline,
|
|
377
377
|
stickyScrollbar = _this$props2.stickyScrollbar,
|
|
378
378
|
stickyHeader = _this$props2.stickyHeader,
|
|
379
|
+
panelled = _this$props2.panelled,
|
|
379
380
|
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
380
381
|
var classes = classNames('euiBasicTable', {
|
|
381
382
|
'euiBasicTable-loading': loading
|
|
@@ -397,8 +398,9 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
397
398
|
loading = _this$props3.loading,
|
|
398
399
|
scrollableInline = _this$props3.scrollableInline,
|
|
399
400
|
stickyScrollbar = _this$props3.stickyScrollbar,
|
|
400
|
-
stickyHeader = _this$props3.stickyHeader
|
|
401
|
-
|
|
401
|
+
stickyHeader = _this$props3.stickyHeader,
|
|
402
|
+
panelled = _this$props3.panelled;
|
|
403
|
+
var content = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTableHeaderMobile, {
|
|
402
404
|
responsiveBreakpoint: responsiveBreakpoint
|
|
403
405
|
}, this.renderSelectAll(true), this.renderTableMobileSort()), ___EmotionJSX(OverrideCopiedTabularContent, null, ___EmotionJSX(EuiTable, {
|
|
404
406
|
id: this.tableId,
|
|
@@ -411,6 +413,13 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
411
413
|
stickyHeader: stickyHeader,
|
|
412
414
|
css: loading && safariLoadingWorkaround
|
|
413
415
|
}, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
|
|
416
|
+
if (panelled) {
|
|
417
|
+
return ___EmotionJSX("div", {
|
|
418
|
+
css: panelled && euiBasicTableWrapperPanelledStyles(responsiveBreakpoint),
|
|
419
|
+
"data-test-subj": "euiBasicTablePanelledWrapper"
|
|
420
|
+
}, content);
|
|
421
|
+
}
|
|
422
|
+
return content;
|
|
414
423
|
}
|
|
415
424
|
}, {
|
|
416
425
|
key: "renderTableMobileSort",
|
|
@@ -967,7 +976,9 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
967
976
|
error = _this$props11.error,
|
|
968
977
|
pagination = _this$props11.pagination,
|
|
969
978
|
tableCaption = _this$props11.tableCaption,
|
|
970
|
-
onChange = _this$props11.onChange
|
|
979
|
+
onChange = _this$props11.onChange,
|
|
980
|
+
panelled = _this$props11.panelled,
|
|
981
|
+
responsiveBreakpoint = _this$props11.responsiveBreakpoint;
|
|
971
982
|
if (!error && pagination && pagination.totalItemCount > 0) {
|
|
972
983
|
if (!onChange) {
|
|
973
984
|
throw new Error("The Basic Table is configured with pagination but [onChange] is\n not configured. This callback must be implemented to handle pagination changes");
|
|
@@ -981,6 +992,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
981
992
|
}, function (tablePagination) {
|
|
982
993
|
return ___EmotionJSX(PaginationBar, {
|
|
983
994
|
pagination: pagination,
|
|
995
|
+
panelled: panelled,
|
|
996
|
+
responsiveBreakpoint: responsiveBreakpoint,
|
|
984
997
|
onPageSizeChange: _this7.onPageSizeChange.bind(_this7),
|
|
985
998
|
onPageChange: _this7.onPageChange.bind(_this7),
|
|
986
999
|
"aria-controls": _this7.tableId,
|
|
@@ -1501,6 +1514,23 @@ EuiBasicTable.propTypes = {
|
|
|
1501
1514
|
* Provides an infinite loading indicator
|
|
1502
1515
|
*/
|
|
1503
1516
|
loading: PropTypes.bool,
|
|
1517
|
+
/**
|
|
1518
|
+
* Enable the panelled style of the table.
|
|
1519
|
+
*
|
|
1520
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1521
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1522
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1523
|
+
* @default false
|
|
1524
|
+
*/
|
|
1525
|
+
/**
|
|
1526
|
+
* Enable the panelled style of the table.
|
|
1527
|
+
*
|
|
1528
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1529
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1530
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1531
|
+
* @default false
|
|
1532
|
+
*/
|
|
1533
|
+
panelled: PropTypes.bool,
|
|
1504
1534
|
/**
|
|
1505
1535
|
* Message to display if table is empty
|
|
1506
1536
|
*/
|
|
@@ -10,7 +10,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { css, keyframes } from '@emotion/react';
|
|
13
|
-
import { logicalCSS, euiCantAnimate, highContrastModeStyles, preventForcedColors } from '../../global_styling';
|
|
13
|
+
import { logicalCSS, euiCantAnimate, highContrastModeStyles, preventForcedColors, euiMinBreakpoint } from '../../global_styling';
|
|
14
|
+
import { EUI_BASIC_TABLE_PANEL_CLASS_NAME } from './use_panel_props';
|
|
14
15
|
var tableLoadingLine = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), logicalCSS('left', 0), logicalCSS('width', 0), logicalCSS('left', 0), logicalCSS('width', '40%'), logicalCSS('left', '60%'), logicalCSS('width', '40%'), logicalCSS('left', '100%'), logicalCSS('width', 0));
|
|
15
16
|
export var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(euiThemeContext) {
|
|
16
17
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -19,6 +20,23 @@ export var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(euiTheme
|
|
|
19
20
|
}), ";}};label:euiBasicTableBodyLoading;");
|
|
20
21
|
};
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export var euiBasicTableWrapperPanelledStyles = function euiBasicTableWrapperPanelledStyles(responsiveBreakpoint) {
|
|
27
|
+
return function (theme) {
|
|
28
|
+
var euiTheme = theme.euiTheme;
|
|
29
|
+
var styles = /*#__PURE__*/css("border:", euiTheme.border.thin, ";border-block-end-width:0;padding-block-start:", euiTheme.border.width.thin, ";border-radius:", euiTheme.border.radius.medium, ";.euiTable{border-radius:", euiTheme.border.radius.medium, ";}.", EUI_BASIC_TABLE_PANEL_CLASS_NAME, "+.euiBasicTable &{border-start-start-radius:0;border-start-end-radius:0;.euiTable{border-start-start-radius:0;border-start-end-radius:0;}}&:not(:last-child),&:has(+ .", EUI_BASIC_TABLE_PANEL_CLASS_NAME, "){border-end-start-radius:0;border-end-end-radius:0;.euiTable{border-end-start-radius:0;border-end-end-radius:0;}};label:styles;");
|
|
30
|
+
if (responsiveBreakpoint === true) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (!responsiveBreakpoint) {
|
|
34
|
+
return styles;
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/css(euiMinBreakpoint(theme, responsiveBreakpoint), "{", styles, ";};label:euiBasicTableWrapperPanelledStyles;");
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
|
|
22
40
|
// Fix to make the loading indicator position correctly in Safari
|
|
23
41
|
// For whatever annoying reason, Safari doesn't respect `position: relative;`
|
|
24
42
|
// on `tbody` without `position: relative` on the parent `table`
|
|
@@ -1014,6 +1014,23 @@ EuiInMemoryTable.propTypes = {
|
|
|
1014
1014
|
* Provides an infinite loading indicator
|
|
1015
1015
|
*/
|
|
1016
1016
|
loading: PropTypes.bool,
|
|
1017
|
+
/**
|
|
1018
|
+
* Enable the panelled style of the table.
|
|
1019
|
+
*
|
|
1020
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1021
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1022
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1023
|
+
* @default false
|
|
1024
|
+
*/
|
|
1025
|
+
/**
|
|
1026
|
+
* Enable the panelled style of the table.
|
|
1027
|
+
*
|
|
1028
|
+
* Panelled style adds contrast between the table navigation controls
|
|
1029
|
+
* and table content itself. It should be used in tables rendered outside
|
|
1030
|
+
* EUI containers like `<EuiPanel>` or `<EuiFlyout>`.
|
|
1031
|
+
* @default false
|
|
1032
|
+
*/
|
|
1033
|
+
panelled: PropTypes.bool,
|
|
1017
1034
|
/**
|
|
1018
1035
|
* Applied to `EuiTableRow`
|
|
1019
1036
|
*/
|
|
@@ -7,11 +7,24 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React, { useEffect } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
11
11
|
import { EuiTablePagination, useEuiTablePaginationDefaults } from '../table/table_pagination';
|
|
12
|
+
import { useIsEuiTableResponsive } from '../table/mobile/responsive_context';
|
|
13
|
+
import { euiBasicTablePaginationBarStyles } from './pagination_bar.styles';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
12
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
|
+
/**
|
|
20
|
+
* An internal utility component that renders EuiTablePagination with
|
|
21
|
+
* proper configuration and handles the `panelled` styles.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
13
24
|
export var PaginationBar = function PaginationBar(_ref) {
|
|
14
25
|
var pagination = _ref.pagination,
|
|
26
|
+
panelled = _ref.panelled,
|
|
27
|
+
responsiveBreakpoint = _ref.responsiveBreakpoint,
|
|
15
28
|
onPageSizeChange = _ref.onPageSizeChange,
|
|
16
29
|
onPageChange = _ref.onPageChange,
|
|
17
30
|
ariaControls = _ref['aria-controls'],
|
|
@@ -26,14 +39,16 @@ export var PaginationBar = function PaginationBar(_ref) {
|
|
|
26
39
|
_pagination$showPerPa = pagination.showPerPageOptions,
|
|
27
40
|
showPerPageOptions = _pagination$showPerPa === void 0 ? defaults.showPerPageOptions : _pagination$showPerPa;
|
|
28
41
|
var pageCount = pageSize ? Math.ceil(totalItemCount / pageSize) : 1;
|
|
42
|
+
var styles = useEuiMemoizedStyles(euiBasicTablePaginationBarStyles);
|
|
43
|
+
var isResponsive = useIsEuiTableResponsive(responsiveBreakpoint);
|
|
29
44
|
useEffect(function () {
|
|
30
45
|
if (pageCount < pageIndex + 1) {
|
|
31
46
|
onPageChange === null || onPageChange === void 0 || onPageChange(pageCount - 1);
|
|
32
47
|
}
|
|
33
48
|
}, [pageCount, onPageChange, pageIndex]);
|
|
34
|
-
return ___EmotionJSX("div",
|
|
35
|
-
|
|
36
|
-
}
|
|
49
|
+
return ___EmotionJSX("div", {
|
|
50
|
+
css: [styles.root, !isResponsive && panelled && styles.panelled, ";label:PaginationBar;"]
|
|
51
|
+
}, ___EmotionJSX(EuiTablePagination, {
|
|
37
52
|
activePage: pageIndex,
|
|
38
53
|
showPerPageOptions: showPerPageOptions,
|
|
39
54
|
itemsPerPage: pageSize,
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { logicalShorthandCSS } from '../../global_styling';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export var euiBasicTablePaginationBarStyles = function euiBasicTablePaginationBarStyles(theme) {
|
|
16
|
+
var euiTheme = theme.euiTheme;
|
|
17
|
+
return {
|
|
18
|
+
root: /*#__PURE__*/css(logicalShorthandCSS('padding', "".concat(euiTheme.size.xs, " ").concat(euiTheme.size.s)), ";;label:root;"),
|
|
19
|
+
panelled: /*#__PURE__*/css("background:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-start-width:0;", logicalShorthandCSS('border-radius', "0 0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium)), ";;label:panelled;")
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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 { logicalShorthandCSS } from '../../global_styling';
|
|
11
|
+
export var euiBasicTablePanelStyles = function euiBasicTablePanelStyles(_ref) {
|
|
12
|
+
var euiTheme = _ref.euiTheme;
|
|
13
|
+
return /*#__PURE__*/css("background-color:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-end-width:0;", logicalShorthandCSS('border-radius', "".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0 0")), "&+&{border-start-start-radius:0;border-start-end-radius:0;};label:euiBasicTablePanelStyles;");
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { useEuiMemoizedStyles } from '../../services';
|
|
10
|
+
import { euiBasicTablePanelStyles } from './panel.styles';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export var EUI_BASIC_TABLE_PANEL_CLASS_NAME = 'euiBasicTablePanel';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A utility hook that returns props needed to be passed to element(s) being
|
|
19
|
+
* a part of the paneled table look and feel (e.g., a toolbar above the table).
|
|
20
|
+
* @beta
|
|
21
|
+
*/
|
|
22
|
+
export var useEuiBasicTablePanelProps = function useEuiBasicTablePanelProps() {
|
|
23
|
+
var css = useEuiMemoizedStyles(euiBasicTablePanelStyles);
|
|
24
|
+
return {
|
|
25
|
+
css: css,
|
|
26
|
+
className: EUI_BASIC_TABLE_PANEL_CLASS_NAME
|
|
27
|
+
};
|
|
28
|
+
};
|