@elastic/eui 92.0.0 → 92.1.1
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 +3 -18
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -18
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/aspect_ratio/aspect_ratio.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
- package/es/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +111 -244
- package/es/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
- package/es/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
- package/es/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
- package/es/components/datagrid/body/cell/focus_utils.js +166 -0
- package/es/components/datagrid/body/cell/index.js +11 -0
- package/es/components/datagrid/body/data_grid_body.js +0 -2
- package/es/components/datagrid/body/data_grid_body_custom.js +1 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +1 -7
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
- package/es/components/datagrid/body/header/data_grid_header_cell.js +27 -12
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +45 -116
- package/es/components/datagrid/body/header/data_grid_header_row.js +5 -10
- package/es/components/datagrid/body/header/use_data_grid_header.js +3 -14
- package/es/components/datagrid/data_grid.js +2 -12
- package/es/components/datagrid/utils/focus.js +25 -54
- package/es/components/datagrid/utils/scrolling.js +1 -1
- package/es/components/flyout/flyout_resizable.js +10 -10
- package/es/components/flyout/flyout_resizable.styles.js +12 -6
- package/es/components/resizable_container/helpers.js +5 -6
- package/es/components/resizable_container/resizable_button.js +13 -4
- package/es/components/resizable_container/resizable_button.styles.js +18 -8
- package/es/components/resizable_container/resizable_container.js +28 -22
- package/es/components/steps/step_number.styles.js +6 -7
- package/es/components/tree_view/tree_view.js +9 -2
- package/eui.d.ts +130 -90
- package/i18ntokens.json +108 -72
- package/lib/components/aspect_ratio/aspect_ratio.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
- package/lib/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +111 -244
- package/lib/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
- package/lib/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
- package/lib/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
- package/lib/components/datagrid/body/cell/focus_utils.js +174 -0
- package/lib/components/datagrid/body/cell/index.js +32 -0
- package/lib/components/datagrid/body/data_grid_body.js +0 -2
- package/lib/components/datagrid/body/data_grid_body_custom.js +2 -8
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -8
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +35 -20
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +47 -119
- package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -10
- package/lib/components/datagrid/body/header/use_data_grid_header.js +10 -24
- package/lib/components/datagrid/data_grid.js +4 -14
- package/lib/components/datagrid/utils/focus.js +26 -56
- package/lib/components/datagrid/utils/scrolling.js +2 -2
- package/lib/components/flyout/flyout_resizable.js +10 -10
- package/lib/components/flyout/flyout_resizable.styles.js +12 -6
- package/lib/components/resizable_container/helpers.js +7 -7
- package/lib/components/resizable_container/resizable_button.js +13 -4
- package/lib/components/resizable_container/resizable_button.styles.js +18 -8
- package/lib/components/resizable_container/resizable_container.js +28 -22
- package/lib/components/steps/step_number.styles.js +6 -7
- package/lib/components/tree_view/tree_view.js +9 -2
- package/optimize/es/components/aspect_ratio/aspect_ratio.js +1 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
- package/optimize/es/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +111 -244
- package/optimize/es/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
- package/optimize/es/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
- package/optimize/es/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
- package/optimize/es/components/datagrid/body/cell/focus_utils.js +153 -0
- package/optimize/es/components/datagrid/body/cell/index.js +11 -0
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +1 -5
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +1 -5
- package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -4
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +25 -10
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +41 -115
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +4 -8
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +3 -13
- package/optimize/es/components/datagrid/data_grid.js +2 -12
- package/optimize/es/components/datagrid/utils/focus.js +25 -54
- package/optimize/es/components/datagrid/utils/scrolling.js +1 -1
- package/optimize/es/components/flyout/flyout_resizable.js +10 -10
- package/optimize/es/components/flyout/flyout_resizable.styles.js +12 -6
- package/optimize/es/components/resizable_container/helpers.js +5 -6
- package/optimize/es/components/resizable_container/resizable_button.js +5 -2
- package/optimize/es/components/resizable_container/resizable_button.styles.js +18 -8
- package/optimize/es/components/resizable_container/resizable_container.js +28 -22
- package/optimize/es/components/steps/step_number.styles.js +6 -7
- package/optimize/es/components/tree_view/tree_view.js +9 -2
- package/optimize/lib/components/aspect_ratio/aspect_ratio.js +1 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
- package/optimize/lib/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +111 -244
- package/optimize/lib/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
- package/optimize/lib/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
- package/optimize/lib/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
- package/optimize/lib/components/datagrid/body/cell/focus_utils.js +163 -0
- package/optimize/lib/components/datagrid/body/cell/index.js +32 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -6
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -6
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +25 -10
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +41 -115
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +4 -8
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +4 -14
- package/optimize/lib/components/datagrid/data_grid.js +4 -14
- package/optimize/lib/components/datagrid/utils/focus.js +26 -56
- package/optimize/lib/components/datagrid/utils/scrolling.js +2 -2
- package/optimize/lib/components/flyout/flyout_resizable.js +10 -10
- package/optimize/lib/components/flyout/flyout_resizable.styles.js +12 -6
- package/optimize/lib/components/resizable_container/helpers.js +7 -7
- package/optimize/lib/components/resizable_container/resizable_button.js +5 -2
- package/optimize/lib/components/resizable_container/resizable_button.styles.js +18 -8
- package/optimize/lib/components/resizable_container/resizable_container.js +28 -22
- package/optimize/lib/components/steps/step_number.styles.js +6 -7
- package/optimize/lib/components/tree_view/tree_view.js +9 -2
- package/package.json +1 -1
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +8 -7
- package/test-env/components/aspect_ratio/aspect_ratio.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +7 -3
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +4 -4
- package/test-env/components/datagrid/body/{data_grid_cell.js → cell/data_grid_cell.js} +111 -244
- package/test-env/components/datagrid/body/{data_grid_cell_actions.js → cell/data_grid_cell_actions.js} +5 -5
- package/test-env/components/datagrid/body/{data_grid_cell_popover.js → cell/data_grid_cell_popover.js} +4 -4
- package/test-env/components/datagrid/body/{data_grid_cell_wrapper.js → cell/data_grid_cell_wrapper.js} +1 -1
- package/test-env/components/datagrid/body/cell/focus_utils.js +172 -0
- package/test-env/components/datagrid/body/cell/index.js +32 -0
- package/test-env/components/datagrid/body/data_grid_body.js +0 -2
- package/test-env/components/datagrid/body/data_grid_body_custom.js +2 -8
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +2 -8
- package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +5 -6
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +3 -6
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +25 -10
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +44 -116
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -10
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +4 -14
- package/test-env/components/datagrid/data_grid.js +4 -14
- package/test-env/components/datagrid/utils/focus.js +26 -56
- package/test-env/components/datagrid/utils/scrolling.js +2 -2
- package/test-env/components/flyout/flyout_resizable.js +10 -10
- package/test-env/components/flyout/flyout_resizable.styles.js +12 -6
- package/test-env/components/resizable_container/helpers.js +7 -7
- package/test-env/components/resizable_container/resizable_button.js +13 -4
- package/test-env/components/resizable_container/resizable_button.styles.js +18 -8
- package/test-env/components/resizable_container/resizable_container.js +28 -22
- package/test-env/components/steps/step_number.styles.js +6 -7
- package/test-env/components/tree_view/tree_view.js +9 -2
- package/es/components/datagrid/body/header/header_is_interactive.js +0 -58
- package/lib/components/datagrid/body/header/header_is_interactive.js +0 -63
- package/optimize/es/components/datagrid/body/header/header_is_interactive.js +0 -53
- package/optimize/lib/components/datagrid/body/header/header_is_interactive.js +0 -61
- package/test-env/components/datagrid/body/header/header_is_interactive.js +0 -61
|
@@ -14,19 +14,25 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
|
-
name: "
|
|
18
|
-
styles: "position:absolute
|
|
17
|
+
name: "1gfwqnd-euiFlyoutResizableButton",
|
|
18
|
+
styles: "position:absolute;label:euiFlyoutResizableButton;"
|
|
19
19
|
} : {
|
|
20
|
-
name: "
|
|
21
|
-
styles: "position:absolute
|
|
20
|
+
name: "1gfwqnd-euiFlyoutResizableButton",
|
|
21
|
+
styles: "position:absolute;label:euiFlyoutResizableButton;",
|
|
22
22
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
23
|
};
|
|
24
24
|
var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(_ref2) {
|
|
25
25
|
var euiTheme = _ref2.euiTheme;
|
|
26
26
|
return {
|
|
27
27
|
euiFlyoutResizableButton: _ref,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
overlay: {
|
|
29
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), ";;label:left;"),
|
|
30
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), ";;label:right;")
|
|
31
|
+
},
|
|
32
|
+
push: {
|
|
33
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', "-".concat(euiTheme.border.width.thin)), ";;label:left;"),
|
|
34
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', "-".concat(euiTheme.border.width.thin)), ";;label:right;")
|
|
35
|
+
}
|
|
30
36
|
};
|
|
31
37
|
};
|
|
32
38
|
exports.euiFlyoutResizableButtonStyles = euiFlyoutResizableButtonStyles;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useContainerCallbacks = exports.sizesOnly = exports.pxToPercent = exports.getPosition = exports.getPanelMinSize = void 0;
|
|
6
|
+
exports.useContainerCallbacks = exports.sizesOnly = exports.pxToPercent = exports.isTouchEvent = exports.getPosition = exports.getPanelMinSize = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _common = require("../common");
|
|
9
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -24,9 +24,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
24
24
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
25
25
|
* Side Public License, v 1.
|
|
26
26
|
*/
|
|
27
|
-
function
|
|
28
|
-
return _typeof(event) === 'object' && '
|
|
29
|
-
}
|
|
27
|
+
var isTouchEvent = function isTouchEvent(event) {
|
|
28
|
+
return _typeof(event) === 'object' && 'targetTouches' in event;
|
|
29
|
+
};
|
|
30
|
+
exports.isTouchEvent = isTouchEvent;
|
|
30
31
|
var pxToPercent = function pxToPercent(proportion, whole) {
|
|
31
32
|
if (whole < 1 || proportion < 0) return 0;
|
|
32
33
|
return proportion / whole * 100;
|
|
@@ -56,9 +57,8 @@ var getPanelMinSize = function getPanelMinSize(panelMinSize, containerSize) {
|
|
|
56
57
|
};
|
|
57
58
|
exports.getPanelMinSize = getPanelMinSize;
|
|
58
59
|
var getPosition = function getPosition(event, isHorizontal) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
return isHorizontal ? clientX : clientY;
|
|
60
|
+
var direction = isHorizontal ? 'clientX' : 'clientY';
|
|
61
|
+
return isTouchEvent(event) ? event.targetTouches[0][direction] : event[direction];
|
|
62
62
|
};
|
|
63
63
|
exports.getPosition = getPosition;
|
|
64
64
|
var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
@@ -13,7 +13,7 @@ var _services = require("../../services");
|
|
|
13
13
|
var _context = require("./context");
|
|
14
14
|
var _resizable_button = require("./resizable_button.styles");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["isHorizontal", "alignIndicator", "className"],
|
|
16
|
+
var _excluded = ["isHorizontal", "indicator", "alignIndicator", "className"],
|
|
17
17
|
_excluded2 = ["registration", "id", "disabled", "onFocus"];
|
|
18
18
|
/*
|
|
19
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -40,14 +40,17 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
40
40
|
*/
|
|
41
41
|
var EuiResizableButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
42
42
|
var isHorizontal = _ref.isHorizontal,
|
|
43
|
+
_ref$indicator = _ref.indicator,
|
|
44
|
+
indicator = _ref$indicator === void 0 ? 'handle' : _ref$indicator,
|
|
43
45
|
_ref$alignIndicator = _ref.alignIndicator,
|
|
44
46
|
alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
|
|
45
47
|
className = _ref.className,
|
|
46
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
49
|
var classes = (0, _classnames.default)('euiResizableButton', className);
|
|
50
|
+
var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
|
|
48
51
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
49
52
|
var styles = (0, _resizable_button.euiResizableButtonStyles)(euiTheme);
|
|
50
|
-
var cssStyles = [styles.euiResizableButton,
|
|
53
|
+
var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
|
|
51
54
|
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
52
55
|
tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
|
|
53
56
|
defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
|
|
@@ -77,8 +80,14 @@ EuiResizableButton.propTypes = {
|
|
|
77
80
|
*/
|
|
78
81
|
isHorizontal: _propTypes.default.bool,
|
|
79
82
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
83
|
+
* By default, EuiResizableButton will show a grab handle to indicate resizability.
|
|
84
|
+
* This indicator can be optionally hidden to show a plain border instead.
|
|
85
|
+
*/
|
|
86
|
+
indicator: _propTypes.default.oneOf(["handle", "border"]),
|
|
87
|
+
/**
|
|
88
|
+
* Allows customizing the alignment of grab `handle` indicators (does nothing for
|
|
89
|
+
* border indicators). Defaults to `center`, but consider using `start` for extremely
|
|
90
|
+
* tall content that scrolls off-screen
|
|
82
91
|
*/
|
|
83
92
|
alignIndicator: _propTypes.default.oneOf(["center", "start", "end"]),
|
|
84
93
|
/**
|
|
@@ -46,21 +46,31 @@ var euiResizableButtonStyles = function euiResizableButtonStyles(euiThemeContext
|
|
|
46
46
|
var transitionSpeed = euiTheme.animation.fast;
|
|
47
47
|
var transition = "".concat(transitionSpeed, " ease");
|
|
48
48
|
return {
|
|
49
|
-
//
|
|
50
|
-
// 1. The "grab"
|
|
51
|
-
// 2. Start/end aligned handles should have a slight margin offset that disappears on hover/focus
|
|
49
|
+
// Creates a resizable indicator (either a grab handle or a plain border) with CSS psuedo-elements.
|
|
50
|
+
// 1. The "grab" handle transforms into a thicker straight line on :hover and :focus
|
|
51
|
+
// 2. Start/end aligned grab handles should have a slight margin offset that disappears on hover/focus
|
|
52
52
|
// 3. CSS hack to smooth out/anti-alias the 1px wide handles at various zoom levels
|
|
53
|
-
euiResizableButton: /*#__PURE__*/(0, _react.css)("z-index:1;flex-shrink:0;display:flex;justify-content:center;
|
|
54
|
-
return x * 2;
|
|
55
|
-
}), ";&:disabled{display:none;}&:hover,&:focus{gap:0;justify-content:center;}", _global_styling.euiCanAnimate, "{transition:gap ", transition, ",justify-content ", transition, ";}&::before,&::after{content:'';display:block;background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";", _global_styling.euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}}&:focus,&:active{background-color:", (0, _services.transparentize)(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", (0, _global_styling.mathWithUnits)(transitionSpeed, function (x) {
|
|
53
|
+
euiResizableButton: /*#__PURE__*/(0, _react.css)("z-index:1;flex-shrink:0;display:flex;justify-content:center;&:disabled{display:none;}&::before,&::after{content:'';display:block;", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";}}&:focus,&:active{background-color:", (0, _services.transparentize)(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", (0, _global_styling.mathWithUnits)(transitionSpeed, function (x) {
|
|
56
54
|
return x / 2;
|
|
57
55
|
}), ";}}};label:euiResizableButton;"),
|
|
58
56
|
horizontal: /*#__PURE__*/(0, _react.css)("cursor:col-resize;", (0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.logicalCSS)('width', buttonSize), " margin-inline:", (0, _global_styling.mathWithUnits)(buttonSize, function (x) {
|
|
59
57
|
return x / -2;
|
|
60
|
-
}), "
|
|
58
|
+
}), ";;label:horizontal;"),
|
|
61
59
|
vertical: /*#__PURE__*/(0, _react.css)("flex-direction:column;cursor:row-resize;", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('height', buttonSize), " margin-block:", (0, _global_styling.mathWithUnits)(buttonSize, function (x) {
|
|
62
60
|
return x / -2;
|
|
63
|
-
}), "
|
|
61
|
+
}), ";;label:vertical;"),
|
|
62
|
+
border: /*#__PURE__*/(0, _react.css)("&::before,&::after{background-color:", euiTheme.border.color, ";};label:border;"),
|
|
63
|
+
borderDirection: {
|
|
64
|
+
horizontal: /*#__PURE__*/(0, _react.css)("&::before{", (0, _global_styling.logicalCSS)('width', euiTheme.border.width.thin), " ", (0, _global_styling.logicalCSS)('height', '100%'), ";}&:hover,&:focus,&:active{&::after{", (0, _global_styling.logicalCSS)('width', euiTheme.border.width.thin), " ", (0, _global_styling.logicalCSS)('height', '100%'), ";}};label:horizontal;"),
|
|
65
|
+
vertical: /*#__PURE__*/(0, _react.css)("&::before{", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thin), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}&:hover,&:focus,&:active{&::after{", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thin), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:vertical;")
|
|
66
|
+
},
|
|
67
|
+
handle: /*#__PURE__*/(0, _react.css)("gap:", (0, _global_styling.mathWithUnits)(grabHandleHeight, function (x) {
|
|
68
|
+
return x * 2;
|
|
69
|
+
}), ";&:hover,&:focus,&:active{gap:0;}", _global_styling.euiCanAnimate, "{transition:gap ", transition, ";}&::before,&::after{background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);}&:hover{&::before,&::after{", _global_styling.euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}};label:handle;"),
|
|
70
|
+
handleDirection: {
|
|
71
|
+
horizontal: /*#__PURE__*/(0, _react.css)("&::before,&::after{", (0, _global_styling.logicalCSS)('width', grabHandleHeight), " ", (0, _global_styling.logicalCSS)('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", (0, _global_styling.logicalCSS)('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
|
|
72
|
+
vertical: /*#__PURE__*/(0, _react.css)("&::before,&::after{", (0, _global_styling.logicalCSS)('height', grabHandleHeight), " ", (0, _global_styling.logicalCSS)('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", (0, _global_styling.logicalCSS)('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;")
|
|
73
|
+
},
|
|
64
74
|
alignIndicator: {
|
|
65
75
|
center: _ref3,
|
|
66
76
|
start: _ref2,
|
|
@@ -117,16 +117,33 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
117
117
|
prevPanelId: prevPanelId,
|
|
118
118
|
nextPanelId: nextPanelId
|
|
119
119
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
position
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
|
|
121
|
+
// Window event listeners instead of React events are used to continue
|
|
122
|
+
// detecting movement even if the user's mouse leaves the container
|
|
123
|
+
|
|
124
|
+
var onMouseMove = function onMouseMove(event) {
|
|
125
|
+
var position = (0, _helpers.getPosition)(event, isHorizontal);
|
|
126
|
+
actions.dragMove({
|
|
127
|
+
position: position,
|
|
128
|
+
prevPanelId: prevPanelId,
|
|
129
|
+
nextPanelId: nextPanelId
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var onMouseUp = function onMouseUp() {
|
|
133
|
+
if (resizeContext.current.trigger === 'pointer') {
|
|
134
|
+
resizeEnd();
|
|
135
|
+
}
|
|
136
|
+
actions.reset();
|
|
137
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
138
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
139
|
+
window.removeEventListener('touchmove', onMouseMove);
|
|
140
|
+
window.removeEventListener('touchend', onMouseUp);
|
|
141
|
+
};
|
|
142
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
143
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
144
|
+
window.addEventListener('touchmove', onMouseMove);
|
|
145
|
+
window.addEventListener('touchend', onMouseUp);
|
|
146
|
+
}, [actions, isHorizontal, resizeStart, resizeEnd]);
|
|
130
147
|
var getKeyMoveDirection = (0, _react.useCallback)(function (key) {
|
|
131
148
|
var direction = null;
|
|
132
149
|
if (isHorizontal && key === _services.keys.ARROW_LEFT || !isHorizontal && key === _services.keys.ARROW_UP) {
|
|
@@ -164,12 +181,6 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
164
181
|
resizeEnd();
|
|
165
182
|
}
|
|
166
183
|
}, [getKeyMoveDirection, resizeEnd]);
|
|
167
|
-
var onMouseUp = (0, _react.useCallback)(function () {
|
|
168
|
-
if (resizeContext.current.trigger === 'pointer') {
|
|
169
|
-
resizeEnd();
|
|
170
|
-
}
|
|
171
|
-
actions.reset();
|
|
172
|
-
}, [actions, resizeEnd]);
|
|
173
184
|
var onBlur = (0, _react.useCallback)(function () {
|
|
174
185
|
if (resizeContext.current.trigger === 'key') {
|
|
175
186
|
resizeEnd();
|
|
@@ -228,12 +239,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
228
239
|
}, (0, _react2.jsx)("div", _extends({
|
|
229
240
|
css: cssStyles,
|
|
230
241
|
className: classes,
|
|
231
|
-
ref: containerRef
|
|
232
|
-
onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
|
|
233
|
-
onMouseUp: onMouseUp,
|
|
234
|
-
onMouseLeave: onMouseUp,
|
|
235
|
-
onTouchMove: onMouseMove,
|
|
236
|
-
onTouchEnd: onMouseUp
|
|
242
|
+
ref: containerRef
|
|
237
243
|
}, rest), render()));
|
|
238
244
|
};
|
|
239
245
|
exports.EuiResizableContainer = EuiResizableContainer;
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.euiStepNumberStyles = exports.euiStepNumberContentStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
|
-
var _services = require("../../services");
|
|
10
9
|
var _step = require("./step.styles");
|
|
11
10
|
var _mixins = require("../../themes/amsterdam/global_styling/mixins");
|
|
12
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
@@ -46,12 +45,12 @@ var euiStepNumberStyles = function euiStepNumberStyles(euiThemeContext) {
|
|
|
46
45
|
xs: /*#__PURE__*/(0, _react.css)(createStepsNumber(euiStep.numberXSSize, (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme)), ";;label:xs;"),
|
|
47
46
|
// status
|
|
48
47
|
incomplete: /*#__PURE__*/(0, _react.css)("background-color:transparent;color:", euiTheme.colors.text, ";border:", euiTheme.border.thick, ";;label:incomplete;"),
|
|
49
|
-
disabled: /*#__PURE__*/(0, _react.css)(
|
|
48
|
+
disabled: /*#__PURE__*/(0, _react.css)((0, _mixins.euiButtonFillColor)(euiThemeContext, 'disabled'), ";;label:disabled;"),
|
|
50
49
|
loading: _ref,
|
|
51
|
-
warning: /*#__PURE__*/(0, _react.css)(
|
|
52
|
-
danger: /*#__PURE__*/(0, _react.css)(
|
|
53
|
-
complete: /*#__PURE__*/(0, _react.css)(
|
|
54
|
-
current: /*#__PURE__*/(0, _react.css)("border:
|
|
50
|
+
warning: /*#__PURE__*/(0, _react.css)((0, _mixins.euiButtonFillColor)(euiThemeContext, 'warning'), " ", _global_styling.euiCanAnimate, "{animation:", _global_styling.euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:warning;"),
|
|
51
|
+
danger: /*#__PURE__*/(0, _react.css)((0, _mixins.euiButtonFillColor)(euiThemeContext, 'danger'), " ", _global_styling.euiCanAnimate, "{animation:", _global_styling.euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:danger;"),
|
|
52
|
+
complete: /*#__PURE__*/(0, _react.css)((0, _mixins.euiButtonFillColor)(euiThemeContext, 'success'), " ", _global_styling.euiCanAnimate, "{animation:", _global_styling.euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:complete;"),
|
|
53
|
+
current: /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.width.thick, " solid ", euiTheme.colors.body, ";box-shadow:0 0 0 ", euiTheme.border.width.thick, " ", euiTheme.colors.primary, ";;label:current;")
|
|
55
54
|
};
|
|
56
55
|
};
|
|
57
56
|
exports.euiStepNumberStyles = euiStepNumberStyles;
|
|
@@ -72,7 +71,7 @@ var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref3) {
|
|
|
72
71
|
incomplete: /*#__PURE__*/(0, _react.css)("display:unset;position:relative;inset-block-start:-", euiTheme.border.width.thick, ";;label:incomplete;"),
|
|
73
72
|
loading: /*#__PURE__*/(0, _react.css)(";label:loading;"),
|
|
74
73
|
disabled: /*#__PURE__*/(0, _react.css)(";label:disabled;"),
|
|
75
|
-
current: /*#__PURE__*/(0, _react.css)(";label:current;")
|
|
74
|
+
current: /*#__PURE__*/(0, _react.css)("display:inline-block;transform:translateY(-", euiTheme.border.width.thick, ");;label:current;")
|
|
76
75
|
};
|
|
77
76
|
};
|
|
78
77
|
exports.euiStepNumberContentStyles = euiStepNumberContentStyles;
|
|
@@ -51,7 +51,9 @@ var EuiTreeViewContext = /*#__PURE__*/(0, _react.createContext)('');
|
|
|
51
51
|
function hasAriaLabel(x) {
|
|
52
52
|
return x.hasOwnProperty('aria-label');
|
|
53
53
|
}
|
|
54
|
-
function getTreeId(propId
|
|
54
|
+
function getTreeId(propId) {
|
|
55
|
+
var contextId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
56
|
+
var idGenerator = arguments.length > 2 ? arguments[2] : undefined;
|
|
55
57
|
return propId !== null && propId !== void 0 ? propId : contextId === '' ? idGenerator() : contextId;
|
|
56
58
|
}
|
|
57
59
|
var displayToClassNameMap = {
|
|
@@ -61,9 +63,14 @@ var displayToClassNameMap = {
|
|
|
61
63
|
var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
62
64
|
_inherits(EuiTreeView, _Component);
|
|
63
65
|
var _super = _createSuper(EuiTreeView);
|
|
64
|
-
function EuiTreeView(props,
|
|
66
|
+
function EuiTreeView(props,
|
|
67
|
+
// Without the optional ? typing, TS will throw errors on JSX component errors
|
|
68
|
+
// @see https://github.com/facebook/react/issues/13944#issuecomment-1183693239
|
|
69
|
+
context) {
|
|
65
70
|
var _this;
|
|
66
71
|
_classCallCheck(this, EuiTreeView);
|
|
72
|
+
// TODO: context in constructor has been deprecated.
|
|
73
|
+
// We should likely convert this to a function component
|
|
67
74
|
_this = _super.call(this, props, context);
|
|
68
75
|
_defineProperty(_assertThisInitialized(_this), "treeIdGenerator", (0, _services.htmlIdGenerator)('euiTreeView'));
|
|
69
76
|
_defineProperty(_assertThisInitialized(_this), "isNested", void 0);
|
|
@@ -22,7 +22,7 @@ export var EuiAspectRatio = function EuiAspectRatio(_ref) {
|
|
|
22
22
|
style = _ref.style,
|
|
23
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
24
|
var classes = classNames('euiAspectRatio', className);
|
|
25
|
-
var euiAspectRatioStyle = _objectSpread({
|
|
25
|
+
var euiAspectRatioStyle = _objectSpread(_objectSpread({}, children.props.style), {}, {
|
|
26
26
|
aspectRatio: "".concat(width, " / ").concat(height),
|
|
27
27
|
height: 'auto',
|
|
28
28
|
width: '100%',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["className"],
|
|
4
|
-
_excluded2 = ["className"];
|
|
4
|
+
_excluded2 = ["className", "children"];
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -44,6 +44,7 @@ export var EuiCollapsibleNavBody = function EuiCollapsibleNavBody(_ref) {
|
|
|
44
44
|
};
|
|
45
45
|
export var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
|
|
46
46
|
var className = _ref2.className,
|
|
47
|
+
children = _ref2.children,
|
|
47
48
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
48
49
|
var classes = classNames('euiCollapsibleNav__footer', className);
|
|
49
50
|
var _useContext2 = useContext(EuiCollapsibleNavContext),
|
|
@@ -51,9 +52,12 @@ export var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
|
|
|
51
52
|
isPush = _useContext2.isPush;
|
|
52
53
|
var euiTheme = useEuiTheme();
|
|
53
54
|
var styles = euiCollapsibleNavFooterStyles(euiTheme);
|
|
54
|
-
var cssStyles =
|
|
55
|
+
var cssStyles = styles.euiCollapsibleNav__footer;
|
|
56
|
+
var overflowWrapperStyles = [styles.euiFlyoutFooter__overflow, isCollapsed && isPush && styles.isPushCollapsed];
|
|
55
57
|
return ___EmotionJSX(EuiFlyoutFooter, _extends({
|
|
56
58
|
className: classes,
|
|
57
59
|
css: cssStyles
|
|
58
|
-
}, props)
|
|
60
|
+
}, props), ___EmotionJSX("div", {
|
|
61
|
+
css: overflowWrapperStyles
|
|
62
|
+
}, children));
|
|
59
63
|
};
|
|
@@ -13,16 +13,16 @@ import { logicalCSS, euiYScrollWithShadows } from '../../global_styling';
|
|
|
13
13
|
// Otherwise if scrollbars are visible, button icon visibility suffers.
|
|
14
14
|
export var hideScrollbars = "\n scrollbar-width: none; /* Firefox */\n\n &::-webkit-scrollbar {\n display: none; /* Chrome, Edge, & Safari */\n }\n";
|
|
15
15
|
export var euiCollapsibleNavBodyStyles = {
|
|
16
|
-
|
|
17
|
-
euiCollapsibleNav__body: /*#__PURE__*/css(logicalCSS('min-height', '50%'), ";;label:euiCollapsibleNav__body;"),
|
|
16
|
+
euiCollapsibleNav__body: /*#__PURE__*/css(";label:euiCollapsibleNav__body;"),
|
|
18
17
|
isPushCollapsed: /*#__PURE__*/css(".euiFlyoutBody__overflow{", hideScrollbars, ";};label:isPushCollapsed;")
|
|
19
18
|
};
|
|
20
19
|
export var euiCollapsibleNavFooterStyles = function euiCollapsibleNavFooterStyles(euiThemeContext) {
|
|
21
20
|
var euiTheme = euiThemeContext.euiTheme;
|
|
22
21
|
return {
|
|
23
|
-
euiCollapsibleNav__footer: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), "
|
|
22
|
+
euiCollapsibleNav__footer: /*#__PURE__*/css(logicalCSS('max-height', '50%'), " background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), ";;label:euiCollapsibleNav__footer;"),
|
|
23
|
+
euiFlyoutFooter__overflow: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
|
|
24
24
|
side: 'end'
|
|
25
|
-
}), ";;label:
|
|
25
|
+
}), ";;label:euiFlyoutFooter__overflow;"),
|
|
26
26
|
isPushCollapsed: /*#__PURE__*/css(hideScrollbars, ";;label:isPushCollapsed;")
|
|
27
27
|
};
|
|
28
28
|
};
|