@react-aria/overlays 3.17.0 → 3.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +49 -44
- package/dist/main.js +48 -43
- package/dist/main.js.map +1 -1
- package/dist/module.js +49 -44
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/Overlay.tsx +13 -12
- package/src/calculatePosition.ts +17 -9
package/dist/import.mjs
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,15 +106,20 @@ function $edcf132a9284368a$var$getScroll(node) {
|
|
|
106
106
|
height: node.scrollHeight
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function $edcf132a9284368a$var$getDelta(axis, offset, size,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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) {
|
|
117
|
+
let containerScroll = containerDimensions.scroll[axis];
|
|
118
|
+
let boundaryHeight = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
114
119
|
let startEdgeOffset = offset - padding - containerScroll;
|
|
115
120
|
let endEdgeOffset = offset + padding - containerScroll + size;
|
|
116
121
|
if (startEdgeOffset < 0) return -startEdgeOffset;
|
|
117
|
-
else if (endEdgeOffset >
|
|
122
|
+
else if (endEdgeOffset > boundaryHeight) return Math.max(boundaryHeight - endEdgeOffset, -startEdgeOffset);
|
|
118
123
|
else return 0;
|
|
119
124
|
}
|
|
120
125
|
function $edcf132a9284368a$var$getMargins(node) {
|
|
@@ -145,7 +150,7 @@ function $edcf132a9284368a$var$parsePlacement(input) {
|
|
|
145
150
|
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
146
151
|
}
|
|
147
152
|
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
148
|
-
let { placement: placement
|
|
153
|
+
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
149
154
|
let position = {};
|
|
150
155
|
// button position
|
|
151
156
|
position[crossAxis] = childOffset[crossAxis];
|
|
@@ -186,13 +191,13 @@ function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, contai
|
|
|
186
191
|
));
|
|
187
192
|
}
|
|
188
193
|
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
189
|
-
let { placement: placement
|
|
194
|
+
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
190
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);
|
|
191
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);
|
|
192
197
|
}
|
|
193
|
-
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) {
|
|
194
199
|
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
195
|
-
let { size: size
|
|
200
|
+
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
196
201
|
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
197
202
|
let normalizedOffset = offset;
|
|
198
203
|
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
@@ -208,13 +213,13 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
208
213
|
normalizedOffset = offset;
|
|
209
214
|
}
|
|
210
215
|
}
|
|
211
|
-
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);
|
|
212
217
|
position[crossAxis] += delta;
|
|
213
218
|
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
|
|
214
219
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
215
220
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
216
221
|
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
217
|
-
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
222
|
+
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
|
|
218
223
|
position[crossAxis] += delta;
|
|
219
224
|
let arrowPosition = {};
|
|
220
225
|
// All values are transformed so that 0 is at the top/left of the overlay depending on the orientation
|
|
@@ -238,14 +243,14 @@ function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
238
243
|
};
|
|
239
244
|
}
|
|
240
245
|
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
241
|
-
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;
|
|
242
247
|
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
243
248
|
let isViewportContainer = container === document.documentElement;
|
|
244
249
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
245
250
|
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
246
251
|
let childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
|
|
247
252
|
if (!isViewportContainer) {
|
|
248
|
-
let { marginTop: marginTop
|
|
253
|
+
let { marginTop: marginTop, marginLeft: marginLeft } = window.getComputedStyle(targetNode);
|
|
249
254
|
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
250
255
|
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
251
256
|
}
|
|
@@ -255,12 +260,13 @@ function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
|
255
260
|
overlaySize.height += margins.top + margins.bottom;
|
|
256
261
|
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
257
262
|
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
263
|
+
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
|
|
258
264
|
let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
|
|
259
|
-
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);
|
|
260
266
|
}
|
|
261
267
|
function $edcf132a9284368a$var$getOffset(node) {
|
|
262
|
-
let { top: top
|
|
263
|
-
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;
|
|
264
270
|
return {
|
|
265
271
|
top: top + scrollTop - clientTop,
|
|
266
272
|
left: left + scrollLeft - clientLeft,
|
|
@@ -272,7 +278,7 @@ function $edcf132a9284368a$var$getPosition(node, parent) {
|
|
|
272
278
|
let style = window.getComputedStyle(node);
|
|
273
279
|
let offset;
|
|
274
280
|
if (style.position === "fixed") {
|
|
275
|
-
let { top: top
|
|
281
|
+
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
276
282
|
offset = {
|
|
277
283
|
top: top,
|
|
278
284
|
left: left,
|
|
@@ -337,7 +343,7 @@ function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
|
337
343
|
*/
|
|
338
344
|
const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
|
|
339
345
|
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
340
|
-
let { triggerRef: triggerRef
|
|
346
|
+
let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
|
|
341
347
|
(0, $k7QOs$useEffect)(()=>{
|
|
342
348
|
if (!isOpen || onClose === null) return;
|
|
343
349
|
let onScroll = (e)=>{
|
|
@@ -365,8 +371,8 @@ function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
|
365
371
|
// @ts-ignore
|
|
366
372
|
let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
367
373
|
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
368
|
-
let { direction: direction
|
|
369
|
-
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;
|
|
370
376
|
let [position, setPosition] = (0, $k7QOs$useState)({
|
|
371
377
|
position: {},
|
|
372
378
|
arrowOffsetLeft: undefined,
|
|
@@ -512,7 +518,7 @@ function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
|
512
518
|
|
|
513
519
|
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
514
520
|
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
515
|
-
let { onClose: onClose
|
|
521
|
+
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
516
522
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
517
523
|
(0, $k7QOs$useEffect)(()=>{
|
|
518
524
|
if (isOpen) $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
|
|
@@ -559,7 +565,7 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
559
565
|
onInteractOutside: isDismissable ? onInteractOutside : null,
|
|
560
566
|
onInteractOutsideStart: onInteractOutsideStart
|
|
561
567
|
});
|
|
562
|
-
let { focusWithinProps: focusWithinProps
|
|
568
|
+
let { focusWithinProps: focusWithinProps } = (0, $k7QOs$useFocusWithin)({
|
|
563
569
|
isDisabled: !shouldCloseOnBlur,
|
|
564
570
|
onBlurWithin: (e)=>{
|
|
565
571
|
// Do not close if relatedTarget is null, which means focus is lost to the body.
|
|
@@ -605,8 +611,8 @@ function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
|
605
611
|
|
|
606
612
|
|
|
607
613
|
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
608
|
-
let { type: type
|
|
609
|
-
let { isOpen: isOpen
|
|
614
|
+
let { type: type } = props;
|
|
615
|
+
let { isOpen: isOpen } = state;
|
|
610
616
|
// Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
|
|
611
617
|
// without forcing users to pass onClose.
|
|
612
618
|
(0, $k7QOs$useEffect)(()=>{
|
|
@@ -663,7 +669,7 @@ const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
|
663
669
|
let $49c51c25361d4cd2$var$preventScrollCount = 0;
|
|
664
670
|
let $49c51c25361d4cd2$var$restore;
|
|
665
671
|
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
|
|
666
|
-
let { isDisabled: isDisabled
|
|
672
|
+
let { isDisabled: isDisabled } = options;
|
|
667
673
|
(0, $k7QOs$useLayoutEffect)(()=>{
|
|
668
674
|
if (isDisabled) return;
|
|
669
675
|
$49c51c25361d4cd2$var$preventScrollCount++;
|
|
@@ -856,7 +862,7 @@ function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
|
856
862
|
|
|
857
863
|
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
|
|
858
864
|
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
859
|
-
let { children: children
|
|
865
|
+
let { children: children } = props;
|
|
860
866
|
let parent = (0, $k7QOs$useContext)($f57aed4a881a3485$var$Context);
|
|
861
867
|
let [modalCount, setModalCount] = (0, $k7QOs$useState)(0);
|
|
862
868
|
let context = (0, $k7QOs$useMemo)(()=>({
|
|
@@ -889,7 +895,7 @@ function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
|
889
895
|
/**
|
|
890
896
|
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
891
897
|
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
|
|
892
|
-
let { modalProviderProps: modalProviderProps
|
|
898
|
+
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
|
|
893
899
|
return /*#__PURE__*/ (0, $k7QOs$react).createElement("div", {
|
|
894
900
|
"data-overlay-container": true,
|
|
895
901
|
...props,
|
|
@@ -901,7 +907,7 @@ function $f57aed4a881a3485$export$bf688221f59024e5(props) {
|
|
|
901
907
|
}
|
|
902
908
|
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
903
909
|
let isSSR = (0, $k7QOs$useIsSSR)();
|
|
904
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
910
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
905
911
|
(0, $k7QOs$react).useEffect(()=>{
|
|
906
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.");
|
|
907
913
|
}, [
|
|
@@ -1194,7 +1200,7 @@ $a2f21f5f14f60553$exports = {
|
|
|
1194
1200
|
|
|
1195
1201
|
|
|
1196
1202
|
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
1197
|
-
let { onDismiss: onDismiss
|
|
1203
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
1198
1204
|
let stringFormatter = (0, $k7QOs$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($a2f21f5f14f60553$exports))));
|
|
1199
1205
|
let labels = (0, $k7QOs$useLabels)(otherProps, stringFormatter.format("dismiss"));
|
|
1200
1206
|
let onClick = ()=>{
|
|
@@ -1338,15 +1344,15 @@ function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1338
1344
|
|
|
1339
1345
|
|
|
1340
1346
|
function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
1341
|
-
let { triggerRef: triggerRef
|
|
1342
|
-
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)({
|
|
1343
1349
|
isOpen: state.isOpen,
|
|
1344
1350
|
onClose: state.close,
|
|
1345
1351
|
shouldCloseOnBlur: true,
|
|
1346
1352
|
isDismissable: !isNonModal,
|
|
1347
1353
|
isKeyboardDismissDisabled: isKeyboardDismissDisabled
|
|
1348
1354
|
}, popoverRef);
|
|
1349
|
-
let { overlayProps: positionProps
|
|
1355
|
+
let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement } = (0, $2a41e45df1593e64$export$d39e1813b3bdd0e1)({
|
|
1350
1356
|
...otherProps,
|
|
1351
1357
|
targetRef: triggerRef,
|
|
1352
1358
|
overlayRef: popoverRef,
|
|
@@ -1403,10 +1409,11 @@ function $f2f8a6077418541e$export$542a6fd13ac93354(props, state) {
|
|
|
1403
1409
|
|
|
1404
1410
|
|
|
1405
1411
|
|
|
1412
|
+
|
|
1406
1413
|
const $337b884510726a0d$export$a2200b96afd16271 = /*#__PURE__*/ (0, $k7QOs$react).createContext(null);
|
|
1407
1414
|
function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
1408
1415
|
let isSSR = (0, $k7QOs$useIsSSR)();
|
|
1409
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
1416
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
1410
1417
|
let [contain, setContain] = (0, $k7QOs$useState)(false);
|
|
1411
1418
|
let contextValue = (0, $k7QOs$useMemo)(()=>({
|
|
1412
1419
|
contain: contain,
|
|
@@ -1416,16 +1423,14 @@ function $337b884510726a0d$export$c6fdb837b070b4ff(props) {
|
|
|
1416
1423
|
setContain
|
|
1417
1424
|
]);
|
|
1418
1425
|
if (!portalContainer) return null;
|
|
1419
|
-
let contents;
|
|
1420
|
-
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($
|
|
1421
|
-
value: contextValue
|
|
1422
|
-
}, /*#__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), {
|
|
1423
1428
|
restoreFocus: true,
|
|
1424
1429
|
contain: contain && !isExiting
|
|
1425
|
-
},
|
|
1426
|
-
|
|
1430
|
+
}, contents);
|
|
1431
|
+
contents = /*#__PURE__*/ (0, $k7QOs$react).createElement($337b884510726a0d$export$a2200b96afd16271.Provider, {
|
|
1427
1432
|
value: contextValue
|
|
1428
|
-
},
|
|
1433
|
+
}, /*#__PURE__*/ (0, $k7QOs$react).createElement((0, $k7QOs$ClearPressResponder), null, contents));
|
|
1429
1434
|
return /*#__PURE__*/ (0, $k7QOs$reactdom).createPortal(contents, portalContainer);
|
|
1430
1435
|
}
|
|
1431
1436
|
function $337b884510726a0d$export$14c98a7594375490() {
|
|
@@ -1441,7 +1446,7 @@ function $337b884510726a0d$export$14c98a7594375490() {
|
|
|
1441
1446
|
|
|
1442
1447
|
|
|
1443
1448
|
function $8ac8429251c45e4b$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
1444
|
-
let { overlayProps: overlayProps
|
|
1449
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $a11501f3d1d39e6c$export$ea8f71083e90600f)({
|
|
1445
1450
|
...props,
|
|
1446
1451
|
isOpen: state.isOpen,
|
|
1447
1452
|
onClose: state.close
|
package/dist/main.js
CHANGED
|
@@ -101,7 +101,7 @@ function $5935ba4d7da2c103$var$getContainerDimensions(containerNode) {
|
|
|
101
101
|
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
102
102
|
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
103
103
|
} else {
|
|
104
|
-
({ width: width
|
|
104
|
+
({ width: width, height: height, top: top, left: left } = $5935ba4d7da2c103$var$getOffset(containerNode));
|
|
105
105
|
scroll.top = containerNode.scrollTop;
|
|
106
106
|
scroll.left = containerNode.scrollLeft;
|
|
107
107
|
totalWidth = width;
|
|
@@ -125,15 +125,20 @@ function $5935ba4d7da2c103$var$getScroll(node) {
|
|
|
125
125
|
height: node.scrollHeight
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function $5935ba4d7da2c103$var$getDelta(axis, offset, size,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
function $5935ba4d7da2c103$var$getDelta(axis, offset, size, // The dimensions of the boundary element that the popover is
|
|
129
|
+
// positioned within (most of the time this is the <body>).
|
|
130
|
+
boundaryDimensions, // The dimensions of the containing block element that the popover is
|
|
131
|
+
// positioned relative to (e.g. parent with position: relative).
|
|
132
|
+
// Usually this is the same as the boundary element, but if the popover
|
|
133
|
+
// is portaled somewhere other than the body and has an ancestor with
|
|
134
|
+
// position: relative/absolute, it will be different.
|
|
135
|
+
containerDimensions, padding) {
|
|
136
|
+
let containerScroll = containerDimensions.scroll[axis];
|
|
137
|
+
let boundaryHeight = boundaryDimensions[$5935ba4d7da2c103$var$AXIS_SIZE[axis]];
|
|
133
138
|
let startEdgeOffset = offset - padding - containerScroll;
|
|
134
139
|
let endEdgeOffset = offset + padding - containerScroll + size;
|
|
135
140
|
if (startEdgeOffset < 0) return -startEdgeOffset;
|
|
136
|
-
else if (endEdgeOffset >
|
|
141
|
+
else if (endEdgeOffset > boundaryHeight) return Math.max(boundaryHeight - endEdgeOffset, -startEdgeOffset);
|
|
137
142
|
else return 0;
|
|
138
143
|
}
|
|
139
144
|
function $5935ba4d7da2c103$var$getMargins(node) {
|
|
@@ -164,7 +169,7 @@ function $5935ba4d7da2c103$var$parsePlacement(input) {
|
|
|
164
169
|
return $5935ba4d7da2c103$var$PARSED_PLACEMENT_CACHE[input];
|
|
165
170
|
}
|
|
166
171
|
function $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
167
|
-
let { placement: placement
|
|
172
|
+
let { placement: placement, crossPlacement: crossPlacement, axis: axis, crossAxis: crossAxis, size: size, crossSize: crossSize } = placementInfo;
|
|
168
173
|
let position = {};
|
|
169
174
|
// button position
|
|
170
175
|
position[crossAxis] = childOffset[crossAxis];
|
|
@@ -205,13 +210,13 @@ function $5935ba4d7da2c103$var$getMaxHeight(position, boundaryDimensions, contai
|
|
|
205
210
|
));
|
|
206
211
|
}
|
|
207
212
|
function $5935ba4d7da2c103$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
208
|
-
let { placement: placement
|
|
213
|
+
let { placement: placement, axis: axis, size: size } = placementInfo;
|
|
209
214
|
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$5935ba4d7da2c103$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
210
215
|
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$5935ba4d7da2c103$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
211
216
|
}
|
|
212
|
-
function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
217
|
+
function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
213
218
|
let placementInfo = $5935ba4d7da2c103$var$parsePlacement(placementInput);
|
|
214
|
-
let { size: size
|
|
219
|
+
let { size: size, crossAxis: crossAxis, crossSize: crossSize, placement: placement, crossPlacement: crossPlacement } = placementInfo;
|
|
215
220
|
let position = $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
216
221
|
let normalizedOffset = offset;
|
|
217
222
|
let space = $5935ba4d7da2c103$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
@@ -227,13 +232,13 @@ function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
227
232
|
normalizedOffset = offset;
|
|
228
233
|
}
|
|
229
234
|
}
|
|
230
|
-
let delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
235
|
+
let delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
|
|
231
236
|
position[crossAxis] += delta;
|
|
232
237
|
let maxHeight = $5935ba4d7da2c103$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
|
|
233
238
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
234
239
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
235
240
|
position = $5935ba4d7da2c103$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
236
|
-
delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
241
|
+
delta = $5935ba4d7da2c103$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
|
|
237
242
|
position[crossAxis] += delta;
|
|
238
243
|
let arrowPosition = {};
|
|
239
244
|
// All values are transformed so that 0 is at the top/left of the overlay depending on the orientation
|
|
@@ -257,14 +262,14 @@ function $5935ba4d7da2c103$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
257
262
|
};
|
|
258
263
|
}
|
|
259
264
|
function $5935ba4d7da2c103$export$b3ceb0cbf1056d98(opts) {
|
|
260
|
-
let { placement: placement
|
|
265
|
+
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;
|
|
261
266
|
let container = overlayNode instanceof HTMLElement ? $5935ba4d7da2c103$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
262
267
|
let isViewportContainer = container === document.documentElement;
|
|
263
268
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
264
269
|
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
265
270
|
let childOffset = isViewportContainer ? $5935ba4d7da2c103$var$getOffset(targetNode) : $5935ba4d7da2c103$var$getPosition(targetNode, container);
|
|
266
271
|
if (!isViewportContainer) {
|
|
267
|
-
let { marginTop: marginTop
|
|
272
|
+
let { marginTop: marginTop, marginLeft: marginLeft } = window.getComputedStyle(targetNode);
|
|
268
273
|
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
269
274
|
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
270
275
|
}
|
|
@@ -274,12 +279,13 @@ function $5935ba4d7da2c103$export$b3ceb0cbf1056d98(opts) {
|
|
|
274
279
|
overlaySize.height += margins.top + margins.bottom;
|
|
275
280
|
let scrollSize = $5935ba4d7da2c103$var$getScroll(scrollNode);
|
|
276
281
|
let boundaryDimensions = $5935ba4d7da2c103$var$getContainerDimensions(boundaryElement);
|
|
282
|
+
let containerDimensions = $5935ba4d7da2c103$var$getContainerDimensions(container);
|
|
277
283
|
let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $5935ba4d7da2c103$var$getOffset(container) : $5935ba4d7da2c103$var$getPosition(container, boundaryElement);
|
|
278
|
-
return $5935ba4d7da2c103$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
284
|
+
return $5935ba4d7da2c103$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
279
285
|
}
|
|
280
286
|
function $5935ba4d7da2c103$var$getOffset(node) {
|
|
281
|
-
let { top: top
|
|
282
|
-
let { scrollTop: scrollTop
|
|
287
|
+
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
288
|
+
let { scrollTop: scrollTop, scrollLeft: scrollLeft, clientTop: clientTop, clientLeft: clientLeft } = document.documentElement;
|
|
283
289
|
return {
|
|
284
290
|
top: top + scrollTop - clientTop,
|
|
285
291
|
left: left + scrollLeft - clientLeft,
|
|
@@ -291,7 +297,7 @@ function $5935ba4d7da2c103$var$getPosition(node, parent) {
|
|
|
291
297
|
let style = window.getComputedStyle(node);
|
|
292
298
|
let offset;
|
|
293
299
|
if (style.position === "fixed") {
|
|
294
|
-
let { top: top
|
|
300
|
+
let { top: top, left: left, width: width, height: height } = node.getBoundingClientRect();
|
|
295
301
|
offset = {
|
|
296
302
|
top: top,
|
|
297
303
|
left: left,
|
|
@@ -356,7 +362,7 @@ function $5935ba4d7da2c103$var$isContainingBlock(node) {
|
|
|
356
362
|
*/
|
|
357
363
|
const $9a8aa1b0b336ea3a$export$f6211563215e3b37 = new WeakMap();
|
|
358
364
|
function $9a8aa1b0b336ea3a$export$18fc8428861184da(opts) {
|
|
359
|
-
let { triggerRef: triggerRef
|
|
365
|
+
let { triggerRef: triggerRef, isOpen: isOpen, onClose: onClose } = opts;
|
|
360
366
|
(0, $6Zb2x$react.useEffect)(()=>{
|
|
361
367
|
if (!isOpen || onClose === null) return;
|
|
362
368
|
let onScroll = (e)=>{
|
|
@@ -384,8 +390,8 @@ function $9a8aa1b0b336ea3a$export$18fc8428861184da(opts) {
|
|
|
384
390
|
// @ts-ignore
|
|
385
391
|
let $cd94b4896dd97759$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
|
|
386
392
|
function $cd94b4896dd97759$export$d39e1813b3bdd0e1(props) {
|
|
387
|
-
let { direction: direction
|
|
388
|
-
let { arrowSize: arrowSize = 0
|
|
393
|
+
let { direction: direction } = (0, $6Zb2x$reactariai18n.useLocale)();
|
|
394
|
+
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;
|
|
389
395
|
let [position, setPosition] = (0, $6Zb2x$react.useState)({
|
|
390
396
|
position: {},
|
|
391
397
|
arrowOffsetLeft: undefined,
|
|
@@ -531,7 +537,7 @@ function $cd94b4896dd97759$var$translateRTL(position, direction) {
|
|
|
531
537
|
|
|
532
538
|
const $82711f9cb668ecdb$var$visibleOverlays = [];
|
|
533
539
|
function $82711f9cb668ecdb$export$ea8f71083e90600f(props, ref) {
|
|
534
|
-
let { onClose: onClose
|
|
540
|
+
let { onClose: onClose, shouldCloseOnBlur: shouldCloseOnBlur, isOpen: isOpen, isDismissable: isDismissable = false, isKeyboardDismissDisabled: isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
535
541
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
536
542
|
(0, $6Zb2x$react.useEffect)(()=>{
|
|
537
543
|
if (isOpen) $82711f9cb668ecdb$var$visibleOverlays.push(ref);
|
|
@@ -578,7 +584,7 @@ function $82711f9cb668ecdb$export$ea8f71083e90600f(props, ref) {
|
|
|
578
584
|
onInteractOutside: isDismissable ? onInteractOutside : null,
|
|
579
585
|
onInteractOutsideStart: onInteractOutsideStart
|
|
580
586
|
});
|
|
581
|
-
let { focusWithinProps: focusWithinProps
|
|
587
|
+
let { focusWithinProps: focusWithinProps } = (0, $6Zb2x$reactariainteractions.useFocusWithin)({
|
|
582
588
|
isDisabled: !shouldCloseOnBlur,
|
|
583
589
|
onBlurWithin: (e)=>{
|
|
584
590
|
// Do not close if relatedTarget is null, which means focus is lost to the body.
|
|
@@ -624,8 +630,8 @@ function $82711f9cb668ecdb$export$ea8f71083e90600f(props, ref) {
|
|
|
624
630
|
|
|
625
631
|
|
|
626
632
|
function $b4878eb6316f670a$export$f9d5c8beee7d008d(props, state, ref) {
|
|
627
|
-
let { type: type
|
|
628
|
-
let { isOpen: isOpen
|
|
633
|
+
let { type: type } = props;
|
|
634
|
+
let { isOpen: isOpen } = state;
|
|
629
635
|
// Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
|
|
630
636
|
// without forcing users to pass onClose.
|
|
631
637
|
(0, $6Zb2x$react.useEffect)(()=>{
|
|
@@ -682,7 +688,7 @@ const $5c2f5cd01815d369$var$nonTextInputTypes = new Set([
|
|
|
682
688
|
let $5c2f5cd01815d369$var$preventScrollCount = 0;
|
|
683
689
|
let $5c2f5cd01815d369$var$restore;
|
|
684
690
|
function $5c2f5cd01815d369$export$ee0f7cc6afcd1c18(options = {}) {
|
|
685
|
-
let { isDisabled: isDisabled
|
|
691
|
+
let { isDisabled: isDisabled } = options;
|
|
686
692
|
(0, $6Zb2x$reactariautils.useLayoutEffect)(()=>{
|
|
687
693
|
if (isDisabled) return;
|
|
688
694
|
$5c2f5cd01815d369$var$preventScrollCount++;
|
|
@@ -875,7 +881,7 @@ function $5c2f5cd01815d369$var$willOpenKeyboard(target) {
|
|
|
875
881
|
|
|
876
882
|
const $0775ea8ea6a0565e$var$Context = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createContext(null);
|
|
877
883
|
function $0775ea8ea6a0565e$export$178405afcd8c5eb(props) {
|
|
878
|
-
let { children: children
|
|
884
|
+
let { children: children } = props;
|
|
879
885
|
let parent = (0, $6Zb2x$react.useContext)($0775ea8ea6a0565e$var$Context);
|
|
880
886
|
let [modalCount, setModalCount] = (0, $6Zb2x$react.useState)(0);
|
|
881
887
|
let context = (0, $6Zb2x$react.useMemo)(()=>({
|
|
@@ -908,7 +914,7 @@ function $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0() {
|
|
|
908
914
|
/**
|
|
909
915
|
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
910
916
|
*/ function $0775ea8ea6a0565e$var$OverlayContainerDOM(props) {
|
|
911
|
-
let { modalProviderProps: modalProviderProps
|
|
917
|
+
let { modalProviderProps: modalProviderProps } = $0775ea8ea6a0565e$export$d9aaed4c3ece1bc0();
|
|
912
918
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement("div", {
|
|
913
919
|
"data-overlay-container": true,
|
|
914
920
|
...props,
|
|
@@ -920,7 +926,7 @@ function $0775ea8ea6a0565e$export$bf688221f59024e5(props) {
|
|
|
920
926
|
}
|
|
921
927
|
function $0775ea8ea6a0565e$export$b47c3594eab58386(props) {
|
|
922
928
|
let isSSR = (0, $6Zb2x$reactariassr.useIsSSR)();
|
|
923
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
929
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
924
930
|
(0, ($parcel$interopDefault($6Zb2x$react))).useEffect(()=>{
|
|
925
931
|
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.");
|
|
926
932
|
}, [
|
|
@@ -1213,7 +1219,7 @@ $90f032faf016e1fb$exports = {
|
|
|
1213
1219
|
|
|
1214
1220
|
|
|
1215
1221
|
function $f69bb3e6457495cc$export$2317d149ed6f78c4(props) {
|
|
1216
|
-
let { onDismiss: onDismiss
|
|
1222
|
+
let { onDismiss: onDismiss, ...otherProps } = props;
|
|
1217
1223
|
let stringFormatter = (0, $6Zb2x$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($90f032faf016e1fb$exports))));
|
|
1218
1224
|
let labels = (0, $6Zb2x$reactariautils.useLabels)(otherProps, stringFormatter.format("dismiss"));
|
|
1219
1225
|
let onClick = ()=>{
|
|
@@ -1357,15 +1363,15 @@ function $08ef1685902b6011$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1357
1363
|
|
|
1358
1364
|
|
|
1359
1365
|
function $6c2dfcdee3e15e20$export$542a6fd13ac93354(props, state) {
|
|
1360
|
-
let { triggerRef: triggerRef
|
|
1361
|
-
let { overlayProps: overlayProps
|
|
1366
|
+
let { triggerRef: triggerRef, popoverRef: popoverRef, isNonModal: isNonModal, isKeyboardDismissDisabled: isKeyboardDismissDisabled, ...otherProps } = props;
|
|
1367
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $82711f9cb668ecdb$export$ea8f71083e90600f)({
|
|
1362
1368
|
isOpen: state.isOpen,
|
|
1363
1369
|
onClose: state.close,
|
|
1364
1370
|
shouldCloseOnBlur: true,
|
|
1365
1371
|
isDismissable: !isNonModal,
|
|
1366
1372
|
isKeyboardDismissDisabled: isKeyboardDismissDisabled
|
|
1367
1373
|
}, popoverRef);
|
|
1368
|
-
let { overlayProps: positionProps
|
|
1374
|
+
let { overlayProps: positionProps, arrowProps: arrowProps, placement: placement } = (0, $cd94b4896dd97759$export$d39e1813b3bdd0e1)({
|
|
1369
1375
|
...otherProps,
|
|
1370
1376
|
targetRef: triggerRef,
|
|
1371
1377
|
overlayRef: popoverRef,
|
|
@@ -1422,10 +1428,11 @@ function $6c2dfcdee3e15e20$export$542a6fd13ac93354(props, state) {
|
|
|
1422
1428
|
|
|
1423
1429
|
|
|
1424
1430
|
|
|
1431
|
+
|
|
1425
1432
|
const $745edbb83ab4296f$export$a2200b96afd16271 = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createContext(null);
|
|
1426
1433
|
function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
|
|
1427
1434
|
let isSSR = (0, $6Zb2x$reactariassr.useIsSSR)();
|
|
1428
|
-
let { portalContainer: portalContainer = isSSR ? null : document.body
|
|
1435
|
+
let { portalContainer: portalContainer = isSSR ? null : document.body, isExiting: isExiting } = props;
|
|
1429
1436
|
let [contain, setContain] = (0, $6Zb2x$react.useState)(false);
|
|
1430
1437
|
let contextValue = (0, $6Zb2x$react.useMemo)(()=>({
|
|
1431
1438
|
contain: contain,
|
|
@@ -1435,16 +1442,14 @@ function $745edbb83ab4296f$export$c6fdb837b070b4ff(props) {
|
|
|
1435
1442
|
setContain
|
|
1436
1443
|
]);
|
|
1437
1444
|
if (!portalContainer) return null;
|
|
1438
|
-
let contents;
|
|
1439
|
-
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement($
|
|
1440
|
-
value: contextValue
|
|
1441
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement((0, $6Zb2x$reactariafocus.FocusScope), {
|
|
1445
|
+
let contents = props.children;
|
|
1446
|
+
if (!props.disableFocusManagement) contents = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement((0, $6Zb2x$reactariafocus.FocusScope), {
|
|
1442
1447
|
restoreFocus: true,
|
|
1443
1448
|
contain: contain && !isExiting
|
|
1444
|
-
},
|
|
1445
|
-
|
|
1449
|
+
}, contents);
|
|
1450
|
+
contents = /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement($745edbb83ab4296f$export$a2200b96afd16271.Provider, {
|
|
1446
1451
|
value: contextValue
|
|
1447
|
-
},
|
|
1452
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$react))).createElement((0, $6Zb2x$reactariainteractions.ClearPressResponder), null, contents));
|
|
1448
1453
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($6Zb2x$reactdom))).createPortal(contents, portalContainer);
|
|
1449
1454
|
}
|
|
1450
1455
|
function $745edbb83ab4296f$export$14c98a7594375490() {
|
|
@@ -1460,7 +1465,7 @@ function $745edbb83ab4296f$export$14c98a7594375490() {
|
|
|
1460
1465
|
|
|
1461
1466
|
|
|
1462
1467
|
function $11b7e0b04b421e95$export$dbc0f175b25fb0fb(props, state, ref) {
|
|
1463
|
-
let { overlayProps: overlayProps
|
|
1468
|
+
let { overlayProps: overlayProps, underlayProps: underlayProps } = (0, $82711f9cb668ecdb$export$ea8f71083e90600f)({
|
|
1464
1469
|
...props,
|
|
1465
1470
|
isOpen: state.isOpen,
|
|
1466
1471
|
onClose: state.close
|