@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
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { euiShadow, euiShadowFlat, euiShadowMedium } from '../../../themes/amsterdam/global_styling/mixins';
|
|
10
|
+
import { getShadowColor } from '../../../themes/amsterdam/global_styling/functions';
|
|
10
11
|
import { euiCanAnimate, logicalCSS } from '../../../global_styling';
|
|
11
12
|
export var openAnimationTiming = 'slow';
|
|
12
13
|
var translateDistance = 's';
|
|
@@ -17,7 +18,8 @@ var translateDistance = 's';
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
20
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
21
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
22
|
+
colorMode = euiThemeContext.colorMode;
|
|
21
23
|
return {
|
|
22
24
|
// Base
|
|
23
25
|
euiPopover__panel: /*#__PURE__*/css("position:absolute;", logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), ";", logicalCSS('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", euiShadowMedium(euiThemeContext, {
|
|
@@ -38,6 +40,18 @@ export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContex
|
|
|
38
40
|
// Satisfies TS
|
|
39
41
|
left: /*#__PURE__*/css(";label:left;"),
|
|
40
42
|
right: /*#__PURE__*/css(";label:right;")
|
|
43
|
+
},
|
|
44
|
+
// Overrides for drag & drop contexts within popovers. This is required because
|
|
45
|
+
// the fixed positions of drag and drop don't work inside of transformed elements
|
|
46
|
+
hasDragDrop: {
|
|
47
|
+
hasDragDrop: /*#__PURE__*/css("transform:none;filter:none;", euiShadowMedium(euiThemeContext, {
|
|
48
|
+
property: 'box-shadow'
|
|
49
|
+
}), ";;label:hasDragDrop;"),
|
|
50
|
+
// The offset transforms must be recreated in margins
|
|
51
|
+
top: /*#__PURE__*/css("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
|
|
41
55
|
}
|
|
42
56
|
};
|
|
43
57
|
};
|
|
@@ -268,6 +268,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
268
268
|
return valuesEqual(item, value);
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
+
|
|
272
|
+
var mustToMatch = function mustToMatch(must) {
|
|
273
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
274
|
+
};
|
|
271
275
|
/**
|
|
272
276
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
273
277
|
*
|
|
@@ -392,9 +396,16 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
392
396
|
}
|
|
393
397
|
}, {
|
|
394
398
|
key: "getOrFieldClause",
|
|
395
|
-
value: function getOrFieldClause(field, value) {
|
|
399
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
396
400
|
return this.getFieldClause(field, function (clause) {
|
|
397
|
-
|
|
401
|
+
if (!isArray(clause.value)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var matchValue = isNil(value) || arrayIncludesValue(clause.value, value);
|
|
406
|
+
var matchMust = isNil(must) || mustToMatch(must) === clause.match;
|
|
407
|
+
var matchOperator = isNil(operator) || operator === clause.operator;
|
|
408
|
+
return matchValue && matchMust && matchOperator;
|
|
398
409
|
});
|
|
399
410
|
}
|
|
400
411
|
}, {
|
|
@@ -402,7 +413,7 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
402
413
|
value: function addOrFieldValue(field, value) {
|
|
403
414
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
404
415
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
405
|
-
var existingClause = this.getOrFieldClause(field);
|
|
416
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
406
417
|
|
|
407
418
|
if (!existingClause) {
|
|
408
419
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -10,6 +10,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
10
10
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
11
11
|
var _excluded = ["schema"];
|
|
12
12
|
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
|
+
|
|
13
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
18
|
|
|
15
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -22,6 +26,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
26
|
* Side Public License, v 1.
|
|
23
27
|
*/
|
|
24
28
|
import React, { Component } from 'react';
|
|
29
|
+
import { htmlIdGenerator } from '../../services/accessibility';
|
|
25
30
|
import { isString } from '../../services/predicate';
|
|
26
31
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
27
32
|
import { EuiSearchBox } from './search_box';
|
|
@@ -62,6 +67,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
62
67
|
|
|
63
68
|
_this = _super.call(this, props);
|
|
64
69
|
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "hintId", htmlIdGenerator('__hint')());
|
|
71
|
+
|
|
65
72
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
|
|
66
73
|
try {
|
|
67
74
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -118,7 +125,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
118
125
|
_this.state = {
|
|
119
126
|
query: _query,
|
|
120
127
|
queryText: _query.text,
|
|
121
|
-
error: null
|
|
128
|
+
error: null,
|
|
129
|
+
isHintVisible: false
|
|
122
130
|
};
|
|
123
131
|
return _this;
|
|
124
132
|
}
|
|
@@ -180,10 +188,15 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
180
188
|
}, {
|
|
181
189
|
key: "render",
|
|
182
190
|
value: function render() {
|
|
191
|
+
var _hint$popoverProps$is,
|
|
192
|
+
_hint$popoverProps,
|
|
193
|
+
_this2 = this;
|
|
194
|
+
|
|
183
195
|
var _this$state = this.state,
|
|
184
196
|
query = _this$state.query,
|
|
185
197
|
queryText = _this$state.queryText,
|
|
186
|
-
error = _this$state.error
|
|
198
|
+
error = _this$state.error,
|
|
199
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
187
200
|
var _this$props = this.props,
|
|
188
201
|
_this$props$box = _this$props.box;
|
|
189
202
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -194,7 +207,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
194
207
|
box = _objectWithoutProperties(_this$props$box, _excluded),
|
|
195
208
|
filters = _this$props.filters,
|
|
196
209
|
toolsLeft = _this$props.toolsLeft,
|
|
197
|
-
toolsRight = _this$props.toolsRight
|
|
210
|
+
toolsRight = _this$props.toolsRight,
|
|
211
|
+
hint = _this$props.hint;
|
|
198
212
|
|
|
199
213
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
200
214
|
var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
|
|
@@ -206,6 +220,7 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
206
220
|
onChange: this.onFiltersChange
|
|
207
221
|
}));
|
|
208
222
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
223
|
+
var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 ? void 0 : (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
|
|
209
224
|
return ___EmotionJSX(EuiFlexGroup, {
|
|
210
225
|
gutterSize: "m",
|
|
211
226
|
alignItems: "center",
|
|
@@ -217,7 +232,17 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
217
232
|
query: queryText,
|
|
218
233
|
onSearch: this.onSearch,
|
|
219
234
|
isInvalid: error != null,
|
|
220
|
-
title: error ? error.message : undefined
|
|
235
|
+
title: error ? error.message : undefined,
|
|
236
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
237
|
+
hint: hint ? _objectSpread({
|
|
238
|
+
isVisible: isHintVisible,
|
|
239
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
240
|
+
_this2.setState({
|
|
241
|
+
isHintVisible: isVisible
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
id: this.hintId
|
|
245
|
+
}, hint) : undefined
|
|
221
246
|
}))), filtersBar, toolsRightEl);
|
|
222
247
|
}
|
|
223
248
|
}], [{
|
|
@@ -228,7 +253,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
228
253
|
return {
|
|
229
254
|
query: query,
|
|
230
255
|
queryText: query.text,
|
|
231
|
-
error: null
|
|
256
|
+
error: null,
|
|
257
|
+
isHintVisible: prevState.isHintVisible
|
|
232
258
|
};
|
|
233
259
|
}
|
|
234
260
|
|
|
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["query", "incremental"];
|
|
10
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -22,6 +22,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
22
|
*/
|
|
23
23
|
import React, { Component } from 'react';
|
|
24
24
|
import { EuiFieldSearch } from '../form';
|
|
25
|
+
import { EuiInputPopover } from '../popover';
|
|
25
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
27
|
export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
27
28
|
_inherits(EuiSearchBox, _Component);
|
|
@@ -60,6 +61,7 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
60
61
|
var _this$props = this.props,
|
|
61
62
|
query = _this$props.query,
|
|
62
63
|
incremental = _this$props.incremental,
|
|
64
|
+
hint = _this$props.hint,
|
|
63
65
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
64
66
|
|
|
65
67
|
var ariaLabel;
|
|
@@ -70,15 +72,39 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
70
72
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
var search = ___EmotionJSX(EuiFieldSearch, _extends({
|
|
74
76
|
inputRef: function inputRef(input) {
|
|
75
77
|
return _this2.inputElement = input;
|
|
76
78
|
},
|
|
77
79
|
fullWidth: true,
|
|
78
80
|
defaultValue: query,
|
|
79
81
|
incremental: incremental,
|
|
80
|
-
"aria-label": ariaLabel
|
|
82
|
+
"aria-label": ariaLabel,
|
|
83
|
+
onFocus: function onFocus() {
|
|
84
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
85
|
+
}
|
|
81
86
|
}, rest));
|
|
87
|
+
|
|
88
|
+
if (hint) {
|
|
89
|
+
return ___EmotionJSX(EuiInputPopover, _extends({
|
|
90
|
+
disableFocusTrap: true,
|
|
91
|
+
input: search,
|
|
92
|
+
isOpen: hint.isVisible,
|
|
93
|
+
fullWidth: true,
|
|
94
|
+
closePopover: function closePopover() {
|
|
95
|
+
hint.setIsVisible(false);
|
|
96
|
+
},
|
|
97
|
+
panelProps: {
|
|
98
|
+
'aria-live': undefined,
|
|
99
|
+
'aria-modal': undefined,
|
|
100
|
+
role: undefined,
|
|
101
|
+
tabIndex: -1,
|
|
102
|
+
id: hint.id
|
|
103
|
+
}
|
|
104
|
+
}, hint.popoverProps), hint.content);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return search;
|
|
82
108
|
}
|
|
83
109
|
}]);
|
|
84
110
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
10
|
-
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
|
|
11
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
12
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ export var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
20
20
|
colorMode = _ref.colorMode;
|
|
21
21
|
return {
|
|
22
22
|
// Targets EuiPopoverPanel
|
|
23
|
-
euiTour: /*#__PURE__*/css("
|
|
23
|
+
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
@@ -34,7 +34,8 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
34
34
|
});
|
|
35
35
|
return {
|
|
36
36
|
// Base
|
|
37
|
-
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], "
|
|
37
|
+
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;", euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
38
|
+
isOpen: /*#__PURE__*/css(euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
38
39
|
// Positions
|
|
39
40
|
right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
|
|
40
41
|
left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
6
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -34,6 +34,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
34
34
|
anchor = _ref.anchor,
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
className = _ref.className,
|
|
37
|
+
css = _ref.css,
|
|
37
38
|
_ref$closePopover = _ref.closePopover,
|
|
38
39
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
39
40
|
content = _ref.content,
|
|
@@ -53,6 +54,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
53
54
|
_ref$decoration = _ref.decoration,
|
|
54
55
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
55
56
|
footerAction = _ref.footerAction,
|
|
57
|
+
panelProps = _ref.panelProps,
|
|
56
58
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
|
|
58
60
|
var titleId = useGeneratedHtmlId();
|
|
@@ -96,7 +98,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
96
98
|
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
97
99
|
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
98
100
|
var beaconStyles = euiTourBeaconStyles(euiTheme);
|
|
99
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
101
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
100
102
|
var finishButtonProps = {
|
|
101
103
|
color: 'text',
|
|
102
104
|
flush: 'right',
|
|
@@ -157,9 +159,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
157
159
|
ownFocus: false,
|
|
158
160
|
panelClassName: classes,
|
|
159
161
|
panelStyle: style,
|
|
160
|
-
panelProps: {
|
|
161
|
-
css: tourStyles.euiTour
|
|
162
|
-
},
|
|
162
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
163
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
164
|
+
}),
|
|
163
165
|
offset: hasBeacon ? 10 : 0,
|
|
164
166
|
'aria-labelledby': titleId,
|
|
165
167
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -15,7 +13,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
15
13
|
|
|
16
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
15
|
|
|
18
|
-
var _react =
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
17
|
|
|
20
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
19
|
|
|
@@ -30,11 +28,6 @@ var _icon = require("../../icon");
|
|
|
30
28
|
var _react2 = require("@emotion/react");
|
|
31
29
|
|
|
32
30
|
var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
31
|
var colorToClassMap = {
|
|
39
32
|
accent: 'euiBetaBadge--accent',
|
|
40
33
|
subdued: 'euiBetaBadge--subdued',
|
|
@@ -127,7 +120,7 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
127
120
|
anchorProps: anchorProps
|
|
128
121
|
}, content);
|
|
129
122
|
} else {
|
|
130
|
-
return (0, _react2.jsx)(
|
|
123
|
+
return (0, _react2.jsx)("span", anchorProps, content);
|
|
131
124
|
}
|
|
132
125
|
} else {
|
|
133
126
|
if (tooltipContent) {
|
|
@@ -148,10 +141,10 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
148
141
|
console.warn("Only string titles are permitted on badges that do not use tooltips. Found: ".concat((0, _typeof2.default)(spanTitle)));
|
|
149
142
|
}
|
|
150
143
|
|
|
151
|
-
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
144
|
+
return (0, _react2.jsx)("span", anchorProps, (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
152
145
|
className: classes,
|
|
153
146
|
title: spanTitle
|
|
154
|
-
}, rest), icon || label);
|
|
147
|
+
}, rest), icon || label));
|
|
155
148
|
}
|
|
156
149
|
}
|
|
157
150
|
};
|
|
@@ -401,7 +401,7 @@ var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
401
401
|
sortName = _this$state2.sortName,
|
|
402
402
|
pageIndex = _this$state2.pageIndex,
|
|
403
403
|
pageSize = _this$state2.pageSize;
|
|
404
|
-
var matchingItems = query ? _search_bar.EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
404
|
+
var matchingItems = query !== null && (executeQueryOptions === null || executeQueryOptions === void 0 ? void 0 : executeQueryOptions.enabled) !== false ? _search_bar.EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
405
405
|
var sortedItems = sortName ? matchingItems.slice(0) // avoid mutating the source array
|
|
406
406
|
.sort(this.getItemSorter()) // sort, causes mutation
|
|
407
407
|
: matchingItems;
|
|
@@ -38,7 +38,7 @@ var _breadcrumb = require("./breadcrumb.styles");
|
|
|
38
38
|
var _react2 = require("@emotion/react");
|
|
39
39
|
|
|
40
40
|
var _excluded = ["children", "className", "type", "truncate"],
|
|
41
|
-
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb"];
|
|
41
|
+
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
|
|
42
42
|
|
|
43
43
|
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); }
|
|
44
44
|
|
|
@@ -75,11 +75,12 @@ var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
75
75
|
isLastBreadcrumb = _ref2.isLastBreadcrumb,
|
|
76
76
|
isOnlyBreadcrumb = _ref2.isOnlyBreadcrumb,
|
|
77
77
|
highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
|
|
78
|
+
truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
|
|
78
79
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
79
80
|
var classes = (0, _classnames.default)('euiBreadcrumb__content', className);
|
|
80
81
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
81
82
|
var styles = (0, _breadcrumb.euiBreadcrumbContentStyles)(euiTheme);
|
|
82
|
-
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate &&
|
|
83
|
+
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
83
84
|
|
|
84
85
|
if (type === 'application') {
|
|
85
86
|
if (isOnlyBreadcrumb) {
|
|
@@ -66,12 +66,14 @@ var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
66
66
|
}, [breadcrumbs, responsiveMax]);
|
|
67
67
|
var breadcrumbChildren = (0, _react.useMemo)(function () {
|
|
68
68
|
return visibleBreadcrumbs.map(function (breadcrumb, index) {
|
|
69
|
+
var _breadcrumb$truncate;
|
|
70
|
+
|
|
69
71
|
var isFirstBreadcrumb = index === 0;
|
|
70
72
|
var isLastBreadcrumb = index === visibleBreadcrumbs.length - 1;
|
|
71
73
|
var isOnlyBreadcrumb = visibleBreadcrumbs.length === 1;
|
|
72
74
|
var sharedProps = {
|
|
73
75
|
type: type,
|
|
74
|
-
truncate: truncate
|
|
76
|
+
truncate: (_breadcrumb$truncate = breadcrumb.truncate) !== null && _breadcrumb$truncate !== void 0 ? _breadcrumb$truncate : truncate
|
|
75
77
|
};
|
|
76
78
|
return breadcrumb.isCollapsedButton ? (0, _react2.jsx)(_breadcrumb.EuiBreadcrumbCollapsed, (0, _extends2.default)({
|
|
77
79
|
key: "collapsed"
|
|
@@ -85,12 +87,13 @@ var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
85
87
|
max: 0
|
|
86
88
|
})) : (0, _react2.jsx)(_breadcrumb.EuiBreadcrumb, (0, _extends2.default)({
|
|
87
89
|
key: index
|
|
88
|
-
}, sharedProps), (0, _react2.jsx)(_breadcrumb.EuiBreadcrumbContent, (0, _extends2.default)({
|
|
90
|
+
}, sharedProps), (0, _react2.jsx)(_breadcrumb.EuiBreadcrumbContent, (0, _extends2.default)({}, breadcrumb, sharedProps, {
|
|
89
91
|
isFirstBreadcrumb: isFirstBreadcrumb,
|
|
90
92
|
isLastBreadcrumb: isLastBreadcrumb,
|
|
91
93
|
isOnlyBreadcrumb: isOnlyBreadcrumb,
|
|
92
|
-
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage
|
|
93
|
-
|
|
94
|
+
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage,
|
|
95
|
+
truncateLastBreadcrumb: isLastBreadcrumb && truncate && breadcrumb.truncate == null
|
|
96
|
+
})));
|
|
94
97
|
});
|
|
95
98
|
}, [visibleBreadcrumbs, truncate, type, lastBreadcrumbIsCurrentPage]);
|
|
96
99
|
return (0, _react2.jsx)("nav", (0, _extends2.default)({
|
|
@@ -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",
|
|
@@ -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)({
|