@eightshift/ui-components 7.2.0 → 7.3.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/Autocomplete-pLMPWMFq.js +451 -0
- package/dist/Button-Biwg7zwt.js +223 -0
- package/dist/Dialog-C1sh8jbh.js +2474 -0
- package/dist/{Disclosure-NYWFw9RJ.js → Disclosure-B_SHgiUz.js} +50 -51
- package/dist/FocusScope-lGkM8AO8.js +734 -0
- package/dist/Form-BxIJCHYd.js +5 -0
- package/dist/Heading-B2EsUuu6.js +16 -0
- package/dist/{Hidden-8TB37dpK.js → Hidden-DYY00jLm.js} +10 -10
- package/dist/I18nProvider-Cm6dj5jY.js +93 -0
- package/dist/Label-B1TkoVOG.js +17 -0
- package/dist/ListBox-BquE0m8z.js +584 -0
- package/dist/{NumberFormatter-m5VW6MTK.js → NumberFormatter-JHF0Tadk.js} +24 -26
- package/dist/PortalProvider-BYcv24il.js +13 -0
- package/dist/RadioGroup-BxjLooWU.js +324 -0
- package/dist/SearchField-BkAU0HLm.js +322 -0
- package/dist/SelectionIndicator-Bx_EYBXD.js +13 -0
- package/dist/{Slider-DW1RuMVp.js → Slider-DSv6fyZ6.js} +321 -363
- package/dist/Text-C8pfwn0W.js +16 -0
- package/dist/{VisuallyHidden-CfsnJHZb.js → VisuallyHidden-KcXlGa5p.js} +12 -12
- package/dist/{animation-Bd2peown.js → animation-BJ-2VKdB.js} +12 -12
- package/dist/assets/fonts/google-sans-flex-latin-ext-full-normal.woff2 +0 -0
- package/dist/assets/fonts/google-sans-flex-latin-full-normal.woff2 +0 -0
- package/dist/assets/fonts/google-sans-flex-symbols-full-normal.woff2 +0 -0
- package/dist/assets/style-admin.css +1 -1
- package/dist/assets/style-editor.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/{button-D9cbyHeZ.js → button-CawAzlko.js} +21 -73
- package/dist/{checkbox-BO5RZmO8.js → checkbox-t7VrqXv2.js} +59 -62
- package/dist/{color-swatch-D2ZBkuTt.js → color-swatch-gU09x9Ga.js} +417 -414
- package/dist/components/base-control/base-control.js +2 -2
- package/dist/components/base-control/container.js +1 -1
- package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +2 -2
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +4 -4
- package/dist/components/container-panel/container-panel.js +5 -5
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +1 -1
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +7 -7
- package/dist/components/index.js +15 -15
- package/dist/components/input-field/input-field.js +1 -1
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +1 -1
- package/dist/components/matrix-align/matrix-align.js +5 -5
- package/dist/components/menu/menu.js +11 -11
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/number-picker/number-picker.js +1 -1
- package/dist/components/option-select/option-select.js +3 -3
- package/dist/components/options-panel/options-panel.js +3 -3
- package/dist/components/placeholders/file-picker-shell.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +6 -6
- package/dist/components/portal-provider/portal-provider.js +2 -2
- package/dist/components/radio/radio.js +9 -9
- package/dist/components/repeater/repeater-item.js +2 -2
- package/dist/components/repeater/repeater.js +3 -3
- package/dist/components/responsive/mini-responsive.js +6 -6
- package/dist/components/responsive/responsive-legacy.js +5 -5
- package/dist/components/responsive/responsive.js +5 -5
- package/dist/components/responsive-preview/responsive-preview.js +2 -2
- package/dist/components/select/async-multi-select.js +27 -26
- package/dist/components/select/async-select.js +27 -26
- package/dist/components/select/multi-select.js +33 -32
- package/dist/components/select/shared.js +1 -1
- package/dist/components/select/single-select.js +33 -32
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +8 -8
- package/dist/components/slider/slider.js +8 -8
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/smart-image/smart-image.js +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toggle/switch.js +1 -1
- package/dist/components/toggle/toggle.js +3 -3
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/{draggable-CTDVJ4zd.js → draggable-Cxv-OueQ.js} +1 -1
- package/dist/filterDOMProps-BfW758QC.js +69 -0
- package/dist/{gradient-editor-xfxA_s9a.js → gradient-editor-CInqVF8v.js} +6 -11
- package/dist/icons/index.js +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +15 -15
- package/dist/{input-field-_OCWbftf.js → input-field-BdFrxQ-R.js} +46 -47
- package/dist/{jsx-svg-BRJ4n3pD.js → jsx-svg-DT1SBWuP.js} +6 -12
- package/dist/keyboard-CT41mQzR.js +55 -0
- package/dist/{link-input-Bh8G7Urm.js → link-input-BDFhSSvH.js} +324 -356
- package/dist/{modal-snrElwty.js → modal-CJDaBdPh.js} +100 -92
- package/dist/{number-ZZIxJukn.js → number-MWRvGfyE.js} +10 -10
- package/dist/{number-picker-Dhtx4409.js → number-picker-BrxrB-xq.js} +43 -42
- package/dist/{shared-BiWZjrGF.js → shared-CI4kcnm8.js} +482 -502
- package/dist/{smart-image-CBNbxJ57.js → smart-image-eGdMu9s9.js} +2 -2
- package/dist/{solid-color-picker-DukArNH-.js → solid-color-picker-DXgX-OAm.js} +926 -935
- package/dist/{switch-DmsvyQPa.js → switch-DNHFoCCx.js} +28 -28
- package/dist/{tabs-DaIUEc0g.js → tabs-C2tPOEYr.js} +150 -153
- package/dist/textSelection-BhX_2zV9.js +45 -0
- package/dist/{toggle-button-BlzUGfGy.js → toggle-button-DYDp11rq.js} +35 -35
- package/dist/{tooltip-BzJzYlcc.js → tooltip-C-hT6tN9.js} +162 -162
- package/dist/{useAsyncList-BNzwKoX4.js → useAsyncList-DsOh1xIx.js} +54 -74
- package/dist/{useButton-ra1ZSZ4z.js → useButton-BMZc4fTX.js} +11 -11
- package/dist/{SelectionManager-B8lLv6Ue.js → useCollection-CBVYSuGz.js} +1689 -1777
- package/dist/{useEvent-DkZVfgsS.js → useEvent-ypAU33vv.js} +5 -5
- package/dist/useField-BXf__jxy.js +32 -0
- package/dist/{useFilter-OiMnf6sb.js → useFilter-CfKEbIwL.js} +5 -5
- package/dist/{useFocusRing-DuYL4cdO.js → useFocusRing-BgYY-7ko.js} +23 -23
- package/dist/useFormReset-BuMc_O4y.js +17 -0
- package/dist/{FieldError-BWDbP5Db.js → useFormValidation-BcME9D0E.js} +63 -66
- package/dist/useHover-lyApu3ba.js +975 -0
- package/dist/{useLabel-2EohW5l6.js → useLabel-Rv8cIIKk.js} +8 -8
- package/dist/{useLabels-B2p7RXi5.js → useLabels-xOYtkA8o.js} +5 -5
- package/dist/useListState-u6DfeXHi.js +135 -0
- package/dist/{useLocalizedStringFormatter-Dv2diN3k.js → useLocalizedStringFormatter-CR-bmorj.js} +45 -45
- package/dist/{useNumberField-2xbi3jRV.js → useNumberFieldState-xL-ecwNz.js} +665 -619
- package/dist/useNumberFormatter-CR1PAFPG.js +10 -0
- package/dist/useOverlayTriggerState-AeCx45Gv.js +551 -0
- package/dist/usePress-Dnx5rBoD.js +593 -0
- package/dist/useTextField-BW3ZwGyz.js +159 -0
- package/dist/{useToggle-ecIirvIM.js → useToggle-BF5wptMP.js} +19 -20
- package/dist/useToggleState-D5P01lch.js +22 -0
- package/dist/useToolbar-BT25-MJg.js +55 -0
- package/dist/utilities/debounce-throttle.js +1 -1
- package/dist/utilities/es-dash.js +1 -1
- package/dist/utilities/index.js +3 -3
- package/dist/{utils-B_uiqNa4.js → utils-JFcCNFzy.js} +121 -122
- package/package.json +18 -18
- package/dist/Button-h6xF_WrP.js +0 -225
- package/dist/Dialog-i5VLQw1o.js +0 -2488
- package/dist/FocusScope-CgwbGOBB.js +0 -746
- package/dist/Form-DTMkbrQY.js +0 -5
- package/dist/Heading-Hol-wS_B.js +0 -16
- package/dist/Input-BURqyJXW.js +0 -161
- package/dist/Label-DFXXxMKY.js +0 -17
- package/dist/ListBox-B21SgugS.js +0 -601
- package/dist/OverlayArrow-BoloUPQM.js +0 -573
- package/dist/PortalProvider-DinZZCKX.js +0 -14
- package/dist/RSPContexts-C_z0bI8W.js +0 -12
- package/dist/RadioGroup-BwlGtCja.js +0 -329
- package/dist/SearchField-DR_I4_yn.js +0 -765
- package/dist/SelectionIndicator-31L6EI9F.js +0 -13
- package/dist/Text-O6VBBDlP.js +0 -16
- package/dist/context-C-XNeJ_l.js +0 -93
- package/dist/filterDOMProps-_2_3GD-K.js +0 -69
- package/dist/textSelection-Dv6WPj0Z.js +0 -45
- package/dist/useField-D0WrzR2F.js +0 -32
- package/dist/useFormReset-DdkykzAn.js +0 -18
- package/dist/useHover-qaMm3XFO.js +0 -982
- package/dist/useListState-CD_5vfyy.js +0 -147
- package/dist/useNumberFormatter-C2Cm2mNj.js +0 -10
- package/dist/usePress-ZP1TjkFf.js +0 -678
- package/dist/useToggleState-IIDbiKPl.js +0 -23
- /package/dist/{List-DWlgW2Ex.js → List---tsVJlI.js} +0 -0
- /package/dist/{build-module-Bsx62nlm.js → build-module-K6vi4xE0.js} +0 -0
- /package/dist/{debounce-throttle-DXxSAKpq.js → debounce-throttle-LSPAPFtq.js} +0 -0
- /package/dist/{dist-2gkv7_1U.js → dist-jw8wvxoG.js} +0 -0
- /package/dist/{es-dash-HqXWZZ3_.js → es-dash-BuShf_ht.js} +0 -0
- /package/dist/{utilities-lwX686oD.js → utilities-DV0KKJNR.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-Cm6dj5jY.js";
|
|
2
|
+
import { t as $1dfb119a85e764e5$export$cc77c4ff7e8673c5 } from "./NumberFormatter-JHF0Tadk.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
//#region node_modules/react-aria/dist/private/i18n/useNumberFormatter.mjs
|
|
5
|
+
function $bd90acf18e792be6$export$b7a616150fdb9f44(options = {}) {
|
|
6
|
+
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
7
|
+
return useMemo(() => new $1dfb119a85e764e5$export$cc77c4ff7e8673c5(locale, options), [locale, options]);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { $bd90acf18e792be6$export$b7a616150fdb9f44 as t };
|
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, o as $7230ffa83bc0c2cf$export$df3a06d6289f983e, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3 } from "./utils-JFcCNFzy.js";
|
|
2
|
+
import { B as $23f2114a1b82827e$export$b4f377a2b6254582, D as $2add3ce32c6007eb$export$78551043582a6a98, H as $23f2114a1b82827e$export$e58f029f0fbfdb29, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, d as $3e6197669829fe11$export$40bfa8c7b0832715, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-lyApu3ba.js";
|
|
3
|
+
import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-Cm6dj5jY.js";
|
|
4
|
+
import { t as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f } from "./filterDOMProps-BfW758QC.js";
|
|
5
|
+
import { t as $240e9101ba2842f5$export$7d15b64cf5a3a4c4 } from "./number-MWRvGfyE.js";
|
|
6
|
+
import React, { createContext, forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
7
|
+
//#region node_modules/react-aria-components/dist/private/OverlayArrow.mjs
|
|
8
|
+
var $4fcfe18fac72dabd$export$2de4954e8ae13b9f = createContext({ placement: "bottom" });
|
|
9
|
+
var $4fcfe18fac72dabd$export$746d02f47f4d381 = forwardRef(function OverlayArrow(props, ref) {
|
|
10
|
+
[props, ref] = $7230ffa83bc0c2cf$export$29f1550f4b0d4415(props, ref, $4fcfe18fac72dabd$export$2de4954e8ae13b9f);
|
|
11
|
+
let placement = props.placement;
|
|
12
|
+
let style = {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
transform: placement === "top" || placement === "bottom" ? "translateX(-50%)" : "translateY(-50%)"
|
|
15
|
+
};
|
|
16
|
+
if (placement != null) style[placement] = "100%";
|
|
17
|
+
let renderProps = $7230ffa83bc0c2cf$export$4d86445c2cf5e3({
|
|
18
|
+
...props,
|
|
19
|
+
defaultClassName: "react-aria-OverlayArrow",
|
|
20
|
+
values: { placement }
|
|
21
|
+
});
|
|
22
|
+
if (renderProps.style) Object.keys(renderProps.style).forEach((key) => renderProps.style[key] === void 0 && delete renderProps.style[key]);
|
|
23
|
+
let DOMProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props);
|
|
24
|
+
return React.createElement($7230ffa83bc0c2cf$export$df3a06d6289f983e.div, {
|
|
25
|
+
...DOMProps,
|
|
26
|
+
...renderProps,
|
|
27
|
+
style: {
|
|
28
|
+
...style,
|
|
29
|
+
...renderProps.style
|
|
30
|
+
},
|
|
31
|
+
ref,
|
|
32
|
+
"data-placement": placement
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region node_modules/react-aria/dist/private/overlays/calculatePosition.mjs
|
|
37
|
+
var $954926fb6168ae2a$var$AXIS = {
|
|
38
|
+
top: "top",
|
|
39
|
+
bottom: "top",
|
|
40
|
+
left: "left",
|
|
41
|
+
right: "left"
|
|
42
|
+
};
|
|
43
|
+
var $954926fb6168ae2a$var$FLIPPED_DIRECTION = {
|
|
44
|
+
top: "bottom",
|
|
45
|
+
bottom: "top",
|
|
46
|
+
left: "right",
|
|
47
|
+
right: "left"
|
|
48
|
+
};
|
|
49
|
+
var $954926fb6168ae2a$var$CROSS_AXIS = {
|
|
50
|
+
top: "left",
|
|
51
|
+
left: "top"
|
|
52
|
+
};
|
|
53
|
+
var $954926fb6168ae2a$var$AXIS_SIZE = {
|
|
54
|
+
top: "height",
|
|
55
|
+
left: "width"
|
|
56
|
+
};
|
|
57
|
+
var $954926fb6168ae2a$var$TOTAL_SIZE = {
|
|
58
|
+
width: "totalWidth",
|
|
59
|
+
height: "totalHeight"
|
|
60
|
+
};
|
|
61
|
+
var $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE = {};
|
|
62
|
+
var $954926fb6168ae2a$var$getVisualViewport = () => typeof document !== "undefined" ? window.visualViewport : null;
|
|
63
|
+
function $954926fb6168ae2a$var$getContainerDimensions(containerNode, visualViewport) {
|
|
64
|
+
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
65
|
+
let scroll = {};
|
|
66
|
+
let isPinchZoomedIn = (visualViewport?.scale ?? 1) > 1;
|
|
67
|
+
if (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") {
|
|
68
|
+
let documentElement = document.documentElement;
|
|
69
|
+
totalWidth = documentElement.clientWidth;
|
|
70
|
+
totalHeight = documentElement.clientHeight;
|
|
71
|
+
width = visualViewport?.width ?? totalWidth;
|
|
72
|
+
height = visualViewport?.height ?? totalHeight;
|
|
73
|
+
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
74
|
+
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
75
|
+
if (visualViewport) {
|
|
76
|
+
top = visualViewport.offsetTop;
|
|
77
|
+
left = visualViewport.offsetLeft;
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
({width: width, height: height, top: top, left: left} = $954926fb6168ae2a$var$getOffset(containerNode, false));
|
|
81
|
+
scroll.top = containerNode.scrollTop;
|
|
82
|
+
scroll.left = containerNode.scrollLeft;
|
|
83
|
+
totalWidth = width;
|
|
84
|
+
totalHeight = height;
|
|
85
|
+
}
|
|
86
|
+
if ($2add3ce32c6007eb$export$78551043582a6a98() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) {
|
|
87
|
+
scroll.top = 0;
|
|
88
|
+
scroll.left = 0;
|
|
89
|
+
top = visualViewport?.pageTop ?? 0;
|
|
90
|
+
left = visualViewport?.pageLeft ?? 0;
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
95
|
+
totalWidth,
|
|
96
|
+
totalHeight,
|
|
97
|
+
scroll,
|
|
98
|
+
top,
|
|
99
|
+
left
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function $954926fb6168ae2a$var$getScroll(node) {
|
|
103
|
+
return {
|
|
104
|
+
top: node.scrollTop,
|
|
105
|
+
left: node.scrollLeft,
|
|
106
|
+
width: node.scrollWidth,
|
|
107
|
+
height: node.scrollHeight
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function $954926fb6168ae2a$var$getDelta(axis, offset, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) {
|
|
111
|
+
let containerScroll = containerDimensions.scroll[axis] ?? 0;
|
|
112
|
+
let boundarySize = boundaryDimensions[$954926fb6168ae2a$var$AXIS_SIZE[axis]];
|
|
113
|
+
let boundaryStartEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + padding;
|
|
114
|
+
let boundaryEndEdge = containerOffsetWithBoundary[axis] + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + boundarySize - padding;
|
|
115
|
+
let startEdgeOffset = offset - containerScroll + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$954926fb6168ae2a$var$AXIS[axis]];
|
|
116
|
+
let endEdgeOffset = offset - containerScroll + size + boundaryDimensions.scroll[$954926fb6168ae2a$var$AXIS[axis]] + containerOffsetWithBoundary[axis] - boundaryDimensions[$954926fb6168ae2a$var$AXIS[axis]];
|
|
117
|
+
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
118
|
+
else if (endEdgeOffset > boundaryEndEdge) return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
119
|
+
else return 0;
|
|
120
|
+
}
|
|
121
|
+
function $954926fb6168ae2a$var$getMargins(node) {
|
|
122
|
+
let style = window.getComputedStyle(node);
|
|
123
|
+
return {
|
|
124
|
+
top: parseInt(style.marginTop, 10) || 0,
|
|
125
|
+
bottom: parseInt(style.marginBottom, 10) || 0,
|
|
126
|
+
left: parseInt(style.marginLeft, 10) || 0,
|
|
127
|
+
right: parseInt(style.marginRight, 10) || 0
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function $954926fb6168ae2a$var$parsePlacement(input) {
|
|
131
|
+
if ($954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input]) return $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input];
|
|
132
|
+
let [placement, crossPlacement] = input.split(" ");
|
|
133
|
+
let axis = $954926fb6168ae2a$var$AXIS[placement] || "right";
|
|
134
|
+
let crossAxis = $954926fb6168ae2a$var$CROSS_AXIS[axis];
|
|
135
|
+
if (!$954926fb6168ae2a$var$AXIS[crossPlacement]) crossPlacement = "center";
|
|
136
|
+
let size = $954926fb6168ae2a$var$AXIS_SIZE[axis];
|
|
137
|
+
let crossSize = $954926fb6168ae2a$var$AXIS_SIZE[crossAxis];
|
|
138
|
+
$954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input] = {
|
|
139
|
+
placement,
|
|
140
|
+
crossPlacement,
|
|
141
|
+
axis,
|
|
142
|
+
crossAxis,
|
|
143
|
+
size,
|
|
144
|
+
crossSize
|
|
145
|
+
};
|
|
146
|
+
return $954926fb6168ae2a$var$PARSED_PLACEMENT_CACHE[input];
|
|
147
|
+
}
|
|
148
|
+
function $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
|
|
149
|
+
let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo;
|
|
150
|
+
let position = {};
|
|
151
|
+
position[crossAxis] = childOffset[crossAxis] ?? 0;
|
|
152
|
+
if (crossPlacement === "center") position[crossAxis] += ((childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0)) / 2;
|
|
153
|
+
else if (crossPlacement !== crossAxis) position[crossAxis] += (childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0);
|
|
154
|
+
position[crossAxis] += crossOffset;
|
|
155
|
+
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
156
|
+
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
157
|
+
position[crossAxis] = $240e9101ba2842f5$export$7d15b64cf5a3a4c4(position[crossAxis], minPosition, maxPosition);
|
|
158
|
+
if (placement === axis) {
|
|
159
|
+
let containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[$954926fb6168ae2a$var$TOTAL_SIZE[size]];
|
|
160
|
+
position[$954926fb6168ae2a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
161
|
+
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
162
|
+
return position;
|
|
163
|
+
}
|
|
164
|
+
function $954926fb6168ae2a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
|
|
165
|
+
let overlayTop = (position.top != null ? position.top : containerDimensions[$954926fb6168ae2a$var$TOTAL_SIZE.height] - (position.bottom ?? 0) - overlayHeight) - (containerDimensions.scroll.top ?? 0);
|
|
166
|
+
let boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
|
|
167
|
+
let boundingRect = {
|
|
168
|
+
top: Math.max(boundaryDimensions.top + boundaryToContainerTransformOffset, (visualViewport?.offsetTop ?? boundaryDimensions.top) + boundaryToContainerTransformOffset),
|
|
169
|
+
bottom: Math.min(boundaryDimensions.top + boundaryDimensions.height + boundaryToContainerTransformOffset, (visualViewport?.offsetTop ?? 0) + (visualViewport?.height ?? 0))
|
|
170
|
+
};
|
|
171
|
+
return heightGrowthDirection !== "top" ? Math.max(0, boundingRect.bottom - overlayTop - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding)) : Math.max(0, overlayTop + overlayHeight - boundingRect.top - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding));
|
|
172
|
+
}
|
|
173
|
+
function $954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
|
|
174
|
+
let { placement, axis, size } = placementInfo;
|
|
175
|
+
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);
|
|
176
|
+
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);
|
|
177
|
+
}
|
|
178
|
+
function $954926fb6168ae2a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
179
|
+
let placementInfo = $954926fb6168ae2a$var$parsePlacement(placementInput);
|
|
180
|
+
let { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo;
|
|
181
|
+
let position = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
182
|
+
let normalizedOffset = offset;
|
|
183
|
+
let space = $954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
184
|
+
if (flip && overlaySize[size] > space) {
|
|
185
|
+
let flippedPlacementInfo = $954926fb6168ae2a$var$parsePlacement(`${$954926fb6168ae2a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
186
|
+
let flippedPosition = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
187
|
+
if ($954926fb6168ae2a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary) > space) {
|
|
188
|
+
placementInfo = flippedPlacementInfo;
|
|
189
|
+
position = flippedPosition;
|
|
190
|
+
normalizedOffset = offset;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
let heightGrowthDirection = "bottom";
|
|
194
|
+
if (placementInfo.axis === "top") {
|
|
195
|
+
if (placementInfo.placement === "top") heightGrowthDirection = "top";
|
|
196
|
+
else if (placementInfo.placement === "bottom") heightGrowthDirection = "bottom";
|
|
197
|
+
} else if (placementInfo.crossAxis === "top") {
|
|
198
|
+
if (placementInfo.crossPlacement === "top") heightGrowthDirection = "bottom";
|
|
199
|
+
else if (placementInfo.crossPlacement === "bottom") heightGrowthDirection = "top";
|
|
200
|
+
}
|
|
201
|
+
let delta = $954926fb6168ae2a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
202
|
+
position[crossAxis] += delta;
|
|
203
|
+
let maxHeight = $954926fb6168ae2a$var$getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
|
|
204
|
+
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
205
|
+
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
206
|
+
position = $954926fb6168ae2a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
207
|
+
delta = $954926fb6168ae2a$var$getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
208
|
+
position[crossAxis] += delta;
|
|
209
|
+
let arrowPosition = {};
|
|
210
|
+
let origin = childOffset[crossAxis] - position[crossAxis] - margins[$954926fb6168ae2a$var$AXIS[crossAxis]];
|
|
211
|
+
let preferredArrowPosition = origin + .5 * childOffset[crossSize];
|
|
212
|
+
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
213
|
+
const overlayMargin = $954926fb6168ae2a$var$AXIS[crossAxis] === "left" ? (margins.left ?? 0) + (margins.right ?? 0) : (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
214
|
+
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
215
|
+
arrowPosition[crossAxis] = $240e9101ba2842f5$export$7d15b64cf5a3a4c4($240e9101ba2842f5$export$7d15b64cf5a3a4c4(preferredArrowPosition, childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]]), childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + margins[$954926fb6168ae2a$var$AXIS[crossAxis]])), arrowMinPosition, arrowMaxPosition);
|
|
216
|
+
({placement: placement, crossPlacement: crossPlacement} = placementInfo);
|
|
217
|
+
if (arrowSize) origin = arrowPosition[crossAxis];
|
|
218
|
+
else if (crossPlacement === "right") origin += childOffset[crossSize];
|
|
219
|
+
else if (crossPlacement === "center") origin += childOffset[crossSize] / 2;
|
|
220
|
+
let crossOrigin = placement === "left" || placement === "top" ? overlaySize[size] : 0;
|
|
221
|
+
let triggerAnchorPoint = {
|
|
222
|
+
x: placement === "top" || placement === "bottom" ? origin : crossOrigin,
|
|
223
|
+
y: placement === "left" || placement === "right" ? origin : crossOrigin
|
|
224
|
+
};
|
|
225
|
+
return {
|
|
226
|
+
position,
|
|
227
|
+
maxHeight,
|
|
228
|
+
arrowOffsetLeft: arrowPosition.left,
|
|
229
|
+
arrowOffsetTop: arrowPosition.top,
|
|
230
|
+
placement,
|
|
231
|
+
triggerAnchorPoint
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function $954926fb6168ae2a$export$b3ceb0cbf1056d98(opts) {
|
|
235
|
+
let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts;
|
|
236
|
+
let visualViewport = $954926fb6168ae2a$var$getVisualViewport();
|
|
237
|
+
let container = overlayNode instanceof HTMLElement ? $954926fb6168ae2a$var$getContainingBlock(overlayNode) : document.documentElement;
|
|
238
|
+
let isViewportContainer = container === document.documentElement;
|
|
239
|
+
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
240
|
+
let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
241
|
+
let childOffset = isViewportContainer ? $954926fb6168ae2a$var$getOffset(targetNode, false) : $954926fb6168ae2a$var$getPosition(targetNode, container, false);
|
|
242
|
+
if (!isViewportContainer) {
|
|
243
|
+
let { marginTop, marginLeft } = window.getComputedStyle(targetNode);
|
|
244
|
+
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
245
|
+
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
246
|
+
}
|
|
247
|
+
let overlaySize = $954926fb6168ae2a$var$getOffset(overlayNode, true);
|
|
248
|
+
let margins = $954926fb6168ae2a$var$getMargins(overlayNode);
|
|
249
|
+
overlaySize.width += (margins.left ?? 0) + (margins.right ?? 0);
|
|
250
|
+
overlaySize.height += (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
251
|
+
let scrollSize = $954926fb6168ae2a$var$getScroll(scrollNode);
|
|
252
|
+
let boundaryDimensions = $954926fb6168ae2a$var$getContainerDimensions(boundaryElement, visualViewport);
|
|
253
|
+
let containerDimensions = $954926fb6168ae2a$var$getContainerDimensions(container, visualViewport);
|
|
254
|
+
let containerOffsetWithBoundary;
|
|
255
|
+
if ((boundaryElement.tagName === "BODY" || boundaryElement.tagName === "HTML") && !isViewportContainer) {
|
|
256
|
+
let containerRect = $954926fb6168ae2a$export$4b834cebd9e5cebe(container, false);
|
|
257
|
+
containerOffsetWithBoundary = {
|
|
258
|
+
top: -(containerRect.top - boundaryDimensions.top),
|
|
259
|
+
left: -(containerRect.left - boundaryDimensions.left),
|
|
260
|
+
width: 0,
|
|
261
|
+
height: 0
|
|
262
|
+
};
|
|
263
|
+
} else if ((boundaryElement.tagName === "BODY" || boundaryElement.tagName === "HTML") && isViewportContainer) containerOffsetWithBoundary = {
|
|
264
|
+
top: 0,
|
|
265
|
+
left: 0,
|
|
266
|
+
width: 0,
|
|
267
|
+
height: 0
|
|
268
|
+
};
|
|
269
|
+
else containerOffsetWithBoundary = $954926fb6168ae2a$var$getPosition(boundaryElement, container, false);
|
|
270
|
+
let isContainerDescendentOfBoundary = $23f2114a1b82827e$export$4282f70798064fe0(boundaryElement, container);
|
|
271
|
+
return $954926fb6168ae2a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport);
|
|
272
|
+
}
|
|
273
|
+
function $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale) {
|
|
274
|
+
let { top, left, width, height } = node.getBoundingClientRect();
|
|
275
|
+
if (ignoreScale && node instanceof node.ownerDocument.defaultView.HTMLElement) {
|
|
276
|
+
width = node.offsetWidth;
|
|
277
|
+
height = node.offsetHeight;
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
top,
|
|
281
|
+
left,
|
|
282
|
+
width,
|
|
283
|
+
height
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function $954926fb6168ae2a$var$getOffset(node, ignoreScale) {
|
|
287
|
+
let { top, left, width, height } = $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale);
|
|
288
|
+
let { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
|
|
289
|
+
return {
|
|
290
|
+
top: top + scrollTop - clientTop,
|
|
291
|
+
left: left + scrollLeft - clientLeft,
|
|
292
|
+
width,
|
|
293
|
+
height
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function $954926fb6168ae2a$var$getPosition(node, parent, ignoreScale) {
|
|
297
|
+
let style = window.getComputedStyle(node);
|
|
298
|
+
let offset;
|
|
299
|
+
if (style.position === "fixed") offset = $954926fb6168ae2a$export$4b834cebd9e5cebe(node, ignoreScale);
|
|
300
|
+
else {
|
|
301
|
+
offset = $954926fb6168ae2a$var$getOffset(node, ignoreScale);
|
|
302
|
+
let parentOffset = $954926fb6168ae2a$var$getOffset(parent, ignoreScale);
|
|
303
|
+
let parentStyle = window.getComputedStyle(parent);
|
|
304
|
+
parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop;
|
|
305
|
+
parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft;
|
|
306
|
+
offset.top -= parentOffset.top;
|
|
307
|
+
offset.left -= parentOffset.left;
|
|
308
|
+
}
|
|
309
|
+
offset.top -= parseInt(style.marginTop, 10) || 0;
|
|
310
|
+
offset.left -= parseInt(style.marginLeft, 10) || 0;
|
|
311
|
+
return offset;
|
|
312
|
+
}
|
|
313
|
+
function $954926fb6168ae2a$var$getContainingBlock(node) {
|
|
314
|
+
let offsetParent = node.offsetParent;
|
|
315
|
+
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$954926fb6168ae2a$var$isContainingBlock(offsetParent)) offsetParent = document.documentElement;
|
|
316
|
+
if (offsetParent == null) {
|
|
317
|
+
offsetParent = node.parentElement;
|
|
318
|
+
while (offsetParent && !$954926fb6168ae2a$var$isContainingBlock(offsetParent)) offsetParent = offsetParent.parentElement;
|
|
319
|
+
}
|
|
320
|
+
return offsetParent || document.documentElement;
|
|
321
|
+
}
|
|
322
|
+
function $954926fb6168ae2a$var$isContainingBlock(node) {
|
|
323
|
+
let style = window.getComputedStyle(node);
|
|
324
|
+
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";
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region node_modules/react-aria/dist/private/overlays/useCloseOnScroll.mjs
|
|
328
|
+
var $22e2f5f6490788e8$export$f6211563215e3b37 = new WeakMap();
|
|
329
|
+
function $22e2f5f6490788e8$export$18fc8428861184da(opts) {
|
|
330
|
+
let { triggerRef, isOpen, onClose } = opts;
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
if (!isOpen || onClose === null) return;
|
|
333
|
+
let onScroll = (e) => {
|
|
334
|
+
let target = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
335
|
+
if (!triggerRef.current || target instanceof Node && !$23f2114a1b82827e$export$4282f70798064fe0(target, triggerRef.current)) return;
|
|
336
|
+
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;
|
|
337
|
+
let onCloseHandler = onClose || $22e2f5f6490788e8$export$f6211563215e3b37.get(triggerRef.current);
|
|
338
|
+
if (onCloseHandler) onCloseHandler();
|
|
339
|
+
};
|
|
340
|
+
window.addEventListener("scroll", onScroll, true);
|
|
341
|
+
return () => {
|
|
342
|
+
window.removeEventListener("scroll", onScroll, true);
|
|
343
|
+
};
|
|
344
|
+
}, [
|
|
345
|
+
isOpen,
|
|
346
|
+
onClose,
|
|
347
|
+
triggerRef
|
|
348
|
+
]);
|
|
349
|
+
}
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region node_modules/react-aria/dist/private/utils/useResizeObserver.mjs
|
|
352
|
+
function $970072cf4b13fde3$var$hasResizeObserver() {
|
|
353
|
+
return typeof window.ResizeObserver !== "undefined";
|
|
354
|
+
}
|
|
355
|
+
function $970072cf4b13fde3$export$683480f191c0e3ea(options) {
|
|
356
|
+
const { ref, box, onResize } = options;
|
|
357
|
+
let onResizeEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(onResize);
|
|
358
|
+
useEffect(() => {
|
|
359
|
+
let element = ref?.current;
|
|
360
|
+
if (!element) return;
|
|
361
|
+
if (!$970072cf4b13fde3$var$hasResizeObserver()) {
|
|
362
|
+
window.addEventListener("resize", onResizeEvent, false);
|
|
363
|
+
return () => {
|
|
364
|
+
window.removeEventListener("resize", onResizeEvent, false);
|
|
365
|
+
};
|
|
366
|
+
} else {
|
|
367
|
+
const resizeObserverInstance = new window.ResizeObserver((entries) => {
|
|
368
|
+
if (!entries.length) return;
|
|
369
|
+
onResizeEvent();
|
|
370
|
+
});
|
|
371
|
+
resizeObserverInstance.observe(element, { box });
|
|
372
|
+
return () => {
|
|
373
|
+
if (element) resizeObserverInstance.unobserve(element);
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}, [ref, box]);
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region node_modules/react-aria/dist/private/overlays/useOverlayPosition.mjs
|
|
380
|
+
var $b3526bc71400be8d$var$visualViewport = typeof document !== "undefined" ? window.visualViewport : null;
|
|
381
|
+
function $b3526bc71400be8d$export$d39e1813b3bdd0e1(props) {
|
|
382
|
+
let { direction } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
383
|
+
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;
|
|
384
|
+
let [position, setPosition] = useState(null);
|
|
385
|
+
let deps = [
|
|
386
|
+
shouldUpdatePosition,
|
|
387
|
+
placement,
|
|
388
|
+
overlayRef.current,
|
|
389
|
+
targetRef.current,
|
|
390
|
+
arrowRef?.current,
|
|
391
|
+
scrollRef.current,
|
|
392
|
+
containerPadding,
|
|
393
|
+
shouldFlip,
|
|
394
|
+
boundaryElement,
|
|
395
|
+
offset,
|
|
396
|
+
crossOffset,
|
|
397
|
+
isOpen,
|
|
398
|
+
direction,
|
|
399
|
+
maxHeight,
|
|
400
|
+
arrowBoundaryOffset,
|
|
401
|
+
arrowSize
|
|
402
|
+
];
|
|
403
|
+
let lastScale = useRef($b3526bc71400be8d$var$visualViewport?.scale);
|
|
404
|
+
useEffect(() => {
|
|
405
|
+
if (isOpen) lastScale.current = $b3526bc71400be8d$var$visualViewport?.scale;
|
|
406
|
+
}, [isOpen]);
|
|
407
|
+
let updatePosition = useCallback(() => {
|
|
408
|
+
if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) return;
|
|
409
|
+
if ($b3526bc71400be8d$var$visualViewport?.scale !== lastScale.current) return;
|
|
410
|
+
let anchor = null;
|
|
411
|
+
if (scrollRef.current && $23f2114a1b82827e$export$b4f377a2b6254582(scrollRef.current)) {
|
|
412
|
+
let anchorRect = $23f2114a1b82827e$export$cd4e5573fbe2b576()?.getBoundingClientRect();
|
|
413
|
+
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
414
|
+
anchor = {
|
|
415
|
+
type: "top",
|
|
416
|
+
offset: (anchorRect?.top ?? 0) - scrollRect.top
|
|
417
|
+
};
|
|
418
|
+
if (anchor.offset > scrollRect.height / 2) {
|
|
419
|
+
anchor.type = "bottom";
|
|
420
|
+
anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
let overlay = overlayRef.current;
|
|
424
|
+
if (!maxHeight && overlayRef.current) {
|
|
425
|
+
overlay.style.top = "0px";
|
|
426
|
+
overlay.style.bottom = "";
|
|
427
|
+
overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + "px";
|
|
428
|
+
}
|
|
429
|
+
let position = $954926fb6168ae2a$export$b3ceb0cbf1056d98({
|
|
430
|
+
placement: $b3526bc71400be8d$var$translateRTL(placement, direction),
|
|
431
|
+
overlayNode: overlayRef.current,
|
|
432
|
+
targetNode: targetRef.current,
|
|
433
|
+
scrollNode: scrollRef.current || overlayRef.current,
|
|
434
|
+
padding: containerPadding,
|
|
435
|
+
shouldFlip,
|
|
436
|
+
boundaryElement,
|
|
437
|
+
offset,
|
|
438
|
+
crossOffset,
|
|
439
|
+
maxHeight,
|
|
440
|
+
arrowSize: arrowSize ?? (arrowRef?.current ? $954926fb6168ae2a$export$4b834cebd9e5cebe(arrowRef.current, true).width : 0),
|
|
441
|
+
arrowBoundaryOffset
|
|
442
|
+
});
|
|
443
|
+
if (!position.position) return;
|
|
444
|
+
overlay.style.top = "";
|
|
445
|
+
overlay.style.bottom = "";
|
|
446
|
+
overlay.style.left = "";
|
|
447
|
+
overlay.style.right = "";
|
|
448
|
+
Object.keys(position.position).forEach((key) => overlay.style[key] = position.position[key] + "px");
|
|
449
|
+
overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + "px" : "";
|
|
450
|
+
let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
|
|
451
|
+
if (anchor && activeElement && scrollRef.current) {
|
|
452
|
+
let anchorRect = activeElement.getBoundingClientRect();
|
|
453
|
+
let scrollRect = scrollRef.current.getBoundingClientRect();
|
|
454
|
+
let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];
|
|
455
|
+
scrollRef.current.scrollTop += newOffset - anchor.offset;
|
|
456
|
+
}
|
|
457
|
+
setPosition(position);
|
|
458
|
+
}, deps);
|
|
459
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(updatePosition, deps);
|
|
460
|
+
$b3526bc71400be8d$var$useResize(updatePosition);
|
|
461
|
+
$970072cf4b13fde3$export$683480f191c0e3ea({
|
|
462
|
+
ref: overlayRef,
|
|
463
|
+
onResize: updatePosition
|
|
464
|
+
});
|
|
465
|
+
$970072cf4b13fde3$export$683480f191c0e3ea({
|
|
466
|
+
ref: targetRef,
|
|
467
|
+
onResize: updatePosition
|
|
468
|
+
});
|
|
469
|
+
let isResizing = useRef(false);
|
|
470
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
471
|
+
let timeout;
|
|
472
|
+
let onResize = () => {
|
|
473
|
+
isResizing.current = true;
|
|
474
|
+
clearTimeout(timeout);
|
|
475
|
+
timeout = setTimeout(() => {
|
|
476
|
+
isResizing.current = false;
|
|
477
|
+
}, 500);
|
|
478
|
+
updatePosition();
|
|
479
|
+
};
|
|
480
|
+
let onScroll = () => {
|
|
481
|
+
if (isResizing.current) onResize();
|
|
482
|
+
};
|
|
483
|
+
$b3526bc71400be8d$var$visualViewport?.addEventListener("resize", onResize);
|
|
484
|
+
$b3526bc71400be8d$var$visualViewport?.addEventListener("scroll", onScroll);
|
|
485
|
+
return () => {
|
|
486
|
+
$b3526bc71400be8d$var$visualViewport?.removeEventListener("resize", onResize);
|
|
487
|
+
$b3526bc71400be8d$var$visualViewport?.removeEventListener("scroll", onScroll);
|
|
488
|
+
};
|
|
489
|
+
}, [updatePosition]);
|
|
490
|
+
let close = useCallback(() => {
|
|
491
|
+
if (!isResizing.current) onClose?.();
|
|
492
|
+
}, [onClose, isResizing]);
|
|
493
|
+
$22e2f5f6490788e8$export$18fc8428861184da({
|
|
494
|
+
triggerRef: targetRef,
|
|
495
|
+
isOpen,
|
|
496
|
+
onClose: onClose && close
|
|
497
|
+
});
|
|
498
|
+
return {
|
|
499
|
+
overlayProps: { style: {
|
|
500
|
+
position: position ? "absolute" : "fixed",
|
|
501
|
+
top: !position ? 0 : void 0,
|
|
502
|
+
left: !position ? 0 : void 0,
|
|
503
|
+
zIndex: 1e5,
|
|
504
|
+
...position?.position,
|
|
505
|
+
maxHeight: position?.maxHeight ?? "100vh"
|
|
506
|
+
} },
|
|
507
|
+
placement: position?.placement ?? null,
|
|
508
|
+
triggerAnchorPoint: position?.triggerAnchorPoint ?? null,
|
|
509
|
+
arrowProps: {
|
|
510
|
+
"aria-hidden": "true",
|
|
511
|
+
role: "presentation",
|
|
512
|
+
style: {
|
|
513
|
+
left: position?.arrowOffsetLeft,
|
|
514
|
+
top: position?.arrowOffsetTop
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
updatePosition
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
function $b3526bc71400be8d$var$useResize(onResize) {
|
|
521
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
522
|
+
window.addEventListener("resize", onResize, false);
|
|
523
|
+
return () => {
|
|
524
|
+
window.removeEventListener("resize", onResize, false);
|
|
525
|
+
};
|
|
526
|
+
}, [onResize]);
|
|
527
|
+
}
|
|
528
|
+
function $b3526bc71400be8d$var$translateRTL(position, direction) {
|
|
529
|
+
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
530
|
+
return position.replace("start", "left").replace("end", "right");
|
|
531
|
+
}
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region node_modules/react-stately/dist/private/overlays/useOverlayTriggerState.mjs
|
|
534
|
+
function $f11fb0bcf1b2687a$export$61c6a8c84e605fb6(props) {
|
|
535
|
+
let [isOpen, setOpen] = $3e6197669829fe11$export$40bfa8c7b0832715(props.isOpen, props.defaultOpen || false, props.onOpenChange);
|
|
536
|
+
return {
|
|
537
|
+
isOpen,
|
|
538
|
+
setOpen,
|
|
539
|
+
open: useCallback(() => {
|
|
540
|
+
setOpen(true);
|
|
541
|
+
}, [setOpen]),
|
|
542
|
+
close: useCallback(() => {
|
|
543
|
+
setOpen(false);
|
|
544
|
+
}, [setOpen]),
|
|
545
|
+
toggle: useCallback(() => {
|
|
546
|
+
setOpen(!isOpen);
|
|
547
|
+
}, [setOpen, isOpen])
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
//#endregion
|
|
551
|
+
export { $4fcfe18fac72dabd$export$2de4954e8ae13b9f as a, $22e2f5f6490788e8$export$f6211563215e3b37 as i, $b3526bc71400be8d$export$d39e1813b3bdd0e1 as n, $4fcfe18fac72dabd$export$746d02f47f4d381 as o, $970072cf4b13fde3$export$683480f191c0e3ea as r, $f11fb0bcf1b2687a$export$61c6a8c84e605fb6 as t };
|