@elastic/eui 93.2.0 → 93.3.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 +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +9 -6
- package/es/components/breadcrumbs/breadcrumbs.js +4 -2
- package/es/components/button/button_display/_button_display.js +2 -3
- package/es/components/button/button_empty/button_empty.js +2 -3
- package/es/components/button/button_group/button_group.js +3 -5
- package/es/components/button/button_group/button_group.styles.js +10 -13
- package/es/components/button/button_icon/button_icon.js +4 -5
- package/es/components/button/button_icon/button_icon.styles.js +11 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/es/components/datagrid/body/data_grid_body.js +1 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/es/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/es/components/datagrid/data_grid.js +3 -1
- package/es/components/facet/facet_button.styles.js +1 -2
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/es/components/icon/icon.js +13 -16
- package/es/components/icon/icon.styles.js +6 -9
- package/es/components/link/external_link_icon.js +11 -8
- package/es/components/link/link.js +2 -3
- package/es/components/link/link.styles.js +4 -10
- package/es/components/page/page_header/page_header_content.js +4 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/skeleton/skeleton_circle.js +2 -3
- package/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/es/components/skeleton/skeleton_text.js +16 -12
- package/es/components/skeleton/skeleton_title.js +2 -3
- package/es/components/text/text.js +2 -3
- package/es/components/text/text_align.js +1 -2
- package/es/components/text/text_align.styles.js +5 -7
- package/es/components/text/text_color.js +2 -3
- package/es/components/title/title.js +2 -3
- package/es/components/title/title.styles.js +0 -7
- package/es/global_styling/mixins/_typography.js +17 -6
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +47 -14
- package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/eui.d.ts +46 -37
- package/i18ntokens.json +36 -36
- package/lib/components/breadcrumbs/breadcrumb.js +9 -6
- package/lib/components/breadcrumbs/breadcrumbs.js +4 -2
- package/lib/components/button/button_display/_button_display.js +1 -2
- package/lib/components/button/button_empty/button_empty.js +1 -2
- package/lib/components/button/button_group/button_group.js +2 -4
- package/lib/components/button/button_group/button_group.styles.js +10 -13
- package/lib/components/button/button_icon/button_icon.js +3 -4
- package/lib/components/button/button_icon/button_icon.styles.js +10 -2
- package/lib/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/lib/components/datagrid/body/data_grid_body.js +1 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/lib/components/datagrid/data_grid.js +3 -1
- package/lib/components/facet/facet_button.styles.js +1 -2
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/lib/components/icon/icon.js +12 -15
- package/lib/components/icon/icon.styles.js +5 -8
- package/lib/components/link/external_link_icon.js +10 -7
- package/lib/components/link/link.js +1 -2
- package/lib/components/link/link.styles.js +6 -14
- package/lib/components/page/page_header/page_header_content.js +4 -2
- package/lib/components/progress/progress.styles.js +1 -1
- package/lib/components/skeleton/skeleton_circle.js +1 -2
- package/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/lib/components/skeleton/skeleton_text.js +18 -11
- package/lib/components/skeleton/skeleton_title.js +1 -2
- package/lib/components/text/text.js +1 -2
- package/lib/components/text/text_align.js +1 -2
- package/lib/components/text/text_align.styles.js +5 -7
- package/lib/components/text/text_color.js +1 -2
- package/lib/components/title/title.js +1 -2
- package/lib/components/title/title.styles.js +2 -10
- package/lib/global_styling/mixins/_typography.js +27 -19
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +49 -16
- package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
- package/optimize/es/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/es/components/button/button_display/_button_display.js +2 -3
- package/optimize/es/components/button/button_empty/button_empty.js +2 -3
- package/optimize/es/components/button/button_group/button_group.js +3 -5
- package/optimize/es/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/es/components/button/button_icon/button_icon.js +4 -5
- package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/es/components/datagrid/data_grid.js +3 -1
- package/optimize/es/components/facet/facet_button.styles.js +1 -2
- package/optimize/es/components/icon/icon.js +13 -16
- package/optimize/es/components/icon/icon.styles.js +6 -9
- package/optimize/es/components/link/external_link_icon.js +11 -8
- package/optimize/es/components/link/link.js +2 -3
- package/optimize/es/components/link/link.styles.js +4 -10
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_text.js +16 -12
- package/optimize/es/components/skeleton/skeleton_title.js +2 -3
- package/optimize/es/components/text/text.js +2 -3
- package/optimize/es/components/text/text_align.js +1 -2
- package/optimize/es/components/text/text_align.styles.js +5 -7
- package/optimize/es/components/text/text_color.js +2 -3
- package/optimize/es/components/title/title.js +2 -3
- package/optimize/es/components/title/title.styles.js +0 -7
- package/optimize/es/global_styling/mixins/_typography.js +14 -6
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +47 -14
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/lib/components/button/button_display/_button_display.js +1 -2
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
- package/optimize/lib/components/button/button_group/button_group.js +2 -4
- package/optimize/lib/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
- package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/lib/components/datagrid/data_grid.js +3 -1
- package/optimize/lib/components/facet/facet_button.styles.js +1 -2
- package/optimize/lib/components/icon/icon.js +12 -15
- package/optimize/lib/components/icon/icon.styles.js +5 -8
- package/optimize/lib/components/link/external_link_icon.js +10 -7
- package/optimize/lib/components/link/link.js +1 -2
- package/optimize/lib/components/link/link.styles.js +6 -14
- package/optimize/lib/components/progress/progress.styles.js +1 -1
- package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
- package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
- package/optimize/lib/components/text/text.js +1 -2
- package/optimize/lib/components/text/text_align.js +1 -2
- package/optimize/lib/components/text/text_align.styles.js +5 -7
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/title/title.js +1 -2
- package/optimize/lib/components/title/title.styles.js +2 -10
- package/optimize/lib/global_styling/mixins/_typography.js +25 -19
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +49 -16
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/package.json +3 -3
- package/src/components/datagrid/_data_grid_data_row.scss +4 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +9 -6
- package/test-env/components/breadcrumbs/breadcrumbs.js +4 -2
- package/test-env/components/button/button_display/_button_display.js +1 -2
- package/test-env/components/button/button_empty/button_empty.js +1 -2
- package/test-env/components/button/button_group/button_group.js +2 -4
- package/test-env/components/button/button_group/button_group.styles.js +10 -13
- package/test-env/components/button/button_icon/button_icon.js +3 -4
- package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/test-env/components/datagrid/body/data_grid_body.js +1 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/test-env/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/test-env/components/datagrid/data_grid.js +3 -1
- package/test-env/components/facet/facet_button.styles.js +1 -2
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/test-env/components/icon/icon.styles.js +5 -8
- package/test-env/components/link/external_link_icon.js +10 -7
- package/test-env/components/link/link.js +1 -2
- package/test-env/components/link/link.styles.js +6 -14
- package/test-env/components/page/page_header/page_header_content.js +4 -2
- package/test-env/components/progress/progress.styles.js +1 -1
- package/test-env/components/skeleton/skeleton_circle.js +1 -2
- package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
- package/test-env/components/skeleton/skeleton_text.js +18 -11
- package/test-env/components/skeleton/skeleton_title.js +1 -2
- package/test-env/components/text/text.js +1 -2
- package/test-env/components/text/text_align.js +1 -2
- package/test-env/components/text/text_align.styles.js +5 -7
- package/test-env/components/text/text_color.js +1 -2
- package/test-env/components/title/title.js +1 -2
- package/test-env/components/title/title.styles.js +2 -10
- package/test-env/global_styling/mixins/_typography.js +25 -19
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +49 -16
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
|
@@ -107,11 +107,12 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
107
107
|
css: cssStyles
|
|
108
108
|
};
|
|
109
109
|
if (isPopoverBreadcrumb) {
|
|
110
|
+
var _closePopover = function _closePopover() {
|
|
111
|
+
return setIsPopoverOpen(false);
|
|
112
|
+
};
|
|
110
113
|
return ___EmotionJSX(EuiPopover, _extends({}, popoverProps, {
|
|
111
114
|
isOpen: isPopoverOpen,
|
|
112
|
-
closePopover:
|
|
113
|
-
return setIsPopoverOpen(false);
|
|
114
|
-
},
|
|
115
|
+
closePopover: _closePopover,
|
|
115
116
|
css: !isLastBreadcrumb && styles.euiBreadcrumb__popoverWrapper,
|
|
116
117
|
button: ___EmotionJSX(EuiLink, _extends({}, baseProps, {
|
|
117
118
|
color: linkColor,
|
|
@@ -128,7 +129,7 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
128
129
|
size: "s",
|
|
129
130
|
"aria-label": " - ".concat(popoverAriaLabel)
|
|
130
131
|
}))
|
|
131
|
-
}), popoverContent);
|
|
132
|
+
}), typeof popoverContent === 'function' ? popoverContent(_closePopover) : popoverContent);
|
|
132
133
|
} else if (isInteractiveBreadcrumb) {
|
|
133
134
|
return ___EmotionJSX(EuiLink, _extends({}, baseProps, styleProps, {
|
|
134
135
|
color: linkColor,
|
|
@@ -169,12 +170,14 @@ EuiBreadcrumbContent.propTypes = {
|
|
|
169
170
|
*/
|
|
170
171
|
"aria-current": PropTypes.any,
|
|
171
172
|
/**
|
|
172
|
-
* Creates a breadcrumb that toggles a popover dialog
|
|
173
|
+
* Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
|
|
174
|
+
* or a render function that will pass callback allowing you to close the
|
|
175
|
+
* breadcrumb popover from within your popover content.
|
|
173
176
|
*
|
|
174
177
|
* If passed, both `href` and `onClick` will be ignored - the breadcrumb's
|
|
175
178
|
* click behavior should only trigger a popover.
|
|
176
179
|
*/
|
|
177
|
-
popoverContent: PropTypes.node,
|
|
180
|
+
popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
|
|
178
181
|
/**
|
|
179
182
|
* Allows customizing the popover if necessary. Accepts any props that
|
|
180
183
|
* [EuiPopover](/#/layout/popover) accepts, except for props that control state.
|
|
@@ -140,12 +140,14 @@ EuiBreadcrumbs.propTypes = {
|
|
|
140
140
|
*/
|
|
141
141
|
"aria-current": PropTypes.any,
|
|
142
142
|
/**
|
|
143
|
-
* Creates a breadcrumb that toggles a popover dialog
|
|
143
|
+
* Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
|
|
144
|
+
* or a render function that will pass callback allowing you to close the
|
|
145
|
+
* breadcrumb popover from within your popover content.
|
|
144
146
|
*
|
|
145
147
|
* If passed, both `href` and `onClick` will be ignored - the breadcrumb's
|
|
146
148
|
* click behavior should only trigger a popover.
|
|
147
149
|
*/
|
|
148
|
-
popoverContent: PropTypes.node,
|
|
150
|
+
popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
|
|
149
151
|
/**
|
|
150
152
|
* Allows customizing the popover if necessary. Accepts any props that
|
|
151
153
|
* [EuiPopover](/#/layout/popover) accepts, except for props that control state.
|
|
@@ -21,7 +21,7 @@ import React, { forwardRef } from 'react';
|
|
|
21
21
|
// @ts-ignore module doesn't export `createElement`
|
|
22
22
|
import PropTypes from "prop-types";
|
|
23
23
|
import { createElement } from '@emotion/react';
|
|
24
|
-
import { getSecureRelForTarget,
|
|
24
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
25
25
|
import { euiButtonDisplayStyles } from './_button_display.styles';
|
|
26
26
|
import { EuiButtonDisplayContent } from './_button_display_content';
|
|
27
27
|
import { validateHref } from '../../../services/security/href_validator';
|
|
@@ -75,8 +75,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
75
75
|
isDisabled: isDisabled || disabled,
|
|
76
76
|
isLoading: isLoading
|
|
77
77
|
});
|
|
78
|
-
var
|
|
79
|
-
var styles = euiButtonDisplayStyles(theme);
|
|
78
|
+
var styles = useEuiMemoizedStyles(euiButtonDisplayStyles);
|
|
80
79
|
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
|
|
81
80
|
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
82
81
|
isLoading: isLoading,
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import {
|
|
22
|
+
import { useEuiMemoizedStyles, getSecureRelForTarget } from '../../../services';
|
|
23
23
|
import { EuiButtonDisplayContent } from '../button_display/_button_display_content';
|
|
24
24
|
import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
25
25
|
import { isButtonDisabled } from '../button_display/_button_display';
|
|
@@ -67,8 +67,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
67
67
|
var buttonColorStyles = useEuiButtonColorCSS({
|
|
68
68
|
display: 'empty'
|
|
69
69
|
});
|
|
70
|
-
var
|
|
71
|
-
var styles = euiButtonEmptyStyles(euiTheme);
|
|
70
|
+
var styles = useEuiMemoizedStyles(euiButtonEmptyStyles);
|
|
72
71
|
var cssStyles = [styles.euiButtonEmpty, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], flush && styles.flush, flush && styles[flush], isDisabled && styles.isDisabled];
|
|
73
72
|
var classes = classNames('euiButtonEmpty', className);
|
|
74
73
|
var contentClassNames = classNames('euiButtonEmpty__content', contentProps === null || contentProps === void 0 ? void 0 : contentProps.className);
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
17
17
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
18
18
|
import { EuiButtonGroupButton } from './button_group_button';
|
|
19
19
|
import { euiButtonGroupStyles, euiButtonGroupButtonsStyles } from './button_group.styles';
|
|
@@ -42,10 +42,8 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
42
42
|
_ref$type = _ref.type,
|
|
43
43
|
type = _ref$type === void 0 ? 'single' : _ref$type,
|
|
44
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var wrapperCssStyles = [wrapperStyles.euiButtonGroup, isFullWidth && wrapperStyles.fullWidth];
|
|
48
|
-
var styles = euiButtonGroupButtonsStyles(euiTheme);
|
|
45
|
+
var wrapperCssStyles = [euiButtonGroupStyles.euiButtonGroup, isFullWidth && euiButtonGroupStyles.fullWidth];
|
|
46
|
+
var styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
|
|
49
47
|
var cssStyles = [styles.euiButtonGroup__buttons, isFullWidth && styles.fullWidth, styles[buttonSize]];
|
|
50
48
|
var classes = classNames('euiButtonGroup', {
|
|
51
49
|
'euiButtonGroup-isDisabled': isDisabled
|
|
@@ -10,19 +10,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalCSS } from '../../../global_styling';
|
|
12
12
|
import { euiFormVariables } from '../../form/form.styles';
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
24
|
-
fullWidth: _ref
|
|
25
|
-
};
|
|
13
|
+
export var euiButtonGroupStyles = {
|
|
14
|
+
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
15
|
+
fullWidth: process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "jl0hie-fullWidth",
|
|
17
|
+
styles: "display:block;label:fullWidth;"
|
|
18
|
+
} : {
|
|
19
|
+
name: "jl0hie-fullWidth",
|
|
20
|
+
styles: "display:block;label:fullWidth;",
|
|
21
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
|
+
}
|
|
26
23
|
};
|
|
27
24
|
export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(euiThemeContext) {
|
|
28
25
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import { getSecureRelForTarget,
|
|
16
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
17
17
|
import { EuiIcon } from '../../icon';
|
|
18
18
|
import { EuiLoadingSpinner } from '../../loading';
|
|
19
19
|
import { useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
@@ -44,7 +44,6 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
44
44
|
isSelected = _ref.isSelected,
|
|
45
45
|
isLoading = _ref.isLoading,
|
|
46
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
|
-
var euiThemeContext = useEuiTheme();
|
|
48
47
|
var isDisabled = isButtonDisabled({
|
|
49
48
|
isDisabled: _isDisabled || disabled,
|
|
50
49
|
href: href,
|
|
@@ -59,9 +58,9 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
59
58
|
display: display
|
|
60
59
|
});
|
|
61
60
|
var buttonFocusStyle = useEuiButtonFocusCSS();
|
|
62
|
-
var emptyHoverStyles =
|
|
63
|
-
var styles = euiButtonIconStyles
|
|
64
|
-
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, emptyHoverStyles, isDisabled && styles.isDisabled];
|
|
61
|
+
var emptyHoverStyles = useEuiMemoizedStyles(_emptyHoverStyles);
|
|
62
|
+
var styles = useEuiMemoizedStyles(euiButtonIconStyles);
|
|
63
|
+
var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
|
|
65
64
|
var classes = classNames('euiButtonIcon', className);
|
|
66
65
|
|
|
67
66
|
// Add an icon to the button if one exists.
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
7
|
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)."; }
|
|
2
8
|
/*
|
|
3
9
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -9,7 +15,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
15
|
|
|
10
16
|
import { css } from '@emotion/react';
|
|
11
17
|
import { logicalSizeCSS } from '../../../global_styling';
|
|
12
|
-
import { euiButtonEmptyColor, euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
18
|
+
import { BUTTON_COLORS, euiButtonEmptyColor, euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
13
19
|
import { euiButtonBaseCSS } from '../button_display/_button_display.styles';
|
|
14
20
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
21
|
name: "8595p9-isDisabled",
|
|
@@ -30,6 +36,8 @@ export var euiButtonIconStyles = function euiButtonIconStyles(euiThemeContext) {
|
|
|
30
36
|
m: /*#__PURE__*/css(logicalSizeCSS(sizes.m.height), " border-radius:", sizes.m.radius, ";;label:m;")
|
|
31
37
|
};
|
|
32
38
|
};
|
|
33
|
-
export var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext
|
|
34
|
-
return
|
|
39
|
+
export var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext) {
|
|
40
|
+
return BUTTON_COLORS.reduce(function (styles, color) {
|
|
41
|
+
return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, color, /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";}")));
|
|
42
|
+
}, {});
|
|
35
43
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
|
|
2
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
|
|
3
3
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
4
4
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
|
|
5
5
|
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; }
|
|
@@ -45,6 +45,7 @@ import { HandleInteractiveChildren } from './focus_utils';
|
|
|
45
45
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
46
46
|
var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
47
47
|
var renderCellValue = _ref.renderCellValue,
|
|
48
|
+
cellContext = _ref.cellContext,
|
|
48
49
|
column = _ref.column,
|
|
49
50
|
setCellContentsRef = _ref.setCellContentsRef,
|
|
50
51
|
rowIndex = _ref.rowIndex,
|
|
@@ -73,7 +74,7 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
73
74
|
rowIndex: rowIndex,
|
|
74
75
|
colIndex: colIndex,
|
|
75
76
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
76
|
-
}, rest)));
|
|
77
|
+
}, cellContext, rest)));
|
|
77
78
|
if (cellHeightType === 'lineCount' && !isControlColumn) {
|
|
78
79
|
var lines = rowHeightUtils.getLineCount(rowHeight);
|
|
79
80
|
cellContent = ___EmotionJSX(EuiTextBlockTruncate, {
|
|
@@ -529,6 +530,7 @@ EuiDataGridCellContent.propTypes = {
|
|
|
529
530
|
isExpandable: PropTypes.bool.isRequired,
|
|
530
531
|
className: PropTypes.string,
|
|
531
532
|
renderCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
533
|
+
cellContext: PropTypes.any,
|
|
532
534
|
renderCellPopover: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
533
535
|
setRowHeight: PropTypes.func,
|
|
534
536
|
getRowHeight: PropTypes.func,
|
|
@@ -738,6 +740,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
738
740
|
var _this$props5 = _this.props,
|
|
739
741
|
renderCellPopover = _this$props5.renderCellPopover,
|
|
740
742
|
renderCellValue = _this$props5.renderCellValue,
|
|
743
|
+
cellContext = _this$props5.cellContext,
|
|
741
744
|
rowIndex = _this$props5.rowIndex,
|
|
742
745
|
colIndex = _this$props5.colIndex,
|
|
743
746
|
column = _this$props5.column,
|
|
@@ -758,7 +761,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
758
761
|
})),
|
|
759
762
|
DefaultCellPopover: DefaultCellPopover,
|
|
760
763
|
setCellPopoverProps: setCellPopoverProps
|
|
761
|
-
}), ___EmotionJSX(CellElement, _extends({}, sharedProps, {
|
|
764
|
+
}), ___EmotionJSX(CellElement, _extends({}, cellContext, sharedProps, {
|
|
762
765
|
setCellProps: _this.setCellProps,
|
|
763
766
|
isExpandable: true,
|
|
764
767
|
isExpanded: true,
|
|
@@ -1376,6 +1379,7 @@ EuiDataGridCell.propTypes = {
|
|
|
1376
1379
|
setCellPopoverProps: PropTypes.func.isRequired
|
|
1377
1380
|
}).isRequired,
|
|
1378
1381
|
renderCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
1382
|
+
cellContext: PropTypes.any,
|
|
1379
1383
|
renderCellPopover: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
1380
1384
|
setRowHeight: PropTypes.func,
|
|
1381
1385
|
getRowHeight: PropTypes.func,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
|
|
2
|
+
var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "cellContext", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
@@ -39,6 +39,7 @@ export var Cell = function Cell(_ref) {
|
|
|
39
39
|
columnWidths = _ref.columnWidths,
|
|
40
40
|
defaultColumnWidth = _ref.defaultColumnWidth,
|
|
41
41
|
renderCellValue = _ref.renderCellValue,
|
|
42
|
+
cellContext = _ref.cellContext,
|
|
42
43
|
renderCellPopover = _ref.renderCellPopover,
|
|
43
44
|
interactiveCellId = _ref.interactiveCellId,
|
|
44
45
|
setRowHeight = _ref.setRowHeight,
|
|
@@ -80,7 +81,8 @@ export var Cell = function Cell(_ref) {
|
|
|
80
81
|
setRowHeight: isFirstColumn ? setRowHeight : undefined,
|
|
81
82
|
rowManager: rowManager,
|
|
82
83
|
popoverContext: popoverContext,
|
|
83
|
-
pagination: pagination
|
|
84
|
+
pagination: pagination,
|
|
85
|
+
cellContext: cellContext
|
|
84
86
|
};
|
|
85
87
|
if (isLeadingControlColumn) {
|
|
86
88
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
@@ -562,6 +562,7 @@ EuiDataGridBody.propTypes = {
|
|
|
562
562
|
visibleRowCount: PropTypes.number.isRequired
|
|
563
563
|
}).isRequired,
|
|
564
564
|
renderCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
565
|
+
cellContext: PropTypes.any,
|
|
565
566
|
renderCellPopover: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
566
567
|
renderFooterCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]),
|
|
567
568
|
renderCustomGridBody: PropTypes.func,
|
|
@@ -45,6 +45,7 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
45
45
|
schemaDetectors = _ref.schemaDetectors,
|
|
46
46
|
visibleRows = _ref.visibleRows,
|
|
47
47
|
renderCellValue = _ref.renderCellValue,
|
|
48
|
+
cellContext = _ref.cellContext,
|
|
48
49
|
renderCellPopover = _ref.renderCellPopover,
|
|
49
50
|
renderFooterCellValue = _ref.renderFooterCellValue,
|
|
50
51
|
interactiveCellId = _ref.interactiveCellId,
|
|
@@ -134,6 +135,7 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
134
135
|
columnWidths: columnWidths,
|
|
135
136
|
defaultColumnWidth: defaultColumnWidth,
|
|
136
137
|
renderCellValue: renderCellValue,
|
|
138
|
+
cellContext: cellContext,
|
|
137
139
|
renderCellPopover: renderCellPopover,
|
|
138
140
|
interactiveCellId: interactiveCellId,
|
|
139
141
|
setRowHeight: setRowHeight,
|
|
@@ -705,6 +707,7 @@ EuiDataGridBodyCustomRender.propTypes = {
|
|
|
705
707
|
visibleRowCount: PropTypes.number.isRequired
|
|
706
708
|
}).isRequired,
|
|
707
709
|
renderCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
710
|
+
cellContext: PropTypes.any,
|
|
708
711
|
renderCellPopover: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
709
712
|
renderFooterCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]),
|
|
710
713
|
renderCustomGridBody: PropTypes.func,
|
|
@@ -88,6 +88,7 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
88
88
|
endRow = _ref3$visibleRows.endRow,
|
|
89
89
|
visibleRowCount = _ref3$visibleRows.visibleRowCount,
|
|
90
90
|
renderCellValue = _ref3.renderCellValue,
|
|
91
|
+
cellContext = _ref3.cellContext,
|
|
91
92
|
renderCellPopover = _ref3.renderCellPopover,
|
|
92
93
|
renderFooterCellValue = _ref3.renderFooterCellValue,
|
|
93
94
|
interactiveCellId = _ref3.interactiveCellId,
|
|
@@ -289,6 +290,7 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
289
290
|
columnWidths: columnWidths,
|
|
290
291
|
defaultColumnWidth: defaultColumnWidth,
|
|
291
292
|
renderCellValue: renderCellValue,
|
|
293
|
+
cellContext: cellContext,
|
|
292
294
|
renderCellPopover: renderCellPopover,
|
|
293
295
|
interactiveCellId: interactiveCellId,
|
|
294
296
|
rowHeightsOptions: rowHeightsOptions,
|
|
@@ -834,6 +836,7 @@ EuiDataGridBodyVirtualized.propTypes = {
|
|
|
834
836
|
visibleRowCount: PropTypes.number.isRequired
|
|
835
837
|
}).isRequired,
|
|
836
838
|
renderCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
839
|
+
cellContext: PropTypes.any,
|
|
837
840
|
renderCellPopover: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.func.isRequired]),
|
|
838
841
|
renderFooterCellValue: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]),
|
|
839
842
|
renderCustomGridBody: PropTypes.func,
|
|
@@ -83,7 +83,7 @@ export var useRowManager = function useRowManager(_ref) {
|
|
|
83
83
|
if (rowClasses) {
|
|
84
84
|
rowIdToElements.current.forEach(function (rowElement, rowIndex) {
|
|
85
85
|
var euiClasses = Array.from(rowElement.classList).filter(function (className) {
|
|
86
|
-
return
|
|
86
|
+
return ['euiDataGridRow', 'euiDataGridRow--striped'].includes(className);
|
|
87
87
|
}).join(' ');
|
|
88
88
|
if (rowClasses[rowIndex]) {
|
|
89
89
|
rowElement.classList.value = "".concat(euiClasses, " ").concat(rowClasses[rowIndex]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"],
|
|
2
|
+
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "cellContext", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"],
|
|
3
3
|
_excluded2 = ["focusProps"];
|
|
4
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -88,6 +88,7 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
|
|
|
88
88
|
schemaDetectors = props.schemaDetectors,
|
|
89
89
|
rowCount = props.rowCount,
|
|
90
90
|
renderCellValue = props.renderCellValue,
|
|
91
|
+
cellContext = props.cellContext,
|
|
91
92
|
renderCellPopover = props.renderCellPopover,
|
|
92
93
|
renderFooterCellValue = props.renderFooterCellValue,
|
|
93
94
|
className = props.className,
|
|
@@ -357,6 +358,7 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
|
|
|
357
358
|
schemaDetectors: allSchemaDetectors,
|
|
358
359
|
pagination: pagination,
|
|
359
360
|
renderCellValue: renderCellValue,
|
|
361
|
+
cellContext: cellContext,
|
|
360
362
|
renderCellPopover: renderCellPopover,
|
|
361
363
|
renderFooterCellValue: renderFooterCellValue,
|
|
362
364
|
rowCount: rowCount,
|
|
@@ -9,12 +9,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { euiTextTruncate, euiTextShift, logicalTextAlignCSS } from '../../global_styling';
|
|
12
|
-
import { euiLinkFocusCSS } from '../link/link.styles';
|
|
13
12
|
export var euiFacetButtonStyles = function euiFacetButtonStyles(_ref3) {
|
|
14
13
|
var euiTheme = _ref3.euiTheme;
|
|
15
14
|
return {
|
|
16
15
|
// Base
|
|
17
|
-
euiFacetButton: /*#__PURE__*/css(logicalTextAlignCSS('left'), " &:hover,&:focus{
|
|
16
|
+
euiFacetButton: /*#__PURE__*/css(logicalTextAlignCSS('left'), " &:not(:disabled){&:hover,&:focus{text-decoration:none;.euiFacetButton__text{text-decoration:underline;}}&:focus .euiFacetButton__text{text-decoration-thickness:", euiTheme.border.width.thick, ";}}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;};label:euiFacetButton;")
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
export var euiFacetButtonTextStyles = function euiFacetButtonTextStyles(_ref4) {
|
|
@@ -88,12 +88,14 @@ EuiHeaderBreadcrumbs.propTypes = {
|
|
|
88
88
|
*/
|
|
89
89
|
"aria-current": PropTypes.any,
|
|
90
90
|
/**
|
|
91
|
-
* Creates a breadcrumb that toggles a popover dialog
|
|
91
|
+
* Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
|
|
92
|
+
* or a render function that will pass callback allowing you to close the
|
|
93
|
+
* breadcrumb popover from within your popover content.
|
|
92
94
|
*
|
|
93
95
|
* If passed, both `href` and `onClick` will be ignored - the breadcrumb's
|
|
94
96
|
* click behavior should only trigger a popover.
|
|
95
97
|
*/
|
|
96
|
-
popoverContent: PropTypes.node,
|
|
98
|
+
popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
|
|
97
99
|
/**
|
|
98
100
|
* Allows customizing the popover if necessary. Accepts any props that
|
|
99
101
|
* [EuiPopover](/#/layout/popover) accepts, except for props that control state.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "
|
|
1
|
+
var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "style", "stylesMemoizer"];
|
|
2
2
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
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; }
|
|
@@ -33,7 +33,7 @@ import { keysOf } from '../common';
|
|
|
33
33
|
import { typeToPathMap } from './icon_map';
|
|
34
34
|
import { icon as empty } from './assets/empty';
|
|
35
35
|
import { enqueueStateChange } from '../../services/react';
|
|
36
|
-
import { htmlIdGenerator,
|
|
36
|
+
import { htmlIdGenerator, withEuiStylesMemoizer } from '../../services';
|
|
37
37
|
export { COLORS } from './named_colors';
|
|
38
38
|
import { isNamedColor } from './named_colors';
|
|
39
39
|
import { euiIconStyles } from './icon.styles';
|
|
@@ -185,8 +185,8 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
|
|
|
185
185
|
tabIndex = _this$props.tabIndex,
|
|
186
186
|
title = _this$props.title,
|
|
187
187
|
onIconLoad = _this$props.onIconLoad,
|
|
188
|
-
theme = _this$props.theme,
|
|
189
188
|
style = _this$props.style,
|
|
189
|
+
stylesMemoizer = _this$props.stylesMemoizer,
|
|
190
190
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
191
191
|
var _this$state = this.state,
|
|
192
192
|
isLoading = _this$state.isLoading,
|
|
@@ -208,7 +208,7 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
|
|
|
208
208
|
var classes = classNames('euiIcon', className);
|
|
209
209
|
|
|
210
210
|
// Emotion styles
|
|
211
|
-
var styles = euiIconStyles
|
|
211
|
+
var styles = stylesMemoizer(euiIconStyles);
|
|
212
212
|
var cssStyles = [styles.euiIcon, styles[size], color && isNamedColor(color) && styles[color], isCustomColor && styles.customColor, isElasticLogoOutline && styles.logoElasticOutline, isAppIcon && !appIconHasColor && styles.app, isLoading && styles.isLoading, !isLoading && neededLoading && styles.isLoaded];
|
|
213
213
|
var icon = this.state.icon || empty;
|
|
214
214
|
if (typeof icon === 'string') {
|
|
@@ -225,30 +225,27 @@ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
|
|
|
225
225
|
|
|
226
226
|
// If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true
|
|
227
227
|
var isAriaHidden = icon === empty || !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
|
|
228
|
-
var hideIconEmpty = isAriaHidden && {
|
|
229
|
-
'aria-hidden': true
|
|
230
|
-
};
|
|
231
|
-
var titleId;
|
|
232
228
|
|
|
233
229
|
// If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated
|
|
234
230
|
// The svg aria-labelledby attribute gets this titleId
|
|
235
231
|
// The svg title element gets this titleId as an id
|
|
236
|
-
|
|
237
|
-
titleId
|
|
238
|
-
|
|
239
|
-
};
|
|
240
|
-
}
|
|
232
|
+
var titleId = !this.props['aria-label'] && !this.props['aria-labelledby'] && title ? {
|
|
233
|
+
titleId: generateId()
|
|
234
|
+
} : undefined;
|
|
241
235
|
return ___EmotionJSX(Svg, _extends({
|
|
242
236
|
className: classes,
|
|
243
237
|
style: optionalCustomStyles,
|
|
244
238
|
css: cssStyles,
|
|
245
239
|
tabIndex: tabIndex,
|
|
246
240
|
role: "img",
|
|
247
|
-
title: title
|
|
241
|
+
title: title
|
|
242
|
+
}, titleId, {
|
|
248
243
|
"data-icon-type": iconTitle,
|
|
249
244
|
"data-is-loaded": isLoaded || undefined,
|
|
250
245
|
"data-is-loading": isLoading || undefined
|
|
251
|
-
},
|
|
246
|
+
}, rest, {
|
|
247
|
+
"aria-hidden": isAriaHidden || undefined
|
|
248
|
+
}));
|
|
252
249
|
}
|
|
253
250
|
}
|
|
254
251
|
}]);
|
|
@@ -289,4 +286,4 @@ EuiIconClass.propTypes = {
|
|
|
289
286
|
*/
|
|
290
287
|
onIconLoad: PropTypes.func
|
|
291
288
|
};
|
|
292
|
-
export var EuiIcon =
|
|
289
|
+
export var EuiIcon = withEuiStylesMemoizer(EuiIconClass);
|
|
@@ -10,10 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { css, keyframes } from '@emotion/react';
|
|
13
|
-
import {
|
|
14
|
-
var iconSize = function iconSize(size) {
|
|
15
|
-
return "\n ".concat(logicalCSS('width', size), ";\n ").concat(logicalCSS('height', size), ";\n ");
|
|
16
|
-
};
|
|
13
|
+
import { logicalSizeCSS, euiCanAnimate } from '../../global_styling';
|
|
17
14
|
export var iconLoadingOpacity = 0.05;
|
|
18
15
|
var iconLoading = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: ", ";\n }\n\n 100% {\n opacity: 1;\n }\n"])), iconLoadingOpacity);
|
|
19
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -52,11 +49,11 @@ export var euiIconStyles = function euiIconStyles(_ref3) {
|
|
|
52
49
|
logoElasticOutline: _ref,
|
|
53
50
|
// Sizes
|
|
54
51
|
original: /*#__PURE__*/css(";label:original;"),
|
|
55
|
-
s: /*#__PURE__*/css(
|
|
56
|
-
m: /*#__PURE__*/css(
|
|
57
|
-
l: /*#__PURE__*/css(
|
|
58
|
-
xl: /*#__PURE__*/css(
|
|
59
|
-
xxl: /*#__PURE__*/css(
|
|
52
|
+
s: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size.m), ";label:s;"),
|
|
53
|
+
m: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size.base), ";label:m;"),
|
|
54
|
+
l: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size.l), ";label:l;"),
|
|
55
|
+
xl: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size.xl), ";label:xl;"),
|
|
56
|
+
xxl: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size.xxl), ";label:xxl;"),
|
|
60
57
|
// Variants
|
|
61
58
|
// App icons are two-toned. This provides the base color.
|
|
62
59
|
app: /*#__PURE__*/css("fill:", euiTheme.colors.text, ";.euiIcon__fillSecondary{fill:", euiTheme.colors.successText, ";};label:app;"),
|
|
@@ -12,7 +12,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
|
-
import {
|
|
15
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
16
16
|
import { logicalStyle } from '../../global_styling';
|
|
17
17
|
import { EuiIcon } from '../icon';
|
|
18
18
|
import { EuiI18n, useEuiI18n } from '../i18n';
|
|
@@ -23,16 +23,19 @@ import { EuiScreenReaderOnly } from '../accessibility';
|
|
|
23
23
|
* screen readers. Used internally by at EuiLink and EuiListGroupItem
|
|
24
24
|
*/
|
|
25
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
var iconStyle = function iconStyle(_ref) {
|
|
27
|
+
var euiTheme = _ref.euiTheme;
|
|
28
|
+
return logicalStyle('margin-left', euiTheme.size.xs);
|
|
29
|
+
};
|
|
30
|
+
export var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
|
|
31
|
+
var target = _ref2.target,
|
|
32
|
+
external = _ref2.external,
|
|
33
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
34
|
+
var iconCssStyle = useEuiMemoizedStyles(iconStyle);
|
|
32
35
|
var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
|
|
33
36
|
var iconAriaLabel = useEuiI18n('euiExternalLinkIcon.ariaLabel', 'External link');
|
|
34
37
|
return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(EuiIcon, _extends({
|
|
35
|
-
css:
|
|
38
|
+
css: iconCssStyle,
|
|
36
39
|
"aria-label": iconAriaLabel,
|
|
37
40
|
size: "s",
|
|
38
41
|
type: "popout"
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
import React, { forwardRef } from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { getSecureRelForTarget,
|
|
22
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../services';
|
|
23
23
|
import { validateHref } from '../../services/security/href_validator';
|
|
24
24
|
import { EuiExternalLinkIcon } from './external_link_icon';
|
|
25
25
|
import { euiLinkStyles } from './link.styles';
|
|
@@ -39,8 +39,7 @@ var EuiLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
39
39
|
onClick = _ref.onClick,
|
|
40
40
|
_disabled = _ref.disabled,
|
|
41
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
-
var
|
|
43
|
-
var styles = euiLinkStyles(euiTheme);
|
|
42
|
+
var styles = useEuiMemoizedStyles(euiLinkStyles);
|
|
44
43
|
var cssStyles = [styles.euiLink];
|
|
45
44
|
var isHrefValid = !href || validateHref(href);
|
|
46
45
|
var disabled = _disabled || !isHrefValid;
|
|
@@ -9,18 +9,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { euiFocusRing, logicalTextAlignCSS } from '../../global_styling';
|
|
12
|
-
var _colorCSS = function _colorCSS(color) {
|
|
13
|
-
return "\n color: ".concat(color, ";\n\n &:target {\n color: darken(").concat(color, ", 10%);\n }\n ");
|
|
14
|
-
};
|
|
15
|
-
export var euiLinkHoverCSS = function euiLinkHoverCSS() {
|
|
16
|
-
return "\n text-decoration: underline;\n ";
|
|
17
|
-
};
|
|
18
|
-
export var euiLinkFocusCSS = function euiLinkFocusCSS(euiTheme) {
|
|
19
|
-
return "\n text-decoration: underline;\n text-decoration-thickness: ".concat(euiTheme.border.width.thick, ";\n ");
|
|
20
|
-
};
|
|
21
12
|
export var euiLinkCSS = function euiLinkCSS(euiThemeContext) {
|
|
22
13
|
var euiTheme = euiThemeContext.euiTheme;
|
|
23
|
-
return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n ").concat(logicalTextAlignCSS('left'), "\n\n &:hover {\n
|
|
14
|
+
return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n ").concat(logicalTextAlignCSS('left'), "\n\n &:hover {\n text-decoration: underline;\n }\n\n &:focus {\n ").concat(euiFocusRing(euiThemeContext, 'outset'), "\n text-decoration: underline;\n text-decoration-thickness: ").concat(euiTheme.border.width.thick, ";\n }\n ");
|
|
24
15
|
};
|
|
25
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
26
17
|
name: "9njbi5-disabled",
|
|
@@ -45,4 +36,7 @@ export var euiLinkStyles = function euiLinkStyles(euiThemeContext) {
|
|
|
45
36
|
ghost: /*#__PURE__*/css(_colorCSS(euiTheme.colors.ghost), ";label:ghost;"),
|
|
46
37
|
text: /*#__PURE__*/css(_colorCSS(euiTheme.colors.text), ";label:text;")
|
|
47
38
|
};
|
|
39
|
+
};
|
|
40
|
+
var _colorCSS = function _colorCSS(color) {
|
|
41
|
+
return "\n color: ".concat(color, ";\n\n &:target {\n color: darken(").concat(color, ", 10%);\n }\n ");
|
|
48
42
|
};
|