@elastic/eui 67.1.5 → 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_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/button/button_display/_button_display.js +7 -6
- package/es/components/button/button_display/_button_display_content.js +6 -9
- package/es/components/button/button_display/_button_display_content.styles.js +3 -41
- 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/loading/loading_spinner.js +14 -3
- package/es/components/loading/loading_spinner.styles.js +11 -7
- 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 +44 -13
- 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/button/button_display/_button_display.js +7 -6
- package/lib/components/button/button_display/_button_display_content.js +6 -9
- package/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- 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/loading/loading_spinner.js +13 -2
- package/lib/components/loading/loading_spinner.styles.js +14 -6
- 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/button/button_display/_button_display.js +6 -5
- package/optimize/es/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +3 -41
- 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/loading/loading_spinner.js +13 -3
- package/optimize/es/components/loading/loading_spinner.styles.js +11 -7
- 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/button/button_display/_button_display.js +7 -6
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- 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/loading/loading_spinner.js +14 -2
- package/optimize/lib/components/loading/loading_spinner.styles.js +14 -6
- 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/button/button_display/_button_display.js +7 -6
- package/test-env/components/button/button_display/_button_display_content.js +6 -9
- package/test-env/components/button/button_display/_button_display_content.styles.js +10 -40
- 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/loading/loading_spinner.js +14 -2
- package/test-env/components/loading/loading_spinner.styles.js +14 -6
- 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
|
@@ -9,48 +9,18 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
|
|
10
10
|
var _global_styling = require("../../../global_styling");
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
24
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
25
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
|
|
26
|
-
} : {
|
|
27
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
28
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;",
|
|
29
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
33
|
-
name: "qfl6yj-right",
|
|
34
|
-
styles: "flex-direction:row-reverse;label:right;"
|
|
35
|
-
} : {
|
|
36
|
-
name: "qfl6yj-right",
|
|
37
|
-
styles: "flex-direction:row-reverse;label:right;",
|
|
38
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4) {
|
|
42
|
-
var euiTheme = _ref4.euiTheme;
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref) {
|
|
20
|
+
var euiTheme = _ref.euiTheme;
|
|
43
21
|
return {
|
|
44
22
|
// Base
|
|
45
|
-
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
46
|
-
// Icon side
|
|
47
|
-
left: /*#__PURE__*/(0, _react.css)(";label:left;"),
|
|
48
|
-
right: _ref3,
|
|
49
|
-
euiButtonDisplayContent__spinner: _ref2,
|
|
50
|
-
euiButtonDisplayContent__icon: _ref,
|
|
51
|
-
// Icon size
|
|
52
|
-
s: /*#__PURE__*/(0, _react.css)(";label:s;"),
|
|
53
|
-
m: /*#__PURE__*/(0, _react.css)(";label:m;")
|
|
23
|
+
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
54
24
|
};
|
|
55
25
|
};
|
|
56
26
|
|
|
@@ -138,7 +138,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
138
138
|
},
|
|
139
139
|
anchorPosition: "downLeft",
|
|
140
140
|
panelPaddingSize: "s",
|
|
141
|
-
|
|
141
|
+
hasDragDrop: true,
|
|
142
142
|
button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
143
143
|
size: "xs",
|
|
144
144
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -150,7 +150,7 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
|
|
|
150
150
|
},
|
|
151
151
|
anchorPosition: "downLeft",
|
|
152
152
|
panelPaddingSize: "s",
|
|
153
|
-
|
|
153
|
+
hasDragDrop: true,
|
|
154
154
|
button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
155
155
|
size: "xs",
|
|
156
156
|
iconType: "sortable",
|
|
@@ -9,6 +9,8 @@ exports.SIZES = exports.EuiLoadingSpinner = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
12
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
15
|
|
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -23,7 +25,12 @@ var _loading_spinner = require("./loading_spinner.styles");
|
|
|
23
25
|
|
|
24
26
|
var _react2 = require("@emotion/react");
|
|
25
27
|
|
|
26
|
-
var _excluded = ["size", "className", "aria-label", "color"];
|
|
28
|
+
var _excluded = ["size", "className", "aria-label", "color", "style"];
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
33
|
+
|
|
27
34
|
var SIZES = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
28
35
|
exports.SIZES = SIZES;
|
|
29
36
|
|
|
@@ -33,15 +40,20 @@ var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
|
33
40
|
className = _ref.className,
|
|
34
41
|
ariaLabel = _ref['aria-label'],
|
|
35
42
|
color = _ref.color,
|
|
43
|
+
style = _ref.style,
|
|
36
44
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
37
45
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
38
|
-
var styles = (0, _loading_spinner.euiLoadingSpinnerStyles)(euiTheme
|
|
46
|
+
var styles = (0, _loading_spinner.euiLoadingSpinnerStyles)(euiTheme);
|
|
39
47
|
var cssStyles = [styles.euiLoadingSpinner, styles[size]];
|
|
40
48
|
var classes = (0, _classnames.default)('euiLoadingSpinner', className);
|
|
41
49
|
var defaultLabel = (0, _loading_strings.useLoadingAriaLabel)();
|
|
50
|
+
var customColorStyle = color ? _objectSpread(_objectSpread({}, style), {}, {
|
|
51
|
+
borderColor: (0, _loading_spinner.euiSpinnerBorderColorsCSS)(euiTheme, color)
|
|
52
|
+
}) : style;
|
|
42
53
|
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
43
54
|
className: classes,
|
|
44
55
|
css: cssStyles,
|
|
56
|
+
style: customColorStyle,
|
|
45
57
|
role: "progressbar",
|
|
46
58
|
"aria-label": ariaLabel || defaultLabel
|
|
47
59
|
}, rest));
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.euiLoadingSpinnerStyles = void 0;
|
|
8
|
+
exports.euiSpinnerBorderColorsCSS = exports.euiLoadingSpinnerStyles = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -25,14 +25,22 @@ var spinnerSizes = {
|
|
|
25
25
|
xxl: 'xxl'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
28
|
+
var euiSpinnerBorderColorsCSS = function euiSpinnerBorderColorsCSS(_ref) {
|
|
29
|
+
var euiTheme = _ref.euiTheme;
|
|
30
|
+
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31
|
+
var _colors$border = colors.border,
|
|
32
|
+
border = _colors$border === void 0 ? euiTheme.colors.lightShade : _colors$border,
|
|
33
|
+
_colors$highlight = colors.highlight,
|
|
34
|
+
highlight = _colors$highlight === void 0 ? euiTheme.colors.primary : _colors$highlight;
|
|
35
|
+
return "".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border);
|
|
30
36
|
};
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
exports.euiSpinnerBorderColorsCSS = euiSpinnerBorderColorsCSS;
|
|
39
|
+
|
|
40
|
+
var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(euiThemeContext) {
|
|
41
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
34
42
|
return {
|
|
35
|
-
euiLoadingSpinner: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";
|
|
43
|
+
euiLoadingSpinner: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", euiSpinnerBorderColorsCSS(euiThemeContext), ";", _global_styling.euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
|
|
36
44
|
// Sizes
|
|
37
45
|
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size[spinnerSizes.s], euiTheme.size[spinnerSizes.s]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
|
|
38
46
|
m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size[spinnerSizes.m], euiTheme.size[spinnerSizes.m]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -13,7 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
15
|
|
|
14
16
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
17
|
|
|
16
|
-
var _react =
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
19
|
|
|
18
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
21
|
|
|
@@ -31,6 +33,10 @@ var _react2 = require("@emotion/react");
|
|
|
31
33
|
|
|
32
34
|
var _excluded = ["className", "children", "initialFocus", "onClose", "maxWidth", "style"];
|
|
33
35
|
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
+
|
|
34
40
|
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; }
|
|
35
41
|
|
|
36
42
|
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) { (0, _defineProperty2.default)(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; }
|
|
@@ -44,6 +50,18 @@ var EuiModal = function EuiModal(_ref) {
|
|
|
44
50
|
maxWidth = _ref$maxWidth === void 0 ? true : _ref$maxWidth,
|
|
45
51
|
style = _ref.style,
|
|
46
52
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
54
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
55
|
+
var bodyScrollTop = (0, _react.useRef)(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
56
|
+
);
|
|
57
|
+
var onFocus = (0, _react.useCallback)(function () {
|
|
58
|
+
if (bodyScrollTop.current != null) {
|
|
59
|
+
window.scrollTo({
|
|
60
|
+
top: bodyScrollTop.current
|
|
61
|
+
});
|
|
62
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
63
|
+
}
|
|
64
|
+
}, []);
|
|
47
65
|
|
|
48
66
|
var onKeyDown = function onKeyDown(event) {
|
|
49
67
|
if (event.key === _services.keys.ESCAPE) {
|
|
@@ -67,11 +85,13 @@ var EuiModal = function EuiModal(_ref) {
|
|
|
67
85
|
|
|
68
86
|
var classes = (0, _classnames.default)('euiModal', widthClassName, className);
|
|
69
87
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
70
|
-
initialFocus: initialFocus
|
|
88
|
+
initialFocus: initialFocus,
|
|
89
|
+
scrollLock: true
|
|
71
90
|
}, (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
72
91
|
className: classes,
|
|
73
92
|
onKeyDown: onKeyDown,
|
|
74
93
|
tabIndex: 0,
|
|
94
|
+
onFocus: onFocus,
|
|
75
95
|
style: newStyle || style
|
|
76
96
|
}, rest), (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
77
97
|
token: "euiModal.closeModal",
|
|
@@ -155,15 +155,12 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
155
155
|
_react.default.Children.toArray(children).forEach(function (child, index) {
|
|
156
156
|
if (! /*#__PURE__*/_react.default.isValidElement(child)) return; // Skip non-components
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
sidebar.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
default:
|
|
166
|
-
sections.push(child);
|
|
158
|
+
if (child.type === _page.EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === _page.EuiPageSidebar) {
|
|
159
|
+
sidebar.push( /*#__PURE__*/_react.default.cloneElement(child, _objectSpread(_objectSpread({
|
|
160
|
+
key: "sidebar".concat(index)
|
|
161
|
+
}, getSideBarProps()), child.props)));
|
|
162
|
+
} else {
|
|
163
|
+
sections.push(child);
|
|
167
164
|
}
|
|
168
165
|
});
|
|
169
166
|
|
|
@@ -64,7 +64,7 @@ var _popover2 = require("./popover.styles");
|
|
|
64
64
|
|
|
65
65
|
var _popover_panel = require("./popover_panel");
|
|
66
66
|
|
|
67
|
-
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"];
|
|
67
|
+
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"];
|
|
68
68
|
|
|
69
69
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
70
70
|
|
|
@@ -401,7 +401,8 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
401
401
|
}, {
|
|
402
402
|
key: "render",
|
|
403
403
|
value: function render() {
|
|
404
|
-
var
|
|
404
|
+
var _panelProps$tabIndex,
|
|
405
|
+
_this4 = this;
|
|
405
406
|
|
|
406
407
|
var _this$props = this.props,
|
|
407
408
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -424,6 +425,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
424
425
|
hasArrow = _this$props.hasArrow,
|
|
425
426
|
arrowChildren = _this$props.arrowChildren,
|
|
426
427
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
428
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
427
429
|
zIndex = _this$props.zIndex,
|
|
428
430
|
attachToAnchor = _this$props.attachToAnchor,
|
|
429
431
|
display = _this$props.display,
|
|
@@ -436,8 +438,9 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
436
438
|
container = _this$props.container,
|
|
437
439
|
focusTrapProps = _this$props.focusTrapProps,
|
|
438
440
|
initialFocusProp = _this$props.initialFocus,
|
|
439
|
-
|
|
441
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
440
442
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
443
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
441
444
|
var styles = (0, _popover2.euiPopoverStyles)();
|
|
442
445
|
var popoverStyles = [styles.euiPopover, {
|
|
443
446
|
display: display
|
|
@@ -501,6 +504,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
501
504
|
position: this.state.arrowPosition,
|
|
502
505
|
isAttached: attachToAnchor,
|
|
503
506
|
className: (0, _classnames.default)(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
507
|
+
hasDragDrop: hasDragDrop,
|
|
504
508
|
hasShadow: false,
|
|
505
509
|
paddingSize: panelPaddingSize,
|
|
506
510
|
tabIndex: tabIndex,
|
|
@@ -31,6 +31,7 @@ var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
31
31
|
var styles = (0, _popover_arrow.euiPopoverArrowStyles)(euiTheme);
|
|
32
32
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
33
33
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
34
|
+
className: "euiPopover__arrow",
|
|
34
35
|
"data-popover-arrow": position,
|
|
35
36
|
css: cssStyles
|
|
36
37
|
}, rest), children);
|
|
@@ -27,7 +27,7 @@ var _popover_panel = require("./_popover_panel.styles");
|
|
|
27
27
|
|
|
28
28
|
var _react2 = require("@emotion/react");
|
|
29
29
|
|
|
30
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
30
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
31
31
|
|
|
32
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
33
|
|
|
@@ -47,6 +47,7 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
47
47
|
className = _ref.className,
|
|
48
48
|
isOpen = _ref.isOpen,
|
|
49
49
|
isAttached = _ref.isAttached,
|
|
50
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
50
51
|
position = _ref.position,
|
|
51
52
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
52
53
|
var panelContext = (0, _react.useContext)(EuiPopoverPanelContext);
|
|
@@ -61,6 +62,10 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
61
62
|
panelCSS = [].concat((0, _toConsumableArray2.default)(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
if (hasDragDrop) {
|
|
66
|
+
panelCSS = [].concat((0, _toConsumableArray2.default)(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
67
|
+
}
|
|
68
|
+
|
|
64
69
|
return (0, _react2.jsx)(EuiPopoverPanelContext.Provider, {
|
|
65
70
|
value: panelContext
|
|
66
71
|
}, (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
|
|
@@ -9,6 +9,8 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
|
|
10
10
|
var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
|
|
11
11
|
|
|
12
|
+
var _functions = require("../../../themes/amsterdam/global_styling/functions");
|
|
13
|
+
|
|
12
14
|
var _global_styling = require("../../../global_styling");
|
|
13
15
|
|
|
14
16
|
/*
|
|
@@ -28,7 +30,8 @@ var translateDistance = 's';
|
|
|
28
30
|
*/
|
|
29
31
|
|
|
30
32
|
var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
31
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
33
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
34
|
+
colorMode = euiThemeContext.colorMode;
|
|
32
35
|
return {
|
|
33
36
|
// Base
|
|
34
37
|
euiPopover__panel: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('min-width', "".concat(euiTheme.base * 7, "px")), ";", (0, _global_styling.logicalCSS)('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", (0, _mixins.euiShadowMedium)(euiThemeContext, {
|
|
@@ -49,6 +52,18 @@ var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
|
49
52
|
// Satisfies TS
|
|
50
53
|
left: /*#__PURE__*/(0, _react.css)(";label:left;"),
|
|
51
54
|
right: /*#__PURE__*/(0, _react.css)(";label:right;")
|
|
55
|
+
},
|
|
56
|
+
// Overrides for drag & drop contexts within popovers. This is required because
|
|
57
|
+
// the fixed positions of drag and drop don't work inside of transformed elements
|
|
58
|
+
hasDragDrop: {
|
|
59
|
+
hasDragDrop: /*#__PURE__*/(0, _react.css)("transform:none;filter:none;", (0, _mixins.euiShadowMedium)(euiThemeContext, {
|
|
60
|
+
property: 'box-shadow'
|
|
61
|
+
}), ";;label:hasDragDrop;"),
|
|
62
|
+
// The offset transforms must be recreated in margins
|
|
63
|
+
top: /*#__PURE__*/(0, _react.css)("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
|
|
64
|
+
bottom: /*#__PURE__*/(0, _react.css)("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
|
|
65
|
+
left: /*#__PURE__*/(0, _react.css)("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
|
|
66
|
+
right: /*#__PURE__*/(0, _react.css)("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", (0, _functions.getShadowColor)(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
|
|
52
67
|
}
|
|
53
68
|
};
|
|
54
69
|
};
|
|
@@ -277,6 +277,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
277
277
|
return valuesEqual(item, value);
|
|
278
278
|
});
|
|
279
279
|
};
|
|
280
|
+
|
|
281
|
+
var mustToMatch = function mustToMatch(must) {
|
|
282
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
283
|
+
};
|
|
280
284
|
/**
|
|
281
285
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
282
286
|
*
|
|
@@ -397,9 +401,16 @@ var _AST = /*#__PURE__*/function () {
|
|
|
397
401
|
}
|
|
398
402
|
}, {
|
|
399
403
|
key: "getOrFieldClause",
|
|
400
|
-
value: function getOrFieldClause(field, value) {
|
|
404
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
401
405
|
return this.getFieldClause(field, function (clause) {
|
|
402
|
-
|
|
406
|
+
if (!(0, _predicate.isArray)(clause.value)) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
var matchValue = (0, _predicate.isNil)(value) || arrayIncludesValue(clause.value, value);
|
|
411
|
+
var matchMust = (0, _predicate.isNil)(must) || mustToMatch(must) === clause.match;
|
|
412
|
+
var matchOperator = (0, _predicate.isNil)(operator) || operator === clause.operator;
|
|
413
|
+
return matchValue && matchMust && matchOperator;
|
|
403
414
|
});
|
|
404
415
|
}
|
|
405
416
|
}, {
|
|
@@ -407,7 +418,7 @@ var _AST = /*#__PURE__*/function () {
|
|
|
407
418
|
value: function addOrFieldValue(field, value) {
|
|
408
419
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
409
420
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
410
|
-
var existingClause = this.getOrFieldClause(field);
|
|
421
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
411
422
|
|
|
412
423
|
if (!existingClause) {
|
|
413
424
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -43,6 +43,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
43
43
|
|
|
44
44
|
var _react = _interopRequireWildcard(require("react"));
|
|
45
45
|
|
|
46
|
+
var _accessibility = require("../../services/accessibility");
|
|
47
|
+
|
|
46
48
|
var _predicate = require("../../services/predicate");
|
|
47
49
|
|
|
48
50
|
var _flex = require("../flex");
|
|
@@ -61,6 +63,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
61
63
|
|
|
62
64
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
65
|
|
|
66
|
+
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; }
|
|
67
|
+
|
|
68
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
69
|
+
|
|
64
70
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
65
71
|
|
|
66
72
|
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; } }
|
|
@@ -95,6 +101,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
95
101
|
|
|
96
102
|
(0, _classCallCheck2.default)(this, EuiSearchBar);
|
|
97
103
|
_this = _super.call(this, props);
|
|
104
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hintId", (0, _accessibility.htmlIdGenerator)('__hint')());
|
|
98
105
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSearch", function (queryText) {
|
|
99
106
|
try {
|
|
100
107
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -150,7 +157,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
150
157
|
_this.state = {
|
|
151
158
|
query: _query,
|
|
152
159
|
queryText: _query.text,
|
|
153
|
-
error: null
|
|
160
|
+
error: null,
|
|
161
|
+
isHintVisible: false
|
|
154
162
|
};
|
|
155
163
|
return _this;
|
|
156
164
|
}
|
|
@@ -212,10 +220,15 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
212
220
|
}, {
|
|
213
221
|
key: "render",
|
|
214
222
|
value: function render() {
|
|
223
|
+
var _hint$popoverProps$is,
|
|
224
|
+
_hint$popoverProps,
|
|
225
|
+
_this2 = this;
|
|
226
|
+
|
|
215
227
|
var _this$state = this.state,
|
|
216
228
|
query = _this$state.query,
|
|
217
229
|
queryText = _this$state.queryText,
|
|
218
|
-
error = _this$state.error
|
|
230
|
+
error = _this$state.error,
|
|
231
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
219
232
|
var _this$props = this.props,
|
|
220
233
|
_this$props$box = _this$props.box;
|
|
221
234
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -225,7 +238,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
225
238
|
box = (0, _objectWithoutProperties2.default)(_this$props$box, _excluded),
|
|
226
239
|
filters = _this$props.filters,
|
|
227
240
|
toolsLeft = _this$props.toolsLeft,
|
|
228
|
-
toolsRight = _this$props.toolsRight
|
|
241
|
+
toolsRight = _this$props.toolsRight,
|
|
242
|
+
hint = _this$props.hint;
|
|
229
243
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
230
244
|
var filtersBar = !filters ? undefined : (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
231
245
|
className: "euiSearchBar__filtersHolder",
|
|
@@ -236,6 +250,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
236
250
|
onChange: this.onFiltersChange
|
|
237
251
|
}));
|
|
238
252
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
253
|
+
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;
|
|
239
254
|
return (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
240
255
|
gutterSize: "m",
|
|
241
256
|
alignItems: "center",
|
|
@@ -247,7 +262,17 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
247
262
|
query: queryText,
|
|
248
263
|
onSearch: this.onSearch,
|
|
249
264
|
isInvalid: error != null,
|
|
250
|
-
title: error ? error.message : undefined
|
|
265
|
+
title: error ? error.message : undefined,
|
|
266
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
267
|
+
hint: hint ? _objectSpread({
|
|
268
|
+
isVisible: isHintVisible,
|
|
269
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
270
|
+
_this2.setState({
|
|
271
|
+
isHintVisible: isVisible
|
|
272
|
+
});
|
|
273
|
+
},
|
|
274
|
+
id: this.hintId
|
|
275
|
+
}, hint) : undefined
|
|
251
276
|
}))), filtersBar, toolsRightEl);
|
|
252
277
|
}
|
|
253
278
|
}], [{
|
|
@@ -258,7 +283,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
258
283
|
return {
|
|
259
284
|
query: query,
|
|
260
285
|
queryText: query.text,
|
|
261
|
-
error: null
|
|
286
|
+
error: null,
|
|
287
|
+
isHintVisible: prevState.isHintVisible
|
|
262
288
|
};
|
|
263
289
|
}
|
|
264
290
|
|
|
@@ -31,9 +31,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
31
31
|
|
|
32
32
|
var _form = require("../form");
|
|
33
33
|
|
|
34
|
+
var _popover = require("../popover");
|
|
35
|
+
|
|
34
36
|
var _react2 = require("@emotion/react");
|
|
35
37
|
|
|
36
|
-
var _excluded = ["query", "incremental"];
|
|
38
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
37
39
|
|
|
38
40
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
41
|
|
|
@@ -78,6 +80,7 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
78
80
|
var _this$props = this.props,
|
|
79
81
|
query = _this$props.query,
|
|
80
82
|
incremental = _this$props.incremental,
|
|
83
|
+
hint = _this$props.hint,
|
|
81
84
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
82
85
|
var ariaLabel;
|
|
83
86
|
|
|
@@ -87,15 +90,39 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
87
90
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
88
91
|
}
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
var search = (0, _react2.jsx)(_form.EuiFieldSearch, (0, _extends2.default)({
|
|
91
94
|
inputRef: function inputRef(input) {
|
|
92
95
|
return _this2.inputElement = input;
|
|
93
96
|
},
|
|
94
97
|
fullWidth: true,
|
|
95
98
|
defaultValue: query,
|
|
96
99
|
incremental: incremental,
|
|
97
|
-
"aria-label": ariaLabel
|
|
100
|
+
"aria-label": ariaLabel,
|
|
101
|
+
onFocus: function onFocus() {
|
|
102
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
103
|
+
}
|
|
98
104
|
}, rest));
|
|
105
|
+
|
|
106
|
+
if (hint) {
|
|
107
|
+
return (0, _react2.jsx)(_popover.EuiInputPopover, (0, _extends2.default)({
|
|
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;
|
|
99
126
|
}
|
|
100
127
|
}]);
|
|
101
128
|
return EuiSearchBox;
|
|
@@ -31,7 +31,7 @@ var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
31
31
|
colorMode = _ref.colorMode;
|
|
32
32
|
return {
|
|
33
33
|
// Targets EuiPopoverPanel
|
|
34
|
-
euiTour: /*#__PURE__*/(0, _react.css)("
|
|
34
|
+
euiTour: /*#__PURE__*/(0, _react.css)("[data-popover-arrow='top']::before{", (0, _global_styling.logicalCSS)('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -48,7 +48,8 @@ var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
50
|
// Base
|
|
51
|
-
euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], "
|
|
51
|
+
euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;", _global_styling.euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
52
|
+
isOpen: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
52
53
|
// Positions
|
|
53
54
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
|
|
54
55
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
|