@elastic/eui 76.2.0 → 76.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +0 -23
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -23
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +15 -4
- package/es/components/code/code_block_full_screen.js +2 -0
- package/es/components/flyout/flyout.js +1 -0
- package/es/components/image/image_fullscreen_wrapper.js +2 -0
- package/es/components/key_pad_menu/key_pad_menu.js +10 -1
- package/es/components/key_pad_menu/key_pad_menu.styles.js +33 -0
- package/eui.d.ts +19 -3
- package/lib/components/accessibility/skip_link/skip_link.js +15 -4
- package/lib/components/code/code_block_full_screen.js +2 -0
- package/lib/components/flyout/flyout.js +1 -0
- package/lib/components/image/image_fullscreen_wrapper.js +2 -0
- package/lib/components/key_pad_menu/key_pad_menu.js +12 -1
- package/lib/components/key_pad_menu/key_pad_menu.styles.js +47 -0
- package/optimize/es/components/accessibility/skip_link/skip_link.js +8 -1
- package/optimize/es/components/code/code_block_full_screen.js +2 -0
- package/optimize/es/components/flyout/flyout.js +1 -0
- package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -0
- package/optimize/es/components/key_pad_menu/key_pad_menu.js +10 -1
- package/optimize/es/components/key_pad_menu/key_pad_menu.styles.js +33 -0
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +8 -1
- package/optimize/lib/components/code/code_block_full_screen.js +2 -0
- package/optimize/lib/components/flyout/flyout.js +1 -0
- package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -0
- package/optimize/lib/components/key_pad_menu/key_pad_menu.js +12 -1
- package/optimize/lib/components/key_pad_menu/key_pad_menu.styles.js +47 -0
- package/package.json +1 -1
- package/src/components/key_pad_menu/_index.scss +0 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +15 -4
- package/test-env/components/code/code_block_full_screen.js +2 -0
- package/test-env/components/image/image_fullscreen_wrapper.js +2 -0
- package/test-env/components/key_pad_menu/key_pad_menu.js +12 -1
- package/test-env/components/key_pad_menu/key_pad_menu.styles.js +47 -0
- package/src/components/key_pad_menu/_key_pad_menu.scss +0 -22
|
@@ -47,7 +47,14 @@ export var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
47
47
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
48
48
|
|
|
49
49
|
if (!destinationEl && fallbackDestination) {
|
|
50
|
-
|
|
50
|
+
if (Array.isArray(fallbackDestination)) {
|
|
51
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
52
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
53
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
57
|
+
}
|
|
51
58
|
}
|
|
52
59
|
|
|
53
60
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -108,11 +115,15 @@ EuiSkipLink.propTypes = {
|
|
|
108
115
|
destinationId: PropTypes.string.isRequired,
|
|
109
116
|
|
|
110
117
|
/**
|
|
111
|
-
* If no destination ID element exists or can be found, you may provide a
|
|
112
|
-
*
|
|
118
|
+
* If no destination ID element exists or can be found, you may provide a query selector
|
|
119
|
+
* string to fall back to.
|
|
120
|
+
*
|
|
121
|
+
* For complex applications with potentially variable layouts per page, an array of
|
|
122
|
+
* query selectors can be passed, e.g. `['main', '[role=main]', '.appWrapper']`, which
|
|
123
|
+
* prioritizes looking for multiple fallbacks based on array order.
|
|
113
124
|
* @default main
|
|
114
125
|
*/
|
|
115
|
-
fallbackDestination: PropTypes.string,
|
|
126
|
+
fallbackDestination: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.arrayOf(PropTypes.string.isRequired).isRequired]),
|
|
116
127
|
|
|
117
128
|
/**
|
|
118
129
|
* If default HTML anchor link behavior is not desired (e.g. for SPAs with hash routing),
|
|
@@ -88,6 +88,8 @@ export var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrappe
|
|
|
88
88
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
89
89
|
styles.isFullScreen];
|
|
90
90
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
91
|
+
scrollLock: true,
|
|
92
|
+
preventScrollOnFocus: true,
|
|
91
93
|
clickOutsideDisables: true
|
|
92
94
|
}, ___EmotionJSX("div", {
|
|
93
95
|
className: "euiCodeBlockFullScreen",
|
|
@@ -289,6 +289,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
289
289
|
|
|
290
290
|
var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
|
|
291
291
|
disabled: isPushed,
|
|
292
|
+
scrollLock: ownFocus,
|
|
292
293
|
clickOutsideDisables: !ownFocus,
|
|
293
294
|
onClickOutside: onClickOutside
|
|
294
295
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
@@ -70,6 +70,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
|
|
|
70
70
|
return ___EmotionJSX(EuiOverlayMask, {
|
|
71
71
|
"data-test-subj": "fullScreenOverlayMask"
|
|
72
72
|
}, ___EmotionJSX(EuiFocusTrap, {
|
|
73
|
+
scrollLock: true,
|
|
74
|
+
preventScrollOnFocus: true,
|
|
73
75
|
onClickOutside: closeFullScreen
|
|
74
76
|
}, ___EmotionJSX(React.Fragment, null, ___EmotionJSX("figure", _extends({
|
|
75
77
|
"aria-label": optionalCaptionText,
|
|
@@ -19,6 +19,8 @@ import React from 'react';
|
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import classNames from 'classnames';
|
|
21
21
|
import { EuiFormLabel } from '../form/form_label/form_label';
|
|
22
|
+
import { useEuiTheme } from '../../services';
|
|
23
|
+
import { euiKeyPadMenuStyles } from './key_pad_menu.styles';
|
|
22
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
25
|
export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
24
26
|
var children = _ref.children,
|
|
@@ -27,13 +29,20 @@ export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
|
27
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
30
|
|
|
29
31
|
var classes = classNames('euiKeyPadMenu', className);
|
|
30
|
-
var
|
|
32
|
+
var theme = useEuiTheme();
|
|
33
|
+
var styles = euiKeyPadMenuStyles(theme);
|
|
34
|
+
var cssStyles = [styles.euiKeyPadMenu];
|
|
35
|
+
var legend = _typeof(checkable) === 'object' && checkable.legend ? ___EmotionJSX(EuiFormLabel, _extends({
|
|
36
|
+
css: styles.euiKeyPadMenu__legend
|
|
37
|
+
}, checkable.legendProps, {
|
|
31
38
|
type: "legend"
|
|
32
39
|
}), checkable.legend) : undefined;
|
|
33
40
|
return checkable ? ___EmotionJSX("fieldset", _extends({
|
|
41
|
+
css: cssStyles,
|
|
34
42
|
className: classes,
|
|
35
43
|
"aria-label": _typeof(checkable) === 'object' ? checkable.ariaLegend : undefined
|
|
36
44
|
}, rest), legend, children) : ___EmotionJSX("ul", _extends({
|
|
45
|
+
css: cssStyles,
|
|
37
46
|
className: classes
|
|
38
47
|
}, rest), React.Children.map(children, function (child) {
|
|
39
48
|
return ___EmotionJSX("li", null, child);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
export var euiKeyPadMenuVariables = function euiKeyPadMenuVariables(_ref) {
|
|
11
|
+
var euiTheme = _ref.euiTheme;
|
|
12
|
+
return {
|
|
13
|
+
euiKeyPadMenuSize: mathWithUnits(euiTheme.size.base, function (x) {
|
|
14
|
+
return x * 6;
|
|
15
|
+
}),
|
|
16
|
+
euiKeyPadMenuMarginSize: euiTheme.size.xs
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export var euiKeyPadMenuStyles = function euiKeyPadMenuStyles(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
|
|
22
|
+
var _euiKeyPadMenuVariabl = euiKeyPadMenuVariables(euiThemeContext),
|
|
23
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize,
|
|
24
|
+
euiKeyPadMenuMarginSize = _euiKeyPadMenuVariabl.euiKeyPadMenuMarginSize;
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
euiKeyPadMenu: /*#__PURE__*/css("display:flex;flex-direction:row;flex-wrap:wrap;", logicalCSS('width', mathWithUnits([euiKeyPadMenuSize, euiKeyPadMenuMarginSize], function (x, y) {
|
|
28
|
+
return x * 3 + y * 3;
|
|
29
|
+
})), " ", logicalCSS('max-width', '100%'), " gap:", euiKeyPadMenuMarginSize, ";;label:euiKeyPadMenu;"),
|
|
30
|
+
// Checkable = Fieldset and Legend
|
|
31
|
+
euiKeyPadMenu__legend: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiKeyPadMenu__legend;")
|
|
32
|
+
};
|
|
33
|
+
};
|
package/eui.d.ts
CHANGED
|
@@ -8115,11 +8115,15 @@ declare module '@elastic/eui/src/components/accessibility/skip_link/skip_link' {
|
|
|
8115
8115
|
*/
|
|
8116
8116
|
destinationId: string;
|
|
8117
8117
|
/**
|
|
8118
|
-
* If no destination ID element exists or can be found, you may provide a
|
|
8119
|
-
*
|
|
8118
|
+
* If no destination ID element exists or can be found, you may provide a query selector
|
|
8119
|
+
* string to fall back to.
|
|
8120
|
+
*
|
|
8121
|
+
* For complex applications with potentially variable layouts per page, an array of
|
|
8122
|
+
* query selectors can be passed, e.g. `['main', '[role=main]', '.appWrapper']`, which
|
|
8123
|
+
* prioritizes looking for multiple fallbacks based on array order.
|
|
8120
8124
|
* @default main
|
|
8121
8125
|
*/
|
|
8122
|
-
fallbackDestination?: string;
|
|
8126
|
+
fallbackDestination?: string | string[];
|
|
8123
8127
|
/**
|
|
8124
8128
|
* If default HTML anchor link behavior is not desired (e.g. for SPAs with hash routing),
|
|
8125
8129
|
* setting this flag to true will manually scroll to and focus the destination element
|
|
@@ -15610,6 +15614,18 @@ declare module '@elastic/eui/src/components/image' {
|
|
|
15610
15614
|
export type { EuiImageProps } from '@elastic/eui/src/components/image/image_types';
|
|
15611
15615
|
export { EuiImage } from '@elastic/eui/src/components/image/image';
|
|
15612
15616
|
|
|
15617
|
+
}
|
|
15618
|
+
declare module '@elastic/eui/src/components/key_pad_menu/key_pad_menu.styles' {
|
|
15619
|
+
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
15620
|
+
export const euiKeyPadMenuVariables: ({ euiTheme }: UseEuiTheme) => {
|
|
15621
|
+
euiKeyPadMenuSize: string;
|
|
15622
|
+
euiKeyPadMenuMarginSize: string;
|
|
15623
|
+
};
|
|
15624
|
+
export const euiKeyPadMenuStyles: (euiThemeContext: UseEuiTheme) => {
|
|
15625
|
+
euiKeyPadMenu: import("@emotion/utils").SerializedStyles;
|
|
15626
|
+
euiKeyPadMenu__legend: import("@emotion/utils").SerializedStyles;
|
|
15627
|
+
};
|
|
15628
|
+
|
|
15613
15629
|
}
|
|
15614
15630
|
declare module '@elastic/eui/src/components/key_pad_menu/key_pad_menu' {
|
|
15615
15631
|
import { FunctionComponent, HTMLAttributes, ReactNode } from 'react';
|
|
@@ -66,7 +66,14 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
66
66
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
67
67
|
|
|
68
68
|
if (!destinationEl && fallbackDestination) {
|
|
69
|
-
|
|
69
|
+
if (Array.isArray(fallbackDestination)) {
|
|
70
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
71
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
72
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
76
|
+
}
|
|
70
77
|
}
|
|
71
78
|
|
|
72
79
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -129,11 +136,15 @@ EuiSkipLink.propTypes = {
|
|
|
129
136
|
destinationId: _propTypes.default.string.isRequired,
|
|
130
137
|
|
|
131
138
|
/**
|
|
132
|
-
* If no destination ID element exists or can be found, you may provide a
|
|
133
|
-
*
|
|
139
|
+
* If no destination ID element exists or can be found, you may provide a query selector
|
|
140
|
+
* string to fall back to.
|
|
141
|
+
*
|
|
142
|
+
* For complex applications with potentially variable layouts per page, an array of
|
|
143
|
+
* query selectors can be passed, e.g. `['main', '[role=main]', '.appWrapper']`, which
|
|
144
|
+
* prioritizes looking for multiple fallbacks based on array order.
|
|
134
145
|
* @default main
|
|
135
146
|
*/
|
|
136
|
-
fallbackDestination: _propTypes.default.string,
|
|
147
|
+
fallbackDestination: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired]),
|
|
137
148
|
|
|
138
149
|
/**
|
|
139
150
|
* If default HTML anchor link behavior is not desired (e.g. for SPAs with hash routing),
|
|
@@ -104,6 +104,8 @@ var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2
|
|
|
104
104
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
105
105
|
styles.isFullScreen];
|
|
106
106
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
107
|
+
scrollLock: true,
|
|
108
|
+
preventScrollOnFocus: true,
|
|
107
109
|
clickOutsideDisables: true
|
|
108
110
|
}, (0, _react2.jsx)("div", {
|
|
109
111
|
className: "euiCodeBlockFullScreen",
|
|
@@ -312,6 +312,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
312
312
|
|
|
313
313
|
var flyout = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, _extends({
|
|
314
314
|
disabled: isPushed,
|
|
315
|
+
scrollLock: ownFocus,
|
|
315
316
|
clickOutsideDisables: !ownFocus,
|
|
316
317
|
onClickOutside: onClickOutside
|
|
317
318
|
}, focusTrapProps), (0, _react2.jsx)(Element, _extends({
|
|
@@ -85,6 +85,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
85
85
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, {
|
|
86
86
|
"data-test-subj": "fullScreenOverlayMask"
|
|
87
87
|
}, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
88
|
+
scrollLock: true,
|
|
89
|
+
preventScrollOnFocus: true,
|
|
88
90
|
onClickOutside: closeFullScreen
|
|
89
91
|
}, (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("figure", _extends({
|
|
90
92
|
"aria-label": optionalCaptionText,
|
|
@@ -13,6 +13,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _form_label = require("../form/form_label/form_label");
|
|
15
15
|
|
|
16
|
+
var _services = require("../../services");
|
|
17
|
+
|
|
18
|
+
var _key_pad_menu = require("./key_pad_menu.styles");
|
|
19
|
+
|
|
16
20
|
var _react2 = require("@emotion/react");
|
|
17
21
|
|
|
18
22
|
var _excluded = ["children", "className", "checkable"];
|
|
@@ -34,13 +38,20 @@ var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
|
34
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
39
|
|
|
36
40
|
var classes = (0, _classnames.default)('euiKeyPadMenu', className);
|
|
37
|
-
var
|
|
41
|
+
var theme = (0, _services.useEuiTheme)();
|
|
42
|
+
var styles = (0, _key_pad_menu.euiKeyPadMenuStyles)(theme);
|
|
43
|
+
var cssStyles = [styles.euiKeyPadMenu];
|
|
44
|
+
var legend = _typeof(checkable) === 'object' && checkable.legend ? (0, _react2.jsx)(_form_label.EuiFormLabel, _extends({
|
|
45
|
+
css: styles.euiKeyPadMenu__legend
|
|
46
|
+
}, checkable.legendProps, {
|
|
38
47
|
type: "legend"
|
|
39
48
|
}), checkable.legend) : undefined;
|
|
40
49
|
return checkable ? (0, _react2.jsx)("fieldset", _extends({
|
|
50
|
+
css: cssStyles,
|
|
41
51
|
className: classes,
|
|
42
52
|
"aria-label": _typeof(checkable) === 'object' ? checkable.ariaLegend : undefined
|
|
43
53
|
}, rest), legend, children) : (0, _react2.jsx)("ul", _extends({
|
|
54
|
+
css: cssStyles,
|
|
44
55
|
className: classes
|
|
45
56
|
}, rest), _react.default.Children.map(children, function (child) {
|
|
46
57
|
return (0, _react2.jsx)("li", null, child);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiKeyPadMenuVariables = exports.euiKeyPadMenuStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiKeyPadMenuVariables = function euiKeyPadMenuVariables(_ref) {
|
|
20
|
+
var euiTheme = _ref.euiTheme;
|
|
21
|
+
return {
|
|
22
|
+
euiKeyPadMenuSize: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
23
|
+
return x * 6;
|
|
24
|
+
}),
|
|
25
|
+
euiKeyPadMenuMarginSize: euiTheme.size.xs
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.euiKeyPadMenuVariables = euiKeyPadMenuVariables;
|
|
30
|
+
|
|
31
|
+
var euiKeyPadMenuStyles = function euiKeyPadMenuStyles(euiThemeContext) {
|
|
32
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
33
|
+
|
|
34
|
+
var _euiKeyPadMenuVariabl = euiKeyPadMenuVariables(euiThemeContext),
|
|
35
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize,
|
|
36
|
+
euiKeyPadMenuMarginSize = _euiKeyPadMenuVariabl.euiKeyPadMenuMarginSize;
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
euiKeyPadMenu: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:row;flex-wrap:wrap;", (0, _global_styling.logicalCSS)('width', (0, _global_styling.mathWithUnits)([euiKeyPadMenuSize, euiKeyPadMenuMarginSize], function (x, y) {
|
|
40
|
+
return x * 3 + y * 3;
|
|
41
|
+
})), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " gap:", euiKeyPadMenuMarginSize, ";;label:euiKeyPadMenu;"),
|
|
42
|
+
// Checkable = Fieldset and Legend
|
|
43
|
+
euiKeyPadMenu__legend: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:euiKeyPadMenu__legend;")
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.euiKeyPadMenuStyles = euiKeyPadMenuStyles;
|
|
@@ -42,7 +42,14 @@ export var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
42
42
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
43
43
|
|
|
44
44
|
if (!destinationEl && fallbackDestination) {
|
|
45
|
-
|
|
45
|
+
if (Array.isArray(fallbackDestination)) {
|
|
46
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
47
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
48
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
52
|
+
}
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -78,6 +78,8 @@ export var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrappe
|
|
|
78
78
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
79
79
|
styles.isFullScreen];
|
|
80
80
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
81
|
+
scrollLock: true,
|
|
82
|
+
preventScrollOnFocus: true,
|
|
81
83
|
clickOutsideDisables: true
|
|
82
84
|
}, ___EmotionJSX("div", {
|
|
83
85
|
className: "euiCodeBlockFullScreen",
|
|
@@ -266,6 +266,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
266
266
|
|
|
267
267
|
var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
|
|
268
268
|
disabled: isPushed,
|
|
269
|
+
scrollLock: ownFocus,
|
|
269
270
|
clickOutsideDisables: !ownFocus,
|
|
270
271
|
onClickOutside: onClickOutside
|
|
271
272
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
@@ -58,6 +58,8 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
|
|
|
58
58
|
return ___EmotionJSX(EuiOverlayMask, {
|
|
59
59
|
"data-test-subj": "fullScreenOverlayMask"
|
|
60
60
|
}, ___EmotionJSX(EuiFocusTrap, {
|
|
61
|
+
scrollLock: true,
|
|
62
|
+
preventScrollOnFocus: true,
|
|
61
63
|
onClickOutside: closeFullScreen
|
|
62
64
|
}, ___EmotionJSX(React.Fragment, null, ___EmotionJSX("figure", _extends({
|
|
63
65
|
"aria-label": optionalCaptionText,
|
|
@@ -13,6 +13,8 @@ var _excluded = ["children", "className", "checkable"];
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { EuiFormLabel } from '../form/form_label/form_label';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
17
|
+
import { euiKeyPadMenuStyles } from './key_pad_menu.styles';
|
|
16
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
19
|
export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
18
20
|
var children = _ref.children,
|
|
@@ -21,13 +23,20 @@ export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
|
21
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
24
|
|
|
23
25
|
var classes = classNames('euiKeyPadMenu', className);
|
|
24
|
-
var
|
|
26
|
+
var theme = useEuiTheme();
|
|
27
|
+
var styles = euiKeyPadMenuStyles(theme);
|
|
28
|
+
var cssStyles = [styles.euiKeyPadMenu];
|
|
29
|
+
var legend = _typeof(checkable) === 'object' && checkable.legend ? ___EmotionJSX(EuiFormLabel, _extends({
|
|
30
|
+
css: styles.euiKeyPadMenu__legend
|
|
31
|
+
}, checkable.legendProps, {
|
|
25
32
|
type: "legend"
|
|
26
33
|
}), checkable.legend) : undefined;
|
|
27
34
|
return checkable ? ___EmotionJSX("fieldset", _extends({
|
|
35
|
+
css: cssStyles,
|
|
28
36
|
className: classes,
|
|
29
37
|
"aria-label": _typeof(checkable) === 'object' ? checkable.ariaLegend : undefined
|
|
30
38
|
}, rest), legend, children) : ___EmotionJSX("ul", _extends({
|
|
39
|
+
css: cssStyles,
|
|
31
40
|
className: classes
|
|
32
41
|
}, rest), React.Children.map(children, function (child) {
|
|
33
42
|
return ___EmotionJSX("li", null, child);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
export var euiKeyPadMenuVariables = function euiKeyPadMenuVariables(_ref) {
|
|
11
|
+
var euiTheme = _ref.euiTheme;
|
|
12
|
+
return {
|
|
13
|
+
euiKeyPadMenuSize: mathWithUnits(euiTheme.size.base, function (x) {
|
|
14
|
+
return x * 6;
|
|
15
|
+
}),
|
|
16
|
+
euiKeyPadMenuMarginSize: euiTheme.size.xs
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export var euiKeyPadMenuStyles = function euiKeyPadMenuStyles(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
|
|
22
|
+
var _euiKeyPadMenuVariabl = euiKeyPadMenuVariables(euiThemeContext),
|
|
23
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize,
|
|
24
|
+
euiKeyPadMenuMarginSize = _euiKeyPadMenuVariabl.euiKeyPadMenuMarginSize;
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
euiKeyPadMenu: /*#__PURE__*/css("display:flex;flex-direction:row;flex-wrap:wrap;", logicalCSS('width', mathWithUnits([euiKeyPadMenuSize, euiKeyPadMenuMarginSize], function (x, y) {
|
|
28
|
+
return x * 3 + y * 3;
|
|
29
|
+
})), " ", logicalCSS('max-width', '100%'), " gap:", euiKeyPadMenuMarginSize, ";;label:euiKeyPadMenu;"),
|
|
30
|
+
// Checkable = Fieldset and Legend
|
|
31
|
+
euiKeyPadMenu__legend: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiKeyPadMenu__legend;")
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -61,7 +61,14 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
61
61
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
62
62
|
|
|
63
63
|
if (!destinationEl && fallbackDestination) {
|
|
64
|
-
|
|
64
|
+
if (Array.isArray(fallbackDestination)) {
|
|
65
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
66
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
67
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
71
|
+
}
|
|
65
72
|
}
|
|
66
73
|
|
|
67
74
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -104,6 +104,8 @@ var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2
|
|
|
104
104
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
105
105
|
styles.isFullScreen];
|
|
106
106
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
107
|
+
scrollLock: true,
|
|
108
|
+
preventScrollOnFocus: true,
|
|
107
109
|
clickOutsideDisables: true
|
|
108
110
|
}, (0, _react2.jsx)("div", {
|
|
109
111
|
className: "euiCodeBlockFullScreen",
|
|
@@ -294,6 +294,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
294
294
|
|
|
295
295
|
var flyout = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
|
|
296
296
|
disabled: isPushed,
|
|
297
|
+
scrollLock: ownFocus,
|
|
297
298
|
clickOutsideDisables: !ownFocus,
|
|
298
299
|
onClickOutside: onClickOutside
|
|
299
300
|
}, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
@@ -80,6 +80,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
80
80
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, {
|
|
81
81
|
"data-test-subj": "fullScreenOverlayMask"
|
|
82
82
|
}, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
83
|
+
scrollLock: true,
|
|
84
|
+
preventScrollOnFocus: true,
|
|
83
85
|
onClickOutside: closeFullScreen
|
|
84
86
|
}, (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("figure", (0, _extends2.default)({
|
|
85
87
|
"aria-label": optionalCaptionText,
|
|
@@ -19,6 +19,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
19
19
|
|
|
20
20
|
var _form_label = require("../form/form_label/form_label");
|
|
21
21
|
|
|
22
|
+
var _services = require("../../services");
|
|
23
|
+
|
|
24
|
+
var _key_pad_menu = require("./key_pad_menu.styles");
|
|
25
|
+
|
|
22
26
|
var _react2 = require("@emotion/react");
|
|
23
27
|
|
|
24
28
|
var _excluded = ["children", "className", "checkable"];
|
|
@@ -29,13 +33,20 @@ var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
|
|
|
29
33
|
checkable = _ref.checkable,
|
|
30
34
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
35
|
var classes = (0, _classnames.default)('euiKeyPadMenu', className);
|
|
32
|
-
var
|
|
36
|
+
var theme = (0, _services.useEuiTheme)();
|
|
37
|
+
var styles = (0, _key_pad_menu.euiKeyPadMenuStyles)(theme);
|
|
38
|
+
var cssStyles = [styles.euiKeyPadMenu];
|
|
39
|
+
var legend = (0, _typeof2.default)(checkable) === 'object' && checkable.legend ? (0, _react2.jsx)(_form_label.EuiFormLabel, (0, _extends2.default)({
|
|
40
|
+
css: styles.euiKeyPadMenu__legend
|
|
41
|
+
}, checkable.legendProps, {
|
|
33
42
|
type: "legend"
|
|
34
43
|
}), checkable.legend) : undefined;
|
|
35
44
|
return checkable ? (0, _react2.jsx)("fieldset", (0, _extends2.default)({
|
|
45
|
+
css: cssStyles,
|
|
36
46
|
className: classes,
|
|
37
47
|
"aria-label": (0, _typeof2.default)(checkable) === 'object' ? checkable.ariaLegend : undefined
|
|
38
48
|
}, rest), legend, children) : (0, _react2.jsx)("ul", (0, _extends2.default)({
|
|
49
|
+
css: cssStyles,
|
|
39
50
|
className: classes
|
|
40
51
|
}, rest), _react.default.Children.map(children, function (child) {
|
|
41
52
|
return (0, _react2.jsx)("li", null, child);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiKeyPadMenuVariables = exports.euiKeyPadMenuStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiKeyPadMenuVariables = function euiKeyPadMenuVariables(_ref) {
|
|
20
|
+
var euiTheme = _ref.euiTheme;
|
|
21
|
+
return {
|
|
22
|
+
euiKeyPadMenuSize: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
23
|
+
return x * 6;
|
|
24
|
+
}),
|
|
25
|
+
euiKeyPadMenuMarginSize: euiTheme.size.xs
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.euiKeyPadMenuVariables = euiKeyPadMenuVariables;
|
|
30
|
+
|
|
31
|
+
var euiKeyPadMenuStyles = function euiKeyPadMenuStyles(euiThemeContext) {
|
|
32
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
33
|
+
|
|
34
|
+
var _euiKeyPadMenuVariabl = euiKeyPadMenuVariables(euiThemeContext),
|
|
35
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize,
|
|
36
|
+
euiKeyPadMenuMarginSize = _euiKeyPadMenuVariabl.euiKeyPadMenuMarginSize;
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
euiKeyPadMenu: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:row;flex-wrap:wrap;", (0, _global_styling.logicalCSS)('width', (0, _global_styling.mathWithUnits)([euiKeyPadMenuSize, euiKeyPadMenuMarginSize], function (x, y) {
|
|
40
|
+
return x * 3 + y * 3;
|
|
41
|
+
})), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " gap:", euiKeyPadMenuMarginSize, ";;label:euiKeyPadMenu;"),
|
|
42
|
+
// Checkable = Fieldset and Legend
|
|
43
|
+
euiKeyPadMenu__legend: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:euiKeyPadMenu__legend;")
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.euiKeyPadMenuStyles = euiKeyPadMenuStyles;
|
package/package.json
CHANGED
|
@@ -63,7 +63,14 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
63
63
|
var hasValidId = !!destinationEl; // Check the fallback destination if not
|
|
64
64
|
|
|
65
65
|
if (!destinationEl && fallbackDestination) {
|
|
66
|
-
|
|
66
|
+
if (Array.isArray(fallbackDestination)) {
|
|
67
|
+
for (var i = 0; i < fallbackDestination.length; i++) {
|
|
68
|
+
destinationEl = document.querySelector(fallbackDestination[i]);
|
|
69
|
+
if (destinationEl) break; // Stop once the first fallback has been found
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
destinationEl = document.querySelector(fallbackDestination);
|
|
73
|
+
}
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
@@ -126,11 +133,15 @@ EuiSkipLink.propTypes = {
|
|
|
126
133
|
destinationId: _propTypes.default.string.isRequired,
|
|
127
134
|
|
|
128
135
|
/**
|
|
129
|
-
* If no destination ID element exists or can be found, you may provide a
|
|
130
|
-
*
|
|
136
|
+
* If no destination ID element exists or can be found, you may provide a query selector
|
|
137
|
+
* string to fall back to.
|
|
138
|
+
*
|
|
139
|
+
* For complex applications with potentially variable layouts per page, an array of
|
|
140
|
+
* query selectors can be passed, e.g. `['main', '[role=main]', '.appWrapper']`, which
|
|
141
|
+
* prioritizes looking for multiple fallbacks based on array order.
|
|
131
142
|
* @default main
|
|
132
143
|
*/
|
|
133
|
-
fallbackDestination: _propTypes.default.string,
|
|
144
|
+
fallbackDestination: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired]),
|
|
134
145
|
|
|
135
146
|
/**
|
|
136
147
|
* If default HTML anchor link behavior is not desired (e.g. for SPAs with hash routing),
|
|
@@ -104,6 +104,8 @@ var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2
|
|
|
104
104
|
var cssStyles = [styles.euiCodeBlock, styles.l, // Force fullscreen to use large font
|
|
105
105
|
styles.isFullScreen];
|
|
106
106
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, null, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
107
|
+
scrollLock: true,
|
|
108
|
+
preventScrollOnFocus: true,
|
|
107
109
|
clickOutsideDisables: true
|
|
108
110
|
}, (0, _react2.jsx)("div", {
|
|
109
111
|
className: "euiCodeBlockFullScreen",
|
|
@@ -82,6 +82,8 @@ var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref) {
|
|
|
82
82
|
return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, {
|
|
83
83
|
"data-test-subj": "fullScreenOverlayMask"
|
|
84
84
|
}, (0, _react2.jsx)(_focus_trap.EuiFocusTrap, {
|
|
85
|
+
scrollLock: true,
|
|
86
|
+
preventScrollOnFocus: true,
|
|
85
87
|
onClickOutside: closeFullScreen
|
|
86
88
|
}, (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("figure", (0, _extends2.default)({
|
|
87
89
|
"aria-label": optionalCaptionText,
|