@elastic/eui 112.0.0-snapshot.1769177525113 → 112.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/es/components/flyout/flyout.component.js +31 -26
- package/eui.d.ts +22 -22
- package/i18ntokens.json +448 -448
- package/lib/components/flyout/flyout.component.js +38 -33
- package/optimize/es/components/flyout/flyout.component.js +31 -26
- package/optimize/lib/components/flyout/flyout.component.js +38 -33
- package/package.json +4 -5
- package/test-env/components/flyout/flyout.component.js +38 -33
|
@@ -33,6 +33,7 @@ import React, { useEffect, useLayoutEffect, useRef, useMemo, useCallback, useSta
|
|
|
33
33
|
import classnames from 'classnames';
|
|
34
34
|
import { keys, EuiWindowEvent, useCombinedRefs, useEuiMemoizedStyles, useGeneratedHtmlId, useEuiThemeCSSVariables, focusTrapPubSub } from '../../services';
|
|
35
35
|
import { useCurrentSession, useIsInManagedFlyout, useFlyoutLayoutMode, useFlyoutId, useFlyoutWidth, useIsFlyoutActive, useFlyoutManager, useHasPushPadding } from './manager';
|
|
36
|
+
import { LAYOUT_MODE_STACKED } from './manager/const';
|
|
36
37
|
import { EuiFocusTrap } from '../focus_trap';
|
|
37
38
|
import { EuiI18n } from '../i18n';
|
|
38
39
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
@@ -158,6 +159,31 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
158
159
|
var _useResizeObserver = useResizeObserver(isPushed ? resizeRef : null, 'width'),
|
|
159
160
|
width = _useResizeObserver.width;
|
|
160
161
|
|
|
162
|
+
// Memoize flyout identification and relationships to prevent race conditions
|
|
163
|
+
var flyoutIdentity = useMemo(function () {
|
|
164
|
+
if (!flyoutId || !currentSession) {
|
|
165
|
+
return {
|
|
166
|
+
isMainFlyout: false,
|
|
167
|
+
siblingFlyoutId: null,
|
|
168
|
+
hasValidSession: false,
|
|
169
|
+
sessionForWidth: null
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
var siblingFlyoutId = currentSession.mainFlyoutId === flyoutId ? currentSession.childFlyoutId : currentSession.mainFlyoutId;
|
|
173
|
+
return {
|
|
174
|
+
isMainFlyout: currentSession.mainFlyoutId === flyoutId,
|
|
175
|
+
siblingFlyoutId: siblingFlyoutId,
|
|
176
|
+
hasValidSession: true,
|
|
177
|
+
sessionForWidth: currentSession
|
|
178
|
+
};
|
|
179
|
+
}, [flyoutId, currentSession]);
|
|
180
|
+
|
|
181
|
+
// Destructure for easier use
|
|
182
|
+
var siblingFlyoutId = flyoutIdentity.siblingFlyoutId,
|
|
183
|
+
isMainFlyout = flyoutIdentity.isMainFlyout;
|
|
184
|
+
var _siblingFlyoutWidth = useFlyoutWidth(siblingFlyoutId);
|
|
185
|
+
var siblingFlyoutWidth = layoutMode === LAYOUT_MODE_STACKED ? 0 : _siblingFlyoutWidth;
|
|
186
|
+
|
|
161
187
|
/**
|
|
162
188
|
* Effect for adding push padding to body. Using useLayoutEffect to ensure
|
|
163
189
|
* padding changes happen synchronously before child components render -
|
|
@@ -172,12 +198,13 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
172
198
|
var paddingSide = side === 'left' ? 'paddingInlineStart' : 'paddingInlineEnd';
|
|
173
199
|
var cssVarName = "--euiPushFlyoutOffset".concat(side === 'left' ? 'InlineStart' : 'InlineEnd');
|
|
174
200
|
var managerSide = side === 'left' ? 'left' : 'right';
|
|
201
|
+
var paddingWidth = layoutMode === LAYOUT_MODE_STACKED && isMainFlyout && _siblingFlyoutWidth ? _siblingFlyoutWidth : width;
|
|
175
202
|
if (shouldApplyPadding) {
|
|
176
|
-
document.body.style[paddingSide] = "".concat(
|
|
177
|
-
setGlobalCSSVariables(_defineProperty({}, cssVarName, "".concat(
|
|
203
|
+
document.body.style[paddingSide] = "".concat(paddingWidth, "px");
|
|
204
|
+
setGlobalCSSVariables(_defineProperty({}, cssVarName, "".concat(paddingWidth, "px")));
|
|
178
205
|
// Update manager state if in managed context
|
|
179
206
|
if (isInManagedContext && flyoutManagerRef.current) {
|
|
180
|
-
flyoutManagerRef.current.setPushPadding(managerSide,
|
|
207
|
+
flyoutManagerRef.current.setPushPadding(managerSide, paddingWidth);
|
|
181
208
|
}
|
|
182
209
|
} else {
|
|
183
210
|
// Explicitly remove padding when this push flyout becomes inactive
|
|
@@ -198,7 +225,7 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
198
225
|
flyoutManagerRef.current.setPushPadding(managerSide, 0);
|
|
199
226
|
}
|
|
200
227
|
};
|
|
201
|
-
}, [isPushed, isInManagedContext, isActiveManagedFlyout, setGlobalCSSVariables, side, width]);
|
|
228
|
+
}, [isPushed, isInManagedContext, isActiveManagedFlyout, setGlobalCSSVariables, side, width, layoutMode, isMainFlyout, _siblingFlyoutWidth]);
|
|
202
229
|
|
|
203
230
|
/**
|
|
204
231
|
* This class doesn't actually do anything by EUI, but is nice to add for consumers (JIC)
|
|
@@ -210,27 +237,6 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
210
237
|
document.body.classList.remove('euiBody--hasFlyout');
|
|
211
238
|
};
|
|
212
239
|
}, []);
|
|
213
|
-
|
|
214
|
-
// Memoize flyout identification and relationships to prevent race conditions
|
|
215
|
-
var flyoutIdentity = useMemo(function () {
|
|
216
|
-
if (!flyoutId || !currentSession) {
|
|
217
|
-
return {
|
|
218
|
-
isMainFlyout: false,
|
|
219
|
-
siblingFlyoutId: null,
|
|
220
|
-
hasValidSession: false,
|
|
221
|
-
sessionForWidth: null
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
var siblingFlyoutId = currentSession.mainFlyoutId === flyoutId ? currentSession.childFlyoutId : currentSession.mainFlyoutId;
|
|
225
|
-
return {
|
|
226
|
-
siblingFlyoutId: siblingFlyoutId,
|
|
227
|
-
hasValidSession: true,
|
|
228
|
-
sessionForWidth: currentSession
|
|
229
|
-
};
|
|
230
|
-
}, [flyoutId, currentSession]);
|
|
231
|
-
|
|
232
|
-
// Destructure for easier use
|
|
233
|
-
var siblingFlyoutId = flyoutIdentity.siblingFlyoutId;
|
|
234
240
|
var hasChildFlyout = (currentSession === null || currentSession === void 0 ? void 0 : currentSession.childFlyoutId) != null;
|
|
235
241
|
var isChildFlyout = isInManagedContext && hasChildFlyout && (currentSession === null || currentSession === void 0 ? void 0 : currentSession.childFlyoutId) === id;
|
|
236
242
|
var shouldCloseOnEscape = useMemo(function () {
|
|
@@ -262,7 +268,6 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
262
268
|
onClose(event);
|
|
263
269
|
}
|
|
264
270
|
}, [onClose, isPushed, shouldCloseOnEscape]);
|
|
265
|
-
var siblingFlyoutWidth = useFlyoutWidth(siblingFlyoutId);
|
|
266
271
|
var managedFlyoutIndex = currentZIndexRef.current;
|
|
267
272
|
if (isInManagedContext && currentSession) {
|
|
268
273
|
managedFlyoutIndex = currentSession.zIndex;
|
package/eui.d.ts
CHANGED
|
@@ -34415,6 +34415,7 @@ declare module '@elastic/eui/src/services/container_query' {
|
|
|
34415
34415
|
declare module '@elastic/eui' {
|
|
34416
34416
|
export type EuiTokensObject = {
|
|
34417
34417
|
"euiTreeView.listNavigationInstructions": any;
|
|
34418
|
+
"euiIconTip.defaultAriaLabel": any;
|
|
34418
34419
|
"euiTourStepIndicator.isActive": any;
|
|
34419
34420
|
"euiTourStepIndicator.isComplete": any;
|
|
34420
34421
|
"euiTourStepIndicator.isIncomplete": any;
|
|
@@ -34422,7 +34423,6 @@ declare module '@elastic/eui' {
|
|
|
34422
34423
|
"euiTourFooter.endTour": any;
|
|
34423
34424
|
"euiTourFooter.skipTour": any;
|
|
34424
34425
|
"euiTourFooter.closeTour": any;
|
|
34425
|
-
"euiIconTip.defaultAriaLabel": any;
|
|
34426
34426
|
"euiToast.newNotification": any;
|
|
34427
34427
|
"euiToast.notification": any;
|
|
34428
34428
|
"euiToast.dismissToast": any;
|
|
@@ -34449,26 +34449,26 @@ declare module '@elastic/eui' {
|
|
|
34449
34449
|
"euiSkeletonLoading.loadedAriaText": any;
|
|
34450
34450
|
"euiSkeletonLoading.loadingAriaText": any;
|
|
34451
34451
|
"euiSideNav.mobileToggleAriaLabel": any;
|
|
34452
|
+
"euiSearchBox.placeholder": any;
|
|
34453
|
+
"euiSearchBox.incrementalAriaLabel": any;
|
|
34454
|
+
"euiSearchBox.ariaLabel": any;
|
|
34452
34455
|
"euiSelectable.loadingOptions": any;
|
|
34453
34456
|
"euiSelectable.noMatchingOptions": any;
|
|
34454
34457
|
"euiSelectable.noAvailableOptions": any;
|
|
34455
34458
|
"euiSelectable.screenReaderInstructions": any;
|
|
34456
34459
|
"euiSelectable.placeholderName": any;
|
|
34457
34460
|
"euiSelectable.searchResults": any;
|
|
34458
|
-
"euiSearchBox.placeholder": any;
|
|
34459
|
-
"euiSearchBox.incrementalAriaLabel": any;
|
|
34460
|
-
"euiSearchBox.ariaLabel": any;
|
|
34461
34461
|
"euiResizablePanel.toggleButtonAriaLabel": any;
|
|
34462
34462
|
"euiResizableButton.horizontalResizerAriaLabel": any;
|
|
34463
34463
|
"euiResizableButton.verticalResizerAriaLabel": any;
|
|
34464
34464
|
"euiProgress.valueText": any;
|
|
34465
34465
|
"euiPopover.screenReaderAnnouncement": any;
|
|
34466
|
+
"euiPaginationButton.longPageString": any;
|
|
34467
|
+
"euiPaginationButton.shortPageString": any;
|
|
34466
34468
|
"euiPaginationButtonArrow.firstPage": any;
|
|
34467
34469
|
"euiPaginationButtonArrow.previousPage": any;
|
|
34468
34470
|
"euiPaginationButtonArrow.nextPage": any;
|
|
34469
34471
|
"euiPaginationButtonArrow.lastPage": any;
|
|
34470
|
-
"euiPaginationButton.longPageString": any;
|
|
34471
|
-
"euiPaginationButton.shortPageString": any;
|
|
34472
34472
|
"euiPagination.pageOfTotalCompressed": any;
|
|
34473
34473
|
"euiPagination.firstRangeAriaLabel": any;
|
|
34474
34474
|
"euiPagination.lastRangeAriaLabel": any;
|
|
@@ -34479,6 +34479,8 @@ declare module '@elastic/eui' {
|
|
|
34479
34479
|
"euiPagination.fromEndLabel": any;
|
|
34480
34480
|
"euiModal.screenReaderModalDialog": any;
|
|
34481
34481
|
"euiModal.closeModal": any;
|
|
34482
|
+
"euiMark.highlightStart": any;
|
|
34483
|
+
"euiMark.highlightEnd": any;
|
|
34482
34484
|
"euiMarkdownEditorToolbar.editor": any;
|
|
34483
34485
|
"euiMarkdownEditorToolbar.previewMarkdown": any;
|
|
34484
34486
|
"euiMarkdownEditorHelpButton.mdSyntaxLink": any;
|
|
@@ -34494,8 +34496,6 @@ declare module '@elastic/eui' {
|
|
|
34494
34496
|
"euiMarkdownEditorFooter.supportedFileTypes": any;
|
|
34495
34497
|
"euiMarkdownEditorFooter.showSyntaxErrors": any;
|
|
34496
34498
|
"euiMarkdownEditorFooter.errorsTitle": any;
|
|
34497
|
-
"euiMark.highlightStart": any;
|
|
34498
|
-
"euiMark.highlightEnd": any;
|
|
34499
34499
|
"euiLoadingStrings.ariaLabel": any;
|
|
34500
34500
|
"euiExternalLinkIcon.newTarget.screenReaderOnlyText": any;
|
|
34501
34501
|
"euiExternalLinkIcon.externalTarget.screenReaderOnlyText": any;
|
|
@@ -34506,19 +34506,20 @@ declare module '@elastic/eui' {
|
|
|
34506
34506
|
"euiImageButton.openFullScreen": any;
|
|
34507
34507
|
"euiImageButton.closeFullScreen": any;
|
|
34508
34508
|
"euiForm.addressFormErrors": any;
|
|
34509
|
+
"euiFilterButton.filterBadgeActiveAriaLabel": any;
|
|
34510
|
+
"euiFilterButton.filterBadgeAvailableAriaLabel": any;
|
|
34509
34511
|
"euiFlyoutMenu.back": any;
|
|
34510
34512
|
"euiFlyoutMenu.history": any;
|
|
34511
34513
|
"euiFlyout.screenReaderModalDialog": any;
|
|
34512
34514
|
"euiFlyout.screenReaderNonModalDialog": any;
|
|
34513
34515
|
"euiFlyout.screenReaderFocusTrapShards": any;
|
|
34514
34516
|
"euiFlyoutCloseButton.ariaLabel": any;
|
|
34515
|
-
"euiFilterButton.filterBadgeActiveAriaLabel": any;
|
|
34516
|
-
"euiFilterButton.filterBadgeAvailableAriaLabel": any;
|
|
34517
34517
|
"euiErrorBoundary.error": any;
|
|
34518
34518
|
"euiDataGrid.ariaLabel": any;
|
|
34519
34519
|
"euiDataGrid.ariaLabelledBy": any;
|
|
34520
34520
|
"euiDataGrid.screenReaderNotice": any;
|
|
34521
34521
|
"euiComboBox.listboxAriaLabel": any;
|
|
34522
|
+
"euiCollapsibleNavBeta.ariaLabel": any;
|
|
34522
34523
|
"euiSaturation.ariaLabel": any;
|
|
34523
34524
|
"euiSaturation.roleDescription": any;
|
|
34524
34525
|
"euiSaturation.screenReaderInstructions": any;
|
|
@@ -34534,14 +34535,13 @@ declare module '@elastic/eui' {
|
|
|
34534
34535
|
"euiColorPicker.alphaLabel": any;
|
|
34535
34536
|
"euiColorPicker.openLabel": any;
|
|
34536
34537
|
"euiColorPicker.closeLabel": any;
|
|
34537
|
-
"
|
|
34538
|
+
"euiCallOut.dismissAriaLabel": any;
|
|
34538
34539
|
"euiCodeBlockFullScreen.fullscreenCollapse": any;
|
|
34539
34540
|
"euiCodeBlockFullScreen.fullscreenExpand": any;
|
|
34540
34541
|
"euiCodeBlockFullScreen.ariaLabel": any;
|
|
34541
34542
|
"euiCodeBlockCopy.copy": any;
|
|
34542
34543
|
"euiCodeBlockAnnotations.ariaLabel": any;
|
|
34543
34544
|
"euiCodeBlock.label": any;
|
|
34544
|
-
"euiCallOut.dismissAriaLabel": any;
|
|
34545
34545
|
"euiBreadcrumbs.nav.ariaLabel": any;
|
|
34546
34546
|
"euiBreadcrumb.collapsedBadge.ariaLabel": any;
|
|
34547
34547
|
"euiBreadcrumb.popoverAriaLabel": any;
|
|
@@ -34565,6 +34565,7 @@ declare module '@elastic/eui' {
|
|
|
34565
34565
|
"euiTablePagination.rowsPerPageOptionShowAllRows": any;
|
|
34566
34566
|
"euiTablePagination.rowsPerPageOption": any;
|
|
34567
34567
|
"euiTableSortMobile.sorting": any;
|
|
34568
|
+
"euiFieldValueSelectionFilter.buttonLabelHint": any;
|
|
34568
34569
|
"euiSelectableTemplateSitewide.searchPlaceholder": any;
|
|
34569
34570
|
"euiSelectableTemplateSitewide.loadingResults": any;
|
|
34570
34571
|
"euiSelectableTemplateSitewide.noResults": any;
|
|
@@ -34578,7 +34579,6 @@ declare module '@elastic/eui' {
|
|
|
34578
34579
|
"euiSelectableListItem.mixedOptionInstructions": any;
|
|
34579
34580
|
"euiSelectableListItem.mixedOptionUncheckInstructions": any;
|
|
34580
34581
|
"euiSelectableListItem.mixedOptionExcludeInstructions": any;
|
|
34581
|
-
"euiFieldValueSelectionFilter.buttonLabelHint": any;
|
|
34582
34582
|
"euiPinnableListGroup.pinExtraActionLabel": any;
|
|
34583
34583
|
"euiPinnableListGroup.pinnedExtraActionLabel": any;
|
|
34584
34584
|
"euiHeaderLinks.appNavigation": any;
|
|
@@ -34597,6 +34597,15 @@ declare module '@elastic/eui' {
|
|
|
34597
34597
|
"euiFieldPassword.showPassword": any;
|
|
34598
34598
|
"euiFieldPassword.maskPassword": any;
|
|
34599
34599
|
"euiFlyoutManaged.defaultTitle": any;
|
|
34600
|
+
"euiRefreshInterval.fullDescriptionOff": any;
|
|
34601
|
+
"euiRefreshInterval.fullDescriptionOn": any;
|
|
34602
|
+
"euiRefreshInterval.toggleLabel": any;
|
|
34603
|
+
"euiRefreshInterval.toggleAriaLabel": any;
|
|
34604
|
+
"euiRefreshInterval.valueAriaLabel": any;
|
|
34605
|
+
"euiRefreshInterval.unitsAriaLabel": any;
|
|
34606
|
+
"euiAutoRefresh.autoRefreshLabel": any;
|
|
34607
|
+
"euiAutoRefresh.buttonLabelOff": any;
|
|
34608
|
+
"euiAutoRefresh.buttonLabelOn": any;
|
|
34600
34609
|
"euiTimeWindowButtons.previousDescription": any;
|
|
34601
34610
|
"euiTimeWindowButtons.nextDescription": any;
|
|
34602
34611
|
"euiTimeWindowButtons.invalidShiftLabel": any;
|
|
@@ -34683,15 +34692,6 @@ declare module '@elastic/eui' {
|
|
|
34683
34692
|
"euiPrettyDuration.now": any;
|
|
34684
34693
|
"euiPrettyDuration.invalid": any;
|
|
34685
34694
|
"euiPrettyDuration.fallbackDuration": any;
|
|
34686
|
-
"euiRefreshInterval.fullDescriptionOff": any;
|
|
34687
|
-
"euiRefreshInterval.fullDescriptionOn": any;
|
|
34688
|
-
"euiRefreshInterval.toggleLabel": any;
|
|
34689
|
-
"euiRefreshInterval.toggleAriaLabel": any;
|
|
34690
|
-
"euiRefreshInterval.valueAriaLabel": any;
|
|
34691
|
-
"euiRefreshInterval.unitsAriaLabel": any;
|
|
34692
|
-
"euiAutoRefresh.autoRefreshLabel": any;
|
|
34693
|
-
"euiAutoRefresh.buttonLabelOff": any;
|
|
34694
|
-
"euiAutoRefresh.buttonLabelOn": any;
|
|
34695
34695
|
"euiDataGridSchema.booleanSortTextAsc": any;
|
|
34696
34696
|
"euiDataGridSchema.booleanSortTextDesc": any;
|
|
34697
34697
|
"euiDataGridSchema.currencySortTextAsc": any;
|