@elastic/eui 67.1.6 → 67.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -6
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -6
- 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/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 +41 -5
- 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/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/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/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/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/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
|
@@ -15,7 +15,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
-
import React
|
|
18
|
+
import React from 'react';
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import { keysOf } from '../../common';
|
|
@@ -112,7 +112,7 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
112
112
|
anchorProps: anchorProps
|
|
113
113
|
}, content);
|
|
114
114
|
} else {
|
|
115
|
-
return ___EmotionJSX(
|
|
115
|
+
return ___EmotionJSX("span", anchorProps, content);
|
|
116
116
|
}
|
|
117
117
|
} else {
|
|
118
118
|
if (tooltipContent) {
|
|
@@ -133,10 +133,10 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
133
133
|
console.warn("Only string titles are permitted on badges that do not use tooltips. Found: ".concat(_typeof(spanTitle)));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
return ___EmotionJSX("span", _extends({
|
|
136
|
+
return ___EmotionJSX("span", anchorProps, ___EmotionJSX("span", _extends({
|
|
137
137
|
className: classes,
|
|
138
138
|
title: spanTitle
|
|
139
|
-
}, rest), icon || label);
|
|
139
|
+
}, rest), icon || label));
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
};
|
|
@@ -400,7 +400,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
400
400
|
sortName = _this$state2.sortName,
|
|
401
401
|
pageIndex = _this$state2.pageIndex,
|
|
402
402
|
pageSize = _this$state2.pageSize;
|
|
403
|
-
var matchingItems = query ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
403
|
+
var matchingItems = query !== null && (executeQueryOptions === null || executeQueryOptions === void 0 ? void 0 : executeQueryOptions.enabled) !== false ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
404
404
|
var sortedItems = sortName ? matchingItems.slice(0) // avoid mutating the source array
|
|
405
405
|
.sort(this.getItemSorter()) // sort, causes mutation
|
|
406
406
|
: matchingItems;
|
|
@@ -1134,6 +1134,14 @@ EuiInMemoryTable.propTypes = {
|
|
|
1134
1134
|
* Date formatter to use when parsing date values
|
|
1135
1135
|
*/
|
|
1136
1136
|
dateFormat: PropTypes.any,
|
|
1137
|
+
|
|
1138
|
+
/**
|
|
1139
|
+
* Hint to render below the search bar
|
|
1140
|
+
*/
|
|
1141
|
+
hint: PropTypes.shape({
|
|
1142
|
+
content: PropTypes.node.isRequired,
|
|
1143
|
+
popoverProps: PropTypes.any
|
|
1144
|
+
}),
|
|
1137
1145
|
className: PropTypes.string,
|
|
1138
1146
|
"aria-label": PropTypes.string,
|
|
1139
1147
|
"data-test-subj": PropTypes.string,
|
|
@@ -1198,7 +1206,13 @@ EuiInMemoryTable.propTypes = {
|
|
|
1198
1206
|
executeQueryOptions: PropTypes.shape({
|
|
1199
1207
|
defaultFields: PropTypes.arrayOf(PropTypes.string.isRequired),
|
|
1200
1208
|
isClauseMatcher: PropTypes.func,
|
|
1201
|
-
explain: PropTypes.bool
|
|
1209
|
+
explain: PropTypes.bool,
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* When the search bar Query is controlled and passed to the `search` prop it is by default executed against the items passed to the table to filter them out.
|
|
1213
|
+
* If the filtering is already done before passing the `items` to the table we can disable the execution by setting `enabled` to `false`.
|
|
1214
|
+
*/
|
|
1215
|
+
enabled: PropTypes.bool
|
|
1202
1216
|
}),
|
|
1203
1217
|
|
|
1204
1218
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _excluded = ["children", "className", "type", "truncate"],
|
|
2
|
-
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb"];
|
|
2
|
+
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
|
|
3
3
|
|
|
4
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
5
|
|
|
@@ -59,7 +59,8 @@ EuiBreadcrumb.propTypes = {
|
|
|
59
59
|
isFirstBreadcrumb: PropTypes.bool,
|
|
60
60
|
isLastBreadcrumb: PropTypes.bool,
|
|
61
61
|
isOnlyBreadcrumb: PropTypes.bool,
|
|
62
|
-
highlightLastBreadcrumb: PropTypes.bool
|
|
62
|
+
highlightLastBreadcrumb: PropTypes.bool,
|
|
63
|
+
truncateLastBreadcrumb: PropTypes.bool
|
|
63
64
|
};
|
|
64
65
|
export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
65
66
|
var text = _ref2.text,
|
|
@@ -74,12 +75,13 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
74
75
|
isLastBreadcrumb = _ref2.isLastBreadcrumb,
|
|
75
76
|
isOnlyBreadcrumb = _ref2.isOnlyBreadcrumb,
|
|
76
77
|
highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
|
|
78
|
+
truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
|
|
77
79
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
78
80
|
|
|
79
81
|
var classes = classNames('euiBreadcrumb__content', className);
|
|
80
82
|
var euiTheme = useEuiTheme();
|
|
81
83
|
var styles = euiBreadcrumbContentStyles(euiTheme);
|
|
82
|
-
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate &&
|
|
84
|
+
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
83
85
|
|
|
84
86
|
if (type === 'application') {
|
|
85
87
|
if (isOnlyBreadcrumb) {
|
|
@@ -148,7 +150,8 @@ EuiBreadcrumbContent.propTypes = {
|
|
|
148
150
|
isFirstBreadcrumb: PropTypes.bool,
|
|
149
151
|
isLastBreadcrumb: PropTypes.bool,
|
|
150
152
|
isOnlyBreadcrumb: PropTypes.bool,
|
|
151
|
-
highlightLastBreadcrumb: PropTypes.bool
|
|
153
|
+
highlightLastBreadcrumb: PropTypes.bool,
|
|
154
|
+
truncateLastBreadcrumb: PropTypes.bool
|
|
152
155
|
};
|
|
153
156
|
export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref3) {
|
|
154
157
|
var children = _ref3.children,
|
|
@@ -196,5 +199,6 @@ EuiBreadcrumbCollapsed.propTypes = {
|
|
|
196
199
|
isFirstBreadcrumb: PropTypes.bool,
|
|
197
200
|
isLastBreadcrumb: PropTypes.bool,
|
|
198
201
|
isOnlyBreadcrumb: PropTypes.bool,
|
|
199
|
-
highlightLastBreadcrumb: PropTypes.bool
|
|
202
|
+
highlightLastBreadcrumb: PropTypes.bool,
|
|
203
|
+
truncateLastBreadcrumb: PropTypes.bool
|
|
200
204
|
};
|
|
@@ -54,12 +54,14 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
54
54
|
}, [breadcrumbs, responsiveMax]);
|
|
55
55
|
var breadcrumbChildren = useMemo(function () {
|
|
56
56
|
return visibleBreadcrumbs.map(function (breadcrumb, index) {
|
|
57
|
+
var _breadcrumb$truncate;
|
|
58
|
+
|
|
57
59
|
var isFirstBreadcrumb = index === 0;
|
|
58
60
|
var isLastBreadcrumb = index === visibleBreadcrumbs.length - 1;
|
|
59
61
|
var isOnlyBreadcrumb = visibleBreadcrumbs.length === 1;
|
|
60
62
|
var sharedProps = {
|
|
61
63
|
type: type,
|
|
62
|
-
truncate: truncate
|
|
64
|
+
truncate: (_breadcrumb$truncate = breadcrumb.truncate) !== null && _breadcrumb$truncate !== void 0 ? _breadcrumb$truncate : truncate
|
|
63
65
|
};
|
|
64
66
|
return breadcrumb.isCollapsedButton ? ___EmotionJSX(EuiBreadcrumbCollapsed, _extends({
|
|
65
67
|
key: "collapsed"
|
|
@@ -73,12 +75,13 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
73
75
|
max: 0
|
|
74
76
|
})) : ___EmotionJSX(EuiBreadcrumb, _extends({
|
|
75
77
|
key: index
|
|
76
|
-
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({
|
|
78
|
+
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({}, breadcrumb, sharedProps, {
|
|
77
79
|
isFirstBreadcrumb: isFirstBreadcrumb,
|
|
78
80
|
isLastBreadcrumb: isLastBreadcrumb,
|
|
79
81
|
isOnlyBreadcrumb: isOnlyBreadcrumb,
|
|
80
|
-
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage
|
|
81
|
-
|
|
82
|
+
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage,
|
|
83
|
+
truncateLastBreadcrumb: isLastBreadcrumb && truncate && breadcrumb.truncate == null
|
|
84
|
+
})));
|
|
82
85
|
});
|
|
83
86
|
}, [visibleBreadcrumbs, truncate, type, lastBreadcrumbIsCurrentPage]);
|
|
84
87
|
return ___EmotionJSX("nav", _extends({
|
|
@@ -127,7 +127,7 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
127
127
|
},
|
|
128
128
|
anchorPosition: "downLeft",
|
|
129
129
|
panelPaddingSize: "s",
|
|
130
|
-
|
|
130
|
+
hasDragDrop: true,
|
|
131
131
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
132
132
|
size: "xs",
|
|
133
133
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -140,7 +140,7 @@ export var useDataGridColumnSorting = function useDataGridColumnSorting(columns,
|
|
|
140
140
|
},
|
|
141
141
|
anchorPosition: "downLeft",
|
|
142
142
|
panelPaddingSize: "s",
|
|
143
|
-
|
|
143
|
+
hasDragDrop: true,
|
|
144
144
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
145
145
|
size: "xs",
|
|
146
146
|
iconType: "sortable",
|
|
@@ -252,6 +252,12 @@ EuiHeaderLinks.propTypes = {
|
|
|
252
252
|
*/
|
|
253
253
|
repositionOnScroll: PropTypes.bool,
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
257
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
258
|
+
*/
|
|
259
|
+
hasDragDrop: PropTypes.bool,
|
|
260
|
+
|
|
255
261
|
/**
|
|
256
262
|
* By default, popover content inherits the z-index of the anchor
|
|
257
263
|
* component; pass `zIndex` to override
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
20
|
* Side Public License, v 1.
|
|
21
21
|
*/
|
|
22
|
-
import React from 'react';
|
|
22
|
+
import React, { useRef, useCallback } from 'react';
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classnames from 'classnames';
|
|
25
25
|
import { keys } from '../../services';
|
|
@@ -38,6 +38,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
38
38
|
style = _ref.style,
|
|
39
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
|
|
41
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
42
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
43
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
44
|
+
);
|
|
45
|
+
var onFocus = useCallback(function () {
|
|
46
|
+
if (bodyScrollTop.current != null) {
|
|
47
|
+
window.scrollTo({
|
|
48
|
+
top: bodyScrollTop.current
|
|
49
|
+
});
|
|
50
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
41
54
|
var onKeyDown = function onKeyDown(event) {
|
|
42
55
|
if (event.key === keys.ESCAPE) {
|
|
43
56
|
event.preventDefault();
|
|
@@ -60,11 +73,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
60
73
|
|
|
61
74
|
var classes = classnames('euiModal', widthClassName, className);
|
|
62
75
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
63
|
-
initialFocus: initialFocus
|
|
76
|
+
initialFocus: initialFocus,
|
|
77
|
+
scrollLock: true
|
|
64
78
|
}, ___EmotionJSX("div", _extends({
|
|
65
79
|
className: classes,
|
|
66
80
|
onKeyDown: onKeyDown,
|
|
67
81
|
tabIndex: 0,
|
|
82
|
+
onFocus: onFocus,
|
|
68
83
|
style: newStyle || style
|
|
69
84
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
70
85
|
token: "euiModal.closeModal",
|
|
@@ -149,15 +149,12 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
149
149
|
React.Children.toArray(children).forEach(function (child, index) {
|
|
150
150
|
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
sidebar.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
default:
|
|
160
|
-
sections.push(child);
|
|
152
|
+
if (child.type === EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === EuiPageSidebar) {
|
|
153
|
+
sidebar.push( /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
|
|
154
|
+
key: "sidebar".concat(index)
|
|
155
|
+
}, getSideBarProps()), child.props)));
|
|
156
|
+
} else {
|
|
157
|
+
sections.push(child);
|
|
161
158
|
}
|
|
162
159
|
});
|
|
163
160
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
3
|
import { css as _css } from "@emotion/react";
|
|
4
|
-
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"];
|
|
4
|
+
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"];
|
|
5
5
|
|
|
6
6
|
function _extends() { _extends = Object.assign || 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); }
|
|
7
7
|
|
|
@@ -419,7 +419,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
419
419
|
}, {
|
|
420
420
|
key: "render",
|
|
421
421
|
value: function render() {
|
|
422
|
-
var
|
|
422
|
+
var _panelProps$tabIndex,
|
|
423
|
+
_this4 = this;
|
|
423
424
|
|
|
424
425
|
var _this$props = this.props,
|
|
425
426
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -442,6 +443,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
442
443
|
hasArrow = _this$props.hasArrow,
|
|
443
444
|
arrowChildren = _this$props.arrowChildren,
|
|
444
445
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
446
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
445
447
|
zIndex = _this$props.zIndex,
|
|
446
448
|
attachToAnchor = _this$props.attachToAnchor,
|
|
447
449
|
display = _this$props.display,
|
|
@@ -454,9 +456,10 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
454
456
|
container = _this$props.container,
|
|
455
457
|
focusTrapProps = _this$props.focusTrapProps,
|
|
456
458
|
initialFocusProp = _this$props.initialFocus,
|
|
457
|
-
|
|
459
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
458
460
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
459
461
|
|
|
462
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
460
463
|
var styles = euiPopoverStyles();
|
|
461
464
|
var popoverStyles = [styles.euiPopover, {
|
|
462
465
|
display: display
|
|
@@ -520,6 +523,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
520
523
|
position: this.state.arrowPosition,
|
|
521
524
|
isAttached: attachToAnchor,
|
|
522
525
|
className: classNames(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
526
|
+
hasDragDrop: hasDragDrop,
|
|
523
527
|
hasShadow: false,
|
|
524
528
|
paddingSize: panelPaddingSize,
|
|
525
529
|
tabIndex: tabIndex,
|
|
@@ -738,6 +742,12 @@ EuiPopover.propTypes = {
|
|
|
738
742
|
*/
|
|
739
743
|
repositionOnScroll: PropTypes.bool,
|
|
740
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
747
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
748
|
+
*/
|
|
749
|
+
hasDragDrop: PropTypes.bool,
|
|
750
|
+
|
|
741
751
|
/**
|
|
742
752
|
* By default, popover content inherits the z-index of the anchor
|
|
743
753
|
* component; pass `zIndex` to override
|
|
@@ -28,6 +28,7 @@ export var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
28
28
|
var styles = euiPopoverArrowStyles(euiTheme);
|
|
29
29
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
30
30
|
return ___EmotionJSX("div", _extends({
|
|
31
|
+
className: "euiPopover__arrow",
|
|
31
32
|
"data-popover-arrow": position,
|
|
32
33
|
css: cssStyles
|
|
33
34
|
}, rest), children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
1
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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
|
|
|
@@ -45,6 +45,7 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
45
45
|
className = _ref.className,
|
|
46
46
|
isOpen = _ref.isOpen,
|
|
47
47
|
isAttached = _ref.isAttached,
|
|
48
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
48
49
|
position = _ref.position,
|
|
49
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
|
|
@@ -60,6 +61,10 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
60
61
|
panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
if (hasDragDrop) {
|
|
65
|
+
panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
return ___EmotionJSX(EuiPopoverPanelContext.Provider, {
|
|
64
69
|
value: panelContext
|
|
65
70
|
}, ___EmotionJSX(EuiPanel, _extends({
|
|
@@ -111,5 +116,6 @@ EuiPopoverPanel.propTypes = {
|
|
|
111
116
|
css: PropTypes.any,
|
|
112
117
|
isOpen: PropTypes.bool,
|
|
113
118
|
isAttached: PropTypes.bool,
|
|
114
|
-
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])])
|
|
119
|
+
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])]),
|
|
120
|
+
hasDragDrop: PropTypes.bool
|
|
115
121
|
};
|
|
@@ -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
|
};
|
|
@@ -283,6 +283,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
283
283
|
return valuesEqual(item, value);
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
+
|
|
287
|
+
var mustToMatch = function mustToMatch(must) {
|
|
288
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
289
|
+
};
|
|
286
290
|
/**
|
|
287
291
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
288
292
|
*
|
|
@@ -407,9 +411,16 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
407
411
|
}
|
|
408
412
|
}, {
|
|
409
413
|
key: "getOrFieldClause",
|
|
410
|
-
value: function getOrFieldClause(field, value) {
|
|
414
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
411
415
|
return this.getFieldClause(field, function (clause) {
|
|
412
|
-
|
|
416
|
+
if (!isArray(clause.value)) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
var matchValue = isNil(value) || arrayIncludesValue(clause.value, value);
|
|
421
|
+
var matchMust = isNil(must) || mustToMatch(must) === clause.match;
|
|
422
|
+
var matchOperator = isNil(operator) || operator === clause.operator;
|
|
423
|
+
return matchValue && matchMust && matchOperator;
|
|
413
424
|
});
|
|
414
425
|
}
|
|
415
426
|
}, {
|
|
@@ -417,7 +428,7 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
417
428
|
value: function addOrFieldValue(field, value) {
|
|
418
429
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
419
430
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
420
|
-
var existingClause = this.getOrFieldClause(field);
|
|
431
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
421
432
|
|
|
422
433
|
if (!existingClause) {
|
|
423
434
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -2,6 +2,10 @@ var _excluded = ["schema"];
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || 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
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
5
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
10
|
|
|
7
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -40,6 +44,7 @@ import PropTypes from "prop-types";
|
|
|
40
44
|
* Side Public License, v 1.
|
|
41
45
|
*/
|
|
42
46
|
import React, { Component } from 'react';
|
|
47
|
+
import { htmlIdGenerator } from '../../services/accessibility';
|
|
43
48
|
import { isString } from '../../services/predicate';
|
|
44
49
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
45
50
|
import { EuiSearchBox } from './search_box';
|
|
@@ -80,6 +85,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
80
85
|
|
|
81
86
|
_this = _super.call(this, props);
|
|
82
87
|
|
|
88
|
+
_defineProperty(_assertThisInitialized(_this), "hintId", htmlIdGenerator('__hint')());
|
|
89
|
+
|
|
83
90
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
|
|
84
91
|
try {
|
|
85
92
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -136,7 +143,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
136
143
|
_this.state = {
|
|
137
144
|
query: _query,
|
|
138
145
|
queryText: _query.text,
|
|
139
|
-
error: null
|
|
146
|
+
error: null,
|
|
147
|
+
isHintVisible: false
|
|
140
148
|
};
|
|
141
149
|
return _this;
|
|
142
150
|
}
|
|
@@ -198,10 +206,15 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
198
206
|
}, {
|
|
199
207
|
key: "render",
|
|
200
208
|
value: function render() {
|
|
209
|
+
var _hint$popoverProps$is,
|
|
210
|
+
_hint$popoverProps,
|
|
211
|
+
_this2 = this;
|
|
212
|
+
|
|
201
213
|
var _this$state = this.state,
|
|
202
214
|
query = _this$state.query,
|
|
203
215
|
queryText = _this$state.queryText,
|
|
204
|
-
error = _this$state.error
|
|
216
|
+
error = _this$state.error,
|
|
217
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
205
218
|
var _this$props = this.props,
|
|
206
219
|
_this$props$box = _this$props.box;
|
|
207
220
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -212,7 +225,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
212
225
|
box = _objectWithoutProperties(_this$props$box, _excluded),
|
|
213
226
|
filters = _this$props.filters,
|
|
214
227
|
toolsLeft = _this$props.toolsLeft,
|
|
215
|
-
toolsRight = _this$props.toolsRight
|
|
228
|
+
toolsRight = _this$props.toolsRight,
|
|
229
|
+
hint = _this$props.hint;
|
|
216
230
|
|
|
217
231
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
218
232
|
var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
|
|
@@ -224,6 +238,7 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
224
238
|
onChange: this.onFiltersChange
|
|
225
239
|
}));
|
|
226
240
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
241
|
+
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;
|
|
227
242
|
return ___EmotionJSX(EuiFlexGroup, {
|
|
228
243
|
gutterSize: "m",
|
|
229
244
|
alignItems: "center",
|
|
@@ -235,7 +250,17 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
235
250
|
query: queryText,
|
|
236
251
|
onSearch: this.onSearch,
|
|
237
252
|
isInvalid: error != null,
|
|
238
|
-
title: error ? error.message : undefined
|
|
253
|
+
title: error ? error.message : undefined,
|
|
254
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
255
|
+
hint: hint ? _objectSpread({
|
|
256
|
+
isVisible: isHintVisible,
|
|
257
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
258
|
+
_this2.setState({
|
|
259
|
+
isHintVisible: isVisible
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
id: this.hintId
|
|
263
|
+
}, hint) : undefined
|
|
239
264
|
}))), filtersBar, toolsRightEl);
|
|
240
265
|
}
|
|
241
266
|
}], [{
|
|
@@ -246,7 +271,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
246
271
|
return {
|
|
247
272
|
query: query,
|
|
248
273
|
queryText: query.text,
|
|
249
|
-
error: null
|
|
274
|
+
error: null,
|
|
275
|
+
isHintVisible: prevState.isHintVisible
|
|
250
276
|
};
|
|
251
277
|
}
|
|
252
278
|
|
|
@@ -432,6 +458,14 @@ EuiSearchBar.propTypes = {
|
|
|
432
458
|
* Date formatter to use when parsing date values
|
|
433
459
|
*/
|
|
434
460
|
dateFormat: PropTypes.any,
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Hint to render below the search bar
|
|
464
|
+
*/
|
|
465
|
+
hint: PropTypes.shape({
|
|
466
|
+
content: PropTypes.node.isRequired,
|
|
467
|
+
popoverProps: PropTypes.any
|
|
468
|
+
}),
|
|
435
469
|
className: PropTypes.string,
|
|
436
470
|
"aria-label": PropTypes.string,
|
|
437
471
|
"data-test-subj": PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
var _excluded = ["query", "incremental"];
|
|
3
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
4
4
|
|
|
5
5
|
function _extends() { _extends = Object.assign || 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); }
|
|
6
6
|
|
|
@@ -40,6 +40,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
40
40
|
import React, { Component } from 'react';
|
|
41
41
|
import PropTypes from "prop-types";
|
|
42
42
|
import { EuiFieldSearch } from '../form';
|
|
43
|
+
import { EuiInputPopover } from '../popover';
|
|
43
44
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
44
45
|
export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
45
46
|
_inherits(EuiSearchBox, _Component);
|
|
@@ -78,6 +79,7 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
var _this$props = this.props,
|
|
79
80
|
query = _this$props.query,
|
|
80
81
|
incremental = _this$props.incremental,
|
|
82
|
+
hint = _this$props.hint,
|
|
81
83
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
82
84
|
|
|
83
85
|
var ariaLabel;
|
|
@@ -88,15 +90,39 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
88
90
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
var search = ___EmotionJSX(EuiFieldSearch, _extends({
|
|
92
94
|
inputRef: function inputRef(input) {
|
|
93
95
|
return _this2.inputElement = input;
|
|
94
96
|
},
|
|
95
97
|
fullWidth: true,
|
|
96
98
|
defaultValue: query,
|
|
97
99
|
incremental: incremental,
|
|
98
|
-
"aria-label": ariaLabel
|
|
100
|
+
"aria-label": ariaLabel,
|
|
101
|
+
onFocus: function onFocus() {
|
|
102
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
103
|
+
}
|
|
99
104
|
}, rest));
|
|
105
|
+
|
|
106
|
+
if (hint) {
|
|
107
|
+
return ___EmotionJSX(EuiInputPopover, _extends({
|
|
108
|
+
disableFocusTrap: true,
|
|
109
|
+
input: search,
|
|
110
|
+
isOpen: hint.isVisible,
|
|
111
|
+
fullWidth: true,
|
|
112
|
+
closePopover: function closePopover() {
|
|
113
|
+
hint.setIsVisible(false);
|
|
114
|
+
},
|
|
115
|
+
panelProps: {
|
|
116
|
+
'aria-live': undefined,
|
|
117
|
+
'aria-modal': undefined,
|
|
118
|
+
role: undefined,
|
|
119
|
+
tabIndex: -1,
|
|
120
|
+
id: hint.id
|
|
121
|
+
}
|
|
122
|
+
}, hint.popoverProps), hint.content);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return search;
|
|
100
126
|
}
|
|
101
127
|
}]);
|
|
102
128
|
|
|
@@ -111,5 +137,12 @@ _defineProperty(EuiSearchBox, "defaultProps", {
|
|
|
111
137
|
EuiSearchBox.propTypes = {
|
|
112
138
|
query: PropTypes.string.isRequired,
|
|
113
139
|
// This is optional in EuiFieldSearchProps
|
|
114
|
-
onSearch: PropTypes.func.isRequired
|
|
140
|
+
onSearch: PropTypes.func.isRequired,
|
|
141
|
+
hint: PropTypes.shape({
|
|
142
|
+
id: PropTypes.string.isRequired,
|
|
143
|
+
isVisible: PropTypes.bool.isRequired,
|
|
144
|
+
setIsVisible: PropTypes.func.isRequired,
|
|
145
|
+
content: PropTypes.node.isRequired,
|
|
146
|
+
popoverProps: PropTypes.any
|
|
147
|
+
})
|
|
115
148
|
};
|