@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
|
@@ -9,7 +9,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import React, { useContext, useEffect, useCallback, useMemo } from 'react';
|
|
12
|
-
import { DataGridCellPopoverContext } from '../body/
|
|
12
|
+
import { DataGridCellPopoverContext } from '../body/cell';
|
|
13
13
|
import { DataGridFocusContext } from './focus';
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
15
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
|
|
4
|
+
var _excluded = ["size", "maxWidth", "minWidth", "side", "type", "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
|
|
@@ -13,6 +13,7 @@ var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
|
|
|
13
13
|
import React, { forwardRef, useState, useEffect, useRef, useMemo, useCallback } from 'react';
|
|
14
14
|
import { keys, useCombinedRefs, useEuiTheme } from '../../services';
|
|
15
15
|
import { EuiResizableButton } from '../resizable_container';
|
|
16
|
+
import { getPosition } from '../resizable_container/helpers';
|
|
16
17
|
import { EuiFlyout } from './flyout';
|
|
17
18
|
import { euiFlyoutResizableButtonStyles } from './flyout_resizable.styles';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -23,11 +24,13 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
23
24
|
minWidth = _ref$minWidth === void 0 ? 200 : _ref$minWidth,
|
|
24
25
|
_ref$side = _ref.side,
|
|
25
26
|
side = _ref$side === void 0 ? 'right' : _ref$side,
|
|
27
|
+
_ref$type = _ref.type,
|
|
28
|
+
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
26
29
|
children = _ref.children,
|
|
27
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
31
|
var euiTheme = useEuiTheme();
|
|
29
32
|
var styles = euiFlyoutResizableButtonStyles(euiTheme);
|
|
30
|
-
var cssStyles = [styles.euiFlyoutResizableButton, styles[side]];
|
|
33
|
+
var cssStyles = [styles.euiFlyoutResizableButton, styles[type][side]];
|
|
31
34
|
var getFlyoutMinMaxWidth = useCallback(function (width) {
|
|
32
35
|
return Math.min(Math.max(width, minWidth), maxWidth || Infinity, window.innerWidth - 20 // Leave some offset
|
|
33
36
|
);
|
|
@@ -61,7 +64,7 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
61
64
|
return modifier;
|
|
62
65
|
}, [side, flyoutRef]);
|
|
63
66
|
var onMouseMove = useCallback(function (e) {
|
|
64
|
-
var mouseOffset =
|
|
67
|
+
var mouseOffset = getPosition(e, true) - initialMouseX.current;
|
|
65
68
|
var changedFlyoutWidth = initialWidth.current + mouseOffset * direction;
|
|
66
69
|
setFlyoutWidth(getFlyoutMinMaxWidth(changedFlyoutWidth));
|
|
67
70
|
}, [getFlyoutMinMaxWidth, direction]);
|
|
@@ -74,7 +77,7 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
74
77
|
}, [onMouseMove]);
|
|
75
78
|
var onMouseDown = useCallback(function (e) {
|
|
76
79
|
var _flyoutRef$offsetWidt;
|
|
77
|
-
initialMouseX.current =
|
|
80
|
+
initialMouseX.current = getPosition(e, true);
|
|
78
81
|
initialWidth.current = (_flyoutRef$offsetWidt = flyoutRef === null || flyoutRef === void 0 ? void 0 : flyoutRef.offsetWidth) !== null && _flyoutRef$offsetWidt !== void 0 ? _flyoutRef$offsetWidt : 0;
|
|
79
82
|
|
|
80
83
|
// Window event listeners instead of React events are used
|
|
@@ -104,18 +107,15 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
104
107
|
size: flyoutWidth || size,
|
|
105
108
|
maxWidth: maxWidth,
|
|
106
109
|
side: side,
|
|
110
|
+
type: type,
|
|
107
111
|
ref: setRefs
|
|
108
112
|
}), ___EmotionJSX(EuiResizableButton, {
|
|
109
113
|
isHorizontal: true,
|
|
114
|
+
indicator: "border",
|
|
110
115
|
css: cssStyles,
|
|
111
116
|
onMouseDown: onMouseDown,
|
|
112
117
|
onTouchStart: onMouseDown,
|
|
113
118
|
onKeyDown: onKeyDown
|
|
114
119
|
}), children);
|
|
115
120
|
});
|
|
116
|
-
EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
|
|
117
|
-
var getMouseOrTouchX = function getMouseOrTouchX(e) {
|
|
118
|
-
// Some Typescript fooling is needed here
|
|
119
|
-
var x = e.targetTouches ? e.targetTouches[0].pageX : e.pageX;
|
|
120
|
-
return x;
|
|
121
|
-
};
|
|
121
|
+
EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
|
|
@@ -10,18 +10,24 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalCSS } from '../../global_styling';
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
-
name: "
|
|
14
|
-
styles: "position:absolute
|
|
13
|
+
name: "1gfwqnd-euiFlyoutResizableButton",
|
|
14
|
+
styles: "position:absolute;label:euiFlyoutResizableButton;"
|
|
15
15
|
} : {
|
|
16
|
-
name: "
|
|
17
|
-
styles: "position:absolute
|
|
16
|
+
name: "1gfwqnd-euiFlyoutResizableButton",
|
|
17
|
+
styles: "position:absolute;label:euiFlyoutResizableButton;",
|
|
18
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
19
|
};
|
|
20
20
|
export var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(_ref2) {
|
|
21
21
|
var euiTheme = _ref2.euiTheme;
|
|
22
22
|
return {
|
|
23
23
|
euiFlyoutResizableButton: _ref,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
overlay: {
|
|
25
|
+
left: /*#__PURE__*/css(logicalCSS('right', 0), ";;label:left;"),
|
|
26
|
+
right: /*#__PURE__*/css(logicalCSS('left', 0), ";;label:right;")
|
|
27
|
+
},
|
|
28
|
+
push: {
|
|
29
|
+
left: /*#__PURE__*/css(logicalCSS('right', "-".concat(euiTheme.border.width.thin)), ";;label:left;"),
|
|
30
|
+
right: /*#__PURE__*/css(logicalCSS('left', "-".concat(euiTheme.border.width.thin)), ";;label:right;")
|
|
31
|
+
}
|
|
26
32
|
};
|
|
27
33
|
};
|
|
@@ -13,9 +13,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
13
13
|
|
|
14
14
|
import { useMemo, useReducer } from 'react';
|
|
15
15
|
import { assertNever } from '../common';
|
|
16
|
-
function
|
|
17
|
-
return _typeof(event) === 'object' && '
|
|
18
|
-
}
|
|
16
|
+
export var isTouchEvent = function isTouchEvent(event) {
|
|
17
|
+
return _typeof(event) === 'object' && 'targetTouches' in event;
|
|
18
|
+
};
|
|
19
19
|
export var pxToPercent = function pxToPercent(proportion, whole) {
|
|
20
20
|
if (whole < 1 || proportion < 0) return 0;
|
|
21
21
|
return proportion / whole * 100;
|
|
@@ -42,9 +42,8 @@ export var getPanelMinSize = function getPanelMinSize(panelMinSize, containerSiz
|
|
|
42
42
|
return Math.max(configMin, paddingMin);
|
|
43
43
|
};
|
|
44
44
|
export var getPosition = function getPosition(event, isHorizontal) {
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
return isHorizontal ? clientX : clientY;
|
|
45
|
+
var direction = isHorizontal ? 'clientX' : 'clientY';
|
|
46
|
+
return isTouchEvent(event) ? event.targetTouches[0][direction] : event[direction];
|
|
48
47
|
};
|
|
49
48
|
var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
50
49
|
if (!element) return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["isHorizontal", "alignIndicator", "className"],
|
|
4
|
+
var _excluded = ["isHorizontal", "indicator", "alignIndicator", "className"],
|
|
5
5
|
_excluded2 = ["registration", "id", "disabled", "onFocus"];
|
|
6
6
|
/*
|
|
7
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -24,14 +24,17 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
24
24
|
*/
|
|
25
25
|
export var EuiResizableButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
26
26
|
var isHorizontal = _ref.isHorizontal,
|
|
27
|
+
_ref$indicator = _ref.indicator,
|
|
28
|
+
indicator = _ref$indicator === void 0 ? 'handle' : _ref$indicator,
|
|
27
29
|
_ref$alignIndicator = _ref.alignIndicator,
|
|
28
30
|
alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
|
|
29
31
|
className = _ref.className,
|
|
30
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
33
|
var classes = classNames('euiResizableButton', className);
|
|
34
|
+
var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
|
|
32
35
|
var euiTheme = useEuiTheme();
|
|
33
36
|
var styles = euiResizableButtonStyles(euiTheme);
|
|
34
|
-
var cssStyles = [styles.euiResizableButton,
|
|
37
|
+
var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
|
|
35
38
|
return ___EmotionJSX(EuiI18n, {
|
|
36
39
|
tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
|
|
37
40
|
defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
|
|
@@ -42,21 +42,31 @@ export var euiResizableButtonStyles = function euiResizableButtonStyles(euiTheme
|
|
|
42
42
|
var transitionSpeed = euiTheme.animation.fast;
|
|
43
43
|
var transition = "".concat(transitionSpeed, " ease");
|
|
44
44
|
return {
|
|
45
|
-
//
|
|
46
|
-
// 1. The "grab"
|
|
47
|
-
// 2. Start/end aligned handles should have a slight margin offset that disappears on hover/focus
|
|
45
|
+
// Creates a resizable indicator (either a grab handle or a plain border) with CSS psuedo-elements.
|
|
46
|
+
// 1. The "grab" handle transforms into a thicker straight line on :hover and :focus
|
|
47
|
+
// 2. Start/end aligned grab handles should have a slight margin offset that disappears on hover/focus
|
|
48
48
|
// 3. CSS hack to smooth out/anti-alias the 1px wide handles at various zoom levels
|
|
49
|
-
euiResizableButton: /*#__PURE__*/css("z-index:1;flex-shrink:0;display:flex;justify-content:center;
|
|
50
|
-
return x * 2;
|
|
51
|
-
}), ";&:disabled{display:none;}&:hover,&:focus{gap:0;justify-content:center;}", euiCanAnimate, "{transition:gap ", transition, ",justify-content ", transition, ";}&::before,&::after{content:'';display:block;background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";", euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}}&:focus,&:active{background-color:", transparentize(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", mathWithUnits(transitionSpeed, function (x) {
|
|
49
|
+
euiResizableButton: /*#__PURE__*/css("z-index:1;flex-shrink:0;display:flex;justify-content:center;&:disabled{display:none;}&::before,&::after{content:'';display:block;", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";}}&:focus,&:active{background-color:", transparentize(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", mathWithUnits(transitionSpeed, function (x) {
|
|
52
50
|
return x / 2;
|
|
53
51
|
}), ";}}};label:euiResizableButton;"),
|
|
54
52
|
horizontal: /*#__PURE__*/css("cursor:col-resize;", logicalCSS('height', '100%'), " ", logicalCSS('width', buttonSize), " margin-inline:", mathWithUnits(buttonSize, function (x) {
|
|
55
53
|
return x / -2;
|
|
56
|
-
}), "
|
|
54
|
+
}), ";;label:horizontal;"),
|
|
57
55
|
vertical: /*#__PURE__*/css("flex-direction:column;cursor:row-resize;", logicalCSS('width', '100%'), " ", logicalCSS('height', buttonSize), " margin-block:", mathWithUnits(buttonSize, function (x) {
|
|
58
56
|
return x / -2;
|
|
59
|
-
}), "
|
|
57
|
+
}), ";;label:vertical;"),
|
|
58
|
+
border: /*#__PURE__*/css("&::before,&::after{background-color:", euiTheme.border.color, ";};label:border;"),
|
|
59
|
+
borderDirection: {
|
|
60
|
+
horizontal: /*#__PURE__*/css("&::before{", logicalCSS('width', euiTheme.border.width.thin), " ", logicalCSS('height', '100%'), ";}&:hover,&:focus,&:active{&::after{", logicalCSS('width', euiTheme.border.width.thin), " ", logicalCSS('height', '100%'), ";}};label:horizontal;"),
|
|
61
|
+
vertical: /*#__PURE__*/css("&::before{", logicalCSS('height', euiTheme.border.width.thin), " ", logicalCSS('width', '100%'), ";}&:hover,&:focus,&:active{&::after{", logicalCSS('height', euiTheme.border.width.thin), " ", logicalCSS('width', '100%'), ";}};label:vertical;")
|
|
62
|
+
},
|
|
63
|
+
handle: /*#__PURE__*/css("gap:", mathWithUnits(grabHandleHeight, function (x) {
|
|
64
|
+
return x * 2;
|
|
65
|
+
}), ";&:hover,&:focus,&:active{gap:0;}", euiCanAnimate, "{transition:gap ", transition, ";}&::before,&::after{background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);}&:hover{&::before,&::after{", euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}};label:handle;"),
|
|
66
|
+
handleDirection: {
|
|
67
|
+
horizontal: /*#__PURE__*/css("&::before,&::after{", logicalCSS('width', grabHandleHeight), " ", logicalCSS('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
|
|
68
|
+
vertical: /*#__PURE__*/css("&::before,&::after{", logicalCSS('height', grabHandleHeight), " ", logicalCSS('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;")
|
|
69
|
+
},
|
|
60
70
|
alignIndicator: {
|
|
61
71
|
center: _ref3,
|
|
62
72
|
start: _ref2,
|
|
@@ -99,16 +99,33 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
99
99
|
prevPanelId: prevPanelId,
|
|
100
100
|
nextPanelId: nextPanelId
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
position
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
|
|
103
|
+
// Window event listeners instead of React events are used to continue
|
|
104
|
+
// detecting movement even if the user's mouse leaves the container
|
|
105
|
+
|
|
106
|
+
var onMouseMove = function onMouseMove(event) {
|
|
107
|
+
var position = getPosition(event, isHorizontal);
|
|
108
|
+
actions.dragMove({
|
|
109
|
+
position: position,
|
|
110
|
+
prevPanelId: prevPanelId,
|
|
111
|
+
nextPanelId: nextPanelId
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
var onMouseUp = function onMouseUp() {
|
|
115
|
+
if (resizeContext.current.trigger === 'pointer') {
|
|
116
|
+
resizeEnd();
|
|
117
|
+
}
|
|
118
|
+
actions.reset();
|
|
119
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
120
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
121
|
+
window.removeEventListener('touchmove', onMouseMove);
|
|
122
|
+
window.removeEventListener('touchend', onMouseUp);
|
|
123
|
+
};
|
|
124
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
125
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
126
|
+
window.addEventListener('touchmove', onMouseMove);
|
|
127
|
+
window.addEventListener('touchend', onMouseUp);
|
|
128
|
+
}, [actions, isHorizontal, resizeStart, resizeEnd]);
|
|
112
129
|
var getKeyMoveDirection = useCallback(function (key) {
|
|
113
130
|
var direction = null;
|
|
114
131
|
if (isHorizontal && key === keys.ARROW_LEFT || !isHorizontal && key === keys.ARROW_UP) {
|
|
@@ -146,12 +163,6 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
146
163
|
resizeEnd();
|
|
147
164
|
}
|
|
148
165
|
}, [getKeyMoveDirection, resizeEnd]);
|
|
149
|
-
var onMouseUp = useCallback(function () {
|
|
150
|
-
if (resizeContext.current.trigger === 'pointer') {
|
|
151
|
-
resizeEnd();
|
|
152
|
-
}
|
|
153
|
-
actions.reset();
|
|
154
|
-
}, [actions, resizeEnd]);
|
|
155
166
|
var onBlur = useCallback(function () {
|
|
156
167
|
if (resizeContext.current.trigger === 'key') {
|
|
157
168
|
resizeEnd();
|
|
@@ -210,11 +221,6 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
210
221
|
}, ___EmotionJSX("div", _extends({
|
|
211
222
|
css: cssStyles,
|
|
212
223
|
className: classes,
|
|
213
|
-
ref: containerRef
|
|
214
|
-
onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
|
|
215
|
-
onMouseUp: onMouseUp,
|
|
216
|
-
onMouseLeave: onMouseUp,
|
|
217
|
-
onTouchMove: onMouseMove,
|
|
218
|
-
onTouchEnd: onMouseUp
|
|
224
|
+
ref: containerRef
|
|
219
225
|
}, rest), render()));
|
|
220
226
|
};
|
|
@@ -9,7 +9,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { mathWithUnits, logicalCSS, euiFontSizeFromScale, euiCanAnimate, euiAnimScale } from '../../global_styling';
|
|
12
|
-
import { makeHighContrastColor } from '../../services';
|
|
13
12
|
import { euiStepVariables } from './step.styles';
|
|
14
13
|
import { euiButtonFillColor } from '../../themes/amsterdam/global_styling/mixins';
|
|
15
14
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -42,12 +41,12 @@ export var euiStepNumberStyles = function euiStepNumberStyles(euiThemeContext) {
|
|
|
42
41
|
xs: /*#__PURE__*/css(createStepsNumber(euiStep.numberXSSize, euiFontSizeFromScale('xs', euiTheme)), ";;label:xs;"),
|
|
43
42
|
// status
|
|
44
43
|
incomplete: /*#__PURE__*/css("background-color:transparent;color:", euiTheme.colors.text, ";border:", euiTheme.border.thick, ";;label:incomplete;"),
|
|
45
|
-
disabled: /*#__PURE__*/css(
|
|
44
|
+
disabled: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'disabled'), ";;label:disabled;"),
|
|
46
45
|
loading: _ref,
|
|
47
|
-
warning: /*#__PURE__*/css(
|
|
48
|
-
danger: /*#__PURE__*/css(
|
|
49
|
-
complete: /*#__PURE__*/css(
|
|
50
|
-
current: /*#__PURE__*/css("border:
|
|
46
|
+
warning: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'warning'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:warning;"),
|
|
47
|
+
danger: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'danger'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:danger;"),
|
|
48
|
+
complete: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, 'success'), " ", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:complete;"),
|
|
49
|
+
current: /*#__PURE__*/css("border:", euiTheme.border.width.thick, " solid ", euiTheme.colors.body, ";box-shadow:0 0 0 ", euiTheme.border.width.thick, " ", euiTheme.colors.primary, ";;label:current;")
|
|
51
50
|
};
|
|
52
51
|
};
|
|
53
52
|
export var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref3) {
|
|
@@ -67,6 +66,6 @@ export var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref
|
|
|
67
66
|
incomplete: /*#__PURE__*/css("display:unset;position:relative;inset-block-start:-", euiTheme.border.width.thick, ";;label:incomplete;"),
|
|
68
67
|
loading: /*#__PURE__*/css(";label:loading;"),
|
|
69
68
|
disabled: /*#__PURE__*/css(";label:disabled;"),
|
|
70
|
-
current: /*#__PURE__*/css(";label:current;")
|
|
69
|
+
current: /*#__PURE__*/css("display:inline-block;transform:translateY(-", euiTheme.border.width.thick, ");;label:current;")
|
|
71
70
|
};
|
|
72
71
|
};
|
|
@@ -32,7 +32,9 @@ var EuiTreeViewContext = /*#__PURE__*/createContext('');
|
|
|
32
32
|
function hasAriaLabel(x) {
|
|
33
33
|
return x.hasOwnProperty('aria-label');
|
|
34
34
|
}
|
|
35
|
-
function getTreeId(propId
|
|
35
|
+
function getTreeId(propId) {
|
|
36
|
+
var contextId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
37
|
+
var idGenerator = arguments.length > 2 ? arguments[2] : undefined;
|
|
36
38
|
return propId !== null && propId !== void 0 ? propId : contextId === '' ? idGenerator() : contextId;
|
|
37
39
|
}
|
|
38
40
|
var displayToClassNameMap = {
|
|
@@ -42,9 +44,14 @@ var displayToClassNameMap = {
|
|
|
42
44
|
export var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
43
45
|
_inherits(EuiTreeView, _Component);
|
|
44
46
|
var _super = _createSuper(EuiTreeView);
|
|
45
|
-
function EuiTreeView(props,
|
|
47
|
+
function EuiTreeView(props,
|
|
48
|
+
// Without the optional ? typing, TS will throw errors on JSX component errors
|
|
49
|
+
// @see https://github.com/facebook/react/issues/13944#issuecomment-1183693239
|
|
50
|
+
context) {
|
|
46
51
|
var _this;
|
|
47
52
|
_classCallCheck(this, EuiTreeView);
|
|
53
|
+
// TODO: context in constructor has been deprecated.
|
|
54
|
+
// We should likely convert this to a function component
|
|
48
55
|
_this = _super.call(this, props, context);
|
|
49
56
|
_defineProperty(_assertThisInitialized(_this), "treeIdGenerator", htmlIdGenerator('euiTreeView'));
|
|
50
57
|
_defineProperty(_assertThisInitialized(_this), "isNested", void 0);
|
|
@@ -28,7 +28,7 @@ var EuiAspectRatio = function EuiAspectRatio(_ref) {
|
|
|
28
28
|
style = _ref.style,
|
|
29
29
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
30
|
var classes = (0, _classnames.default)('euiAspectRatio', className);
|
|
31
|
-
var euiAspectRatioStyle = _objectSpread({
|
|
31
|
+
var euiAspectRatioStyle = _objectSpread(_objectSpread({}, children.props.style), {}, {
|
|
32
32
|
aspectRatio: "".concat(width, " / ").concat(height),
|
|
33
33
|
height: 'auto',
|
|
34
34
|
width: '100%',
|
|
@@ -16,7 +16,7 @@ var _context = require("./context");
|
|
|
16
16
|
var _collapsible_nav_body_footer = require("./collapsible_nav_body_footer.styles");
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _excluded = ["className"],
|
|
19
|
-
_excluded2 = ["className"];
|
|
19
|
+
_excluded2 = ["className", "children"];
|
|
20
20
|
/*
|
|
21
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
22
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -53,6 +53,7 @@ var EuiCollapsibleNavBody = function EuiCollapsibleNavBody(_ref) {
|
|
|
53
53
|
exports.EuiCollapsibleNavBody = EuiCollapsibleNavBody;
|
|
54
54
|
var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
|
|
55
55
|
var className = _ref2.className,
|
|
56
|
+
children = _ref2.children,
|
|
56
57
|
props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
57
58
|
var classes = (0, _classnames.default)('euiCollapsibleNav__footer', className);
|
|
58
59
|
var _useContext2 = (0, _react.useContext)(_context.EuiCollapsibleNavContext),
|
|
@@ -60,10 +61,13 @@ var EuiCollapsibleNavFooter = function EuiCollapsibleNavFooter(_ref2) {
|
|
|
60
61
|
isPush = _useContext2.isPush;
|
|
61
62
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
62
63
|
var styles = (0, _collapsible_nav_body_footer.euiCollapsibleNavFooterStyles)(euiTheme);
|
|
63
|
-
var cssStyles =
|
|
64
|
+
var cssStyles = styles.euiCollapsibleNav__footer;
|
|
65
|
+
var overflowWrapperStyles = [styles.euiFlyoutFooter__overflow, isCollapsed && isPush && styles.isPushCollapsed];
|
|
64
66
|
return (0, _react2.jsx)(_flyout.EuiFlyoutFooter, (0, _extends2.default)({
|
|
65
67
|
className: classes,
|
|
66
68
|
css: cssStyles
|
|
67
|
-
}, props))
|
|
69
|
+
}, props), (0, _react2.jsx)("div", {
|
|
70
|
+
css: overflowWrapperStyles
|
|
71
|
+
}, children));
|
|
68
72
|
};
|
|
69
73
|
exports.EuiCollapsibleNavFooter = EuiCollapsibleNavFooter;
|
|
@@ -19,17 +19,17 @@ var _global_styling = require("../../global_styling");
|
|
|
19
19
|
var hideScrollbars = "\n scrollbar-width: none; /* Firefox */\n\n &::-webkit-scrollbar {\n display: none; /* Chrome, Edge, & Safari */\n }\n";
|
|
20
20
|
exports.hideScrollbars = hideScrollbars;
|
|
21
21
|
var euiCollapsibleNavBodyStyles = {
|
|
22
|
-
|
|
23
|
-
euiCollapsibleNav__body: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-height', '50%'), ";;label:euiCollapsibleNav__body;"),
|
|
22
|
+
euiCollapsibleNav__body: /*#__PURE__*/(0, _react.css)(";label:euiCollapsibleNav__body;"),
|
|
24
23
|
isPushCollapsed: /*#__PURE__*/(0, _react.css)(".euiFlyoutBody__overflow{", hideScrollbars, ";};label:isPushCollapsed;")
|
|
25
24
|
};
|
|
26
25
|
exports.euiCollapsibleNavBodyStyles = euiCollapsibleNavBodyStyles;
|
|
27
26
|
var euiCollapsibleNavFooterStyles = function euiCollapsibleNavFooterStyles(euiThemeContext) {
|
|
28
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
29
28
|
return {
|
|
30
|
-
euiCollapsibleNav__footer: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), "
|
|
29
|
+
euiCollapsibleNav__footer: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '50%'), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";;label:euiCollapsibleNav__footer;"),
|
|
30
|
+
euiFlyoutFooter__overflow: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext, {
|
|
31
31
|
side: 'end'
|
|
32
|
-
}), ";;label:
|
|
32
|
+
}), ";;label:euiFlyoutFooter__overflow;"),
|
|
33
33
|
isPushCollapsed: /*#__PURE__*/(0, _react.css)(hideScrollbars, ";;label:isPushCollapsed;")
|
|
34
34
|
};
|
|
35
35
|
};
|