@elastic/eui 67.1.6 → 67.1.8
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 +0 -7
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -7
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +4 -4
- package/es/components/basic_table/in_memory_table.js +16 -2
- package/es/components/breadcrumbs/breadcrumb.js +9 -5
- package/es/components/breadcrumbs/breadcrumbs.js +7 -4
- package/es/components/card/card.js +6 -28
- package/es/components/card/checkable_card/checkable_card.js +3 -2
- package/es/components/datagrid/controls/column_selector.js +1 -1
- package/es/components/datagrid/controls/column_sorting.js +1 -1
- package/es/components/header/header_links/header_links.js +6 -0
- package/es/components/modal/modal.js +17 -2
- package/es/components/page_template/page_template.js +6 -9
- package/es/components/popover/popover.js +13 -3
- package/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/es/components/popover/popover_panel/_popover_panel.js +8 -2
- package/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/es/components/search_bar/query/ast.js +14 -3
- package/es/components/search_bar/search_bar.js +39 -5
- package/es/components/search_bar/search_box.js +37 -4
- package/es/components/tour/tour.styles.js +4 -3
- package/es/components/tour/tour_step.js +13 -5
- package/eui.d.ts +43 -8
- package/i18ntokens.json +12 -12
- package/lib/components/badge/beta_badge/beta_badge.js +4 -8
- package/lib/components/basic_table/in_memory_table.js +16 -2
- package/lib/components/breadcrumbs/breadcrumb.js +9 -5
- package/lib/components/breadcrumbs/breadcrumbs.js +7 -4
- package/lib/components/card/card.js +7 -30
- package/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/lib/components/datagrid/controls/column_selector.js +1 -1
- package/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/lib/components/header/header_links/header_links.js +6 -0
- package/lib/components/modal/modal.js +23 -2
- package/lib/components/page_template/page_template.js +6 -9
- package/lib/components/popover/popover.js +13 -3
- package/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/lib/components/popover/popover_panel/_popover_panel.js +8 -2
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/lib/components/search_bar/query/ast.js +14 -3
- package/lib/components/search_bar/search_bar.js +40 -5
- package/lib/components/search_bar/search_box.js +38 -4
- package/lib/components/tour/tour.styles.js +3 -2
- package/lib/components/tour/tour_step.js +7 -5
- package/optimize/es/components/badge/beta_badge/beta_badge.js +4 -4
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/breadcrumbs/breadcrumb.js +3 -2
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +7 -4
- package/optimize/es/components/card/card.js +5 -27
- package/optimize/es/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/es/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/es/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/es/components/modal/modal.js +17 -2
- package/optimize/es/components/page_template/page_template.js +6 -9
- package/optimize/es/components/popover/popover.js +7 -3
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/optimize/es/components/search_bar/query/ast.js +14 -3
- package/optimize/es/components/search_bar/search_bar.js +31 -5
- package/optimize/es/components/search_bar/search_box.js +29 -3
- package/optimize/es/components/tour/tour.styles.js +4 -3
- package/optimize/es/components/tour/tour_step.js +7 -5
- package/optimize/lib/components/badge/beta_badge/beta_badge.js +4 -11
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +3 -2
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +7 -4
- package/optimize/lib/components/card/card.js +6 -29
- package/optimize/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/lib/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/lib/components/modal/modal.js +22 -2
- package/optimize/lib/components/page_template/page_template.js +6 -9
- package/optimize/lib/components/popover/popover.js +7 -3
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/optimize/lib/components/search_bar/query/ast.js +14 -3
- package/optimize/lib/components/search_bar/search_bar.js +31 -5
- package/optimize/lib/components/search_bar/search_box.js +30 -3
- package/optimize/lib/components/tour/tour.styles.js +3 -2
- package/optimize/lib/components/tour/tour_step.js +7 -5
- package/package.json +1 -1
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -8
- package/src/components/modal/_modal.scss +3 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +4 -11
- package/test-env/components/basic_table/in_memory_table.js +16 -2
- package/test-env/components/breadcrumbs/breadcrumb.js +9 -5
- package/test-env/components/breadcrumbs/breadcrumbs.js +7 -4
- package/test-env/components/card/card.js +7 -30
- package/test-env/components/card/checkable_card/checkable_card.js +3 -2
- package/test-env/components/datagrid/controls/column_selector.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting.js +1 -1
- package/test-env/components/header/header_links/header_links.js +6 -0
- package/test-env/components/modal/modal.js +22 -2
- package/test-env/components/page_template/page_template.js +6 -9
- package/test-env/components/popover/popover.js +13 -3
- package/test-env/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/test-env/components/popover/popover_panel/_popover_panel.js +8 -2
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/test-env/components/search_bar/query/ast.js +14 -3
- package/test-env/components/search_bar/search_bar.js +39 -5
- package/test-env/components/search_bar/search_box.js +38 -4
- package/test-env/components/tour/tour.styles.js +3 -2
- package/test-env/components/tour/tour_step.js +7 -5
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "className", "type", "truncate"],
|
|
5
|
-
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb"];
|
|
5
|
+
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -51,12 +51,13 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
51
51
|
isLastBreadcrumb = _ref2.isLastBreadcrumb,
|
|
52
52
|
isOnlyBreadcrumb = _ref2.isOnlyBreadcrumb,
|
|
53
53
|
highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
|
|
54
|
+
truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
|
|
54
55
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
56
|
|
|
56
57
|
var classes = classNames('euiBreadcrumb__content', className);
|
|
57
58
|
var euiTheme = useEuiTheme();
|
|
58
59
|
var styles = euiBreadcrumbContentStyles(euiTheme);
|
|
59
|
-
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate &&
|
|
60
|
+
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
60
61
|
|
|
61
62
|
if (type === 'application') {
|
|
62
63
|
if (isOnlyBreadcrumb) {
|
|
@@ -48,12 +48,14 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
48
48
|
}, [breadcrumbs, responsiveMax]);
|
|
49
49
|
var breadcrumbChildren = useMemo(function () {
|
|
50
50
|
return visibleBreadcrumbs.map(function (breadcrumb, index) {
|
|
51
|
+
var _breadcrumb$truncate;
|
|
52
|
+
|
|
51
53
|
var isFirstBreadcrumb = index === 0;
|
|
52
54
|
var isLastBreadcrumb = index === visibleBreadcrumbs.length - 1;
|
|
53
55
|
var isOnlyBreadcrumb = visibleBreadcrumbs.length === 1;
|
|
54
56
|
var sharedProps = {
|
|
55
57
|
type: type,
|
|
56
|
-
truncate: truncate
|
|
58
|
+
truncate: (_breadcrumb$truncate = breadcrumb.truncate) !== null && _breadcrumb$truncate !== void 0 ? _breadcrumb$truncate : truncate
|
|
57
59
|
};
|
|
58
60
|
return breadcrumb.isCollapsedButton ? ___EmotionJSX(EuiBreadcrumbCollapsed, _extends({
|
|
59
61
|
key: "collapsed"
|
|
@@ -67,12 +69,13 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
67
69
|
max: 0
|
|
68
70
|
})) : ___EmotionJSX(EuiBreadcrumb, _extends({
|
|
69
71
|
key: index
|
|
70
|
-
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({
|
|
72
|
+
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({}, breadcrumb, sharedProps, {
|
|
71
73
|
isFirstBreadcrumb: isFirstBreadcrumb,
|
|
72
74
|
isLastBreadcrumb: isLastBreadcrumb,
|
|
73
75
|
isOnlyBreadcrumb: isOnlyBreadcrumb,
|
|
74
|
-
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage
|
|
75
|
-
|
|
76
|
+
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage,
|
|
77
|
+
truncateLastBreadcrumb: isLastBreadcrumb && truncate && breadcrumb.truncate == null
|
|
78
|
+
})));
|
|
76
79
|
});
|
|
77
80
|
}, [visibleBreadcrumbs, truncate, type, lastBreadcrumbIsCurrentPage]);
|
|
78
81
|
return ___EmotionJSX("nav", _extends({
|
|
@@ -17,33 +17,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { isValidElement } from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
|
-
import { keysOf } from '../common';
|
|
21
20
|
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
21
|
+
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
22
22
|
import { EuiText } from '../text';
|
|
23
23
|
import { EuiTitle } from '../title';
|
|
24
24
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
25
|
-
import { EuiCardSelect
|
|
25
|
+
import { EuiCardSelect } from './card_select';
|
|
26
26
|
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
27
27
|
import { validateHref } from '../../services/security/href_validator';
|
|
28
28
|
import { EuiPanel } from '../panel';
|
|
29
29
|
import { EuiSpacer } from '../spacer';
|
|
30
30
|
import { euiCardBetaBadgeStyles, euiCardStyles, euiCardTextStyles } from './card.styles';
|
|
31
31
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
|
-
var
|
|
33
|
-
left: 'euiCard--leftAligned',
|
|
34
|
-
center: 'euiCard--centerAligned',
|
|
35
|
-
right: 'euiCard--rightAligned'
|
|
36
|
-
};
|
|
37
|
-
export var ALIGNMENTS = keysOf(textAlignToClassNameMap);
|
|
38
|
-
var layoutToClassNameMap = {
|
|
39
|
-
vertical: '',
|
|
40
|
-
horizontal: 'euiCard--horizontal'
|
|
41
|
-
};
|
|
42
|
-
export var LAYOUT_ALIGNMENTS = keysOf(layoutToClassNameMap);
|
|
43
|
-
/**
|
|
44
|
-
* Certain props are only allowed when the layout is vertical
|
|
45
|
-
*/
|
|
46
|
-
|
|
32
|
+
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
47
33
|
export var EuiCard = function EuiCard(_ref) {
|
|
48
34
|
var className = _ref.className,
|
|
49
35
|
description = _ref.description,
|
|
@@ -103,15 +89,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
103
89
|
}
|
|
104
90
|
}
|
|
105
91
|
|
|
106
|
-
var
|
|
107
|
-
var classes = classNames('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
108
|
-
'euiCard--isClickable': isClickable,
|
|
109
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
110
|
-
'euiCard--hasIcon': icon,
|
|
111
|
-
'euiCard--isSelectable': selectable,
|
|
112
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
113
|
-
'euiCard-isDisabled': isDisabled
|
|
114
|
-
}, selectableColorClass, className);
|
|
92
|
+
var classes = classNames('euiCard', className);
|
|
115
93
|
var ariaId = useGeneratedHtmlId();
|
|
116
94
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
117
95
|
/**
|
|
@@ -139,7 +117,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
139
117
|
|
|
140
118
|
if (icon) {
|
|
141
119
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
142
|
-
iconNode =
|
|
120
|
+
iconNode = cloneElementWithCss(icon, {
|
|
143
121
|
className: classNames(icon.props.className, 'euiCard__icon'),
|
|
144
122
|
css: iconStyles
|
|
145
123
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
3
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -19,6 +19,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
19
19
|
export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
20
20
|
var children = _ref.children,
|
|
21
21
|
className = _ref.className,
|
|
22
|
+
css = _ref.css,
|
|
22
23
|
_ref$checkableType = _ref.checkableType,
|
|
23
24
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
24
25
|
label = _ref.label,
|
|
@@ -31,7 +32,7 @@ export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
31
32
|
|
|
32
33
|
var euiThemeContext = useEuiTheme();
|
|
33
34
|
var styles = euiCheckableCardStyles(euiThemeContext);
|
|
34
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
35
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
35
36
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
36
37
|
var childStyles = [styles.euiCheckableCard__children];
|
|
37
38
|
var id = rest.id;
|
|
@@ -110,7 +110,7 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
110
110
|
},
|
|
111
111
|
anchorPosition: "downLeft",
|
|
112
112
|
panelPaddingSize: "s",
|
|
113
|
-
|
|
113
|
+
hasDragDrop: true,
|
|
114
114
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
115
115
|
size: "xs",
|
|
116
116
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -123,7 +123,7 @@ export var useDataGridColumnSorting = function useDataGridColumnSorting(columns,
|
|
|
123
123
|
},
|
|
124
124
|
anchorPosition: "downLeft",
|
|
125
125
|
panelPaddingSize: "s",
|
|
126
|
-
|
|
126
|
+
hasDragDrop: true,
|
|
127
127
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
128
128
|
size: "xs",
|
|
129
129
|
iconType: "sortable",
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
15
|
* Side Public License, v 1.
|
|
16
16
|
*/
|
|
17
|
-
import React from 'react';
|
|
17
|
+
import React, { useRef, useCallback } from 'react';
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import { keys } from '../../services';
|
|
20
20
|
import { EuiButtonIcon } from '../button';
|
|
@@ -32,6 +32,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
32
32
|
style = _ref.style,
|
|
33
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
|
|
35
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
36
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
37
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
38
|
+
);
|
|
39
|
+
var onFocus = useCallback(function () {
|
|
40
|
+
if (bodyScrollTop.current != null) {
|
|
41
|
+
window.scrollTo({
|
|
42
|
+
top: bodyScrollTop.current
|
|
43
|
+
});
|
|
44
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
35
48
|
var onKeyDown = function onKeyDown(event) {
|
|
36
49
|
if (event.key === keys.ESCAPE) {
|
|
37
50
|
event.preventDefault();
|
|
@@ -54,11 +67,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
54
67
|
|
|
55
68
|
var classes = classnames('euiModal', widthClassName, className);
|
|
56
69
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
57
|
-
initialFocus: initialFocus
|
|
70
|
+
initialFocus: initialFocus,
|
|
71
|
+
scrollLock: true
|
|
58
72
|
}, ___EmotionJSX("div", _extends({
|
|
59
73
|
className: classes,
|
|
60
74
|
onKeyDown: onKeyDown,
|
|
61
75
|
tabIndex: 0,
|
|
76
|
+
onFocus: onFocus,
|
|
62
77
|
style: newStyle || style
|
|
63
78
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
64
79
|
token: "euiModal.closeModal",
|
|
@@ -132,15 +132,12 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
132
132
|
React.Children.toArray(children).forEach(function (child, index) {
|
|
133
133
|
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
sidebar.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
default:
|
|
143
|
-
sections.push(child);
|
|
135
|
+
if (child.type === EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === EuiPageSidebar) {
|
|
136
|
+
sidebar.push( /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
|
|
137
|
+
key: "sidebar".concat(index)
|
|
138
|
+
}, getSideBarProps()), child.props)));
|
|
139
|
+
} else {
|
|
140
|
+
sections.push(child);
|
|
144
141
|
}
|
|
145
142
|
});
|
|
146
143
|
|
|
@@ -10,7 +10,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
10
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
13
|
-
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
13
|
+
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
14
14
|
|
|
15
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
16
16
|
|
|
@@ -382,7 +382,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
382
382
|
}, {
|
|
383
383
|
key: "render",
|
|
384
384
|
value: function render() {
|
|
385
|
-
var
|
|
385
|
+
var _panelProps$tabIndex,
|
|
386
|
+
_this4 = this;
|
|
386
387
|
|
|
387
388
|
var _this$props = this.props,
|
|
388
389
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -405,6 +406,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
405
406
|
hasArrow = _this$props.hasArrow,
|
|
406
407
|
arrowChildren = _this$props.arrowChildren,
|
|
407
408
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
409
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
408
410
|
zIndex = _this$props.zIndex,
|
|
409
411
|
attachToAnchor = _this$props.attachToAnchor,
|
|
410
412
|
display = _this$props.display,
|
|
@@ -417,9 +419,10 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
417
419
|
container = _this$props.container,
|
|
418
420
|
focusTrapProps = _this$props.focusTrapProps,
|
|
419
421
|
initialFocusProp = _this$props.initialFocus,
|
|
420
|
-
|
|
422
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
421
423
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
422
424
|
|
|
425
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
423
426
|
var styles = euiPopoverStyles();
|
|
424
427
|
var popoverStyles = [styles.euiPopover, {
|
|
425
428
|
display: display
|
|
@@ -483,6 +486,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
483
486
|
position: this.state.arrowPosition,
|
|
484
487
|
isAttached: attachToAnchor,
|
|
485
488
|
className: classNames(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
489
|
+
hasDragDrop: hasDragDrop,
|
|
486
490
|
hasShadow: false,
|
|
487
491
|
paddingSize: panelPaddingSize,
|
|
488
492
|
tabIndex: tabIndex,
|
|
@@ -23,6 +23,7 @@ export var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
23
23
|
var styles = euiPopoverArrowStyles(euiTheme);
|
|
24
24
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
25
25
|
return ___EmotionJSX("div", _extends({
|
|
26
|
+
className: "euiPopover__arrow",
|
|
26
27
|
"data-popover-arrow": position,
|
|
27
28
|
css: cssStyles
|
|
28
29
|
}, rest), children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
4
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -29,6 +29,7 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
29
29
|
className = _ref.className,
|
|
30
30
|
isOpen = _ref.isOpen,
|
|
31
31
|
isAttached = _ref.isAttached,
|
|
32
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
32
33
|
position = _ref.position,
|
|
33
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
|
|
@@ -44,6 +45,10 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
44
45
|
panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
if (hasDragDrop) {
|
|
49
|
+
panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
return ___EmotionJSX(EuiPopoverPanelContext.Provider, {
|
|
48
53
|
value: panelContext
|
|
49
54
|
}, ___EmotionJSX(EuiPanel, _extends({
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { euiShadow, euiShadowFlat, euiShadowMedium } from '../../../themes/amsterdam/global_styling/mixins';
|
|
10
|
+
import { getShadowColor } from '../../../themes/amsterdam/global_styling/functions';
|
|
10
11
|
import { euiCanAnimate, logicalCSS } from '../../../global_styling';
|
|
11
12
|
export var openAnimationTiming = 'slow';
|
|
12
13
|
var translateDistance = 's';
|
|
@@ -17,7 +18,8 @@ var translateDistance = 's';
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
20
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
21
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
22
|
+
colorMode = euiThemeContext.colorMode;
|
|
21
23
|
return {
|
|
22
24
|
// Base
|
|
23
25
|
euiPopover__panel: /*#__PURE__*/css("position:absolute;", logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), ";", logicalCSS('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", euiShadowMedium(euiThemeContext, {
|
|
@@ -38,6 +40,18 @@ export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContex
|
|
|
38
40
|
// Satisfies TS
|
|
39
41
|
left: /*#__PURE__*/css(";label:left;"),
|
|
40
42
|
right: /*#__PURE__*/css(";label:right;")
|
|
43
|
+
},
|
|
44
|
+
// Overrides for drag & drop contexts within popovers. This is required because
|
|
45
|
+
// the fixed positions of drag and drop don't work inside of transformed elements
|
|
46
|
+
hasDragDrop: {
|
|
47
|
+
hasDragDrop: /*#__PURE__*/css("transform:none;filter:none;", euiShadowMedium(euiThemeContext, {
|
|
48
|
+
property: 'box-shadow'
|
|
49
|
+
}), ";;label:hasDragDrop;"),
|
|
50
|
+
// The offset transforms must be recreated in margins
|
|
51
|
+
top: /*#__PURE__*/css("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
|
|
41
55
|
}
|
|
42
56
|
};
|
|
43
57
|
};
|
|
@@ -268,6 +268,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
268
268
|
return valuesEqual(item, value);
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
+
|
|
272
|
+
var mustToMatch = function mustToMatch(must) {
|
|
273
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
274
|
+
};
|
|
271
275
|
/**
|
|
272
276
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
273
277
|
*
|
|
@@ -392,9 +396,16 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
392
396
|
}
|
|
393
397
|
}, {
|
|
394
398
|
key: "getOrFieldClause",
|
|
395
|
-
value: function getOrFieldClause(field, value) {
|
|
399
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
396
400
|
return this.getFieldClause(field, function (clause) {
|
|
397
|
-
|
|
401
|
+
if (!isArray(clause.value)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var matchValue = isNil(value) || arrayIncludesValue(clause.value, value);
|
|
406
|
+
var matchMust = isNil(must) || mustToMatch(must) === clause.match;
|
|
407
|
+
var matchOperator = isNil(operator) || operator === clause.operator;
|
|
408
|
+
return matchValue && matchMust && matchOperator;
|
|
398
409
|
});
|
|
399
410
|
}
|
|
400
411
|
}, {
|
|
@@ -402,7 +413,7 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
402
413
|
value: function addOrFieldValue(field, value) {
|
|
403
414
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
404
415
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
405
|
-
var existingClause = this.getOrFieldClause(field);
|
|
416
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
406
417
|
|
|
407
418
|
if (!existingClause) {
|
|
408
419
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -10,6 +10,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
10
10
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
11
11
|
var _excluded = ["schema"];
|
|
12
12
|
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
|
+
|
|
13
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
18
|
|
|
15
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -22,6 +26,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
26
|
* Side Public License, v 1.
|
|
23
27
|
*/
|
|
24
28
|
import React, { Component } from 'react';
|
|
29
|
+
import { htmlIdGenerator } from '../../services/accessibility';
|
|
25
30
|
import { isString } from '../../services/predicate';
|
|
26
31
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
27
32
|
import { EuiSearchBox } from './search_box';
|
|
@@ -62,6 +67,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
62
67
|
|
|
63
68
|
_this = _super.call(this, props);
|
|
64
69
|
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "hintId", htmlIdGenerator('__hint')());
|
|
71
|
+
|
|
65
72
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
|
|
66
73
|
try {
|
|
67
74
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -118,7 +125,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
118
125
|
_this.state = {
|
|
119
126
|
query: _query,
|
|
120
127
|
queryText: _query.text,
|
|
121
|
-
error: null
|
|
128
|
+
error: null,
|
|
129
|
+
isHintVisible: false
|
|
122
130
|
};
|
|
123
131
|
return _this;
|
|
124
132
|
}
|
|
@@ -180,10 +188,15 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
180
188
|
}, {
|
|
181
189
|
key: "render",
|
|
182
190
|
value: function render() {
|
|
191
|
+
var _hint$popoverProps$is,
|
|
192
|
+
_hint$popoverProps,
|
|
193
|
+
_this2 = this;
|
|
194
|
+
|
|
183
195
|
var _this$state = this.state,
|
|
184
196
|
query = _this$state.query,
|
|
185
197
|
queryText = _this$state.queryText,
|
|
186
|
-
error = _this$state.error
|
|
198
|
+
error = _this$state.error,
|
|
199
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
187
200
|
var _this$props = this.props,
|
|
188
201
|
_this$props$box = _this$props.box;
|
|
189
202
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -194,7 +207,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
194
207
|
box = _objectWithoutProperties(_this$props$box, _excluded),
|
|
195
208
|
filters = _this$props.filters,
|
|
196
209
|
toolsLeft = _this$props.toolsLeft,
|
|
197
|
-
toolsRight = _this$props.toolsRight
|
|
210
|
+
toolsRight = _this$props.toolsRight,
|
|
211
|
+
hint = _this$props.hint;
|
|
198
212
|
|
|
199
213
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
200
214
|
var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
|
|
@@ -206,6 +220,7 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
206
220
|
onChange: this.onFiltersChange
|
|
207
221
|
}));
|
|
208
222
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
223
|
+
var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 ? void 0 : (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
|
|
209
224
|
return ___EmotionJSX(EuiFlexGroup, {
|
|
210
225
|
gutterSize: "m",
|
|
211
226
|
alignItems: "center",
|
|
@@ -217,7 +232,17 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
217
232
|
query: queryText,
|
|
218
233
|
onSearch: this.onSearch,
|
|
219
234
|
isInvalid: error != null,
|
|
220
|
-
title: error ? error.message : undefined
|
|
235
|
+
title: error ? error.message : undefined,
|
|
236
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
237
|
+
hint: hint ? _objectSpread({
|
|
238
|
+
isVisible: isHintVisible,
|
|
239
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
240
|
+
_this2.setState({
|
|
241
|
+
isHintVisible: isVisible
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
id: this.hintId
|
|
245
|
+
}, hint) : undefined
|
|
221
246
|
}))), filtersBar, toolsRightEl);
|
|
222
247
|
}
|
|
223
248
|
}], [{
|
|
@@ -228,7 +253,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
228
253
|
return {
|
|
229
254
|
query: query,
|
|
230
255
|
queryText: query.text,
|
|
231
|
-
error: null
|
|
256
|
+
error: null,
|
|
257
|
+
isHintVisible: prevState.isHintVisible
|
|
232
258
|
};
|
|
233
259
|
}
|
|
234
260
|
|
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["query", "incremental"];
|
|
10
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -22,6 +22,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
22
|
*/
|
|
23
23
|
import React, { Component } from 'react';
|
|
24
24
|
import { EuiFieldSearch } from '../form';
|
|
25
|
+
import { EuiInputPopover } from '../popover';
|
|
25
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
27
|
export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
27
28
|
_inherits(EuiSearchBox, _Component);
|
|
@@ -60,6 +61,7 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
60
61
|
var _this$props = this.props,
|
|
61
62
|
query = _this$props.query,
|
|
62
63
|
incremental = _this$props.incremental,
|
|
64
|
+
hint = _this$props.hint,
|
|
63
65
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
64
66
|
|
|
65
67
|
var ariaLabel;
|
|
@@ -70,15 +72,39 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
70
72
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
var search = ___EmotionJSX(EuiFieldSearch, _extends({
|
|
74
76
|
inputRef: function inputRef(input) {
|
|
75
77
|
return _this2.inputElement = input;
|
|
76
78
|
},
|
|
77
79
|
fullWidth: true,
|
|
78
80
|
defaultValue: query,
|
|
79
81
|
incremental: incremental,
|
|
80
|
-
"aria-label": ariaLabel
|
|
82
|
+
"aria-label": ariaLabel,
|
|
83
|
+
onFocus: function onFocus() {
|
|
84
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
85
|
+
}
|
|
81
86
|
}, rest));
|
|
87
|
+
|
|
88
|
+
if (hint) {
|
|
89
|
+
return ___EmotionJSX(EuiInputPopover, _extends({
|
|
90
|
+
disableFocusTrap: true,
|
|
91
|
+
input: search,
|
|
92
|
+
isOpen: hint.isVisible,
|
|
93
|
+
fullWidth: true,
|
|
94
|
+
closePopover: function closePopover() {
|
|
95
|
+
hint.setIsVisible(false);
|
|
96
|
+
},
|
|
97
|
+
panelProps: {
|
|
98
|
+
'aria-live': undefined,
|
|
99
|
+
'aria-modal': undefined,
|
|
100
|
+
role: undefined,
|
|
101
|
+
tabIndex: -1,
|
|
102
|
+
id: hint.id
|
|
103
|
+
}
|
|
104
|
+
}, hint.popoverProps), hint.content);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return search;
|
|
82
108
|
}
|
|
83
109
|
}]);
|
|
84
110
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
10
|
-
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
|
|
11
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
12
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ export var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
20
20
|
colorMode = _ref.colorMode;
|
|
21
21
|
return {
|
|
22
22
|
// Targets EuiPopoverPanel
|
|
23
|
-
euiTour: /*#__PURE__*/css("
|
|
23
|
+
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
@@ -34,7 +34,8 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
34
34
|
});
|
|
35
35
|
return {
|
|
36
36
|
// Base
|
|
37
|
-
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], "
|
|
37
|
+
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;", euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
38
|
+
isOpen: /*#__PURE__*/css(euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
38
39
|
// Positions
|
|
39
40
|
right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
|
|
40
41
|
left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
6
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -34,6 +34,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
34
34
|
anchor = _ref.anchor,
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
className = _ref.className,
|
|
37
|
+
css = _ref.css,
|
|
37
38
|
_ref$closePopover = _ref.closePopover,
|
|
38
39
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
39
40
|
content = _ref.content,
|
|
@@ -53,6 +54,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
53
54
|
_ref$decoration = _ref.decoration,
|
|
54
55
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
55
56
|
footerAction = _ref.footerAction,
|
|
57
|
+
panelProps = _ref.panelProps,
|
|
56
58
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
|
|
58
60
|
var titleId = useGeneratedHtmlId();
|
|
@@ -96,7 +98,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
96
98
|
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
97
99
|
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
98
100
|
var beaconStyles = euiTourBeaconStyles(euiTheme);
|
|
99
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
101
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
100
102
|
var finishButtonProps = {
|
|
101
103
|
color: 'text',
|
|
102
104
|
flush: 'right',
|
|
@@ -157,9 +159,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
157
159
|
ownFocus: false,
|
|
158
160
|
panelClassName: classes,
|
|
159
161
|
panelStyle: style,
|
|
160
|
-
panelProps: {
|
|
161
|
-
css: tourStyles.euiTour
|
|
162
|
-
},
|
|
162
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
163
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
164
|
+
}),
|
|
163
165
|
offset: hasBeacon ? 10 : 0,
|
|
164
166
|
'aria-labelledby': titleId,
|
|
165
167
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|