@elastic/eui 113.2.1 → 114.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/basic_table/collapsed_item_actions.js +2 -0
- package/es/components/button/split_button/split_button.js +13 -0
- package/es/components/button/split_button/split_button_actions.js +15 -0
- package/es/components/collapsible_nav/collapsible_nav.js +5 -0
- package/es/components/color_picker/color_picker.js +31 -8
- package/es/components/context_menu/context_menu_item.js +9 -3
- package/es/components/context_menu/context_menu_item.styles.js +6 -2
- package/es/components/datagrid/utils/scrolling.js +39 -10
- package/es/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
- package/es/components/flyout/_flyout_overlay.js +34 -4
- package/es/components/flyout/const.js +10 -0
- package/es/components/flyout/flyout.component.js +49 -57
- package/es/components/flyout/flyout.js +10 -2
- package/es/components/flyout/flyout.styles.js +2 -2
- package/es/components/flyout/flyout_menu.js +19 -5
- package/es/components/flyout/flyout_resizable.js +5 -0
- package/es/components/flyout/manager/actions.js +12 -5
- package/es/components/flyout/manager/flyout_child.js +9 -2
- package/es/components/flyout/manager/flyout_managed.js +27 -14
- package/es/components/flyout/manager/reducer.js +251 -54
- package/es/components/flyout/manager/store.js +74 -12
- package/es/components/flyout/use_flyout_menu.js +70 -0
- package/es/components/form/file_picker/file_picker.js +46 -18
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
- package/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
- package/es/components/overlay_mask/overlay_mask.js +10 -3
- package/es/components/tree_view/tree_view_item.styles.js +1 -1
- package/es/services/hooks/index.js +8 -8
- package/es/services/hooks/useIsPointerDown.js +6 -15
- package/es/services/index.js +1 -1
- package/eui.d.ts +477 -63
- package/i18ntokens.json +661 -643
- package/lib/components/basic_table/collapsed_item_actions.js +2 -0
- package/lib/components/button/split_button/split_button.js +13 -0
- package/lib/components/button/split_button/split_button_actions.js +15 -0
- package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
- package/lib/components/color_picker/color_picker.js +30 -7
- package/lib/components/context_menu/context_menu_item.js +9 -3
- package/lib/components/context_menu/context_menu_item.styles.js +5 -1
- package/lib/components/datagrid/utils/scrolling.js +37 -8
- package/lib/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
- package/lib/components/flyout/_flyout_overlay.js +33 -3
- package/lib/components/flyout/const.js +11 -1
- package/lib/components/flyout/flyout.component.js +48 -56
- package/lib/components/flyout/flyout.js +15 -1
- package/lib/components/flyout/flyout.styles.js +2 -2
- package/lib/components/flyout/flyout_menu.js +19 -5
- package/lib/components/flyout/flyout_resizable.js +5 -0
- package/lib/components/flyout/manager/actions.js +12 -5
- package/lib/components/flyout/manager/flyout_child.js +9 -2
- package/lib/components/flyout/manager/flyout_managed.js +19 -12
- package/lib/components/flyout/manager/reducer.js +250 -53
- package/lib/components/flyout/manager/store.js +74 -14
- package/lib/components/flyout/use_flyout_menu.js +75 -0
- package/lib/components/form/file_picker/file_picker.js +46 -18
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
- package/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
- package/lib/components/overlay_mask/overlay_mask.js +10 -3
- package/lib/components/tree_view/tree_view_item.styles.js +1 -1
- package/lib/services/hooks/index.js +60 -91
- package/lib/services/hooks/useIsPointerDown.js +7 -14
- package/lib/services/index.js +70 -11
- package/optimize/es/components/basic_table/collapsed_item_actions.js +2 -0
- package/optimize/es/components/color_picker/color_picker.js +31 -8
- package/optimize/es/components/context_menu/context_menu_item.js +3 -2
- package/optimize/es/components/context_menu/context_menu_item.styles.js +6 -2
- package/optimize/es/components/datagrid/utils/scrolling.js +39 -10
- package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
- package/optimize/es/components/flyout/_flyout_overlay.js +34 -4
- package/optimize/es/components/flyout/const.js +10 -0
- package/optimize/es/components/flyout/flyout.component.js +49 -57
- package/optimize/es/components/flyout/flyout.js +5 -2
- package/optimize/es/components/flyout/flyout.styles.js +2 -2
- package/optimize/es/components/flyout/flyout_menu.js +7 -3
- package/optimize/es/components/flyout/manager/actions.js +12 -5
- package/optimize/es/components/flyout/manager/flyout_managed.js +18 -12
- package/optimize/es/components/flyout/manager/reducer.js +251 -54
- package/optimize/es/components/flyout/manager/store.js +69 -12
- package/optimize/es/components/flyout/use_flyout_menu.js +69 -0
- package/optimize/es/components/form/file_picker/file_picker.js +35 -18
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
- package/optimize/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
- package/optimize/es/components/overlay_mask/overlay_mask.js +4 -2
- package/optimize/es/components/tree_view/tree_view_item.styles.js +1 -1
- package/optimize/es/services/hooks/index.js +8 -8
- package/optimize/es/services/hooks/useIsPointerDown.js +6 -10
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +2 -0
- package/optimize/lib/components/color_picker/color_picker.js +30 -7
- package/optimize/lib/components/context_menu/context_menu_item.js +3 -2
- package/optimize/lib/components/context_menu/context_menu_item.styles.js +5 -1
- package/optimize/lib/components/datagrid/utils/scrolling.js +37 -8
- package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
- package/optimize/lib/components/flyout/_flyout_overlay.js +33 -3
- package/optimize/lib/components/flyout/const.js +11 -1
- package/optimize/lib/components/flyout/flyout.component.js +48 -56
- package/optimize/lib/components/flyout/flyout.js +10 -1
- package/optimize/lib/components/flyout/flyout.styles.js +2 -2
- package/optimize/lib/components/flyout/flyout_menu.js +7 -3
- package/optimize/lib/components/flyout/manager/actions.js +12 -5
- package/optimize/lib/components/flyout/manager/flyout_managed.js +18 -12
- package/optimize/lib/components/flyout/manager/reducer.js +250 -53
- package/optimize/lib/components/flyout/manager/store.js +70 -12
- package/optimize/lib/components/flyout/use_flyout_menu.js +74 -0
- package/optimize/lib/components/form/file_picker/file_picker.js +35 -18
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
- package/optimize/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
- package/optimize/lib/components/overlay_mask/overlay_mask.js +4 -2
- package/optimize/lib/components/tree_view/tree_view_item.styles.js +1 -1
- package/optimize/lib/services/hooks/index.js +60 -91
- package/optimize/lib/services/hooks/useIsPointerDown.js +5 -10
- package/optimize/lib/services/index.js +70 -11
- package/package.json +4 -4
- package/test-env/components/basic_table/collapsed_item_actions.js +2 -0
- package/test-env/components/button/split_button/split_button.js +13 -0
- package/test-env/components/button/split_button/split_button_actions.js +15 -0
- package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
- package/test-env/components/color_picker/color_picker.js +30 -7
- package/test-env/components/context_menu/context_menu_item.js +9 -3
- package/test-env/components/context_menu/context_menu_item.styles.js +5 -1
- package/test-env/components/datagrid/utils/scrolling.js +37 -8
- package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +17 -3
- package/test-env/components/flyout/_flyout_overlay.js +33 -3
- package/test-env/components/flyout/const.js +11 -1
- package/test-env/components/flyout/flyout.component.js +48 -56
- package/test-env/components/flyout/flyout.styles.js +2 -2
- package/test-env/components/flyout/flyout_menu.js +19 -5
- package/test-env/components/flyout/flyout_resizable.js +5 -0
- package/test-env/components/flyout/manager/actions.js +12 -5
- package/test-env/components/flyout/manager/flyout_child.js +9 -2
- package/test-env/components/flyout/manager/flyout_managed.js +19 -12
- package/test-env/components/flyout/manager/reducer.js +250 -53
- package/test-env/components/flyout/manager/store.js +70 -12
- package/test-env/components/flyout/use_flyout_menu.js +74 -0
- package/test-env/components/form/file_picker/file_picker.js +46 -18
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
- package/test-env/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
- package/test-env/components/overlay_mask/overlay_mask.js +10 -3
- package/test-env/components/tree_view/tree_view_item.styles.js +1 -1
- package/test-env/services/hooks/index.js +60 -91
- package/test-env/services/hooks/useIsPointerDown.js +5 -10
- package/test-env/services/index.js +70 -11
|
@@ -3,8 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"]
|
|
7
|
-
_excluded2 = ["titleId"];
|
|
6
|
+
var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "flyoutMenuDisplayMode", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "hasAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"];
|
|
8
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
9
|
/*
|
|
@@ -29,7 +28,7 @@ import { EuiScreenReaderOnly } from '../accessibility';
|
|
|
29
28
|
import { EuiFlyoutCloseButton } from './_flyout_close_button';
|
|
30
29
|
import { euiFlyoutStyles, composeFlyoutInlineStyles } from './flyout.styles';
|
|
31
30
|
import { usePropsWithComponentDefaults } from '../provider/component_defaults';
|
|
32
|
-
import { DEFAULT_PADDING_SIZE, DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_SIDE, DEFAULT_SIZE, DEFAULT_TYPE, isEuiFlyoutSizeNamed } from './const';
|
|
31
|
+
import { DEFAULT_MENU_DISPLAY_MODE, DEFAULT_PADDING_SIZE, DEFAULT_PUSH_MIN_BREAKPOINT, DEFAULT_SIDE, DEFAULT_SIZE, DEFAULT_TYPE, isEuiFlyoutSizeNamed } from './const';
|
|
33
32
|
import { useIsPushed } from './hooks';
|
|
34
33
|
import { EuiFlyoutMenu } from './flyout_menu';
|
|
35
34
|
import { EuiFlyoutOverlay } from './_flyout_overlay';
|
|
@@ -37,6 +36,7 @@ import { EuiFlyoutResizeButton } from './_flyout_resize_button';
|
|
|
37
36
|
import { useEuiFlyoutResizable } from './use_flyout_resizable';
|
|
38
37
|
import { useEuiFlyoutZIndex } from './use_flyout_z_index';
|
|
39
38
|
import { EuiFlyoutParentProvider } from './flyout_parent_context';
|
|
39
|
+
import { useEuiFlyoutMenu } from './use_flyout_menu';
|
|
40
40
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
41
41
|
/**
|
|
42
42
|
* Resolves the container prop (element, getter, or selector string) to an
|
|
@@ -63,31 +63,33 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
63
63
|
_usePropsWithComponen2 = _usePropsWithComponen.hideCloseButton,
|
|
64
64
|
hideCloseButton = _usePropsWithComponen2 === void 0 ? false : _usePropsWithComponen2,
|
|
65
65
|
_flyoutMenuProps = _usePropsWithComponen.flyoutMenuProps,
|
|
66
|
+
_usePropsWithComponen3 = _usePropsWithComponen.flyoutMenuDisplayMode,
|
|
67
|
+
flyoutMenuDisplayMode = _usePropsWithComponen3 === void 0 ? DEFAULT_MENU_DISPLAY_MODE : _usePropsWithComponen3,
|
|
66
68
|
closeButtonProps = _usePropsWithComponen.closeButtonProps,
|
|
67
|
-
|
|
68
|
-
closeButtonPosition =
|
|
69
|
+
_usePropsWithComponen4 = _usePropsWithComponen.closeButtonPosition,
|
|
70
|
+
closeButtonPosition = _usePropsWithComponen4 === void 0 ? 'inside' : _usePropsWithComponen4,
|
|
69
71
|
onClose = _usePropsWithComponen.onClose,
|
|
70
|
-
|
|
71
|
-
ownFocus =
|
|
72
|
-
|
|
73
|
-
side =
|
|
74
|
-
|
|
75
|
-
_size =
|
|
76
|
-
|
|
77
|
-
paddingSize =
|
|
78
|
-
|
|
79
|
-
maxWidth =
|
|
72
|
+
_usePropsWithComponen5 = _usePropsWithComponen.ownFocus,
|
|
73
|
+
ownFocus = _usePropsWithComponen5 === void 0 ? true : _usePropsWithComponen5,
|
|
74
|
+
_usePropsWithComponen6 = _usePropsWithComponen.side,
|
|
75
|
+
side = _usePropsWithComponen6 === void 0 ? DEFAULT_SIDE : _usePropsWithComponen6,
|
|
76
|
+
_usePropsWithComponen7 = _usePropsWithComponen.size,
|
|
77
|
+
_size = _usePropsWithComponen7 === void 0 ? DEFAULT_SIZE : _usePropsWithComponen7,
|
|
78
|
+
_usePropsWithComponen8 = _usePropsWithComponen.paddingSize,
|
|
79
|
+
paddingSize = _usePropsWithComponen8 === void 0 ? DEFAULT_PADDING_SIZE : _usePropsWithComponen8,
|
|
80
|
+
_usePropsWithComponen9 = _usePropsWithComponen.maxWidth,
|
|
81
|
+
maxWidth = _usePropsWithComponen9 === void 0 ? false : _usePropsWithComponen9,
|
|
80
82
|
style = _usePropsWithComponen.style,
|
|
81
|
-
|
|
82
|
-
hasChildBackground =
|
|
83
|
+
_usePropsWithComponen10 = _usePropsWithComponen.hasChildBackground,
|
|
84
|
+
hasChildBackground = _usePropsWithComponen10 === void 0 ? false : _usePropsWithComponen10,
|
|
83
85
|
maskProps = _usePropsWithComponen.maskProps,
|
|
84
|
-
|
|
85
|
-
type =
|
|
86
|
+
_usePropsWithComponen11 = _usePropsWithComponen.type,
|
|
87
|
+
type = _usePropsWithComponen11 === void 0 ? DEFAULT_TYPE : _usePropsWithComponen11,
|
|
86
88
|
outsideClickCloses = _usePropsWithComponen.outsideClickCloses,
|
|
87
|
-
|
|
88
|
-
pushMinBreakpoint =
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
_usePropsWithComponen12 = _usePropsWithComponen.pushMinBreakpoint,
|
|
90
|
+
pushMinBreakpoint = _usePropsWithComponen12 === void 0 ? DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen12,
|
|
91
|
+
_pushAnimation = _usePropsWithComponen.pushAnimation,
|
|
92
|
+
_hasAnimation = _usePropsWithComponen.hasAnimation,
|
|
91
93
|
_focusTrapProps = _usePropsWithComponen.focusTrapProps,
|
|
92
94
|
_usePropsWithComponen13 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
|
|
93
95
|
includeFixedHeadersInFocusTrap = _usePropsWithComponen13 === void 0 ? true : _usePropsWithComponen13,
|
|
@@ -103,6 +105,8 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
103
105
|
containerProp = _usePropsWithComponen.container,
|
|
104
106
|
rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
|
|
105
107
|
var container = resolveContainer(containerProp);
|
|
108
|
+
var hasAnimationDefault = type === 'overlay';
|
|
109
|
+
var hasAnimation = _hasAnimation !== null && _hasAnimation !== void 0 ? _hasAnimation : hasAnimationDefault;
|
|
106
110
|
var _useEuiThemeCSSVariab = useEuiThemeCSSVariables(),
|
|
107
111
|
setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
|
|
108
112
|
var Element = as || defaultElement;
|
|
@@ -154,6 +158,21 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
154
158
|
var layoutMode = (_managerState$layoutM = managerState === null || managerState === void 0 ? void 0 : managerState.layoutMode) !== null && _managerState$layoutM !== void 0 ? _managerState$layoutM : LAYOUT_MODE_SIDE_BY_SIDE;
|
|
155
159
|
var isActiveManagedFlyout = (currentSession === null || currentSession === void 0 ? void 0 : currentSession.mainFlyoutId) === flyoutId || (currentSession === null || currentSession === void 0 ? void 0 : currentSession.childFlyoutId) === flyoutId;
|
|
156
160
|
var currentZIndexRef = useRef((_managerState$current = managerState === null || managerState === void 0 ? void 0 : managerState.currentZIndex) !== null && _managerState$current !== void 0 ? _managerState$current : 0);
|
|
161
|
+
var _useEuiFlyoutMenu = useEuiFlyoutMenu({
|
|
162
|
+
flyoutMenuProps: _flyoutMenuProps,
|
|
163
|
+
flyoutMenuDisplayMode: flyoutMenuDisplayMode,
|
|
164
|
+
ariaLabelledBy: _ariaLabelledBy
|
|
165
|
+
}),
|
|
166
|
+
flyoutMenuId = _useEuiFlyoutMenu.flyoutMenuId,
|
|
167
|
+
flyoutMenuProps = _useEuiFlyoutMenu.flyoutMenuProps,
|
|
168
|
+
shouldRenderMenu = _useEuiFlyoutMenu.shouldRenderMenu,
|
|
169
|
+
ariaLabelledBy = _useEuiFlyoutMenu.ariaLabelledBy;
|
|
170
|
+
useEffect(function () {
|
|
171
|
+
if (process.env.NODE_ENV === 'development' && _flyoutMenuProps && 'hideTitle' in _flyoutMenuProps) {
|
|
172
|
+
console.warn('EuiFlyout: `flyoutMenuProps.hideTitle` is deprecated. Use `EuiFlyoutHeader` for visible titles instead.');
|
|
173
|
+
}
|
|
174
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
175
|
+
}, []);
|
|
157
176
|
|
|
158
177
|
// Use a ref to access the latest flyoutManager without triggering effect re-runs
|
|
159
178
|
var flyoutManagerRef = useRef(flyoutManager);
|
|
@@ -508,7 +527,7 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
508
527
|
return _objectSpread(_objectSpread(_objectSpread({}, style), composedStyles), containerPositionStyles);
|
|
509
528
|
}, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex, containerRect, side, isChildFlyout]);
|
|
510
529
|
var styles = useEuiMemoizedStyles(euiFlyoutStyles);
|
|
511
|
-
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side],
|
|
530
|
+
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], !hasAnimation && styles.noAnimation, styles[side]];
|
|
512
531
|
var classes = classnames('euiFlyout', isChildFlyout && hasChildBackground && 'euiFlyout--hasChildBackground', className);
|
|
513
532
|
var flyoutToggle = useRef(document.activeElement);
|
|
514
533
|
var _useState5 = useState([]),
|
|
@@ -602,34 +621,6 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
602
621
|
})));
|
|
603
622
|
}, [hasOverlayMask, descriptionId, focusTrapShards.length]);
|
|
604
623
|
|
|
605
|
-
/*
|
|
606
|
-
* If the flyout menu is to be rendered, ensure the flyout has aria-labelledby referencing the menu's titleId
|
|
607
|
-
*/
|
|
608
|
-
var generatedMenuId = useGeneratedHtmlId();
|
|
609
|
-
var _ref = _flyoutMenuProps || {},
|
|
610
|
-
_titleId = _ref.titleId,
|
|
611
|
-
flyoutMenuProps = _objectWithoutProperties(_ref, _excluded2);
|
|
612
|
-
var hasMenu = !!_flyoutMenuProps;
|
|
613
|
-
var flyoutMenuId = useMemo(function () {
|
|
614
|
-
if (!hasMenu) return undefined;
|
|
615
|
-
return _titleId || generatedMenuId;
|
|
616
|
-
}, [hasMenu, _titleId, generatedMenuId]);
|
|
617
|
-
|
|
618
|
-
// If the flyout level is LEVEL_MAIN, the title should be hidden by default
|
|
619
|
-
var flyoutMenuHideTitle = useMemo(function () {
|
|
620
|
-
if (!hasMenu) return undefined;
|
|
621
|
-
if ((_flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.hideTitle) !== undefined) {
|
|
622
|
-
return _flyoutMenuProps.hideTitle;
|
|
623
|
-
}
|
|
624
|
-
return (currentSession === null || currentSession === void 0 ? void 0 : currentSession.mainFlyoutId) === flyoutId;
|
|
625
|
-
}, [hasMenu, _flyoutMenuProps, currentSession, flyoutId]);
|
|
626
|
-
var ariaLabelledBy = useMemo(function () {
|
|
627
|
-
if (flyoutMenuId) {
|
|
628
|
-
return classnames(flyoutMenuId, _ariaLabelledBy);
|
|
629
|
-
}
|
|
630
|
-
return _ariaLabelledBy;
|
|
631
|
-
}, [flyoutMenuId, _ariaLabelledBy]);
|
|
632
|
-
|
|
633
624
|
/*
|
|
634
625
|
* Trap focus even when `ownFocus={false}`, otherwise closing
|
|
635
626
|
* the flyout won't return focus to the originating button.
|
|
@@ -672,8 +663,10 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
672
663
|
isPushed: isPushed,
|
|
673
664
|
maskZIndex: maskZIndex,
|
|
674
665
|
headerZindexLocation: effectiveHeaderZindexLocation,
|
|
666
|
+
containerRect: containerRect,
|
|
675
667
|
maskProps: _objectSpread(_objectSpread({}, maskProps), {}, {
|
|
676
|
-
maskRef: maskCombinedRefs
|
|
668
|
+
maskRef: maskCombinedRefs,
|
|
669
|
+
hasAnimation: hasAnimation
|
|
677
670
|
})
|
|
678
671
|
}, ___EmotionJSX(EuiWindowEvent, {
|
|
679
672
|
event: "keydown",
|
|
@@ -697,13 +690,12 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
697
690
|
"aria-labelledby": ariaLabelledBy,
|
|
698
691
|
"data-autofocus": !isPushed || undefined,
|
|
699
692
|
onAnimationEnd: onAnimationEnd
|
|
700
|
-
}), !isPushed && screenReaderDescription,
|
|
693
|
+
}), !isPushed && screenReaderDescription, shouldRenderMenu ? ___EmotionJSX(EuiFlyoutMenu, _extends({}, flyoutMenuProps, {
|
|
694
|
+
titleId: flyoutMenuId
|
|
695
|
+
})) : !hideCloseButton && ___EmotionJSX(EuiFlyoutCloseButton, _extends({}, closeButtonProps, {
|
|
701
696
|
onClose: handleClose,
|
|
702
697
|
closeButtonPosition: closeButtonPosition,
|
|
703
698
|
side: side
|
|
704
|
-
})), _flyoutMenuProps && ___EmotionJSX(EuiFlyoutMenu, _extends({}, flyoutMenuProps, {
|
|
705
|
-
hideTitle: flyoutMenuHideTitle,
|
|
706
|
-
titleId: flyoutMenuId
|
|
707
699
|
})), resizable && ___EmotionJSX(EuiFlyoutResizeButton, {
|
|
708
700
|
type: type,
|
|
709
701
|
side: side,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["as", "onClose", "onActive", "session"];
|
|
3
|
+
var _excluded = ["as", "onClose", "onActive", "session", "historyKey"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,13 +17,14 @@ import { EuiFlyoutMenuContext } from './flyout_menu_context';
|
|
|
17
17
|
import { useIsInsideParentFlyout } from './flyout_parent_context';
|
|
18
18
|
import { SESSION_INHERIT, SESSION_NEVER, SESSION_START } from './manager/const';
|
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
-
export { FLYOUT_SIDES, FLYOUT_PADDING_SIZES, FLYOUT_SIZES, FLYOUT_TYPES } from './const';
|
|
20
|
+
export { FLYOUT_SIDES, FLYOUT_PADDING_SIZES, FLYOUT_SIZES, FLYOUT_TYPES, FLYOUT_MENU_DISPLAY_MODES } from './const';
|
|
21
21
|
export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
22
22
|
var _usePropsWithComponen = usePropsWithComponentDefaults('EuiFlyout', props),
|
|
23
23
|
as = _usePropsWithComponen.as,
|
|
24
24
|
onClose = _usePropsWithComponen.onClose,
|
|
25
25
|
onActive = _usePropsWithComponen.onActive,
|
|
26
26
|
session = _usePropsWithComponen.session,
|
|
27
|
+
historyKey = _usePropsWithComponen.historyKey,
|
|
27
28
|
rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
|
|
28
29
|
var hasActiveSession = useHasActiveSession();
|
|
29
30
|
var isInsideParentFlyout = useIsInsideParentFlyout();
|
|
@@ -50,6 +51,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
50
51
|
return null;
|
|
51
52
|
}
|
|
52
53
|
return ___EmotionJSX(EuiFlyoutMain, _extends({}, rest, {
|
|
54
|
+
historyKey: historyKey,
|
|
53
55
|
onClose: onClose,
|
|
54
56
|
onActive: onActive,
|
|
55
57
|
as: "div",
|
|
@@ -60,6 +62,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
60
62
|
// session=inherit: auto-join existing session as child
|
|
61
63
|
if (hasActiveSession && effectiveSession === SESSION_INHERIT) {
|
|
62
64
|
return ___EmotionJSX(EuiFlyoutChild, _extends({}, rest, {
|
|
65
|
+
historyKey: historyKey,
|
|
63
66
|
onClose: onClose,
|
|
64
67
|
onActive: onActive,
|
|
65
68
|
as: "div",
|
|
@@ -69,9 +69,9 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
|
69
69
|
push: {
|
|
70
70
|
push: /*#__PURE__*/css("clip-path:none;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
|
|
71
71
|
right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thick), ";;label:right;"),
|
|
72
|
-
left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;")
|
|
73
|
-
noAnimation: _ref
|
|
72
|
+
left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;")
|
|
74
73
|
},
|
|
74
|
+
noAnimation: _ref,
|
|
75
75
|
// Padding
|
|
76
76
|
paddingSizes: {
|
|
77
77
|
none: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
-
var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions"];
|
|
4
|
+
var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType"];
|
|
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
|
|
@@ -75,6 +75,7 @@ var HistoryPopover = function HistoryPopover(_ref) {
|
|
|
75
75
|
return ___EmotionJSX(EuiListGroupItem, {
|
|
76
76
|
key: "history-item-".concat(index),
|
|
77
77
|
label: item.title,
|
|
78
|
+
iconType: item.iconType,
|
|
78
79
|
size: "s",
|
|
79
80
|
onClick: function onClick() {
|
|
80
81
|
item.onClick();
|
|
@@ -98,13 +99,15 @@ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
|
|
|
98
99
|
var className = _ref2.className,
|
|
99
100
|
title = _ref2.title,
|
|
100
101
|
titleId = _ref2.titleId,
|
|
101
|
-
hideTitle = _ref2.hideTitle,
|
|
102
|
+
_ref2$hideTitle = _ref2.hideTitle,
|
|
103
|
+
hideTitle = _ref2$hideTitle === void 0 ? true : _ref2$hideTitle,
|
|
102
104
|
hideCloseButton = _ref2.hideCloseButton,
|
|
103
105
|
_ref2$historyItems = _ref2.historyItems,
|
|
104
106
|
historyItems = _ref2$historyItems === void 0 ? [] : _ref2$historyItems,
|
|
105
107
|
showBackButton = _ref2.showBackButton,
|
|
106
108
|
backButtonProps = _ref2.backButtonProps,
|
|
107
109
|
customActions = _ref2.customActions,
|
|
110
|
+
_iconType = _ref2.iconType,
|
|
108
111
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
109
112
|
var _useContext = useContext(EuiFlyoutMenuContext),
|
|
110
113
|
onClose = _useContext.onClose;
|
|
@@ -129,7 +132,8 @@ export var EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
|
|
|
129
132
|
});
|
|
130
133
|
return ___EmotionJSX("div", _extends({
|
|
131
134
|
className: classes,
|
|
132
|
-
css: styles.euiFlyoutMenu__container
|
|
135
|
+
css: styles.euiFlyoutMenu__container,
|
|
136
|
+
"data-test-subj": "euiFlyoutMenu"
|
|
133
137
|
}, rest), ___EmotionJSX(EuiFlexGroup, {
|
|
134
138
|
alignItems: "center",
|
|
135
139
|
justifyContent: "spaceBetween",
|
|
@@ -54,7 +54,7 @@ export var ACTION_CLOSE_UNMANAGED_FLYOUT = "".concat(PREFIX, "/closeUnmanagedFly
|
|
|
54
54
|
|
|
55
55
|
/** Go back one session (remove current session from stack). */
|
|
56
56
|
|
|
57
|
-
/** Navigate to a specific flyout (remove all sessions after it). */
|
|
57
|
+
/** Navigate to a specific flyout (remove all sessions after it, or pop to child in history). */
|
|
58
58
|
|
|
59
59
|
/** Set push padding offset for a specific side. */
|
|
60
60
|
|
|
@@ -69,17 +69,23 @@ export var ACTION_CLOSE_UNMANAGED_FLYOUT = "".concat(PREFIX, "/closeUnmanagedFly
|
|
|
69
69
|
* - `title` is used for the flyout menu.
|
|
70
70
|
* - `level` determines whether the flyout is `main` or `child`.
|
|
71
71
|
* - Optional `size` is the named EUI size (e.g. `s`, `m`, `l`).
|
|
72
|
+
* - Optional `historyKey` (Symbol) scopes history; only flyouts with the same reference share Back/history. Omit for a unique group per session.
|
|
73
|
+
* - Optional `iconType` is shown next to the session title in the history menu.
|
|
72
74
|
*/
|
|
73
75
|
export var addFlyout = function addFlyout(flyoutId, title) {
|
|
74
76
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : LEVEL_MAIN;
|
|
75
77
|
var size = arguments.length > 3 ? arguments[3] : undefined;
|
|
76
|
-
var
|
|
78
|
+
var historyKey = arguments.length > 4 ? arguments[4] : undefined;
|
|
79
|
+
var iconType = arguments.length > 5 ? arguments[5] : undefined;
|
|
80
|
+
var minWidth = arguments.length > 6 ? arguments[6] : undefined;
|
|
77
81
|
return {
|
|
78
82
|
type: ACTION_ADD,
|
|
79
83
|
flyoutId: flyoutId,
|
|
80
84
|
title: title,
|
|
81
85
|
level: level,
|
|
82
86
|
size: size,
|
|
87
|
+
historyKey: historyKey,
|
|
88
|
+
iconType: iconType,
|
|
83
89
|
minWidth: minWidth
|
|
84
90
|
};
|
|
85
91
|
};
|
|
@@ -140,11 +146,12 @@ export var goBack = function goBack() {
|
|
|
140
146
|
};
|
|
141
147
|
};
|
|
142
148
|
|
|
143
|
-
/** Navigate to a specific flyout (remove all sessions after it). */
|
|
144
|
-
export var goToFlyout = function goToFlyout(flyoutId) {
|
|
149
|
+
/** Navigate to a specific flyout (remove all sessions after it, or pop to child in history when level === 'child'). */
|
|
150
|
+
export var goToFlyout = function goToFlyout(flyoutId, level) {
|
|
145
151
|
return {
|
|
146
152
|
type: ACTION_GO_TO_FLYOUT,
|
|
147
|
-
flyoutId: flyoutId
|
|
153
|
+
flyoutId: flyoutId,
|
|
154
|
+
level: level
|
|
148
155
|
};
|
|
149
156
|
};
|
|
150
157
|
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "css", "flyoutMenuProps"];
|
|
5
|
+
var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "historyKey", "css", "flyoutMenuProps"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/*
|
|
@@ -26,6 +26,7 @@ import { EuiFlyoutIsManagedProvider } from './context';
|
|
|
26
26
|
import { euiManagedFlyoutStyles } from './flyout_managed.styles';
|
|
27
27
|
import { useFlyoutManager as _useFlyoutManager, useFlyoutId } from './hooks';
|
|
28
28
|
import { useIsFlyoutRegistered } from './selectors';
|
|
29
|
+
import { getFlyoutManagerStore } from './store';
|
|
29
30
|
import { createValidationErrorMessage, isNamedSize, validateManagedFlyoutSize, validateSizeCombination } from './validation';
|
|
30
31
|
|
|
31
32
|
/**
|
|
@@ -57,6 +58,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
57
58
|
level = _ref.level,
|
|
58
59
|
sizeProp = _ref.size,
|
|
59
60
|
minWidth = _ref.minWidth,
|
|
61
|
+
historyKey = _ref.historyKey,
|
|
60
62
|
customCss = _ref.css,
|
|
61
63
|
_flyoutMenuProps = _ref.flyoutMenuProps,
|
|
62
64
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -155,18 +157,23 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
155
157
|
// Register with flyout manager context when open, remove when closed
|
|
156
158
|
// Using useLayoutEffect to run synchronously before DOM updates
|
|
157
159
|
useLayoutEffect(function () {
|
|
158
|
-
addFlyout(flyoutId, title, level, size, typeof minWidth === 'number' ? minWidth : undefined);
|
|
160
|
+
addFlyout(flyoutId, title, level, size, level === LEVEL_MAIN ? historyKey : undefined, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
|
|
159
161
|
return function () {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
var currentStoreState = getFlyoutManagerStore().getState();
|
|
163
|
+
var stillInStore = currentStoreState.flyouts.some(function (f) {
|
|
164
|
+
return f.flyoutId === flyoutId;
|
|
165
|
+
});
|
|
166
|
+
if (stillInStore) {
|
|
167
|
+
// Normal cleanup (deps changed or explicit close via isOpen=false)
|
|
163
168
|
level === LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
|
|
169
|
+
} else if (wasRegisteredRef.current) {
|
|
170
|
+
var _onCloseCallbackRef$c;
|
|
171
|
+
// Cascade close: was registered but removed externally (e.g. main closed)
|
|
172
|
+
(_onCloseCallbackRef$c = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c === void 0 || _onCloseCallbackRef$c.call(onCloseCallbackRef, new MouseEvent('navigation'));
|
|
164
173
|
}
|
|
165
|
-
|
|
166
|
-
// Reset navigation tracking when explicitly closed via isOpen=false
|
|
167
174
|
wasRegisteredRef.current = false;
|
|
168
175
|
};
|
|
169
|
-
}, [flyoutId, title, level, size, minWidth, addFlyout, closeFlyout, closeAllFlyouts]);
|
|
176
|
+
}, [flyoutId, title, level, size, minWidth, historyKey, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, addFlyout, closeFlyout, closeAllFlyouts]);
|
|
170
177
|
|
|
171
178
|
// Detect when flyout has been removed from manager state (e.g., via Back button)
|
|
172
179
|
// and trigger onClose callback to notify the parent component
|
|
@@ -178,8 +185,8 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
178
185
|
// If flyout was previously registered, is marked as open, but no longer exists in manager state,
|
|
179
186
|
// it was removed via navigation (Back button) - trigger close callback
|
|
180
187
|
if (wasRegisteredRef.current && !flyoutExistsInManager) {
|
|
181
|
-
var _onCloseCallbackRef$
|
|
182
|
-
(_onCloseCallbackRef$
|
|
188
|
+
var _onCloseCallbackRef$c2;
|
|
189
|
+
(_onCloseCallbackRef$c2 = onCloseCallbackRef.current) === null || _onCloseCallbackRef$c2 === void 0 || _onCloseCallbackRef$c2.call(onCloseCallbackRef, new MouseEvent('navigation'));
|
|
183
190
|
wasRegisteredRef.current = false; // Reset to avoid repeated calls
|
|
184
191
|
}
|
|
185
192
|
}, [flyoutExistsInManager, flyoutId]);
|
|
@@ -211,8 +218,7 @@ export var EuiManagedFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
211
218
|
flushSync(function () {
|
|
212
219
|
level === LEVEL_MAIN ? closeAllFlyouts() : closeFlyout(flyoutId);
|
|
213
220
|
});
|
|
214
|
-
|
|
215
|
-
// trigger parent callback, unmounts the component
|
|
221
|
+
wasRegisteredRef.current = false; // Prevent cleanup from double-firing onClose
|
|
216
222
|
if (onCloseCallbackRef.current) {
|
|
217
223
|
var event = e || new MouseEvent('click');
|
|
218
224
|
onCloseCallbackRef.current(event);
|