@wix/editor-react-components 1.2310.0 → 1.2311.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/site/components/AudioPlayer/component.js +3 -4
- package/dist/site/components/Breadcrumbs/component.js +1 -1
- package/dist/site/components/Button/component.js +1 -1
- package/dist/site/components/CollapsibleText/component.js +1 -1
- package/dist/site/components/DatePicker/component.js +8 -965
- package/dist/site/components/Lottie/component.js +1 -1
- package/dist/site/components/Menu/component.js +1 -1
- package/dist/site/components/Slideshow/component.js +1 -1
- package/dist/site/components/TextInput/component.js +2 -3
- package/dist/site/components/TextMarquee/component.js +6 -6
- package/dist/site/components/TimePicker/TimePicker.types.d.ts +31 -0
- package/dist/site/components/TimePicker/component.js +119 -17
- package/dist/site/components/TimePicker/constants.d.ts +63 -1
- package/dist/site/components/TimePicker/css.css +126 -0
- package/dist/site/components/TimePicker/hooks/useTimeConstraints.d.ts +8 -0
- package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +2 -1
- package/dist/site/components/TimePicker/manifest.js +142 -3
- package/dist/site/components/TimePicker/timePickerUtils.d.ts +2 -0
- package/dist/site/components/chunks/Button.js +1057 -347
- package/dist/site/components/chunks/Button2.js +351 -285
- package/dist/site/components/chunks/Group.js +160 -47
- package/dist/site/components/chunks/Input.js +14 -14
- package/dist/site/components/chunks/{DateField.js → Tooltip.js} +1017 -52
- package/dist/site/components/chunks/VisuallyHidden.js +47 -0
- package/dist/site/components/chunks/constants2.js +62 -4
- package/dist/site/components/chunks/filterDOMProps.js +3 -3
- package/package.json +2 -2
- package/dist/site/components/chunks/useFocusable.js +0 -118
- package/dist/site/components/chunks/usePress.js +0 -825
|
@@ -3,13 +3,74 @@ var __typeError = (msg) => {
|
|
|
3
3
|
};
|
|
4
4
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
5
5
|
var _type, _type2, _type3, _type4;
|
|
6
|
-
import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, b as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$fabf2dc03a41866e, d as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, e as $64fa3d84918910a7$export$ef03459518577ad4, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, h as $64fa3d84918910a7$export$2881499e37b75b9a,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import React__default, { useRef, useContext, useMemo, useEffect,
|
|
6
|
+
import { i as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, j as $c7eafbbe1ea5834e$export$535bd6ca7f90a273, b as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$fabf2dc03a41866e, d as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, e as $64fa3d84918910a7$export$ef03459518577ad4, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, h as $64fa3d84918910a7$export$2881499e37b75b9a, k as $df56164dff5785e2$export$4338b53315abf666 } from "./filterDOMProps.js";
|
|
7
|
+
import { b as $191c9b6d48a0a4e2$export$294aa081a6c6f55d, c as $860f7da480e22816$export$b8473d3665f3a75a, i as $fd2148440a13ec26$export$75ee7c75d68f5b0e, j as $fd2148440a13ec26$export$aca958c65c314e6c, a as $fd2148440a13ec26$export$fc1a364ae1f3ff10, d as $d3e0e05bdfcf66bd$export$c24727297075ec6a, e as $3985021b0ad6602f$export$37fb8590cf2c088c, f as $514c0188e459b4c0$export$9afb8bc826b033ea, g as $ee014567cb39d3f0$export$ff05c3ac10437e03, h as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "./Input.js";
|
|
8
|
+
import { C as $6a20a7989e6c817a$export$98658e8c59125e6a, q as $23f2114a1b82827e$export$4282f70798064fe0, D as $23f2114a1b82827e$export$cd4e5573fbe2b576, j as $d447af545b77c9f1$export$b204af158042fbac, E as $3b8b240c1bf84ab9$export$bebd5a1431fec25d, F as $3b8b240c1bf84ab9$export$4c063cf1350e6fed, G as $f192c2f16961cbe0$export$80f3e147d781571c, H as $c4867b2f328c2698$export$e5c5a5f917a5871c, l as $d447af545b77c9f1$export$f21a1ffae260145a, f as $23f2114a1b82827e$export$e58f029f0fbfdb29, I as $2add3ce32c6007eb$export$a11b0059900ceec8, J as $2add3ce32c6007eb$export$6446a186d09e379e, K as $8f5a2122b0992be3$export$630ff653c5ada6a9, n as $fe16bffc7a557bf0$export$7f54fc3180508a52, i as $2add3ce32c6007eb$export$fedb369cb70207f1, m as $48a7d519b337145d$export$4eaf04e54aa8eed6, e as $bbaa08b3cd72f041$export$9d1611c77c2fe928, L as $2c9edc598a03d523$export$420e68273165f4ec, d as $3274bf1495747a7b$export$5add1d006293d136, B as $390e54f620492c70$export$f680877a34711e37, M as $e8ac3c3f5d4bae7f$export$d6875122194c7b44, y as $2add3ce32c6007eb$export$9ac100e40613ea10, N as $2add3ce32c6007eb$export$78551043582a6a98, O as $23f2114a1b82827e$export$b4f377a2b6254582, A as $e969f22b6713ca4a$export$ae780daf29e6d456, c as $d1116acdf220c2da$export$4c014de7c8940b4c, P as $8f5a2122b0992be3$export$b9b3dfddab17db27, b as $3e6197669829fe11$export$40bfa8c7b0832715, h as $a049562f99e7db0e$export$f9c6924e160136d1, g as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, z as $0c4a58759813079a$export$4e328f61c538687f, Q as $d1116acdf220c2da$export$13f3202a3e5ddd5 } from "./Group.js";
|
|
9
|
+
import React__default, { useState, useCallback, useRef, useContext, useMemo, useEffect, createContext, forwardRef, cloneElement } from "react";
|
|
10
10
|
import { a as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider.js";
|
|
11
|
-
import {
|
|
11
|
+
import { a as $1dfb119a85e764e5$export$cc77c4ff7e8673c5, b as $d27d541f9569d26d$export$45712eceda6fad21, c as $240e9101ba2842f5$export$7d15b64cf5a3a4c4 } from "./Button.js";
|
|
12
12
|
import { $ as $cf2482eff2eeeec2$export$f12b703ca79dfbb1, a as $cf2482eff2eeeec2$export$87b761675e8eaa10, b as $a747a10fe70a57da$export$c17fa47878dc55b6, c as $b27c684a33948c64$export$2f817fcdc4b89ae0 } from "./useLocalizedStringFormatter.js";
|
|
13
|
+
import __rspack_external_react_dom_7136dc57__default, { flushSync } from "react-dom";
|
|
14
|
+
function $d3f049242431219c$export$6d3443f2c48bfc20(ref, isReady = true) {
|
|
15
|
+
let [isEntering, setEntering] = useState(true);
|
|
16
|
+
let isAnimationReady = isEntering && isReady;
|
|
17
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
18
|
+
if (isAnimationReady && ref.current && "getAnimations" in ref.current) {
|
|
19
|
+
for (let animation of ref.current.getAnimations()) if (animation instanceof CSSTransition) animation.cancel();
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
ref,
|
|
23
|
+
isAnimationReady
|
|
24
|
+
]);
|
|
25
|
+
$d3f049242431219c$var$useAnimation(ref, isAnimationReady, useCallback(() => setEntering(false), []));
|
|
26
|
+
return isAnimationReady;
|
|
27
|
+
}
|
|
28
|
+
function $d3f049242431219c$export$45fda7c47f93fd48(ref, isOpen) {
|
|
29
|
+
let [exitState, setExitState] = useState(isOpen ? "open" : "closed");
|
|
30
|
+
switch (exitState) {
|
|
31
|
+
case "open":
|
|
32
|
+
if (!isOpen) setExitState("exiting");
|
|
33
|
+
break;
|
|
34
|
+
case "closed":
|
|
35
|
+
case "exiting":
|
|
36
|
+
if (isOpen) setExitState("open");
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
let isExiting = exitState === "exiting";
|
|
40
|
+
$d3f049242431219c$var$useAnimation(ref, isExiting, useCallback(() => {
|
|
41
|
+
setExitState((state) => state === "exiting" ? "closed" : state);
|
|
42
|
+
}, []));
|
|
43
|
+
return isExiting;
|
|
44
|
+
}
|
|
45
|
+
function $d3f049242431219c$var$useAnimation(ref, isActive, onEnd) {
|
|
46
|
+
$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
47
|
+
if (isActive && ref.current) {
|
|
48
|
+
if (!("getAnimations" in ref.current)) {
|
|
49
|
+
onEnd();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
let animations = ref.current.getAnimations();
|
|
53
|
+
if (animations.length === 0) {
|
|
54
|
+
onEnd();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
let canceled = false;
|
|
58
|
+
Promise.all(animations.map((a) => a.finished)).then(() => {
|
|
59
|
+
if (!canceled) flushSync(() => {
|
|
60
|
+
onEnd();
|
|
61
|
+
});
|
|
62
|
+
}).catch(() => {
|
|
63
|
+
});
|
|
64
|
+
return () => {
|
|
65
|
+
canceled = true;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}, [
|
|
69
|
+
ref,
|
|
70
|
+
isActive,
|
|
71
|
+
onEnd
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
13
74
|
function $09ec6a572d60460f$export$842a2cf37af977e1(amount, numerator) {
|
|
14
75
|
return amount - numerator * Math.floor(amount / numerator);
|
|
15
76
|
}
|
|
@@ -3743,6 +3804,28 @@ function $757ec6630f26125c$export$e908e06f4b8e3402(props) {
|
|
|
3743
3804
|
}
|
|
3744
3805
|
};
|
|
3745
3806
|
}
|
|
3807
|
+
const $22e2f5f6490788e8$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap();
|
|
3808
|
+
function $22e2f5f6490788e8$export$18fc8428861184da(opts) {
|
|
3809
|
+
let { triggerRef, isOpen, onClose } = opts;
|
|
3810
|
+
useEffect(() => {
|
|
3811
|
+
if (!isOpen || onClose === null) return;
|
|
3812
|
+
let onScroll = (e) => {
|
|
3813
|
+
let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
3814
|
+
if (!triggerRef.current || target instanceof Node && !$23f2114a1b82827e$export$4282f70798064fe0(target, triggerRef.current)) return;
|
|
3815
|
+
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;
|
|
3816
|
+
let onCloseHandler = onClose || $22e2f5f6490788e8$export$f6211563215e3b37.get(triggerRef.current);
|
|
3817
|
+
if (onCloseHandler) onCloseHandler();
|
|
3818
|
+
};
|
|
3819
|
+
window.addEventListener("scroll", onScroll, true);
|
|
3820
|
+
return () => {
|
|
3821
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
3822
|
+
};
|
|
3823
|
+
}, [
|
|
3824
|
+
isOpen,
|
|
3825
|
+
onClose,
|
|
3826
|
+
triggerRef
|
|
3827
|
+
]);
|
|
3828
|
+
}
|
|
3746
3829
|
var $0184ae2f3e9694a3$exports = {};
|
|
3747
3830
|
$0184ae2f3e9694a3$exports = {
|
|
3748
3831
|
"calendar": `التقويم`,
|
|
@@ -5028,6 +5111,691 @@ function $d51706f903be7eab$var$commonPrefixLength(strings) {
|
|
|
5028
5111
|
}
|
|
5029
5112
|
return 0;
|
|
5030
5113
|
}
|
|
5114
|
+
const $72abaeab4d80592f$export$60d741e20e0aa309 = /* @__PURE__ */ createContext({});
|
|
5115
|
+
function $72abaeab4d80592f$export$9fc1347d4195ccb3() {
|
|
5116
|
+
return useContext($72abaeab4d80592f$export$60d741e20e0aa309) ?? {};
|
|
5117
|
+
}
|
|
5118
|
+
function $970072cf4b13fde3$var$hasResizeObserver() {
|
|
5119
|
+
return typeof window.ResizeObserver !== "undefined";
|
|
5120
|
+
}
|
|
5121
|
+
function $970072cf4b13fde3$export$683480f191c0e3ea(options) {
|
|
5122
|
+
const { ref, box, onResize } = options;
|
|
5123
|
+
let onResizeEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(onResize);
|
|
5124
|
+
useEffect(() => {
|
|
5125
|
+
let element = ref == null ? void 0 : ref.current;
|
|
5126
|
+
if (!element) return;
|
|
5127
|
+
if (!$970072cf4b13fde3$var$hasResizeObserver()) {
|
|
5128
|
+
window.addEventListener("resize", onResizeEvent, false);
|
|
5129
|
+
return () => {
|
|
5130
|
+
window.removeEventListener("resize", onResizeEvent, false);
|
|
5131
|
+
};
|
|
5132
|
+
} else {
|
|
5133
|
+
const resizeObserverInstance = new window.ResizeObserver((entries) => {
|
|
5134
|
+
if (!entries.length) return;
|
|
5135
|
+
onResizeEvent();
|
|
5136
|
+
});
|
|
5137
|
+
resizeObserverInstance.observe(element, {
|
|
5138
|
+
box
|
|
5139
|
+
});
|
|
5140
|
+
return () => {
|
|
5141
|
+
if (element) resizeObserverInstance.unobserve(element);
|
|
5142
|
+
};
|
|
5143
|
+
}
|
|
5144
|
+
}, [
|
|
5145
|
+
ref,
|
|
5146
|
+
box
|
|
5147
|
+
]);
|
|
5148
|
+
}
|
|
5149
|
+
const $c07df45195231803$var$Context = /* @__PURE__ */ React__default.createContext(null);
|
|
5150
|
+
function $c07df45195231803$export$178405afcd8c5eb(props) {
|
|
5151
|
+
let { children } = props;
|
|
5152
|
+
let parent = useContext($c07df45195231803$var$Context);
|
|
5153
|
+
let [modalCount, setModalCount] = useState(0);
|
|
5154
|
+
let context = useMemo(() => ({
|
|
5155
|
+
parent,
|
|
5156
|
+
modalCount,
|
|
5157
|
+
addModal() {
|
|
5158
|
+
setModalCount((count) => count + 1);
|
|
5159
|
+
if (parent) parent.addModal();
|
|
5160
|
+
},
|
|
5161
|
+
removeModal() {
|
|
5162
|
+
setModalCount((count) => count - 1);
|
|
5163
|
+
if (parent) parent.removeModal();
|
|
5164
|
+
}
|
|
5165
|
+
}), [
|
|
5166
|
+
parent,
|
|
5167
|
+
modalCount
|
|
5168
|
+
]);
|
|
5169
|
+
return /* @__PURE__ */ React__default.createElement($c07df45195231803$var$Context.Provider, {
|
|
5170
|
+
value: context
|
|
5171
|
+
}, children);
|
|
5172
|
+
}
|
|
5173
|
+
function $c07df45195231803$export$d9aaed4c3ece1bc0() {
|
|
5174
|
+
let context = useContext($c07df45195231803$var$Context);
|
|
5175
|
+
return {
|
|
5176
|
+
modalProviderProps: {
|
|
5177
|
+
"aria-hidden": context && context.modalCount > 0 ? true : void 0
|
|
5178
|
+
}
|
|
5179
|
+
};
|
|
5180
|
+
}
|
|
5181
|
+
function $c07df45195231803$var$OverlayContainerDOM(props) {
|
|
5182
|
+
let { modalProviderProps } = $c07df45195231803$export$d9aaed4c3ece1bc0();
|
|
5183
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
5184
|
+
"data-overlay-container": true,
|
|
5185
|
+
...props,
|
|
5186
|
+
...modalProviderProps
|
|
5187
|
+
});
|
|
5188
|
+
}
|
|
5189
|
+
function $c07df45195231803$export$bf688221f59024e5(props) {
|
|
5190
|
+
return /* @__PURE__ */ React__default.createElement($c07df45195231803$export$178405afcd8c5eb, null, /* @__PURE__ */ React__default.createElement($c07df45195231803$var$OverlayContainerDOM, props));
|
|
5191
|
+
}
|
|
5192
|
+
function $c07df45195231803$export$b47c3594eab58386(props) {
|
|
5193
|
+
let isSSR = $c7eafbbe1ea5834e$export$535bd6ca7f90a273();
|
|
5194
|
+
let { portalContainer = isSSR ? null : document.body, ...rest } = props;
|
|
5195
|
+
let { getContainer } = $72abaeab4d80592f$export$9fc1347d4195ccb3();
|
|
5196
|
+
if (!props.portalContainer && getContainer) portalContainer = getContainer();
|
|
5197
|
+
React__default.useEffect(() => {
|
|
5198
|
+
if (portalContainer == null ? void 0 : portalContainer.closest("[data-overlay-container]")) throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.");
|
|
5199
|
+
}, [
|
|
5200
|
+
portalContainer
|
|
5201
|
+
]);
|
|
5202
|
+
if (!portalContainer) return null;
|
|
5203
|
+
let contents = /* @__PURE__ */ React__default.createElement($c07df45195231803$export$bf688221f59024e5, rest);
|
|
5204
|
+
return /* @__PURE__ */ __rspack_external_react_dom_7136dc57__default.createPortal(contents, portalContainer);
|
|
5205
|
+
}
|
|
5206
|
+
const $954926fb6168ae2a$var$AXIS = {
|
|
5207
|
+
top: "top",
|
|
5208
|
+
bottom: "top",
|
|
5209
|
+
left: "left",
|
|
5210
|
+
right: "left"
|
|
5211
|
+
};
|
|
5212
|
+
const $954926fb6168ae2a$var$FLIPPED_DIRECTION = {
|
|
5213
|
+
top: "bottom",
|
|
5214
|
+
bottom: "top",
|
|
5215
|
+
left: "right",
|
|
5216
|
+
right: "left"
|
|
5217
|
+
};
|
|
5218
|
+
const $954926fb6168ae2a$var$CROSS_AXIS = {
|
|
5219
|
+
top: "left",
|
|
5220
|
+
left: "top"
|
|
5221
|
+
};
|
|
5222
|
+
const $954926fb6168ae2a$var$AXIS_SIZE = {
|
|
5223
|
+
top: "height",
|
|
5224
|
+
left: "width"
|
|
5225
|
+
};
|
|
5226
|
+
const $954926fb6168ae2a$var$TOTAL_SIZE = {
|
|
5227
|
+
width: "totalWidth",
|
|
5228
|
+
height: "totalHeight"
|
|
5229
|
+
};
|
|
5230
|
+
const $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE = {};
|
|
5231
|
+
let $954926fb6168ae2a$var$getVisualViewport = () => typeof document !== "undefined" ? window.visualViewport : null;
|
|
5232
|
+
function $954926fb6168ae2a$var$getContainerDimensions(containerNode, visualViewport) {
|
|
5233
|
+
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
5234
|
+
let scroll = {};
|
|
5235
|
+
let isPinchZoomedIn = ((visualViewport == null ? void 0 : visualViewport.scale) ?? 1) > 1;
|
|
5236
|
+
if (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") {
|
|
5237
|
+
let documentElement = document.documentElement;
|
|
5238
|
+
totalWidth = documentElement.clientWidth;
|
|
5239
|
+
totalHeight = documentElement.clientHeight;
|
|
5240
|
+
width = (visualViewport == null ? void 0 : visualViewport.width) ?? totalWidth;
|
|
5241
|
+
height = (visualViewport == null ? void 0 : visualViewport.height) ?? totalHeight;
|
|
5242
|
+
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
5243
|
+
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
5244
|
+
if (visualViewport) {
|
|
5245
|
+
top = visualViewport.offsetTop;
|
|
5246
|
+
left = visualViewport.offsetLeft;
|
|
5247
|
+
}
|
|
5248
|
+
} else {
|
|
5249
|
+
({ width, height, top, left } = $954926fb6168ae2a$var$getOffset(containerNode, false));
|
|
5250
|
+
scroll.top = containerNode.scrollTop;
|
|
5251
|
+
scroll.left = containerNode.scrollLeft;
|
|
5252
|
+
totalWidth = width;
|
|
5253
|
+
totalHeight = height;
|
|
5254
|
+
}
|
|
5255
|
+
if ($2add3ce32c6007eb$export$78551043582a6a98() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) {
|
|
5256
|
+
scroll.top = 0;
|
|
5257
|
+
scroll.left = 0;
|
|
5258
|
+
top = (visualViewport == null ? void 0 : visualViewport.pageTop) ?? 0;
|
|
5259
|
+
left = (visualViewport == null ? void 0 : visualViewport.pageLeft) ?? 0;
|
|
5260
|
+
}
|
|
5261
|
+
return {
|
|
5262
|
+
width,
|
|
5263
|
+
height,
|
|
5264
|
+
totalWidth,
|
|
5265
|
+
totalHeight,
|
|
5266
|
+
scroll,
|
|
5267
|
+
top,
|
|
5268
|
+
left
|
|
5269
|
+
};
|
|
5270
|
+
}
|
|
5271
|
+
function $954926fb6168ae2a$var$getScroll(node) {
|
|
5272
|
+
return {
|
|
5273
|
+
top: node.scrollTop,
|
|
5274
|
+
left: node.scrollLeft,
|
|
5275
|
+
width: node.scrollWidth,
|
|
5276
|
+
height: node.scrollHeight
|
|
5277
|
+
};
|
|
5278
|
+
}
|
|
5279
|
+
function $954926fb6168ae2a$var$getDelta(axis, offset, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) {
|
|
5280
|
+
let containerScroll = containerDimensions.scroll[axis] ?? 0;
|
|
5281
|
+
let boundarySize = boundaryDimensions[$954926fb6168ae2a$var$AXIS_SIZE[axis]];
|
|
5282
|
+
let boundaryStartEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + padding;
|
|
5283
|
+
let boundaryEndEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + boundarySize - padding;
|
|
5284
|
+
let startEdgeOffset = offset - containerScroll + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$954926fb6168ae2a$var$AXIS[axis]];
|
|
5285
|
+
let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$954926fb6168ae2a$var$AXIS[axis]];
|
|
5286
|
+
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
5287
|
+
else if (endEdgeOffset > boundaryEndEdge) return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
5288
|
+
else return 0;
|
|
5289
|
+
}
|
|
5290
|
+
function $954926fb6168ae2a$var$getMargins(node) {
|
|
5291
|
+
let style = window.getComputedStyle(node);
|
|
5292
|
+
return {
|
|
5293
|
+
top: parseInt(style.marginTop, 10) || 0,
|
|
5294
|
+
bottom: parseInt(style.marginBottom, 10) || 0,
|
|
5295
|
+
left: parseInt(style.marginLeft, 10) || 0,
|
|
5296
|
+
right: parseInt(style.marginRight, 10) || 0
|
|
5297
|
+
};
|
|
5298
|
+
}
|
|
5299
|
+
function $954926fb6168ae2a$var$parsePlacement(input) {
|
|
5300
|
+
if ($954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input]) return $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input];
|
|
5301
|
+
let [placement, crossPlacement] = input.split(" ");
|
|
5302
|
+
let axis = $954926fb6168ae2a$var$AXIS[placement] || "right";
|
|
5303
|
+
let crossAxis = $954926fb6168ae2a$var$CROSS_AXIS[axis];
|
|
5304
|
+
if (!$954926fb6168ae2a$var$AXIS[crossPlacement]) crossPlacement = "center";
|
|
5305
|
+
let size = $954926fb6168ae2a$var$AXIS_SIZE[axis];
|
|
5306
|
+
let crossSize = $954926fb6168ae2a$var$AXIS_SIZE[crossAxis];
|
|
5307
|
+
$954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input] = {
|
|
5308
|
+
placement,
|
|
5309
|
+
crossPlacement,
|
|
5310
|
+
axis,
|
|
5311
|
+
crossAxis,
|
|
5312
|
+
size,
|
|
5313
|
+
crossSize
|
|
5314
|
+
};
|
|
5315
|
+
return $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input];
|
|
5316
|
+
}
|
|
5317
|
+
function $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
|
|
5318
|
+
let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo;
|
|
5319
|
+
let position = {};
|
|
5320
|
+
position[crossAxis] = childOffset[crossAxis] ?? 0;
|
|
5321
|
+
if (crossPlacement === "center")
|
|
5322
|
+
position[crossAxis] += ((childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0)) / 2;
|
|
5323
|
+
else if (crossPlacement !== crossAxis)
|
|
5324
|
+
position[crossAxis] += (childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0);
|
|
5325
|
+
position[crossAxis] += crossOffset;
|
|
5326
|
+
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
5327
|
+
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
5328
|
+
position[crossAxis] = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(position[crossAxis], minPosition, maxPosition);
|
|
5329
|
+
if (placement === axis) {
|
|
5330
|
+
let containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[$954926fb6168ae2a$var$TOTAL_SIZE[size]];
|
|
5331
|
+
position[$954926fb6168ae2a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
5332
|
+
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
5333
|
+
return position;
|
|
5334
|
+
}
|
|
5335
|
+
function $954926fb6168ae2a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
|
|
5336
|
+
let overlayTop = (position.top != null ? position.top : containerDimensions[$954926fb6168ae2a$var$TOTAL_SIZE.height] - (position.bottom ?? 0) - overlayHeight) - (containerDimensions.scroll.top ?? 0);
|
|
5337
|
+
let boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
|
|
5338
|
+
let boundingRect = {
|
|
5339
|
+
// This should be boundary top in container coord system vs viewport top in container coord system
|
|
5340
|
+
// For the viewport top, there are several cases
|
|
5341
|
+
// 1. pinchzoom case where we want the viewports offset top as top here
|
|
5342
|
+
// 2. case where container is offset from the boundary and is contained by the boundary. In this case the top we want here is NOT 0, we want to take boundary's top even though is is a negative number OR the visual viewport, whichever is more restrictive
|
|
5343
|
+
top: Math.max(boundaryDimensions.top + boundaryToContainerTransformOffset, ((visualViewport == null ? void 0 : visualViewport.offsetTop) ?? boundaryDimensions.top) + boundaryToContainerTransformOffset),
|
|
5344
|
+
bottom: Math.min(boundaryDimensions.top + boundaryDimensions.height + boundaryToContainerTransformOffset, ((visualViewport == null ? void 0 : visualViewport.offsetTop) ?? 0) + ((visualViewport == null ? void 0 : visualViewport.height) ?? 0))
|
|
5345
|
+
};
|
|
5346
|
+
let maxHeight = heightGrowthDirection !== "top" ? (
|
|
5347
|
+
// We want the distance between the top of the overlay to the bottom of the boundary
|
|
5348
|
+
Math.max(0, boundingRect.bottom - overlayTop - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding))
|
|
5349
|
+
) : Math.max(0, overlayTop + overlayHeight - boundingRect.top - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding));
|
|
5350
|
+
return maxHeight;
|
|
5351
|
+
}
|
|
5352
|
+
function $954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
|
|
5353
|
+
let { placement, axis, size } = placementInfo;
|
|
5354
|
+
if (placement === axis) return Math.max(0, childOffset[axis] - (containerDimensions.scroll[axis] ?? 0) - (boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0)) - (margins[axis] ?? 0) - margins[$954926fb6168ae2a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
5355
|
+
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) - childOffset[axis] - childOffset[size] + (containerDimensions.scroll[axis] ?? 0) - (margins[axis] ?? 0) - margins[$954926fb6168ae2a$var$FLIPPED_DIRECTION[axis]] - padding);
|
|
5356
|
+
}
|
|
5357
|
+
function $954926fb6168ae2a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
5358
|
+
let placementInfo = $954926fb6168ae2a$var$parsePlacement(placementInput);
|
|
5359
|
+
let { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo;
|
|
5360
|
+
let position = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
5361
|
+
let normalizedOffset = offset;
|
|
5362
|
+
let space = $954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
5363
|
+
if (flip && overlaySize[size] > space) {
|
|
5364
|
+
let flippedPlacementInfo = $954926fb6168ae2a$var$parsePlacement(`${$954926fb6168ae2a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
5365
|
+
let flippedPosition = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
5366
|
+
let flippedSpace = $954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
5367
|
+
if (flippedSpace > space) {
|
|
5368
|
+
placementInfo = flippedPlacementInfo;
|
|
5369
|
+
position = flippedPosition;
|
|
5370
|
+
normalizedOffset = offset;
|
|
5371
|
+
}
|
|
5372
|
+
}
|
|
5373
|
+
let heightGrowthDirection = "bottom";
|
|
5374
|
+
if (placementInfo.axis === "top") {
|
|
5375
|
+
if (placementInfo.placement === "top") heightGrowthDirection = "top";
|
|
5376
|
+
else if (placementInfo.placement === "bottom") heightGrowthDirection = "bottom";
|
|
5377
|
+
} else if (placementInfo.crossAxis === "top") {
|
|
5378
|
+
if (placementInfo.crossPlacement === "top") heightGrowthDirection = "bottom";
|
|
5379
|
+
else if (placementInfo.crossPlacement === "bottom") heightGrowthDirection = "top";
|
|
5380
|
+
}
|
|
5381
|
+
let delta = $954926fb6168ae2a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
5382
|
+
position[crossAxis] += delta;
|
|
5383
|
+
let maxHeight = $954926fb6168ae2a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
|
|
5384
|
+
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
5385
|
+
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
5386
|
+
position = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
5387
|
+
delta = $954926fb6168ae2a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
5388
|
+
position[crossAxis] += delta;
|
|
5389
|
+
let arrowPosition = {};
|
|
5390
|
+
let origin = childOffset[crossAxis] - position[crossAxis] - margins[$954926fb6168ae2a$var$AXIS[crossAxis]];
|
|
5391
|
+
let preferredArrowPosition = origin + 0.5 * childOffset[crossSize];
|
|
5392
|
+
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
5393
|
+
const overlayMargin = $954926fb6168ae2a$var$AXIS[crossAxis] === "left" ? (margins.left ?? 0) + (margins.right ?? 0) : (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
5394
|
+
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
5395
|
+
const arrowOverlappingChildMinEdge = childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]]);
|
|
5396
|
+
const arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]]);
|
|
5397
|
+
const arrowPositionOverlappingChild = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge);
|
|
5398
|
+
arrowPosition[crossAxis] = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition);
|
|
5399
|
+
({ placement, crossPlacement } = placementInfo);
|
|
5400
|
+
if (arrowSize) origin = arrowPosition[crossAxis];
|
|
5401
|
+
else if (crossPlacement === "right") origin += childOffset[crossSize];
|
|
5402
|
+
else if (crossPlacement === "center") origin += childOffset[crossSize] / 2;
|
|
5403
|
+
let crossOrigin = placement === "left" || placement === "top" ? overlaySize[size] : 0;
|
|
5404
|
+
let triggerAnchorPoint = {
|
|
5405
|
+
x: placement === "top" || placement === "bottom" ? origin : crossOrigin,
|
|
5406
|
+
y: placement === "left" || placement === "right" ? origin : crossOrigin
|
|
5407
|
+
};
|
|
5408
|
+
return {
|
|
5409
|
+
position,
|
|
5410
|
+
maxHeight,
|
|
5411
|
+
arrowOffsetLeft: arrowPosition.left,
|
|
5412
|
+
arrowOffsetTop: arrowPosition.top,
|
|
5413
|
+
placement,
|
|
5414
|
+
triggerAnchorPoint
|
|
5415
|
+
};
|
|
5416
|
+
}
|
|
5417
|
+
function $954926fb6168ae2a$export$b3ceb0cbf1056d98(opts) {
|
|
5418
|
+
let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts;
|
|
5419
|
+
let visualViewport = $954926fb6168ae2a$var$getVisualViewport();
|
|
5420
|
+
let container = overlayNode instanceof HTMLElement ? $954926fb6168ae2a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
5421
|
+
let isViewportContainer = container === document.documentElement;
|
|
5422
|
+
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
5423
|
+
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
5424
|
+
let childOffset = isViewportContainer ? $954926fb6168ae2a$var$getOffset(targetNode, false) : $954926fb6168ae2a$var$getPosition(targetNode, container, false);
|
|
5425
|
+
if (!isViewportContainer) {
|
|
5426
|
+
let { marginTop, marginLeft } = window.getComputedStyle(targetNode);
|
|
5427
|
+
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
5428
|
+
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
5429
|
+
}
|
|
5430
|
+
let overlaySize = $954926fb6168ae2a$var$getOffset(overlayNode, true);
|
|
5431
|
+
let margins = $954926fb6168ae2a$var$getMargins(overlayNode);
|
|
5432
|
+
overlaySize.width += (margins.left ?? 0) + (margins.right ?? 0);
|
|
5433
|
+
overlaySize.height += (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
5434
|
+
let scrollSize = $954926fb6168ae2a$var$getScroll(scrollNode);
|
|
5435
|
+
let boundaryDimensions = $954926fb6168ae2a$var$getContainerDimensions(boundaryElement, visualViewport);
|
|
5436
|
+
let containerDimensions = $954926fb6168ae2a$var$getContainerDimensions(container, visualViewport);
|
|
5437
|
+
let containerOffsetWithBoundary;
|
|
5438
|
+
if ((boundaryElement.tagName === "BODY" || boundaryElement.tagName === "HTML") && !isViewportContainer) {
|
|
5439
|
+
let containerRect = $954926fb6168ae2a$export$4b834cebd9e5cebe(container, false);
|
|
5440
|
+
containerOffsetWithBoundary = {
|
|
5441
|
+
top: -(containerRect.top - boundaryDimensions.top),
|
|
5442
|
+
left: -(containerRect.left - boundaryDimensions.left),
|
|
5443
|
+
width: 0,
|
|
5444
|
+
height: 0
|
|
5445
|
+
};
|
|
5446
|
+
} else if ((boundaryElement.tagName === "BODY" || boundaryElement.tagName === "HTML") && isViewportContainer)
|
|
5447
|
+
containerOffsetWithBoundary = {
|
|
5448
|
+
top: 0,
|
|
5449
|
+
left: 0,
|
|
5450
|
+
width: 0,
|
|
5451
|
+
height: 0
|
|
5452
|
+
};
|
|
5453
|
+
else
|
|
5454
|
+
containerOffsetWithBoundary = $954926fb6168ae2a$var$getPosition(boundaryElement, container, false);
|
|
5455
|
+
let isContainerDescendentOfBoundary = $23f2114a1b82827e$export$4282f70798064fe0(boundaryElement, container);
|
|
5456
|
+
return $954926fb6168ae2a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
|
|
5457
|
+
}
|
|
5458
|
+
function $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale) {
|
|
5459
|
+
let { top, left, width, height } = node.getBoundingClientRect();
|
|
5460
|
+
if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
|
5461
|
+
width = node.offsetWidth;
|
|
5462
|
+
height = node.offsetHeight;
|
|
5463
|
+
}
|
|
5464
|
+
return {
|
|
5465
|
+
top,
|
|
5466
|
+
left,
|
|
5467
|
+
width,
|
|
5468
|
+
height
|
|
5469
|
+
};
|
|
5470
|
+
}
|
|
5471
|
+
function $954926fb6168ae2a$var$getOffset(node, ignoreScale) {
|
|
5472
|
+
let { top, left, width, height } = $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale);
|
|
5473
|
+
let { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
|
|
5474
|
+
return {
|
|
5475
|
+
top: top + scrollTop - clientTop,
|
|
5476
|
+
left: left + scrollLeft - clientLeft,
|
|
5477
|
+
width,
|
|
5478
|
+
height
|
|
5479
|
+
};
|
|
5480
|
+
}
|
|
5481
|
+
function $954926fb6168ae2a$var$getPosition(node, parent, ignoreScale) {
|
|
5482
|
+
let style = window.getComputedStyle(node);
|
|
5483
|
+
let offset;
|
|
5484
|
+
if (style.position === "fixed") offset = $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale);
|
|
5485
|
+
else {
|
|
5486
|
+
offset = $954926fb6168ae2a$var$getOffset(node, ignoreScale);
|
|
5487
|
+
let parentOffset = $954926fb6168ae2a$var$getOffset(parent, ignoreScale);
|
|
5488
|
+
let parentStyle = window.getComputedStyle(parent);
|
|
5489
|
+
parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop;
|
|
5490
|
+
parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft;
|
|
5491
|
+
offset.top -= parentOffset.top;
|
|
5492
|
+
offset.left -= parentOffset.left;
|
|
5493
|
+
}
|
|
5494
|
+
offset.top -= parseInt(style.marginTop, 10) || 0;
|
|
5495
|
+
offset.left -= parseInt(style.marginLeft, 10) || 0;
|
|
5496
|
+
return offset;
|
|
5497
|
+
}
|
|
5498
|
+
function $954926fb6168ae2a$var$getContainingBlock(node) {
|
|
5499
|
+
let offsetParent = node.offsetParent;
|
|
5500
|
+
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$954926fb6168ae2a$var$isContainingBlock(offsetParent)) offsetParent = document.documentElement;
|
|
5501
|
+
if (offsetParent == null) {
|
|
5502
|
+
offsetParent = node.parentElement;
|
|
5503
|
+
while (offsetParent && !$954926fb6168ae2a$var$isContainingBlock(offsetParent)) offsetParent = offsetParent.parentElement;
|
|
5504
|
+
}
|
|
5505
|
+
return offsetParent || document.documentElement;
|
|
5506
|
+
}
|
|
5507
|
+
function $954926fb6168ae2a$var$isContainingBlock(node) {
|
|
5508
|
+
let style = window.getComputedStyle(node);
|
|
5509
|
+
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";
|
|
5510
|
+
}
|
|
5511
|
+
let $b3526bc71400be8d$var$visualViewport = typeof document !== "undefined" ? window.visualViewport : null;
|
|
5512
|
+
function $b3526bc71400be8d$export$d39e1813b3bdd0e1(props) {
|
|
5513
|
+
let { direction } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
5514
|
+
let { arrowSize, targetRef, overlayRef, arrowRef, 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;
|
|
5515
|
+
let [position, setPosition] = useState(null);
|
|
5516
|
+
let deps = [
|
|
5517
|
+
shouldUpdatePosition,
|
|
5518
|
+
placement,
|
|
5519
|
+
overlayRef.current,
|
|
5520
|
+
targetRef.current,
|
|
5521
|
+
arrowRef == null ? void 0 : arrowRef.current,
|
|
5522
|
+
scrollRef.current,
|
|
5523
|
+
containerPadding,
|
|
5524
|
+
shouldFlip,
|
|
5525
|
+
boundaryElement,
|
|
5526
|
+
offset,
|
|
5527
|
+
crossOffset,
|
|
5528
|
+
isOpen,
|
|
5529
|
+
direction,
|
|
5530
|
+
maxHeight,
|
|
5531
|
+
arrowBoundaryOffset,
|
|
5532
|
+
arrowSize
|
|
5533
|
+
];
|
|
5534
|
+
let lastScale = useRef($b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.scale);
|
|
5535
|
+
useEffect(() => {
|
|
5536
|
+
if (isOpen) lastScale.current = $b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.scale;
|
|
5537
|
+
}, [
|
|
5538
|
+
isOpen
|
|
5539
|
+
]);
|
|
5540
|
+
let updatePosition = useCallback(() => {
|
|
5541
|
+
var _a, _b;
|
|
5542
|
+
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) return;
|
|
5543
|
+
if (($b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.scale) !== lastScale.current) return;
|
|
5544
|
+
let anchor = null;
|
|
5545
|
+
if (scrollRef.current && $23f2114a1b82827e$export$b4f377a2b6254582(scrollRef.current)) {
|
|
5546
|
+
let anchorRect = (_a = $23f2114a1b82827e$export$cd4e5573fbe2b576()) == null ? void 0 : _a.getBoundingClientRect();
|
|
5547
|
+
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
5548
|
+
anchor = {
|
|
5549
|
+
type: "top",
|
|
5550
|
+
offset: ((anchorRect == null ? void 0 : anchorRect.top) ?? 0) - scrollRect.top
|
|
5551
|
+
};
|
|
5552
|
+
if (anchor.offset > scrollRect.height / 2) {
|
|
5553
|
+
anchor.type = "bottom";
|
|
5554
|
+
anchor.offset = ((anchorRect == null ? void 0 : anchorRect.bottom) ?? 0) - scrollRect.bottom;
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
let overlay = overlayRef.current;
|
|
5558
|
+
if (!maxHeight && overlayRef.current) {
|
|
5559
|
+
overlay.style.top = "0px";
|
|
5560
|
+
overlay.style.bottom = "";
|
|
5561
|
+
overlay.style.maxHeight = (((_b = window.visualViewport) == null ? void 0 : _b.height) ?? window.innerHeight) + "px";
|
|
5562
|
+
}
|
|
5563
|
+
let position2 = $954926fb6168ae2a$export$b3ceb0cbf1056d98({
|
|
5564
|
+
placement: $b3526bc71400be8d$var$translateRTL(placement, direction),
|
|
5565
|
+
overlayNode: overlayRef.current,
|
|
5566
|
+
targetNode: targetRef.current,
|
|
5567
|
+
scrollNode: scrollRef.current || overlayRef.current,
|
|
5568
|
+
padding: containerPadding,
|
|
5569
|
+
shouldFlip,
|
|
5570
|
+
boundaryElement,
|
|
5571
|
+
offset,
|
|
5572
|
+
crossOffset,
|
|
5573
|
+
maxHeight,
|
|
5574
|
+
arrowSize: arrowSize ?? ((arrowRef == null ? void 0 : arrowRef.current) ? $954926fb6168ae2a$export$4b834cebd9e5cebe(arrowRef.current, true).width : 0),
|
|
5575
|
+
arrowBoundaryOffset
|
|
5576
|
+
});
|
|
5577
|
+
if (!position2.position) return;
|
|
5578
|
+
overlay.style.top = "";
|
|
5579
|
+
overlay.style.bottom = "";
|
|
5580
|
+
overlay.style.left = "";
|
|
5581
|
+
overlay.style.right = "";
|
|
5582
|
+
Object.keys(position2.position).forEach((key) => overlay.style[key] = position2.position[key] + "px");
|
|
5583
|
+
overlay.style.maxHeight = position2.maxHeight != null ? position2.maxHeight + "px" : "";
|
|
5584
|
+
let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
|
|
5585
|
+
if (anchor && activeElement && scrollRef.current) {
|
|
5586
|
+
let anchorRect = activeElement.getBoundingClientRect();
|
|
5587
|
+
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
5588
|
+
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
5589
|
+
scrollRef.current.scrollTop += newOffset - anchor.offset;
|
|
5590
|
+
}
|
|
5591
|
+
setPosition(position2);
|
|
5592
|
+
}, deps);
|
|
5593
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(updatePosition, deps);
|
|
5594
|
+
$b3526bc71400be8d$var$useResize(updatePosition);
|
|
5595
|
+
$970072cf4b13fde3$export$683480f191c0e3ea({
|
|
5596
|
+
ref: overlayRef,
|
|
5597
|
+
onResize: updatePosition
|
|
5598
|
+
});
|
|
5599
|
+
$970072cf4b13fde3$export$683480f191c0e3ea({
|
|
5600
|
+
ref: targetRef,
|
|
5601
|
+
onResize: updatePosition
|
|
5602
|
+
});
|
|
5603
|
+
let isResizing = useRef(false);
|
|
5604
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
5605
|
+
let timeout;
|
|
5606
|
+
let onResize = () => {
|
|
5607
|
+
isResizing.current = true;
|
|
5608
|
+
clearTimeout(timeout);
|
|
5609
|
+
timeout = setTimeout(() => {
|
|
5610
|
+
isResizing.current = false;
|
|
5611
|
+
}, 500);
|
|
5612
|
+
updatePosition();
|
|
5613
|
+
};
|
|
5614
|
+
let onScroll = () => {
|
|
5615
|
+
if (isResizing.current) onResize();
|
|
5616
|
+
};
|
|
5617
|
+
$b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.addEventListener("resize", onResize);
|
|
5618
|
+
$b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.addEventListener("scroll", onScroll);
|
|
5619
|
+
return () => {
|
|
5620
|
+
$b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.removeEventListener("resize", onResize);
|
|
5621
|
+
$b3526bc71400be8d$var$visualViewport == null ? void 0 : $b3526bc71400be8d$var$visualViewport.removeEventListener("scroll", onScroll);
|
|
5622
|
+
};
|
|
5623
|
+
}, [
|
|
5624
|
+
updatePosition
|
|
5625
|
+
]);
|
|
5626
|
+
let close = useCallback(() => {
|
|
5627
|
+
if (!isResizing.current) onClose == null ? void 0 : onClose();
|
|
5628
|
+
}, [
|
|
5629
|
+
onClose,
|
|
5630
|
+
isResizing
|
|
5631
|
+
]);
|
|
5632
|
+
$22e2f5f6490788e8$export$18fc8428861184da({
|
|
5633
|
+
triggerRef: targetRef,
|
|
5634
|
+
isOpen,
|
|
5635
|
+
onClose: onClose && close
|
|
5636
|
+
});
|
|
5637
|
+
return {
|
|
5638
|
+
overlayProps: {
|
|
5639
|
+
style: {
|
|
5640
|
+
position: position ? "absolute" : "fixed",
|
|
5641
|
+
top: !position ? 0 : void 0,
|
|
5642
|
+
left: !position ? 0 : void 0,
|
|
5643
|
+
zIndex: 1e5,
|
|
5644
|
+
...position == null ? void 0 : position.position,
|
|
5645
|
+
maxHeight: (position == null ? void 0 : position.maxHeight) ?? "100vh"
|
|
5646
|
+
}
|
|
5647
|
+
},
|
|
5648
|
+
placement: (position == null ? void 0 : position.placement) ?? null,
|
|
5649
|
+
triggerAnchorPoint: (position == null ? void 0 : position.triggerAnchorPoint) ?? null,
|
|
5650
|
+
arrowProps: {
|
|
5651
|
+
"aria-hidden": "true",
|
|
5652
|
+
role: "presentation",
|
|
5653
|
+
style: {
|
|
5654
|
+
left: position == null ? void 0 : position.arrowOffsetLeft,
|
|
5655
|
+
top: position == null ? void 0 : position.arrowOffsetTop
|
|
5656
|
+
}
|
|
5657
|
+
},
|
|
5658
|
+
updatePosition
|
|
5659
|
+
};
|
|
5660
|
+
}
|
|
5661
|
+
function $b3526bc71400be8d$var$useResize(onResize) {
|
|
5662
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
5663
|
+
window.addEventListener("resize", onResize, false);
|
|
5664
|
+
return () => {
|
|
5665
|
+
window.removeEventListener("resize", onResize, false);
|
|
5666
|
+
};
|
|
5667
|
+
}, [
|
|
5668
|
+
onResize
|
|
5669
|
+
]);
|
|
5670
|
+
}
|
|
5671
|
+
function $b3526bc71400be8d$var$translateRTL(position, direction) {
|
|
5672
|
+
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
5673
|
+
return position.replace("start", "left").replace("end", "right");
|
|
5674
|
+
}
|
|
5675
|
+
function $8c383cffc84c9982$export$1c4b08e0eca38426(props, state) {
|
|
5676
|
+
let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
|
|
5677
|
+
labelable: true
|
|
5678
|
+
});
|
|
5679
|
+
let { hoverProps } = $e969f22b6713ca4a$export$ae780daf29e6d456({
|
|
5680
|
+
onHoverStart: () => state == null ? void 0 : state.open(true),
|
|
5681
|
+
onHoverEnd: () => state == null ? void 0 : state.close()
|
|
5682
|
+
});
|
|
5683
|
+
return {
|
|
5684
|
+
tooltipProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, hoverProps, {
|
|
5685
|
+
role: "tooltip"
|
|
5686
|
+
})
|
|
5687
|
+
};
|
|
5688
|
+
}
|
|
5689
|
+
function $85908aa8a35f0fac$export$a6da6c504e4bba8b(props, state, ref) {
|
|
5690
|
+
let { isDisabled, trigger, shouldCloseOnPress = true } = props;
|
|
5691
|
+
let tooltipId = $390e54f620492c70$export$f680877a34711e37();
|
|
5692
|
+
let isHovered = useRef(false);
|
|
5693
|
+
let isFocused = useRef(false);
|
|
5694
|
+
let handleShow = () => {
|
|
5695
|
+
if (isHovered.current || isFocused.current) state.open(isFocused.current);
|
|
5696
|
+
};
|
|
5697
|
+
let handleHide = (immediate) => {
|
|
5698
|
+
if (!isHovered.current && !isFocused.current) state.close(immediate);
|
|
5699
|
+
};
|
|
5700
|
+
useEffect(() => {
|
|
5701
|
+
let onKeyDown = (e) => {
|
|
5702
|
+
if (ref && ref.current) {
|
|
5703
|
+
if (e.key === "Escape") {
|
|
5704
|
+
e.stopPropagation();
|
|
5705
|
+
state.close(true);
|
|
5706
|
+
}
|
|
5707
|
+
}
|
|
5708
|
+
};
|
|
5709
|
+
if (state.isOpen) {
|
|
5710
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
5711
|
+
return () => {
|
|
5712
|
+
document.removeEventListener("keydown", onKeyDown, true);
|
|
5713
|
+
};
|
|
5714
|
+
}
|
|
5715
|
+
}, [
|
|
5716
|
+
ref,
|
|
5717
|
+
state
|
|
5718
|
+
]);
|
|
5719
|
+
let onHoverStart = () => {
|
|
5720
|
+
if (trigger === "focus") return;
|
|
5721
|
+
if ($8f5a2122b0992be3$export$630ff653c5ada6a9() === "pointer") isHovered.current = true;
|
|
5722
|
+
else isHovered.current = false;
|
|
5723
|
+
handleShow();
|
|
5724
|
+
};
|
|
5725
|
+
let onHoverEnd = () => {
|
|
5726
|
+
if (trigger === "focus") return;
|
|
5727
|
+
isFocused.current = false;
|
|
5728
|
+
isHovered.current = false;
|
|
5729
|
+
handleHide();
|
|
5730
|
+
};
|
|
5731
|
+
let onPressStart = () => {
|
|
5732
|
+
if (!shouldCloseOnPress) return;
|
|
5733
|
+
isFocused.current = false;
|
|
5734
|
+
isHovered.current = false;
|
|
5735
|
+
handleHide(true);
|
|
5736
|
+
};
|
|
5737
|
+
let onFocus = () => {
|
|
5738
|
+
let isVisible = $8f5a2122b0992be3$export$b9b3dfddab17db27();
|
|
5739
|
+
if (isVisible) {
|
|
5740
|
+
isFocused.current = true;
|
|
5741
|
+
handleShow();
|
|
5742
|
+
}
|
|
5743
|
+
};
|
|
5744
|
+
let onBlur = () => {
|
|
5745
|
+
isFocused.current = false;
|
|
5746
|
+
isHovered.current = false;
|
|
5747
|
+
handleHide(true);
|
|
5748
|
+
};
|
|
5749
|
+
let { hoverProps } = $e969f22b6713ca4a$export$ae780daf29e6d456({
|
|
5750
|
+
isDisabled,
|
|
5751
|
+
onHoverStart,
|
|
5752
|
+
onHoverEnd
|
|
5753
|
+
});
|
|
5754
|
+
let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c({
|
|
5755
|
+
isDisabled,
|
|
5756
|
+
onFocus,
|
|
5757
|
+
onBlur
|
|
5758
|
+
}, ref);
|
|
5759
|
+
return {
|
|
5760
|
+
triggerProps: {
|
|
5761
|
+
"aria-describedby": state.isOpen ? tooltipId : void 0,
|
|
5762
|
+
...$bbaa08b3cd72f041$export$9d1611c77c2fe928(focusableProps, hoverProps, {
|
|
5763
|
+
onPointerDown: onPressStart,
|
|
5764
|
+
onKeyDown: onPressStart
|
|
5765
|
+
}),
|
|
5766
|
+
tabIndex: void 0
|
|
5767
|
+
},
|
|
5768
|
+
tooltipProps: {
|
|
5769
|
+
id: tooltipId
|
|
5770
|
+
}
|
|
5771
|
+
};
|
|
5772
|
+
}
|
|
5773
|
+
function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
|
|
5774
|
+
let [isOpen, setOpen] = $3e6197669829fe11$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
|
5775
|
+
const open = useCallback(() => {
|
|
5776
|
+
setOpen(true);
|
|
5777
|
+
}, [
|
|
5778
|
+
setOpen
|
|
5779
|
+
]);
|
|
5780
|
+
const close = useCallback(() => {
|
|
5781
|
+
setOpen(false);
|
|
5782
|
+
}, [
|
|
5783
|
+
setOpen
|
|
5784
|
+
]);
|
|
5785
|
+
const toggle = useCallback(() => {
|
|
5786
|
+
setOpen(!isOpen);
|
|
5787
|
+
}, [
|
|
5788
|
+
setOpen,
|
|
5789
|
+
isOpen
|
|
5790
|
+
]);
|
|
5791
|
+
return {
|
|
5792
|
+
isOpen,
|
|
5793
|
+
setOpen,
|
|
5794
|
+
open,
|
|
5795
|
+
close,
|
|
5796
|
+
toggle
|
|
5797
|
+
};
|
|
5798
|
+
}
|
|
5031
5799
|
var $6f00cf506278c4dd$exports = {};
|
|
5032
5800
|
$6f00cf506278c4dd$exports = {
|
|
5033
5801
|
"rangeOverflow": (args) => `يجب أن تكون القيمة ${args.maxValue} أو قبل ذلك.`,
|
|
@@ -6508,6 +7276,104 @@ function $b822555cf9fe955c$var$convertValue(value, date = $ad063034c8620db8$expo
|
|
|
6508
7276
|
if ("day" in value) return value;
|
|
6509
7277
|
return $d07e34cce18680fd$export$b21e0b124e224484(date, value);
|
|
6510
7278
|
}
|
|
7279
|
+
const $3834487504f4fc00$var$TOOLTIP_DELAY = 1500;
|
|
7280
|
+
const $3834487504f4fc00$var$TOOLTIP_COOLDOWN = 500;
|
|
7281
|
+
let $3834487504f4fc00$var$tooltips = {};
|
|
7282
|
+
let $3834487504f4fc00$var$tooltipId = 0;
|
|
7283
|
+
let $3834487504f4fc00$var$globalWarmedUp = false;
|
|
7284
|
+
let $3834487504f4fc00$var$globalWarmUpTimeout = null;
|
|
7285
|
+
let $3834487504f4fc00$var$globalCooldownTimeout = null;
|
|
7286
|
+
function $3834487504f4fc00$export$4d40659c25ecb50b(props = {}) {
|
|
7287
|
+
let { delay = $3834487504f4fc00$var$TOOLTIP_DELAY, closeDelay = $3834487504f4fc00$var$TOOLTIP_COOLDOWN } = props;
|
|
7288
|
+
let { isOpen, open, close } = $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props);
|
|
7289
|
+
let id = useMemo(() => `${++$3834487504f4fc00$var$tooltipId}`, []);
|
|
7290
|
+
let closeTimeout = useRef(null);
|
|
7291
|
+
let closeCallback = useRef(close);
|
|
7292
|
+
let ensureTooltipEntry = () => {
|
|
7293
|
+
$3834487504f4fc00$var$tooltips[id] = hideTooltip;
|
|
7294
|
+
};
|
|
7295
|
+
let closeOpenTooltips = () => {
|
|
7296
|
+
for (let hideTooltipId in $3834487504f4fc00$var$tooltips) if (hideTooltipId !== id) {
|
|
7297
|
+
$3834487504f4fc00$var$tooltips[hideTooltipId](true);
|
|
7298
|
+
delete $3834487504f4fc00$var$tooltips[hideTooltipId];
|
|
7299
|
+
}
|
|
7300
|
+
};
|
|
7301
|
+
let showTooltip = () => {
|
|
7302
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
7303
|
+
closeTimeout.current = null;
|
|
7304
|
+
closeOpenTooltips();
|
|
7305
|
+
ensureTooltipEntry();
|
|
7306
|
+
$3834487504f4fc00$var$globalWarmedUp = true;
|
|
7307
|
+
open();
|
|
7308
|
+
if ($3834487504f4fc00$var$globalWarmUpTimeout) {
|
|
7309
|
+
clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
|
|
7310
|
+
$3834487504f4fc00$var$globalWarmUpTimeout = null;
|
|
7311
|
+
}
|
|
7312
|
+
if ($3834487504f4fc00$var$globalCooldownTimeout) {
|
|
7313
|
+
clearTimeout($3834487504f4fc00$var$globalCooldownTimeout);
|
|
7314
|
+
$3834487504f4fc00$var$globalCooldownTimeout = null;
|
|
7315
|
+
}
|
|
7316
|
+
};
|
|
7317
|
+
let hideTooltip = (immediate) => {
|
|
7318
|
+
if (immediate || closeDelay <= 0) {
|
|
7319
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
7320
|
+
closeTimeout.current = null;
|
|
7321
|
+
closeCallback.current();
|
|
7322
|
+
} else if (!closeTimeout.current) closeTimeout.current = setTimeout(() => {
|
|
7323
|
+
closeTimeout.current = null;
|
|
7324
|
+
closeCallback.current();
|
|
7325
|
+
}, closeDelay);
|
|
7326
|
+
if ($3834487504f4fc00$var$globalWarmUpTimeout) {
|
|
7327
|
+
clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
|
|
7328
|
+
$3834487504f4fc00$var$globalWarmUpTimeout = null;
|
|
7329
|
+
}
|
|
7330
|
+
if ($3834487504f4fc00$var$globalWarmedUp) {
|
|
7331
|
+
if ($3834487504f4fc00$var$globalCooldownTimeout) clearTimeout($3834487504f4fc00$var$globalCooldownTimeout);
|
|
7332
|
+
$3834487504f4fc00$var$globalCooldownTimeout = setTimeout(() => {
|
|
7333
|
+
delete $3834487504f4fc00$var$tooltips[id];
|
|
7334
|
+
$3834487504f4fc00$var$globalCooldownTimeout = null;
|
|
7335
|
+
$3834487504f4fc00$var$globalWarmedUp = false;
|
|
7336
|
+
}, Math.max($3834487504f4fc00$var$TOOLTIP_COOLDOWN, closeDelay));
|
|
7337
|
+
}
|
|
7338
|
+
};
|
|
7339
|
+
let warmupTooltip = () => {
|
|
7340
|
+
closeOpenTooltips();
|
|
7341
|
+
ensureTooltipEntry();
|
|
7342
|
+
if (!isOpen && !$3834487504f4fc00$var$globalWarmedUp) {
|
|
7343
|
+
if ($3834487504f4fc00$var$globalWarmUpTimeout) clearTimeout($3834487504f4fc00$var$globalWarmUpTimeout);
|
|
7344
|
+
$3834487504f4fc00$var$globalWarmUpTimeout = setTimeout(() => {
|
|
7345
|
+
$3834487504f4fc00$var$globalWarmUpTimeout = null;
|
|
7346
|
+
$3834487504f4fc00$var$globalWarmedUp = true;
|
|
7347
|
+
showTooltip();
|
|
7348
|
+
}, delay);
|
|
7349
|
+
} else if (!isOpen) showTooltip();
|
|
7350
|
+
};
|
|
7351
|
+
useEffect(() => {
|
|
7352
|
+
closeCallback.current = close;
|
|
7353
|
+
}, [
|
|
7354
|
+
close
|
|
7355
|
+
]);
|
|
7356
|
+
useEffect(() => {
|
|
7357
|
+
return () => {
|
|
7358
|
+
if (closeTimeout.current) clearTimeout(closeTimeout.current);
|
|
7359
|
+
let tooltip = $3834487504f4fc00$var$tooltips[id];
|
|
7360
|
+
if (tooltip) delete $3834487504f4fc00$var$tooltips[id];
|
|
7361
|
+
};
|
|
7362
|
+
}, [
|
|
7363
|
+
id
|
|
7364
|
+
]);
|
|
7365
|
+
return {
|
|
7366
|
+
isOpen,
|
|
7367
|
+
open: (immediate) => {
|
|
7368
|
+
if (!immediate && delay > 0 && !closeTimeout.current) warmupTooltip();
|
|
7369
|
+
else showTooltip();
|
|
7370
|
+
},
|
|
7371
|
+
close: hideTooltip
|
|
7372
|
+
};
|
|
7373
|
+
}
|
|
7374
|
+
const $44f671af83e7d9e0$export$2de4954e8ae13b9f = /* @__PURE__ */ createContext({
|
|
7375
|
+
placement: "bottom"
|
|
7376
|
+
});
|
|
6511
7377
|
const $40825cdb76e74f70$export$7b3e670c86da5fe8 = /* @__PURE__ */ createContext(null);
|
|
6512
7378
|
const $40825cdb76e74f70$export$8e17ddc448e87c1e = /* @__PURE__ */ createContext(null);
|
|
6513
7379
|
const $40825cdb76e74f70$export$3b08bebcf796eea0 = /* @__PURE__ */ createContext(null);
|
|
@@ -6708,56 +7574,155 @@ const $40825cdb76e74f70$export$336ab7fa954c4b5f = /* @__PURE__ */ forwardRef(fun
|
|
|
6708
7574
|
"data-focus-visible": isFocusVisible || void 0
|
|
6709
7575
|
});
|
|
6710
7576
|
});
|
|
7577
|
+
const $4e3b923658d69c60$export$7a7623236eec67fa = /* @__PURE__ */ createContext(null);
|
|
7578
|
+
const $4e3b923658d69c60$export$39ae08fa83328b12 = /* @__PURE__ */ createContext(null);
|
|
7579
|
+
function $4e3b923658d69c60$export$8c610744efcf8a1d(props) {
|
|
7580
|
+
let state = $3834487504f4fc00$export$4d40659c25ecb50b(props);
|
|
7581
|
+
let ref = useRef(null);
|
|
7582
|
+
let { triggerProps, tooltipProps } = $85908aa8a35f0fac$export$a6da6c504e4bba8b(props, state, ref);
|
|
7583
|
+
return /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
|
|
7584
|
+
values: [
|
|
7585
|
+
[
|
|
7586
|
+
$4e3b923658d69c60$export$7a7623236eec67fa,
|
|
7587
|
+
state
|
|
7588
|
+
],
|
|
7589
|
+
[
|
|
7590
|
+
$4e3b923658d69c60$export$39ae08fa83328b12,
|
|
7591
|
+
{
|
|
7592
|
+
...tooltipProps,
|
|
7593
|
+
triggerRef: ref
|
|
7594
|
+
}
|
|
7595
|
+
]
|
|
7596
|
+
]
|
|
7597
|
+
}, /* @__PURE__ */ React__default.createElement($d1116acdf220c2da$export$13f3202a3e5ddd5, {
|
|
7598
|
+
...triggerProps,
|
|
7599
|
+
ref
|
|
7600
|
+
}, props.children));
|
|
7601
|
+
}
|
|
7602
|
+
const $4e3b923658d69c60$export$28c660c63b792dea = /* @__PURE__ */ forwardRef(function Tooltip({ UNSTABLE_portalContainer, ...props }, ref) {
|
|
7603
|
+
[props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $4e3b923658d69c60$export$39ae08fa83328b12);
|
|
7604
|
+
let contextState = useContext($4e3b923658d69c60$export$7a7623236eec67fa);
|
|
7605
|
+
let localState = $3834487504f4fc00$export$4d40659c25ecb50b(props);
|
|
7606
|
+
let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;
|
|
7607
|
+
let isExiting = $d3f049242431219c$export$45fda7c47f93fd48(ref, state.isOpen) || props.isExiting || false;
|
|
7608
|
+
if (!state.isOpen && !isExiting) return null;
|
|
7609
|
+
return /* @__PURE__ */ React__default.createElement($c07df45195231803$export$b47c3594eab58386, {
|
|
7610
|
+
portalContainer: UNSTABLE_portalContainer
|
|
7611
|
+
}, /* @__PURE__ */ React__default.createElement($4e3b923658d69c60$var$TooltipInner, {
|
|
7612
|
+
...props,
|
|
7613
|
+
tooltipRef: ref,
|
|
7614
|
+
isExiting
|
|
7615
|
+
}));
|
|
7616
|
+
});
|
|
7617
|
+
function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
7618
|
+
let state = useContext($4e3b923658d69c60$export$7a7623236eec67fa);
|
|
7619
|
+
let arrowRef = useRef(null);
|
|
7620
|
+
let { overlayProps, arrowProps, placement, triggerAnchorPoint } = $b3526bc71400be8d$export$d39e1813b3bdd0e1({
|
|
7621
|
+
placement: props.placement || "top",
|
|
7622
|
+
targetRef: props.triggerRef,
|
|
7623
|
+
overlayRef: props.tooltipRef,
|
|
7624
|
+
arrowRef,
|
|
7625
|
+
offset: props.offset,
|
|
7626
|
+
crossOffset: props.crossOffset,
|
|
7627
|
+
isOpen: state.isOpen,
|
|
7628
|
+
arrowBoundaryOffset: props.arrowBoundaryOffset,
|
|
7629
|
+
shouldFlip: props.shouldFlip,
|
|
7630
|
+
containerPadding: props.containerPadding,
|
|
7631
|
+
onClose: () => state.close(true)
|
|
7632
|
+
});
|
|
7633
|
+
let isEntering = $d3f049242431219c$export$6d3443f2c48bfc20(props.tooltipRef, !!placement) || props.isEntering || false;
|
|
7634
|
+
let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
|
|
7635
|
+
...props,
|
|
7636
|
+
defaultClassName: "react-aria-Tooltip",
|
|
7637
|
+
values: {
|
|
7638
|
+
placement,
|
|
7639
|
+
isEntering,
|
|
7640
|
+
isExiting: props.isExiting,
|
|
7641
|
+
state
|
|
7642
|
+
}
|
|
7643
|
+
});
|
|
7644
|
+
props = $bbaa08b3cd72f041$export$9d1611c77c2fe928(props, overlayProps);
|
|
7645
|
+
let { tooltipProps } = $8c383cffc84c9982$export$1c4b08e0eca38426(props, state);
|
|
7646
|
+
let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
|
|
7647
|
+
global: true
|
|
7648
|
+
});
|
|
7649
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
7650
|
+
...$bbaa08b3cd72f041$export$9d1611c77c2fe928(DOMProps, renderProps, tooltipProps),
|
|
7651
|
+
ref: props.tooltipRef,
|
|
7652
|
+
style: {
|
|
7653
|
+
...overlayProps.style,
|
|
7654
|
+
"--trigger-anchor-point": triggerAnchorPoint ? `${triggerAnchorPoint.x}px ${triggerAnchorPoint.y}px` : void 0,
|
|
7655
|
+
...renderProps.style
|
|
7656
|
+
},
|
|
7657
|
+
"data-placement": placement !== null && placement !== void 0 ? placement : void 0,
|
|
7658
|
+
"data-entering": isEntering || void 0,
|
|
7659
|
+
"data-exiting": props.isExiting || void 0
|
|
7660
|
+
}, /* @__PURE__ */ React__default.createElement($44f671af83e7d9e0$export$2de4954e8ae13b9f.Provider, {
|
|
7661
|
+
value: {
|
|
7662
|
+
...arrowProps,
|
|
7663
|
+
placement,
|
|
7664
|
+
ref: arrowRef
|
|
7665
|
+
}
|
|
7666
|
+
}, renderProps.children));
|
|
7667
|
+
}
|
|
6711
7668
|
export {
|
|
6712
7669
|
$58246871e4652552$export$c9698ec7f05a07e1 as $,
|
|
6713
|
-
$
|
|
6714
|
-
$
|
|
6715
|
-
$
|
|
6716
|
-
$
|
|
6717
|
-
$
|
|
6718
|
-
$
|
|
6719
|
-
$d07e34cce18680fd$export$
|
|
6720
|
-
$ad063034c8620db8$export$
|
|
6721
|
-
$ad063034c8620db8$export$
|
|
6722
|
-
$
|
|
6723
|
-
$
|
|
6724
|
-
$
|
|
6725
|
-
$
|
|
6726
|
-
$
|
|
6727
|
-
$
|
|
6728
|
-
$
|
|
6729
|
-
$8b141f2f71e88f85$export$
|
|
6730
|
-
$
|
|
6731
|
-
$
|
|
6732
|
-
$
|
|
6733
|
-
$
|
|
6734
|
-
$
|
|
6735
|
-
$
|
|
6736
|
-
$
|
|
7670
|
+
$72abaeab4d80592f$export$9fc1347d4195ccb3 as A,
|
|
7671
|
+
$535772f9d2c1f38d$export$20e40289641fbbb6 as B,
|
|
7672
|
+
$535772f9d2c1f38d$export$1258395f99bf9cbf as C,
|
|
7673
|
+
$901761b40e390936$export$2bb74740c4e19def as D,
|
|
7674
|
+
$b3526bc71400be8d$export$d39e1813b3bdd0e1 as E,
|
|
7675
|
+
$ad063034c8620db8$export$a75f2bff57811055 as F,
|
|
7676
|
+
$d07e34cce18680fd$export$93522d1a439f3617 as G,
|
|
7677
|
+
$ad063034c8620db8$export$5c333a116e949cdd as H,
|
|
7678
|
+
$ad063034c8620db8$export$f91e89d3d0406102 as I,
|
|
7679
|
+
$12a3c853105e5a70$export$ad991b66133851cf as J,
|
|
7680
|
+
$d07e34cce18680fd$export$b4a036af3fc0b032 as K,
|
|
7681
|
+
$ad063034c8620db8$export$dbc69fd56b53d5e as L,
|
|
7682
|
+
$ad063034c8620db8$export$2061056d06d7cdf7 as M,
|
|
7683
|
+
$ad063034c8620db8$export$ef8b6d9133084f4e as N,
|
|
7684
|
+
$93635573935797de$export$80ee6245ec4f29ec as O,
|
|
7685
|
+
$f11fb0bcf1b2687a$export$61c6a8c84e605fb6 as P,
|
|
7686
|
+
$8b141f2f71e88f85$export$2440da353cedad43 as Q,
|
|
7687
|
+
$8b141f2f71e88f85$export$f18627323ab57ac0 as R,
|
|
7688
|
+
$8b141f2f71e88f85$export$7e319ea407e63bc0 as S,
|
|
7689
|
+
$8b141f2f71e88f85$export$c5221a78ef73c5e9 as T,
|
|
7690
|
+
$d07e34cce18680fd$export$b21e0b124e224484 as U,
|
|
7691
|
+
$8b141f2f71e88f85$export$80ff8fc0ae339c13 as V,
|
|
7692
|
+
$84102b64e5ca022f$export$dd0bbc9b26defe37 as W,
|
|
7693
|
+
$ad063034c8620db8$export$a18c89cbd24170ff as X,
|
|
7694
|
+
$d3f049242431219c$export$45fda7c47f93fd48 as Y,
|
|
7695
|
+
$d3f049242431219c$export$6d3443f2c48bfc20 as Z,
|
|
7696
|
+
$44f671af83e7d9e0$export$2de4954e8ae13b9f as _,
|
|
6737
7697
|
$40825cdb76e74f70$export$7edc06cf1783b30f as a,
|
|
7698
|
+
$58246871e4652552$export$588937bcd60ade55 as a0,
|
|
7699
|
+
$58246871e4652552$export$6b862160d295c8e as a1,
|
|
7700
|
+
$40825cdb76e74f70$export$7b3e670c86da5fe8 as a2,
|
|
7701
|
+
$ad063034c8620db8$export$aa8b41735afcabd2 as a3,
|
|
7702
|
+
$2aaf608024c21ca1$export$680ea196effce5f as a4,
|
|
6738
7703
|
$40825cdb76e74f70$export$336ab7fa954c4b5f as b,
|
|
6739
7704
|
$40825cdb76e74f70$export$5eaee2322dd727eb as c,
|
|
6740
|
-
$
|
|
6741
|
-
$
|
|
6742
|
-
$
|
|
6743
|
-
$ad063034c8620db8$export$
|
|
6744
|
-
$
|
|
6745
|
-
$
|
|
6746
|
-
$
|
|
6747
|
-
$
|
|
6748
|
-
$
|
|
6749
|
-
$
|
|
6750
|
-
$
|
|
6751
|
-
$
|
|
6752
|
-
$
|
|
6753
|
-
$ad063034c8620db8$export$
|
|
6754
|
-
$
|
|
6755
|
-
$
|
|
6756
|
-
$
|
|
6757
|
-
$
|
|
6758
|
-
$
|
|
6759
|
-
$
|
|
6760
|
-
$7541913c0284d84b$export$
|
|
6761
|
-
$
|
|
6762
|
-
$
|
|
7705
|
+
$4e3b923658d69c60$export$8c610744efcf8a1d as d,
|
|
7706
|
+
$4e3b923658d69c60$export$28c660c63b792dea as e,
|
|
7707
|
+
$60f33508b4cd9d3b$export$85fd5fdf27bacc79 as f,
|
|
7708
|
+
$ad063034c8620db8$export$ea39ec197993aef0 as g,
|
|
7709
|
+
$ad063034c8620db8$export$a5a3b454ada2268e as h,
|
|
7710
|
+
$ad063034c8620db8$export$a2258d9c4118825c as i,
|
|
7711
|
+
$a46cf152bb926da5$export$a9b970dcc4ae71a9 as j,
|
|
7712
|
+
$9c268ab73a5d55e5$export$722debc0e56fea39 as k,
|
|
7713
|
+
$ad063034c8620db8$export$91b62ebf2ba703ee as l,
|
|
7714
|
+
$ad063034c8620db8$export$629b0a497aa65267 as m,
|
|
7715
|
+
$121970af65029459$export$f8aeda7b10753fa1 as n,
|
|
7716
|
+
$51a3e22a5186a962$export$c826860796309d1b as o,
|
|
7717
|
+
$3578607fe3d4b096$export$cfa2225e87938781 as p,
|
|
7718
|
+
$ad063034c8620db8$export$42c81a444fbfb5d4 as q,
|
|
7719
|
+
$ad063034c8620db8$export$d0bdf45af03a6ea3 as r,
|
|
7720
|
+
$ad063034c8620db8$export$ccc1b2479e7dd654 as s,
|
|
7721
|
+
$600b3cf69ae46262$export$90fc3a17d93f704c as t,
|
|
7722
|
+
$654b97e09f2a30c1$export$4d0f8be8b12a7ef6 as u,
|
|
7723
|
+
$6a440d0e2d99dd46$export$4a931266a3838b86 as v,
|
|
7724
|
+
$535772f9d2c1f38d$export$c5251b9e124bf29 as w,
|
|
7725
|
+
$7541913c0284d84b$export$300019f83c56d282 as x,
|
|
7726
|
+
$0014db39426443c5$exports as y,
|
|
7727
|
+
$7541913c0284d84b$export$7b3062cd49e80452 as z
|
|
6763
7728
|
};
|