@elastic/eui 71.1.0 → 72.0.0
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 +20 -28
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +20 -28
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +160 -173
- package/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/es/components/expression/expression.a11y.js +254 -0
- package/es/components/filter_group/filter_group.a11y.js +281 -0
- package/es/components/focus_trap/focus_trap.a11y.js +131 -0
- package/es/components/form/file_picker/file_picker.js +1 -0
- package/es/components/header/header.a11y.js +374 -0
- package/es/components/icon/icon_ML.a11y.js +33 -0
- package/es/components/icon/icon_apps.a11y.js +33 -0
- package/es/components/icon/icon_editor.a11y.js +33 -0
- package/es/components/icon/icon_elastic.a11y.js +33 -0
- package/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/es/components/icon/icon_tokens.a11y.js +33 -0
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/es/components/selectable/selectable.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +17 -5
- package/es/components/tabs/tab.js +7 -17
- package/es/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/es/components/tabs/tabs.js +7 -11
- package/es/components/tabs/tabs_context.js +13 -0
- package/eui.d.ts +41 -32
- package/i18ntokens.json +30 -14
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +155 -168
- package/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/lib/components/expression/expression.a11y.js +262 -0
- package/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/lib/components/form/file_picker/file_picker.js +1 -0
- package/lib/components/header/header.a11y.js +385 -0
- package/lib/components/icon/icon_ML.a11y.js +40 -0
- package/lib/components/icon/icon_apps.a11y.js +40 -0
- package/lib/components/icon/icon_editor.a11y.js +40 -0
- package/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/lib/components/selectable/selectable.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +17 -5
- package/lib/components/tabs/tab.js +14 -17
- package/lib/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/lib/components/tabs/tabs.js +8 -14
- package/lib/components/tabs/tabs_context.js +23 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +145 -169
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/optimize/es/components/expression/expression.a11y.js +243 -0
- package/optimize/es/components/filter_group/filter_group.a11y.js +271 -0
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +120 -0
- package/optimize/es/components/form/file_picker/file_picker.js +1 -0
- package/optimize/es/components/header/header.a11y.js +364 -0
- package/optimize/es/components/icon/icon_ML.a11y.js +33 -0
- package/optimize/es/components/icon/icon_apps.a11y.js +33 -0
- package/optimize/es/components/icon/icon_editor.a11y.js +33 -0
- package/optimize/es/components/icon/icon_elastic.a11y.js +33 -0
- package/optimize/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/optimize/es/components/icon/icon_tokens.a11y.js +33 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/optimize/es/components/selectable/selectable.js +2 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/es/components/tabs/tab.js +7 -5
- package/optimize/es/components/tabs/tabs.js +7 -11
- package/optimize/es/components/tabs/tabs_context.js +13 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +146 -167
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/optimize/lib/components/expression/expression.a11y.js +254 -0
- package/optimize/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/optimize/lib/components/form/file_picker/file_picker.js +1 -0
- package/optimize/lib/components/header/header.a11y.js +385 -0
- package/optimize/lib/components/icon/icon_ML.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_apps.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_editor.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/optimize/lib/components/selectable/selectable.js +2 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/lib/components/tabs/tab.js +15 -5
- package/optimize/lib/components/tabs/tabs.js +8 -14
- package/optimize/lib/components/tabs/tabs_context.js +23 -0
- package/package.json +4 -6
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +14 -0
- package/src/components/form/file_picker/_file_picker.scss +14 -14
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +153 -166
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/test-env/components/error_boundary/error_boundary.a11y.js +75 -0
- package/test-env/components/expression/expression.a11y.js +254 -0
- package/test-env/components/filter_group/filter_group.a11y.js +287 -0
- package/test-env/components/focus_trap/focus_trap.a11y.js +140 -0
- package/test-env/components/form/file_picker/file_picker.js +1 -0
- package/test-env/components/header/header.a11y.js +385 -0
- package/test-env/components/icon/icon_ML.a11y.js +40 -0
- package/test-env/components/icon/icon_apps.a11y.js +40 -0
- package/test-env/components/icon/icon_editor.a11y.js +40 -0
- package/test-env/components/icon/icon_elastic.a11y.js +40 -0
- package/test-env/components/icon/icon_glyphs.a11y.js +40 -0
- package/test-env/components/icon/icon_tokens.a11y.js +40 -0
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/test-env/components/selectable/selectable.js +4 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +17 -5
- package/test-env/components/tabs/tab.js +15 -17
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/test-env/components/tabs/tabs.js +8 -14
- package/test-env/components/tabs/tabs_context.js +23 -0
|
@@ -227,6 +227,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
227
227
|
onOptionClick = _this$props4.onOptionClick,
|
|
228
228
|
options = _this$props4.options,
|
|
229
229
|
singleSelection = _this$props4.singleSelection;
|
|
230
|
+
|
|
231
|
+
var changedOption = _objectSpread({}, addedOption);
|
|
232
|
+
|
|
230
233
|
var updatedOptions = options.map(function (option) {
|
|
231
234
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
232
235
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -238,11 +241,12 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
238
241
|
|
|
239
242
|
if (option === addedOption) {
|
|
240
243
|
updatedOption.checked = 'on';
|
|
244
|
+
changedOption = updatedOption;
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
return updatedOption;
|
|
244
248
|
});
|
|
245
|
-
onOptionClick(updatedOptions, event);
|
|
249
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
246
250
|
});
|
|
247
251
|
|
|
248
252
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
@@ -250,33 +254,40 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
250
254
|
onOptionClick = _this$props5.onOptionClick,
|
|
251
255
|
singleSelection = _this$props5.singleSelection,
|
|
252
256
|
options = _this$props5.options;
|
|
257
|
+
|
|
258
|
+
var changedOption = _objectSpread({}, removedOption);
|
|
259
|
+
|
|
253
260
|
var updatedOptions = options.map(function (option) {
|
|
254
261
|
var updatedOption = _objectSpread({}, option);
|
|
255
262
|
|
|
256
263
|
if (option === removedOption && singleSelection !== 'always') {
|
|
257
264
|
delete updatedOption.checked;
|
|
265
|
+
changedOption = updatedOption;
|
|
258
266
|
}
|
|
259
267
|
|
|
260
268
|
return updatedOption;
|
|
261
269
|
});
|
|
262
|
-
onOptionClick(updatedOptions, event);
|
|
270
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
263
271
|
});
|
|
264
272
|
|
|
265
273
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
266
274
|
var _this$props6 = _this.props,
|
|
267
275
|
onOptionClick = _this$props6.onOptionClick,
|
|
268
276
|
options = _this$props6.options;
|
|
269
|
-
|
|
277
|
+
|
|
278
|
+
var changedOption = _objectSpread({}, excludedOption);
|
|
279
|
+
|
|
270
280
|
var updatedOptions = options.map(function (option) {
|
|
271
281
|
var updatedOption = _objectSpread({}, option);
|
|
272
282
|
|
|
273
283
|
if (option === excludedOption) {
|
|
274
284
|
updatedOption.checked = 'off';
|
|
285
|
+
changedOption = updatedOption;
|
|
275
286
|
}
|
|
276
287
|
|
|
277
288
|
return updatedOption;
|
|
278
289
|
});
|
|
279
|
-
onOptionClick(updatedOptions, event);
|
|
290
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
280
291
|
});
|
|
281
292
|
|
|
282
293
|
return _this;
|
|
@@ -590,7 +601,8 @@ EuiSelectableList.propTypes = {
|
|
|
590
601
|
searchValue: PropTypes.string.isRequired,
|
|
591
602
|
|
|
592
603
|
/**
|
|
593
|
-
* Returns the array of options with altered checked state
|
|
604
|
+
* Returns the array of options with altered checked state, the click/keyboard event,
|
|
605
|
+
* and the option that triggered the click/keyboard event
|
|
594
606
|
*/
|
|
595
607
|
onOptionClick: PropTypes.func.isRequired,
|
|
596
608
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"
|
|
1
|
+
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -13,12 +13,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
|
-
import React from 'react';
|
|
16
|
+
import React, { useContext } from 'react';
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
20
20
|
import { validateHref } from '../../services/security/href_validator';
|
|
21
21
|
import { euiTabStyles, euiTabContentStyles } from './tab.styles';
|
|
22
|
+
import { EuiTabsContext } from './tabs_context';
|
|
22
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
24
|
export var EuiTab = function EuiTab(_ref) {
|
|
24
25
|
var isSelected = _ref.isSelected,
|
|
@@ -30,11 +31,12 @@ export var EuiTab = function EuiTab(_ref) {
|
|
|
30
31
|
rel = _ref.rel,
|
|
31
32
|
prepend = _ref.prepend,
|
|
32
33
|
append = _ref.append,
|
|
33
|
-
_ref$size = _ref.size,
|
|
34
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
35
|
-
expand = _ref.expand,
|
|
36
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
35
|
|
|
36
|
+
var _useContext = useContext(EuiTabsContext),
|
|
37
|
+
size = _useContext.size,
|
|
38
|
+
expand = _useContext.expand;
|
|
39
|
+
|
|
38
40
|
var euiTheme = useEuiTheme();
|
|
39
41
|
var isHrefValid = !href || validateHref(href);
|
|
40
42
|
var disabled = _disabled || !isHrefValid; // Keep CSS classnames for reference
|
|
@@ -114,18 +116,6 @@ EuiTab.propTypes = {
|
|
|
114
116
|
* Will be excluded from interactive effects.
|
|
115
117
|
*/
|
|
116
118
|
append: PropTypes.node,
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Evenly stretches each tab to fill the
|
|
120
|
-
* horizontal space
|
|
121
|
-
*/
|
|
122
|
-
expand: PropTypes.bool,
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Sizes affect both font size and overall size.
|
|
126
|
-
* Only use the `xl` size when displayed as page titles.
|
|
127
|
-
*/
|
|
128
|
-
size: PropTypes.any,
|
|
129
119
|
className: PropTypes.string,
|
|
130
120
|
"aria-label": PropTypes.string,
|
|
131
121
|
"data-test-subj": PropTypes.string,
|
|
@@ -239,18 +239,6 @@ EuiTabbedContent.propTypes = {
|
|
|
239
239
|
* Will be excluded from interactive effects.
|
|
240
240
|
*/
|
|
241
241
|
append: PropTypes.node,
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Evenly stretches each tab to fill the
|
|
245
|
-
* horizontal space
|
|
246
|
-
*/
|
|
247
|
-
expand: PropTypes.bool,
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Sizes affect both font size and overall size.
|
|
251
|
-
* Only use the `xl` size when displayed as page titles.
|
|
252
|
-
*/
|
|
253
|
-
size: PropTypes.any,
|
|
254
242
|
className: PropTypes.string,
|
|
255
243
|
"aria-label": PropTypes.string,
|
|
256
244
|
"data-test-subj": PropTypes.string,
|
|
@@ -269,8 +257,6 @@ EuiTabbedContent.propTypes = {
|
|
|
269
257
|
disabled: PropTypes.bool,
|
|
270
258
|
prepend: PropTypes.node,
|
|
271
259
|
append: PropTypes.node,
|
|
272
|
-
expand: PropTypes.bool,
|
|
273
|
-
size: PropTypes.any,
|
|
274
260
|
className: PropTypes.string,
|
|
275
261
|
"aria-label": PropTypes.string,
|
|
276
262
|
"data-test-subj": PropTypes.string,
|
|
@@ -290,8 +276,6 @@ EuiTabbedContent.propTypes = {
|
|
|
290
276
|
disabled: PropTypes.bool,
|
|
291
277
|
prepend: PropTypes.node,
|
|
292
278
|
append: PropTypes.node,
|
|
293
|
-
expand: PropTypes.bool,
|
|
294
|
-
size: PropTypes.any,
|
|
295
279
|
className: PropTypes.string,
|
|
296
280
|
"aria-label": PropTypes.string,
|
|
297
281
|
"data-test-subj": PropTypes.string,
|
|
@@ -16,8 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
import React, { forwardRef } from 'react';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
18
|
import { useEuiTheme } from '../../services';
|
|
19
|
-
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
20
19
|
import { euiTabsStyles } from './tabs.styles';
|
|
20
|
+
import { EuiTabsContext } from './tabs_context';
|
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
22
|
export var SIZES = ['s', 'm', 'l', 'xl'];
|
|
23
23
|
export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -35,21 +35,17 @@ export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
35
|
var classes = classNames('euiTabs', className);
|
|
36
36
|
var styles = euiTabsStyles(euiTheme);
|
|
37
37
|
var cssStyles = [styles.euiTabs, styles[size], bottomBorder && styles.bottomBorder];
|
|
38
|
-
var tabItems = React.Children.map(children, function (child) {
|
|
39
|
-
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
40
|
-
return cloneElementWithCss(child, {
|
|
41
|
-
// we're passing the parent `size` and `expand` down to the children
|
|
42
|
-
size: size,
|
|
43
|
-
expand: expand
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
38
|
return ___EmotionJSX("div", _extends({
|
|
48
39
|
ref: ref,
|
|
49
40
|
className: classes,
|
|
50
41
|
css: cssStyles
|
|
51
42
|
}, children && {
|
|
52
43
|
role: 'tablist'
|
|
53
|
-
}, rest),
|
|
44
|
+
}, rest), ___EmotionJSX(EuiTabsContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
expand: expand,
|
|
47
|
+
size: size
|
|
48
|
+
}
|
|
49
|
+
}, children));
|
|
54
50
|
});
|
|
55
51
|
EuiTabs.displayName = 'EuiTabs';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { createContext } from 'react';
|
|
9
|
+
export var contextDefaults = {
|
|
10
|
+
expand: false,
|
|
11
|
+
size: 'm'
|
|
12
|
+
};
|
|
13
|
+
export var EuiTabsContext = /*#__PURE__*/createContext(contextDefaults);
|
package/eui.d.ts
CHANGED
|
@@ -13479,11 +13479,18 @@ declare module '@elastic/eui/src/components/tabs/tabs' {
|
|
|
13479
13479
|
children?: React.ReactNode;
|
|
13480
13480
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
13481
13481
|
|
|
13482
|
+
}
|
|
13483
|
+
declare module '@elastic/eui/src/components/tabs/tabs_context' {
|
|
13484
|
+
|
|
13485
|
+
import { EuiTabsProps } from '@elastic/eui/src/components/tabs/tabs';
|
|
13486
|
+
export type EuiTabsContextValues = Required<Pick<EuiTabsProps, 'expand' | 'size'>>;
|
|
13487
|
+
export const contextDefaults: EuiTabsContextValues;
|
|
13488
|
+
export const EuiTabsContext: import("react").Context<Required<Pick<EuiTabsProps, "size" | "expand">>>;
|
|
13489
|
+
|
|
13482
13490
|
}
|
|
13483
13491
|
declare module '@elastic/eui/src/components/tabs/tab' {
|
|
13484
13492
|
import { MouseEventHandler, AnchorHTMLAttributes, ButtonHTMLAttributes, FunctionComponent, ReactNode } from 'react';
|
|
13485
13493
|
import { CommonProps, ExclusiveUnion } from '@elastic/eui/src/components/common';
|
|
13486
|
-
import { EuiTabsProps, EuiTabsSizes } from '@elastic/eui/src/components/tabs/tabs';
|
|
13487
13494
|
export interface EuiTabProps extends CommonProps {
|
|
13488
13495
|
isSelected?: boolean;
|
|
13489
13496
|
disabled?: boolean;
|
|
@@ -13497,16 +13504,6 @@ declare module '@elastic/eui/src/components/tabs/tab' {
|
|
|
13497
13504
|
* Will be excluded from interactive effects.
|
|
13498
13505
|
*/
|
|
13499
13506
|
append?: ReactNode;
|
|
13500
|
-
/**
|
|
13501
|
-
* Evenly stretches each tab to fill the
|
|
13502
|
-
* horizontal space
|
|
13503
|
-
*/
|
|
13504
|
-
expand?: EuiTabsProps['expand'];
|
|
13505
|
-
/**
|
|
13506
|
-
* Sizes affect both font size and overall size.
|
|
13507
|
-
* Only use the `xl` size when displayed as page titles.
|
|
13508
|
-
*/
|
|
13509
|
-
size?: EuiTabsSizes;
|
|
13510
13507
|
} type EuiTabPropsForAnchor = EuiTabProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick' | 'href'> & {
|
|
13511
13508
|
href?: string;
|
|
13512
13509
|
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
@@ -13950,14 +13947,26 @@ declare module '@elastic/eui/src/components/date_picker/auto_refresh/refresh_int
|
|
|
13950
13947
|
|
|
13951
13948
|
}
|
|
13952
13949
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover' {
|
|
13953
|
-
import {
|
|
13950
|
+
import { FunctionComponent, ReactNode, ReactElement } from 'react';
|
|
13951
|
+
import { EuiQuickSelect } from '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select';
|
|
13952
|
+
import { EuiCommonlyUsedTimeRanges } from '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges';
|
|
13953
|
+
import { EuiRecentlyUsed } from '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover/recently_used';
|
|
13954
|
+
import { EuiRefreshInterval } from '@elastic/eui/src/components/date_picker/auto_refresh/refresh_interval';
|
|
13954
13955
|
import { TimeOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/time_options';
|
|
13955
13956
|
import { DurationRange, ApplyRefreshInterval, ApplyTime, QuickSelect, QuickSelectPanel } from '@elastic/eui/src/components/date_picker/types';
|
|
13957
|
+
export type CustomQuickSelectRenderOptions = {
|
|
13958
|
+
quickSelect: ReactElement<typeof EuiQuickSelect>;
|
|
13959
|
+
commonlyUsedRanges: ReactElement<typeof EuiCommonlyUsedTimeRanges>;
|
|
13960
|
+
recentlyUsedRanges: ReactElement<typeof EuiRecentlyUsed>;
|
|
13961
|
+
refreshInterval?: ReactElement<typeof EuiRefreshInterval>;
|
|
13962
|
+
customQuickSelectPanels?: ReactNode;
|
|
13963
|
+
};
|
|
13956
13964
|
export interface EuiQuickSelectPopoverProps {
|
|
13957
13965
|
applyRefreshInterval?: ApplyRefreshInterval;
|
|
13958
13966
|
applyTime: ApplyTime;
|
|
13959
13967
|
commonlyUsedRanges: DurationRange[];
|
|
13960
13968
|
customQuickSelectPanels?: QuickSelectPanel[];
|
|
13969
|
+
customQuickSelectRender?: (options: CustomQuickSelectRenderOptions) => ReactNode;
|
|
13961
13970
|
dateFormat: string;
|
|
13962
13971
|
end: string;
|
|
13963
13972
|
isDisabled: boolean;
|
|
@@ -13967,20 +13976,10 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/quick_
|
|
|
13967
13976
|
start: string;
|
|
13968
13977
|
timeOptions: TimeOptions;
|
|
13969
13978
|
}
|
|
13970
|
-
|
|
13971
|
-
|
|
13979
|
+
export const EuiQuickSelectPopover: FunctionComponent<EuiQuickSelectPopoverProps>;
|
|
13980
|
+
export const EuiQuickSelectPanels: FunctionComponent<Omit<EuiQuickSelectPopoverProps, 'isDisabled'> & {
|
|
13972
13981
|
prevQuickSelect?: QuickSelect;
|
|
13973
|
-
}
|
|
13974
|
-
export class EuiQuickSelectPopover extends Component<EuiQuickSelectPopoverProps, EuiQuickSelectPopoverState> {
|
|
13975
|
-
state: EuiQuickSelectPopoverState;
|
|
13976
|
-
closePopover: () => void;
|
|
13977
|
-
togglePopover: () => void;
|
|
13978
|
-
applyTime: ApplyTime;
|
|
13979
|
-
renderDateTimeSections: () => JSX.Element;
|
|
13980
|
-
renderCustomQuickSelectPanels: () => JSX.Element[] | null;
|
|
13981
|
-
render(): JSX.Element;
|
|
13982
|
-
}
|
|
13983
|
-
export {};
|
|
13982
|
+
}>;
|
|
13984
13983
|
|
|
13985
13984
|
}
|
|
13986
13985
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover' {
|
|
@@ -14182,13 +14181,14 @@ declare module '@elastic/eui/src/components/date_picker/auto_refresh/auto_refres
|
|
|
14182
14181
|
|
|
14183
14182
|
}
|
|
14184
14183
|
declare module '@elastic/eui/src/components/date_picker/super_date_picker/super_date_picker' {
|
|
14185
|
-
import { Component, FocusEventHandler, FunctionComponent } from 'react';
|
|
14184
|
+
import { Component, FocusEventHandler, FunctionComponent, ReactNode } from 'react';
|
|
14186
14185
|
import { LocaleSpecifier } from 'moment';
|
|
14187
14186
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
14188
14187
|
import { ShortDate, Milliseconds, DurationRange, ApplyTime, ApplyRefreshInterval, QuickSelectPanel } from '@elastic/eui/src/components/date_picker/types';
|
|
14189
14188
|
import { TimeOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/time_options';
|
|
14190
14189
|
import { AsyncInterval } from '@elastic/eui/src/components/date_picker/super_date_picker/async_interval';
|
|
14191
14190
|
import { EuiSuperUpdateButtonProps } from '@elastic/eui/src/components/date_picker/super_date_picker/super_update_button';
|
|
14191
|
+
import { CustomQuickSelectRenderOptions } from '@elastic/eui/src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover';
|
|
14192
14192
|
import { EuiDatePopoverContentProps } from '@elastic/eui/src/components/date_picker/super_date_picker/date_popover/date_popover_content';
|
|
14193
14193
|
export interface OnTimeChangeProps extends DurationRange {
|
|
14194
14194
|
isInvalid: boolean;
|
|
@@ -14200,6 +14200,12 @@ declare module '@elastic/eui/src/components/date_picker/super_date_picker/super_
|
|
|
14200
14200
|
export type EuiSuperDatePickerProps = CommonProps & {
|
|
14201
14201
|
commonlyUsedRanges?: DurationRange[];
|
|
14202
14202
|
customQuickSelectPanels?: QuickSelectPanel[];
|
|
14203
|
+
/**
|
|
14204
|
+
* An optional render prop function that allows customizing the display of the Quick Select menu.
|
|
14205
|
+
* This function passes all default quick select panels within an object, allowing you to
|
|
14206
|
+
* re-order panels, omit certain panels entirely, or pass in your own fully custom content.
|
|
14207
|
+
*/
|
|
14208
|
+
customQuickSelectRender?: (options: CustomQuickSelectRenderOptions) => ReactNode;
|
|
14203
14209
|
/**
|
|
14204
14210
|
* Specifies the formatted used when displaying dates and/or datetimes
|
|
14205
14211
|
*/
|
|
@@ -15331,7 +15337,7 @@ declare module '@elastic/eui/src/components/markdown_editor/markdown_types' {
|
|
|
15331
15337
|
import { ComponentType, ReactNode } from 'react';
|
|
15332
15338
|
import { VFile } from 'vfile';
|
|
15333
15339
|
import { Node as UnistNode, Position as UnistPosition } from 'unist';
|
|
15334
|
-
import { Parser } from 'remark-parse';
|
|
15340
|
+
import { Parser } from 'remark-parse-no-trim';
|
|
15335
15341
|
import { VFileMessage } from 'vfile-message';
|
|
15336
15342
|
import { IconType } from '@elastic/eui/src/components/icon';
|
|
15337
15343
|
export interface RemarkParser {
|
|
@@ -17946,9 +17952,10 @@ declare module '@elastic/eui/src/components/selectable/selectable_list/selectabl
|
|
|
17946
17952
|
*/
|
|
17947
17953
|
searchValue: string;
|
|
17948
17954
|
/**
|
|
17949
|
-
* Returns the array of options with altered checked state
|
|
17955
|
+
* Returns the array of options with altered checked state, the click/keyboard event,
|
|
17956
|
+
* and the option that triggered the click/keyboard event
|
|
17950
17957
|
*/
|
|
17951
|
-
onOptionClick: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent) => void;
|
|
17958
|
+
onOptionClick: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent, clickedOption: EuiSelectableOption<T>) => void;
|
|
17952
17959
|
/**
|
|
17953
17960
|
* Custom render for the label portion of the option;
|
|
17954
17961
|
* Takes (option, searchValue), returns ReactNode
|
|
@@ -18037,9 +18044,10 @@ declare module '@elastic/eui/src/components/selectable/selectable' {
|
|
|
18037
18044
|
options: Array<EuiSelectableOption<T>>;
|
|
18038
18045
|
/**
|
|
18039
18046
|
* Passes back the altered `options` array with selected options having `checked: 'on'`.
|
|
18040
|
-
* Also passes back the React click/keyboard event as a second argument
|
|
18047
|
+
* Also passes back the React click/keyboard event as a second argument,
|
|
18048
|
+
* and the option that triggered the onChange event as a third argument.
|
|
18041
18049
|
*/
|
|
18042
|
-
onChange?: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent) => void;
|
|
18050
|
+
onChange?: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent, changedOption: EuiSelectableOption<T>) => void;
|
|
18043
18051
|
/**
|
|
18044
18052
|
* Passes back the current active option whenever the user changes the currently
|
|
18045
18053
|
* highlighted option via keyboard navigation or searching.
|
|
@@ -18133,7 +18141,7 @@ declare module '@elastic/eui/src/components/selectable/selectable' {
|
|
|
18133
18141
|
incrementActiveOptionIndex: (amount: number) => void;
|
|
18134
18142
|
onSearchChange: (searchValue: string, visibleOptions: Array<EuiSelectableOption<T>>) => void;
|
|
18135
18143
|
onContainerBlur: (e: React.FocusEvent) => void;
|
|
18136
|
-
onOptionClick: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent) => void;
|
|
18144
|
+
onOptionClick: (options: Array<EuiSelectableOption<T>>, event: EuiSelectableOnChangeEvent, clickedOption: EuiSelectableOption<T>) => void;
|
|
18137
18145
|
scrollToItem: (index: number, align?: Align | undefined) => void;
|
|
18138
18146
|
makeOptionId: (index?: number | undefined) => string;
|
|
18139
18147
|
render(): JSX.Element;
|
|
@@ -25815,6 +25823,7 @@ declare module '@elastic/eui' {
|
|
|
25815
25823
|
"euiPrettyInterval.daysShorthand": any;
|
|
25816
25824
|
"euiPrettyInterval.off": any;
|
|
25817
25825
|
"euiCommonlyUsedTimeRanges.legend": any;
|
|
25826
|
+
"euiQuickSelectPopover.buttonLabel": any;
|
|
25818
25827
|
"euiQuickSelect.legendText": any;
|
|
25819
25828
|
"euiQuickSelect.quickSelectTitle": any;
|
|
25820
25829
|
"euiQuickSelect.previousLabel": any;
|
package/i18ntokens.json
CHANGED
|
@@ -3151,6 +3151,22 @@
|
|
|
3151
3151
|
},
|
|
3152
3152
|
"filepath": "src/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.tsx"
|
|
3153
3153
|
},
|
|
3154
|
+
{
|
|
3155
|
+
"token": "euiQuickSelectPopover.buttonLabel",
|
|
3156
|
+
"defString": "Date quick select",
|
|
3157
|
+
"highlighting": "string",
|
|
3158
|
+
"loc": {
|
|
3159
|
+
"start": {
|
|
3160
|
+
"line": 86,
|
|
3161
|
+
"column": 22
|
|
3162
|
+
},
|
|
3163
|
+
"end": {
|
|
3164
|
+
"line": 89,
|
|
3165
|
+
"column": 3
|
|
3166
|
+
}
|
|
3167
|
+
},
|
|
3168
|
+
"filepath": "src/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.tsx"
|
|
3169
|
+
},
|
|
3154
3170
|
{
|
|
3155
3171
|
"token": "euiQuickSelect.legendText",
|
|
3156
3172
|
"defString": "Quick select a time range",
|
|
@@ -5349,11 +5365,11 @@
|
|
|
5349
5365
|
"highlighting": "string",
|
|
5350
5366
|
"loc": {
|
|
5351
5367
|
"start": {
|
|
5352
|
-
"line":
|
|
5368
|
+
"line": 570,
|
|
5353
5369
|
"column": 16
|
|
5354
5370
|
},
|
|
5355
5371
|
"end": {
|
|
5356
|
-
"line":
|
|
5372
|
+
"line": 573,
|
|
5357
5373
|
"column": 18
|
|
5358
5374
|
}
|
|
5359
5375
|
},
|
|
@@ -5365,11 +5381,11 @@
|
|
|
5365
5381
|
"highlighting": "string",
|
|
5366
5382
|
"loc": {
|
|
5367
5383
|
"start": {
|
|
5368
|
-
"line":
|
|
5384
|
+
"line": 592,
|
|
5369
5385
|
"column": 14
|
|
5370
5386
|
},
|
|
5371
5387
|
"end": {
|
|
5372
|
-
"line":
|
|
5388
|
+
"line": 596,
|
|
5373
5389
|
"column": 16
|
|
5374
5390
|
}
|
|
5375
5391
|
},
|
|
@@ -5381,11 +5397,11 @@
|
|
|
5381
5397
|
"highlighting": "string",
|
|
5382
5398
|
"loc": {
|
|
5383
5399
|
"start": {
|
|
5384
|
-
"line":
|
|
5400
|
+
"line": 611,
|
|
5385
5401
|
"column": 14
|
|
5386
5402
|
},
|
|
5387
5403
|
"end": {
|
|
5388
|
-
"line":
|
|
5404
|
+
"line": 614,
|
|
5389
5405
|
"column": 16
|
|
5390
5406
|
}
|
|
5391
5407
|
},
|
|
@@ -5397,11 +5413,11 @@
|
|
|
5397
5413
|
"highlighting": "string",
|
|
5398
5414
|
"loc": {
|
|
5399
5415
|
"start": {
|
|
5400
|
-
"line":
|
|
5416
|
+
"line": 676,
|
|
5401
5417
|
"column": 6
|
|
5402
5418
|
},
|
|
5403
5419
|
"end": {
|
|
5404
|
-
"line":
|
|
5420
|
+
"line": 676,
|
|
5405
5421
|
"column": 78
|
|
5406
5422
|
}
|
|
5407
5423
|
},
|
|
@@ -5413,11 +5429,11 @@
|
|
|
5413
5429
|
"highlighting": "code",
|
|
5414
5430
|
"loc": {
|
|
5415
5431
|
"start": {
|
|
5416
|
-
"line":
|
|
5432
|
+
"line": 703,
|
|
5417
5433
|
"column": 6
|
|
5418
5434
|
},
|
|
5419
5435
|
"end": {
|
|
5420
|
-
"line":
|
|
5436
|
+
"line": 709,
|
|
5421
5437
|
"column": 8
|
|
5422
5438
|
}
|
|
5423
5439
|
},
|
|
@@ -5429,11 +5445,11 @@
|
|
|
5429
5445
|
"highlighting": "string",
|
|
5430
5446
|
"loc": {
|
|
5431
5447
|
"start": {
|
|
5432
|
-
"line":
|
|
5448
|
+
"line": 721,
|
|
5433
5449
|
"column": 6
|
|
5434
5450
|
},
|
|
5435
5451
|
"end": {
|
|
5436
|
-
"line":
|
|
5452
|
+
"line": 730,
|
|
5437
5453
|
"column": 7
|
|
5438
5454
|
}
|
|
5439
5455
|
},
|
|
@@ -5445,11 +5461,11 @@
|
|
|
5445
5461
|
"highlighting": "string",
|
|
5446
5462
|
"loc": {
|
|
5447
5463
|
"start": {
|
|
5448
|
-
"line":
|
|
5464
|
+
"line": 721,
|
|
5449
5465
|
"column": 6
|
|
5450
5466
|
},
|
|
5451
5467
|
"end": {
|
|
5452
|
-
"line":
|
|
5468
|
+
"line": 730,
|
|
5453
5469
|
"column": 7
|
|
5454
5470
|
}
|
|
5455
5471
|
},
|
|
@@ -241,7 +241,9 @@ var EuiRefreshInterval = /*#__PURE__*/function (_Component) {
|
|
|
241
241
|
units = _this$state5.units;
|
|
242
242
|
return (0, _react2.jsx)(_time_options.RenderI18nTimeOptions, null, function (_ref3) {
|
|
243
243
|
var refreshUnitsOptions = _ref3.refreshUnitsOptions;
|
|
244
|
-
return (0, _react2.jsx)("fieldset",
|
|
244
|
+
return (0, _react2.jsx)("fieldset", {
|
|
245
|
+
className: "euiQuickSelectPopover__panel"
|
|
246
|
+
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
245
247
|
alignItems: "center",
|
|
246
248
|
gutterSize: "s",
|
|
247
249
|
responsive: false,
|
|
@@ -56,10 +56,13 @@ var EuiCommonlyUsedTimeRanges = function EuiCommonlyUsedTimeRanges(_ref) {
|
|
|
56
56
|
"data-test-subj": dataTestSubj
|
|
57
57
|
}, label));
|
|
58
58
|
});
|
|
59
|
-
return (0, _react2.jsx)("fieldset",
|
|
59
|
+
return (0, _react2.jsx)("fieldset", {
|
|
60
|
+
className: "euiQuickSelectPopover__panel"
|
|
61
|
+
}, (0, _react2.jsx)(_title.EuiTitle, {
|
|
60
62
|
size: "xxxs"
|
|
61
63
|
}, (0, _react2.jsx)("legend", {
|
|
62
|
-
id: legendId
|
|
64
|
+
id: legendId,
|
|
65
|
+
className: "euiQuickSelectPopover__panelTitle"
|
|
63
66
|
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
64
67
|
token: "euiCommonlyUsedTimeRanges.legend",
|
|
65
68
|
default: "Commonly used"
|
|
@@ -209,7 +209,9 @@ var EuiQuickSelect = /*#__PURE__*/function (_Component) {
|
|
|
209
209
|
return value === timeUnits;
|
|
210
210
|
});
|
|
211
211
|
var timeUnit = matchedTimeUnit ? matchedTimeUnit.text : '';
|
|
212
|
-
return (0, _react2.jsx)("fieldset",
|
|
212
|
+
return (0, _react2.jsx)("fieldset", {
|
|
213
|
+
className: "euiQuickSelectPopover__panel"
|
|
214
|
+
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
213
215
|
token: "euiQuickSelect.legendText",
|
|
214
216
|
default: "Quick select a time range"
|
|
215
217
|
}, function (legendText) {
|