@elastic/eui 92.0.0 → 92.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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} +56 -209
- 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 +125 -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} +56 -209
- 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} +56 -209
- 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} +56 -209
- 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} +56 -209
- 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
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.useFocus = exports.preventTabbing = exports.notifyCellOfFocusState = exports.getParentCellContent = exports.createKeyDownHandler = exports.DataGridFocusContext = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _tabbable = require("tabbable");
|
|
@@ -30,9 +30,7 @@ exports.DataGridFocusContext = DataGridFocusContext;
|
|
|
30
30
|
/**
|
|
31
31
|
* Main focus context and overarching focus state management
|
|
32
32
|
*/
|
|
33
|
-
var useFocus = function useFocus(
|
|
34
|
-
var headerIsInteractive = _ref.headerIsInteractive,
|
|
35
|
-
gridItemsRendered = _ref.gridItemsRendered;
|
|
33
|
+
var useFocus = function useFocus() {
|
|
36
34
|
// Maintain a map of focus cell state callbacks
|
|
37
35
|
var cellsUpdateFocus = (0, _react.useRef)(new Map());
|
|
38
36
|
var onFocusUpdate = (0, _react.useCallback)(function (cell, updateFocus) {
|
|
@@ -53,14 +51,17 @@ var useFocus = function useFocus(_ref) {
|
|
|
53
51
|
focusedCell = _useState4[0],
|
|
54
52
|
_setFocusedCell = _useState4[1];
|
|
55
53
|
var setFocusedCell = (0, _react.useCallback)(function (nextFocusedCell) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
_setFocusedCell(function (prevFocusedCell) {
|
|
55
|
+
// If the x/y coordinates remained the same, don't update. This keeps the focusedCell
|
|
56
|
+
// reference stable, and allows it to be used in places that need reference equality.
|
|
57
|
+
if (nextFocusedCell[0] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[0]) && nextFocusedCell[1] === (prevFocusedCell === null || prevFocusedCell === void 0 ? void 0 : prevFocusedCell[1])) {
|
|
58
|
+
return prevFocusedCell;
|
|
59
|
+
} else {
|
|
60
|
+
setIsFocusedCellInView(true); // scrolling.ts ensures focused cells are fully in view
|
|
61
|
+
return nextFocusedCell;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, []);
|
|
64
65
|
var previousCell = (0, _react.useRef)(undefined);
|
|
65
66
|
(0, _react.useEffect)(function () {
|
|
66
67
|
if (previousCell.current) {
|
|
@@ -72,19 +73,8 @@ var useFocus = function useFocus(_ref) {
|
|
|
72
73
|
}
|
|
73
74
|
}, [cellsUpdateFocus, focusedCell]);
|
|
74
75
|
var focusFirstVisibleInteractiveCell = (0, _react.useCallback)(function () {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
setFocusedCell([0, -1]);
|
|
78
|
-
} else if (gridItemsRendered.current) {
|
|
79
|
-
var _gridItemsRendered$cu = gridItemsRendered.current,
|
|
80
|
-
visibleColumnStartIndex = _gridItemsRendered$cu.visibleColumnStartIndex,
|
|
81
|
-
visibleRowStartIndex = _gridItemsRendered$cu.visibleRowStartIndex;
|
|
82
|
-
setFocusedCell([visibleColumnStartIndex, visibleRowStartIndex]);
|
|
83
|
-
} else {
|
|
84
|
-
// If the header is non-interactive and there are no rendered cells,
|
|
85
|
-
// there's nothing to do - we might as well leave focus on the grid body wrapper
|
|
86
|
-
}
|
|
87
|
-
}, [setFocusedCell, headerIsInteractive, gridItemsRendered]);
|
|
76
|
+
setFocusedCell([0, -1]);
|
|
77
|
+
}, [setFocusedCell]);
|
|
88
78
|
var focusProps = (0, _react.useMemo)(function () {
|
|
89
79
|
return isFocusedCellInView ? {
|
|
90
80
|
// FireFox allows tabbing to a div that is scrollable, while Chrome does not
|
|
@@ -127,16 +117,15 @@ var notifyCellOfFocusState = function notifyCellOfFocusState(cellsUpdateFocus, c
|
|
|
127
117
|
* Keydown handler for connecting focus state with keyboard navigation
|
|
128
118
|
*/
|
|
129
119
|
exports.notifyCellOfFocusState = notifyCellOfFocusState;
|
|
130
|
-
var createKeyDownHandler = function createKeyDownHandler(
|
|
131
|
-
var gridElement =
|
|
132
|
-
visibleColCount =
|
|
133
|
-
visibleRowCount =
|
|
134
|
-
visibleRowStartIndex =
|
|
135
|
-
rowCount =
|
|
136
|
-
pagination =
|
|
137
|
-
hasFooter =
|
|
138
|
-
|
|
139
|
-
focusContext = _ref2.focusContext;
|
|
120
|
+
var createKeyDownHandler = function createKeyDownHandler(_ref) {
|
|
121
|
+
var gridElement = _ref.gridElement,
|
|
122
|
+
visibleColCount = _ref.visibleColCount,
|
|
123
|
+
visibleRowCount = _ref.visibleRowCount,
|
|
124
|
+
visibleRowStartIndex = _ref.visibleRowStartIndex,
|
|
125
|
+
rowCount = _ref.rowCount,
|
|
126
|
+
pagination = _ref.pagination,
|
|
127
|
+
hasFooter = _ref.hasFooter,
|
|
128
|
+
focusContext = _ref.focusContext;
|
|
140
129
|
return function (event) {
|
|
141
130
|
var focusedCell = focusContext.focusedCell,
|
|
142
131
|
setFocusedCell = focusContext.setFocusedCell;
|
|
@@ -170,8 +159,7 @@ var createKeyDownHandler = function createKeyDownHandler(_ref2) {
|
|
|
170
159
|
}
|
|
171
160
|
} else if (key === _services.keys.ARROW_UP) {
|
|
172
161
|
event.preventDefault();
|
|
173
|
-
|
|
174
|
-
if (y > minimumIndex) {
|
|
162
|
+
if (y > -1) {
|
|
175
163
|
setFocusedCell([x, y - 1]);
|
|
176
164
|
}
|
|
177
165
|
} else if (key === _services.keys.ARROW_RIGHT) {
|
|
@@ -261,22 +249,4 @@ var getParentCellContent = function getParentCellContent(_element) {
|
|
|
261
249
|
}
|
|
262
250
|
return element;
|
|
263
251
|
};
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Focus fixes & workarounds
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
|
-
// If the focus is on the header, and the header is no longer interactive,
|
|
270
|
-
// move the focus down to the first row
|
|
271
|
-
exports.getParentCellContent = getParentCellContent;
|
|
272
|
-
var useHeaderFocusWorkaround = function useHeaderFocusWorkaround(headerIsInteractive) {
|
|
273
|
-
var _useContext = (0, _react.useContext)(DataGridFocusContext),
|
|
274
|
-
focusedCell = _useContext.focusedCell,
|
|
275
|
-
setFocusedCell = _useContext.setFocusedCell;
|
|
276
|
-
(0, _react.useEffect)(function () {
|
|
277
|
-
if (!headerIsInteractive && focusedCell && focusedCell[1] === -1) {
|
|
278
|
-
setFocusedCell([focusedCell[0], 0]);
|
|
279
|
-
}
|
|
280
|
-
}, [headerIsInteractive, focusedCell, setFocusedCell]);
|
|
281
|
-
};
|
|
282
|
-
exports.useHeaderFocusWorkaround = useHeaderFocusWorkaround;
|
|
252
|
+
exports.getParentCellContent = getParentCellContent;
|
|
@@ -9,7 +9,7 @@ exports.useScrollCellIntoView = exports.useScrollBars = exports.useScroll = void
|
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _cell = require("../body/cell");
|
|
13
13
|
var _focus = require("./focus");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -41,7 +41,7 @@ var useScroll = function useScroll(args) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}, [focusedCell, scrollCellIntoView]);
|
|
44
|
-
var _useContext2 = (0, _react.useContext)(
|
|
44
|
+
var _useContext2 = (0, _react.useContext)(_cell.DataGridCellPopoverContext),
|
|
45
45
|
popoverIsOpen = _useContext2.popoverIsOpen,
|
|
46
46
|
cellLocation = _useContext2.cellLocation;
|
|
47
47
|
(0, _react.useEffect)(function () {
|
|
@@ -12,10 +12,11 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _services = require("../../services");
|
|
14
14
|
var _resizable_container = require("../resizable_container");
|
|
15
|
+
var _helpers = require("../resizable_container/helpers");
|
|
15
16
|
var _flyout = require("./flyout");
|
|
16
17
|
var _flyout_resizable = require("./flyout_resizable.styles");
|
|
17
18
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _excluded = ["size", "maxWidth", "minWidth", "side", "children"];
|
|
19
|
+
var _excluded = ["size", "maxWidth", "minWidth", "side", "type", "children"];
|
|
19
20
|
/*
|
|
20
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -32,11 +33,13 @@ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
32
33
|
minWidth = _ref$minWidth === void 0 ? 200 : _ref$minWidth,
|
|
33
34
|
_ref$side = _ref.side,
|
|
34
35
|
side = _ref$side === void 0 ? 'right' : _ref$side,
|
|
36
|
+
_ref$type = _ref.type,
|
|
37
|
+
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
35
38
|
children = _ref.children,
|
|
36
39
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
37
40
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
38
41
|
var styles = (0, _flyout_resizable.euiFlyoutResizableButtonStyles)(euiTheme);
|
|
39
|
-
var cssStyles = [styles.euiFlyoutResizableButton, styles[side]];
|
|
42
|
+
var cssStyles = [styles.euiFlyoutResizableButton, styles[type][side]];
|
|
40
43
|
var getFlyoutMinMaxWidth = (0, _react.useCallback)(function (width) {
|
|
41
44
|
return Math.min(Math.max(width, minWidth), maxWidth || Infinity, window.innerWidth - 20 // Leave some offset
|
|
42
45
|
);
|
|
@@ -70,7 +73,7 @@ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
70
73
|
return modifier;
|
|
71
74
|
}, [side, flyoutRef]);
|
|
72
75
|
var onMouseMove = (0, _react.useCallback)(function (e) {
|
|
73
|
-
var mouseOffset =
|
|
76
|
+
var mouseOffset = (0, _helpers.getPosition)(e, true) - initialMouseX.current;
|
|
74
77
|
var changedFlyoutWidth = initialWidth.current + mouseOffset * direction;
|
|
75
78
|
setFlyoutWidth(getFlyoutMinMaxWidth(changedFlyoutWidth));
|
|
76
79
|
}, [getFlyoutMinMaxWidth, direction]);
|
|
@@ -83,7 +86,7 @@ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
83
86
|
}, [onMouseMove]);
|
|
84
87
|
var onMouseDown = (0, _react.useCallback)(function (e) {
|
|
85
88
|
var _flyoutRef$offsetWidt;
|
|
86
|
-
initialMouseX.current =
|
|
89
|
+
initialMouseX.current = (0, _helpers.getPosition)(e, true);
|
|
87
90
|
initialWidth.current = (_flyoutRef$offsetWidt = flyoutRef === null || flyoutRef === void 0 ? void 0 : flyoutRef.offsetWidth) !== null && _flyoutRef$offsetWidt !== void 0 ? _flyoutRef$offsetWidt : 0;
|
|
88
91
|
|
|
89
92
|
// Window event listeners instead of React events are used
|
|
@@ -113,9 +116,11 @@ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
113
116
|
size: flyoutWidth || size,
|
|
114
117
|
maxWidth: maxWidth,
|
|
115
118
|
side: side,
|
|
119
|
+
type: type,
|
|
116
120
|
ref: setRefs
|
|
117
121
|
}), (0, _react2.jsx)(_resizable_container.EuiResizableButton, {
|
|
118
122
|
isHorizontal: true,
|
|
123
|
+
indicator: "border",
|
|
119
124
|
css: cssStyles,
|
|
120
125
|
onMouseDown: onMouseDown,
|
|
121
126
|
onTouchStart: onMouseDown,
|
|
@@ -123,9 +128,4 @@ var EuiFlyoutResizable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
|
|
|
123
128
|
}), children);
|
|
124
129
|
});
|
|
125
130
|
exports.EuiFlyoutResizable = EuiFlyoutResizable;
|
|
126
|
-
EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
|
|
127
|
-
var getMouseOrTouchX = function getMouseOrTouchX(e) {
|
|
128
|
-
// Some Typescript fooling is needed here
|
|
129
|
-
var x = e.targetTouches ? e.targetTouches[0].pageX : e.pageX;
|
|
130
|
-
return x;
|
|
131
|
-
};
|
|
131
|
+
EuiFlyoutResizable.displayName = 'EuiFlyoutResizable';
|
|
@@ -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;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useContainerCallbacks = exports.sizesOnly = exports.pxToPercent = exports.getPosition = exports.getPanelMinSize = void 0;
|
|
7
|
+
exports.useContainerCallbacks = exports.sizesOnly = exports.pxToPercent = exports.isTouchEvent = exports.getPosition = exports.getPanelMinSize = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -18,9 +18,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
18
18
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
19
19
|
* Side Public License, v 1.
|
|
20
20
|
*/
|
|
21
|
-
function
|
|
22
|
-
return (0, _typeof2.default)(event) === 'object' && '
|
|
23
|
-
}
|
|
21
|
+
var isTouchEvent = function isTouchEvent(event) {
|
|
22
|
+
return (0, _typeof2.default)(event) === 'object' && 'targetTouches' in event;
|
|
23
|
+
};
|
|
24
|
+
exports.isTouchEvent = isTouchEvent;
|
|
24
25
|
var pxToPercent = function pxToPercent(proportion, whole) {
|
|
25
26
|
if (whole < 1 || proportion < 0) return 0;
|
|
26
27
|
return proportion / whole * 100;
|
|
@@ -50,9 +51,8 @@ var getPanelMinSize = function getPanelMinSize(panelMinSize, containerSize) {
|
|
|
50
51
|
};
|
|
51
52
|
exports.getPanelMinSize = getPanelMinSize;
|
|
52
53
|
var getPosition = function getPosition(event, isHorizontal) {
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
return isHorizontal ? clientX : clientY;
|
|
54
|
+
var direction = isHorizontal ? 'clientX' : 'clientY';
|
|
55
|
+
return isTouchEvent(event) ? event.targetTouches[0][direction] : event[direction];
|
|
56
56
|
};
|
|
57
57
|
exports.getPosition = getPosition;
|
|
58
58
|
var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
@@ -16,7 +16,7 @@ var _services = require("../../services");
|
|
|
16
16
|
var _context = require("./context");
|
|
17
17
|
var _resizable_button = require("./resizable_button.styles");
|
|
18
18
|
var _react2 = require("@emotion/react");
|
|
19
|
-
var _excluded = ["isHorizontal", "alignIndicator", "className"],
|
|
19
|
+
var _excluded = ["isHorizontal", "indicator", "alignIndicator", "className"],
|
|
20
20
|
_excluded2 = ["registration", "id", "disabled", "onFocus"];
|
|
21
21
|
/*
|
|
22
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -33,14 +33,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
33
|
*/
|
|
34
34
|
var EuiResizableButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
35
35
|
var isHorizontal = _ref.isHorizontal,
|
|
36
|
+
_ref$indicator = _ref.indicator,
|
|
37
|
+
indicator = _ref$indicator === void 0 ? 'handle' : _ref$indicator,
|
|
36
38
|
_ref$alignIndicator = _ref.alignIndicator,
|
|
37
39
|
alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
|
|
38
40
|
className = _ref.className,
|
|
39
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
40
42
|
var classes = (0, _classnames.default)('euiResizableButton', className);
|
|
43
|
+
var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
|
|
41
44
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
42
45
|
var styles = (0, _resizable_button.euiResizableButtonStyles)(euiTheme);
|
|
43
|
-
var cssStyles = [styles.euiResizableButton,
|
|
46
|
+
var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
|
|
44
47
|
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
45
48
|
tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
|
|
46
49
|
defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
|
|
@@ -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,
|
|
@@ -108,16 +108,33 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
108
108
|
prevPanelId: prevPanelId,
|
|
109
109
|
nextPanelId: nextPanelId
|
|
110
110
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
position
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
|
|
112
|
+
// Window event listeners instead of React events are used to continue
|
|
113
|
+
// detecting movement even if the user's mouse leaves the container
|
|
114
|
+
|
|
115
|
+
var onMouseMove = function onMouseMove(event) {
|
|
116
|
+
var position = (0, _helpers.getPosition)(event, isHorizontal);
|
|
117
|
+
actions.dragMove({
|
|
118
|
+
position: position,
|
|
119
|
+
prevPanelId: prevPanelId,
|
|
120
|
+
nextPanelId: nextPanelId
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var onMouseUp = function onMouseUp() {
|
|
124
|
+
if (resizeContext.current.trigger === 'pointer') {
|
|
125
|
+
resizeEnd();
|
|
126
|
+
}
|
|
127
|
+
actions.reset();
|
|
128
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
129
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
130
|
+
window.removeEventListener('touchmove', onMouseMove);
|
|
131
|
+
window.removeEventListener('touchend', onMouseUp);
|
|
132
|
+
};
|
|
133
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
134
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
135
|
+
window.addEventListener('touchmove', onMouseMove);
|
|
136
|
+
window.addEventListener('touchend', onMouseUp);
|
|
137
|
+
}, [actions, isHorizontal, resizeStart, resizeEnd]);
|
|
121
138
|
var getKeyMoveDirection = (0, _react.useCallback)(function (key) {
|
|
122
139
|
var direction = null;
|
|
123
140
|
if (isHorizontal && key === _services.keys.ARROW_LEFT || !isHorizontal && key === _services.keys.ARROW_UP) {
|
|
@@ -155,12 +172,6 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
155
172
|
resizeEnd();
|
|
156
173
|
}
|
|
157
174
|
}, [getKeyMoveDirection, resizeEnd]);
|
|
158
|
-
var onMouseUp = (0, _react.useCallback)(function () {
|
|
159
|
-
if (resizeContext.current.trigger === 'pointer') {
|
|
160
|
-
resizeEnd();
|
|
161
|
-
}
|
|
162
|
-
actions.reset();
|
|
163
|
-
}, [actions, resizeEnd]);
|
|
164
175
|
var onBlur = (0, _react.useCallback)(function () {
|
|
165
176
|
if (resizeContext.current.trigger === 'key') {
|
|
166
177
|
resizeEnd();
|
|
@@ -219,12 +230,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
219
230
|
}, (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
220
231
|
css: cssStyles,
|
|
221
232
|
className: classes,
|
|
222
|
-
ref: containerRef
|
|
223
|
-
onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
|
|
224
|
-
onMouseUp: onMouseUp,
|
|
225
|
-
onMouseLeave: onMouseUp,
|
|
226
|
-
onTouchMove: onMouseMove,
|
|
227
|
-
onTouchEnd: onMouseUp
|
|
233
|
+
ref: containerRef
|
|
228
234
|
}, rest), render()));
|
|
229
235
|
};
|
|
230
236
|
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;
|
|
@@ -40,7 +40,9 @@ var EuiTreeViewContext = /*#__PURE__*/(0, _react.createContext)('');
|
|
|
40
40
|
function hasAriaLabel(x) {
|
|
41
41
|
return x.hasOwnProperty('aria-label');
|
|
42
42
|
}
|
|
43
|
-
function getTreeId(propId
|
|
43
|
+
function getTreeId(propId) {
|
|
44
|
+
var contextId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
45
|
+
var idGenerator = arguments.length > 2 ? arguments[2] : undefined;
|
|
44
46
|
return propId !== null && propId !== void 0 ? propId : contextId === '' ? idGenerator() : contextId;
|
|
45
47
|
}
|
|
46
48
|
var displayToClassNameMap = {
|
|
@@ -50,9 +52,14 @@ var displayToClassNameMap = {
|
|
|
50
52
|
var EuiTreeView = /*#__PURE__*/function (_Component) {
|
|
51
53
|
(0, _inherits2.default)(EuiTreeView, _Component);
|
|
52
54
|
var _super = _createSuper(EuiTreeView);
|
|
53
|
-
function EuiTreeView(props,
|
|
55
|
+
function EuiTreeView(props,
|
|
56
|
+
// Without the optional ? typing, TS will throw errors on JSX component errors
|
|
57
|
+
// @see https://github.com/facebook/react/issues/13944#issuecomment-1183693239
|
|
58
|
+
context) {
|
|
54
59
|
var _this;
|
|
55
60
|
(0, _classCallCheck2.default)(this, EuiTreeView);
|
|
61
|
+
// TODO: context in constructor has been deprecated.
|
|
62
|
+
// We should likely convert this to a function component
|
|
56
63
|
_this = _super.call(this, props, context);
|
|
57
64
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "treeIdGenerator", (0, _services.htmlIdGenerator)('euiTreeView'));
|
|
58
65
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isNested", void 0);
|
package/package.json
CHANGED
|
@@ -17,18 +17,19 @@
|
|
|
17
17
|
align-items: center;
|
|
18
18
|
display: flex;
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// Workaround for focus trap
|
|
21
|
+
& > [data-focus-lock-disabled] {
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:focus,
|
|
26
|
+
&--hasColumnActions:focus-within,
|
|
27
|
+
&--isActionsPopoverOpen {
|
|
21
28
|
@include euiDataGridCellFocus;
|
|
22
|
-
border-top: none;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
// We only truncate if the cell is not a control column.
|
|
26
32
|
&:not(.euiDataGridHeaderCell--controlColumn) {
|
|
27
|
-
&:focus-within {
|
|
28
|
-
@include euiDataGridCellFocus;
|
|
29
|
-
border-top: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
33
|
.euiDataGridHeaderCell__button {
|
|
33
34
|
position: relative;
|
|
34
35
|
display: flex;
|
|
@@ -29,7 +29,7 @@ var EuiAspectRatio = function EuiAspectRatio(_ref) {
|
|
|
29
29
|
style = _ref.style,
|
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
31
|
var classes = (0, _classnames.default)('euiAspectRatio', className);
|
|
32
|
-
var euiAspectRatioStyle = _objectSpread({
|
|
32
|
+
var euiAspectRatioStyle = _objectSpread(_objectSpread({}, children.props.style), {}, {
|
|
33
33
|
aspectRatio: "".concat(width, " / ").concat(height),
|
|
34
34
|
height: 'auto',
|
|
35
35
|
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
|
};
|