@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
|
@@ -21,6 +21,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
23
|
|
|
24
|
+
var _accessibility = require("../../services/accessibility");
|
|
25
|
+
|
|
24
26
|
var _predicate = require("../../services/predicate");
|
|
25
27
|
|
|
26
28
|
var _flex = require("../flex");
|
|
@@ -43,6 +45,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
43
45
|
|
|
44
46
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
45
47
|
|
|
48
|
+
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; }
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
46
52
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
47
53
|
|
|
48
54
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -103,6 +109,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
103
109
|
|
|
104
110
|
_this = _super.call(this, props);
|
|
105
111
|
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "hintId", (0, _accessibility.htmlIdGenerator)('__hint')());
|
|
113
|
+
|
|
106
114
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
|
|
107
115
|
try {
|
|
108
116
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -159,7 +167,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
159
167
|
_this.state = {
|
|
160
168
|
query: _query,
|
|
161
169
|
queryText: _query.text,
|
|
162
|
-
error: null
|
|
170
|
+
error: null,
|
|
171
|
+
isHintVisible: false
|
|
163
172
|
};
|
|
164
173
|
return _this;
|
|
165
174
|
}
|
|
@@ -221,10 +230,15 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
221
230
|
}, {
|
|
222
231
|
key: "render",
|
|
223
232
|
value: function render() {
|
|
233
|
+
var _hint$popoverProps$is,
|
|
234
|
+
_hint$popoverProps,
|
|
235
|
+
_this2 = this;
|
|
236
|
+
|
|
224
237
|
var _this$state = this.state,
|
|
225
238
|
query = _this$state.query,
|
|
226
239
|
queryText = _this$state.queryText,
|
|
227
|
-
error = _this$state.error
|
|
240
|
+
error = _this$state.error,
|
|
241
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
228
242
|
var _this$props = this.props,
|
|
229
243
|
_this$props$box = _this$props.box;
|
|
230
244
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -235,7 +249,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
235
249
|
box = _objectWithoutProperties(_this$props$box, _excluded),
|
|
236
250
|
filters = _this$props.filters,
|
|
237
251
|
toolsLeft = _this$props.toolsLeft,
|
|
238
|
-
toolsRight = _this$props.toolsRight
|
|
252
|
+
toolsRight = _this$props.toolsRight,
|
|
253
|
+
hint = _this$props.hint;
|
|
239
254
|
|
|
240
255
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
241
256
|
var filtersBar = !filters ? undefined : (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
@@ -247,6 +262,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
247
262
|
onChange: this.onFiltersChange
|
|
248
263
|
}));
|
|
249
264
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
265
|
+
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;
|
|
250
266
|
return (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
251
267
|
gutterSize: "m",
|
|
252
268
|
alignItems: "center",
|
|
@@ -258,7 +274,17 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
258
274
|
query: queryText,
|
|
259
275
|
onSearch: this.onSearch,
|
|
260
276
|
isInvalid: error != null,
|
|
261
|
-
title: error ? error.message : undefined
|
|
277
|
+
title: error ? error.message : undefined,
|
|
278
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
279
|
+
hint: hint ? _objectSpread({
|
|
280
|
+
isVisible: isHintVisible,
|
|
281
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
282
|
+
_this2.setState({
|
|
283
|
+
isHintVisible: isVisible
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
id: this.hintId
|
|
287
|
+
}, hint) : undefined
|
|
262
288
|
}))), filtersBar, toolsRightEl);
|
|
263
289
|
}
|
|
264
290
|
}], [{
|
|
@@ -269,7 +295,8 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
269
295
|
return {
|
|
270
296
|
query: query,
|
|
271
297
|
queryText: query.text,
|
|
272
|
-
error: null
|
|
298
|
+
error: null,
|
|
299
|
+
isHintVisible: prevState.isHintVisible
|
|
273
300
|
};
|
|
274
301
|
}
|
|
275
302
|
|
|
@@ -457,6 +484,14 @@ EuiSearchBar.propTypes = {
|
|
|
457
484
|
* Date formatter to use when parsing date values
|
|
458
485
|
*/
|
|
459
486
|
dateFormat: _propTypes.default.any,
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Hint to render below the search bar
|
|
490
|
+
*/
|
|
491
|
+
hint: _propTypes.default.shape({
|
|
492
|
+
content: _propTypes.default.node.isRequired,
|
|
493
|
+
popoverProps: _propTypes.default.any
|
|
494
|
+
}),
|
|
460
495
|
className: _propTypes.default.string,
|
|
461
496
|
"aria-label": _propTypes.default.string,
|
|
462
497
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -13,9 +13,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _form = require("../form");
|
|
15
15
|
|
|
16
|
+
var _popover = require("../popover");
|
|
17
|
+
|
|
16
18
|
var _react2 = require("@emotion/react");
|
|
17
19
|
|
|
18
|
-
var _excluded = ["query", "incremental"];
|
|
20
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
@@ -88,6 +90,7 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
88
90
|
var _this$props = this.props,
|
|
89
91
|
query = _this$props.query,
|
|
90
92
|
incremental = _this$props.incremental,
|
|
93
|
+
hint = _this$props.hint,
|
|
91
94
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
92
95
|
|
|
93
96
|
var ariaLabel;
|
|
@@ -98,15 +101,39 @@ var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
98
101
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
|
|
104
|
+
var search = (0, _react2.jsx)(_form.EuiFieldSearch, _extends({
|
|
102
105
|
inputRef: function inputRef(input) {
|
|
103
106
|
return _this2.inputElement = input;
|
|
104
107
|
},
|
|
105
108
|
fullWidth: true,
|
|
106
109
|
defaultValue: query,
|
|
107
110
|
incremental: incremental,
|
|
108
|
-
"aria-label": ariaLabel
|
|
111
|
+
"aria-label": ariaLabel,
|
|
112
|
+
onFocus: function onFocus() {
|
|
113
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
114
|
+
}
|
|
109
115
|
}, rest));
|
|
116
|
+
|
|
117
|
+
if (hint) {
|
|
118
|
+
return (0, _react2.jsx)(_popover.EuiInputPopover, _extends({
|
|
119
|
+
disableFocusTrap: true,
|
|
120
|
+
input: search,
|
|
121
|
+
isOpen: hint.isVisible,
|
|
122
|
+
fullWidth: true,
|
|
123
|
+
closePopover: function closePopover() {
|
|
124
|
+
hint.setIsVisible(false);
|
|
125
|
+
},
|
|
126
|
+
panelProps: {
|
|
127
|
+
'aria-live': undefined,
|
|
128
|
+
'aria-modal': undefined,
|
|
129
|
+
role: undefined,
|
|
130
|
+
tabIndex: -1,
|
|
131
|
+
id: hint.id
|
|
132
|
+
}
|
|
133
|
+
}, hint.popoverProps), hint.content);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return search;
|
|
110
137
|
}
|
|
111
138
|
}]);
|
|
112
139
|
|
|
@@ -123,5 +150,12 @@ _defineProperty(EuiSearchBox, "defaultProps", {
|
|
|
123
150
|
EuiSearchBox.propTypes = {
|
|
124
151
|
query: _propTypes.default.string.isRequired,
|
|
125
152
|
// This is optional in EuiFieldSearchProps
|
|
126
|
-
onSearch: _propTypes.default.func.isRequired
|
|
153
|
+
onSearch: _propTypes.default.func.isRequired,
|
|
154
|
+
hint: _propTypes.default.shape({
|
|
155
|
+
id: _propTypes.default.string.isRequired,
|
|
156
|
+
isVisible: _propTypes.default.bool.isRequired,
|
|
157
|
+
setIsVisible: _propTypes.default.func.isRequired,
|
|
158
|
+
content: _propTypes.default.node.isRequired,
|
|
159
|
+
popoverProps: _propTypes.default.any
|
|
160
|
+
})
|
|
127
161
|
};
|
|
@@ -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;"),
|
|
@@ -33,7 +33,7 @@ var _tour = require("./tour.styles");
|
|
|
33
33
|
|
|
34
34
|
var _react2 = require("@emotion/react");
|
|
35
35
|
|
|
36
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
36
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
@@ -79,6 +79,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
79
79
|
anchor = _ref.anchor,
|
|
80
80
|
children = _ref.children,
|
|
81
81
|
className = _ref.className,
|
|
82
|
+
css = _ref.css,
|
|
82
83
|
_ref$closePopover = _ref.closePopover,
|
|
83
84
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
84
85
|
content = _ref.content,
|
|
@@ -98,6 +99,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
98
99
|
_ref$decoration = _ref.decoration,
|
|
99
100
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
100
101
|
footerAction = _ref.footerAction,
|
|
102
|
+
panelProps = _ref.panelProps,
|
|
101
103
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
102
104
|
|
|
103
105
|
var titleId = (0, _services.useGeneratedHtmlId)();
|
|
@@ -141,7 +143,7 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
141
143
|
var headerStyles = (0, _tour.euiTourHeaderStyles)(euiTheme);
|
|
142
144
|
var footerStyles = (0, _tour.euiTourFooterStyles)(euiTheme);
|
|
143
145
|
var beaconStyles = (0, _tour.euiTourBeaconStyles)(euiTheme);
|
|
144
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
146
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
145
147
|
var finishButtonProps = {
|
|
146
148
|
color: 'text',
|
|
147
149
|
flush: 'right',
|
|
@@ -200,9 +202,9 @@ var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
200
202
|
ownFocus: false,
|
|
201
203
|
panelClassName: classes,
|
|
202
204
|
panelStyle: style,
|
|
203
|
-
panelProps: {
|
|
204
|
-
css: tourStyles.euiTour
|
|
205
|
-
},
|
|
205
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
206
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
207
|
+
}),
|
|
206
208
|
offset: hasBeacon ? 10 : 0,
|
|
207
209
|
'aria-labelledby': titleId,
|
|
208
210
|
arrowChildren: hasBeacon && (0, _react2.jsx)(_beacon.EuiBeacon, {
|
|
@@ -10,7 +10,7 @@ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPositi
|
|
|
10
10
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
11
11
|
* Side Public License, v 1.
|
|
12
12
|
*/
|
|
13
|
-
import React
|
|
13
|
+
import React from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { keysOf } from '../../common';
|
|
16
16
|
import { getSecureRelForTarget } from '../../../services';
|
|
@@ -106,7 +106,7 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
106
106
|
anchorProps: anchorProps
|
|
107
107
|
}, content);
|
|
108
108
|
} else {
|
|
109
|
-
return ___EmotionJSX(
|
|
109
|
+
return ___EmotionJSX("span", anchorProps, content);
|
|
110
110
|
}
|
|
111
111
|
} else {
|
|
112
112
|
if (tooltipContent) {
|
|
@@ -127,10 +127,10 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
127
127
|
console.warn("Only string titles are permitted on badges that do not use tooltips. Found: ".concat(_typeof(spanTitle)));
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
return ___EmotionJSX("span", _extends({
|
|
130
|
+
return ___EmotionJSX("span", anchorProps, ___EmotionJSX("span", _extends({
|
|
131
131
|
className: classes,
|
|
132
132
|
title: spanTitle
|
|
133
|
-
}, rest), icon || label);
|
|
133
|
+
}, rest), icon || label));
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
};
|
|
@@ -382,7 +382,7 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
|
|
|
382
382
|
sortName = _this$state2.sortName,
|
|
383
383
|
pageIndex = _this$state2.pageIndex,
|
|
384
384
|
pageSize = _this$state2.pageSize;
|
|
385
|
-
var matchingItems = query ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
385
|
+
var matchingItems = query !== null && (executeQueryOptions === null || executeQueryOptions === void 0 ? void 0 : executeQueryOptions.enabled) !== false ? EuiSearchBar.Query.execute(query, items, executeQueryOptions) : items;
|
|
386
386
|
var sortedItems = sortName ? matchingItems.slice(0) // avoid mutating the source array
|
|
387
387
|
.sort(this.getItemSorter()) // sort, causes mutation
|
|
388
388
|
: matchingItems;
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "className", "type", "truncate"],
|
|
5
|
-
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb"];
|
|
5
|
+
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -51,12 +51,13 @@ export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
|
|
|
51
51
|
isLastBreadcrumb = _ref2.isLastBreadcrumb,
|
|
52
52
|
isOnlyBreadcrumb = _ref2.isOnlyBreadcrumb,
|
|
53
53
|
highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
|
|
54
|
+
truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
|
|
54
55
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
56
|
|
|
56
57
|
var classes = classNames('euiBreadcrumb__content', className);
|
|
57
58
|
var euiTheme = useEuiTheme();
|
|
58
59
|
var styles = euiBreadcrumbContentStyles(euiTheme);
|
|
59
|
-
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate &&
|
|
60
|
+
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
60
61
|
|
|
61
62
|
if (type === 'application') {
|
|
62
63
|
if (isOnlyBreadcrumb) {
|
|
@@ -48,12 +48,14 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
48
48
|
}, [breadcrumbs, responsiveMax]);
|
|
49
49
|
var breadcrumbChildren = useMemo(function () {
|
|
50
50
|
return visibleBreadcrumbs.map(function (breadcrumb, index) {
|
|
51
|
+
var _breadcrumb$truncate;
|
|
52
|
+
|
|
51
53
|
var isFirstBreadcrumb = index === 0;
|
|
52
54
|
var isLastBreadcrumb = index === visibleBreadcrumbs.length - 1;
|
|
53
55
|
var isOnlyBreadcrumb = visibleBreadcrumbs.length === 1;
|
|
54
56
|
var sharedProps = {
|
|
55
57
|
type: type,
|
|
56
|
-
truncate: truncate
|
|
58
|
+
truncate: (_breadcrumb$truncate = breadcrumb.truncate) !== null && _breadcrumb$truncate !== void 0 ? _breadcrumb$truncate : truncate
|
|
57
59
|
};
|
|
58
60
|
return breadcrumb.isCollapsedButton ? ___EmotionJSX(EuiBreadcrumbCollapsed, _extends({
|
|
59
61
|
key: "collapsed"
|
|
@@ -67,12 +69,13 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
67
69
|
max: 0
|
|
68
70
|
})) : ___EmotionJSX(EuiBreadcrumb, _extends({
|
|
69
71
|
key: index
|
|
70
|
-
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({
|
|
72
|
+
}, sharedProps), ___EmotionJSX(EuiBreadcrumbContent, _extends({}, breadcrumb, sharedProps, {
|
|
71
73
|
isFirstBreadcrumb: isFirstBreadcrumb,
|
|
72
74
|
isLastBreadcrumb: isLastBreadcrumb,
|
|
73
75
|
isOnlyBreadcrumb: isOnlyBreadcrumb,
|
|
74
|
-
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage
|
|
75
|
-
|
|
76
|
+
highlightLastBreadcrumb: isLastBreadcrumb && lastBreadcrumbIsCurrentPage,
|
|
77
|
+
truncateLastBreadcrumb: isLastBreadcrumb && truncate && breadcrumb.truncate == null
|
|
78
|
+
})));
|
|
76
79
|
});
|
|
77
80
|
}, [visibleBreadcrumbs, truncate, type, lastBreadcrumbIsCurrentPage]);
|
|
78
81
|
return ___EmotionJSX("nav", _extends({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type", "style"];
|
|
5
5
|
|
|
@@ -39,7 +39,8 @@ export function isButtonDisabled(_ref) {
|
|
|
39
39
|
export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
40
40
|
var children = _ref2.children,
|
|
41
41
|
iconType = _ref2.iconType,
|
|
42
|
-
iconSide = _ref2.iconSide,
|
|
42
|
+
_ref2$iconSide = _ref2.iconSide,
|
|
43
|
+
iconSide = _ref2$iconSide === void 0 ? 'left' : _ref2$iconSide,
|
|
43
44
|
iconSize = _ref2.iconSize,
|
|
44
45
|
_ref2$size = _ref2.size,
|
|
45
46
|
size = _ref2$size === void 0 ? 'm' : _ref2$size,
|
|
@@ -75,7 +76,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
75
76
|
iconType: iconType,
|
|
76
77
|
iconSide: iconSide,
|
|
77
78
|
iconSize: iconSize,
|
|
78
|
-
textProps:
|
|
79
|
+
textProps: textProps
|
|
79
80
|
}, contentProps), children);
|
|
80
81
|
|
|
81
82
|
var element = href && !buttonIsDisabled ? 'a' : 'button';
|
|
@@ -104,8 +105,8 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
104
105
|
|
|
105
106
|
return createElement(element, _objectSpread(_objectSpread(_objectSpread({
|
|
106
107
|
css: cssStyles,
|
|
107
|
-
style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
|
|
108
|
-
|
|
108
|
+
style: minWidth != null ? _objectSpread(_objectSpread({}, style), {}, {
|
|
109
|
+
minInlineSize: minWidth
|
|
109
110
|
}) : style,
|
|
110
111
|
ref: ref
|
|
111
112
|
}, elementProps), relObj), rest), innerNode);
|
|
@@ -28,14 +28,13 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
28
28
|
iconType = _ref.iconType,
|
|
29
29
|
_ref$iconSize = _ref.iconSize,
|
|
30
30
|
iconSize = _ref$iconSize === void 0 ? 'm' : _ref$iconSize,
|
|
31
|
-
iconSide = _ref.iconSide,
|
|
31
|
+
_ref$iconSide = _ref.iconSide,
|
|
32
|
+
iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
|
|
32
33
|
contentProps = _objectWithoutProperties(_ref, _excluded);
|
|
33
34
|
|
|
34
35
|
var theme = useEuiTheme();
|
|
35
36
|
var styles = euiButtonDisplayContentStyles(theme);
|
|
36
|
-
var cssStyles = [styles.euiButtonDisplayContent
|
|
37
|
-
var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
|
|
38
|
-
var cssIconStyles = [styles.euiButtonDisplayContent__icon, iconSize && styles[iconSize]]; // Add an icon to the button if one exists.
|
|
37
|
+
var cssStyles = [styles.euiButtonDisplayContent]; // Add an icon to the button if one exists.
|
|
39
38
|
|
|
40
39
|
var icon; // When the button is disabled the text gets gray
|
|
41
40
|
// and in some buttons the background gets a light gray
|
|
@@ -44,18 +43,16 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
44
43
|
// are always visible. The default spinner color could be very light.
|
|
45
44
|
|
|
46
45
|
var loadingSpinnerColor = isDisabled ? {
|
|
47
|
-
border: '
|
|
46
|
+
border: 'currentcolor'
|
|
48
47
|
} : undefined;
|
|
49
48
|
|
|
50
49
|
if (isLoading) {
|
|
51
50
|
icon = ___EmotionJSX(EuiLoadingSpinner, {
|
|
52
|
-
css: cssSpinnerStyles,
|
|
53
51
|
size: iconSize,
|
|
54
52
|
color: loadingSpinnerColor
|
|
55
53
|
});
|
|
56
54
|
} else if (iconType) {
|
|
57
55
|
icon = ___EmotionJSX(EuiIcon, {
|
|
58
|
-
css: cssIconStyles,
|
|
59
56
|
type: iconType,
|
|
60
57
|
size: iconSize,
|
|
61
58
|
color: "inherit" // forces the icon to inherit its parent color
|
|
@@ -66,7 +63,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
66
63
|
var isText = typeof children === 'string';
|
|
67
64
|
return ___EmotionJSX("span", _extends({
|
|
68
65
|
css: cssStyles
|
|
69
|
-
}, contentProps), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
|
|
66
|
+
}, contentProps), iconSide === 'left' && icon, isText || textProps ? ___EmotionJSX("span", _extends({}, textProps, {
|
|
70
67
|
className: classNames('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
|
|
71
|
-
}), children) : children);
|
|
68
|
+
}), children) : children, iconSide === 'right' && icon);
|
|
72
69
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
-
|
|
3
1
|
/*
|
|
4
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -9,46 +7,10 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
7
|
*/
|
|
10
8
|
import { css } from '@emotion/react';
|
|
11
9
|
import { logicalCSS } from '../../../global_styling';
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
name: "gtg6j-euiButtonDisplayContent__icon",
|
|
15
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;"
|
|
16
|
-
} : {
|
|
17
|
-
name: "gtg6j-euiButtonDisplayContent__icon",
|
|
18
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;",
|
|
19
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
23
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
24
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
|
|
25
|
-
} : {
|
|
26
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
27
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;",
|
|
28
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
32
|
-
name: "qfl6yj-right",
|
|
33
|
-
styles: "flex-direction:row-reverse;label:right;"
|
|
34
|
-
} : {
|
|
35
|
-
name: "qfl6yj-right",
|
|
36
|
-
styles: "flex-direction:row-reverse;label:right;",
|
|
37
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4) {
|
|
41
|
-
var euiTheme = _ref4.euiTheme;
|
|
10
|
+
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref) {
|
|
11
|
+
var euiTheme = _ref.euiTheme;
|
|
42
12
|
return {
|
|
43
13
|
// Base
|
|
44
|
-
euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), ";", logicalCSS('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
45
|
-
// Icon side
|
|
46
|
-
left: /*#__PURE__*/css(";label:left;"),
|
|
47
|
-
right: _ref3,
|
|
48
|
-
euiButtonDisplayContent__spinner: _ref2,
|
|
49
|
-
euiButtonDisplayContent__icon: _ref,
|
|
50
|
-
// Icon size
|
|
51
|
-
s: /*#__PURE__*/css(";label:s;"),
|
|
52
|
-
m: /*#__PURE__*/css(";label:m;")
|
|
14
|
+
euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), ";", logicalCSS('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
53
15
|
};
|
|
54
16
|
};
|
|
@@ -110,7 +110,7 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
110
110
|
},
|
|
111
111
|
anchorPosition: "downLeft",
|
|
112
112
|
panelPaddingSize: "s",
|
|
113
|
-
|
|
113
|
+
hasDragDrop: true,
|
|
114
114
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
115
115
|
size: "xs",
|
|
116
116
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -123,7 +123,7 @@ export var useDataGridColumnSorting = function useDataGridColumnSorting(columns,
|
|
|
123
123
|
},
|
|
124
124
|
anchorPosition: "downLeft",
|
|
125
125
|
panelPaddingSize: "s",
|
|
126
|
-
|
|
126
|
+
hasDragDrop: true,
|
|
127
127
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
128
128
|
size: "xs",
|
|
129
129
|
iconType: "sortable",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "className", "aria-label", "color"];
|
|
4
|
+
var _excluded = ["size", "className", "aria-label", "color", "style"];
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
4
9
|
|
|
5
10
|
/*
|
|
6
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -13,7 +18,7 @@ import React from 'react';
|
|
|
13
18
|
import classNames from 'classnames';
|
|
14
19
|
import { useEuiTheme } from '../..//services';
|
|
15
20
|
import { useLoadingAriaLabel } from './_loading_strings';
|
|
16
|
-
import { euiLoadingSpinnerStyles } from './loading_spinner.styles';
|
|
21
|
+
import { euiLoadingSpinnerStyles, euiSpinnerBorderColorsCSS } from './loading_spinner.styles';
|
|
17
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
23
|
export var SIZES = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
19
24
|
export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
@@ -22,16 +27,21 @@ export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
|
22
27
|
className = _ref.className,
|
|
23
28
|
ariaLabel = _ref['aria-label'],
|
|
24
29
|
color = _ref.color,
|
|
30
|
+
style = _ref.style,
|
|
25
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
32
|
|
|
27
33
|
var euiTheme = useEuiTheme();
|
|
28
|
-
var styles = euiLoadingSpinnerStyles(euiTheme
|
|
34
|
+
var styles = euiLoadingSpinnerStyles(euiTheme);
|
|
29
35
|
var cssStyles = [styles.euiLoadingSpinner, styles[size]];
|
|
30
36
|
var classes = classNames('euiLoadingSpinner', className);
|
|
31
37
|
var defaultLabel = useLoadingAriaLabel();
|
|
38
|
+
var customColorStyle = color ? _objectSpread(_objectSpread({}, style), {}, {
|
|
39
|
+
borderColor: euiSpinnerBorderColorsCSS(euiTheme, color)
|
|
40
|
+
}) : style;
|
|
32
41
|
return ___EmotionJSX("span", _extends({
|
|
33
42
|
className: classes,
|
|
34
43
|
css: cssStyles,
|
|
44
|
+
style: customColorStyle,
|
|
35
45
|
role: "progressbar",
|
|
36
46
|
"aria-label": ariaLabel || defaultLabel
|
|
37
47
|
}, rest));
|
|
@@ -21,15 +21,19 @@ var spinnerSizes = {
|
|
|
21
21
|
xl: 'xl',
|
|
22
22
|
xxl: 'xxl'
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
var spinnerColorsCSS = function spinnerColorsCSS(border, highlight) {
|
|
26
|
-
return "\n border-color: ".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border, ";\n ");
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref, color) {
|
|
24
|
+
export var euiSpinnerBorderColorsCSS = function euiSpinnerBorderColorsCSS(_ref) {
|
|
30
25
|
var euiTheme = _ref.euiTheme;
|
|
26
|
+
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27
|
+
var _colors$border = colors.border,
|
|
28
|
+
border = _colors$border === void 0 ? euiTheme.colors.lightShade : _colors$border,
|
|
29
|
+
_colors$highlight = colors.highlight,
|
|
30
|
+
highlight = _colors$highlight === void 0 ? euiTheme.colors.primary : _colors$highlight;
|
|
31
|
+
return "".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border);
|
|
32
|
+
};
|
|
33
|
+
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(euiThemeContext) {
|
|
34
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
35
|
return {
|
|
32
|
-
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";
|
|
36
|
+
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", euiSpinnerBorderColorsCSS(euiThemeContext), ";", euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
|
|
33
37
|
// Sizes
|
|
34
38
|
s: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.s], euiTheme.size[spinnerSizes.s]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
|
|
35
39
|
m: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.m], euiTheme.size[spinnerSizes.m]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
15
|
* Side Public License, v 1.
|
|
16
16
|
*/
|
|
17
|
-
import React from 'react';
|
|
17
|
+
import React, { useRef, useCallback } from 'react';
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import { keys } from '../../services';
|
|
20
20
|
import { EuiButtonIcon } from '../button';
|
|
@@ -32,6 +32,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
32
32
|
style = _ref.style,
|
|
33
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
|
|
35
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
36
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
37
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
38
|
+
);
|
|
39
|
+
var onFocus = useCallback(function () {
|
|
40
|
+
if (bodyScrollTop.current != null) {
|
|
41
|
+
window.scrollTo({
|
|
42
|
+
top: bodyScrollTop.current
|
|
43
|
+
});
|
|
44
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
35
48
|
var onKeyDown = function onKeyDown(event) {
|
|
36
49
|
if (event.key === keys.ESCAPE) {
|
|
37
50
|
event.preventDefault();
|
|
@@ -54,11 +67,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
54
67
|
|
|
55
68
|
var classes = classnames('euiModal', widthClassName, className);
|
|
56
69
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
57
|
-
initialFocus: initialFocus
|
|
70
|
+
initialFocus: initialFocus,
|
|
71
|
+
scrollLock: true
|
|
58
72
|
}, ___EmotionJSX("div", _extends({
|
|
59
73
|
className: classes,
|
|
60
74
|
onKeyDown: onKeyDown,
|
|
61
75
|
tabIndex: 0,
|
|
76
|
+
onFocus: onFocus,
|
|
62
77
|
style: newStyle || style
|
|
63
78
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
64
79
|
token: "euiModal.closeModal",
|