@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
|
@@ -66,7 +66,7 @@ var _popover2 = require("./popover.styles");
|
|
|
66
66
|
|
|
67
67
|
var _popover_panel = require("./popover_panel");
|
|
68
68
|
|
|
69
|
-
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"];
|
|
69
|
+
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"];
|
|
70
70
|
|
|
71
71
|
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); }
|
|
72
72
|
|
|
@@ -403,7 +403,8 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
403
403
|
}, {
|
|
404
404
|
key: "render",
|
|
405
405
|
value: function render() {
|
|
406
|
-
var
|
|
406
|
+
var _panelProps$tabIndex,
|
|
407
|
+
_this4 = this;
|
|
407
408
|
|
|
408
409
|
var _this$props = this.props,
|
|
409
410
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -426,6 +427,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
426
427
|
hasArrow = _this$props.hasArrow,
|
|
427
428
|
arrowChildren = _this$props.arrowChildren,
|
|
428
429
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
430
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
429
431
|
zIndex = _this$props.zIndex,
|
|
430
432
|
attachToAnchor = _this$props.attachToAnchor,
|
|
431
433
|
display = _this$props.display,
|
|
@@ -438,8 +440,9 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
438
440
|
container = _this$props.container,
|
|
439
441
|
focusTrapProps = _this$props.focusTrapProps,
|
|
440
442
|
initialFocusProp = _this$props.initialFocus,
|
|
441
|
-
|
|
443
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
442
444
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
445
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
443
446
|
var styles = (0, _popover2.euiPopoverStyles)();
|
|
444
447
|
var popoverStyles = [styles.euiPopover, {
|
|
445
448
|
display: display
|
|
@@ -503,6 +506,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
503
506
|
position: this.state.arrowPosition,
|
|
504
507
|
isAttached: attachToAnchor,
|
|
505
508
|
className: (0, _classnames.default)(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
509
|
+
hasDragDrop: hasDragDrop,
|
|
506
510
|
hasShadow: false,
|
|
507
511
|
paddingSize: panelPaddingSize,
|
|
508
512
|
tabIndex: tabIndex,
|
|
@@ -720,6 +724,12 @@ EuiPopover.propTypes = {
|
|
|
720
724
|
*/
|
|
721
725
|
repositionOnScroll: _propTypes.default.bool,
|
|
722
726
|
|
|
727
|
+
/**
|
|
728
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
729
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
730
|
+
*/
|
|
731
|
+
hasDragDrop: _propTypes.default.bool,
|
|
732
|
+
|
|
723
733
|
/**
|
|
724
734
|
* By default, popover content inherits the z-index of the anchor
|
|
725
735
|
* component; pass `zIndex` to override
|
|
@@ -33,6 +33,7 @@ var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
33
33
|
var styles = (0, _popover_arrow.euiPopoverArrowStyles)(euiTheme);
|
|
34
34
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
35
35
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
36
|
+
className: "euiPopover__arrow",
|
|
36
37
|
"data-popover-arrow": position,
|
|
37
38
|
css: cssStyles
|
|
38
39
|
}, rest), children);
|
|
@@ -29,7 +29,7 @@ var _popover_panel = require("./_popover_panel.styles");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
32
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
@@ -49,6 +49,7 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
49
49
|
className = _ref.className,
|
|
50
50
|
isOpen = _ref.isOpen,
|
|
51
51
|
isAttached = _ref.isAttached,
|
|
52
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
52
53
|
position = _ref.position,
|
|
53
54
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
54
55
|
var panelContext = (0, _react.useContext)(EuiPopoverPanelContext);
|
|
@@ -63,6 +64,10 @@ var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
63
64
|
panelCSS = [].concat((0, _toConsumableArray2.default)(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
if (hasDragDrop) {
|
|
68
|
+
panelCSS = [].concat((0, _toConsumableArray2.default)(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
return (0, _react2.jsx)(EuiPopoverPanelContext.Provider, {
|
|
67
72
|
value: panelContext
|
|
68
73
|
}, (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
|
|
@@ -116,5 +121,6 @@ EuiPopoverPanel.propTypes = {
|
|
|
116
121
|
css: _propTypes.default.any,
|
|
117
122
|
isOpen: _propTypes.default.bool,
|
|
118
123
|
isAttached: _propTypes.default.bool,
|
|
119
|
-
position: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([null])])
|
|
124
|
+
position: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([null])]),
|
|
125
|
+
hasDragDrop: _propTypes.default.bool
|
|
120
126
|
};
|
|
@@ -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]);
|
|
@@ -45,6 +45,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
45
45
|
|
|
46
46
|
var _react = _interopRequireWildcard(require("react"));
|
|
47
47
|
|
|
48
|
+
var _accessibility = require("../../services/accessibility");
|
|
49
|
+
|
|
48
50
|
var _predicate = require("../../services/predicate");
|
|
49
51
|
|
|
50
52
|
var _flex = require("../flex");
|
|
@@ -63,6 +65,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
63
65
|
|
|
64
66
|
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; }
|
|
65
67
|
|
|
68
|
+
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; }
|
|
69
|
+
|
|
70
|
+
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; }
|
|
71
|
+
|
|
66
72
|
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); }; }
|
|
67
73
|
|
|
68
74
|
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; } }
|
|
@@ -97,6 +103,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
97
103
|
|
|
98
104
|
(0, _classCallCheck2.default)(this, EuiSearchBar);
|
|
99
105
|
_this = _super.call(this, props);
|
|
106
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hintId", (0, _accessibility.htmlIdGenerator)('__hint')());
|
|
100
107
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSearch", function (queryText) {
|
|
101
108
|
try {
|
|
102
109
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -152,7 +159,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
152
159
|
_this.state = {
|
|
153
160
|
query: _query,
|
|
154
161
|
queryText: _query.text,
|
|
155
|
-
error: null
|
|
162
|
+
error: null,
|
|
163
|
+
isHintVisible: false
|
|
156
164
|
};
|
|
157
165
|
return _this;
|
|
158
166
|
}
|
|
@@ -214,10 +222,15 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
214
222
|
}, {
|
|
215
223
|
key: "render",
|
|
216
224
|
value: function render() {
|
|
225
|
+
var _hint$popoverProps$is,
|
|
226
|
+
_hint$popoverProps,
|
|
227
|
+
_this2 = this;
|
|
228
|
+
|
|
217
229
|
var _this$state = this.state,
|
|
218
230
|
query = _this$state.query,
|
|
219
231
|
queryText = _this$state.queryText,
|
|
220
|
-
error = _this$state.error
|
|
232
|
+
error = _this$state.error,
|
|
233
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
221
234
|
var _this$props = this.props,
|
|
222
235
|
_this$props$box = _this$props.box;
|
|
223
236
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -227,7 +240,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
227
240
|
box = (0, _objectWithoutProperties2.default)(_this$props$box, _excluded),
|
|
228
241
|
filters = _this$props.filters,
|
|
229
242
|
toolsLeft = _this$props.toolsLeft,
|
|
230
|
-
toolsRight = _this$props.toolsRight
|
|
243
|
+
toolsRight = _this$props.toolsRight,
|
|
244
|
+
hint = _this$props.hint;
|
|
231
245
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
232
246
|
var filtersBar = !filters ? undefined : (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
233
247
|
className: "euiSearchBar__filtersHolder",
|
|
@@ -238,6 +252,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
238
252
|
onChange: this.onFiltersChange
|
|
239
253
|
}));
|
|
240
254
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
255
|
+
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;
|
|
241
256
|
return (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
242
257
|
gutterSize: "m",
|
|
243
258
|
alignItems: "center",
|
|
@@ -249,7 +264,17 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
249
264
|
query: queryText,
|
|
250
265
|
onSearch: this.onSearch,
|
|
251
266
|
isInvalid: error != null,
|
|
252
|
-
title: error ? error.message : undefined
|
|
267
|
+
title: error ? error.message : undefined,
|
|
268
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
269
|
+
hint: hint ? _objectSpread({
|
|
270
|
+
isVisible: isHintVisible,
|
|
271
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
272
|
+
_this2.setState({
|
|
273
|
+
isHintVisible: isVisible
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
id: this.hintId
|
|
277
|
+
}, hint) : undefined
|
|
253
278
|
}))), filtersBar, toolsRightEl);
|
|
254
279
|
}
|
|
255
280
|
}], [{
|
|
@@ -260,7 +285,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
260
285
|
return {
|
|
261
286
|
query: query,
|
|
262
287
|
queryText: query.text,
|
|
263
|
-
error: null
|
|
288
|
+
error: null,
|
|
289
|
+
isHintVisible: prevState.isHintVisible
|
|
264
290
|
};
|
|
265
291
|
}
|
|
266
292
|
|
|
@@ -445,6 +471,14 @@ EuiSearchBar.propTypes = {
|
|
|
445
471
|
* Date formatter to use when parsing date values
|
|
446
472
|
*/
|
|
447
473
|
dateFormat: _propTypes.default.any,
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Hint to render below the search bar
|
|
477
|
+
*/
|
|
478
|
+
hint: _propTypes.default.shape({
|
|
479
|
+
content: _propTypes.default.node.isRequired,
|
|
480
|
+
popoverProps: _propTypes.default.any
|
|
481
|
+
}),
|
|
448
482
|
className: _propTypes.default.string,
|
|
449
483
|
"aria-label": _propTypes.default.string,
|
|
450
484
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -33,9 +33,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
33
33
|
|
|
34
34
|
var _form = require("../form");
|
|
35
35
|
|
|
36
|
+
var _popover = require("../popover");
|
|
37
|
+
|
|
36
38
|
var _react2 = require("@emotion/react");
|
|
37
39
|
|
|
38
|
-
var _excluded = ["query", "incremental"];
|
|
40
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
39
41
|
|
|
40
42
|
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); }
|
|
41
43
|
|
|
@@ -80,6 +82,7 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
80
82
|
var _this$props = this.props,
|
|
81
83
|
query = _this$props.query,
|
|
82
84
|
incremental = _this$props.incremental,
|
|
85
|
+
hint = _this$props.hint,
|
|
83
86
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
84
87
|
var ariaLabel;
|
|
85
88
|
|
|
@@ -89,15 +92,39 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
89
92
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
var search = (0, _react2.jsx)(_form.EuiFieldSearch, (0, _extends2.default)({
|
|
93
96
|
inputRef: function inputRef(input) {
|
|
94
97
|
return _this2.inputElement = input;
|
|
95
98
|
},
|
|
96
99
|
fullWidth: true,
|
|
97
100
|
defaultValue: query,
|
|
98
101
|
incremental: incremental,
|
|
99
|
-
"aria-label": ariaLabel
|
|
102
|
+
"aria-label": ariaLabel,
|
|
103
|
+
onFocus: function onFocus() {
|
|
104
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
105
|
+
}
|
|
100
106
|
}, rest));
|
|
107
|
+
|
|
108
|
+
if (hint) {
|
|
109
|
+
return (0, _react2.jsx)(_popover.EuiInputPopover, (0, _extends2.default)({
|
|
110
|
+
disableFocusTrap: true,
|
|
111
|
+
input: search,
|
|
112
|
+
isOpen: hint.isVisible,
|
|
113
|
+
fullWidth: true,
|
|
114
|
+
closePopover: function closePopover() {
|
|
115
|
+
hint.setIsVisible(false);
|
|
116
|
+
},
|
|
117
|
+
panelProps: {
|
|
118
|
+
'aria-live': undefined,
|
|
119
|
+
'aria-modal': undefined,
|
|
120
|
+
role: undefined,
|
|
121
|
+
tabIndex: -1,
|
|
122
|
+
id: hint.id
|
|
123
|
+
}
|
|
124
|
+
}, hint.popoverProps), hint.content);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return search;
|
|
101
128
|
}
|
|
102
129
|
}]);
|
|
103
130
|
return EuiSearchBox;
|
|
@@ -111,5 +138,12 @@ exports.EuiSearchBox = EuiSearchBox;
|
|
|
111
138
|
EuiSearchBox.propTypes = {
|
|
112
139
|
query: _propTypes.default.string.isRequired,
|
|
113
140
|
// This is optional in EuiFieldSearchProps
|
|
114
|
-
onSearch: _propTypes.default.func.isRequired
|
|
141
|
+
onSearch: _propTypes.default.func.isRequired,
|
|
142
|
+
hint: _propTypes.default.shape({
|
|
143
|
+
id: _propTypes.default.string.isRequired,
|
|
144
|
+
isVisible: _propTypes.default.bool.isRequired,
|
|
145
|
+
setIsVisible: _propTypes.default.func.isRequired,
|
|
146
|
+
content: _propTypes.default.node.isRequired,
|
|
147
|
+
popoverProps: _propTypes.default.any
|
|
148
|
+
})
|
|
115
149
|
};
|
|
@@ -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;"),
|
|
@@ -45,7 +45,7 @@ var _tour = require("./tour.styles");
|
|
|
45
45
|
|
|
46
46
|
var _react2 = require("@emotion/react");
|
|
47
47
|
|
|
48
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
48
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
49
49
|
|
|
50
50
|
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); }
|
|
51
51
|
|
|
@@ -61,6 +61,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
61
61
|
anchor = _ref.anchor,
|
|
62
62
|
children = _ref.children,
|
|
63
63
|
className = _ref.className,
|
|
64
|
+
css = _ref.css,
|
|
64
65
|
_ref$closePopover = _ref.closePopover,
|
|
65
66
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
66
67
|
content = _ref.content,
|
|
@@ -80,6 +81,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
80
81
|
_ref$decoration = _ref.decoration,
|
|
81
82
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
82
83
|
footerAction = _ref.footerAction,
|
|
84
|
+
panelProps = _ref.panelProps,
|
|
83
85
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
84
86
|
var titleId = (0, _services.useGeneratedHtmlId)();
|
|
85
87
|
|
|
@@ -122,7 +124,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
122
124
|
var headerStyles = (0, _tour.euiTourHeaderStyles)(euiTheme);
|
|
123
125
|
var footerStyles = (0, _tour.euiTourFooterStyles)(euiTheme);
|
|
124
126
|
var beaconStyles = (0, _tour.euiTourBeaconStyles)(euiTheme);
|
|
125
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
127
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
126
128
|
var finishButtonProps = {
|
|
127
129
|
color: 'text',
|
|
128
130
|
flush: 'right',
|
|
@@ -181,9 +183,9 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
181
183
|
ownFocus: false,
|
|
182
184
|
panelClassName: classes,
|
|
183
185
|
panelStyle: style,
|
|
184
|
-
panelProps: {
|
|
185
|
-
css: tourStyles.euiTour
|
|
186
|
-
},
|
|
186
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
187
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
188
|
+
}),
|
|
187
189
|
offset: hasBeacon ? 10 : 0,
|
|
188
190
|
'aria-labelledby': titleId,
|
|
189
191
|
arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
|