@elastic/eui 114.2.0 → 114.3.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/datagrid/utils/scrolling.js +7 -1
- package/es/components/flyout/flyout.component.js +8 -7
- package/es/components/flyout/hooks.js +11 -3
- package/es/components/flyout/manager/flyout_main.js +4 -2
- package/es/components/icon/assets/chart_pie.js +1 -2
- package/es/components/icon/assets/product_dashboard.js +5 -3
- package/es/components/steps/step_horizontal.js +8 -5
- package/eui.d.ts +4 -2
- package/lib/components/datagrid/utils/scrolling.js +7 -1
- package/lib/components/flyout/flyout.component.js +8 -7
- package/lib/components/flyout/hooks.js +10 -2
- package/lib/components/flyout/manager/flyout_main.js +3 -1
- package/lib/components/icon/assets/chart_pie.js +1 -2
- package/lib/components/icon/assets/product_dashboard.js +5 -3
- package/lib/components/icon/svgs/chart_pie.svg +1 -1
- package/lib/components/icon/svgs/product_dashboard.svg +4 -5
- package/lib/components/steps/step_horizontal.js +8 -5
- package/optimize/es/components/datagrid/utils/scrolling.js +7 -1
- package/optimize/es/components/flyout/flyout.component.js +8 -7
- package/optimize/es/components/flyout/hooks.js +11 -3
- package/optimize/es/components/flyout/manager/flyout_main.js +4 -2
- package/optimize/es/components/icon/assets/chart_pie.js +1 -2
- package/optimize/es/components/icon/assets/product_dashboard.js +5 -3
- package/optimize/es/components/steps/step_horizontal.js +8 -5
- package/optimize/lib/components/datagrid/utils/scrolling.js +7 -1
- package/optimize/lib/components/flyout/flyout.component.js +8 -7
- package/optimize/lib/components/flyout/hooks.js +10 -2
- package/optimize/lib/components/flyout/manager/flyout_main.js +3 -1
- package/optimize/lib/components/icon/assets/chart_pie.js +1 -2
- package/optimize/lib/components/icon/assets/product_dashboard.js +5 -3
- package/optimize/lib/components/icon/svgs/chart_pie.svg +1 -1
- package/optimize/lib/components/icon/svgs/product_dashboard.svg +4 -5
- package/optimize/lib/components/steps/step_horizontal.js +8 -5
- package/package.json +1 -1
- package/test-env/components/datagrid/utils/scrolling.js +7 -1
- package/test-env/components/flyout/flyout.component.js +8 -7
- package/test-env/components/flyout/hooks.js +10 -2
- package/test-env/components/flyout/manager/flyout_main.js +3 -1
- package/test-env/components/icon/assets/chart_pie.js +1 -2
- package/test-env/components/icon/assets/product_dashboard.js +5 -3
- package/test-env/components/steps/step_horizontal.js +8 -5
|
@@ -51,11 +51,17 @@ export var useScroll = function useScroll(args) {
|
|
|
51
51
|
});
|
|
52
52
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
53
53
|
useEffect(function () {
|
|
54
|
-
var handlePointerUp = function handlePointerUp() {
|
|
54
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
55
55
|
var _window;
|
|
56
56
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
57
57
|
pendingScrollRef.current = false;
|
|
58
58
|
|
|
59
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
60
|
+
// click. We only care about the primary (usually left) mouse button
|
|
61
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
62
|
+
// which indicate scrolling on Windows.
|
|
63
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
64
|
+
|
|
59
65
|
// Skip if the interaction resulted in text being selected
|
|
60
66
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
61
67
|
scrollCellIntoView({
|
|
@@ -126,9 +126,16 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
126
126
|
|
|
127
127
|
// Ref for the main flyout element to pass to context
|
|
128
128
|
var internalParentFlyoutRef = useRef(null);
|
|
129
|
+
|
|
130
|
+
// Observe the container's dimensions so the resize hook and
|
|
131
|
+
// positioning styles stay aligned with its bounding rect.
|
|
132
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
133
|
+
var containerDimensions = useResizeObserver(container !== null && container !== void 0 ? container : null, 'width');
|
|
134
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
129
135
|
var isPushed = useIsPushed({
|
|
130
136
|
type: type,
|
|
131
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
137
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
138
|
+
containerWidth: containerReferenceWidth
|
|
132
139
|
});
|
|
133
140
|
// When no explicit container is provided, push padding targets
|
|
134
141
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -234,12 +241,6 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
234
241
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
235
242
|
var siblingFlyoutWidth = layoutMode === LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
236
243
|
|
|
237
|
-
// Observe the container's dimensions so the resize hook and
|
|
238
|
-
// positioning styles stay aligned with its bounding rect.
|
|
239
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
240
|
-
var containerDimensions = useResizeObserver(container !== null && container !== void 0 ? container : null, 'width');
|
|
241
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
242
|
-
|
|
243
244
|
// Track the container's bounding rect for positioning the flyout.
|
|
244
245
|
var _useState = useState(null),
|
|
245
246
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useIsWithinMinBreakpoint } from '../../services';
|
|
9
|
+
import { useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
|
|
10
10
|
import { usePropsWithComponentDefaults } from '../provider/component_defaults';
|
|
11
11
|
import { DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_TYPE } from './const';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
15
|
-
* configuration and the current window size.
|
|
15
|
+
* configuration and the current window or container size.
|
|
16
16
|
*/
|
|
17
17
|
export var useIsPushed = function useIsPushed(props) {
|
|
18
18
|
var _usePropsWithComponen = usePropsWithComponentDefaults('EuiFlyout', props),
|
|
@@ -20,6 +20,14 @@ export var useIsPushed = function useIsPushed(props) {
|
|
|
20
20
|
type = _usePropsWithComponen2 === void 0 ? DEFAULT_TYPE : _usePropsWithComponen2,
|
|
21
21
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
22
22
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
23
|
+
var _useEuiTheme = useEuiTheme(),
|
|
24
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
25
|
+
|
|
26
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
27
|
+
// when no container width is provided or the breakpoint key is
|
|
28
|
+
// not present on the theme.
|
|
23
29
|
var windowIsLargeEnoughToPush = useIsWithinMinBreakpoint(pushMinBreakpoint);
|
|
24
|
-
|
|
30
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
31
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
32
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
25
33
|
};
|
|
@@ -18,7 +18,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
18
18
|
|
|
19
19
|
import React, { forwardRef } from 'react';
|
|
20
20
|
import { EuiManagedFlyout } from './flyout_managed';
|
|
21
|
-
import { useHasChildFlyout, useFlyoutId } from './hooks';
|
|
21
|
+
import { useHasChildFlyout, useFlyoutId, useFlyoutManager } from './hooks';
|
|
22
22
|
import { euiMainFlyoutStyles } from './flyout_main.styles';
|
|
23
23
|
import { useEuiMemoizedStyles } from '../../../services';
|
|
24
24
|
import { DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_SIDE, DEFAULT_TYPE } from '../const';
|
|
@@ -46,9 +46,11 @@ export var EuiFlyoutMain = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
46
46
|
var flyoutId = useFlyoutId(id);
|
|
47
47
|
var hasChildFlyout = useHasChildFlyout(flyoutId);
|
|
48
48
|
var styles = useEuiMemoizedStyles(euiMainFlyoutStyles);
|
|
49
|
+
var context = useFlyoutManager();
|
|
49
50
|
var isPushed = useIsPushed({
|
|
50
51
|
type: type,
|
|
51
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
52
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
53
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
52
54
|
});
|
|
53
55
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
54
56
|
var style = {};
|
|
@@ -27,8 +27,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
27
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
28
|
id: titleId
|
|
29
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
-
|
|
31
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
30
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
32
31
|
}));
|
|
33
32
|
};
|
|
34
33
|
export var icon = EuiIconChartPie;
|
|
@@ -27,9 +27,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
27
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
28
|
id: titleId
|
|
29
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
31
|
+
}), ___EmotionJSX("path", {
|
|
32
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
33
|
+
}), ___EmotionJSX("path", {
|
|
34
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
33
35
|
}));
|
|
34
36
|
};
|
|
35
37
|
export var icon = EuiIconProductDashboard;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size"];
|
|
1
|
+
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size", "aria-label", "aria-labelledby"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
@@ -35,6 +35,8 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
35
35
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
36
36
|
_ref$size = _ref.size,
|
|
37
37
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
38
|
+
ariaLabel = _ref['aria-label'],
|
|
39
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
38
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
39
41
|
if (disabled) status = 'disabled';
|
|
40
42
|
var classes = classNames('euiStepHorizontal', className);
|
|
@@ -44,7 +46,7 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
44
46
|
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
45
47
|
var titleStyles = useEuiMemoizedStyles(euiStepHorizontalTitleStyles);
|
|
46
48
|
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
47
|
-
var
|
|
49
|
+
var labelMap = {
|
|
48
50
|
step: useI18nStep({
|
|
49
51
|
number: step,
|
|
50
52
|
title: title
|
|
@@ -78,14 +80,15 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
78
80
|
title: title
|
|
79
81
|
})
|
|
80
82
|
};
|
|
81
|
-
var
|
|
83
|
+
var ariaLabelAttr = labelMap[status || 'step'];
|
|
82
84
|
var onStepClick = function onStepClick(event) {
|
|
83
|
-
if (!disabled) onClick(event);
|
|
85
|
+
if (!disabled && status !== 'disabled') onClick(event);
|
|
84
86
|
};
|
|
85
87
|
return ___EmotionJSX("button", _extends({
|
|
86
88
|
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
87
89
|
className: classes,
|
|
88
|
-
|
|
90
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ariaLabelledby ? undefined : ariaLabelAttr,
|
|
91
|
+
"aria-labelledby": ariaLabelledby,
|
|
89
92
|
onClick: onStepClick,
|
|
90
93
|
disabled: disabled,
|
|
91
94
|
css: cssStyles,
|
package/eui.d.ts
CHANGED
|
@@ -13477,9 +13477,11 @@ declare module '@elastic/eui/src/components/flyout/hooks' {
|
|
|
13477
13477
|
import { EuiFlyoutProps } from '@elastic/eui/src/components/flyout/flyout';
|
|
13478
13478
|
/**
|
|
13479
13479
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
13480
|
-
* configuration and the current window size.
|
|
13480
|
+
* configuration and the current window or container size.
|
|
13481
13481
|
*/
|
|
13482
|
-
export const useIsPushed: (props: Pick<EuiFlyoutProps, "type" | "pushMinBreakpoint">
|
|
13482
|
+
export const useIsPushed: (props: Pick<EuiFlyoutProps, "type" | "pushMinBreakpoint"> & {
|
|
13483
|
+
containerWidth?: number;
|
|
13484
|
+
}) => boolean;
|
|
13483
13485
|
|
|
13484
13486
|
}
|
|
13485
13487
|
declare module '@elastic/eui/src/components/flyout/manager/flyout_main' {
|
|
@@ -57,11 +57,17 @@ var useScroll = exports.useScroll = function useScroll(args) {
|
|
|
57
57
|
});
|
|
58
58
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
59
59
|
(0, _react.useEffect)(function () {
|
|
60
|
-
var handlePointerUp = function handlePointerUp() {
|
|
60
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
61
61
|
var _window;
|
|
62
62
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
63
63
|
pendingScrollRef.current = false;
|
|
64
64
|
|
|
65
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
66
|
+
// click. We only care about the primary (usually left) mouse button
|
|
67
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
68
|
+
// which indicate scrolling on Windows.
|
|
69
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
70
|
+
|
|
65
71
|
// Skip if the interaction resulted in text being selected
|
|
66
72
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
67
73
|
scrollCellIntoView({
|
|
@@ -133,9 +133,16 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
133
133
|
|
|
134
134
|
// Ref for the main flyout element to pass to context
|
|
135
135
|
var internalParentFlyoutRef = (0, _react.useRef)(null);
|
|
136
|
+
|
|
137
|
+
// Observe the container's dimensions so the resize hook and
|
|
138
|
+
// positioning styles stay aligned with its bounding rect.
|
|
139
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
140
|
+
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
141
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
136
142
|
var isPushed = (0, _hooks.useIsPushed)({
|
|
137
143
|
type: type,
|
|
138
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
144
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
145
|
+
containerWidth: containerReferenceWidth
|
|
139
146
|
});
|
|
140
147
|
// When no explicit container is provided, push padding targets
|
|
141
148
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -241,12 +248,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
241
248
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
242
249
|
var siblingFlyoutWidth = layoutMode === _const.LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
243
250
|
|
|
244
|
-
// Observe the container's dimensions so the resize hook and
|
|
245
|
-
// positioning styles stay aligned with its bounding rect.
|
|
246
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
247
|
-
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
248
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
249
|
-
|
|
250
251
|
// Track the container's bounding rect for positioning the flyout.
|
|
251
252
|
var _useState = (0, _react.useState)(null),
|
|
252
253
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -17,7 +17,7 @@ var _const = require("./const");
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
20
|
-
* configuration and the current window size.
|
|
20
|
+
* configuration and the current window or container size.
|
|
21
21
|
*/
|
|
22
22
|
var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
23
23
|
var _usePropsWithComponen = (0, _component_defaults.usePropsWithComponentDefaults)('EuiFlyout', props),
|
|
@@ -25,6 +25,14 @@ var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
|
25
25
|
type = _usePropsWithComponen2 === void 0 ? _const.DEFAULT_TYPE : _usePropsWithComponen2,
|
|
26
26
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
27
27
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? _const.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
28
|
+
var _useEuiTheme = (0, _services.useEuiTheme)(),
|
|
29
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
30
|
+
|
|
31
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
32
|
+
// when no container width is provided or the breakpoint key is
|
|
33
|
+
// not present on the theme.
|
|
28
34
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
29
|
-
|
|
35
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
36
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
37
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
30
38
|
};
|
|
@@ -52,9 +52,11 @@ var EuiFlyoutMain = exports.EuiFlyoutMain = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
52
52
|
var flyoutId = (0, _hooks.useFlyoutId)(id);
|
|
53
53
|
var hasChildFlyout = (0, _hooks.useHasChildFlyout)(flyoutId);
|
|
54
54
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout_main.euiMainFlyoutStyles);
|
|
55
|
+
var context = (0, _hooks.useFlyoutManager)();
|
|
55
56
|
var isPushed = (0, _hooks2.useIsPushed)({
|
|
56
57
|
type: type,
|
|
57
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
58
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
59
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
58
60
|
});
|
|
59
61
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
60
62
|
var style = {};
|
|
@@ -34,8 +34,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
37
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconChartPie;
|
|
@@ -34,9 +34,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
38
|
+
}), (0, _react2.jsx)("path", {
|
|
39
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
40
|
+
}), (0, _react2.jsx)("path", {
|
|
41
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
var icon = exports.icon = EuiIconProductDashboard;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path d="M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"/>
|
|
3
3
|
</svg>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16"
|
|
2
|
-
<path
|
|
3
|
-
<path
|
|
4
|
-
<path
|
|
5
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2C14.5177 2 14.9438 2.39333 14.9951 2.89746L15 3V5C15 5.55228 14.5523 6 14 6H2C1.44772 6 1 5.55228 1 5V3C1 2.44772 1.44772 2 2 2H14ZM2 5H14V3H2V5Z"/>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path d="m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"/>
|
|
3
|
+
<path d="M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"/>
|
|
4
|
+
<path d="M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"/>
|
|
6
5
|
</svg>
|
|
@@ -12,7 +12,7 @@ var _step_number = require("./step_number");
|
|
|
12
12
|
var _step_strings = require("./step_strings");
|
|
13
13
|
var _step_horizontal = require("./step_horizontal.styles");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
|
-
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size"];
|
|
15
|
+
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size", "aria-label", "aria-labelledby"];
|
|
16
16
|
/*
|
|
17
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -41,6 +41,8 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
41
41
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
42
42
|
_ref$size = _ref.size,
|
|
43
43
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
44
|
+
ariaLabel = _ref['aria-label'],
|
|
45
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
44
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
45
47
|
if (disabled) status = 'disabled';
|
|
46
48
|
var classes = (0, _classnames.default)('euiStepHorizontal', className);
|
|
@@ -50,7 +52,7 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
50
52
|
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
51
53
|
var titleStyles = (0, _services.useEuiMemoizedStyles)(_step_horizontal.euiStepHorizontalTitleStyles);
|
|
52
54
|
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
53
|
-
var
|
|
55
|
+
var labelMap = {
|
|
54
56
|
step: (0, _step_strings.useI18nStep)({
|
|
55
57
|
number: step,
|
|
56
58
|
title: title
|
|
@@ -84,14 +86,15 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
84
86
|
title: title
|
|
85
87
|
})
|
|
86
88
|
};
|
|
87
|
-
var
|
|
89
|
+
var ariaLabelAttr = labelMap[status || 'step'];
|
|
88
90
|
var onStepClick = function onStepClick(event) {
|
|
89
|
-
if (!disabled) onClick(event);
|
|
91
|
+
if (!disabled && status !== 'disabled') onClick(event);
|
|
90
92
|
};
|
|
91
93
|
return (0, _react2.jsx)("button", _extends({
|
|
92
94
|
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
93
95
|
className: classes,
|
|
94
|
-
|
|
96
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ariaLabelledby ? undefined : ariaLabelAttr,
|
|
97
|
+
"aria-labelledby": ariaLabelledby,
|
|
95
98
|
onClick: onStepClick,
|
|
96
99
|
disabled: disabled,
|
|
97
100
|
css: cssStyles,
|
|
@@ -49,11 +49,17 @@ export var useScroll = function useScroll(args) {
|
|
|
49
49
|
});
|
|
50
50
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
51
51
|
useEffect(function () {
|
|
52
|
-
var handlePointerUp = function handlePointerUp() {
|
|
52
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
53
53
|
var _window;
|
|
54
54
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
55
55
|
pendingScrollRef.current = false;
|
|
56
56
|
|
|
57
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
58
|
+
// click. We only care about the primary (usually left) mouse button
|
|
59
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
60
|
+
// which indicate scrolling on Windows.
|
|
61
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
62
|
+
|
|
57
63
|
// Skip if the interaction resulted in text being selected
|
|
58
64
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
59
65
|
scrollCellIntoView({
|
|
@@ -114,9 +114,16 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
114
114
|
|
|
115
115
|
// Ref for the main flyout element to pass to context
|
|
116
116
|
var internalParentFlyoutRef = useRef(null);
|
|
117
|
+
|
|
118
|
+
// Observe the container's dimensions so the resize hook and
|
|
119
|
+
// positioning styles stay aligned with its bounding rect.
|
|
120
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
121
|
+
var containerDimensions = useResizeObserver(container !== null && container !== void 0 ? container : null, 'width');
|
|
122
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
117
123
|
var isPushed = useIsPushed({
|
|
118
124
|
type: type,
|
|
119
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
125
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
126
|
+
containerWidth: containerReferenceWidth
|
|
120
127
|
});
|
|
121
128
|
// When no explicit container is provided, push padding targets
|
|
122
129
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -222,12 +229,6 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
222
229
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
223
230
|
var siblingFlyoutWidth = layoutMode === LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
224
231
|
|
|
225
|
-
// Observe the container's dimensions so the resize hook and
|
|
226
|
-
// positioning styles stay aligned with its bounding rect.
|
|
227
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
228
|
-
var containerDimensions = useResizeObserver(container !== null && container !== void 0 ? container : null, 'width');
|
|
229
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
230
|
-
|
|
231
232
|
// Track the container's bounding rect for positioning the flyout.
|
|
232
233
|
var _useState = useState(null),
|
|
233
234
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useIsWithinMinBreakpoint } from '../../services';
|
|
9
|
+
import { useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
|
|
10
10
|
import { usePropsWithComponentDefaults } from '../provider/component_defaults';
|
|
11
11
|
import { DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_TYPE } from './const';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
15
|
-
* configuration and the current window size.
|
|
15
|
+
* configuration and the current window or container size.
|
|
16
16
|
*/
|
|
17
17
|
export var useIsPushed = function useIsPushed(props) {
|
|
18
18
|
var _usePropsWithComponen = usePropsWithComponentDefaults('EuiFlyout', props),
|
|
@@ -20,6 +20,14 @@ export var useIsPushed = function useIsPushed(props) {
|
|
|
20
20
|
type = _usePropsWithComponen2 === void 0 ? DEFAULT_TYPE : _usePropsWithComponen2,
|
|
21
21
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
22
22
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
23
|
+
var _useEuiTheme = useEuiTheme(),
|
|
24
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
25
|
+
|
|
26
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
27
|
+
// when no container width is provided or the breakpoint key is
|
|
28
|
+
// not present on the theme.
|
|
23
29
|
var windowIsLargeEnoughToPush = useIsWithinMinBreakpoint(pushMinBreakpoint);
|
|
24
|
-
|
|
30
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
31
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
32
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
25
33
|
};
|
|
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
14
|
|
|
15
15
|
import React, { forwardRef } from 'react';
|
|
16
16
|
import { EuiManagedFlyout } from './flyout_managed';
|
|
17
|
-
import { useHasChildFlyout, useFlyoutId } from './hooks';
|
|
17
|
+
import { useHasChildFlyout, useFlyoutId, useFlyoutManager } from './hooks';
|
|
18
18
|
import { euiMainFlyoutStyles } from './flyout_main.styles';
|
|
19
19
|
import { useEuiMemoizedStyles } from '../../../services';
|
|
20
20
|
import { DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_SIDE, DEFAULT_TYPE } from '../const';
|
|
@@ -42,9 +42,11 @@ export var EuiFlyoutMain = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
42
42
|
var flyoutId = useFlyoutId(id);
|
|
43
43
|
var hasChildFlyout = useHasChildFlyout(flyoutId);
|
|
44
44
|
var styles = useEuiMemoizedStyles(euiMainFlyoutStyles);
|
|
45
|
+
var context = useFlyoutManager();
|
|
45
46
|
var isPushed = useIsPushed({
|
|
46
47
|
type: type,
|
|
47
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
48
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
49
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
48
50
|
});
|
|
49
51
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
50
52
|
var style = {};
|
|
@@ -26,8 +26,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
|
|
30
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
29
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
31
30
|
}));
|
|
32
31
|
};
|
|
33
32
|
export var icon = EuiIconChartPie;
|
|
@@ -26,9 +26,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
26
26
|
}, props), title ? ___EmotionJSX("title", {
|
|
27
27
|
id: titleId
|
|
28
28
|
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
30
|
+
}), ___EmotionJSX("path", {
|
|
31
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
32
|
+
}), ___EmotionJSX("path", {
|
|
33
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
32
34
|
}));
|
|
33
35
|
};
|
|
34
36
|
export var icon = EuiIconProductDashboard;
|
|
@@ -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 = ["className", "step", "title", "onClick", "disabled", "status", "size"];
|
|
3
|
+
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size", "aria-label", "aria-labelledby"];
|
|
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
|
|
@@ -33,6 +33,8 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
33
33
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
34
34
|
_ref$size = _ref.size,
|
|
35
35
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
36
|
+
ariaLabel = _ref['aria-label'],
|
|
37
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
36
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
39
|
if (disabled) status = 'disabled';
|
|
38
40
|
var classes = classNames('euiStepHorizontal', className);
|
|
@@ -42,7 +44,7 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
42
44
|
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
43
45
|
var titleStyles = useEuiMemoizedStyles(euiStepHorizontalTitleStyles);
|
|
44
46
|
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
45
|
-
var
|
|
47
|
+
var labelMap = {
|
|
46
48
|
step: useI18nStep({
|
|
47
49
|
number: step,
|
|
48
50
|
title: title
|
|
@@ -76,14 +78,15 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
76
78
|
title: title
|
|
77
79
|
})
|
|
78
80
|
};
|
|
79
|
-
var
|
|
81
|
+
var ariaLabelAttr = labelMap[status || 'step'];
|
|
80
82
|
var onStepClick = function onStepClick(event) {
|
|
81
|
-
if (!disabled) onClick(event);
|
|
83
|
+
if (!disabled && status !== 'disabled') onClick(event);
|
|
82
84
|
};
|
|
83
85
|
return ___EmotionJSX("button", _extends({
|
|
84
86
|
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
85
87
|
className: classes,
|
|
86
|
-
|
|
88
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ariaLabelledby ? undefined : ariaLabelAttr,
|
|
89
|
+
"aria-labelledby": ariaLabelledby,
|
|
87
90
|
onClick: onStepClick,
|
|
88
91
|
disabled: disabled,
|
|
89
92
|
css: cssStyles,
|
|
@@ -59,11 +59,17 @@ var useScroll = exports.useScroll = function useScroll(args) {
|
|
|
59
59
|
});
|
|
60
60
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
61
61
|
(0, _react.useEffect)(function () {
|
|
62
|
-
var handlePointerUp = function handlePointerUp() {
|
|
62
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
63
63
|
var _window;
|
|
64
64
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
65
65
|
pendingScrollRef.current = false;
|
|
66
66
|
|
|
67
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
68
|
+
// click. We only care about the primary (usually left) mouse button
|
|
69
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
70
|
+
// which indicate scrolling on Windows.
|
|
71
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
72
|
+
|
|
67
73
|
// Skip if the interaction resulted in text being selected
|
|
68
74
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
69
75
|
scrollCellIntoView({
|
|
@@ -122,9 +122,16 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
122
122
|
|
|
123
123
|
// Ref for the main flyout element to pass to context
|
|
124
124
|
var internalParentFlyoutRef = (0, _react.useRef)(null);
|
|
125
|
+
|
|
126
|
+
// Observe the container's dimensions so the resize hook and
|
|
127
|
+
// positioning styles stay aligned with its bounding rect.
|
|
128
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
129
|
+
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
130
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
125
131
|
var isPushed = (0, _hooks.useIsPushed)({
|
|
126
132
|
type: type,
|
|
127
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
133
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
134
|
+
containerWidth: containerReferenceWidth
|
|
128
135
|
});
|
|
129
136
|
// When no explicit container is provided, push padding targets
|
|
130
137
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -230,12 +237,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
230
237
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
231
238
|
var siblingFlyoutWidth = layoutMode === _const.LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
232
239
|
|
|
233
|
-
// Observe the container's dimensions so the resize hook and
|
|
234
|
-
// positioning styles stay aligned with its bounding rect.
|
|
235
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
236
|
-
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
237
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
238
|
-
|
|
239
240
|
// Track the container's bounding rect for positioning the flyout.
|
|
240
241
|
var _useState = (0, _react.useState)(null),
|
|
241
242
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -17,7 +17,7 @@ var _const = require("./const");
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
20
|
-
* configuration and the current window size.
|
|
20
|
+
* configuration and the current window or container size.
|
|
21
21
|
*/
|
|
22
22
|
var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
23
23
|
var _usePropsWithComponen = (0, _component_defaults.usePropsWithComponentDefaults)('EuiFlyout', props),
|
|
@@ -25,6 +25,14 @@ var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
|
25
25
|
type = _usePropsWithComponen2 === void 0 ? _const.DEFAULT_TYPE : _usePropsWithComponen2,
|
|
26
26
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
27
27
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? _const.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
28
|
+
var _useEuiTheme = (0, _services.useEuiTheme)(),
|
|
29
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
30
|
+
|
|
31
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
32
|
+
// when no container width is provided or the breakpoint key is
|
|
33
|
+
// not present on the theme.
|
|
28
34
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
29
|
-
|
|
35
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
36
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
37
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
30
38
|
};
|
|
@@ -50,9 +50,11 @@ var EuiFlyoutMain = exports.EuiFlyoutMain = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
50
50
|
var flyoutId = (0, _hooks.useFlyoutId)(id);
|
|
51
51
|
var hasChildFlyout = (0, _hooks.useHasChildFlyout)(flyoutId);
|
|
52
52
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout_main.euiMainFlyoutStyles);
|
|
53
|
+
var context = (0, _hooks.useFlyoutManager)();
|
|
53
54
|
var isPushed = (0, _hooks2.useIsPushed)({
|
|
54
55
|
type: type,
|
|
55
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
56
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
57
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
56
58
|
});
|
|
57
59
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
58
60
|
var style = {};
|
|
@@ -34,8 +34,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
37
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconChartPie;
|
|
@@ -34,9 +34,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
38
|
+
}), (0, _react2.jsx)("path", {
|
|
39
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
40
|
+
}), (0, _react2.jsx)("path", {
|
|
41
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
var icon = exports.icon = EuiIconProductDashboard;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
-
<path
|
|
2
|
+
<path d="M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"/>
|
|
3
3
|
</svg>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16"
|
|
2
|
-
<path
|
|
3
|
-
<path
|
|
4
|
-
<path
|
|
5
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 2C14.5177 2 14.9438 2.39333 14.9951 2.89746L15 3V5C15 5.55228 14.5523 6 14 6H2C1.44772 6 1 5.55228 1 5V3C1 2.44772 1.44772 2 2 2H14ZM2 5H14V3H2V5Z"/>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path d="m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"/>
|
|
3
|
+
<path d="M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"/>
|
|
4
|
+
<path d="M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"/>
|
|
6
5
|
</svg>
|
|
@@ -14,7 +14,7 @@ var _step_number = require("./step_number");
|
|
|
14
14
|
var _step_strings = require("./step_strings");
|
|
15
15
|
var _step_horizontal = require("./step_horizontal.styles");
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size"];
|
|
17
|
+
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size", "aria-label", "aria-labelledby"];
|
|
18
18
|
/*
|
|
19
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
20
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -39,6 +39,8 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
39
39
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
40
40
|
_ref$size = _ref.size,
|
|
41
41
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
42
|
+
ariaLabel = _ref['aria-label'],
|
|
43
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
42
44
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
45
|
if (disabled) status = 'disabled';
|
|
44
46
|
var classes = (0, _classnames.default)('euiStepHorizontal', className);
|
|
@@ -48,7 +50,7 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
48
50
|
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
49
51
|
var titleStyles = (0, _services.useEuiMemoizedStyles)(_step_horizontal.euiStepHorizontalTitleStyles);
|
|
50
52
|
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
51
|
-
var
|
|
53
|
+
var labelMap = {
|
|
52
54
|
step: (0, _step_strings.useI18nStep)({
|
|
53
55
|
number: step,
|
|
54
56
|
title: title
|
|
@@ -82,14 +84,15 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
82
84
|
title: title
|
|
83
85
|
})
|
|
84
86
|
};
|
|
85
|
-
var
|
|
87
|
+
var ariaLabelAttr = labelMap[status || 'step'];
|
|
86
88
|
var onStepClick = function onStepClick(event) {
|
|
87
|
-
if (!disabled) onClick(event);
|
|
89
|
+
if (!disabled && status !== 'disabled') onClick(event);
|
|
88
90
|
};
|
|
89
91
|
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
90
92
|
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
91
93
|
className: classes,
|
|
92
|
-
|
|
94
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ariaLabelledby ? undefined : ariaLabelAttr,
|
|
95
|
+
"aria-labelledby": ariaLabelledby,
|
|
93
96
|
onClick: onStepClick,
|
|
94
97
|
disabled: disabled,
|
|
95
98
|
css: cssStyles,
|
package/package.json
CHANGED
|
@@ -59,11 +59,17 @@ var useScroll = exports.useScroll = function useScroll(args) {
|
|
|
59
59
|
});
|
|
60
60
|
}, [focusedCell, scrollCellIntoView, isPointerDownRef]);
|
|
61
61
|
(0, _react.useEffect)(function () {
|
|
62
|
-
var handlePointerUp = function handlePointerUp() {
|
|
62
|
+
var handlePointerUp = function handlePointerUp(event) {
|
|
63
63
|
var _window;
|
|
64
64
|
if (!pendingScrollRef.current || !focusedCell) return;
|
|
65
65
|
pendingScrollRef.current = false;
|
|
66
66
|
|
|
67
|
+
// The pointerup event can come from any mouse button, not only the left
|
|
68
|
+
// click. We only care about the primary (usually left) mouse button
|
|
69
|
+
// clicks, and specifically have to ignore middle mouse button clicks,
|
|
70
|
+
// which indicate scrolling on Windows.
|
|
71
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
72
|
+
|
|
67
73
|
// Skip if the interaction resulted in text being selected
|
|
68
74
|
if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
|
|
69
75
|
scrollCellIntoView({
|
|
@@ -122,9 +122,16 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
122
122
|
|
|
123
123
|
// Ref for the main flyout element to pass to context
|
|
124
124
|
var internalParentFlyoutRef = (0, _react.useRef)(null);
|
|
125
|
+
|
|
126
|
+
// Observe the container's dimensions so the resize hook and
|
|
127
|
+
// positioning styles stay aligned with its bounding rect.
|
|
128
|
+
// When no container is provided, these remain inert (null/undefined).
|
|
129
|
+
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
130
|
+
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
125
131
|
var isPushed = (0, _hooks.useIsPushed)({
|
|
126
132
|
type: type,
|
|
127
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
133
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
134
|
+
containerWidth: containerReferenceWidth
|
|
128
135
|
});
|
|
129
136
|
// When no explicit container is provided, push padding targets
|
|
130
137
|
// document.body and global push-offset CSS vars are set. When a
|
|
@@ -230,12 +237,6 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
|
|
|
230
237
|
var siblingFlyoutMinWidth = siblingFlyout === null || siblingFlyout === void 0 ? void 0 : siblingFlyout.minWidth;
|
|
231
238
|
var siblingFlyoutWidth = layoutMode === _const.LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
232
239
|
|
|
233
|
-
// Observe the container's dimensions so the resize hook and
|
|
234
|
-
// positioning styles stay aligned with its bounding rect.
|
|
235
|
-
// When no container is provided, these remain inert (null/undefined).
|
|
236
|
-
var containerDimensions = (0, _resize_observer.useResizeObserver)(container !== null && container !== void 0 ? container : null, 'width');
|
|
237
|
-
var containerReferenceWidth = container ? containerDimensions.width || container.clientWidth : undefined;
|
|
238
|
-
|
|
239
240
|
// Track the container's bounding rect for positioning the flyout.
|
|
240
241
|
var _useState = (0, _react.useState)(null),
|
|
241
242
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -17,7 +17,7 @@ var _const = require("./const");
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Determines if a flyout should be rendered in a "pushed" state based on its
|
|
20
|
-
* configuration and the current window size.
|
|
20
|
+
* configuration and the current window or container size.
|
|
21
21
|
*/
|
|
22
22
|
var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
23
23
|
var _usePropsWithComponen = (0, _component_defaults.usePropsWithComponentDefaults)('EuiFlyout', props),
|
|
@@ -25,6 +25,14 @@ var useIsPushed = exports.useIsPushed = function useIsPushed(props) {
|
|
|
25
25
|
type = _usePropsWithComponen2 === void 0 ? _const.DEFAULT_TYPE : _usePropsWithComponen2,
|
|
26
26
|
_usePropsWithComponen3 = _usePropsWithComponen.pushMinBreakpoint,
|
|
27
27
|
pushMinBreakpoint = _usePropsWithComponen3 === void 0 ? _const.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen3;
|
|
28
|
+
var _useEuiTheme = (0, _services.useEuiTheme)(),
|
|
29
|
+
breakpoints = _useEuiTheme.euiTheme.breakpoint;
|
|
30
|
+
|
|
31
|
+
// Always called to satisfy React hook rules; used as fallback
|
|
32
|
+
// when no container width is provided or the breakpoint key is
|
|
33
|
+
// not present on the theme.
|
|
28
34
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
29
|
-
|
|
35
|
+
var minWidth = breakpoints[pushMinBreakpoint];
|
|
36
|
+
var isLargeEnoughToPush = props.containerWidth != null && minWidth != null ? props.containerWidth >= minWidth : windowIsLargeEnoughToPush;
|
|
37
|
+
return type === 'push' && isLargeEnoughToPush;
|
|
30
38
|
};
|
|
@@ -50,9 +50,11 @@ var EuiFlyoutMain = exports.EuiFlyoutMain = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
50
50
|
var flyoutId = (0, _hooks.useFlyoutId)(id);
|
|
51
51
|
var hasChildFlyout = (0, _hooks.useHasChildFlyout)(flyoutId);
|
|
52
52
|
var styles = (0, _services.useEuiMemoizedStyles)(_flyout_main.euiMainFlyoutStyles);
|
|
53
|
+
var context = (0, _hooks.useFlyoutManager)();
|
|
53
54
|
var isPushed = (0, _hooks2.useIsPushed)({
|
|
54
55
|
type: type,
|
|
55
|
-
pushMinBreakpoint: pushMinBreakpoint
|
|
56
|
+
pushMinBreakpoint: pushMinBreakpoint,
|
|
57
|
+
containerWidth: context === null || context === void 0 ? void 0 : context.state.referenceWidth
|
|
56
58
|
});
|
|
57
59
|
var cssStyles = [hasChildFlyout && !isPushed && styles.hasChildFlyout[side]];
|
|
58
60
|
var style = {};
|
|
@@ -34,8 +34,7 @@ var EuiIconChartPie = function EuiIconChartPie(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
d: "M7.5 8.5h6.979A6.498 6.498 0 0 1 1.5 8a6.5 6.5 0 0 1 6-6.48V8.5Zm2-6.824A6.506 6.506 0 0 1 14.323 6.5H9.5V1.676Z"
|
|
37
|
+
d: "M7 2.084A6 6 0 0 0 8 14v1A7 7 0 1 1 8 1v7h7a7 7 0 0 1-7 7v-1a6 6 0 0 0 5.915-5H7V2.084Zm2-1.012A7.002 7.002 0 0 1 14.928 7H9V1.072ZM10 6h3.657A6.015 6.015 0 0 0 10 2.343V6Z"
|
|
39
38
|
}));
|
|
40
39
|
};
|
|
41
40
|
var icon = exports.icon = EuiIconChartPie;
|
|
@@ -34,9 +34,11 @@ var EuiIconProductDashboard = function EuiIconProductDashboard(_ref) {
|
|
|
34
34
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
35
35
|
id: titleId
|
|
36
36
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
d: "m8.528 10.265.972-.972 1.5 1.5 1.646-1.647.707.708L11 12.207l-1.5-1.5-1.028 1.028-3-3.5-2.118 2.119-.708-.708 2.882-2.881 3 3.5Z"
|
|
38
|
+
}), (0, _react2.jsx)("path", {
|
|
39
|
+
d: "M9 8H8V6h1v2Zm2 0h-1V5h1v3Zm2 0h-1V4h1v4ZM7 5H3V4h4v1Z"
|
|
40
|
+
}), (0, _react2.jsx)("path", {
|
|
41
|
+
d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h12ZM2 13h12V3H2v10Z"
|
|
40
42
|
}));
|
|
41
43
|
};
|
|
42
44
|
var icon = exports.icon = EuiIconProductDashboard;
|
|
@@ -15,7 +15,7 @@ var _step_number = require("./step_number");
|
|
|
15
15
|
var _step_strings = require("./step_strings");
|
|
16
16
|
var _step_horizontal = require("./step_horizontal.styles");
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size"];
|
|
18
|
+
var _excluded = ["className", "step", "title", "onClick", "disabled", "status", "size", "aria-label", "aria-labelledby"];
|
|
19
19
|
/*
|
|
20
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -40,6 +40,8 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
40
40
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
41
41
|
_ref$size = _ref.size,
|
|
42
42
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
43
|
+
ariaLabel = _ref['aria-label'],
|
|
44
|
+
ariaLabelledby = _ref['aria-labelledby'],
|
|
43
45
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
46
|
if (disabled) status = 'disabled';
|
|
45
47
|
var classes = (0, _classnames.default)('euiStepHorizontal', className);
|
|
@@ -49,7 +51,7 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
49
51
|
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
50
52
|
var titleStyles = (0, _services.useEuiMemoizedStyles)(_step_horizontal.euiStepHorizontalTitleStyles);
|
|
51
53
|
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
52
|
-
var
|
|
54
|
+
var labelMap = {
|
|
53
55
|
step: (0, _step_strings.useI18nStep)({
|
|
54
56
|
number: step,
|
|
55
57
|
title: title
|
|
@@ -83,14 +85,15 @@ var EuiStepHorizontal = exports.EuiStepHorizontal = function EuiStepHorizontal(_
|
|
|
83
85
|
title: title
|
|
84
86
|
})
|
|
85
87
|
};
|
|
86
|
-
var
|
|
88
|
+
var ariaLabelAttr = labelMap[status || 'step'];
|
|
87
89
|
var onStepClick = function onStepClick(event) {
|
|
88
|
-
if (!disabled) onClick(event);
|
|
90
|
+
if (!disabled && status !== 'disabled') onClick(event);
|
|
89
91
|
};
|
|
90
92
|
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
91
93
|
"aria-disabled": status === 'disabled' ? true : undefined,
|
|
92
94
|
className: classes,
|
|
93
|
-
|
|
95
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ariaLabelledby ? undefined : ariaLabelAttr,
|
|
96
|
+
"aria-labelledby": ariaLabelledby,
|
|
94
97
|
onClick: onStepClick,
|
|
95
98
|
disabled: disabled,
|
|
96
99
|
css: cssStyles,
|