@elastic/eui 87.0.0 → 87.1.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/es/components/accordion/accordion.js +82 -35
- package/es/components/auto_sizer/index.js +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +2 -3
- package/es/components/breadcrumbs/breadcrumbs.js +2 -3
- package/es/components/code/code_block_virtualized.js +25 -17
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/es/components/control_bar/control_bar.js +2 -3
- package/es/components/date_picker/date_picker_range.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +0 -1
- package/es/components/flyout/flyout.js +9 -7
- package/es/components/flyout/flyout_body.js +15 -3
- package/es/components/form/range/dual_range.js +33 -6
- package/es/components/form/range/range.js +31 -6
- package/es/components/form/super_select/super_select.js +1 -1
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -3
- package/es/components/header/header_links/header_links.js +2 -3
- package/es/components/page/page_header/page_header_content.js +2 -3
- package/es/components/page/page_sidebar/page_sidebar.js +2 -2
- package/es/components/page_template/page_template.js +12 -4
- package/es/components/popover/input_popover.js +24 -9
- package/es/components/popover/popover.js +4 -6
- package/es/components/selectable/selectable_list/selectable_list.js +97 -79
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/components/tool_tip/tool_tip.js +4 -14
- package/es/components/tool_tip/tool_tip_anchor.js +5 -14
- package/es/components/tour/tour_step.js +2 -3
- package/eui.d.ts +85 -37
- package/i18ntokens.json +54 -36
- package/lib/components/accordion/accordion.js +82 -35
- package/lib/components/auto_sizer/index.js +11 -7
- package/lib/components/breadcrumbs/breadcrumb.js +2 -3
- package/lib/components/code/code_block_virtualized.js +25 -17
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/lib/components/date_picker/date_picker_range.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +0 -1
- package/lib/components/flyout/flyout.js +9 -7
- package/lib/components/flyout/flyout_body.js +15 -3
- package/lib/components/form/range/dual_range.js +33 -6
- package/lib/components/form/range/range.js +14 -6
- package/lib/components/form/super_select/super_select.js +1 -1
- package/lib/components/page/page_sidebar/page_sidebar.js +1 -1
- package/lib/components/page_template/page_template.js +12 -4
- package/lib/components/popover/input_popover.js +23 -8
- package/lib/components/popover/popover.js +4 -6
- package/lib/components/selectable/selectable_list/selectable_list.js +97 -79
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/components/tool_tip/tool_tip.js +4 -14
- package/lib/components/tool_tip/tool_tip_anchor.js +5 -13
- package/optimize/es/components/accordion/accordion.js +82 -35
- package/optimize/es/components/auto_sizer/index.js +1 -1
- package/optimize/es/components/code/code_block_virtualized.js +25 -17
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
- package/optimize/es/components/date_picker/date_picker_range.js +5 -2
- package/optimize/es/components/flyout/flyout.js +9 -7
- package/optimize/es/components/flyout/flyout_body.js +4 -2
- package/optimize/es/components/form/range/dual_range.js +7 -4
- package/optimize/es/components/form/range/range.js +5 -4
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -2
- package/optimize/es/components/page_template/page_template.js +12 -4
- package/optimize/es/components/popover/input_popover.js +13 -8
- package/optimize/es/components/popover/popover.js +2 -3
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +97 -79
- package/optimize/es/components/tool_tip/tool_tip.js +3 -13
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +4 -8
- package/optimize/lib/components/accordion/accordion.js +82 -35
- package/optimize/lib/components/auto_sizer/index.js +11 -7
- package/optimize/lib/components/code/code_block_virtualized.js +25 -17
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
- package/optimize/lib/components/date_picker/date_picker_range.js +5 -2
- package/optimize/lib/components/flyout/flyout.js +9 -7
- package/optimize/lib/components/flyout/flyout_body.js +4 -2
- package/optimize/lib/components/form/range/dual_range.js +7 -4
- package/optimize/lib/components/form/range/range.js +5 -4
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +1 -1
- package/optimize/lib/components/page_template/page_template.js +12 -4
- package/optimize/lib/components/popover/input_popover.js +12 -7
- package/optimize/lib/components/popover/popover.js +2 -3
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +97 -79
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -13
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +4 -8
- package/package.json +7 -9
- package/test-env/components/accordion/accordion.js +82 -35
- package/test-env/components/auto_sizer/index.js +11 -7
- package/test-env/components/breadcrumbs/breadcrumb.js +2 -3
- package/test-env/components/code/code_block_virtualized.js +25 -17
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
- package/test-env/components/date_picker/date_picker_range.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +0 -1
- package/test-env/components/flyout/flyout_body.js +15 -3
- package/test-env/components/form/range/dual_range.js +33 -6
- package/test-env/components/form/range/range.js +14 -6
- package/test-env/components/form/super_select/super_select.js +1 -1
- package/test-env/components/page/page_sidebar/page_sidebar.js +1 -1
- package/test-env/components/page_template/page_template.js +12 -4
- package/test-env/components/popover/input_popover.js +23 -8
- package/test-env/components/popover/popover.js +4 -6
- package/test-env/components/selectable/selectable_list/selectable_list.js +97 -79
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/components/tool_tip/tool_tip.js +4 -14
- package/test-env/components/tool_tip/tool_tip_anchor.js +5 -11
|
@@ -7,7 +7,6 @@ exports.POSITIONS = exports.EuiToolTip = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _common = require("../common");
|
|
11
10
|
var _services = require("../../services");
|
|
12
11
|
var _react2 = require("../../services/react");
|
|
13
12
|
var _resize_observer = require("../observer/resize_observer");
|
|
@@ -44,22 +43,13 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
44
43
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
45
44
|
* Side Public License, v 1.
|
|
46
45
|
*/
|
|
47
|
-
var
|
|
48
|
-
top: 'euiToolTip--top',
|
|
49
|
-
right: 'euiToolTip--right',
|
|
50
|
-
bottom: 'euiToolTip--bottom',
|
|
51
|
-
left: 'euiToolTip--left'
|
|
52
|
-
};
|
|
53
|
-
var POSITIONS = (0, _common.keysOf)(positionsToClassNameMap);
|
|
46
|
+
var POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
54
47
|
exports.POSITIONS = POSITIONS;
|
|
48
|
+
var DISPLAYS = ['inlineBlock', 'block'];
|
|
55
49
|
var delayToMsMap = {
|
|
56
50
|
regular: 250,
|
|
57
51
|
long: 250 * 5
|
|
58
52
|
};
|
|
59
|
-
var displayToClassNameMap = {
|
|
60
|
-
inlineBlock: undefined,
|
|
61
|
-
block: 'euiToolTipAnchor--displayBlock'
|
|
62
|
-
};
|
|
63
53
|
var DEFAULT_TOOLTIP_STYLES = {
|
|
64
54
|
// position the tooltip content near the top-left
|
|
65
55
|
// corner of the window so it can't create scrollbars
|
|
@@ -270,7 +260,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
270
260
|
onFocus: this.onFocus,
|
|
271
261
|
onMouseOver: this.showToolTip,
|
|
272
262
|
onMouseOut: this.onMouseOut,
|
|
273
|
-
id:
|
|
263
|
+
id: id,
|
|
274
264
|
className: anchorClasses,
|
|
275
265
|
display: display,
|
|
276
266
|
isVisible: visible
|
|
@@ -333,7 +323,7 @@ EuiToolTip.propTypes = {
|
|
|
333
323
|
/**
|
|
334
324
|
* Common display alternatives for the anchor wrapper
|
|
335
325
|
*/
|
|
336
|
-
display: _propTypes.default.
|
|
326
|
+
display: _propTypes.default.any,
|
|
337
327
|
/**
|
|
338
328
|
* Delay before showing tooltip. Good for repeatable items.
|
|
339
329
|
*/
|
|
@@ -22,11 +22,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
22
22
|
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); }
|
|
23
23
|
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; }
|
|
24
24
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
25
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
30
25
|
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; }
|
|
31
26
|
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; }
|
|
32
27
|
var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
@@ -52,7 +47,7 @@ var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
52
47
|
className: classes,
|
|
53
48
|
onMouseOver: onMouseOver,
|
|
54
49
|
onMouseOut: onMouseOut
|
|
55
|
-
}), /*#__PURE__*/(0, _react.cloneElement)(children,
|
|
50
|
+
}), /*#__PURE__*/(0, _react.cloneElement)(children, {
|
|
56
51
|
onFocus: function onFocus(e) {
|
|
57
52
|
_onFocus();
|
|
58
53
|
children.props.onFocus && children.props.onFocus(e);
|
|
@@ -60,18 +55,15 @@ var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
60
55
|
onBlur: function onBlur(e) {
|
|
61
56
|
_onBlur();
|
|
62
57
|
children.props.onBlur && children.props.onBlur(e);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})))
|
|
58
|
+
},
|
|
59
|
+
'aria-describedby': isVisible ? (0, _classnames.default)(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
60
|
+
}))
|
|
67
61
|
);
|
|
68
62
|
});
|
|
69
63
|
exports.EuiToolTipAnchor = EuiToolTipAnchor;
|
|
70
64
|
EuiToolTipAnchor.propTypes = {
|
|
71
65
|
onBlur: _propTypes.default.func.isRequired,
|
|
72
66
|
onFocus: _propTypes.default.func.isRequired,
|
|
73
|
-
|
|
74
|
-
isVisible: _propTypes.default.bool.isRequired,
|
|
75
|
-
display: _propTypes.default.oneOf(["block", "inlineBlock"]).isRequired
|
|
67
|
+
isVisible: _propTypes.default.bool.isRequired
|
|
76
68
|
};
|
|
77
69
|
EuiToolTipAnchor.displayName = 'EuiToolTipAnchor';
|
|
@@ -20,6 +20,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20
20
|
|
|
21
21
|
import React, { Component } from 'react';
|
|
22
22
|
import classNames from 'classnames';
|
|
23
|
+
import { tabbable } from 'tabbable';
|
|
23
24
|
import { EuiLoadingSpinner } from '../loading';
|
|
24
25
|
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
25
26
|
import { EuiText } from '../text';
|
|
@@ -42,33 +43,68 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
42
43
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
43
44
|
_defineProperty(_assertThisInitialized(_this), "childContent", null);
|
|
44
45
|
_defineProperty(_assertThisInitialized(_this), "childWrapper", null);
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "tabbableChildren", null);
|
|
45
47
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
46
48
|
isOpen: _this.props.forceState ? _this.props.forceState === 'open' : _this.props.initialIsOpen
|
|
47
49
|
});
|
|
48
50
|
_defineProperty(_assertThisInitialized(_this), "setChildContentHeight", function () {
|
|
49
|
-
var forceState = _this.props.forceState;
|
|
50
51
|
requestAnimationFrame(function () {
|
|
51
|
-
var height = _this.childContent &&
|
|
52
|
+
var height = _this.childContent && _this.isOpen ? _this.childContent.clientHeight : 0;
|
|
52
53
|
_this.childWrapper && _this.childWrapper.setAttribute('style', logicalCSS('height', "".concat(height, "px")));
|
|
53
54
|
});
|
|
54
55
|
});
|
|
55
56
|
_defineProperty(_assertThisInitialized(_this), "onToggle", function () {
|
|
56
57
|
var forceState = _this.props.forceState;
|
|
57
58
|
if (forceState) {
|
|
58
|
-
_this
|
|
59
|
+
var _this$props$onToggle, _this$props;
|
|
60
|
+
(_this$props$onToggle = (_this$props = _this.props).onToggle) === null || _this$props$onToggle === void 0 ? void 0 : _this$props$onToggle.call(_this$props, forceState === 'open' ? false : true);
|
|
59
61
|
} else {
|
|
60
62
|
_this.setState(function (prevState) {
|
|
61
63
|
return {
|
|
62
64
|
isOpen: !prevState.isOpen
|
|
63
65
|
};
|
|
64
66
|
}, function () {
|
|
67
|
+
var _this$props$onToggle2, _this$props2;
|
|
65
68
|
if (_this.state.isOpen && _this.childWrapper) {
|
|
66
69
|
_this.childWrapper.focus();
|
|
67
70
|
}
|
|
68
|
-
_this.props.onToggle
|
|
71
|
+
(_this$props$onToggle2 = (_this$props2 = _this.props).onToggle) === null || _this$props$onToggle2 === void 0 ? void 0 : _this$props$onToggle2.call(_this$props2, _this.state.isOpen);
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
74
|
});
|
|
75
|
+
// When accordions are closed, tabbable children should not be present in the tab order
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "preventTabbing", function () {
|
|
77
|
+
if (_this.childContent) {
|
|
78
|
+
// Re-check for children on every close - content can change dynamically
|
|
79
|
+
_this.tabbableChildren = tabbable(_this.childContent);
|
|
80
|
+
_this.tabbableChildren.forEach(function (element) {
|
|
81
|
+
// If the element has an existing `tabIndex` set, make sure we can restore it
|
|
82
|
+
var originalTabIndex = element.getAttribute('tabIndex');
|
|
83
|
+
if (originalTabIndex) {
|
|
84
|
+
element.setAttribute('data-original-tabindex', originalTabIndex);
|
|
85
|
+
}
|
|
86
|
+
element.setAttribute('tabIndex', '-1');
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(_assertThisInitialized(_this), "enableTabbing", function () {
|
|
91
|
+
// If no tabbable children were set, we don't need to re-enable anything
|
|
92
|
+
if (_this.tabbableChildren) {
|
|
93
|
+
_this.tabbableChildren.forEach(function (element) {
|
|
94
|
+
var originalTabIndex = element.getAttribute('data-original-tabindex');
|
|
95
|
+
if (originalTabIndex) {
|
|
96
|
+
// If the element originally had an existing `tabIndex` set, restore it
|
|
97
|
+
element.setAttribute('tabIndex', originalTabIndex);
|
|
98
|
+
element.removeAttribute('data-original-tabindex');
|
|
99
|
+
} else {
|
|
100
|
+
// If not, remove the tabIndex property
|
|
101
|
+
element.removeAttribute('tabIndex');
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
// Cleanup - unset the list of children
|
|
105
|
+
_this.tabbableChildren = null;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
72
108
|
_defineProperty(_assertThisInitialized(_this), "setChildContentRef", function (node) {
|
|
73
109
|
_this.childContent = node;
|
|
74
110
|
});
|
|
@@ -83,44 +119,55 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
83
119
|
return _this;
|
|
84
120
|
}
|
|
85
121
|
_createClass(EuiAccordionClass, [{
|
|
122
|
+
key: "isOpen",
|
|
123
|
+
get: function get() {
|
|
124
|
+
return this.props.forceState ? this.props.forceState === 'open' : this.state.isOpen;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
86
127
|
key: "componentDidMount",
|
|
87
128
|
value: function componentDidMount() {
|
|
88
129
|
this.setChildContentHeight();
|
|
130
|
+
if (!this.isOpen) this.preventTabbing();
|
|
89
131
|
}
|
|
90
132
|
}, {
|
|
91
133
|
key: "componentDidUpdate",
|
|
92
|
-
value: function componentDidUpdate() {
|
|
134
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
93
135
|
this.setChildContentHeight();
|
|
136
|
+
if (prevProps.forceState === 'open' && this.props.forceState === 'closed' || prevState.isOpen === true && this.state.isOpen === false) {
|
|
137
|
+
this.preventTabbing();
|
|
138
|
+
}
|
|
139
|
+
if (prevProps.forceState === 'closed' && this.props.forceState === 'open' || prevState.isOpen === false && this.state.isOpen === true) {
|
|
140
|
+
this.enableTabbing();
|
|
141
|
+
}
|
|
94
142
|
}
|
|
95
143
|
}, {
|
|
96
144
|
key: "render",
|
|
97
145
|
value: function render() {
|
|
98
146
|
var _buttonProps$id,
|
|
99
147
|
_this2 = this;
|
|
100
|
-
var _this$
|
|
101
|
-
children = _this$
|
|
102
|
-
buttonContent = _this$
|
|
103
|
-
className = _this$
|
|
104
|
-
id = _this$
|
|
105
|
-
_this$
|
|
106
|
-
Element = _this$
|
|
107
|
-
buttonClassName = _this$
|
|
108
|
-
buttonContentClassName = _this$
|
|
109
|
-
extraAction = _this$
|
|
110
|
-
paddingSize = _this$
|
|
111
|
-
initialIsOpen = _this$
|
|
112
|
-
arrowDisplay = _this$
|
|
113
|
-
forceState = _this$
|
|
114
|
-
isLoading = _this$
|
|
115
|
-
isLoadingMessage = _this$
|
|
116
|
-
isDisabled = _this$
|
|
117
|
-
buttonProps = _this$
|
|
118
|
-
_this$
|
|
119
|
-
_ButtonElement = _this$
|
|
120
|
-
arrowProps = _this$
|
|
121
|
-
theme = _this$
|
|
122
|
-
rest = _objectWithoutProperties(_this$
|
|
123
|
-
var isOpen = forceState ? forceState === 'open' : this.state.isOpen;
|
|
148
|
+
var _this$props3 = this.props,
|
|
149
|
+
children = _this$props3.children,
|
|
150
|
+
buttonContent = _this$props3.buttonContent,
|
|
151
|
+
className = _this$props3.className,
|
|
152
|
+
id = _this$props3.id,
|
|
153
|
+
_this$props3$element = _this$props3.element,
|
|
154
|
+
Element = _this$props3$element === void 0 ? 'div' : _this$props3$element,
|
|
155
|
+
buttonClassName = _this$props3.buttonClassName,
|
|
156
|
+
buttonContentClassName = _this$props3.buttonContentClassName,
|
|
157
|
+
extraAction = _this$props3.extraAction,
|
|
158
|
+
paddingSize = _this$props3.paddingSize,
|
|
159
|
+
initialIsOpen = _this$props3.initialIsOpen,
|
|
160
|
+
arrowDisplay = _this$props3.arrowDisplay,
|
|
161
|
+
forceState = _this$props3.forceState,
|
|
162
|
+
isLoading = _this$props3.isLoading,
|
|
163
|
+
isLoadingMessage = _this$props3.isLoadingMessage,
|
|
164
|
+
isDisabled = _this$props3.isDisabled,
|
|
165
|
+
buttonProps = _this$props3.buttonProps,
|
|
166
|
+
_this$props3$buttonEl = _this$props3.buttonElement,
|
|
167
|
+
_ButtonElement = _this$props3$buttonEl === void 0 ? 'button' : _this$props3$buttonEl,
|
|
168
|
+
arrowProps = _this$props3.arrowProps,
|
|
169
|
+
theme = _this$props3.theme,
|
|
170
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
124
171
|
|
|
125
172
|
// Force button element to be a legend if the element is a fieldset
|
|
126
173
|
var ButtonElement = Element === 'fieldset' ? 'legend' : _ButtonElement;
|
|
@@ -129,7 +176,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
129
176
|
// Force visibility of arrow button if button element is not focusable
|
|
130
177
|
var _arrowDisplay = arrowDisplay === 'none' && !buttonElementIsFocusable ? 'left' : arrowDisplay;
|
|
131
178
|
var classes = classNames('euiAccordion', {
|
|
132
|
-
'euiAccordion-isOpen': isOpen
|
|
179
|
+
'euiAccordion-isOpen': this.isOpen
|
|
133
180
|
}, className);
|
|
134
181
|
var childrenClasses = classNames('euiAccordion__children', {
|
|
135
182
|
'euiAccordion__children-isLoading': isLoading
|
|
@@ -137,7 +184,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
137
184
|
var buttonClasses = classNames('euiAccordion__button', buttonClassName, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className);
|
|
138
185
|
var buttonContentClasses = classNames('euiAccordion__buttonContent', buttonContentClassName);
|
|
139
186
|
var iconButtonClasses = classNames('euiAccordion__iconButton', {
|
|
140
|
-
'euiAccordion__iconButton-isOpen': isOpen,
|
|
187
|
+
'euiAccordion__iconButton-isOpen': this.isOpen,
|
|
141
188
|
'euiAccordion__iconButton--right': _arrowDisplay === 'right'
|
|
142
189
|
}, arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.className);
|
|
143
190
|
|
|
@@ -147,9 +194,9 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
147
194
|
var childrenStyles = euiAccordionChildrenStyles(theme);
|
|
148
195
|
var cssChildrenStyles = [childrenStyles.euiAccordion__children, isLoading && childrenStyles.isLoading, paddingSize && paddingSize !== 'none' && childrenStyles[paddingSize]];
|
|
149
196
|
var childWrapperStyles = euiAccordionChildWrapperStyles(theme);
|
|
150
|
-
var cssChildWrapperStyles = [childWrapperStyles.euiAccordion__childWrapper, isOpen && childWrapperStyles.isOpen];
|
|
197
|
+
var cssChildWrapperStyles = [childWrapperStyles.euiAccordion__childWrapper, this.isOpen && childWrapperStyles.isOpen];
|
|
151
198
|
var iconButtonStyles = euiAccordionIconButtonStyles(theme);
|
|
152
|
-
var cssIconButtonStyles = [iconButtonStyles.euiAccordion__iconButton, isOpen && iconButtonStyles.isOpen, _arrowDisplay === 'right' && iconButtonStyles.arrowRight, arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.css];
|
|
199
|
+
var cssIconButtonStyles = [iconButtonStyles.euiAccordion__iconButton, this.isOpen && iconButtonStyles.isOpen, _arrowDisplay === 'right' && iconButtonStyles.arrowRight, arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.css];
|
|
153
200
|
var optionalActionStyles = euiAccordionOptionalActionStyles();
|
|
154
201
|
var cssOptionalActionStyles = [optionalActionStyles.euiAccordion__optionalAction];
|
|
155
202
|
var spinnerStyles = euiAccordionSpinnerStyles(theme);
|
|
@@ -167,7 +214,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
167
214
|
iconType: "arrowRight",
|
|
168
215
|
onClick: this.onToggle,
|
|
169
216
|
"aria-controls": id,
|
|
170
|
-
"aria-expanded": isOpen,
|
|
217
|
+
"aria-expanded": this.isOpen,
|
|
171
218
|
"aria-labelledby": buttonId,
|
|
172
219
|
tabIndex: buttonElementIsFocusable ? -1 : 0,
|
|
173
220
|
isDisabled: isDisabled
|
|
@@ -201,7 +248,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
201
248
|
"aria-controls": id
|
|
202
249
|
// `aria-expanded` is only a valid attribute on interactive controls - axe-core throws a violation otherwise
|
|
203
250
|
,
|
|
204
|
-
"aria-expanded": ButtonElement === 'button' ? isOpen : undefined,
|
|
251
|
+
"aria-expanded": ButtonElement === 'button' ? this.isOpen : undefined,
|
|
205
252
|
onClick: isDisabled ? undefined : this.onToggle,
|
|
206
253
|
type: ButtonElement === 'button' ? 'button' : undefined,
|
|
207
254
|
disabled: ButtonElement === 'button' ? isDisabled : undefined
|
|
@@ -44,26 +44,34 @@ export var EuiCodeBlockVirtualized = function EuiCodeBlockVirtualized(_ref) {
|
|
|
44
44
|
}, codeProps));
|
|
45
45
|
});
|
|
46
46
|
}, [codeProps]);
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var virtualizationProps = {
|
|
48
|
+
itemData: data,
|
|
49
|
+
itemSize: rowHeight,
|
|
50
|
+
itemCount: data.length,
|
|
51
|
+
outerElementType: VirtualizedOuterElement,
|
|
52
|
+
innerElementType: VirtualizedInnerElement
|
|
53
|
+
};
|
|
54
|
+
return typeof overflowHeight === 'number' ? ___EmotionJSX(EuiAutoSizer, {
|
|
55
|
+
disableHeight: true
|
|
49
56
|
}, function (_ref4) {
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
var width = _ref4.width;
|
|
58
|
+
return ___EmotionJSX(FixedSizeList, _extends({
|
|
59
|
+
height: overflowHeight,
|
|
60
|
+
width: width
|
|
61
|
+
}, virtualizationProps), ListRow);
|
|
62
|
+
}) : ___EmotionJSX(EuiAutoSizer, null, function (_ref5) {
|
|
63
|
+
var height = _ref5.height,
|
|
64
|
+
width = _ref5.width;
|
|
65
|
+
return ___EmotionJSX(FixedSizeList, _extends({
|
|
66
|
+
height: height,
|
|
67
|
+
width: width
|
|
68
|
+
}, virtualizationProps), ListRow);
|
|
61
69
|
});
|
|
62
70
|
};
|
|
63
|
-
var ListRow = function ListRow(
|
|
64
|
-
var data =
|
|
65
|
-
index =
|
|
66
|
-
style =
|
|
71
|
+
var ListRow = function ListRow(_ref6) {
|
|
72
|
+
var data = _ref6.data,
|
|
73
|
+
index = _ref6.index,
|
|
74
|
+
style = _ref6.style;
|
|
67
75
|
var row = data[index];
|
|
68
76
|
row.properties.style = logicalStyles(style);
|
|
69
77
|
return nodeToHtml(row, index, data, 0);
|
|
@@ -19,6 +19,7 @@ import classNames from 'classnames';
|
|
|
19
19
|
import { useEuiTheme, useGeneratedHtmlId, throttle } from '../../services';
|
|
20
20
|
import { mathWithUnits, logicalStyle } from '../../global_styling';
|
|
21
21
|
import { EuiFlyout } from '../flyout';
|
|
22
|
+
import { useEuiI18n } from '../i18n';
|
|
22
23
|
import { euiHeaderVariables } from '../header/header.styles';
|
|
23
24
|
import { EuiCollapsibleNavContext } from './context';
|
|
24
25
|
import { EuiCollapsibleNavButton } from './collapsible_nav_button';
|
|
@@ -122,6 +123,7 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
122
123
|
conditionalId: id,
|
|
123
124
|
suffix: 'euiCollapsibleNav'
|
|
124
125
|
});
|
|
126
|
+
var defaultAriaLabel = useEuiI18n('euiCollapsibleNavBeta.ariaLabel', 'Site menu');
|
|
125
127
|
var buttonRef = useRef(null);
|
|
126
128
|
var focusTrapProps = useMemo(function () {
|
|
127
129
|
return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
@@ -133,7 +135,9 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
133
135
|
var cssStyles = [styles.euiCollapsibleNavBeta, styles[side], isPush && styles.isPush, isPush && isCollapsed && styles.isPushCollapsed, isOverlayFullWidth && styles.isOverlayFullWidth];
|
|
134
136
|
|
|
135
137
|
// Wait for any fixed headers to be queried before rendering (prevents position jumping)
|
|
136
|
-
var flyout = fixedHeadersCount !== false && ___EmotionJSX(EuiFlyout, _extends({
|
|
138
|
+
var flyout = fixedHeadersCount !== false && ___EmotionJSX(EuiFlyout, _extends({
|
|
139
|
+
"aria-label": defaultAriaLabel
|
|
140
|
+
}, rest, {
|
|
137
141
|
// EuiCollapsibleNav is significantly less permissive than EuiFlyout
|
|
138
142
|
id: flyoutID,
|
|
139
143
|
css: cssStyles,
|
|
@@ -49,7 +49,8 @@ export var EuiCollapsedNavButton = function EuiCollapsedNavButton(_ref) {
|
|
|
49
49
|
size: "s",
|
|
50
50
|
color: "text",
|
|
51
51
|
href: href,
|
|
52
|
-
onClick: onClick
|
|
52
|
+
onClick: onClick,
|
|
53
|
+
"aria-label": title
|
|
53
54
|
}, linkProps, {
|
|
54
55
|
// Exclusive union shenanigans
|
|
55
56
|
className: buttonClassName,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "startDateControl", "endDateControl", "iconType", "inline", "shadow", "fullWidth", "isCustom", "readOnly", "isLoading", "isInvalid", "disabled", "onFocus", "onBlur", "append", "prepend"];
|
|
3
|
+
var _excluded = ["children", "className", "startDateControl", "endDateControl", "iconType", "inline", "shadow", "fullWidth", "compressed", "isCustom", "readOnly", "isLoading", "isInvalid", "disabled", "onFocus", "onBlur", "append", "prepend"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -26,6 +26,7 @@ export var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
|
|
|
26
26
|
_ref$shadow = _ref.shadow,
|
|
27
27
|
shadow = _ref$shadow === void 0 ? true : _ref$shadow,
|
|
28
28
|
_fullWidth = _ref.fullWidth,
|
|
29
|
+
_compressed = _ref.compressed,
|
|
29
30
|
isCustom = _ref.isCustom,
|
|
30
31
|
readOnly = _ref.readOnly,
|
|
31
32
|
isLoading = _ref.isLoading,
|
|
@@ -36,8 +37,9 @@ export var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
|
|
|
36
37
|
append = _ref.append,
|
|
37
38
|
prepend = _ref.prepend,
|
|
38
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
-
// `fullWidth` should not affect inline datepickers (matches non-range behavior)
|
|
40
|
+
// `fullWidth` and `compressed` should not affect inline datepickers (matches non-range behavior)
|
|
40
41
|
var fullWidth = _fullWidth && !inline;
|
|
42
|
+
var compressed = _compressed && !inline;
|
|
41
43
|
var classes = classNames('euiDatePickerRange', className);
|
|
42
44
|
var euiTheme = useEuiTheme();
|
|
43
45
|
var styles = euiDatePickerRangeStyles(euiTheme);
|
|
@@ -109,6 +111,7 @@ export var EuiDatePickerRange = function EuiDatePickerRange(_ref) {
|
|
|
109
111
|
startControl: startControl,
|
|
110
112
|
endControl: endControl,
|
|
111
113
|
fullWidth: fullWidth,
|
|
114
|
+
compressed: compressed,
|
|
112
115
|
readOnly: readOnly,
|
|
113
116
|
isDisabled: disabled,
|
|
114
117
|
isInvalid: isInvalid,
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
|
|
6
|
+
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap", "aria-describedby"];
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
9
|
/*
|
|
@@ -70,6 +70,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
70
|
_focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
|
|
71
71
|
_ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
|
|
72
72
|
includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
|
|
73
|
+
_ariaDescribedBy = _ref['aria-describedby'],
|
|
73
74
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
74
75
|
var Element = as || defaultElement;
|
|
75
76
|
var maskRef = useRef(null);
|
|
@@ -203,6 +204,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
203
204
|
*/
|
|
204
205
|
var hasOverlayMask = ownFocus && !isPushed;
|
|
205
206
|
var descriptionId = useGeneratedHtmlId();
|
|
207
|
+
var ariaDescribedBy = classnames(descriptionId, _ariaDescribedBy);
|
|
206
208
|
var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
207
209
|
id: descriptionId
|
|
208
210
|
}, hasOverlayMask ? ___EmotionJSX(EuiI18n, {
|
|
@@ -247,15 +249,15 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
247
249
|
clickOutsideDisables: !ownFocus,
|
|
248
250
|
onClickOutside: onClickOutside
|
|
249
251
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
250
|
-
css: cssStyles
|
|
251
|
-
}, rest, {
|
|
252
|
-
role: "dialog",
|
|
253
252
|
className: classes,
|
|
254
|
-
|
|
255
|
-
"data-autofocus": true,
|
|
256
|
-
"aria-describedby": !isPushed ? descriptionId : undefined,
|
|
253
|
+
css: cssStyles,
|
|
257
254
|
style: newStyle,
|
|
258
255
|
ref: setRef
|
|
256
|
+
}, rest, {
|
|
257
|
+
role: !isPushed ? 'dialog' : rest.role,
|
|
258
|
+
tabIndex: !isPushed ? 0 : rest.tabIndex,
|
|
259
|
+
"aria-describedby": !isPushed ? ariaDescribedBy : _ariaDescribedBy,
|
|
260
|
+
"data-autofocus": !isPushed || undefined
|
|
259
261
|
}), !isPushed && screenReaderDescription, closeButton, children));
|
|
260
262
|
|
|
261
263
|
// If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "banner"];
|
|
3
|
+
var _excluded = ["children", "className", "banner", "scrollableTabIndex"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -18,6 +18,8 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
|
|
|
18
18
|
var children = _ref.children,
|
|
19
19
|
className = _ref.className,
|
|
20
20
|
banner = _ref.banner,
|
|
21
|
+
_ref$scrollableTabInd = _ref.scrollableTabIndex,
|
|
22
|
+
scrollableTabIndex = _ref$scrollableTabInd === void 0 ? 0 : _ref$scrollableTabInd,
|
|
21
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
24
|
var classes = classNames('euiFlyoutBody', className);
|
|
23
25
|
var euiTheme = useEuiTheme();
|
|
@@ -29,7 +31,7 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
|
|
|
29
31
|
className: classes,
|
|
30
32
|
css: cssStyles
|
|
31
33
|
}, rest), ___EmotionJSX("div", {
|
|
32
|
-
tabIndex:
|
|
34
|
+
tabIndex: scrollableTabIndex,
|
|
33
35
|
className: "euiFlyoutBody__overflow",
|
|
34
36
|
css: overflowCssStyles
|
|
35
37
|
}, banner && ___EmotionJSX("div", {
|
|
@@ -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 = ["className", "css", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "onBlur", "onChange", "onFocus", "showRange", "value", "isInvalid", "append", "prepend", "minInputProps", "maxInputProps", "isDraggable", "theme"];
|
|
10
|
+
var _excluded = ["className", "css", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "onBlur", "onChange", "onFocus", "showRange", "value", "isInvalid", "append", "prepend", "minInputProps", "maxInputProps", "inputPopoverProps", "isDraggable", "theme"];
|
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
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); }; }
|
|
@@ -259,9 +259,11 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
259
259
|
});
|
|
260
260
|
});
|
|
261
261
|
_defineProperty(_assertThisInitialized(_this), "onResize", function (width) {
|
|
262
|
+
var _this$props$inputPopo, _this$props$inputPopo2;
|
|
262
263
|
_this.setState({
|
|
263
264
|
rangeWidth: width
|
|
264
265
|
});
|
|
266
|
+
(_this$props$inputPopo = _this.props.inputPopoverProps) === null || _this$props$inputPopo === void 0 ? void 0 : (_this$props$inputPopo2 = _this$props$inputPopo.onPanelResize) === null || _this$props$inputPopo2 === void 0 ? void 0 : _this$props$inputPopo2.call(_this$props$inputPopo, width);
|
|
265
267
|
});
|
|
266
268
|
_defineProperty(_assertThisInitialized(_this), "getNearestStep", function (value) {
|
|
267
269
|
var min = _this.props.min;
|
|
@@ -378,6 +380,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
378
380
|
prepend = _this$props.prepend,
|
|
379
381
|
minInputProps = _this$props.minInputProps,
|
|
380
382
|
maxInputProps = _this$props.maxInputProps,
|
|
383
|
+
inputPopoverProps = _this$props.inputPopoverProps,
|
|
381
384
|
isDraggable = _this$props.isDraggable,
|
|
382
385
|
theme = _this$props.theme,
|
|
383
386
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
@@ -618,8 +621,8 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
618
621
|
className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
|
|
619
622
|
css: showTicks || ticks ? rangeStyles.euiRange__slimHorizontalSpacer : rangeStyles.euiRange__horizontalSpacer
|
|
620
623
|
}), maxInput));
|
|
621
|
-
var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, {
|
|
622
|
-
className:
|
|
624
|
+
var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, _extends({}, inputPopoverProps, {
|
|
625
|
+
className: classNames('euiDualRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
|
|
623
626
|
input: ___EmotionJSX(EuiFormControlLayoutDelimited, {
|
|
624
627
|
startControl: minInput,
|
|
625
628
|
endControl: maxInput,
|
|
@@ -638,7 +641,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
638
641
|
disableFocusTrap: true,
|
|
639
642
|
onPanelResize: this.onResize,
|
|
640
643
|
popoverScreenReaderText: dualSliderScreenReaderInstructions
|
|
641
|
-
}, theRange) : undefined;
|
|
644
|
+
}), theRange) : undefined;
|
|
642
645
|
return thePopover || theRange;
|
|
643
646
|
}
|
|
644
647
|
}]);
|
|
@@ -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 = ["className", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "showRange", "showValue", "valueAppend", "valuePrepend", "onBlur", "onChange", "onFocus", "value", "tabIndex", "isInvalid", "theme"];
|
|
10
|
+
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "inputPopoverProps", "showTicks", "tickInterval", "ticks", "levels", "showRange", "showValue", "valueAppend", "valuePrepend", "onBlur", "onChange", "onFocus", "value", "tabIndex", "isInvalid", "theme"];
|
|
11
11
|
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); }; }
|
|
12
12
|
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; } }
|
|
13
13
|
/*
|
|
@@ -114,6 +114,7 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
114
114
|
step = _this$props.step,
|
|
115
115
|
showLabels = _this$props.showLabels,
|
|
116
116
|
showInput = _this$props.showInput,
|
|
117
|
+
inputPopoverProps = _this$props.inputPopoverProps,
|
|
117
118
|
showTicks = _this$props.showTicks,
|
|
118
119
|
tickInterval = _this$props.tickInterval,
|
|
119
120
|
ticks = _this$props.ticks,
|
|
@@ -226,8 +227,8 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
226
227
|
className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
|
|
227
228
|
css: showTicks || ticks ? styles.euiRange__slimHorizontalSpacer : styles.euiRange__horizontalSpacer
|
|
228
229
|
}), theInput));
|
|
229
|
-
var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, {
|
|
230
|
-
className:
|
|
230
|
+
var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, _extends({}, inputPopoverProps, {
|
|
231
|
+
className: classNames('euiRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
|
|
231
232
|
input: theInput // `showInputOnly` confirms existence
|
|
232
233
|
,
|
|
233
234
|
fullWidth: fullWidth,
|
|
@@ -235,7 +236,7 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
|
235
236
|
closePopover: this.closePopover,
|
|
236
237
|
disableFocusTrap: true,
|
|
237
238
|
popoverScreenReaderText: sliderScreenReaderInstructions
|
|
238
|
-
}, theRange) : undefined;
|
|
239
|
+
}), theRange) : undefined;
|
|
239
240
|
return thePopover ? thePopover : theRange;
|
|
240
241
|
}
|
|
241
242
|
}]);
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, {
|
|
17
|
+
import React, { useLayoutEffect, useState } from 'react';
|
|
18
18
|
import { logicalStyle, useEuiPaddingCSS } from '../../../global_styling';
|
|
19
19
|
import { useEuiTheme, useIsWithinBreakpoints } from '../../../services';
|
|
20
20
|
import { euiPageSidebarStyles } from './page_sidebar.styles';
|
|
@@ -42,7 +42,7 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
|
|
|
42
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
43
|
inlineStyles = _useState2[0],
|
|
44
44
|
setInlineStyles = _useState2[1];
|
|
45
|
-
|
|
45
|
+
useLayoutEffect(function () {
|
|
46
46
|
var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
|
|
47
47
|
if (sticky) {
|
|
48
48
|
var _document$body$datase;
|