@elastic/eui 87.2.0 → 88.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +9 -8
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +2 -159
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +2 -159
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/es/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/es/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/es/components/color_picker/color_stops/color_stops.js +11 -0
- package/es/components/control_bar/control_bar.js +11 -0
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -1
- package/es/components/description_list/description_list.js +66 -13
- package/es/components/description_list/description_list.styles.js +19 -6
- package/es/components/description_list/description_list_context.js +1 -1
- package/es/components/description_list/description_list_description.js +3 -9
- package/es/components/description_list/description_list_description.styles.js +3 -9
- package/es/components/description_list/description_list_title.js +7 -4
- package/es/components/description_list/description_list_title.styles.js +3 -6
- package/es/components/description_list/description_list_types.js +4 -2
- package/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
- package/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
- package/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/es/components/notification/notification_event.js +10 -0
- package/es/components/suggest/suggest.js +16 -0
- package/es/components/suggest/suggest_item.js +12 -0
- package/es/components/text/text.styles.js +3 -6
- package/es/global_styling/functions/typography.js +8 -8
- package/es/global_styling/variables/typography.js +1 -1
- package/es/services/color_picker/color_picker.js +4 -0
- package/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/eui.d.ts +2226 -2104
- package/i18ntokens.json +96 -96
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/lib/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/lib/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/lib/components/color_picker/color_stops/color_stops.js +10 -1
- package/lib/components/control_bar/control_bar.js +10 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -1
- package/lib/components/description_list/description_list.js +68 -13
- package/lib/components/description_list/description_list.styles.js +24 -13
- package/lib/components/description_list/description_list_context.js +1 -1
- package/lib/components/description_list/description_list_description.js +2 -8
- package/lib/components/description_list/description_list_description.styles.js +2 -8
- package/lib/components/description_list/description_list_title.js +7 -4
- package/lib/components/description_list/description_list_title.styles.js +2 -5
- package/lib/components/description_list/description_list_types.js +8 -4
- package/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/lib/components/notification/notification_event.js +9 -0
- package/lib/components/suggest/suggest.js +16 -0
- package/lib/components/suggest/suggest_item.js +11 -0
- package/lib/components/text/text.styles.js +3 -6
- package/lib/global_styling/functions/typography.js +8 -8
- package/lib/global_styling/variables/typography.js +3 -3
- package/lib/services/color_picker/color_picker.js +4 -0
- package/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +4 -2
- package/optimize/es/components/color_picker/color_stops/color_stops.js +11 -0
- package/optimize/es/components/control_bar/control_bar.js +11 -0
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -1
- package/optimize/es/components/description_list/description_list.js +41 -11
- package/optimize/es/components/description_list/description_list.styles.js +19 -6
- package/optimize/es/components/description_list/description_list_context.js +1 -1
- package/optimize/es/components/description_list/description_list_description.js +3 -9
- package/optimize/es/components/description_list/description_list_description.styles.js +3 -9
- package/optimize/es/components/description_list/description_list_title.js +7 -4
- package/optimize/es/components/description_list/description_list_title.styles.js +3 -6
- package/optimize/es/components/description_list/description_list_types.js +4 -2
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/es/components/notification/notification_event.js +10 -0
- package/optimize/es/components/suggest/suggest.js +16 -0
- package/optimize/es/components/suggest/suggest_item.js +12 -0
- package/optimize/es/components/text/text.styles.js +3 -6
- package/optimize/es/global_styling/functions/typography.js +8 -8
- package/optimize/es/global_styling/variables/typography.js +1 -1
- package/optimize/es/services/color_picker/color_picker.js +4 -0
- package/optimize/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +4 -2
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +10 -1
- package/optimize/lib/components/control_bar/control_bar.js +10 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -1
- package/optimize/lib/components/description_list/description_list.js +44 -11
- package/optimize/lib/components/description_list/description_list.styles.js +24 -13
- package/optimize/lib/components/description_list/description_list_context.js +1 -1
- package/optimize/lib/components/description_list/description_list_description.js +2 -8
- package/optimize/lib/components/description_list/description_list_description.styles.js +2 -8
- package/optimize/lib/components/description_list/description_list_title.js +7 -4
- package/optimize/lib/components/description_list/description_list_title.styles.js +2 -5
- package/optimize/lib/components/description_list/description_list_types.js +8 -4
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/lib/components/notification/notification_event.js +9 -0
- package/optimize/lib/components/suggest/suggest.js +16 -0
- package/optimize/lib/components/suggest/suggest_item.js +11 -0
- package/optimize/lib/components/text/text.styles.js +3 -6
- package/optimize/lib/global_styling/functions/typography.js +8 -8
- package/optimize/lib/global_styling/variables/typography.js +3 -3
- package/optimize/lib/services/color_picker/color_picker.js +4 -0
- package/optimize/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/package.json +6 -6
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +1 -7
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/test-env/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/test-env/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/test-env/components/color_picker/color_stops/color_stops.js +10 -1
- package/test-env/components/control_bar/control_bar.js +10 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -1
- package/test-env/components/description_list/description_list.js +66 -13
- package/test-env/components/description_list/description_list.styles.js +24 -13
- package/test-env/components/description_list/description_list_context.js +1 -1
- package/test-env/components/description_list/description_list_description.js +2 -8
- package/test-env/components/description_list/description_list_description.styles.js +2 -8
- package/test-env/components/description_list/description_list_title.js +7 -4
- package/test-env/components/description_list/description_list_title.styles.js +2 -5
- package/test-env/components/description_list/description_list_types.js +8 -4
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/test-env/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/test-env/components/markdown_editor/markdown_format.styles.js +3 -6
- package/test-env/components/notification/notification_event.js +9 -0
- package/test-env/components/suggest/suggest.js +16 -0
- package/test-env/components/suggest/suggest_item.js +11 -0
- package/test-env/components/text/text.styles.js +3 -6
- package/test-env/global_styling/functions/typography.js +8 -8
- package/test-env/global_styling/variables/typography.js +3 -3
- package/test-env/services/color_picker/color_picker.js +4 -0
- package/test-env/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/src/components/key_pad_menu/_index.scss +0 -5
- package/src/components/key_pad_menu/_key_pad_menu_item.scss +0 -123
- package/src/components/key_pad_menu/_variables.scss +0 -2
- package/src/themes/amsterdam/overrides/_key_pad_menu.scss +0 -46
|
@@ -7,20 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { euiFontSize, euiTextBreakWord, logicalTextAlignCSS,
|
|
11
|
-
import { tint } from '../../services';
|
|
10
|
+
import { euiFontSize, euiTextBreakWord, logicalTextAlignCSS, logicalCSS } from '../../global_styling';
|
|
12
11
|
import { euiTitle } from '../title/title.styles';
|
|
13
12
|
export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
|
|
14
13
|
var euiTheme = euiThemeContext.euiTheme,
|
|
15
14
|
colorMode = euiThemeContext.colorMode;
|
|
16
|
-
var columnDisplay = "\n ".concat(logicalCSS('width', '50%'), "\n ").concat(logicalCSS('padding-right', euiTheme.size.s), "\n ");
|
|
17
15
|
return {
|
|
18
16
|
euiDescriptionList__title: /*#__PURE__*/css(euiTextBreakWord(), ";;label:euiDescriptionList__title;"),
|
|
19
17
|
// Types
|
|
20
18
|
row: /*#__PURE__*/css(";label:row;"),
|
|
21
|
-
column: /*#__PURE__*/css(
|
|
22
|
-
|
|
23
|
-
inline: /*#__PURE__*/css("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? tint(euiTheme.colors.lightestShade, 0.5) : euiTheme.colors.lightestShade, ";", logicalCSS('margin-vertical', '0'), " ", logicalCSS('margin-horizontal', euiTheme.size.xs), "&:first-of-type{", logicalCSS('margin-left', '0'), ";};label:inline;"),
|
|
19
|
+
column: /*#__PURE__*/css(";label:column;"),
|
|
20
|
+
inline: /*#__PURE__*/css("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? euiTheme.colors.lightShade : euiTheme.colors.lightestShade, ";", logicalCSS('margin-vertical', '0'), " ", logicalCSS('margin-horizontal', euiTheme.size.xs), " ", colorMode === 'DARK' && "color: ".concat(euiTheme.colors.title, ";"), "&:first-of-type{", logicalCSS('margin-left', '0'), ";};label:inline;"),
|
|
24
21
|
// This nested block handles just the font styling based on compressed and reverse
|
|
25
22
|
fontStyles: {
|
|
26
23
|
normal: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xs'), ";;label:normal;"),
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export var
|
|
9
|
+
export var CHILD_TYPES = ['row', 'inline', 'column'];
|
|
10
|
+
export var TYPES = [].concat(CHILD_TYPES, ['responsiveColumn']);
|
|
10
11
|
export var ALIGNMENTS = ['center', 'left'];
|
|
11
12
|
export var TEXT_STYLES = ['normal', 'reverse'];
|
|
12
|
-
export var
|
|
13
|
+
export var ROW_GUTTER_SIZES = ['s', 'm'];
|
|
14
|
+
export var COLUMN_GUTTER_SIZES = ['s', 'm'];
|
|
@@ -9,13 +9,14 @@ var _excluded = ["id", "isSelected", "isDisabled", "label", "children", "classNa
|
|
|
9
9
|
* Side Public License, v 1.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import React from 'react';
|
|
12
|
+
import React, { useMemo } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiTheme, getSecureRelForTarget, useGeneratedHtmlId } from '../../services';
|
|
14
15
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
15
|
-
import { getSecureRelForTarget, useGeneratedHtmlId } from '../../services';
|
|
16
16
|
import { EuiRadio, EuiCheckbox } from '../form';
|
|
17
17
|
import { validateHref } from '../../services/security/href_validator';
|
|
18
18
|
import { EuiToolTip } from '../tool_tip';
|
|
19
|
+
import { euiKeyPadMenuItemStyles, euiKeyPadMenuItemChildStyles } from './key_pad_menu_item.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
21
22
|
var id = _ref.id,
|
|
@@ -40,48 +41,45 @@ export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
40
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
42
|
var isHrefValid = !href || validateHref(href);
|
|
42
43
|
var isDisabled = disabled || _isDisabled || !isHrefValid;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'euiKeyPadMenuItem-isSelected': isSelected
|
|
48
|
-
}, className);
|
|
44
|
+
var euiTheme = useEuiTheme();
|
|
45
|
+
var styles = euiKeyPadMenuItemStyles(euiTheme);
|
|
46
|
+
var cssStyles = [styles.euiKeyPadMenuItem, !isDisabled ? styles.enabled : styles.disabled.disabled, isSelected && (!isDisabled ? styles.selected : styles.disabled.selected)];
|
|
47
|
+
var classes = classNames('euiKeyPadMenuItem', className);
|
|
49
48
|
var Element = href && !isDisabled ? 'a' : 'button';
|
|
50
49
|
if (checkable) Element = 'label';
|
|
51
50
|
var itemId = useGeneratedHtmlId({
|
|
52
51
|
conditionalId: id
|
|
53
52
|
});
|
|
54
|
-
var
|
|
53
|
+
var childStyles = useMemo(function () {
|
|
54
|
+
return euiKeyPadMenuItemChildStyles(euiTheme);
|
|
55
|
+
}, [euiTheme]);
|
|
56
|
+
var checkableElement = useMemo(function () {
|
|
55
57
|
if (!checkable) return;
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
+
var cssStyles = [childStyles.euiKeyPadMenuItem__checkableInput, !isSelected && isDisabled && childStyles.hideCheckableInput, !isSelected && !isDisabled && childStyles.showCheckableInputOnInteraction];
|
|
59
|
+
var sharedProps = {
|
|
60
|
+
id: itemId,
|
|
61
|
+
className: 'euiKeyPadMenuItem__checkableInput',
|
|
62
|
+
css: cssStyles,
|
|
63
|
+
checked: isSelected,
|
|
64
|
+
disabled: isDisabled,
|
|
65
|
+
name: name
|
|
66
|
+
};
|
|
58
67
|
if (checkable === 'single') {
|
|
59
|
-
|
|
60
|
-
id: itemId,
|
|
61
|
-
className: inputClasses,
|
|
62
|
-
checked: isSelected,
|
|
63
|
-
disabled: isDisabled,
|
|
64
|
-
name: name,
|
|
68
|
+
return ___EmotionJSX(EuiRadio, _extends({}, sharedProps, {
|
|
65
69
|
value: value,
|
|
66
70
|
onChange: function onChange() {
|
|
67
71
|
return _onChange(itemId, value);
|
|
68
72
|
}
|
|
69
|
-
});
|
|
73
|
+
}));
|
|
70
74
|
} else {
|
|
71
|
-
|
|
72
|
-
id: itemId,
|
|
73
|
-
className: inputClasses,
|
|
74
|
-
checked: isSelected,
|
|
75
|
-
disabled: isDisabled,
|
|
76
|
-
name: name,
|
|
75
|
+
return ___EmotionJSX(EuiCheckbox, _extends({}, sharedProps, {
|
|
77
76
|
onChange: function onChange() {
|
|
78
77
|
return _onChange(itemId);
|
|
79
78
|
}
|
|
80
|
-
});
|
|
79
|
+
}));
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var renderBetaBadge = function renderBetaBadge() {
|
|
81
|
+
}, [checkable, isDisabled, isSelected, _onChange, value, name, itemId, childStyles]);
|
|
82
|
+
var betaBadge = useMemo(function () {
|
|
85
83
|
if (!betaBadgeLabel) return;
|
|
86
84
|
return ___EmotionJSX(EuiBetaBadge
|
|
87
85
|
// Since we move the tooltip contents to a wrapping EuiToolTip,
|
|
@@ -91,10 +89,11 @@ export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
91
89
|
size: "s",
|
|
92
90
|
color: "subdued",
|
|
93
91
|
className: "euiKeyPadMenuItem__betaBadge",
|
|
92
|
+
css: childStyles.euiKeyPadMenuItem__betaBadge,
|
|
94
93
|
label: betaBadgeLabel.charAt(0),
|
|
95
94
|
iconType: betaBadgeIconType
|
|
96
95
|
});
|
|
97
|
-
};
|
|
96
|
+
}, [betaBadgeLabel, betaBadgeIconType, childStyles]);
|
|
98
97
|
var relObj = {};
|
|
99
98
|
if (href && !isDisabled) {
|
|
100
99
|
relObj.href = href;
|
|
@@ -113,16 +112,20 @@ export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
113
112
|
relObj['aria-pressed'] = isSelected;
|
|
114
113
|
}
|
|
115
114
|
var button = ___EmotionJSX(Element, _extends({
|
|
116
|
-
className: classes
|
|
115
|
+
className: classes,
|
|
116
|
+
css: cssStyles
|
|
117
117
|
}, relObj, rest, {
|
|
118
118
|
// Unable to get past `LegacyRef` conflicts
|
|
119
119
|
ref: buttonRef
|
|
120
120
|
}), ___EmotionJSX("span", {
|
|
121
|
-
className: "euiKeyPadMenuItem__inner"
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
className: "euiKeyPadMenuItem__inner",
|
|
122
|
+
css: childStyles.euiKeyPadMenuItem__inner
|
|
123
|
+
}, checkable ? checkableElement : betaBadge, ___EmotionJSX("span", {
|
|
124
|
+
className: "euiKeyPadMenuItem__icon",
|
|
125
|
+
css: childStyles.euiKeyPadMenuItem__icon
|
|
124
126
|
}, children), ___EmotionJSX("span", {
|
|
125
|
-
className: "euiKeyPadMenuItem__label"
|
|
127
|
+
className: "euiKeyPadMenuItem__label",
|
|
128
|
+
css: childStyles.euiKeyPadMenuItem__label
|
|
126
129
|
}, label)));
|
|
127
130
|
return betaBadgeLabel ? ___EmotionJSX(EuiToolTip, _extends({}, betaBadgeTooltipProps, {
|
|
128
131
|
title: betaBadgeLabel,
|
|
@@ -0,0 +1,41 @@
|
|
|
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 { transparentize } from '../../services';
|
|
11
|
+
import { logicalCSS, logicalSizeCSS, euiCanAnimate, euiFontSize } from '../../global_styling';
|
|
12
|
+
import { euiShadow } from '../../themes/amsterdam/global_styling/mixins';
|
|
13
|
+
import { euiScreenReaderOnly } from '../accessibility';
|
|
14
|
+
import { euiKeyPadMenuVariables } from './key_pad_menu.styles';
|
|
15
|
+
export var euiKeyPadMenuItemStyles = function euiKeyPadMenuItemStyles(euiThemeContext) {
|
|
16
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
17
|
+
var _euiKeyPadMenuVariabl = euiKeyPadMenuVariables(euiThemeContext),
|
|
18
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize;
|
|
19
|
+
return {
|
|
20
|
+
euiKeyPadMenuItem: /*#__PURE__*/css("display:block;padding:", euiTheme.size.xs, ";", logicalSizeCSS(euiKeyPadMenuSize), " border-radius:", euiTheme.border.radius.medium, ";color:", euiTheme.colors.text, ";", euiCanAnimate, "{transition:background-color ", euiTheme.animation.fast, " ease-in,box-shadow ", euiTheme.animation.fast, " ease-in;};label:euiKeyPadMenuItem;"),
|
|
21
|
+
enabled: /*#__PURE__*/css("&:hover,&:focus,&:focus-within{cursor:pointer;text-decoration:underline;", euiShadow(euiThemeContext, 's'), " ", euiCanAnimate, "{.euiKeyPadMenuItem__icon{transform:translateY(0);}}}&:focus{background-color:", euiTheme.focus.backgroundColor, ";box-shadow:none;};label:enabled;"),
|
|
22
|
+
selected: /*#__PURE__*/css("color:", euiTheme.colors.title, ";background-color:", euiTheme.focus.backgroundColor, ";&,&:hover,&:focus,&:focus-within{color:", euiTheme.colors.primaryText, ";};label:selected;"),
|
|
23
|
+
disabled: {
|
|
24
|
+
disabled: /*#__PURE__*/css("cursor:not-allowed;color:", euiTheme.colors.disabledText, ";.euiKeyPadMenuItem__icon{filter:grayscale(100%);svg *{fill:", euiTheme.colors.disabledText, ";}};label:disabled;"),
|
|
25
|
+
selected: /*#__PURE__*/css("background-color:", transparentize(euiTheme.colors.disabled, euiTheme.focus.transparency), ";;label:selected;")
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export var euiKeyPadMenuItemChildStyles = function euiKeyPadMenuItemChildStyles(euiThemeContext) {
|
|
30
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
|
+
var topRightChildren = "\n z-index: 3;\n position: absolute;\n ".concat(logicalCSS('top', euiTheme.size.xs), "\n ").concat(logicalCSS('right', euiTheme.size.xs), "\n ");
|
|
32
|
+
return {
|
|
33
|
+
euiKeyPadMenuItem__inner: /*#__PURE__*/css(logicalSizeCSS('100%'), " display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;;label:euiKeyPadMenuItem__inner;"),
|
|
34
|
+
euiKeyPadMenuItem__icon: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.m), " transform:translateY(2px);", euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";};label:euiKeyPadMenuItem__icon;"),
|
|
35
|
+
euiKeyPadMenuItem__label: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), " font-weight:", euiTheme.font.weight.semiBold, ";text-align:center;;label:euiKeyPadMenuItem__label;"),
|
|
36
|
+
euiKeyPadMenuItem__betaBadge: /*#__PURE__*/css(topRightChildren, ";;label:euiKeyPadMenuItem__betaBadge;"),
|
|
37
|
+
euiKeyPadMenuItem__checkableInput: /*#__PURE__*/css(topRightChildren, " transform:scale(.75);transform-origin:top right;&&{position:absolute;};label:euiKeyPadMenuItem__checkableInput;"),
|
|
38
|
+
showCheckableInputOnInteraction: /*#__PURE__*/css(".euiKeyPadMenuItem:not(:hover, :focus, :focus-within) &{", euiScreenReaderOnly(), ";};label:showCheckableInputOnInteraction;"),
|
|
39
|
+
hideCheckableInput: /*#__PURE__*/css(euiScreenReaderOnly(), ";;label:hideCheckableInput;")
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -17,8 +17,8 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
17
17
|
var _euiFontSize = euiFontSize(euiTheme, 'm', options),
|
|
18
18
|
fontSize = _euiFontSize.fontSize,
|
|
19
19
|
lineHeight = _euiFontSize.lineHeight;
|
|
20
|
-
var
|
|
21
|
-
var lineHeightSize =
|
|
20
|
+
var unit = options.unit;
|
|
21
|
+
var lineHeightSize = unit === 'em' ? "".concat(lineHeight, "em") : lineHeight;
|
|
22
22
|
|
|
23
23
|
// Custom scales
|
|
24
24
|
var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
|
|
@@ -39,19 +39,16 @@ export var euiMarkdownFormatStyles = function euiMarkdownFormatStyles(euiTheme)
|
|
|
39
39
|
euiMarkdownFormat: /*#__PURE__*/css(";label:euiMarkdownFormat;"),
|
|
40
40
|
// Text sizes
|
|
41
41
|
m: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
42
|
-
measurement: 'rem',
|
|
43
42
|
customScale: 'm'
|
|
44
43
|
}), ";;label:m;"),
|
|
45
44
|
s: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
46
|
-
measurement: 'rem',
|
|
47
45
|
customScale: 's'
|
|
48
46
|
}), ";;label:s;"),
|
|
49
47
|
xs: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
50
|
-
measurement: 'rem',
|
|
51
48
|
customScale: 'xs'
|
|
52
49
|
}), ";;label:xs;"),
|
|
53
50
|
relative: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
54
|
-
|
|
51
|
+
unit: 'em'
|
|
55
52
|
}), ";;label:relative;")
|
|
56
53
|
};
|
|
57
54
|
};
|
|
@@ -18,7 +18,17 @@ import { EuiButtonEmpty } from '../button';
|
|
|
18
18
|
import { EuiLink } from '../link';
|
|
19
19
|
import { useGeneratedHtmlId } from '../../services';
|
|
20
20
|
import { EuiNotificationEventReadIcon } from './notification_event_read_icon';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
21
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated - EuiNotificationEvent is scheduled for deprecation due to low internal usage and high
|
|
28
|
+
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
29
|
+
*
|
|
30
|
+
* The component will be permanently removed in December 2023.
|
|
31
|
+
*/
|
|
22
32
|
export var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
23
33
|
var id = _ref.id,
|
|
24
34
|
type = _ref.type,
|
|
@@ -39,6 +39,22 @@ var statusMap = {
|
|
|
39
39
|
|
|
40
40
|
// keys of _EuiSuggestItemPropsBase
|
|
41
41
|
var suggestItemPropsKeys = ['label', 'type', 'description', 'labelDisplay', 'labelWidth', 'descriptionDisplay'];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated - EuiSuggest is scheduled for deprecation due to low internal usage and high
|
|
53
|
+
* overlap with other existing EUI components. We recommend using EuiSelectable instead,
|
|
54
|
+
* or copying this component into your own application for usage if necessary.
|
|
55
|
+
*
|
|
56
|
+
* The component will be permanently removed in October 2023.
|
|
57
|
+
*/
|
|
42
58
|
export var EuiSuggest = function EuiSuggest(_ref) {
|
|
43
59
|
var onItemClick = _ref.onItemClick,
|
|
44
60
|
onBlur = _ref.onBlur,
|
|
@@ -13,6 +13,10 @@ import React from 'react';
|
|
|
13
13
|
import { keysOf } from '../common';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { EuiIcon } from '../icon';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
16
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
21
|
var colorToClassNameMap = {
|
|
18
22
|
tint0: 'euiSuggestItem__type--tint0',
|
|
@@ -28,6 +32,14 @@ var colorToClassNameMap = {
|
|
|
28
32
|
tint10: 'euiSuggestItem__type--tint10'
|
|
29
33
|
};
|
|
30
34
|
export var COLORS = keysOf(colorToClassNameMap);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated - EuiSuggest is scheduled for deprecation due to low internal usage and high
|
|
38
|
+
* overlap with other existing EUI components. We recommend using EuiSelectable instead,
|
|
39
|
+
* or copying this component into your own application for usage if necessary.
|
|
40
|
+
*
|
|
41
|
+
* The component will be permanently removed in October 2023.
|
|
42
|
+
*/
|
|
31
43
|
export var EuiSuggestItem = function EuiSuggestItem(_ref) {
|
|
32
44
|
var className = _ref.className,
|
|
33
45
|
label = _ref.label,
|
|
@@ -33,9 +33,9 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
33
33
|
fontSize = _euiFontSize.fontSize,
|
|
34
34
|
lineHeight = _euiFontSize.lineHeight;
|
|
35
35
|
var euiTheme = euiThemeContext.euiTheme;
|
|
36
|
-
var
|
|
36
|
+
var unit = options.unit,
|
|
37
37
|
_customScale = options.customScale;
|
|
38
|
-
var lineHeightSize =
|
|
38
|
+
var lineHeightSize = unit === 'em' ? "".concat(lineHeight, "em") : lineHeight;
|
|
39
39
|
var headings = {
|
|
40
40
|
h1: euiTitle(euiThemeContext, 'l', options),
|
|
41
41
|
h2: euiTitle(euiThemeContext, 'm', options),
|
|
@@ -71,19 +71,16 @@ export var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
|
71
71
|
constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
72
72
|
// Sizes
|
|
73
73
|
m: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
74
|
-
measurement: 'rem',
|
|
75
74
|
customScale: 'm'
|
|
76
75
|
}), ";;label:m;"),
|
|
77
76
|
s: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
78
|
-
measurement: 'rem',
|
|
79
77
|
customScale: 's'
|
|
80
78
|
}), ";;label:s;"),
|
|
81
79
|
xs: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
82
|
-
measurement: 'rem',
|
|
83
80
|
customScale: 'xs'
|
|
84
81
|
}), ";;label:xs;"),
|
|
85
82
|
relative: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
86
|
-
|
|
83
|
+
unit: 'em'
|
|
87
84
|
}), ";;label:relative;")
|
|
88
85
|
};
|
|
89
86
|
};
|
|
@@ -20,16 +20,16 @@ export function euiFontSizeFromScale(scale, _ref) {
|
|
|
20
20
|
var base = _ref.base,
|
|
21
21
|
font = _ref.font;
|
|
22
22
|
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
23
|
-
_ref2$
|
|
24
|
-
|
|
23
|
+
_ref2$unit = _ref2.unit,
|
|
24
|
+
unit = _ref2$unit === void 0 ? font.defaultUnits : _ref2$unit,
|
|
25
25
|
customScale = _ref2.customScale;
|
|
26
|
-
if (
|
|
26
|
+
if (unit === 'em') {
|
|
27
27
|
return "".concat(font.scale[scale], "em");
|
|
28
28
|
}
|
|
29
29
|
var numerator = base * font.scale[scale];
|
|
30
30
|
if (customScale) numerator *= font.scale[customScale];
|
|
31
31
|
var denominator = base * font.scale[font.body.scale];
|
|
32
|
-
return
|
|
32
|
+
return unit === 'px' ? "".concat(numerator, "px") : "".concat((numerator / denominator).toFixed(4), "rem");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -48,8 +48,8 @@ export function euiLineHeightFromBaseline(scale, _ref3) {
|
|
|
48
48
|
var base = _ref3.base,
|
|
49
49
|
font = _ref3.font;
|
|
50
50
|
var _ref4 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
51
|
-
_ref4$
|
|
52
|
-
|
|
51
|
+
_ref4$unit = _ref4.unit,
|
|
52
|
+
unit = _ref4$unit === void 0 ? font.defaultUnits : _ref4$unit,
|
|
53
53
|
customScale = _ref4.customScale;
|
|
54
54
|
var baseline = font.baseline,
|
|
55
55
|
lineHeightMultiplier = font.lineHeightMultiplier;
|
|
@@ -57,13 +57,13 @@ export function euiLineHeightFromBaseline(scale, _ref3) {
|
|
|
57
57
|
if (customScale) numerator *= font.scale[customScale];
|
|
58
58
|
var denominator = base * font.scale[font.body.scale];
|
|
59
59
|
var _lineHeightMultiplier = numerator <= base ? lineHeightMultiplier : lineHeightMultiplier * 0.833;
|
|
60
|
-
if (
|
|
60
|
+
if (unit === 'em') {
|
|
61
61
|
// Even though the line-height via `em` cannot be determined against the pixel baseline grid;
|
|
62
62
|
// we will assume that typically larger scale font-sizes should have a shorter line-height;
|
|
63
63
|
return _lineHeightMultiplier.toFixed(4).toString();
|
|
64
64
|
}
|
|
65
65
|
var pixelValue = Math.floor(Math.round(numerator * _lineHeightMultiplier) / baseline) * baseline;
|
|
66
|
-
return
|
|
66
|
+
return unit === 'px' ? "".concat(pixelValue, "px") : "".concat((pixelValue / denominator).toFixed(4), "rem");
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
@@ -13,6 +13,10 @@ var generateRandomColor = function generateRandomColor() {
|
|
|
13
13
|
"#".concat(Math.floor(Math.random() * 16777215).toString(16))
|
|
14
14
|
);
|
|
15
15
|
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*/
|
|
16
20
|
export var useColorStopsState = function useColorStopsState() {
|
|
17
21
|
var useRandomColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
18
22
|
var initialColorStops = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [{
|
|
@@ -30,6 +30,7 @@ export var fontBase = {
|
|
|
30
30
|
familySerif: 'Georgia, Times, Times New Roman, serif',
|
|
31
31
|
// Careful using ligatures. Code editors like ACE will often error because of width calculations
|
|
32
32
|
featureSettings: "'calt' 1, 'kern' 1, 'liga' 1",
|
|
33
|
+
defaultUnits: 'rem',
|
|
33
34
|
baseline: computed(function (_ref) {
|
|
34
35
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
35
36
|
base = _ref2[0];
|
|
@@ -22,7 +22,7 @@ var _context = require("./context");
|
|
|
22
22
|
var _collapsible_nav_button = require("./collapsible_nav_button");
|
|
23
23
|
var _collapsible_nav_beta = require("./collapsible_nav_beta.styles");
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
|
-
var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "width", "side", "focusTrapProps"];
|
|
25
|
+
var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
|
|
26
26
|
/*
|
|
27
27
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
28
28
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -41,6 +41,7 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
41
41
|
style = _ref.style,
|
|
42
42
|
_ref$initialIsCollaps = _ref.initialIsCollapsed,
|
|
43
43
|
initialIsCollapsed = _ref$initialIsCollaps === void 0 ? false : _ref$initialIsCollaps,
|
|
44
|
+
onCollapseToggle = _ref.onCollapseToggle,
|
|
44
45
|
_ref$width = _ref.width,
|
|
45
46
|
_width = _ref$width === void 0 ? 248 : _ref$width,
|
|
46
47
|
_ref$side = _ref.side,
|
|
@@ -59,9 +60,10 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
59
60
|
setIsCollapsed = _useState2[1];
|
|
60
61
|
var toggleCollapsed = (0, _react.useCallback)(function () {
|
|
61
62
|
return setIsCollapsed(function (isCollapsed) {
|
|
63
|
+
onCollapseToggle === null || onCollapseToggle === void 0 ? void 0 : onCollapseToggle(!isCollapsed);
|
|
62
64
|
return !isCollapsed;
|
|
63
65
|
});
|
|
64
|
-
}, []);
|
|
66
|
+
}, [onCollapseToggle]);
|
|
65
67
|
var onClose = (0, _react.useCallback)(function () {
|
|
66
68
|
return setIsCollapsed(true);
|
|
67
69
|
}, []);
|
|
@@ -34,7 +34,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
34
34
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
35
35
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
36
36
|
* Side Public License, v 1.
|
|
37
|
-
*/
|
|
37
|
+
*/ /**
|
|
38
|
+
* @deprecated
|
|
39
|
+
*/
|
|
38
40
|
// Because of how the thumbs are rendered in the popover, using ref results in an infinite loop.
|
|
39
41
|
// We'll instead use old fashioned namespaced DOM selectors to get references
|
|
40
42
|
var STOP_ATTR = 'euiColorStop_';
|
|
@@ -89,6 +91,13 @@ function getRangeMax(colorStops, max) {
|
|
|
89
91
|
}
|
|
90
92
|
return DEFAULT_MAX;
|
|
91
93
|
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated - EuiColorStops is scheduled for deprecation due to low internal usage and high
|
|
97
|
+
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
98
|
+
*
|
|
99
|
+
* The component will be permanently removed in October 2023.
|
|
100
|
+
*/
|
|
92
101
|
var EuiColorStops = function EuiColorStops(_ref) {
|
|
93
102
|
var _ref$addColor = _ref.addColor,
|
|
94
103
|
addColor = _ref$addColor === void 0 ? _services.DEFAULT_VISUALIZATION_COLOR : _ref$addColor,
|
|
@@ -61,7 +61,16 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
61
61
|
*/ /**
|
|
62
62
|
* Icon can extend EuiButtonIcon
|
|
63
63
|
* Also omits `iconType` and `id` as these are also specific to icon control
|
|
64
|
-
*/
|
|
64
|
+
*/ /**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
|
|
69
|
+
* overlap with other existing EUI components. We recommend using EuiBottomBar instead,
|
|
70
|
+
* or copying this component into your own application for usage if necessary.
|
|
71
|
+
*
|
|
72
|
+
* The component will be permanently removed in December 2023.
|
|
73
|
+
*/
|
|
65
74
|
var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
66
75
|
(0, _inherits2.default)(EuiControlBar, _Component);
|
|
67
76
|
var _super = _createSuper(EuiControlBar);
|
|
@@ -64,9 +64,9 @@ var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts() {
|
|
|
64
64
|
}, (0, _react2.jsx)(_description_list.EuiDescriptionList, {
|
|
65
65
|
"aria-labelledby": titleId,
|
|
66
66
|
type: "column",
|
|
67
|
+
columnWidths: [1, 3],
|
|
67
68
|
align: "center",
|
|
68
69
|
compressed: true,
|
|
69
|
-
gutterSize: "s",
|
|
70
70
|
listItems: [{
|
|
71
71
|
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
72
72
|
token: "euiKeyboardShortcuts.upArrowTitle",
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.EuiDescriptionList = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _services = require("../../services");
|
|
15
|
+
var _description_list_context = require("./description_list_context");
|
|
12
16
|
var _description_list_title = require("./description_list_title");
|
|
13
17
|
var _description_list_description = require("./description_list_description");
|
|
14
|
-
var _services = require("../../services");
|
|
15
18
|
var _description_list = require("./description_list.styles");
|
|
16
|
-
var _description_list_context = require("./description_list_context");
|
|
17
19
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "
|
|
20
|
+
var _excluded = ["align", "children", "className", "style", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "rowGutterSize", "columnGutterSize", "columnWidths"];
|
|
19
21
|
/*
|
|
20
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
23
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -23,11 +25,16 @@ var _excluded = ["align", "children", "className", "compressed", "descriptionPro
|
|
|
23
25
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
26
|
* Side Public License, v 1.
|
|
25
27
|
*/
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
32
|
var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
27
33
|
var _ref$align = _ref.align,
|
|
28
34
|
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
29
35
|
children = _ref.children,
|
|
30
36
|
className = _ref.className,
|
|
37
|
+
style = _ref.style,
|
|
31
38
|
_ref$compressed = _ref.compressed,
|
|
32
39
|
compressed = _ref$compressed === void 0 ? false : _ref$compressed,
|
|
33
40
|
descriptionProps = _ref.descriptionProps,
|
|
@@ -36,13 +43,38 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
36
43
|
textStyle = _ref$textStyle === void 0 ? 'normal' : _ref$textStyle,
|
|
37
44
|
titleProps = _ref.titleProps,
|
|
38
45
|
_ref$type = _ref.type,
|
|
39
|
-
|
|
40
|
-
_ref$
|
|
41
|
-
|
|
46
|
+
_type = _ref$type === void 0 ? 'row' : _ref$type,
|
|
47
|
+
_ref$rowGutterSize = _ref.rowGutterSize,
|
|
48
|
+
rowGutterSize = _ref$rowGutterSize === void 0 ? 's' : _ref$rowGutterSize,
|
|
49
|
+
_ref$columnGutterSize = _ref.columnGutterSize,
|
|
50
|
+
columnGutterSize = _ref$columnGutterSize === void 0 ? 's' : _ref$columnGutterSize,
|
|
51
|
+
columnWidths = _ref.columnWidths,
|
|
42
52
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
|
+
var showResponsiveColumns = (0, _services.useIsWithinBreakpoints)(['xs', 's']);
|
|
54
|
+
var type = (0, _react.useMemo)(function () {
|
|
55
|
+
if (_type === 'responsiveColumn') {
|
|
56
|
+
return showResponsiveColumns ? 'row' : 'column';
|
|
57
|
+
} else {
|
|
58
|
+
return _type;
|
|
59
|
+
}
|
|
60
|
+
}, [_type, showResponsiveColumns]);
|
|
43
61
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
44
62
|
var styles = (0, _description_list.euiDescriptionListStyles)(euiTheme);
|
|
45
|
-
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align]];
|
|
63
|
+
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align], type === 'column' && styles.rowGap[rowGutterSize], type === 'column' && styles.columnGap[columnGutterSize]];
|
|
64
|
+
var inlineStyles = (0, _react.useMemo)(function () {
|
|
65
|
+
if (type === 'column' && columnWidths) {
|
|
66
|
+
// Leave string values as is - e.g. if a consumer passes in a specific '200px' or 'minmax()'
|
|
67
|
+
var convertNumbersToFr = function convertNumbersToFr(value) {
|
|
68
|
+
return typeof value === 'number' ? "".concat(value, "fr") : value;
|
|
69
|
+
};
|
|
70
|
+
var titleWidth = convertNumbersToFr(columnWidths[0]);
|
|
71
|
+
var descriptionWidth = convertNumbersToFr(columnWidths[1]);
|
|
72
|
+
return _objectSpread({
|
|
73
|
+
gridTemplateColumns: "".concat(titleWidth, " ").concat(descriptionWidth)
|
|
74
|
+
}, style);
|
|
75
|
+
}
|
|
76
|
+
return style;
|
|
77
|
+
}, [style, type, columnWidths]);
|
|
46
78
|
var classes = (0, _classnames.default)('euiDescriptionList', className);
|
|
47
79
|
var childrenOrListItems = null;
|
|
48
80
|
if (listItems) {
|
|
@@ -62,13 +94,14 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
62
94
|
compressed: compressed,
|
|
63
95
|
textStyle: textStyle,
|
|
64
96
|
align: align,
|
|
65
|
-
|
|
97
|
+
rowGutterSize: rowGutterSize
|
|
66
98
|
}
|
|
67
99
|
}, (0, _react2.jsx)("dl", (0, _extends2.default)({
|
|
68
100
|
className: classes,
|
|
69
|
-
css: cssStyles
|
|
101
|
+
css: cssStyles,
|
|
102
|
+
style: inlineStyles
|
|
70
103
|
}, rest, {
|
|
71
|
-
"data-type":
|
|
104
|
+
"data-type": _type
|
|
72
105
|
}), childrenOrListItems));
|
|
73
106
|
};
|
|
74
107
|
exports.EuiDescriptionList = EuiDescriptionList;
|