@eightshift/ui-components 3.0.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +101 -101
- package/dist/Button-BPLceDeW.js +0 -185
- package/dist/Collection-CZxddMZS.js +0 -2332
- package/dist/Color-MV5kBVXr.js +0 -2452
- package/dist/ColorSwatch-BqQfVu4L.js +0 -64
- package/dist/ComboBox-_RfyhwZw.js +0 -1906
- package/dist/Dialog-8tYeQ9n4.js +0 -2300
- package/dist/FieldError-52GVSGgC.js +0 -42
- package/dist/FocusScope-Cri5BFRz.js +0 -831
- package/dist/Form-Cq3fu75_.js +0 -5
- package/dist/Group-_emcIVxI.js +0 -48
- package/dist/Heading-B2153VXe.js +0 -16
- package/dist/Hidden-rE6uR-lr.js +0 -41
- package/dist/Input-BxpFEIXV.js +0 -133
- package/dist/Label-icmbmNdI.js +0 -17
- package/dist/List-CZMUbkFU.js +0 -593
- package/dist/ListBox-Ca6hiCqz.js +0 -581
- package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
- package/dist/OverlayArrow-CYXQSlEU.js +0 -629
- package/dist/RSPContexts-2lR5GG9p.js +0 -14
- package/dist/Select-aab027f3.esm-PDJCDE95.js +0 -2469
- package/dist/Separator-4IIDRlV_.js +0 -322
- package/dist/Slider-rz2XRMGm.js +0 -853
- package/dist/Text-DVSAPY-K.js +0 -16
- package/dist/VisuallyHidden-f9zX67a_.js +0 -48
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
- package/dist/assets/index.css +0 -37
- package/dist/assets/style-admin.css +0 -5255
- package/dist/assets/style-editor.css +0 -5255
- package/dist/assets/style.css +0 -5261
- package/dist/assets/wp-font-enhancements.css +0 -8
- package/dist/assets/wp-ui-enhancements.css +0 -299
- package/dist/components/animated-visibility/animated-visibility.js +0 -105
- package/dist/components/base-control/base-control.js +0 -86
- package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
- package/dist/components/button/button.js +0 -387
- package/dist/components/checkbox/checkbox.js +0 -320
- package/dist/components/color-pickers/color-picker.js +0 -272
- package/dist/components/color-pickers/color-swatch.js +0 -58
- package/dist/components/color-pickers/gradient-editor.js +0 -534
- package/dist/components/color-pickers/solid-color-picker.js +0 -1567
- package/dist/components/component-toggle/component-toggle.js +0 -158
- package/dist/components/container-panel/container-panel.js +0 -131
- package/dist/components/draggable/draggable-context.js +0 -5
- package/dist/components/draggable/draggable-handle.js +0 -46
- package/dist/components/draggable/draggable.js +0 -6207
- package/dist/components/draggable-list/draggable-list-context.js +0 -5
- package/dist/components/draggable-list/draggable-list-item.js +0 -77
- package/dist/components/draggable-list/draggable-list.js +0 -151
- package/dist/components/expandable/expandable.js +0 -342
- package/dist/components/index.js +0 -137
- package/dist/components/input-field/input-field.js +0 -231
- package/dist/components/item-collection/item-collection.js +0 -59
- package/dist/components/layout/hstack.js +0 -30
- package/dist/components/layout/vstack.js +0 -30
- package/dist/components/link-input/link-input.js +0 -293
- package/dist/components/matrix-align/matrix-align.js +0 -134
- package/dist/components/menu/menu.js +0 -285
- package/dist/components/modal/modal.js +0 -305
- package/dist/components/notice/notice.js +0 -123
- package/dist/components/number-picker/number-picker.js +0 -292
- package/dist/components/option-select/option-select.js +0 -264
- package/dist/components/options-panel/options-panel.js +0 -158
- package/dist/components/placeholders/file-placeholder.js +0 -42
- package/dist/components/placeholders/image-placeholder.js +0 -88
- package/dist/components/placeholders/media-placeholder.js +0 -63
- package/dist/components/popover/popover.js +0 -207
- package/dist/components/radio/radio.js +0 -579
- package/dist/components/repeater/repeater-context.js +0 -5
- package/dist/components/repeater/repeater-item.js +0 -119
- package/dist/components/repeater/repeater.js +0 -280
- package/dist/components/responsive/mini-responsive.js +0 -498
- package/dist/components/responsive/responsive-legacy.js +0 -343
- package/dist/components/responsive/responsive.js +0 -580
- package/dist/components/responsive-preview/responsive-preview.js +0 -123
- package/dist/components/rich-label/rich-label.js +0 -66
- package/dist/components/select/async-multi-select.js +0 -157
- package/dist/components/select/async-single-select.js +0 -137
- package/dist/components/select/custom-select-default-components.js +0 -38
- package/dist/components/select/multi-select-components.js +0 -8
- package/dist/components/select/multi-select.js +0 -151
- package/dist/components/select/react-select-component-wrappers.js +0 -90
- package/dist/components/select/shared.js +0 -26
- package/dist/components/select/single-select.js +0 -131
- package/dist/components/select/styles.js +0 -49
- package/dist/components/select/v2/async-select.js +0 -297
- package/dist/components/select/v2/shared.js +0 -24
- package/dist/components/select/v2/single-select.js +0 -990
- package/dist/components/slider/column-config-slider.js +0 -210
- package/dist/components/slider/slider.js +0 -343
- package/dist/components/slider/utils.js +0 -84
- package/dist/components/spacer/spacer.js +0 -97
- package/dist/components/tabs/tabs.js +0 -702
- package/dist/components/toggle/switch.js +0 -155
- package/dist/components/toggle/toggle.js +0 -64
- package/dist/components/toggle-button/toggle-button.js +0 -324
- package/dist/components/tooltip/tooltip.js +0 -525
- package/dist/context-D2KUdwNL.js +0 -92
- package/dist/default-i18n-CT_oS1Fy.js +0 -922
- package/dist/filterDOMProps-EDDcM64A.js +0 -28
- package/dist/icons/block-icon.js +0 -42
- package/dist/icons/generic-color-swatch.js +0 -113
- package/dist/icons/icons.js +0 -30371
- package/dist/icons/index.js +0 -11
- package/dist/icons/jsx-svg.js +0 -50
- package/dist/index-641ee5b8.esm-DIuJijyT.js +0 -3137
- package/dist/index-BKGQ6jGS.js +0 -44
- package/dist/index-CFozsmNS.js +0 -28321
- package/dist/index.js +0 -139
- package/dist/lite-DVmmD_-j.js +0 -7
- package/dist/modifiers.esm-BuJQPI1X.js +0 -31
- package/dist/multi-select-components-Sp-JEFEX.js +0 -3744
- package/dist/number-GajL10e1.js +0 -36
- package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
- package/dist/react-select-async.esm-Bql4G5iV.js +0 -107
- package/dist/react-select.esm-B_TudhTU.js +0 -15
- package/dist/style-admin.js +0 -1
- package/dist/style-editor.js +0 -1
- package/dist/style.js +0 -1
- package/dist/textSelection-0UUS8Yfg.js +0 -46
- package/dist/useButton-Cg474OYB.js +0 -71
- package/dist/useEvent-B0b-6KBr.js +0 -23
- package/dist/useFocusRing-CV5l3lf6.js +0 -107
- package/dist/useFormReset-C5OggHsw.js +0 -22
- package/dist/useFormValidation-DhDNSjws.js +0 -224
- package/dist/useHover-DwDr6ozG.js +0 -900
- package/dist/useLabel-D7HkNEHT.js +0 -27
- package/dist/useLabels-D8cxd1Z8.js +0 -23
- package/dist/useListState-DVr6aYd_.js +0 -161
- package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
- package/dist/useNumberField-TwM0Z9D1.js +0 -1204
- package/dist/useNumberFormatter-321rAb4J.js +0 -13
- package/dist/usePress-Cucx-xSA.js +0 -664
- package/dist/useSingleSelectListState-CMGsRHHh.js +0 -38
- package/dist/useToggle-C0I3vs0g.js +0 -59
- package/dist/useToggleState-CmQX3SoX.js +0 -19
- package/dist/utilities/array-helpers.js +0 -56
- package/dist/utilities/debounce-throttle.js +0 -123
- package/dist/utilities/es-dash.js +0 -376
- package/dist/utilities/index.js +0 -27
- package/dist/utilities/text-helpers.js +0 -136
- package/dist/utils-DkCSC521.js +0 -370
- package/dist/wp/wp-font-enhancements.js +0 -1
- package/dist/wp/wp-ui-enhancements.js +0 -1
|
@@ -1,629 +0,0 @@
|
|
|
1
|
-
import { k as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "./utils-DkCSC521.js";
|
|
2
|
-
import { r as reactDomExports } from "./index-CFozsmNS.js";
|
|
3
|
-
import React__default, { useEffect, useState, useCallback, useRef, forwardRef, createContext } from "react";
|
|
4
|
-
import { B as $c87311424ea30a05$export$78551043582a6a98, b as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./useHover-DwDr6ozG.js";
|
|
5
|
-
import { a as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "./number-GajL10e1.js";
|
|
6
|
-
import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-D2KUdwNL.js";
|
|
7
|
-
function $9daab02d461809db$var$hasResizeObserver() {
|
|
8
|
-
return typeof window.ResizeObserver !== "undefined";
|
|
9
|
-
}
|
|
10
|
-
function $9daab02d461809db$export$683480f191c0e3ea(options) {
|
|
11
|
-
const { ref, box, onResize } = options;
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
let element = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
14
|
-
if (!element) return;
|
|
15
|
-
if (!$9daab02d461809db$var$hasResizeObserver()) {
|
|
16
|
-
window.addEventListener("resize", onResize, false);
|
|
17
|
-
return () => {
|
|
18
|
-
window.removeEventListener("resize", onResize, false);
|
|
19
|
-
};
|
|
20
|
-
} else {
|
|
21
|
-
const resizeObserverInstance = new window.ResizeObserver((entries) => {
|
|
22
|
-
if (!entries.length) return;
|
|
23
|
-
onResize();
|
|
24
|
-
});
|
|
25
|
-
resizeObserverInstance.observe(element, {
|
|
26
|
-
box
|
|
27
|
-
});
|
|
28
|
-
return () => {
|
|
29
|
-
if (element) resizeObserverInstance.unobserve(element);
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}, [
|
|
33
|
-
onResize,
|
|
34
|
-
ref,
|
|
35
|
-
box
|
|
36
|
-
]);
|
|
37
|
-
}
|
|
38
|
-
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
|
|
39
|
-
let [isEntering, setEntering] = useState(true);
|
|
40
|
-
let isAnimationReady = isEntering && isReady;
|
|
41
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
42
|
-
if (isAnimationReady && ref.current && "getAnimations" in ref.current) {
|
|
43
|
-
for (let animation of ref.current.getAnimations()) if (animation instanceof CSSTransition) animation.cancel();
|
|
44
|
-
}
|
|
45
|
-
}, [
|
|
46
|
-
ref,
|
|
47
|
-
isAnimationReady
|
|
48
|
-
]);
|
|
49
|
-
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));
|
|
50
|
-
return isAnimationReady;
|
|
51
|
-
}
|
|
52
|
-
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
|
|
53
|
-
let [exitState, setExitState] = useState(isOpen ? "open" : "closed");
|
|
54
|
-
switch (exitState) {
|
|
55
|
-
case "open":
|
|
56
|
-
if (!isOpen) setExitState("exiting");
|
|
57
|
-
break;
|
|
58
|
-
case "closed":
|
|
59
|
-
case "exiting":
|
|
60
|
-
if (isOpen) setExitState("open");
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
let isExiting = exitState === "exiting";
|
|
64
|
-
$d3f049242431219c$var$useAnimation(ref, isExiting, useCallback(() => {
|
|
65
|
-
setExitState((state) => state === "exiting" ? "closed" : state);
|
|
66
|
-
}, []));
|
|
67
|
-
return isExiting;
|
|
68
|
-
}
|
|
69
|
-
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
|
|
70
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
71
|
-
if (isActive && ref.current) {
|
|
72
|
-
if (!("getAnimations" in ref.current)) {
|
|
73
|
-
onEnd();
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
let animations = ref.current.getAnimations();
|
|
77
|
-
if (animations.length === 0) {
|
|
78
|
-
onEnd();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
let canceled = false;
|
|
82
|
-
Promise.all(animations.map((a) => a.finished)).then(() => {
|
|
83
|
-
if (!canceled) reactDomExports.flushSync(() => {
|
|
84
|
-
onEnd();
|
|
85
|
-
});
|
|
86
|
-
}).catch(() => {
|
|
87
|
-
});
|
|
88
|
-
return () => {
|
|
89
|
-
canceled = true;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}, [
|
|
93
|
-
ref,
|
|
94
|
-
isActive,
|
|
95
|
-
onEnd
|
|
96
|
-
]);
|
|
97
|
-
}
|
|
98
|
-
const $edcf132a9284368a$var$AXIS = {
|
|
99
|
-
top: "top",
|
|
100
|
-
bottom: "top",
|
|
101
|
-
left: "left",
|
|
102
|
-
right: "left"
|
|
103
|
-
};
|
|
104
|
-
const $edcf132a9284368a$var$FLIPPED_DIRECTION = {
|
|
105
|
-
top: "bottom",
|
|
106
|
-
bottom: "top",
|
|
107
|
-
left: "right",
|
|
108
|
-
right: "left"
|
|
109
|
-
};
|
|
110
|
-
const $edcf132a9284368a$var$CROSS_AXIS = {
|
|
111
|
-
top: "left",
|
|
112
|
-
left: "top"
|
|
113
|
-
};
|
|
114
|
-
const $edcf132a9284368a$var$AXIS_SIZE = {
|
|
115
|
-
top: "height",
|
|
116
|
-
left: "width"
|
|
117
|
-
};
|
|
118
|
-
const $edcf132a9284368a$var$TOTAL_SIZE = {
|
|
119
|
-
width: "totalWidth",
|
|
120
|
-
height: "totalHeight"
|
|
121
|
-
};
|
|
122
|
-
const $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
|
|
123
|
-
let $edcf132a9284368a$var$visualViewport = typeof document !== "undefined" ? window.visualViewport : null;
|
|
124
|
-
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
|
|
125
|
-
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
126
|
-
let scroll = {};
|
|
127
|
-
var _visualViewport_scale;
|
|
128
|
-
let isPinchZoomedIn = ((_visualViewport_scale = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.scale) !== null && _visualViewport_scale !== void 0 ? _visualViewport_scale : 1) > 1;
|
|
129
|
-
if (containerNode.tagName === "BODY") {
|
|
130
|
-
let documentElement = document.documentElement;
|
|
131
|
-
totalWidth = documentElement.clientWidth;
|
|
132
|
-
totalHeight = documentElement.clientHeight;
|
|
133
|
-
var _visualViewport_width;
|
|
134
|
-
width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
|
|
135
|
-
var _visualViewport_height;
|
|
136
|
-
height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
|
|
137
|
-
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
138
|
-
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
139
|
-
if ($edcf132a9284368a$var$visualViewport) {
|
|
140
|
-
top = $edcf132a9284368a$var$visualViewport.offsetTop;
|
|
141
|
-
left = $edcf132a9284368a$var$visualViewport.offsetLeft;
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
({ width, height, top, left } = $edcf132a9284368a$var$getOffset(containerNode));
|
|
145
|
-
scroll.top = containerNode.scrollTop;
|
|
146
|
-
scroll.left = containerNode.scrollLeft;
|
|
147
|
-
totalWidth = width;
|
|
148
|
-
totalHeight = height;
|
|
149
|
-
}
|
|
150
|
-
if ($c87311424ea30a05$export$78551043582a6a98() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) {
|
|
151
|
-
scroll.top = 0;
|
|
152
|
-
scroll.left = 0;
|
|
153
|
-
var _visualViewport_pageTop;
|
|
154
|
-
top = (_visualViewport_pageTop = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageTop) !== null && _visualViewport_pageTop !== void 0 ? _visualViewport_pageTop : 0;
|
|
155
|
-
var _visualViewport_pageLeft;
|
|
156
|
-
left = (_visualViewport_pageLeft = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.pageLeft) !== null && _visualViewport_pageLeft !== void 0 ? _visualViewport_pageLeft : 0;
|
|
157
|
-
}
|
|
158
|
-
return {
|
|
159
|
-
width,
|
|
160
|
-
height,
|
|
161
|
-
totalWidth,
|
|
162
|
-
totalHeight,
|
|
163
|
-
scroll,
|
|
164
|
-
top,
|
|
165
|
-
left
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
function $edcf132a9284368a$var$getScroll(node) {
|
|
169
|
-
return {
|
|
170
|
-
top: node.scrollTop,
|
|
171
|
-
left: node.scrollLeft,
|
|
172
|
-
width: node.scrollWidth,
|
|
173
|
-
height: node.scrollHeight
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function $edcf132a9284368a$var$getDelta(axis, offset, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) {
|
|
177
|
-
var _containerDimensions_scroll_axis;
|
|
178
|
-
let containerScroll = (_containerDimensions_scroll_axis = containerDimensions.scroll[axis]) !== null && _containerDimensions_scroll_axis !== void 0 ? _containerDimensions_scroll_axis : 0;
|
|
179
|
-
let boundarySize = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
|
|
180
|
-
let boundaryStartEdge = boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] + padding;
|
|
181
|
-
let boundaryEndEdge = boundarySize + boundaryDimensions.scroll[$edcf132a9284368a$var$AXIS[axis]] - padding;
|
|
182
|
-
let startEdgeOffset = offset - containerScroll + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
183
|
-
let endEdgeOffset = offset - containerScroll + size + containerOffsetWithBoundary[axis] - boundaryDimensions[$edcf132a9284368a$var$AXIS[axis]];
|
|
184
|
-
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
185
|
-
else if (endEdgeOffset > boundaryEndEdge) return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
186
|
-
else return 0;
|
|
187
|
-
}
|
|
188
|
-
function $edcf132a9284368a$var$getMargins(node) {
|
|
189
|
-
let style = window.getComputedStyle(node);
|
|
190
|
-
return {
|
|
191
|
-
top: parseInt(style.marginTop, 10) || 0,
|
|
192
|
-
bottom: parseInt(style.marginBottom, 10) || 0,
|
|
193
|
-
left: parseInt(style.marginLeft, 10) || 0,
|
|
194
|
-
right: parseInt(style.marginRight, 10) || 0
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
function $edcf132a9284368a$var$parsePlacement(input) {
|
|
198
|
-
if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input]) return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
199
|
-
let [placement, crossPlacement] = input.split(" ");
|
|
200
|
-
let axis = $edcf132a9284368a$var$AXIS[placement] || "right";
|
|
201
|
-
let crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
|
|
202
|
-
if (!$edcf132a9284368a$var$AXIS[crossPlacement]) crossPlacement = "center";
|
|
203
|
-
let size = $edcf132a9284368a$var$AXIS_SIZE[axis];
|
|
204
|
-
let crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
|
|
205
|
-
$edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
|
|
206
|
-
placement,
|
|
207
|
-
crossPlacement,
|
|
208
|
-
axis,
|
|
209
|
-
crossAxis,
|
|
210
|
-
size,
|
|
211
|
-
crossSize
|
|
212
|
-
};
|
|
213
|
-
return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
|
|
214
|
-
}
|
|
215
|
-
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
|
|
216
|
-
let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo;
|
|
217
|
-
let position = {};
|
|
218
|
-
var _childOffset_crossAxis;
|
|
219
|
-
position[crossAxis] = (_childOffset_crossAxis = childOffset[crossAxis]) !== null && _childOffset_crossAxis !== void 0 ? _childOffset_crossAxis : 0;
|
|
220
|
-
var _childOffset_crossSize, _overlaySize_crossSize, _childOffset_crossSize1, _overlaySize_crossSize1;
|
|
221
|
-
if (crossPlacement === "center")
|
|
222
|
-
position[crossAxis] += (((_childOffset_crossSize = childOffset[crossSize]) !== null && _childOffset_crossSize !== void 0 ? _childOffset_crossSize : 0) - ((_overlaySize_crossSize = overlaySize[crossSize]) !== null && _overlaySize_crossSize !== void 0 ? _overlaySize_crossSize : 0)) / 2;
|
|
223
|
-
else if (crossPlacement !== crossAxis)
|
|
224
|
-
position[crossAxis] += ((_childOffset_crossSize1 = childOffset[crossSize]) !== null && _childOffset_crossSize1 !== void 0 ? _childOffset_crossSize1 : 0) - ((_overlaySize_crossSize1 = overlaySize[crossSize]) !== null && _overlaySize_crossSize1 !== void 0 ? _overlaySize_crossSize1 : 0);
|
|
225
|
-
position[crossAxis] += crossOffset;
|
|
226
|
-
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
227
|
-
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
228
|
-
position[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(position[crossAxis], minPosition, maxPosition);
|
|
229
|
-
if (placement === axis) {
|
|
230
|
-
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
|
|
231
|
-
position[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
232
|
-
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
233
|
-
return position;
|
|
234
|
-
}
|
|
235
|
-
function $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection) {
|
|
236
|
-
const containerHeight = isContainerPositioned ? containerOffsetWithBoundary.height : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE.height];
|
|
237
|
-
var _position_bottom;
|
|
238
|
-
let overlayTop = position.top != null ? containerOffsetWithBoundary.top + position.top : containerOffsetWithBoundary.top + (containerHeight - ((_position_bottom = position.bottom) !== null && _position_bottom !== void 0 ? _position_bottom : 0) - overlayHeight);
|
|
239
|
-
var _boundaryDimensions_scroll_top, _margins_top, _margins_bottom, _boundaryDimensions_scroll_top1, _margins_top1, _margins_bottom1;
|
|
240
|
-
let maxHeight = heightGrowthDirection !== "top" ? (
|
|
241
|
-
// We want the distance between the top of the overlay to the bottom of the boundary
|
|
242
|
-
Math.max(0, boundaryDimensions.height + boundaryDimensions.top + ((_boundaryDimensions_scroll_top = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top !== void 0 ? _boundaryDimensions_scroll_top : 0) - overlayTop - (((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0) + padding))
|
|
243
|
-
) : Math.max(0, overlayTop + overlayHeight - (boundaryDimensions.top + ((_boundaryDimensions_scroll_top1 = boundaryDimensions.scroll.top) !== null && _boundaryDimensions_scroll_top1 !== void 0 ? _boundaryDimensions_scroll_top1 : 0)) - (((_margins_top1 = margins.top) !== null && _margins_top1 !== void 0 ? _margins_top1 : 0) + ((_margins_bottom1 = margins.bottom) !== null && _margins_bottom1 !== void 0 ? _margins_bottom1 : 0) + padding));
|
|
244
|
-
return Math.min(boundaryDimensions.height - padding * 2, maxHeight);
|
|
245
|
-
}
|
|
246
|
-
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
|
|
247
|
-
let { placement, axis, size } = placementInfo;
|
|
248
|
-
var _boundaryDimensions_scroll_axis, _margins_axis;
|
|
249
|
-
if (placement === axis) return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - ((_boundaryDimensions_scroll_axis = boundaryDimensions.scroll[axis]) !== null && _boundaryDimensions_scroll_axis !== void 0 ? _boundaryDimensions_scroll_axis : 0) + containerOffsetWithBoundary[axis] - ((_margins_axis = margins[axis]) !== null && _margins_axis !== void 0 ? _margins_axis : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
250
|
-
var _margins_axis1;
|
|
251
|
-
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - ((_margins_axis1 = margins[axis]) !== null && _margins_axis1 !== void 0 ? _margins_axis1 : 0) - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
252
|
-
}
|
|
253
|
-
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
|
|
254
|
-
let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
|
|
255
|
-
let { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo;
|
|
256
|
-
let position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
257
|
-
let normalizedOffset = offset;
|
|
258
|
-
let space = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
|
|
259
|
-
if (flip && scrollSize[size] > space) {
|
|
260
|
-
let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
261
|
-
let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
262
|
-
let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
|
|
263
|
-
if (flippedSpace > space) {
|
|
264
|
-
placementInfo = flippedPlacementInfo;
|
|
265
|
-
position = flippedPosition;
|
|
266
|
-
normalizedOffset = offset;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
let heightGrowthDirection = "bottom";
|
|
270
|
-
if (placementInfo.axis === "top") {
|
|
271
|
-
if (placementInfo.placement === "top") heightGrowthDirection = "top";
|
|
272
|
-
else if (placementInfo.placement === "bottom") heightGrowthDirection = "bottom";
|
|
273
|
-
} else if (placementInfo.crossAxis === "top") {
|
|
274
|
-
if (placementInfo.crossPlacement === "top") heightGrowthDirection = "bottom";
|
|
275
|
-
else if (placementInfo.crossPlacement === "bottom") heightGrowthDirection = "top";
|
|
276
|
-
}
|
|
277
|
-
let delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
278
|
-
position[crossAxis] += delta;
|
|
279
|
-
let maxHeight = $edcf132a9284368a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection);
|
|
280
|
-
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
281
|
-
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
282
|
-
position = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
|
|
283
|
-
delta = $edcf132a9284368a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
284
|
-
position[crossAxis] += delta;
|
|
285
|
-
let arrowPosition = {};
|
|
286
|
-
let preferredArrowPosition = childOffset[crossAxis] + 0.5 * childOffset[crossSize] - position[crossAxis] - margins[$edcf132a9284368a$var$AXIS[crossAxis]];
|
|
287
|
-
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
288
|
-
var _margins_left, _margins_right, _margins_top, _margins_bottom;
|
|
289
|
-
const overlayMargin = $edcf132a9284368a$var$AXIS[crossAxis] === "left" ? ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0) : ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
|
|
290
|
-
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
291
|
-
const arrowOverlappingChildMinEdge = childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]);
|
|
292
|
-
const arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$edcf132a9284368a$var$AXIS[crossAxis]]);
|
|
293
|
-
const arrowPositionOverlappingChild = $9446cca9a3875146$export$7d15b64cf5a3a4c4(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge);
|
|
294
|
-
arrowPosition[crossAxis] = $9446cca9a3875146$export$7d15b64cf5a3a4c4(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition);
|
|
295
|
-
return {
|
|
296
|
-
position,
|
|
297
|
-
maxHeight,
|
|
298
|
-
arrowOffsetLeft: arrowPosition.left,
|
|
299
|
-
arrowOffsetTop: arrowPosition.top,
|
|
300
|
-
placement: placementInfo.placement
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
|
|
304
|
-
let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts;
|
|
305
|
-
let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
306
|
-
let isViewportContainer = container === document.documentElement;
|
|
307
|
-
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
308
|
-
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
309
|
-
let childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
|
|
310
|
-
if (!isViewportContainer) {
|
|
311
|
-
let { marginTop, marginLeft } = window.getComputedStyle(targetNode);
|
|
312
|
-
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
313
|
-
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
314
|
-
}
|
|
315
|
-
let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode);
|
|
316
|
-
let margins = $edcf132a9284368a$var$getMargins(overlayNode);
|
|
317
|
-
var _margins_left, _margins_right;
|
|
318
|
-
overlaySize.width += ((_margins_left = margins.left) !== null && _margins_left !== void 0 ? _margins_left : 0) + ((_margins_right = margins.right) !== null && _margins_right !== void 0 ? _margins_right : 0);
|
|
319
|
-
var _margins_top, _margins_bottom;
|
|
320
|
-
overlaySize.height += ((_margins_top = margins.top) !== null && _margins_top !== void 0 ? _margins_top : 0) + ((_margins_bottom = margins.bottom) !== null && _margins_bottom !== void 0 ? _margins_bottom : 0);
|
|
321
|
-
let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
|
|
322
|
-
let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
|
|
323
|
-
let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
|
|
324
|
-
let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
|
|
325
|
-
if (container.tagName === "HTML" && boundaryElement.tagName === "BODY") {
|
|
326
|
-
containerDimensions.scroll.top = 0;
|
|
327
|
-
containerDimensions.scroll.left = 0;
|
|
328
|
-
}
|
|
329
|
-
return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
|
|
330
|
-
}
|
|
331
|
-
function $edcf132a9284368a$var$getOffset(node) {
|
|
332
|
-
let { top, left, width, height } = node.getBoundingClientRect();
|
|
333
|
-
let { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
|
|
334
|
-
return {
|
|
335
|
-
top: top + scrollTop - clientTop,
|
|
336
|
-
left: left + scrollLeft - clientLeft,
|
|
337
|
-
width,
|
|
338
|
-
height
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
function $edcf132a9284368a$var$getPosition(node, parent) {
|
|
342
|
-
let style = window.getComputedStyle(node);
|
|
343
|
-
let offset;
|
|
344
|
-
if (style.position === "fixed") {
|
|
345
|
-
let { top, left, width, height } = node.getBoundingClientRect();
|
|
346
|
-
offset = {
|
|
347
|
-
top,
|
|
348
|
-
left,
|
|
349
|
-
width,
|
|
350
|
-
height
|
|
351
|
-
};
|
|
352
|
-
} else {
|
|
353
|
-
offset = $edcf132a9284368a$var$getOffset(node);
|
|
354
|
-
let parentOffset = $edcf132a9284368a$var$getOffset(parent);
|
|
355
|
-
let parentStyle = window.getComputedStyle(parent);
|
|
356
|
-
parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop;
|
|
357
|
-
parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft;
|
|
358
|
-
offset.top -= parentOffset.top;
|
|
359
|
-
offset.left -= parentOffset.left;
|
|
360
|
-
}
|
|
361
|
-
offset.top -= parseInt(style.marginTop, 10) || 0;
|
|
362
|
-
offset.left -= parseInt(style.marginLeft, 10) || 0;
|
|
363
|
-
return offset;
|
|
364
|
-
}
|
|
365
|
-
function $edcf132a9284368a$var$getContainingBlock(node) {
|
|
366
|
-
let offsetParent = node.offsetParent;
|
|
367
|
-
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent)) offsetParent = document.documentElement;
|
|
368
|
-
if (offsetParent == null) {
|
|
369
|
-
offsetParent = node.parentElement;
|
|
370
|
-
while (offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent)) offsetParent = offsetParent.parentElement;
|
|
371
|
-
}
|
|
372
|
-
return offsetParent || document.documentElement;
|
|
373
|
-
}
|
|
374
|
-
function $edcf132a9284368a$var$isContainingBlock(node) {
|
|
375
|
-
let style = window.getComputedStyle(node);
|
|
376
|
-
return style.transform !== "none" || /transform|perspective/.test(style.willChange) || style.filter !== "none" || style.contain === "paint" || "backdropFilter" in style && style.backdropFilter !== "none" || "WebkitBackdropFilter" in style && style.WebkitBackdropFilter !== "none";
|
|
377
|
-
}
|
|
378
|
-
const $dd149f63282afbbf$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap();
|
|
379
|
-
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
|
|
380
|
-
let { triggerRef, isOpen, onClose } = opts;
|
|
381
|
-
useEffect(() => {
|
|
382
|
-
if (!isOpen || onClose === null) return;
|
|
383
|
-
let onScroll = (e) => {
|
|
384
|
-
let target = e.target;
|
|
385
|
-
if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current)) return;
|
|
386
|
-
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return;
|
|
387
|
-
let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
|
|
388
|
-
if (onCloseHandler) onCloseHandler();
|
|
389
|
-
};
|
|
390
|
-
window.addEventListener("scroll", onScroll, true);
|
|
391
|
-
return () => {
|
|
392
|
-
window.removeEventListener("scroll", onScroll, true);
|
|
393
|
-
};
|
|
394
|
-
}, [
|
|
395
|
-
isOpen,
|
|
396
|
-
onClose,
|
|
397
|
-
triggerRef
|
|
398
|
-
]);
|
|
399
|
-
}
|
|
400
|
-
let $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" ? window.visualViewport : null;
|
|
401
|
-
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
|
|
402
|
-
let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
403
|
-
let { arrowSize = 0, targetRef, overlayRef, scrollRef = overlayRef, placement = "bottom", containerPadding = 12, shouldFlip = true, boundaryElement = typeof document !== "undefined" ? document.body : null, offset = 0, crossOffset = 0, shouldUpdatePosition = true, isOpen = true, onClose, maxHeight, arrowBoundaryOffset = 0 } = props;
|
|
404
|
-
let [position, setPosition] = useState(null);
|
|
405
|
-
let deps = [
|
|
406
|
-
shouldUpdatePosition,
|
|
407
|
-
placement,
|
|
408
|
-
overlayRef.current,
|
|
409
|
-
targetRef.current,
|
|
410
|
-
scrollRef.current,
|
|
411
|
-
containerPadding,
|
|
412
|
-
shouldFlip,
|
|
413
|
-
boundaryElement,
|
|
414
|
-
offset,
|
|
415
|
-
crossOffset,
|
|
416
|
-
isOpen,
|
|
417
|
-
direction,
|
|
418
|
-
maxHeight,
|
|
419
|
-
arrowBoundaryOffset,
|
|
420
|
-
arrowSize
|
|
421
|
-
];
|
|
422
|
-
let lastScale = useRef($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale);
|
|
423
|
-
useEffect(() => {
|
|
424
|
-
if (isOpen) lastScale.current = $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale;
|
|
425
|
-
}, [
|
|
426
|
-
isOpen
|
|
427
|
-
]);
|
|
428
|
-
let updatePosition = useCallback(() => {
|
|
429
|
-
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) return;
|
|
430
|
-
if (($2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.scale) !== lastScale.current) return;
|
|
431
|
-
let anchor = null;
|
|
432
|
-
if (scrollRef.current && scrollRef.current.contains(document.activeElement)) {
|
|
433
|
-
var _document_activeElement;
|
|
434
|
-
let anchorRect = (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.getBoundingClientRect();
|
|
435
|
-
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
436
|
-
var _anchorRect_top;
|
|
437
|
-
anchor = {
|
|
438
|
-
type: "top",
|
|
439
|
-
offset: ((_anchorRect_top = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.top) !== null && _anchorRect_top !== void 0 ? _anchorRect_top : 0) - scrollRect.top
|
|
440
|
-
};
|
|
441
|
-
if (anchor.offset > scrollRect.height / 2) {
|
|
442
|
-
anchor.type = "bottom";
|
|
443
|
-
var _anchorRect_bottom;
|
|
444
|
-
anchor.offset = ((_anchorRect_bottom = anchorRect === null || anchorRect === void 0 ? void 0 : anchorRect.bottom) !== null && _anchorRect_bottom !== void 0 ? _anchorRect_bottom : 0) - scrollRect.bottom;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
let overlay = overlayRef.current;
|
|
448
|
-
if (!maxHeight && overlayRef.current) {
|
|
449
|
-
var _window_visualViewport;
|
|
450
|
-
overlay.style.top = "0px";
|
|
451
|
-
overlay.style.bottom = "";
|
|
452
|
-
var _window_visualViewport_height;
|
|
453
|
-
overlay.style.maxHeight = ((_window_visualViewport_height = (_window_visualViewport = window.visualViewport) === null || _window_visualViewport === void 0 ? void 0 : _window_visualViewport.height) !== null && _window_visualViewport_height !== void 0 ? _window_visualViewport_height : window.innerHeight) + "px";
|
|
454
|
-
}
|
|
455
|
-
let position2 = $edcf132a9284368a$export$b3ceb0cbf1056d98({
|
|
456
|
-
placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
|
|
457
|
-
overlayNode: overlayRef.current,
|
|
458
|
-
targetNode: targetRef.current,
|
|
459
|
-
scrollNode: scrollRef.current || overlayRef.current,
|
|
460
|
-
padding: containerPadding,
|
|
461
|
-
shouldFlip,
|
|
462
|
-
boundaryElement,
|
|
463
|
-
offset,
|
|
464
|
-
crossOffset,
|
|
465
|
-
maxHeight,
|
|
466
|
-
arrowSize,
|
|
467
|
-
arrowBoundaryOffset
|
|
468
|
-
});
|
|
469
|
-
if (!position2.position) return;
|
|
470
|
-
overlay.style.top = "";
|
|
471
|
-
overlay.style.bottom = "";
|
|
472
|
-
overlay.style.left = "";
|
|
473
|
-
overlay.style.right = "";
|
|
474
|
-
Object.keys(position2.position).forEach((key) => overlay.style[key] = position2.position[key] + "px");
|
|
475
|
-
overlay.style.maxHeight = position2.maxHeight != null ? position2.maxHeight + "px" : "";
|
|
476
|
-
if (anchor && document.activeElement && scrollRef.current) {
|
|
477
|
-
let anchorRect = document.activeElement.getBoundingClientRect();
|
|
478
|
-
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
479
|
-
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
480
|
-
scrollRef.current.scrollTop += newOffset - anchor.offset;
|
|
481
|
-
}
|
|
482
|
-
setPosition(position2);
|
|
483
|
-
}, deps);
|
|
484
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updatePosition, deps);
|
|
485
|
-
$2a41e45df1593e64$var$useResize(updatePosition);
|
|
486
|
-
$9daab02d461809db$export$683480f191c0e3ea({
|
|
487
|
-
ref: overlayRef,
|
|
488
|
-
onResize: updatePosition
|
|
489
|
-
});
|
|
490
|
-
$9daab02d461809db$export$683480f191c0e3ea({
|
|
491
|
-
ref: targetRef,
|
|
492
|
-
onResize: updatePosition
|
|
493
|
-
});
|
|
494
|
-
let isResizing = useRef(false);
|
|
495
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
496
|
-
let timeout;
|
|
497
|
-
let onResize = () => {
|
|
498
|
-
isResizing.current = true;
|
|
499
|
-
clearTimeout(timeout);
|
|
500
|
-
timeout = setTimeout(() => {
|
|
501
|
-
isResizing.current = false;
|
|
502
|
-
}, 500);
|
|
503
|
-
updatePosition();
|
|
504
|
-
};
|
|
505
|
-
let onScroll = () => {
|
|
506
|
-
if (isResizing.current) onResize();
|
|
507
|
-
};
|
|
508
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("resize", onResize);
|
|
509
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("scroll", onScroll);
|
|
510
|
-
return () => {
|
|
511
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener("resize", onResize);
|
|
512
|
-
$2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener("scroll", onScroll);
|
|
513
|
-
};
|
|
514
|
-
}, [
|
|
515
|
-
updatePosition
|
|
516
|
-
]);
|
|
517
|
-
let close = useCallback(() => {
|
|
518
|
-
if (!isResizing.current) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
519
|
-
}, [
|
|
520
|
-
onClose,
|
|
521
|
-
isResizing
|
|
522
|
-
]);
|
|
523
|
-
$dd149f63282afbbf$export$18fc8428861184da({
|
|
524
|
-
triggerRef: targetRef,
|
|
525
|
-
isOpen,
|
|
526
|
-
onClose: onClose && close
|
|
527
|
-
});
|
|
528
|
-
var _position_maxHeight, _position_placement;
|
|
529
|
-
return {
|
|
530
|
-
overlayProps: {
|
|
531
|
-
style: {
|
|
532
|
-
position: "absolute",
|
|
533
|
-
zIndex: 1e5,
|
|
534
|
-
...position === null || position === void 0 ? void 0 : position.position,
|
|
535
|
-
maxHeight: (_position_maxHeight = position === null || position === void 0 ? void 0 : position.maxHeight) !== null && _position_maxHeight !== void 0 ? _position_maxHeight : "100vh"
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
placement: (_position_placement = position === null || position === void 0 ? void 0 : position.placement) !== null && _position_placement !== void 0 ? _position_placement : null,
|
|
539
|
-
arrowProps: {
|
|
540
|
-
"aria-hidden": "true",
|
|
541
|
-
role: "presentation",
|
|
542
|
-
style: {
|
|
543
|
-
left: position === null || position === void 0 ? void 0 : position.arrowOffsetLeft,
|
|
544
|
-
top: position === null || position === void 0 ? void 0 : position.arrowOffsetTop
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
updatePosition
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
function $2a41e45df1593e64$var$useResize(onResize) {
|
|
551
|
-
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
552
|
-
window.addEventListener("resize", onResize, false);
|
|
553
|
-
return () => {
|
|
554
|
-
window.removeEventListener("resize", onResize, false);
|
|
555
|
-
};
|
|
556
|
-
}, [
|
|
557
|
-
onResize
|
|
558
|
-
]);
|
|
559
|
-
}
|
|
560
|
-
function $2a41e45df1593e64$var$translateRTL(position, direction) {
|
|
561
|
-
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
562
|
-
return position.replace("start", "left").replace("end", "right");
|
|
563
|
-
}
|
|
564
|
-
function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
|
|
565
|
-
let [isOpen, setOpen] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
|
566
|
-
const open = useCallback(() => {
|
|
567
|
-
setOpen(true);
|
|
568
|
-
}, [
|
|
569
|
-
setOpen
|
|
570
|
-
]);
|
|
571
|
-
const close = useCallback(() => {
|
|
572
|
-
setOpen(false);
|
|
573
|
-
}, [
|
|
574
|
-
setOpen
|
|
575
|
-
]);
|
|
576
|
-
const toggle = useCallback(() => {
|
|
577
|
-
setOpen(!isOpen);
|
|
578
|
-
}, [
|
|
579
|
-
setOpen,
|
|
580
|
-
isOpen
|
|
581
|
-
]);
|
|
582
|
-
return {
|
|
583
|
-
isOpen,
|
|
584
|
-
setOpen,
|
|
585
|
-
open,
|
|
586
|
-
close,
|
|
587
|
-
toggle
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
const $44f671af83e7d9e0$export$2de4954e8ae13b9f = /* @__PURE__ */ createContext({
|
|
591
|
-
placement: "bottom"
|
|
592
|
-
});
|
|
593
|
-
const $44f671af83e7d9e0$export$746d02f47f4d381 = /* @__PURE__ */ forwardRef(function OverlayArrow(props, ref) {
|
|
594
|
-
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $44f671af83e7d9e0$export$2de4954e8ae13b9f);
|
|
595
|
-
let placement = props.placement;
|
|
596
|
-
let style = {
|
|
597
|
-
position: "absolute",
|
|
598
|
-
transform: placement === "top" || placement === "bottom" ? "translateX(-50%)" : "translateY(-50%)"
|
|
599
|
-
};
|
|
600
|
-
if (placement != null) style[placement] = "100%";
|
|
601
|
-
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
602
|
-
...props,
|
|
603
|
-
defaultClassName: "react-aria-OverlayArrow",
|
|
604
|
-
values: {
|
|
605
|
-
placement
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
if (renderProps.style) Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]);
|
|
609
|
-
return /* @__PURE__ */ React__default.createElement("div", {
|
|
610
|
-
...props,
|
|
611
|
-
...renderProps,
|
|
612
|
-
style: {
|
|
613
|
-
...style,
|
|
614
|
-
...renderProps.style
|
|
615
|
-
},
|
|
616
|
-
ref,
|
|
617
|
-
"data-placement": placement
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
export {
|
|
621
|
-
$fc909762b330b746$export$61c6a8c84e605fb6 as $,
|
|
622
|
-
$d3f049242431219c$export$45fda7c47f93fd48 as a,
|
|
623
|
-
$d3f049242431219c$export$6d3443f2c48bfc20 as b,
|
|
624
|
-
$2a41e45df1593e64$export$d39e1813b3bdd0e1 as c,
|
|
625
|
-
$44f671af83e7d9e0$export$2de4954e8ae13b9f as d,
|
|
626
|
-
$44f671af83e7d9e0$export$746d02f47f4d381 as e,
|
|
627
|
-
$9daab02d461809db$export$683480f191c0e3ea as f,
|
|
628
|
-
$dd149f63282afbbf$export$f6211563215e3b37 as g
|
|
629
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
2
|
-
const $4e85f108e88277b8$export$b085522c77523c51 = createContext(null);
|
|
3
|
-
const $4e85f108e88277b8$export$ebe63fadcdce34ed = createContext(null);
|
|
4
|
-
const $4e85f108e88277b8$export$44644b8a16031b5b = createContext(null);
|
|
5
|
-
const $4e85f108e88277b8$export$717b2c0a523a0b53 = createContext(null);
|
|
6
|
-
createContext(null);
|
|
7
|
-
const $4e85f108e88277b8$export$d688439359537581 = createContext({});
|
|
8
|
-
export {
|
|
9
|
-
$4e85f108e88277b8$export$d688439359537581 as $,
|
|
10
|
-
$4e85f108e88277b8$export$b085522c77523c51 as a,
|
|
11
|
-
$4e85f108e88277b8$export$ebe63fadcdce34ed as b,
|
|
12
|
-
$4e85f108e88277b8$export$44644b8a16031b5b as c,
|
|
13
|
-
$4e85f108e88277b8$export$717b2c0a523a0b53 as d
|
|
14
|
-
};
|