@react-aria/overlays 3.7.5 → 3.8.2
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/main.js +305 -294
- package/dist/main.js.map +1 -1
- package/dist/module.js +299 -288
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/DismissButton.tsx +8 -3
- package/src/useOverlay.ts +1 -0
- package/src/usePreventScroll.ts +24 -9
package/dist/module.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import $
|
|
2
|
-
import {useLayoutEffect as $
|
|
3
|
-
import {useLocale as $
|
|
4
|
-
import $
|
|
5
|
-
import $
|
|
6
|
-
import $
|
|
7
|
-
import $
|
|
8
|
-
import $
|
|
9
|
-
import $
|
|
10
|
-
import {useInteractOutside as $
|
|
11
|
-
import $
|
|
12
|
-
import {VisuallyHidden as $
|
|
1
|
+
import $k7QOs$react, {useState as $k7QOs$useState, useCallback as $k7QOs$useCallback, useRef as $k7QOs$useRef, useEffect as $k7QOs$useEffect, useContext as $k7QOs$useContext, useMemo as $k7QOs$useMemo} from "react";
|
|
2
|
+
import {useLayoutEffect as $k7QOs$useLayoutEffect, useId as $k7QOs$useId, isIOS as $k7QOs$isIOS, chain as $k7QOs$chain, getScrollParent as $k7QOs$getScrollParent, useLabels as $k7QOs$useLabels} from "@react-aria/utils";
|
|
3
|
+
import {useLocale as $k7QOs$useLocale, useMessageFormatter as $k7QOs$useMessageFormatter} from "@react-aria/i18n";
|
|
4
|
+
import $k7QOs$domhelpersstyle from "dom-helpers/style";
|
|
5
|
+
import $k7QOs$domhelpersqueryoffset from "dom-helpers/query/offset";
|
|
6
|
+
import $k7QOs$domhelpersqueryposition from "dom-helpers/query/position";
|
|
7
|
+
import $k7QOs$domhelpersqueryscrollLeft from "dom-helpers/query/scrollLeft";
|
|
8
|
+
import $k7QOs$domhelpersqueryscrollTop from "dom-helpers/query/scrollTop";
|
|
9
|
+
import $k7QOs$domhelpersownerDocument from "dom-helpers/ownerDocument";
|
|
10
|
+
import {useInteractOutside as $k7QOs$useInteractOutside, useFocusWithin as $k7QOs$useFocusWithin} from "@react-aria/interactions";
|
|
11
|
+
import $k7QOs$reactdom from "react-dom";
|
|
12
|
+
import {VisuallyHidden as $k7QOs$VisuallyHidden} from "@react-aria/visually-hidden";
|
|
13
13
|
|
|
14
14
|
function $parcel$export(e, n, v, s) {
|
|
15
15
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -17,54 +17,54 @@ function $parcel$export(e, n, v, s) {
|
|
|
17
17
|
function $parcel$interopDefault(a) {
|
|
18
18
|
return a && a.__esModule ? a.default : a;
|
|
19
19
|
}
|
|
20
|
-
var $
|
|
20
|
+
var $2a41e45df1593e64$exports = {};
|
|
21
21
|
|
|
22
|
-
$parcel$export($
|
|
22
|
+
$parcel$export($2a41e45df1593e64$exports, "useOverlayPosition", () => $2a41e45df1593e64$export$d39e1813b3bdd0e1);
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
const $
|
|
29
|
+
const $edcf132a9284368a$var$AXIS = {
|
|
30
30
|
top: 'top',
|
|
31
31
|
bottom: 'top',
|
|
32
32
|
left: 'left',
|
|
33
33
|
right: 'left'
|
|
34
34
|
};
|
|
35
|
-
const $
|
|
35
|
+
const $edcf132a9284368a$var$FLIPPED_DIRECTION = {
|
|
36
36
|
top: 'bottom',
|
|
37
37
|
bottom: 'top',
|
|
38
38
|
left: 'right',
|
|
39
39
|
right: 'left'
|
|
40
40
|
};
|
|
41
|
-
const $
|
|
41
|
+
const $edcf132a9284368a$var$CROSS_AXIS = {
|
|
42
42
|
top: 'left',
|
|
43
43
|
left: 'top'
|
|
44
44
|
};
|
|
45
|
-
const $
|
|
45
|
+
const $edcf132a9284368a$var$AXIS_SIZE = {
|
|
46
46
|
top: 'height',
|
|
47
47
|
left: 'width'
|
|
48
48
|
};
|
|
49
|
-
const $
|
|
49
|
+
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {
|
|
50
50
|
};
|
|
51
51
|
// @ts-ignore
|
|
52
|
-
let $
|
|
53
|
-
function $
|
|
52
|
+
let $edcf132a9284368a$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
|
|
53
|
+
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
54
54
|
let width = 0, height = 0, top = 0, left = 0;
|
|
55
55
|
let scroll = {
|
|
56
56
|
};
|
|
57
57
|
if (containerNode.tagName === 'BODY') {
|
|
58
58
|
var ref;
|
|
59
|
-
width = (ref = $
|
|
59
|
+
width = (ref = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && ref !== void 0 ? ref : document.documentElement.clientWidth;
|
|
60
60
|
var ref1;
|
|
61
|
-
height = (ref1 = $
|
|
62
|
-
scroll.top = $
|
|
63
|
-
scroll.left = $
|
|
61
|
+
height = (ref1 = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && ref1 !== void 0 ? ref1 : document.documentElement.clientHeight;
|
|
62
|
+
scroll.top = $k7QOs$domhelpersqueryscrollTop($k7QOs$domhelpersownerDocument(containerNode).documentElement) || $k7QOs$domhelpersqueryscrollTop(containerNode);
|
|
63
|
+
scroll.left = $k7QOs$domhelpersqueryscrollLeft($k7QOs$domhelpersownerDocument(containerNode).documentElement) || $k7QOs$domhelpersqueryscrollLeft(containerNode);
|
|
64
64
|
} else {
|
|
65
|
-
({ width: width , height: height , top: top , left: left } = $
|
|
66
|
-
scroll.top = $
|
|
67
|
-
scroll.left = $
|
|
65
|
+
({ width: width , height: height , top: top , left: left } = $k7QOs$domhelpersqueryoffset(containerNode));
|
|
66
|
+
scroll.top = $k7QOs$domhelpersqueryscrollTop(containerNode);
|
|
67
|
+
scroll.left = $k7QOs$domhelpersqueryscrollLeft(containerNode);
|
|
68
68
|
}
|
|
69
69
|
return {
|
|
70
70
|
width: width,
|
|
@@ -74,7 +74,7 @@ function $b0f5ccedd88ed20a$var$getContainerDimensions(containerNode) {
|
|
|
74
74
|
left: left
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function $
|
|
77
|
+
function $edcf132a9284368a$var$getScroll(node) {
|
|
78
78
|
return {
|
|
79
79
|
top: node.scrollTop,
|
|
80
80
|
left: node.scrollLeft,
|
|
@@ -82,16 +82,16 @@ function $b0f5ccedd88ed20a$var$getScroll(node) {
|
|
|
82
82
|
height: node.scrollHeight
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
function $
|
|
85
|
+
function $edcf132a9284368a$var$getDelta(axis, offset, size, containerDimensions, padding) {
|
|
86
86
|
let containerScroll = containerDimensions.scroll[axis];
|
|
87
|
-
let containerHeight = containerDimensions[$
|
|
87
|
+
let containerHeight = containerDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
88
88
|
let startEdgeOffset = offset - padding - containerScroll;
|
|
89
89
|
let endEdgeOffset = offset + padding - containerScroll + size;
|
|
90
90
|
if (startEdgeOffset < 0) return -startEdgeOffset;
|
|
91
91
|
else if (endEdgeOffset > containerHeight) return Math.max(containerHeight - endEdgeOffset, -startEdgeOffset);
|
|
92
92
|
else return 0;
|
|
93
93
|
}
|
|
94
|
-
function $
|
|
94
|
+
function $edcf132a9284368a$var$getMargins(node) {
|
|
95
95
|
let style = window.getComputedStyle(node);
|
|
96
96
|
return {
|
|
97
97
|
top: parseInt(style.marginTop, 10) || 0,
|
|
@@ -100,15 +100,15 @@ function $b0f5ccedd88ed20a$var$getMargins(node) {
|
|
|
100
100
|
right: parseInt(style.marginRight, 10) || 0
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function $
|
|
104
|
-
if ($
|
|
103
|
+
function $edcf132a9284368a$var$parsePlacement(input) {
|
|
104
|
+
if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
105
105
|
let [placement, crossPlacement] = input.split(' ');
|
|
106
|
-
let axis = $
|
|
107
|
-
let crossAxis = $
|
|
108
|
-
if (!$
|
|
109
|
-
let size = $
|
|
110
|
-
let crossSize = $
|
|
111
|
-
$
|
|
106
|
+
let axis = $edcf132a9284368a$var$AXIS[placement] || 'right';
|
|
107
|
+
let crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
|
|
108
|
+
if (!$edcf132a9284368a$var$AXIS[crossPlacement]) crossPlacement = 'center';
|
|
109
|
+
let size = $edcf132a9284368a$var$AXIS_SIZE[axis];
|
|
110
|
+
let crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
|
|
111
|
+
$edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
|
|
112
112
|
placement: placement,
|
|
113
113
|
crossPlacement: crossPlacement,
|
|
114
114
|
axis: axis,
|
|
@@ -116,9 +116,9 @@ function $b0f5ccedd88ed20a$var$parsePlacement(input) {
|
|
|
116
116
|
size: size,
|
|
117
117
|
crossSize: crossSize
|
|
118
118
|
};
|
|
119
|
-
return $
|
|
119
|
+
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
120
120
|
}
|
|
121
|
-
function $
|
|
121
|
+
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned) {
|
|
122
122
|
let { placement: placement , crossPlacement: crossPlacement , axis: axis , crossAxis: crossAxis , size: size , crossSize: crossSize } = placementInfo;
|
|
123
123
|
let position = {
|
|
124
124
|
};
|
|
@@ -148,31 +148,31 @@ function $b0f5ccedd88ed20a$var$computePosition(childOffset, boundaryDimensions,
|
|
|
148
148
|
// then it can only be the `document.body`, and `bottom` will be relative to _its_
|
|
149
149
|
// container, which should be as large as boundaryDimensions.
|
|
150
150
|
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[size];
|
|
151
|
-
position[$
|
|
151
|
+
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
152
152
|
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
153
153
|
return position;
|
|
154
154
|
}
|
|
155
|
-
function $
|
|
155
|
+
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
|
|
156
156
|
return position.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top - (containerOffsetWithBoundary.top + position.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
|
|
157
157
|
) : Math.max(0, childOffset.top + containerOffsetWithBoundary.top - (boundaryDimensions.top + boundaryDimensions.scroll.top) - (margins.top + margins.bottom + padding) // save additional space for margin and padding
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
|
-
function $
|
|
160
|
+
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
161
161
|
let { placement: placement , axis: axis , size: size } = placementInfo;
|
|
162
|
-
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$
|
|
163
|
-
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$
|
|
162
|
+
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);
|
|
163
|
+
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);
|
|
164
164
|
}
|
|
165
|
-
function $
|
|
166
|
-
let placementInfo = $
|
|
165
|
+
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight) {
|
|
166
|
+
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
167
167
|
let { size: size , crossAxis: crossAxis , crossSize: crossSize , placement: placement , crossPlacement: crossPlacement } = placementInfo;
|
|
168
|
-
let position = $
|
|
168
|
+
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
|
|
169
169
|
let normalizedOffset = offset;
|
|
170
|
-
let space = $
|
|
170
|
+
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
171
171
|
// Check if the scroll size of the overlay is greater than the available space to determine if we need to flip
|
|
172
172
|
if (flip && scrollSize[size] > space) {
|
|
173
|
-
let flippedPlacementInfo = $
|
|
174
|
-
let flippedPosition = $
|
|
175
|
-
let flippedSpace = $
|
|
173
|
+
let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
174
|
+
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
|
|
175
|
+
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
|
|
176
176
|
// If the available space for the flipped position is greater than the original available space, flip.
|
|
177
177
|
if (flippedSpace > space) {
|
|
178
178
|
placementInfo = flippedPlacementInfo;
|
|
@@ -180,13 +180,13 @@ function $b0f5ccedd88ed20a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
180
180
|
normalizedOffset = offset;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
|
-
let delta = $
|
|
183
|
+
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
184
184
|
position[crossAxis] += delta;
|
|
185
|
-
let maxHeight = $
|
|
185
|
+
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
|
|
186
186
|
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
187
187
|
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
188
|
-
position = $
|
|
189
|
-
delta = $
|
|
188
|
+
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned);
|
|
189
|
+
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, padding);
|
|
190
190
|
position[crossAxis] += delta;
|
|
191
191
|
let arrowPosition = {
|
|
192
192
|
};
|
|
@@ -199,41 +199,41 @@ function $b0f5ccedd88ed20a$export$6839422d1f33cee9(placementInput, childOffset,
|
|
|
199
199
|
placement: placementInfo.placement
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
|
-
function $
|
|
202
|
+
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
203
203
|
let { placement: placement , targetNode: targetNode , overlayNode: overlayNode , scrollNode: scrollNode , padding: padding , shouldFlip: shouldFlip , boundaryElement: boundaryElement , offset: offset , crossOffset: crossOffset , maxHeight: maxHeight } = opts;
|
|
204
204
|
let container = overlayNode.offsetParent || document.body;
|
|
205
205
|
let isBodyContainer = container.tagName === 'BODY';
|
|
206
206
|
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
207
207
|
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== 'static';
|
|
208
|
-
let childOffset = isBodyContainer ? $
|
|
208
|
+
let childOffset = isBodyContainer ? $k7QOs$domhelpersqueryoffset(targetNode) : $k7QOs$domhelpersqueryposition(targetNode, container);
|
|
209
209
|
if (!isBodyContainer) {
|
|
210
|
-
childOffset.top += parseInt($
|
|
211
|
-
childOffset.left += parseInt($
|
|
210
|
+
childOffset.top += parseInt($k7QOs$domhelpersstyle(targetNode, 'marginTop'), 10) || 0;
|
|
211
|
+
childOffset.left += parseInt($k7QOs$domhelpersstyle(targetNode, 'marginLeft'), 10) || 0;
|
|
212
212
|
}
|
|
213
|
-
let overlaySize = $
|
|
214
|
-
let margins = $
|
|
213
|
+
let overlaySize = $k7QOs$domhelpersqueryoffset(overlayNode);
|
|
214
|
+
let margins = $edcf132a9284368a$var$getMargins(overlayNode);
|
|
215
215
|
overlaySize.width += margins.left + margins.right;
|
|
216
216
|
overlaySize.height += margins.top + margins.bottom;
|
|
217
|
-
let scrollSize = $
|
|
218
|
-
let boundaryDimensions = $
|
|
219
|
-
let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? $
|
|
220
|
-
return $
|
|
217
|
+
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
218
|
+
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
219
|
+
let containerOffsetWithBoundary = boundaryElement.tagName === 'BODY' ? $k7QOs$domhelpersqueryoffset(container) : $k7QOs$domhelpersqueryposition(container, boundaryElement);
|
|
220
|
+
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
|
|
224
224
|
|
|
225
225
|
|
|
226
|
-
const $
|
|
227
|
-
function $
|
|
226
|
+
const $dd149f63282afbbf$export$f6211563215e3b37 = new WeakMap();
|
|
227
|
+
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
228
228
|
let { triggerRef: triggerRef , isOpen: isOpen , onClose: onClose } = opts;
|
|
229
|
-
$
|
|
229
|
+
$k7QOs$useEffect(()=>{
|
|
230
230
|
if (!isOpen) return;
|
|
231
231
|
let onScroll = (e)=>{
|
|
232
232
|
// Ignore if scrolling an scrollable region outside the trigger's tree.
|
|
233
233
|
let target = e.target;
|
|
234
234
|
// window is not a Node and doesn't have contain, but window contains everything
|
|
235
235
|
if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
|
|
236
|
-
let onCloseHandler = onClose || $
|
|
236
|
+
let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
|
|
237
237
|
if (onCloseHandler) onCloseHandler();
|
|
238
238
|
};
|
|
239
239
|
window.addEventListener('scroll', onScroll, true);
|
|
@@ -251,11 +251,11 @@ function $57cf16c65f4d0c5c$export$18fc8428861184da(opts) {
|
|
|
251
251
|
|
|
252
252
|
|
|
253
253
|
// @ts-ignore
|
|
254
|
-
let $
|
|
255
|
-
function $
|
|
256
|
-
let { direction: direction } = $
|
|
254
|
+
let $2a41e45df1593e64$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
|
|
255
|
+
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
256
|
+
let { direction: direction } = $k7QOs$useLocale();
|
|
257
257
|
let { 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 } = props;
|
|
258
|
-
let [position, setPosition] = $
|
|
258
|
+
let [position, setPosition] = $k7QOs$useState({
|
|
259
259
|
position: {
|
|
260
260
|
},
|
|
261
261
|
arrowOffsetLeft: undefined,
|
|
@@ -278,10 +278,10 @@ function $406a41f4517fdb30$export$d39e1813b3bdd0e1(props) {
|
|
|
278
278
|
direction,
|
|
279
279
|
maxHeight
|
|
280
280
|
];
|
|
281
|
-
let updatePosition = $
|
|
281
|
+
let updatePosition = $k7QOs$useCallback(()=>{
|
|
282
282
|
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement) return;
|
|
283
|
-
setPosition($
|
|
284
|
-
placement: $
|
|
283
|
+
setPosition($edcf132a9284368a$export$b3ceb0cbf1056d98({
|
|
284
|
+
placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
|
|
285
285
|
overlayNode: overlayRef.current,
|
|
286
286
|
targetNode: targetRef.current,
|
|
287
287
|
scrollNode: scrollRef.current,
|
|
@@ -294,13 +294,13 @@ function $406a41f4517fdb30$export$d39e1813b3bdd0e1(props) {
|
|
|
294
294
|
}));
|
|
295
295
|
}, deps);
|
|
296
296
|
// Update position when anything changes
|
|
297
|
-
$
|
|
297
|
+
$k7QOs$useLayoutEffect(updatePosition, deps);
|
|
298
298
|
// Update position on window resize
|
|
299
|
-
$
|
|
299
|
+
$2a41e45df1593e64$var$useResize(updatePosition);
|
|
300
300
|
// Reposition the overlay and do not close on scroll while the visual viewport is resizing.
|
|
301
301
|
// This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.
|
|
302
|
-
let isResizing = $
|
|
303
|
-
$
|
|
302
|
+
let isResizing = $k7QOs$useRef(false);
|
|
303
|
+
$k7QOs$useLayoutEffect(()=>{
|
|
304
304
|
let timeout;
|
|
305
305
|
let onResize = ()=>{
|
|
306
306
|
isResizing.current = true;
|
|
@@ -310,14 +310,14 @@ function $406a41f4517fdb30$export$d39e1813b3bdd0e1(props) {
|
|
|
310
310
|
}, 500);
|
|
311
311
|
updatePosition();
|
|
312
312
|
};
|
|
313
|
-
$
|
|
313
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener('resize', onResize);
|
|
314
314
|
return ()=>{
|
|
315
|
-
$
|
|
315
|
+
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener('resize', onResize);
|
|
316
316
|
};
|
|
317
317
|
}, [
|
|
318
318
|
updatePosition
|
|
319
319
|
]);
|
|
320
|
-
let close = $
|
|
320
|
+
let close = $k7QOs$useCallback(()=>{
|
|
321
321
|
if (!isResizing.current) onClose();
|
|
322
322
|
}, [
|
|
323
323
|
onClose,
|
|
@@ -325,7 +325,7 @@ function $406a41f4517fdb30$export$d39e1813b3bdd0e1(props) {
|
|
|
325
325
|
]);
|
|
326
326
|
// When scrolling a parent scrollable region of the trigger (other than the body),
|
|
327
327
|
// we hide the popover. Otherwise, its position would be incorrect.
|
|
328
|
-
$
|
|
328
|
+
$dd149f63282afbbf$export$18fc8428861184da({
|
|
329
329
|
triggerRef: targetRef,
|
|
330
330
|
isOpen: isOpen,
|
|
331
331
|
onClose: onClose ? close : undefined
|
|
@@ -349,8 +349,8 @@ function $406a41f4517fdb30$export$d39e1813b3bdd0e1(props) {
|
|
|
349
349
|
updatePosition: updatePosition
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
-
function $
|
|
353
|
-
$
|
|
352
|
+
function $2a41e45df1593e64$var$useResize(onResize) {
|
|
353
|
+
$k7QOs$useLayoutEffect(()=>{
|
|
354
354
|
window.addEventListener('resize', onResize, false);
|
|
355
355
|
return ()=>{
|
|
356
356
|
window.removeEventListener('resize', onResize, false);
|
|
@@ -359,26 +359,26 @@ function $406a41f4517fdb30$var$useResize(onResize) {
|
|
|
359
359
|
onResize
|
|
360
360
|
]);
|
|
361
361
|
}
|
|
362
|
-
function $
|
|
362
|
+
function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
363
363
|
if (direction === 'rtl') return position.replace('start', 'right').replace('end', 'left');
|
|
364
364
|
return position.replace('start', 'left').replace('end', 'right');
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
|
|
368
|
-
var $
|
|
368
|
+
var $a11501f3d1d39e6c$exports = {};
|
|
369
369
|
|
|
370
|
-
$parcel$export($
|
|
370
|
+
$parcel$export($a11501f3d1d39e6c$exports, "useOverlay", () => $a11501f3d1d39e6c$export$ea8f71083e90600f);
|
|
371
371
|
|
|
372
372
|
|
|
373
|
-
const $
|
|
374
|
-
function $
|
|
373
|
+
const $a11501f3d1d39e6c$var$visibleOverlays = [];
|
|
374
|
+
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
|
|
375
375
|
let { onClose: onClose , shouldCloseOnBlur: shouldCloseOnBlur , isOpen: isOpen , isDismissable: isDismissable = false , isKeyboardDismissDisabled: isKeyboardDismissDisabled = false , shouldCloseOnInteractOutside: shouldCloseOnInteractOutside } = props;
|
|
376
376
|
// Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.
|
|
377
|
-
$
|
|
378
|
-
if (isOpen) $
|
|
377
|
+
$k7QOs$useEffect(()=>{
|
|
378
|
+
if (isOpen) $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
|
|
379
379
|
return ()=>{
|
|
380
|
-
let index = $
|
|
381
|
-
if (index >= 0) $
|
|
380
|
+
let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
|
|
381
|
+
if (index >= 0) $a11501f3d1d39e6c$var$visibleOverlays.splice(index, 1);
|
|
382
382
|
};
|
|
383
383
|
}, [
|
|
384
384
|
isOpen,
|
|
@@ -386,11 +386,11 @@ function $9f79c4b26f87d454$export$ea8f71083e90600f(props, ref) {
|
|
|
386
386
|
]);
|
|
387
387
|
// Only hide the overlay when it is the topmost visible overlay in the stack.
|
|
388
388
|
let onHide = ()=>{
|
|
389
|
-
if ($
|
|
389
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose) onClose();
|
|
390
390
|
};
|
|
391
391
|
let onInteractOutsideStart = (e)=>{
|
|
392
392
|
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
393
|
-
if ($
|
|
393
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
394
394
|
e.stopPropagation();
|
|
395
395
|
e.preventDefault();
|
|
396
396
|
}
|
|
@@ -398,7 +398,7 @@ function $9f79c4b26f87d454$export$ea8f71083e90600f(props, ref) {
|
|
|
398
398
|
};
|
|
399
399
|
let onInteractOutside = (e)=>{
|
|
400
400
|
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.target)) {
|
|
401
|
-
if ($
|
|
401
|
+
if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
|
|
402
402
|
e.stopPropagation();
|
|
403
403
|
e.preventDefault();
|
|
404
404
|
}
|
|
@@ -408,17 +408,18 @@ function $9f79c4b26f87d454$export$ea8f71083e90600f(props, ref) {
|
|
|
408
408
|
// Handle the escape key
|
|
409
409
|
let onKeyDown = (e)=>{
|
|
410
410
|
if (e.key === 'Escape' && !isKeyboardDismissDisabled) {
|
|
411
|
+
e.stopPropagation();
|
|
411
412
|
e.preventDefault();
|
|
412
413
|
onHide();
|
|
413
414
|
}
|
|
414
415
|
};
|
|
415
416
|
// Handle clicking outside the overlay to close it
|
|
416
|
-
$
|
|
417
|
+
$k7QOs$useInteractOutside({
|
|
417
418
|
ref: ref,
|
|
418
419
|
onInteractOutside: isDismissable ? onInteractOutside : null,
|
|
419
420
|
onInteractOutsideStart: onInteractOutsideStart
|
|
420
421
|
});
|
|
421
|
-
let { focusWithinProps: focusWithinProps } = $
|
|
422
|
+
let { focusWithinProps: focusWithinProps } = $k7QOs$useFocusWithin({
|
|
422
423
|
isDisabled: !shouldCloseOnBlur,
|
|
423
424
|
onBlurWithin: (e)=>{
|
|
424
425
|
if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e.relatedTarget)) onClose();
|
|
@@ -440,19 +441,19 @@ function $9f79c4b26f87d454$export$ea8f71083e90600f(props, ref) {
|
|
|
440
441
|
}
|
|
441
442
|
|
|
442
443
|
|
|
443
|
-
var $
|
|
444
|
+
var $628037886ba31236$exports = {};
|
|
444
445
|
|
|
445
|
-
$parcel$export($
|
|
446
|
+
$parcel$export($628037886ba31236$exports, "useOverlayTrigger", () => $628037886ba31236$export$f9d5c8beee7d008d);
|
|
446
447
|
|
|
447
448
|
|
|
448
449
|
|
|
449
|
-
function $
|
|
450
|
+
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
|
|
450
451
|
let { type: type } = props;
|
|
451
452
|
let { isOpen: isOpen } = state;
|
|
452
453
|
// Backward compatibility. Share state close function with useOverlayPosition so it can close on scroll
|
|
453
454
|
// without forcing users to pass onClose.
|
|
454
|
-
$
|
|
455
|
-
if (ref && ref.current) $
|
|
455
|
+
$k7QOs$useEffect(()=>{
|
|
456
|
+
if (ref && ref.current) $dd149f63282afbbf$export$f6211563215e3b37.set(ref.current, state.close);
|
|
456
457
|
});
|
|
457
458
|
// Aria 1.1 supports multiple values for aria-haspopup other than just menus.
|
|
458
459
|
// https://www.w3.org/TR/wai-aria-1.1/#aria-haspopup
|
|
@@ -461,7 +462,7 @@ function $d5e25f6b1b375e64$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
461
462
|
let ariaHasPopup = undefined;
|
|
462
463
|
if (type === 'menu') ariaHasPopup = true;
|
|
463
464
|
else if (type === 'listbox') ariaHasPopup = 'listbox';
|
|
464
|
-
let overlayId = $
|
|
465
|
+
let overlayId = $k7QOs$useId();
|
|
465
466
|
return {
|
|
466
467
|
triggerProps: {
|
|
467
468
|
'aria-haspopup': ariaHasPopup,
|
|
@@ -475,14 +476,14 @@ function $d5e25f6b1b375e64$export$f9d5c8beee7d008d(props, state, ref) {
|
|
|
475
476
|
}
|
|
476
477
|
|
|
477
478
|
|
|
478
|
-
var $
|
|
479
|
+
var $49c51c25361d4cd2$exports = {};
|
|
479
480
|
|
|
480
|
-
$parcel$export($
|
|
481
|
+
$parcel$export($49c51c25361d4cd2$exports, "usePreventScroll", () => $49c51c25361d4cd2$export$ee0f7cc6afcd1c18);
|
|
481
482
|
|
|
482
483
|
// @ts-ignore
|
|
483
|
-
const $
|
|
484
|
+
const $49c51c25361d4cd2$var$visualViewport = typeof window !== 'undefined' && window.visualViewport;
|
|
484
485
|
// HTML input types that do not cause the software keyboard to appear.
|
|
485
|
-
const $
|
|
486
|
+
const $49c51c25361d4cd2$var$nonTextInputTypes = new Set([
|
|
486
487
|
'checkbox',
|
|
487
488
|
'radio',
|
|
488
489
|
'range',
|
|
@@ -493,21 +494,21 @@ const $83f8618cd3e10645$var$nonTextInputTypes = new Set([
|
|
|
493
494
|
'submit',
|
|
494
495
|
'reset'
|
|
495
496
|
]);
|
|
496
|
-
function $
|
|
497
|
+
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {
|
|
497
498
|
}) {
|
|
498
499
|
let { isDisabled: isDisabled } = options;
|
|
499
|
-
$
|
|
500
|
+
$k7QOs$useLayoutEffect(()=>{
|
|
500
501
|
if (isDisabled) return;
|
|
501
|
-
if ($
|
|
502
|
-
else return $
|
|
502
|
+
if ($k7QOs$isIOS()) return $49c51c25361d4cd2$var$preventScrollMobileSafari();
|
|
503
|
+
else return $49c51c25361d4cd2$var$preventScrollStandard();
|
|
503
504
|
}, [
|
|
504
505
|
isDisabled
|
|
505
506
|
]);
|
|
506
507
|
}
|
|
507
508
|
// For most browsers, all we need to do is set `overflow: hidden` on the root element, and
|
|
508
509
|
// add some padding to prevent the page from shifting when the scrollbar is hidden.
|
|
509
|
-
function $
|
|
510
|
-
return $
|
|
510
|
+
function $49c51c25361d4cd2$var$preventScrollStandard() {
|
|
511
|
+
return $k7QOs$chain($49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'));
|
|
511
512
|
}
|
|
512
513
|
// Mobile Safari is a whole different beast. Even with overflow: hidden,
|
|
513
514
|
// it still scrolls the page in many situations:
|
|
@@ -535,12 +536,12 @@ function $83f8618cd3e10645$var$preventScrollStandard() {
|
|
|
535
536
|
// above work or Safari will still try to scroll the page when focusing an input.
|
|
536
537
|
// 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
|
|
537
538
|
// to navigate to an input with the next/previous buttons that's outside a modal.
|
|
538
|
-
function $
|
|
539
|
+
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
|
|
539
540
|
let scrollable;
|
|
540
541
|
let lastY = 0;
|
|
541
542
|
let onTouchStart = (e)=>{
|
|
542
543
|
// Store the nearest scrollable parent element from the element that the user touched.
|
|
543
|
-
scrollable = $
|
|
544
|
+
scrollable = $k7QOs$getScrollParent(e.target);
|
|
544
545
|
if (scrollable === document.documentElement && scrollable === document.body) return;
|
|
545
546
|
lastY = e.changedTouches[0].pageY;
|
|
546
547
|
};
|
|
@@ -562,7 +563,8 @@ function $83f8618cd3e10645$var$preventScrollMobileSafari() {
|
|
|
562
563
|
};
|
|
563
564
|
let onTouchEnd = (e)=>{
|
|
564
565
|
let target = e.target;
|
|
565
|
-
if
|
|
566
|
+
// Apply this change if we're not already focused on the target element
|
|
567
|
+
if ($49c51c25361d4cd2$var$willOpenKeyboard(target) && target !== document.activeElement) {
|
|
566
568
|
e.preventDefault();
|
|
567
569
|
// Apply a transform to trick Safari into thinking the input is at the top of the page
|
|
568
570
|
// so it doesn't try to scroll it into view. When tapping on an input, this needs to
|
|
@@ -576,7 +578,7 @@ function $83f8618cd3e10645$var$preventScrollMobileSafari() {
|
|
|
576
578
|
};
|
|
577
579
|
let onFocus = (e)=>{
|
|
578
580
|
let target = e.target;
|
|
579
|
-
if (
|
|
581
|
+
if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
|
|
580
582
|
// Transform also needs to be applied in the focus event in cases where focus moves
|
|
581
583
|
// other than tapping on an input directly, e.g. the next/previous buttons in the
|
|
582
584
|
// software keyboard. In these cases, it seems applying the transform in the focus event
|
|
@@ -586,15 +588,15 @@ function $83f8618cd3e10645$var$preventScrollMobileSafari() {
|
|
|
586
588
|
target.style.transform = '';
|
|
587
589
|
// This will have prevented the browser from scrolling the focused element into view,
|
|
588
590
|
// so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
|
|
589
|
-
if ($
|
|
590
|
-
if ($
|
|
591
|
+
if ($49c51c25361d4cd2$var$visualViewport) {
|
|
592
|
+
if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight) // If the keyboard is already visible, do this after one additional frame
|
|
591
593
|
// to wait for the transform to be removed.
|
|
592
594
|
requestAnimationFrame(()=>{
|
|
593
|
-
$
|
|
595
|
+
$49c51c25361d4cd2$var$scrollIntoView(target);
|
|
594
596
|
});
|
|
595
597
|
else // Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
596
598
|
// measure the correct position to scroll to.
|
|
597
|
-
$
|
|
599
|
+
$49c51c25361d4cd2$var$visualViewport.addEventListener('resize', ()=>$49c51c25361d4cd2$var$scrollIntoView(target)
|
|
598
600
|
, {
|
|
599
601
|
once: true
|
|
600
602
|
});
|
|
@@ -612,19 +614,19 @@ function $83f8618cd3e10645$var$preventScrollMobileSafari() {
|
|
|
612
614
|
// enable us to scroll the window to the top, which is required for the rest of this to work.
|
|
613
615
|
let scrollX = window.pageXOffset;
|
|
614
616
|
let scrollY = window.pageYOffset;
|
|
615
|
-
let restoreStyles = $
|
|
617
|
+
let restoreStyles = $k7QOs$chain($49c51c25361d4cd2$var$setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, 'overflow', 'hidden'), $49c51c25361d4cd2$var$setStyle(document.body, 'marginTop', `-${scrollY}px`));
|
|
616
618
|
// Scroll to the top. The negative margin on the body will make this appear the same.
|
|
617
619
|
window.scrollTo(0, 0);
|
|
618
|
-
let removeEvents = $
|
|
620
|
+
let removeEvents = $k7QOs$chain($49c51c25361d4cd2$var$addEvent(document, 'touchstart', onTouchStart, {
|
|
619
621
|
passive: false,
|
|
620
622
|
capture: true
|
|
621
|
-
}), $
|
|
623
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'touchmove', onTouchMove, {
|
|
622
624
|
passive: false,
|
|
623
625
|
capture: true
|
|
624
|
-
}), $
|
|
626
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'touchend', onTouchEnd, {
|
|
625
627
|
passive: false,
|
|
626
628
|
capture: true
|
|
627
|
-
}), $
|
|
629
|
+
}), $49c51c25361d4cd2$var$addEvent(document, 'focus', onFocus, true), $49c51c25361d4cd2$var$addEvent(window, 'scroll', onWindowScroll));
|
|
628
630
|
return ()=>{
|
|
629
631
|
// Restore styles and scroll the page back to where it was.
|
|
630
632
|
restoreStyles();
|
|
@@ -633,7 +635,7 @@ function $83f8618cd3e10645$var$preventScrollMobileSafari() {
|
|
|
633
635
|
};
|
|
634
636
|
}
|
|
635
637
|
// Sets a CSS property on an element, and returns a function to revert it to the previous value.
|
|
636
|
-
function $
|
|
638
|
+
function $49c51c25361d4cd2$var$setStyle(element, style, value) {
|
|
637
639
|
let cur = element.style[style];
|
|
638
640
|
element.style[style] = value;
|
|
639
641
|
return ()=>{
|
|
@@ -641,38 +643,45 @@ function $83f8618cd3e10645$var$setStyle(element, style, value) {
|
|
|
641
643
|
};
|
|
642
644
|
}
|
|
643
645
|
// Adds an event listener to an element, and returns a function to remove it.
|
|
644
|
-
function $
|
|
646
|
+
function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
|
|
645
647
|
target.addEventListener(event, handler, options);
|
|
646
648
|
return ()=>{
|
|
647
649
|
target.removeEventListener(event, handler, options);
|
|
648
650
|
};
|
|
649
651
|
}
|
|
650
|
-
function $
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
let
|
|
655
|
-
|
|
656
|
-
|
|
652
|
+
function $49c51c25361d4cd2$var$scrollIntoView(target) {
|
|
653
|
+
let root = document.scrollingElement || document.documentElement;
|
|
654
|
+
while(target && target !== root){
|
|
655
|
+
// Find the parent scrollable element and adjust the scroll position if the target is not already in view.
|
|
656
|
+
let scrollable = $k7QOs$getScrollParent(target);
|
|
657
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
|
|
658
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
659
|
+
let targetTop = target.getBoundingClientRect().top;
|
|
660
|
+
if (targetTop > scrollableTop + target.clientHeight) scrollable.scrollTop += targetTop - scrollableTop;
|
|
661
|
+
}
|
|
662
|
+
target = scrollable.parentElement;
|
|
657
663
|
}
|
|
658
664
|
}
|
|
665
|
+
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
|
|
666
|
+
return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
|
|
667
|
+
}
|
|
659
668
|
|
|
660
669
|
|
|
661
|
-
var $
|
|
670
|
+
var $f57aed4a881a3485$exports = {};
|
|
662
671
|
|
|
663
|
-
$parcel$export($
|
|
664
|
-
$parcel$export($
|
|
665
|
-
$parcel$export($
|
|
666
|
-
$parcel$export($
|
|
667
|
-
$parcel$export($
|
|
672
|
+
$parcel$export($f57aed4a881a3485$exports, "ModalProvider", () => $f57aed4a881a3485$export$178405afcd8c5eb);
|
|
673
|
+
$parcel$export($f57aed4a881a3485$exports, "useModalProvider", () => $f57aed4a881a3485$export$d9aaed4c3ece1bc0);
|
|
674
|
+
$parcel$export($f57aed4a881a3485$exports, "OverlayProvider", () => $f57aed4a881a3485$export$bf688221f59024e5);
|
|
675
|
+
$parcel$export($f57aed4a881a3485$exports, "OverlayContainer", () => $f57aed4a881a3485$export$b47c3594eab58386);
|
|
676
|
+
$parcel$export($f57aed4a881a3485$exports, "useModal", () => $f57aed4a881a3485$export$33ffd74ebf07f060);
|
|
668
677
|
|
|
669
678
|
|
|
670
|
-
const $
|
|
671
|
-
function $
|
|
679
|
+
const $f57aed4a881a3485$var$Context = /*#__PURE__*/ $k7QOs$react.createContext(null);
|
|
680
|
+
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
|
|
672
681
|
let { children: children } = props;
|
|
673
|
-
let parent = $
|
|
674
|
-
let [modalCount, setModalCount] = $
|
|
675
|
-
let context = $
|
|
682
|
+
let parent = $k7QOs$useContext($f57aed4a881a3485$var$Context);
|
|
683
|
+
let [modalCount, setModalCount] = $k7QOs$useState(0);
|
|
684
|
+
let context = $k7QOs$useMemo(()=>({
|
|
676
685
|
parent: parent,
|
|
677
686
|
modalCount: modalCount,
|
|
678
687
|
addModal () {
|
|
@@ -690,12 +699,12 @@ function $7b14dc4b86354e5c$export$178405afcd8c5eb(props) {
|
|
|
690
699
|
parent,
|
|
691
700
|
modalCount
|
|
692
701
|
]);
|
|
693
|
-
return(/*#__PURE__*/ $
|
|
702
|
+
return(/*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$var$Context.Provider, {
|
|
694
703
|
value: context
|
|
695
704
|
}, children));
|
|
696
705
|
}
|
|
697
|
-
function $
|
|
698
|
-
let context = $
|
|
706
|
+
function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
|
|
707
|
+
let context = $k7QOs$useContext($f57aed4a881a3485$var$Context);
|
|
699
708
|
return {
|
|
700
709
|
modalProviderProps: {
|
|
701
710
|
'aria-hidden': context && context.modalCount > 0 ? true : null
|
|
@@ -704,32 +713,32 @@ function $7b14dc4b86354e5c$export$d9aaed4c3ece1bc0() {
|
|
|
704
713
|
}
|
|
705
714
|
/**
|
|
706
715
|
* Creates a root node that will be aria-hidden if there are other modals open.
|
|
707
|
-
*/ function $
|
|
708
|
-
let { modalProviderProps: modalProviderProps } = $
|
|
709
|
-
return(/*#__PURE__*/ $
|
|
716
|
+
*/ function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
|
|
717
|
+
let { modalProviderProps: modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
|
|
718
|
+
return(/*#__PURE__*/ $k7QOs$react.createElement("div", {
|
|
710
719
|
"data-overlay-container": true,
|
|
711
720
|
...props,
|
|
712
721
|
...modalProviderProps
|
|
713
722
|
}));
|
|
714
723
|
}
|
|
715
|
-
function $
|
|
716
|
-
return(/*#__PURE__*/ $
|
|
724
|
+
function $f57aed4a881a3485$export$bf688221f59024e5(props) {
|
|
725
|
+
return(/*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$var$OverlayContainerDOM, props)));
|
|
717
726
|
}
|
|
718
|
-
function $
|
|
727
|
+
function $f57aed4a881a3485$export$b47c3594eab58386(props) {
|
|
719
728
|
let { portalContainer: portalContainer = document.body , ...rest } = props;
|
|
720
|
-
$
|
|
729
|
+
$k7QOs$react.useEffect(()=>{
|
|
721
730
|
if (portalContainer.closest('[data-overlay-container]')) throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
|
|
722
731
|
}, [
|
|
723
732
|
portalContainer
|
|
724
733
|
]);
|
|
725
|
-
let contents = /*#__PURE__*/ $
|
|
726
|
-
return(/*#__PURE__*/ $
|
|
734
|
+
let contents = /*#__PURE__*/ $k7QOs$react.createElement($f57aed4a881a3485$export$bf688221f59024e5, rest);
|
|
735
|
+
return(/*#__PURE__*/ $k7QOs$reactdom.createPortal(contents, portalContainer));
|
|
727
736
|
}
|
|
728
|
-
function $
|
|
737
|
+
function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
|
|
729
738
|
// Add aria-hidden to all parent providers on mount, and restore on unmount.
|
|
730
|
-
let context = $
|
|
739
|
+
let context = $k7QOs$useContext($f57aed4a881a3485$var$Context);
|
|
731
740
|
if (!context) throw new Error('Modal is not contained within a provider');
|
|
732
|
-
$
|
|
741
|
+
$k7QOs$useEffect(()=>{
|
|
733
742
|
if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context || !context.parent) return;
|
|
734
743
|
// The immediate context is from the provider containing this modal, so we only
|
|
735
744
|
// want to trigger aria-hidden on its parents not on the modal provider itself.
|
|
@@ -750,204 +759,206 @@ function $7b14dc4b86354e5c$export$33ffd74ebf07f060(options) {
|
|
|
750
759
|
}
|
|
751
760
|
|
|
752
761
|
|
|
753
|
-
var $
|
|
762
|
+
var $86ea4cb521eb2e37$exports = {};
|
|
754
763
|
|
|
755
|
-
$parcel$export($
|
|
756
|
-
var $
|
|
757
|
-
var $
|
|
758
|
-
$
|
|
764
|
+
$parcel$export($86ea4cb521eb2e37$exports, "DismissButton", () => $86ea4cb521eb2e37$export$2317d149ed6f78c4);
|
|
765
|
+
var $61fe14465afefc5e$exports = {};
|
|
766
|
+
var $773d5888b972f1cf$exports = {};
|
|
767
|
+
$773d5888b972f1cf$exports = JSON.parse("{\"dismiss\":\"تجاهل\"}");
|
|
759
768
|
|
|
760
769
|
|
|
761
|
-
var $
|
|
762
|
-
$
|
|
770
|
+
var $d11f19852b941573$exports = {};
|
|
771
|
+
$d11f19852b941573$exports = JSON.parse("{\"dismiss\":\"Отхвърляне\"}");
|
|
763
772
|
|
|
764
773
|
|
|
765
|
-
var $
|
|
766
|
-
$
|
|
774
|
+
var $b983974c2ee1efb3$exports = {};
|
|
775
|
+
$b983974c2ee1efb3$exports = JSON.parse("{\"dismiss\":\"Odstranit\"}");
|
|
767
776
|
|
|
768
777
|
|
|
769
|
-
var $
|
|
770
|
-
$
|
|
778
|
+
var $5809cc9d4e92de73$exports = {};
|
|
779
|
+
$5809cc9d4e92de73$exports = JSON.parse("{\"dismiss\":\"Luk\"}");
|
|
771
780
|
|
|
772
781
|
|
|
773
|
-
var $
|
|
774
|
-
$
|
|
782
|
+
var $c68c2e4fc74398d1$exports = {};
|
|
783
|
+
$c68c2e4fc74398d1$exports = JSON.parse("{\"dismiss\":\"Schließen\"}");
|
|
775
784
|
|
|
776
785
|
|
|
777
|
-
var $
|
|
778
|
-
$
|
|
786
|
+
var $0898b4c153db2b77$exports = {};
|
|
787
|
+
$0898b4c153db2b77$exports = JSON.parse("{\"dismiss\":\"Απόρριψη\"}");
|
|
779
788
|
|
|
780
789
|
|
|
781
|
-
var $
|
|
782
|
-
$
|
|
790
|
+
var $6d74810286a15183$exports = {};
|
|
791
|
+
$6d74810286a15183$exports = JSON.parse("{\"dismiss\":\"Dismiss\"}");
|
|
783
792
|
|
|
784
793
|
|
|
785
|
-
var $
|
|
786
|
-
$
|
|
794
|
+
var $309d73dc65f78055$exports = {};
|
|
795
|
+
$309d73dc65f78055$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
|
|
787
796
|
|
|
788
797
|
|
|
789
|
-
var $
|
|
790
|
-
$
|
|
798
|
+
var $44ad94f7205cf593$exports = {};
|
|
799
|
+
$44ad94f7205cf593$exports = JSON.parse("{\"dismiss\":\"Lõpeta\"}");
|
|
791
800
|
|
|
792
801
|
|
|
793
|
-
var $
|
|
794
|
-
$
|
|
802
|
+
var $7c28f5687f0779a9$exports = {};
|
|
803
|
+
$7c28f5687f0779a9$exports = JSON.parse("{\"dismiss\":\"Hylkää\"}");
|
|
795
804
|
|
|
796
805
|
|
|
797
|
-
var $
|
|
798
|
-
$
|
|
806
|
+
var $e6d75df4b68bd73a$exports = {};
|
|
807
|
+
$e6d75df4b68bd73a$exports = JSON.parse("{\"dismiss\":\"Rejeter\"}");
|
|
799
808
|
|
|
800
809
|
|
|
801
|
-
var $
|
|
802
|
-
$
|
|
810
|
+
var $87505c9dab186d0f$exports = {};
|
|
811
|
+
$87505c9dab186d0f$exports = JSON.parse("{\"dismiss\":\"התעלם\"}");
|
|
803
812
|
|
|
804
813
|
|
|
805
|
-
var $
|
|
806
|
-
$
|
|
814
|
+
var $553439c3ffb3e492$exports = {};
|
|
815
|
+
$553439c3ffb3e492$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
|
|
807
816
|
|
|
808
817
|
|
|
809
|
-
var $
|
|
810
|
-
$
|
|
818
|
+
var $74cf411061b983a2$exports = {};
|
|
819
|
+
$74cf411061b983a2$exports = JSON.parse("{\"dismiss\":\"Elutasítás\"}");
|
|
811
820
|
|
|
812
821
|
|
|
813
|
-
var $
|
|
814
|
-
$
|
|
822
|
+
var $e933f298574dc435$exports = {};
|
|
823
|
+
$e933f298574dc435$exports = JSON.parse("{\"dismiss\":\"Ignora\"}");
|
|
815
824
|
|
|
816
825
|
|
|
817
|
-
var $
|
|
818
|
-
$
|
|
826
|
+
var $ac91fc9fe02f71f6$exports = {};
|
|
827
|
+
$ac91fc9fe02f71f6$exports = JSON.parse("{\"dismiss\":\"閉じる\"}");
|
|
819
828
|
|
|
820
829
|
|
|
821
|
-
var $
|
|
822
|
-
$
|
|
830
|
+
var $52b96f86422025af$exports = {};
|
|
831
|
+
$52b96f86422025af$exports = JSON.parse("{\"dismiss\":\"무시\"}");
|
|
823
832
|
|
|
824
833
|
|
|
825
|
-
var $
|
|
826
|
-
$
|
|
834
|
+
var $c0d724c3e51dafa6$exports = {};
|
|
835
|
+
$c0d724c3e51dafa6$exports = JSON.parse("{\"dismiss\":\"Atmesti\"}");
|
|
827
836
|
|
|
828
837
|
|
|
829
|
-
var $
|
|
830
|
-
$
|
|
838
|
+
var $c92899672a3fe72e$exports = {};
|
|
839
|
+
$c92899672a3fe72e$exports = JSON.parse("{\"dismiss\":\"Nerādīt\"}");
|
|
831
840
|
|
|
832
841
|
|
|
833
|
-
var $
|
|
834
|
-
$
|
|
842
|
+
var $9f576b39d8e7a9d6$exports = {};
|
|
843
|
+
$9f576b39d8e7a9d6$exports = JSON.parse("{\"dismiss\":\"Lukk\"}");
|
|
835
844
|
|
|
836
845
|
|
|
837
|
-
var $
|
|
838
|
-
$
|
|
846
|
+
var $9d025808aeec81a7$exports = {};
|
|
847
|
+
$9d025808aeec81a7$exports = JSON.parse("{\"dismiss\":\"Negeren\"}");
|
|
839
848
|
|
|
840
849
|
|
|
841
|
-
var $
|
|
842
|
-
$
|
|
850
|
+
var $fce709921e2c0fa6$exports = {};
|
|
851
|
+
$fce709921e2c0fa6$exports = JSON.parse("{\"dismiss\":\"Zignoruj\"}");
|
|
843
852
|
|
|
844
853
|
|
|
845
|
-
var $
|
|
846
|
-
$
|
|
854
|
+
var $2599cf0c4ab37f59$exports = {};
|
|
855
|
+
$2599cf0c4ab37f59$exports = JSON.parse("{\"dismiss\":\"Descartar\"}");
|
|
847
856
|
|
|
848
857
|
|
|
849
|
-
var $
|
|
850
|
-
$
|
|
858
|
+
var $3c220ae7ef8a35fd$exports = {};
|
|
859
|
+
$3c220ae7ef8a35fd$exports = JSON.parse("{\"dismiss\":\"Dispensar\"}");
|
|
851
860
|
|
|
852
861
|
|
|
853
|
-
var $
|
|
854
|
-
$
|
|
862
|
+
var $93562b5094072f54$exports = {};
|
|
863
|
+
$93562b5094072f54$exports = JSON.parse("{\"dismiss\":\"Revocare\"}");
|
|
855
864
|
|
|
856
865
|
|
|
857
|
-
var $
|
|
858
|
-
$
|
|
866
|
+
var $cd9e2abd0d06c7b4$exports = {};
|
|
867
|
+
$cd9e2abd0d06c7b4$exports = JSON.parse("{\"dismiss\":\"Пропустить\"}");
|
|
859
868
|
|
|
860
869
|
|
|
861
|
-
var $
|
|
862
|
-
$
|
|
870
|
+
var $45375701f409adf1$exports = {};
|
|
871
|
+
$45375701f409adf1$exports = JSON.parse("{\"dismiss\":\"Zrušiť\"}");
|
|
863
872
|
|
|
864
873
|
|
|
865
|
-
var $
|
|
866
|
-
$
|
|
874
|
+
var $27fab53a576de9dd$exports = {};
|
|
875
|
+
$27fab53a576de9dd$exports = JSON.parse("{\"dismiss\":\"Opusti\"}");
|
|
867
876
|
|
|
868
877
|
|
|
869
|
-
var $
|
|
870
|
-
$
|
|
878
|
+
var $4438748d9952e7c7$exports = {};
|
|
879
|
+
$4438748d9952e7c7$exports = JSON.parse("{\"dismiss\":\"Odbaci\"}");
|
|
871
880
|
|
|
872
881
|
|
|
873
|
-
var $
|
|
874
|
-
$
|
|
882
|
+
var $0936d7347ef4da4c$exports = {};
|
|
883
|
+
$0936d7347ef4da4c$exports = JSON.parse("{\"dismiss\":\"Avvisa\"}");
|
|
875
884
|
|
|
876
885
|
|
|
877
|
-
var $
|
|
878
|
-
$
|
|
886
|
+
var $29700c92185d38f8$exports = {};
|
|
887
|
+
$29700c92185d38f8$exports = JSON.parse("{\"dismiss\":\"Kapat\"}");
|
|
879
888
|
|
|
880
889
|
|
|
881
|
-
var $
|
|
882
|
-
$
|
|
890
|
+
var $662ccaf2be4c25b3$exports = {};
|
|
891
|
+
$662ccaf2be4c25b3$exports = JSON.parse("{\"dismiss\":\"Скасувати\"}");
|
|
883
892
|
|
|
884
893
|
|
|
885
|
-
var $
|
|
886
|
-
$
|
|
894
|
+
var $d80a27deda7cdb3c$exports = {};
|
|
895
|
+
$d80a27deda7cdb3c$exports = JSON.parse("{\"dismiss\":\"取消\"}");
|
|
887
896
|
|
|
888
897
|
|
|
889
|
-
var $
|
|
890
|
-
$
|
|
898
|
+
var $2b2734393847c884$exports = {};
|
|
899
|
+
$2b2734393847c884$exports = JSON.parse("{\"dismiss\":\"關閉\"}");
|
|
891
900
|
|
|
892
901
|
|
|
893
|
-
$
|
|
894
|
-
"ar-AE": $
|
|
895
|
-
"bg-BG": $
|
|
896
|
-
"cs-CZ": $
|
|
897
|
-
"da-DK": $
|
|
898
|
-
"de-DE": $
|
|
899
|
-
"el-GR": $
|
|
900
|
-
"en-US": $
|
|
901
|
-
"es-ES": $
|
|
902
|
-
"et-EE": $
|
|
903
|
-
"fi-FI": $
|
|
904
|
-
"fr-FR": $
|
|
905
|
-
"he-IL": $
|
|
906
|
-
"hr-HR": $
|
|
907
|
-
"hu-HU": $
|
|
908
|
-
"it-IT": $
|
|
909
|
-
"ja-JP": $
|
|
910
|
-
"ko-KR": $
|
|
911
|
-
"lt-LT": $
|
|
912
|
-
"lv-LV": $
|
|
913
|
-
"nb-NO": $
|
|
914
|
-
"nl-NL": $
|
|
915
|
-
"pl-PL": $
|
|
916
|
-
"pt-BR": $
|
|
917
|
-
"pt-PT": $
|
|
918
|
-
"ro-RO": $
|
|
919
|
-
"ru-RU": $
|
|
920
|
-
"sk-SK": $
|
|
921
|
-
"sl-SI": $
|
|
922
|
-
"sr-SP": $
|
|
923
|
-
"sv-SE": $
|
|
924
|
-
"tr-TR": $
|
|
925
|
-
"uk-UA": $
|
|
926
|
-
"zh-CN": $
|
|
927
|
-
"zh-TW": $
|
|
902
|
+
$61fe14465afefc5e$exports = {
|
|
903
|
+
"ar-AE": $773d5888b972f1cf$exports,
|
|
904
|
+
"bg-BG": $d11f19852b941573$exports,
|
|
905
|
+
"cs-CZ": $b983974c2ee1efb3$exports,
|
|
906
|
+
"da-DK": $5809cc9d4e92de73$exports,
|
|
907
|
+
"de-DE": $c68c2e4fc74398d1$exports,
|
|
908
|
+
"el-GR": $0898b4c153db2b77$exports,
|
|
909
|
+
"en-US": $6d74810286a15183$exports,
|
|
910
|
+
"es-ES": $309d73dc65f78055$exports,
|
|
911
|
+
"et-EE": $44ad94f7205cf593$exports,
|
|
912
|
+
"fi-FI": $7c28f5687f0779a9$exports,
|
|
913
|
+
"fr-FR": $e6d75df4b68bd73a$exports,
|
|
914
|
+
"he-IL": $87505c9dab186d0f$exports,
|
|
915
|
+
"hr-HR": $553439c3ffb3e492$exports,
|
|
916
|
+
"hu-HU": $74cf411061b983a2$exports,
|
|
917
|
+
"it-IT": $e933f298574dc435$exports,
|
|
918
|
+
"ja-JP": $ac91fc9fe02f71f6$exports,
|
|
919
|
+
"ko-KR": $52b96f86422025af$exports,
|
|
920
|
+
"lt-LT": $c0d724c3e51dafa6$exports,
|
|
921
|
+
"lv-LV": $c92899672a3fe72e$exports,
|
|
922
|
+
"nb-NO": $9f576b39d8e7a9d6$exports,
|
|
923
|
+
"nl-NL": $9d025808aeec81a7$exports,
|
|
924
|
+
"pl-PL": $fce709921e2c0fa6$exports,
|
|
925
|
+
"pt-BR": $2599cf0c4ab37f59$exports,
|
|
926
|
+
"pt-PT": $3c220ae7ef8a35fd$exports,
|
|
927
|
+
"ro-RO": $93562b5094072f54$exports,
|
|
928
|
+
"ru-RU": $cd9e2abd0d06c7b4$exports,
|
|
929
|
+
"sk-SK": $45375701f409adf1$exports,
|
|
930
|
+
"sl-SI": $27fab53a576de9dd$exports,
|
|
931
|
+
"sr-SP": $4438748d9952e7c7$exports,
|
|
932
|
+
"sv-SE": $0936d7347ef4da4c$exports,
|
|
933
|
+
"tr-TR": $29700c92185d38f8$exports,
|
|
934
|
+
"uk-UA": $662ccaf2be4c25b3$exports,
|
|
935
|
+
"zh-CN": $d80a27deda7cdb3c$exports,
|
|
936
|
+
"zh-TW": $2b2734393847c884$exports
|
|
928
937
|
};
|
|
929
938
|
|
|
930
939
|
|
|
931
940
|
|
|
932
941
|
|
|
933
942
|
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
let
|
|
943
|
+
|
|
944
|
+
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
|
|
945
|
+
let { onDismiss: onDismiss , ...otherProps } = props;
|
|
946
|
+
let formatMessage = $k7QOs$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($61fe14465afefc5e$exports)));
|
|
947
|
+
let labels = $k7QOs$useLabels(otherProps, formatMessage('dismiss'));
|
|
937
948
|
let onClick = ()=>{
|
|
938
949
|
if (onDismiss) onDismiss();
|
|
939
950
|
};
|
|
940
|
-
return(/*#__PURE__*/ $
|
|
951
|
+
return(/*#__PURE__*/ $k7QOs$react.createElement($k7QOs$VisuallyHidden, null, /*#__PURE__*/ $k7QOs$react.createElement("button", {
|
|
952
|
+
...labels,
|
|
941
953
|
tabIndex: -1,
|
|
942
|
-
"aria-label": formatMessage('dismiss'),
|
|
943
954
|
onClick: onClick
|
|
944
955
|
})));
|
|
945
956
|
}
|
|
946
957
|
|
|
947
958
|
|
|
948
|
-
var $
|
|
959
|
+
var $5e3802645cc19319$exports = {};
|
|
949
960
|
|
|
950
|
-
$parcel$export($
|
|
961
|
+
$parcel$export($5e3802645cc19319$exports, "ariaHideOutside", () => $5e3802645cc19319$export$1c3ebcada18427bf);
|
|
951
962
|
/*
|
|
952
963
|
* Copyright 2020 Adobe. All rights reserved.
|
|
953
964
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -960,8 +971,8 @@ $parcel$export($3b8a0076b0513838$exports, "ariaHideOutside", () => $3b8a0076b051
|
|
|
960
971
|
* governing permissions and limitations under the License.
|
|
961
972
|
*/ // Keeps a ref count of all hidden elements. Added to when hiding an element, and
|
|
962
973
|
// subtracted from when showing it again. When it reaches zero, aria-hidden is removed.
|
|
963
|
-
let $
|
|
964
|
-
function $
|
|
974
|
+
let $5e3802645cc19319$var$refCountMap = new WeakMap();
|
|
975
|
+
function $5e3802645cc19319$export$1c3ebcada18427bf(targets, root = document.body) {
|
|
965
976
|
let visibleNodes = new Set(targets);
|
|
966
977
|
let hiddenNodes = new Set();
|
|
967
978
|
let walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
|
|
@@ -982,13 +993,13 @@ function $3b8a0076b0513838$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
982
993
|
});
|
|
983
994
|
let hide = (node)=>{
|
|
984
995
|
var ref;
|
|
985
|
-
let refCount = (ref = $
|
|
996
|
+
let refCount = (ref = $5e3802645cc19319$var$refCountMap.get(node)) !== null && ref !== void 0 ? ref : 0;
|
|
986
997
|
// If already aria-hidden, and the ref count is zero, then this element
|
|
987
998
|
// was already hidden and there's nothing for us to do.
|
|
988
999
|
if (node.getAttribute('aria-hidden') === 'true' && refCount === 0) return;
|
|
989
1000
|
if (refCount === 0) node.setAttribute('aria-hidden', 'true');
|
|
990
1001
|
hiddenNodes.add(node);
|
|
991
|
-
$
|
|
1002
|
+
$5e3802645cc19319$var$refCountMap.set(node, refCount + 1);
|
|
992
1003
|
};
|
|
993
1004
|
let node1 = walker.nextNode();
|
|
994
1005
|
while(node1 != null){
|
|
@@ -1017,11 +1028,11 @@ function $3b8a0076b0513838$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1017
1028
|
return ()=>{
|
|
1018
1029
|
observer.disconnect();
|
|
1019
1030
|
for (let node of hiddenNodes){
|
|
1020
|
-
let count = $
|
|
1031
|
+
let count = $5e3802645cc19319$var$refCountMap.get(node);
|
|
1021
1032
|
if (count === 1) {
|
|
1022
1033
|
node.removeAttribute('aria-hidden');
|
|
1023
|
-
$
|
|
1024
|
-
} else $
|
|
1034
|
+
$5e3802645cc19319$var$refCountMap.delete(node);
|
|
1035
|
+
} else $5e3802645cc19319$var$refCountMap.set(node, count - 1);
|
|
1025
1036
|
}
|
|
1026
1037
|
};
|
|
1027
1038
|
}
|
|
@@ -1029,5 +1040,5 @@ function $3b8a0076b0513838$export$1c3ebcada18427bf(targets, root = document.body
|
|
|
1029
1040
|
|
|
1030
1041
|
|
|
1031
1042
|
|
|
1032
|
-
export {$
|
|
1043
|
+
export {$2a41e45df1593e64$export$d39e1813b3bdd0e1 as useOverlayPosition, $a11501f3d1d39e6c$export$ea8f71083e90600f as useOverlay, $628037886ba31236$export$f9d5c8beee7d008d as useOverlayTrigger, $49c51c25361d4cd2$export$ee0f7cc6afcd1c18 as usePreventScroll, $f57aed4a881a3485$export$178405afcd8c5eb as ModalProvider, $f57aed4a881a3485$export$d9aaed4c3ece1bc0 as useModalProvider, $f57aed4a881a3485$export$bf688221f59024e5 as OverlayProvider, $f57aed4a881a3485$export$b47c3594eab58386 as OverlayContainer, $f57aed4a881a3485$export$33ffd74ebf07f060 as useModal, $86ea4cb521eb2e37$export$2317d149ed6f78c4 as DismissButton, $5e3802645cc19319$export$1c3ebcada18427bf as ariaHideOutside};
|
|
1033
1044
|
//# sourceMappingURL=module.js.map
|