@elastic/eui 60.3.0 → 61.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_theme_dark.css +9 -173
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +9 -173
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +1 -1
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +1 -1
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/button/_button_content_deprecated.js +1 -1
- package/es/components/button/button.js +2 -2
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/card/card_select.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/comment_list/comment.js +45 -24
- package/es/components/comment_list/comment_event.js +104 -33
- package/es/components/comment_list/comment_event.styles.js +78 -0
- package/es/components/comment_list/comment_list.js +38 -13
- package/es/components/comment_list/comment_timeline.js +22 -34
- package/es/components/datagrid/body/data_grid_body.js +14 -14
- package/es/components/datagrid/body/data_grid_cell.js +24 -24
- package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +13 -13
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/datagrid/utils/row_heights.js +27 -33
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/form/field_number/field_number.js +1 -1
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo.js +1 -1
- package/es/components/icon/assets/{keyboard_shortcut.js → keyboard.js} +5 -5
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +1 -1
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/page/page_header/page_header.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/page/page_template.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list.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 +1 -1
- package/es/components/suggest/suggest.js +1 -1
- package/es/components/suggest/suggest_item.js +1 -1
- package/es/components/table/table_header_button.js +1 -1
- package/es/components/text/text.styles.js +5 -4
- package/es/components/timeline/timeline_item.js +1 -2
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/token/token.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useLatest.js +18 -0
- package/es/test/emotion-prefix.js +1 -1
- package/eui.d.ts +198 -153
- package/lib/components/accessibility/skip_link/skip_link.js +1 -1
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +1 -1
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/button/_button_content_deprecated.js +1 -1
- package/lib/components/button/button.js +2 -2
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/card/card_select.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/comment_list/comment.js +44 -25
- package/lib/components/comment_list/comment_event.js +105 -42
- package/lib/components/comment_list/comment_event.styles.js +86 -0
- package/lib/components/comment_list/comment_list.js +39 -13
- package/lib/components/comment_list/comment_timeline.js +23 -46
- package/lib/components/datagrid/body/data_grid_body.js +14 -14
- package/lib/components/datagrid/body/data_grid_cell.js +24 -24
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +13 -13
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/datagrid/utils/row_heights.js +26 -32
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/form/field_number/field_number.js +1 -1
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo.js +1 -1
- package/lib/components/icon/assets/{keyboard_shortcut.js → keyboard.js} +5 -5
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +1 -1
- package/lib/components/icon/svgs/keyboard.svg +3 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/page/page_header/page_header.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/page/page_template.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/suggest/suggest.js +1 -1
- package/lib/components/suggest/suggest_item.js +1 -1
- package/lib/components/table/table_header_button.js +1 -1
- package/lib/components/text/text.styles.js +4 -3
- package/lib/components/timeline/timeline_item.js +1 -2
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/token/token.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/services/hooks/index.js +13 -0
- package/lib/services/hooks/useLatest.js +26 -0
- package/lib/test/emotion-prefix.js +1 -1
- package/optimize/es/components/comment_list/comment.js +22 -17
- package/optimize/es/components/comment_list/comment_event.js +83 -28
- package/optimize/es/components/comment_list/comment_event.styles.js +78 -0
- package/optimize/es/components/comment_list/comment_list.js +7 -3
- package/optimize/es/components/comment_list/comment_timeline.js +19 -31
- package/optimize/es/components/datagrid/body/data_grid_body.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +27 -33
- package/optimize/es/components/icon/assets/{keyboard_shortcut.js → keyboard.js} +5 -5
- package/optimize/es/components/icon/icon_map.js +1 -1
- package/optimize/es/components/text/text.styles.js +5 -4
- package/optimize/es/components/timeline/timeline_item.js +1 -2
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useLatest.js +18 -0
- package/optimize/es/test/emotion-prefix.js +1 -1
- package/optimize/lib/components/comment_list/comment.js +21 -17
- package/optimize/lib/components/comment_list/comment_event.js +85 -31
- package/optimize/lib/components/comment_list/comment_event.styles.js +86 -0
- package/optimize/lib/components/comment_list/comment_list.js +8 -3
- package/optimize/lib/components/comment_list/comment_timeline.js +21 -37
- package/optimize/lib/components/datagrid/body/data_grid_body.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +25 -30
- package/optimize/lib/components/icon/assets/{keyboard_shortcut.js → keyboard.js} +5 -5
- package/optimize/lib/components/icon/icon_map.js +1 -1
- package/optimize/lib/components/icon/svgs/keyboard.svg +3 -0
- package/optimize/lib/components/text/text.styles.js +4 -3
- package/optimize/lib/components/timeline/timeline_item.js +1 -2
- package/optimize/lib/services/hooks/index.js +13 -0
- package/optimize/lib/services/hooks/useLatest.js +26 -0
- package/optimize/lib/test/emotion-prefix.js +1 -1
- package/package.json +2 -2
- package/src/components/index.scss +0 -1
- package/src/components/markdown_editor/_markdown_editor.scss +3 -2
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +1 -1
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +1 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +1 -1
- package/test-env/components/button/_button_content_deprecated.js +1 -1
- package/test-env/components/button/button.js +2 -2
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/card/card_select.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/comment_list/comment.js +44 -24
- package/test-env/components/comment_list/comment_event.js +106 -36
- package/test-env/components/comment_list/comment_event.styles.js +86 -0
- package/test-env/components/comment_list/comment_list.js +39 -13
- package/test-env/components/comment_list/comment_timeline.js +23 -39
- package/test-env/components/datagrid/body/data_grid_body.js +14 -14
- package/test-env/components/datagrid/body/data_grid_cell.js +24 -24
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +13 -13
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +13 -13
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/datagrid/utils/row_heights.js +25 -30
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/form/field_number/field_number.js +1 -1
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo.js +1 -1
- package/test-env/components/icon/assets/{keyboard_shortcut.js → keyboard.js} +5 -5
- package/test-env/components/icon/icon_map.js +1 -1
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/page/page_header/page_header.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/page/page_template.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/suggest/suggest.js +1 -1
- package/test-env/components/suggest/suggest_item.js +1 -1
- package/test-env/components/table/table_header_button.js +1 -1
- package/test-env/components/text/text.styles.js +4 -3
- package/test-env/components/timeline/timeline_item.js +1 -2
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/token/token.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/services/hooks/index.js +13 -0
- package/test-env/services/hooks/useLatest.js +26 -0
- package/test-env/test/emotion-prefix.js +1 -1
- package/lib/components/icon/svgs/keyboard_shortcut.svg +0 -3
- package/optimize/lib/components/icon/svgs/keyboard_shortcut.svg +0 -3
- package/src/components/comment_list/_comment.scss +0 -38
- package/src/components/comment_list/_comment_event.scss +0 -77
- package/src/components/comment_list/_comment_timeline.scss +0 -27
- package/src/components/comment_list/_index.scss +0 -3
- package/src/themes/amsterdam/overrides/_comment.scss +0 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
5
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,45 +8,31 @@
|
|
|
6
8
|
* Side Public License, v 1.
|
|
7
9
|
*/
|
|
8
10
|
import React from 'react';
|
|
9
|
-
import {
|
|
10
|
-
import classNames from 'classnames';
|
|
11
|
-
import { EuiIcon } from '../icon';
|
|
11
|
+
import { EuiAvatar } from '../avatar';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
|
-
var typeToClassNameMap = {
|
|
14
|
-
regular: 'euiCommentTimeline__icon--regular',
|
|
15
|
-
update: 'euiCommentTimeline__icon--update'
|
|
16
|
-
};
|
|
17
|
-
export var TYPES = keysOf(typeToClassNameMap);
|
|
18
13
|
export var EuiCommentTimeline = function EuiCommentTimeline(_ref) {
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
_ref$type = _ref.type,
|
|
22
|
-
type = _ref$type === void 0 ? 'regular' : _ref$type;
|
|
23
|
-
var classes = classNames('euiCommentTimeline', className);
|
|
24
|
-
var iconClasses = classNames({
|
|
25
|
-
'euiCommentTimeline__icon--default': !timelineIcon || typeof timelineIcon === 'string'
|
|
26
|
-
}, typeToClassNameMap[type]);
|
|
14
|
+
var timelineIcon = _ref.timelineIcon,
|
|
15
|
+
username = _ref.username;
|
|
27
16
|
var iconRender;
|
|
17
|
+
var avatarClassName = 'euiCommentAvatar';
|
|
18
|
+
var iconIsString = typeof timelineIcon === 'string';
|
|
19
|
+
var iconIsNode = _typeof(timelineIcon) === 'object';
|
|
28
20
|
|
|
29
|
-
if (
|
|
30
|
-
iconRender = ___EmotionJSX(
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
if (iconIsString) {
|
|
22
|
+
iconRender = ___EmotionJSX(EuiAvatar, {
|
|
23
|
+
className: avatarClassName,
|
|
24
|
+
name: username,
|
|
25
|
+
iconType: timelineIcon,
|
|
26
|
+
color: "subdued"
|
|
33
27
|
});
|
|
34
|
-
} else if (
|
|
28
|
+
} else if (iconIsNode) {
|
|
35
29
|
iconRender = timelineIcon;
|
|
36
30
|
} else {
|
|
37
|
-
iconRender = ___EmotionJSX(
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
iconRender = ___EmotionJSX(EuiAvatar, {
|
|
32
|
+
className: avatarClassName,
|
|
33
|
+
name: username
|
|
40
34
|
});
|
|
41
35
|
}
|
|
42
36
|
|
|
43
|
-
return ___EmotionJSX(
|
|
44
|
-
className: classes
|
|
45
|
-
}, ___EmotionJSX("div", {
|
|
46
|
-
className: "euiCommentTimeline__content"
|
|
47
|
-
}, ___EmotionJSX("div", {
|
|
48
|
-
className: iconClasses
|
|
49
|
-
}, iconRender)));
|
|
37
|
+
return ___EmotionJSX(React.Fragment, null, iconRender);
|
|
50
38
|
};
|
|
@@ -319,7 +319,7 @@ export var EuiDataGridBody = function EuiDataGridBody(props) {
|
|
|
319
319
|
*/
|
|
320
320
|
|
|
321
321
|
var rowHeightUtils = useRowHeightUtils({
|
|
322
|
-
gridRef: gridRef
|
|
322
|
+
gridRef: gridRef,
|
|
323
323
|
gridStyles: gridStyles,
|
|
324
324
|
columns: columns,
|
|
325
325
|
rowHeightsOptions: rowHeightsOptions
|
|
@@ -13,7 +13,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
13
13
|
*/
|
|
14
14
|
import { useEffect, useState, useMemo, useCallback, useContext } from 'react';
|
|
15
15
|
import { isObject, isNumber } from '../../../services/predicate';
|
|
16
|
-
import { useForceRender } from '../../../services';
|
|
16
|
+
import { useForceRender, useLatest } from '../../../services';
|
|
17
17
|
import { DataGridSortingContext } from './sorting'; // TODO: Once JS variables are available, use them here instead of hard-coded maps
|
|
18
18
|
|
|
19
19
|
export var cellPaddingsMap = {
|
|
@@ -24,11 +24,14 @@ export var cellPaddingsMap = {
|
|
|
24
24
|
export var AUTO_HEIGHT = 'auto';
|
|
25
25
|
export var DEFAULT_ROW_HEIGHT = 34;
|
|
26
26
|
export var RowHeightUtils = /*#__PURE__*/function () {
|
|
27
|
-
function RowHeightUtils() {
|
|
27
|
+
function RowHeightUtils(gridRef, rerenderGridBodyRef) {
|
|
28
28
|
var _this = this;
|
|
29
29
|
|
|
30
30
|
_classCallCheck(this, RowHeightUtils);
|
|
31
31
|
|
|
32
|
+
this.gridRef = gridRef;
|
|
33
|
+
this.rerenderGridBodyRef = rerenderGridBodyRef;
|
|
34
|
+
|
|
32
35
|
_defineProperty(this, "styles", {
|
|
33
36
|
paddingTop: 0,
|
|
34
37
|
paddingBottom: 0
|
|
@@ -63,11 +66,7 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
63
66
|
|
|
64
67
|
_defineProperty(this, "timerId", void 0);
|
|
65
68
|
|
|
66
|
-
_defineProperty(this, "grid", void 0);
|
|
67
|
-
|
|
68
69
|
_defineProperty(this, "lastUpdatedRow", Infinity);
|
|
69
|
-
|
|
70
|
-
_defineProperty(this, "rerenderGridBody", function () {});
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
_createClass(RowHeightUtils, [{
|
|
@@ -165,6 +164,8 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
165
164
|
}, {
|
|
166
165
|
key: "setRowHeight",
|
|
167
166
|
value: function setRowHeight(rowIndex, colId) {
|
|
167
|
+
var _this$rerenderGridBod, _this$rerenderGridBod2;
|
|
168
|
+
|
|
168
169
|
var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_ROW_HEIGHT;
|
|
169
170
|
var visibleRowIndex = arguments.length > 3 ? arguments[3] : undefined;
|
|
170
171
|
var rowHeights = this.heightsCache.get(rowIndex) || new Map();
|
|
@@ -179,7 +180,7 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
179
180
|
this.resetRow(visibleRowIndex); // When an auto row height is updated, force a re-render
|
|
180
181
|
// of the grid body to update the unconstrained height
|
|
181
182
|
|
|
182
|
-
this.
|
|
183
|
+
(_this$rerenderGridBod = (_this$rerenderGridBod2 = this.rerenderGridBodyRef).current) === null || _this$rerenderGridBod === void 0 ? void 0 : _this$rerenderGridBod.call(_this$rerenderGridBod2);
|
|
183
184
|
}
|
|
184
185
|
}, {
|
|
185
186
|
key: "pruneHiddenColumnHeights",
|
|
@@ -219,21 +220,11 @@ export var RowHeightUtils = /*#__PURE__*/function () {
|
|
|
219
220
|
}, {
|
|
220
221
|
key: "resetGrid",
|
|
221
222
|
value: function resetGrid() {
|
|
222
|
-
var _this$
|
|
223
|
+
var _this$gridRef$current;
|
|
223
224
|
|
|
224
|
-
(_this$
|
|
225
|
+
(_this$gridRef$current = this.gridRef.current) === null || _this$gridRef$current === void 0 ? void 0 : _this$gridRef$current.resetAfterRowIndex(this.lastUpdatedRow);
|
|
225
226
|
this.lastUpdatedRow = Infinity;
|
|
226
227
|
}
|
|
227
|
-
}, {
|
|
228
|
-
key: "setGrid",
|
|
229
|
-
value: function setGrid(grid) {
|
|
230
|
-
this.grid = grid;
|
|
231
|
-
}
|
|
232
|
-
}, {
|
|
233
|
-
key: "setRerenderGridBody",
|
|
234
|
-
value: function setRerenderGridBody(rerenderGridBody) {
|
|
235
|
-
this.rerenderGridBody = rerenderGridBody;
|
|
236
|
-
}
|
|
237
228
|
}]);
|
|
238
229
|
|
|
239
230
|
return RowHeightUtils;
|
|
@@ -248,22 +239,25 @@ export var useRowHeightUtils = function useRowHeightUtils(_ref2) {
|
|
|
248
239
|
gridStyles = _ref2.gridStyles,
|
|
249
240
|
columns = _ref2.columns,
|
|
250
241
|
rowHeightsOptions = _ref2.rowHeightsOptions;
|
|
251
|
-
var
|
|
252
|
-
return new RowHeightUtils();
|
|
253
|
-
}, []); // Update rowHeightUtils with internal vars from outside dependencies
|
|
242
|
+
var forceRenderRef = useLatest(useForceRender());
|
|
254
243
|
|
|
255
|
-
var
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
244
|
+
var _useState = useState(function () {
|
|
245
|
+
return new RowHeightUtils(gridRef, forceRenderRef);
|
|
246
|
+
}),
|
|
247
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
248
|
+
rowHeightUtils = _useState2[0]; // Forces a rerender whenever the row heights change, as this can cause the
|
|
260
249
|
// grid to change height/have scrollbars. Without this, grid rerendering is stale
|
|
261
250
|
|
|
251
|
+
|
|
262
252
|
useEffect(function () {
|
|
263
|
-
|
|
253
|
+
if (forceRenderRef.current == null) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
requestAnimationFrame(forceRenderRef.current);
|
|
264
258
|
}, [// Effects that should cause rerendering
|
|
265
259
|
rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.defaultHeight, rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.rowHeights, // Dependencies
|
|
266
|
-
rowHeightUtils,
|
|
260
|
+
rowHeightUtils, forceRenderRef]); // Re-cache styles whenever grid density changes
|
|
267
261
|
|
|
268
262
|
useEffect(function () {
|
|
269
263
|
rowHeightUtils.cacheStyles({
|
|
@@ -285,10 +279,10 @@ export var useDefaultRowHeight = function useDefaultRowHeight(_ref3) {
|
|
|
285
279
|
// and ignored by auto & static heights (unless the static height is < the min)
|
|
286
280
|
|
|
287
281
|
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
minRowHeight =
|
|
291
|
-
setRowHeight =
|
|
282
|
+
var _useState3 = useState(DEFAULT_ROW_HEIGHT),
|
|
283
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
284
|
+
minRowHeight = _useState4[0],
|
|
285
|
+
setRowHeight = _useState4[1]; // Default/fallback height for all rows
|
|
292
286
|
|
|
293
287
|
|
|
294
288
|
var defaultRowHeight = useMemo(function () {
|
|
@@ -13,22 +13,22 @@ var _excluded = ["title", "titleId"];
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var EuiIconKeyboard = function EuiIconKeyboard(_ref) {
|
|
17
17
|
var title = _ref.title,
|
|
18
18
|
titleId = _ref.titleId,
|
|
19
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
20
|
|
|
21
21
|
return ___EmotionJSX("svg", _extends({
|
|
22
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
width: 16,
|
|
24
|
-
height: 16,
|
|
25
23
|
viewBox: "0 0 16 16",
|
|
26
24
|
"aria-labelledby": titleId
|
|
27
25
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
26
|
id: titleId
|
|
29
27
|
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
-
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M0 3h16v11H0V3zm15 10V4H1v9h14zM2 5h2v1H2V5zm2 7v-1H2v1h2zm10-1v1h-2v-1h2zm-3 1v-1H5v1h6zM5 5h1v1H5V5zM3 7H2v1h1V7zm3 0h1v1H6V7zM3 9H2v1h1V9zm3 0h1v1H6V9zm2-4H7v1h1V5zM4 7h1v1H4V7zm5 0H8v1h1V7zm1 0h1v1h-1V7zM5 9H4v1h1V9zm3 0h1v1H8V9zm3 0h-1v1h1V9zM9 5h1v1H9V5zm3 0h-1v1h1V5zm1 0h1v1h-1V5zm1 2h-2v3h2V7z"
|
|
31
31
|
}));
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export var icon =
|
|
34
|
+
export var icon = EuiIconKeyboard;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS, euiFontSize, euiBackgroundColor } from '../../global_styling';
|
|
9
|
+
import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor } from '../../global_styling';
|
|
10
10
|
import { euiLinkCSS } from '../link/link.styles';
|
|
11
11
|
import { euiTitle } from '../title/title.styles';
|
|
12
12
|
/**
|
|
@@ -47,7 +47,8 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
47
47
|
var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
|
|
48
48
|
var headingMarginTop = "".concat(parseFloat(euiTheme.size[customScale]) * 2, "px");
|
|
49
49
|
var headingMarginBottom = euiTheme.size[customScale];
|
|
50
|
-
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n
|
|
50
|
+
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
|
|
51
|
+
_customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
53
54
|
* Styles
|
|
@@ -57,8 +58,8 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
57
58
|
export var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
58
59
|
var euiTheme = euiThemeContext.euiTheme;
|
|
59
60
|
return {
|
|
60
|
-
euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiTheme), ";}img{display:block;width:100%;}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;
|
|
61
|
-
constrainedWidth: /*#__PURE__*/css(
|
|
61
|
+
euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiTheme), ";}img{display:block;width:100%;}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", logicalTextAlignCSS('center'), " ", logicalCSS('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", logicalCSS('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", logicalCSS('height', euiTheme.border.width.thick), " ", logicalCSS('width', '50%'), " ", logicalCSS('left', '25%'), " ", logicalCSS('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", logicalCSS('top', '0'), ";}&:after{", logicalCSS('bottom', '0'), ";}}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
|
|
62
|
+
constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
62
63
|
// Sizes
|
|
63
64
|
m: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
64
65
|
measurement: 'rem',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel"
|
|
3
|
+
var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -21,7 +21,6 @@ export var EuiTimelineItem = function EuiTimelineItem(_ref) {
|
|
|
21
21
|
verticalAlign = _ref$verticalAlign === void 0 ? 'center' : _ref$verticalAlign,
|
|
22
22
|
icon = _ref.icon,
|
|
23
23
|
iconAriaLabel = _ref.iconAriaLabel,
|
|
24
|
-
className = _ref.className,
|
|
25
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
25
|
|
|
27
26
|
var styles = euiTimelineItemStyles();
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
import { useRef } from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* Wraps the given `value` into a `MutableRefObject` and keeps the `current`
|
|
11
|
+
* value up-to-date on every render cycle.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export function useLatest(value) {
|
|
15
|
+
var latestValueRef = useRef(value);
|
|
16
|
+
latestValueRef.current = value;
|
|
17
|
+
return latestValueRef;
|
|
18
|
+
}
|
|
@@ -18,7 +18,7 @@ export var replaceEmotionPrefix = function replaceEmotionPrefix(selector) {
|
|
|
18
18
|
// Starts with `css-[hash]-`.
|
|
19
19
|
// Contains `eui[ComponentName] or `Eui[ComponentName]`.
|
|
20
20
|
// Capture the component name (from above) and all variant additions until the end of the string.
|
|
21
|
-
var euiMatch = selector.match( /*#__PURE__*/_wrapRegExp(/css\x2D[0-9A-Z_a-z]{
|
|
21
|
+
var euiMatch = selector.match( /*#__PURE__*/_wrapRegExp(/css\x2D[0-9A-Z_a-z]{5,}\x2D([Ee]ui[A-Z][\x2D0-9A-Z_a-z]*$)/, {
|
|
22
22
|
euiComponent: 1
|
|
23
23
|
})); // Use the captured group (`euiComponent`) if available and prepend with `emotion-`,
|
|
24
24
|
// otherwise use the full selector.
|
|
@@ -15,17 +15,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
+
var _timeline = require("../timeline");
|
|
19
|
+
|
|
18
20
|
var _comment_event = require("./comment_event");
|
|
19
21
|
|
|
20
22
|
var _comment_timeline = require("./comment_timeline");
|
|
21
23
|
|
|
22
24
|
var _react2 = require("@emotion/react");
|
|
23
25
|
|
|
24
|
-
var _excluded = ["children", "className", "username", "event", "actions", "timelineIcon", "
|
|
25
|
-
var typeToClassNameMap = {
|
|
26
|
-
regular: '',
|
|
27
|
-
update: 'euiComment--update'
|
|
28
|
-
};
|
|
26
|
+
var _excluded = ["children", "className", "username", "event", "actions", "timestamp", "timelineIcon", "eventColor", "eventIcon", "eventIconAriaLabel"];
|
|
29
27
|
|
|
30
28
|
var EuiComment = function EuiComment(_ref) {
|
|
31
29
|
var children = _ref.children,
|
|
@@ -33,25 +31,31 @@ var EuiComment = function EuiComment(_ref) {
|
|
|
33
31
|
username = _ref.username,
|
|
34
32
|
event = _ref.event,
|
|
35
33
|
actions = _ref.actions,
|
|
36
|
-
timelineIcon = _ref.timelineIcon,
|
|
37
|
-
_ref$type = _ref.type,
|
|
38
|
-
type = _ref$type === void 0 ? 'regular' : _ref$type,
|
|
39
34
|
timestamp = _ref.timestamp,
|
|
35
|
+
timelineIcon = _ref.timelineIcon,
|
|
36
|
+
eventColor = _ref.eventColor,
|
|
37
|
+
eventIcon = _ref.eventIcon,
|
|
38
|
+
eventIconAriaLabel = _ref.eventIconAriaLabel,
|
|
40
39
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
-
var classes = (0, _classnames.default)('euiComment',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}, rest), (0, _react2.jsx)(_comment_timeline.EuiCommentTimeline, {
|
|
47
|
-
type: type,
|
|
40
|
+
var classes = (0, _classnames.default)('euiComment', className);
|
|
41
|
+
var isTypeUpdate = !children;
|
|
42
|
+
var verticalAlign = isTypeUpdate ? 'center' : 'top';
|
|
43
|
+
var mainIcon = (0, _react2.jsx)(_comment_timeline.EuiCommentTimeline, {
|
|
44
|
+
username: username,
|
|
48
45
|
timelineIcon: timelineIcon
|
|
49
|
-
})
|
|
46
|
+
});
|
|
47
|
+
return (0, _react2.jsx)(_timeline.EuiTimelineItem, (0, _extends2.default)({
|
|
48
|
+
verticalAlign: verticalAlign,
|
|
49
|
+
className: classes,
|
|
50
|
+
icon: mainIcon
|
|
51
|
+
}, rest), (0, _react2.jsx)(_comment_event.EuiCommentEvent, {
|
|
50
52
|
username: username,
|
|
51
53
|
actions: actions,
|
|
52
54
|
event: event,
|
|
53
55
|
timestamp: timestamp,
|
|
54
|
-
|
|
56
|
+
eventColor: eventColor,
|
|
57
|
+
eventIcon: eventIcon,
|
|
58
|
+
eventIconAriaLabel: eventIconAriaLabel
|
|
55
59
|
}, children));
|
|
56
60
|
};
|
|
57
61
|
|
|
@@ -5,14 +5,22 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.EuiCommentEvent = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
11
|
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _services = require("../../services");
|
|
13
15
|
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
17
|
|
|
18
|
+
var _panel = require("../panel");
|
|
19
|
+
|
|
20
|
+
var _avatar = require("../avatar");
|
|
21
|
+
|
|
22
|
+
var _comment_event = require("./comment_event.styles");
|
|
23
|
+
|
|
16
24
|
var _react2 = require("@emotion/react");
|
|
17
25
|
|
|
18
26
|
/*
|
|
@@ -22,43 +30,89 @@ var _react2 = require("@emotion/react");
|
|
|
22
30
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
23
31
|
* Side Public License, v 1.
|
|
24
32
|
*/
|
|
25
|
-
var typeToClassNameMap = {
|
|
26
|
-
regular: 'euiCommentEvent--regular',
|
|
27
|
-
update: 'euiCommentEvent--update'
|
|
28
|
-
};
|
|
29
|
-
var TYPES = (0, _common.keysOf)(typeToClassNameMap);
|
|
30
|
-
exports.TYPES = TYPES;
|
|
31
|
-
|
|
32
33
|
var EuiCommentEvent = function EuiCommentEvent(_ref) {
|
|
33
34
|
var children = _ref.children,
|
|
34
35
|
className = _ref.className,
|
|
36
|
+
eventIcon = _ref.eventIcon,
|
|
37
|
+
eventIconAriaLabel = _ref.eventIconAriaLabel,
|
|
35
38
|
username = _ref.username,
|
|
36
39
|
timestamp = _ref.timestamp,
|
|
37
|
-
_ref$type = _ref.type,
|
|
38
|
-
type = _ref$type === void 0 ? 'regular' : _ref$type,
|
|
39
40
|
event = _ref.event,
|
|
40
|
-
actions = _ref.actions
|
|
41
|
-
|
|
42
|
-
var
|
|
41
|
+
actions = _ref.actions,
|
|
42
|
+
eventColor = _ref.eventColor;
|
|
43
|
+
var classes = (0, _classnames.default)('euiCommentEvent', className); // the username is required so we only check if other elements are define
|
|
44
|
+
|
|
45
|
+
var hasEventElements = eventIcon || timestamp || event || actions;
|
|
46
|
+
var isTypeRegular = children && hasEventElements;
|
|
47
|
+
var isTypeUpdate = !children && hasEventElements;
|
|
48
|
+
var type;
|
|
49
|
+
|
|
50
|
+
if (isTypeRegular) {
|
|
51
|
+
type = 'regular';
|
|
52
|
+
} else if (isTypeUpdate) {
|
|
53
|
+
type = 'update';
|
|
54
|
+
} else {
|
|
55
|
+
type = 'custom';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
59
|
+
var styles = (0, _comment_event.euiCommentEventStyles)(euiTheme);
|
|
60
|
+
var cssStyles = [styles.euiCommentEvent, styles[type]];
|
|
61
|
+
var headerStyles = (0, _comment_event.euiCommentEventHeaderStyles)(euiTheme);
|
|
62
|
+
var cssHeaderStyles = [headerStyles.euiCommentEvent__header, eventColor && headerStyles.hasEventColor, isTypeRegular && headerStyles.regular];
|
|
63
|
+
var cssHeaderPanelStyles = headerStyles.euiCommentEvent__headerPanel;
|
|
64
|
+
var cssHeaderEventIconStyles = headerStyles.euiCommentEvent__headerEventIcon;
|
|
65
|
+
var cssHeaderUsernameStyles = headerStyles.euiCommentEvent__headerUsername;
|
|
66
|
+
var cssHeaderEventStyles = headerStyles.euiCommentEvent__headerEvent;
|
|
67
|
+
var cssHeaderTimestampStyles = headerStyles.euiCommentEvent__headerTimestamp;
|
|
68
|
+
var cssHeaderMainStyles = headerStyles.euiCommentEvent__headerMain;
|
|
69
|
+
var cssHeaderDataStyles = headerStyles.euiCommentEvent__headerData;
|
|
70
|
+
var cssHeaderActionsStyles = headerStyles.euiCommentEvent__headerActions;
|
|
71
|
+
var bodyStyles = (0, _comment_event.euiCommentEventBodyStyles)(euiTheme);
|
|
72
|
+
var cssBodyStyles = [bodyStyles.euiCommentEvent__body, bodyStyles[type]];
|
|
73
|
+
var isFigure = isTypeRegular;
|
|
43
74
|
var Element = isFigure ? 'figure' : 'div';
|
|
44
|
-
var HeaderElement = isFigure ? 'figcaption' : 'div';
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
75
|
+
var HeaderElement = isFigure ? 'figcaption' : 'div'; // The 'plain' color creates a shadow and adds a border radius that we don't want.
|
|
76
|
+
// So for these cases we use the transparent color instead.
|
|
77
|
+
|
|
78
|
+
var finalEventColor = eventColor === 'plain' ? 'transparent' : eventColor;
|
|
79
|
+
var panelProps = finalEventColor ? {
|
|
80
|
+
color: finalEventColor,
|
|
81
|
+
paddingSize: 's'
|
|
82
|
+
} : {
|
|
83
|
+
color: 'transparent',
|
|
84
|
+
paddingSize: 'none'
|
|
85
|
+
};
|
|
86
|
+
var eventHeader = (0, _react2.jsx)(HeaderElement, {
|
|
87
|
+
css: cssHeaderStyles
|
|
88
|
+
}, (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({}, panelProps, {
|
|
89
|
+
css: cssHeaderPanelStyles
|
|
90
|
+
}), (0, _react2.jsx)("div", {
|
|
91
|
+
css: cssHeaderMainStyles
|
|
51
92
|
}, (0, _react2.jsx)("div", {
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
93
|
+
css: cssHeaderDataStyles
|
|
94
|
+
}, eventIcon && (0, _react2.jsx)(_avatar.EuiAvatar, {
|
|
95
|
+
css: cssHeaderEventIconStyles,
|
|
96
|
+
size: "s",
|
|
97
|
+
iconType: eventIcon,
|
|
98
|
+
name: eventIconAriaLabel ? eventIconAriaLabel : '',
|
|
99
|
+
color: "subdued",
|
|
100
|
+
"aria-hidden": !eventIconAriaLabel
|
|
101
|
+
}), username && (0, _react2.jsx)("div", {
|
|
102
|
+
css: cssHeaderUsernameStyles
|
|
103
|
+
}, username), event && (0, _react2.jsx)("div", {
|
|
104
|
+
css: cssHeaderEventStyles
|
|
105
|
+
}, event), timestamp && (0, _react2.jsx)("div", {
|
|
106
|
+
css: cssHeaderTimestampStyles
|
|
107
|
+
}, (0, _react2.jsx)("time", null, timestamp))), actions && (0, _react2.jsx)("div", {
|
|
108
|
+
css: cssHeaderActionsStyles
|
|
109
|
+
}, actions))));
|
|
110
|
+
return (0, _react2.jsx)(Element, {
|
|
111
|
+
className: classes,
|
|
112
|
+
css: cssStyles
|
|
113
|
+
}, hasEventElements && eventHeader, children && (0, _react2.jsx)("div", {
|
|
114
|
+
css: cssBodyStyles
|
|
115
|
+
}, children));
|
|
62
116
|
};
|
|
63
117
|
|
|
64
118
|
exports.EuiCommentEvent = EuiCommentEvent;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiCommentEventStyles = exports.euiCommentEventHeaderStyles = exports.euiCommentEventBodyStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
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)."; }
|
|
13
|
+
|
|
14
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "yoyozp-euiCommentEvent",
|
|
16
|
+
styles: "overflow:hidden;label:euiCommentEvent;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "yoyozp-euiCommentEvent",
|
|
19
|
+
styles: "overflow:hidden;label:euiCommentEvent;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var euiCommentEventStyles = function euiCommentEventStyles(_ref4) {
|
|
24
|
+
var euiTheme = _ref4.euiTheme;
|
|
25
|
+
return {
|
|
26
|
+
euiCommentEvent: _ref3,
|
|
27
|
+
// types
|
|
28
|
+
regular: /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.thin, ";border-radius:", euiTheme.border.radius.medium, ";;label:regular;"),
|
|
29
|
+
update: /*#__PURE__*/(0, _react.css)(";label:update;"),
|
|
30
|
+
custom: /*#__PURE__*/(0, _react.css)(";label:custom;")
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.euiCommentEventStyles = euiCommentEventStyles;
|
|
35
|
+
|
|
36
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
37
|
+
name: "bqgcpj-hasEventColor",
|
|
38
|
+
styles: "padding:0;label:hasEventColor;"
|
|
39
|
+
} : {
|
|
40
|
+
name: "bqgcpj-hasEventColor",
|
|
41
|
+
styles: "padding:0;label:hasEventColor;",
|
|
42
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
46
|
+
name: "ui5tce-euiCommentEvent__headerEvent",
|
|
47
|
+
styles: "align-items:center;display:inline-flex;white-space:pre-wrap;flex-wrap:wrap;label:euiCommentEvent__headerEvent;"
|
|
48
|
+
} : {
|
|
49
|
+
name: "ui5tce-euiCommentEvent__headerEvent",
|
|
50
|
+
styles: "align-items:center;display:inline-flex;white-space:pre-wrap;flex-wrap:wrap;label:euiCommentEvent__headerEvent;",
|
|
51
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var euiCommentEventHeaderStyles = function euiCommentEventHeaderStyles(_ref5) {
|
|
55
|
+
var euiTheme = _ref5.euiTheme;
|
|
56
|
+
return {
|
|
57
|
+
euiCommentEvent__header: /*#__PURE__*/(0, _react.css)(";label:euiCommentEvent__header;"),
|
|
58
|
+
euiCommentEvent__headerPanel: /*#__PURE__*/(0, _react.css)(";label:euiCommentEvent__headerPanel;"),
|
|
59
|
+
euiCommentEvent__headerMain: /*#__PURE__*/(0, _react.css)("display:flex;flex:1;gap:", euiTheme.size.s, ";;label:euiCommentEvent__headerMain;"),
|
|
60
|
+
euiCommentEvent__headerData: /*#__PURE__*/(0, _react.css)("display:flex;flex:1;align-items:center;flex-wrap:wrap;gap:", euiTheme.size.xs, ";;label:euiCommentEvent__headerData;"),
|
|
61
|
+
euiCommentEvent__headerEventIcon: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:euiCommentEvent__headerEventIcon;"),
|
|
62
|
+
euiCommentEvent__headerUsername: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.semiBold, ";;label:euiCommentEvent__headerUsername;"),
|
|
63
|
+
euiCommentEvent__headerEvent: _ref2,
|
|
64
|
+
euiCommentEvent__headerTimestamp: /*#__PURE__*/(0, _react.css)(";label:euiCommentEvent__headerTimestamp;"),
|
|
65
|
+
euiCommentEvent__headerActions: /*#__PURE__*/(0, _react.css)("display:flex;flex-wrap:wrap;gap:", euiTheme.size.xs, ";;label:euiCommentEvent__headerActions;"),
|
|
66
|
+
// types
|
|
67
|
+
regular: /*#__PURE__*/(0, _react.css)("background:", euiTheme.colors.lightestShade, ";border-bottom:", euiTheme.border.thin, ";padding:", euiTheme.size.s, ";;label:regular;"),
|
|
68
|
+
// variants
|
|
69
|
+
hasEventColor: _ref
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.euiCommentEventHeaderStyles = euiCommentEventHeaderStyles;
|
|
74
|
+
|
|
75
|
+
var euiCommentEventBodyStyles = function euiCommentEventBodyStyles(_ref6) {
|
|
76
|
+
var euiTheme = _ref6.euiTheme;
|
|
77
|
+
return {
|
|
78
|
+
euiCommentEvent__body: /*#__PURE__*/(0, _react.css)(";label:euiCommentEvent__body;"),
|
|
79
|
+
// types
|
|
80
|
+
regular: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.s, ";;label:regular;"),
|
|
81
|
+
update: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-top', euiTheme.size.xs), ";;label:update;"),
|
|
82
|
+
custom: /*#__PURE__*/(0, _react.css)(";label:custom;")
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.euiCommentEventBodyStyles = euiCommentEventBodyStyles;
|