@react-aria/overlays 3.16.0 → 3.18.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/import.mjs +55 -42
- package/dist/main.js +54 -41
- package/dist/main.js.map +1 -1
- package/dist/module.js +55 -42
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/Overlay.tsx +13 -12
- package/src/calculatePosition.ts +16 -6
- package/src/useOverlay.ts +7 -1
package/dist/module.js
CHANGED
|
@@ -2,7 +2,7 @@ import $k7QOs$react, {useState as $k7QOs$useState, useCallback as $k7QOs$useCall
|
|
|
2
2
|
import {useLayoutEffect as $k7QOs$useLayoutEffect, useResizeObserver as $k7QOs$useResizeObserver, clamp as $k7QOs$clamp, useId as $k7QOs$useId, isIOS as $k7QOs$isIOS, chain as $k7QOs$chain, getScrollParent as $k7QOs$getScrollParent, useLabels as $k7QOs$useLabels, mergeProps as $k7QOs$mergeProps} from "@react-aria/utils";
|
|
3
3
|
import {useLocale as $k7QOs$useLocale, useLocalizedStringFormatter as $k7QOs$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
4
4
|
import {isElementInChildOfActiveScope as $k7QOs$isElementInChildOfActiveScope, FocusScope as $k7QOs$FocusScope} from "@react-aria/focus";
|
|
5
|
-
import {useInteractOutside as $k7QOs$useInteractOutside, useFocusWithin as $k7QOs$useFocusWithin} from "@react-aria/interactions";
|
|
5
|
+
import {useInteractOutside as $k7QOs$useInteractOutside, useFocusWithin as $k7QOs$useFocusWithin, ClearPressResponder as $k7QOs$ClearPressResponder} from "@react-aria/interactions";
|
|
6
6
|
import $k7QOs$reactdom from "react-dom";
|
|
7
7
|
import {useIsSSR as $k7QOs$useIsSSR} from "@react-aria/ssr";
|
|
8
8
|
import {VisuallyHidden as $k7QOs$VisuallyHidden} from "@react-aria/visually-hidden";
|
|
@@ -82,7 +82,7 @@ function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
|
82
82
|
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
83
83
|
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
84
84
|
} else {
|
|
85
|
-
({ width: width
|
|
85
|
+
({ width: width, height: height, top: top, left: left } = $edcf132a9284368a$var$getOffset(containerNode));
|
|
86
86
|
scroll.top = containerNode.scrollTop;
|
|
87
87
|
scroll.left = containerNode.scrollLeft;
|
|
88
88
|
totalWidth = width;
|
|
@@ -106,13 +106,20 @@ function $edcf132a9284368a$var$getScroll(node) {
|
|
|
106
106
|
height: node.scrollHeight
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function $edcf132a9284368a$var$getDelta(axis, offset, size,
|
|
109
|
+
function $edcf132a9284368a$var$getDelta(axis, offset, size, // The dimensions of the boundary element that the popover is
|
|
110
|
+
// positioned within (most of the time this is the <body>).
|
|
111
|
+
boundaryDimensions, // The dimensions of the containing block element that the popover is
|
|
112
|
+
// positioned relative to (e.g. parent with position: relative).
|
|
113
|
+
// Usually this is the same as the boundary element, but if the popover
|
|
114
|
+
// is portaled somewhere other than the body and has an ancestor with
|
|
115
|
+
// position: relative/absolute, it will be different.
|
|
116
|
+
containerDimensions, padding) {
|
|
110
117
|
let containerScroll = containerDimensions.scroll[axis];
|
|
111
|
-
let
|
|
118
|
+
let boundaryHeight = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
112
119
|
let startEdgeOffset = offset - padding - containerScroll;
|
|
113
120
|
let endEdgeOffset = offset + padding - containerScroll + size;
|
|
114
121
|
if (startEdgeOffset < 0) return -startEdgeOffset;
|
|
115
|
-
else if (endEdgeOffset >
|
|
122
|
+
else if (endEdgeOffset > boundaryHeight) return Math.max(boundaryHeight - endEdgeOffset, -startEdgeOffset);
|
|
116
123
|
else return 0;
|
|
117
124
|
}
|
|
118
125
|
function $edcf132a9284368a$var$getMargins(node) {
|
|
@@ -143,7 +150,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
143
150
|
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
144
151
|
}
|
|
145
152
|
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
146
|
-
let { placement: placement
|
|
153
|
+
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
147
154
|
let position = {};
|
|
148
155
|
// button position
|
|
149
156
|
position[crossAxis] = childOffset[crossAxis];
|
|
@@ -184,13 +191,13 @@ function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, contai
|
|
|
184
191
|
));
|
|
185
192
|
}
|
|
186
193
|
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
187
|
-
let { placement: placement
|
|
194
|
+
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
188
195
|
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
189
196
|
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
190
197
|
}
|
|
191
|
-
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
198
|
+
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
192
199
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
193
|
-
let { size: size
|
|
200
|
+
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
194
201
|
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
195
202
|
let normalizedOffset = offset;
|
|
196
203
|
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
@@ -206,13 +213,13 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
206
213
|
normalizedOffset = offset;
|
|
207
214
|
}
|
|
208
215
|
}
|
|
209
|
-
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
216
|
+
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
|
|
210
217
|
position[crossAxis] += delta;
|
|
211
218
|
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
|
|
212
219
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
213
220
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
214
221
|
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
215
|
-
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
222
|
+
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
|
|
216
223
|
position[crossAxis] += delta;
|
|
217
224
|
let arrowPosition = {};
|
|
218
225
|
// All values are transformed so that 0 is at the top/left of the overlay depending on the orientation
|
|
@@ -236,14 +243,14 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
236
243
|
};
|
|
237
244
|
}
|
|
238
245
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
239
|
-
let { placement: placement
|
|
246
|
+
let { placement: placement, targetNode: targetNode, overlayNode: overlayNode, scrollNode: scrollNode, padding: padding, shouldFlip: shouldFlip, boundaryElement: boundaryElement, offset: offset, crossOffset: crossOffset, maxHeight: maxHeight, arrowSize: arrowSize = 0, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = opts;
|
|
240
247
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
241
248
|
let isViewportContainer = container === document.documentElement;
|
|
242
249
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
243
250
|
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
244
251
|
let childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
|
|
245
252
|
if (!isViewportContainer) {
|
|
246
|
-
let { marginTop: marginTop
|
|
253
|
+
let { marginTop: marginTop, marginLeft: marginLeft } = window.getComputedStyle(targetNode);
|
|
247
254
|
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
248
255
|
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
249
256
|
}
|
|
@@ -253,12 +260,13 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
253
260
|
overlaySize.height += margins.top + margins.bottom;
|
|
254
261
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
255
262
|
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
263
|
+
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
|
|
256
264
|
let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
|
|
257
|
-
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
265
|
+
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
258
266
|
}
|
|
259
267
|
function $edcf132a9284368a$var$getOffset(node) {
|
|
260
|
-
let { top: top
|
|
261
|
-
let { scrollTop: scrollTop
|
|
268
|
+
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
269
|
+
let { scrollTop: scrollTop, scrollLeft: scrollLeft, clientTop: clientTop, clientLeft: clientLeft } = document.documentElement;
|
|
262
270
|
return {
|
|
263
271
|
top: top + scrollTop - clientTop,
|
|
264
272
|
left: left + scrollLeft - clientLeft,
|
|
@@ -270,7 +278,7 @@ function $edcf132a9284368a$var$getPosition(node, parent) {
|
|
|
270
278
|
let style = window.getComputedStyle(node);
|
|
271
279
|
let offset;
|
|
272
280
|
if (style.position === "fixed") {
|
|
273
|
-
let { top: top
|
|
281
|
+
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
274
282
|
offset = {
|
|
275
283
|
top: top,
|
|
276
284
|
left: left,
|
|
@@ -335,7 +343,7 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
|
335
343
|
*/
|
|
336
344
|
const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
|
|
337
345
|
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
338
|
-
let { triggerRef: triggerRef
|
|
346
|
+
let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
|
|
339
347
|
(0, $k7QOs$useEffect)(()=>{
|
|
340
348
|
if (!isOpen || onClose === null) return;
|
|
341
349
|
let onScroll = (e)=>{
|
|
@@ -363,8 +371,8 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
363
371
|
// @ts-ignore
|
|
364
372
|
let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
365
373
|
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
366
|
-
let { direction: direction
|
|
367
|
-
let { arrowSize: arrowSize = 0
|
|
374
|
+
let { direction: direction } = (0, $k7QOs$useLocale)();
|
|
375
|
+
let { arrowSize: arrowSize = 0, targetRef: targetRef, overlayRef: overlayRef, scrollRef: scrollRef = overlayRef, placement: placement = "bottom", containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== "undefined" ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
368
376
|
let [position, setPosition] = (0, $k7QOs$useState)({
|
|
369
377
|
position: {},
|
|
370
378
|
arrowOffsetLeft: undefined,
|
|
@@ -510,7 +518,7 @@ function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
|
510
518
|
|
|
511
519
|
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
512
520
|
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
513
|
-
let { onClose: onClose
|
|
521
|
+
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
514
522
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
515
523
|
(0, $k7QOs$useEffect)(()=>{
|
|
516
524
|
if (isOpen) $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
|
|
@@ -557,13 +565,19 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
557
565
|
onInteractOutside: isDismissable ? onInteractOutside : null,
|
|
558
566
|
onInteractOutsideStart: onInteractOutsideStart
|
|
559
567
|
});
|
|
560
|
-
let { focusWithinProps: focusWithinProps
|
|
568
|
+
let { focusWithinProps: focusWithinProps } = (0, $k7QOs$useFocusWithin)({
|
|
561
569
|
isDisabled: !shouldCloseOnBlur,
|
|
562
570
|
onBlurWithin: (e)=>{
|
|
571
|
+
// Do not close if relatedTarget is null, which means focus is lost to the body.
|
|
572
|
+
// That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.
|
|
573
|
+
// Clicking on the body to close the overlay should already be handled by useInteractOutside.
|
|
574
|
+
// https://github.com/adobe/react-spectrum/issues/4130
|
|
575
|
+
// https://github.com/adobe/react-spectrum/issues/4922
|
|
576
|
+
//
|
|
563
577
|
// If focus is moving into a child focus scope (e.g. menu inside a dialog),
|
|
564
578
|
// do not close the outer overlay. At this point, the active scope should
|
|
565
579
|
// still be the outer overlay, since blur events run before focus.
|
|
566
|
-
if (e.relatedTarget
|
|
580
|
+
if (!e.relatedTarget || (0, $k7QOs$isElementInChildOfActiveScope)(e.relatedTarget)) return;
|
|
567
581
|
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
|
|
568
582
|
}
|
|
569
583
|
});
|
|
@@ -597,8 +611,8 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
597
611
|
|
|
598
612
|
|
|
599
613
|
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
600
|
-
let { type: type
|
|
601
|
-
let { isOpen: isOpen
|
|
614
|
+
let { type: type } = props;
|
|
615
|
+
let { isOpen: isOpen } = state;
|
|
602
616
|
// Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
|
|
603
617
|
// without forcing users to pass onClose.
|
|
604
618
|
(0, $k7QOs$useEffect)(()=>{
|
|
@@ -655,7 +669,7 @@ const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
|
655
669
|
let $49c51c25361d4cd2$var$preventScrollCount = 0;
|
|
656
670
|
let $49c51c25361d4cd2$var$restore;
|
|
657
671
|
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
|
|
658
|
-
let { isDisabled: isDisabled
|
|
672
|
+
let { isDisabled: isDisabled } = options;
|
|
659
673
|
(0, $k7QOs$useLayoutEffect)(()=>{
|
|
660
674
|
if (isDisabled) return;
|
|
661
675
|
$49c51c25361d4cd2$var$preventScrollCount++;
|
|
@@ -848,7 +862,7 @@ function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
|
848
862
|
|
|
849
863
|
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
|
|
850
864
|
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
851
|
-
let { children: children
|
|
865
|
+
let { children: children } = props;
|
|
852
866
|
let parent = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
|
|
853
867
|
let [modalCount, setModalCount] = (0, $k7QOs$useState)(0);
|
|
854
868
|
let context = (0, $k7QOs$useMemo)(()=>({
|
|
@@ -881,7 +895,7 @@ function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
|
881
895
|
/**
|
|
882
896
|
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
883
897
|
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
|
|
884
|
-
let { modalProviderProps: modalProviderProps
|
|
898
|
+
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
|
|
885
899
|
return /*#__PURE__*/ (0, $k7QOs$react).createElement("div", {
|
|
886
900
|
"data-overlay-container": true,
|
|
887
901
|
...props,
|
|
@@ -893,7 +907,7 @@ function $f57aed4a881a3485$export$bf688221f59024e5(props) {
|
|
|
893
907
|
}
|
|
894
908
|
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
895
909
|
let isSSR = (0, $k7QOs$useIsSSR)();
|
|
896
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
910
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
897
911
|
(0, $k7QOs$react).useEffect(()=>{
|
|
898
912
|
if (portalContainer === null || portalContainer === void 0 ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
899
913
|
}, [
|
|
@@ -1186,7 +1200,7 @@ $a2f21f5f14f60553$exports = {
|
|
|
1186
1200
|
|
|
1187
1201
|
|
|
1188
1202
|
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
1189
|
-
let { onDismiss: onDismiss
|
|
1203
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
1190
1204
|
let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($a2f21f5f14f60553$exports))));
|
|
1191
1205
|
let labels = (0, $k7QOs$useLabels)(otherProps, stringFormatter.format("dismiss"));
|
|
1192
1206
|
let onClick = ()=>{
|
|
@@ -1330,15 +1344,15 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1330
1344
|
|
|
1331
1345
|
|
|
1332
1346
|
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
1333
|
-
let { triggerRef: triggerRef
|
|
1334
|
-
let { overlayProps: overlayProps
|
|
1347
|
+
let { triggerRef: triggerRef, popoverRef: popoverRef, isNonModal: isNonModal, isKeyboardDismissDisabled: isKeyboardDismissDisabled, ...otherProps } = props;
|
|
1348
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
1335
1349
|
isOpen: state.isOpen,
|
|
1336
1350
|
onClose: state.close,
|
|
1337
1351
|
shouldCloseOnBlur: true,
|
|
1338
1352
|
isDismissable: !isNonModal,
|
|
1339
1353
|
isKeyboardDismissDisabled: isKeyboardDismissDisabled
|
|
1340
1354
|
}, popoverRef);
|
|
1341
|
-
let { overlayProps: positionProps
|
|
1355
|
+
let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement } = (0, $2a41e45df1593e64$export$d39e1813b3bdd0e1)({
|
|
1342
1356
|
...otherProps,
|
|
1343
1357
|
targetRef: triggerRef,
|
|
1344
1358
|
overlayRef: popoverRef,
|
|
@@ -1395,10 +1409,11 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
1395
1409
|
|
|
1396
1410
|
|
|
1397
1411
|
|
|
1412
|
+
|
|
1398
1413
|
const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
|
|
1399
1414
|
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
1400
1415
|
let isSSR = (0, $k7QOs$useIsSSR)();
|
|
1401
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
1416
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
1402
1417
|
let [contain, setContain] = (0, $k7QOs$useState)(false);
|
|
1403
1418
|
let contextValue = (0, $k7QOs$useMemo)(()=>({
|
|
1404
1419
|
contain: contain,
|
|
@@ -1408,16 +1423,14 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
|
1408
1423
|
setContain
|
|
1409
1424
|
]);
|
|
1410
1425
|
if (!portalContainer) return null;
|
|
1411
|
-
let contents;
|
|
1412
|
-
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($
|
|
1413
|
-
value: contextValue
|
|
1414
|
-
}, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
|
|
1426
|
+
let contents = props.children;
|
|
1427
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$FocusScope), {
|
|
1415
1428
|
restoreFocus: true,
|
|
1416
1429
|
contain: contain && !isExiting
|
|
1417
|
-
},
|
|
1418
|
-
|
|
1430
|
+
}, contents);
|
|
1431
|
+
contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
1419
1432
|
value: contextValue
|
|
1420
|
-
},
|
|
1433
|
+
}, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$ClearPressResponder), null, contents));
|
|
1421
1434
|
return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
|
|
1422
1435
|
}
|
|
1423
1436
|
function $337b884510726a0d$export$14c98a7594375490() {
|
|
@@ -1433,7 +1446,7 @@ function $337b884510726a0d$export$14c98a7594375490() {
|
|
|
1433
1446
|
|
|
1434
1447
|
|
|
1435
1448
|
function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
1436
|
-
let { overlayProps: overlayProps
|
|
1449
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
1437
1450
|
...props,
|
|
1438
1451
|
isOpen: state.isOpen,
|
|
1439
1452
|
onClose: state.close
|