@orchidui/dashboard 1.8.1-95 → 1.8.1-96
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/AccordionTrigger.vue_vue_type_script_setup_true_lang-BdmLII9i.js +295 -0
- package/dist/CalendarPrevButton.vue_vue_type_script_setup_true_lang-DpJRpFhK.js +891 -0
- package/dist/CardTitle.vue_vue_type_script_setup_true_lang-D2_Bj3jw.js +68 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-C51LjITJ.js +172 -0
- package/dist/CollapsibleTrigger-fCarY5DJ.js +154 -0
- package/dist/Collection-COudIl-A.js +55 -0
- package/dist/ConfigProvider-7mV0D7Sp.js +6 -0
- package/dist/Dashboard/Card/OcCard.js +1 -1
- package/dist/Dashboard/TextEditor/QuillEditor.js +1 -1
- package/dist/DialogContent.vue_vue_type_script_setup_true_lang-CdrrrG29.js +68 -0
- package/dist/DialogOverlay-Cj3UTjZ8.js +309 -0
- package/dist/DialogPortal-zAvO8zt4.js +23 -0
- package/dist/DialogTrigger-BIF1A4hk.js +72 -0
- package/dist/DismissableLayer-C7IJliOb.js +151 -0
- package/dist/FocusScope--pJ6bboI.js +121 -0
- package/dist/FormMessage.vue_vue_type_script_setup_true_lang-DwlnFEn2.js +92 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-BrjsUUvL.js +27 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-D_LMIKBv.js +51 -0
- package/dist/ListboxItem-CjMk-mEX.js +417 -0
- package/dist/MenuSubTrigger-CUrxnPwO.js +845 -0
- package/dist/{OcCard-D3be6IMj.js → OcCard-B3SCzVwn.js} +54 -58
- package/dist/{OcLottieAnimation-0mdksHMn.js → OcLottieAnimation-DeMoIDaX.js} +1 -1
- package/dist/PopoverTrigger.vue_vue_type_script_setup_true_lang-DtI_qIyx.js +394 -0
- package/dist/PopperContent-BT3Svcc3.js +1465 -0
- package/dist/Presence-CxfTrw6l.js +133 -0
- package/dist/Primitive-B3twiLO1.js +44 -0
- package/dist/{QuillEditor-DRwC0sgJ.js → QuillEditor-hFQ0MJZO.js} +556 -579
- package/dist/RadioGroupItem.vue_vue_type_script_setup_true_lang-BNfRYIhL.js +297 -0
- package/dist/RovingFocusGroup-0OHdFQl0.js +92 -0
- package/dist/RovingFocusItem-s7Ug6oxb.js +82 -0
- package/dist/SelectValue.vue_vue_type_script_setup_true_lang-CVsYrN1R.js +1255 -0
- package/dist/Separator-DRam5i7g.js +54 -0
- package/dist/Separator.vue_vue_type_script_setup_true_lang-DGPbh6Dt.js +27 -0
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-k1A7l6Y-.js +17 -0
- package/dist/Switch.vue_vue_type_script_setup_true_lang-94ZKgnTz.js +135 -0
- package/dist/Teleport-DnUewq5H.js +25 -0
- package/dist/Textarea.vue_vue_type_script_setup_true_lang-DKazues9.js +27 -0
- package/dist/TooltipTrigger.vue_vue_type_script_setup_true_lang-CZ3AuN38.js +426 -0
- package/dist/VisuallyHidden-DMAU4heD.js +41 -0
- package/dist/VisuallyHiddenInput-DvJnsVHt.js +59 -0
- package/dist/_commonjsHelpers-B4e78b8K.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/array-CqVTtuYm.js +6 -0
- package/dist/arrays-4jDZqbdb.js +20 -0
- package/dist/check-C2tzJ0Gk.js +11 -0
- package/dist/chevron-down-CnpAlizg.js +13 -0
- package/dist/chevron-left-BOwFasou.js +13 -0
- package/dist/chevron-right-D308801z.js +13 -0
- package/dist/circle-A-6NpYiX.js +13 -0
- package/dist/clamp-BL1Rb24G.js +22 -0
- package/dist/constant-CuDQlTIy.js +3433 -0
- package/dist/createContext-CZEfaSVa.js +17 -0
- package/dist/createLucideIcon-eXqDwUWj.js +71 -0
- package/dist/ellipsis-CEG9G7eN.js +15 -0
- package/dist/getActiveElement-B-HWdUIb.js +11 -0
- package/dist/handleAndDispatchCustomEvent-Byh08EHr.js +11 -0
- package/dist/index-B3LW8uSH.js +133 -0
- package/dist/index-BIlpXuWX.js +3430 -0
- package/dist/index-BlGEiPHj.js +1246 -0
- package/dist/index-BwPb_idr.js +574 -0
- package/dist/index-C9julNQm.js +173 -0
- package/dist/index-C_aI-Wfj.js +34 -0
- package/dist/index-CumjCvqB.js +5703 -0
- package/dist/index-LqWMCtOd.js +809 -0
- package/dist/index-OpE2oGce.js +110 -0
- package/dist/index.js +3 -3
- package/dist/isValueEqualOrExist-BDSMUv8t.js +8 -0
- package/dist/lib/utils.js +5 -0
- package/dist/nullish-CjWwlQS3.js +6 -0
- package/dist/ohash.D__AXeF1-DX2n0b2C.js +106 -0
- package/dist/plus-CgluTYQY.js +14 -0
- package/dist/text-zwICaAnx.js +743 -0
- package/dist/ui/accordion/index.js +7 -0
- package/dist/ui/alert/index.js +64 -0
- package/dist/ui/alert-dialog/index.js +356 -0
- package/dist/ui/aspect-ratio/index.js +50 -0
- package/dist/ui/auto-form/constant.js +5 -0
- package/dist/ui/auto-form/dependencies.js +61 -0
- package/dist/ui/auto-form/index.js +227 -0
- package/dist/ui/auto-form/interface.js +4 -0
- package/dist/ui/auto-form/utils.js +89 -0
- package/dist/ui/avatar/index.js +189 -0
- package/dist/ui/badge/index.js +37 -0
- package/dist/ui/breadcrumb/index.js +126 -0
- package/dist/ui/button/index.js +55 -0
- package/dist/ui/calendar/index.js +15 -0
- package/dist/ui/card/index.js +38 -0
- package/dist/ui/carousel/index.js +174 -0
- package/dist/ui/carousel/interface.js +1 -0
- package/dist/ui/carousel/useCarousel.js +1288 -0
- package/dist/ui/chart/index.js +8 -0
- package/dist/ui/chart/interface.js +1 -0
- package/dist/ui/chart-area/index.js +331 -0
- package/dist/ui/chart-bar/index.js +490 -0
- package/dist/ui/chart-donut/index.js +509 -0
- package/dist/ui/chart-line/index.js +110 -0
- package/dist/ui/checkbox/index.js +4 -0
- package/dist/ui/collapsible/index.js +60 -0
- package/dist/ui/combobox/index.js +877 -0
- package/dist/ui/command/index.js +323 -0
- package/dist/ui/context-menu/index.js +734 -0
- package/dist/ui/dialog/index.js +169 -0
- package/dist/ui/drawer/index.js +971 -0
- package/dist/ui/dropdown-menu/index.js +723 -0
- package/dist/ui/form/index.js +13 -0
- package/dist/ui/form/injectionKeys.js +4 -0
- package/dist/ui/form/useFormField.js +25 -0
- package/dist/ui/hover-card/index.js +331 -0
- package/dist/ui/input/index.js +4 -0
- package/dist/ui/label/index.js +4 -0
- package/dist/ui/menubar/index.js +862 -0
- package/dist/ui/navigation-menu/index.js +873 -0
- package/dist/ui/number-field/index.js +682 -0
- package/dist/ui/pagination/index.js +444 -0
- package/dist/ui/pin-input/index.js +308 -0
- package/dist/ui/popover/index.js +6 -0
- package/dist/ui/progress/index.js +137 -0
- package/dist/ui/radio-group/index.js +5 -0
- package/dist/ui/range-calendar/index.js +986 -0
- package/dist/ui/resizable/index.js +1432 -0
- package/dist/ui/scroll-area/index.js +775 -0
- package/dist/ui/select/index.js +135 -0
- package/dist/ui/separator/index.js +4 -0
- package/dist/ui/sheet/index.js +188 -0
- package/dist/ui/sidebar/index.js +652 -0
- package/dist/ui/sidebar/utils.js +12 -0
- package/dist/ui/skeleton/index.js +4 -0
- package/dist/ui/slider/index.js +478 -0
- package/dist/ui/sonner/index.js +892 -0
- package/dist/ui/stepper/index.js +442 -0
- package/dist/ui/switch/index.js +4 -0
- package/dist/ui/table/index.js +153 -0
- package/dist/ui/tabs/index.js +280 -0
- package/dist/ui/tags-input/index.js +449 -0
- package/dist/ui/textarea/index.js +4 -0
- package/dist/ui/toast/index.js +738 -0
- package/dist/ui/toast/use-toast.js +85 -0
- package/dist/ui/toggle/index.js +6 -0
- package/dist/ui/toggle-group/index.js +112 -0
- package/dist/ui/tooltip/index.js +29 -0
- package/dist/useArrowNavigation-BRMPveaB.js +49 -0
- package/dist/useBodyScrollLock-CazCRZjZ.js +153 -0
- package/dist/useDirection-C3C_TLKm.js +14 -0
- package/dist/useFocusGuards-CyjC9cG9.js +26 -0
- package/dist/useFormControl-CFVC51Lp.js +11 -0
- package/dist/useForwardExpose-DZT6mL_U.js +37 -0
- package/dist/useForwardPropsEmits-0XKBv1pB.js +33 -0
- package/dist/useGraceArea-D7-GP1ii.js +137 -0
- package/dist/useId-reAg216X.js +13 -0
- package/dist/useKbd-BJNupnml.js +41 -0
- package/dist/useLocale-BfU0LC8Z.js +14 -0
- package/dist/useNonce-C1ZOgOp5.js +14 -0
- package/dist/usePrimitiveElement-BjwUvHih.js +15 -0
- package/dist/useSingleOrMultipleValue-BkTAaaJB.js +43 -0
- package/dist/useSize-BnyQ8FZF.js +37 -0
- package/dist/useTypeahead-oSidjyFF.js +40 -0
- package/dist/utils-DKNaYMZh.js +57 -0
- package/dist/utils-Dx9la83v.js +35 -0
- package/dist/utils-DxQ_ywGa.js +55 -0
- package/dist/utils-SFgRDk1R.js +2748 -0
- package/dist/utils-W-UiqiPE.js +1869 -0
- package/dist/vee-validate-Cf8JDJ_k.js +2232 -0
- package/dist/x-Cl6YllUK.js +14 -0
- package/package.json +264 -2
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
import { defineComponent as j, useSlots as Qe, computed as H, toRefs as ea, createBlock as U, openBlock as W, unref as p, withCtx as G, renderSlot as q, ref as $, watchEffect as fe, withModifiers as aa, normalizeStyle as ta, getCurrentInstance as na, watch as Q, nextTick as Re, onMounted as ke, onBeforeUnmount as oa, onUnmounted as la, normalizeProps as ra, guardReactiveProps as ia, mergeProps as ve, createVNode as Te, createElementVNode as sa, createElementBlock as Ee, normalizeClass as Ae } from "vue";
|
|
2
|
+
import { c as ua } from "../../createContext-CZEfaSVa.js";
|
|
3
|
+
import { _ as da, a as va, b as ca } from "../../DialogOverlay-Cj3UTjZ8.js";
|
|
4
|
+
import { c as Ka } from "../../DialogOverlay-Cj3UTjZ8.js";
|
|
5
|
+
import { u as Ce } from "../../useForwardPropsEmits-0XKBv1pB.js";
|
|
6
|
+
import { c as ee } from "../../utils-SFgRDk1R.js";
|
|
7
|
+
import { r as me } from "../../index-OpE2oGce.js";
|
|
8
|
+
import { _ as pa } from "../../DialogPortal-zAvO8zt4.js";
|
|
9
|
+
import { _ as fa, a as ma } from "../../DialogTrigger-BIF1A4hk.js";
|
|
10
|
+
import { b as Qa } from "../../DialogTrigger-BIF1A4hk.js";
|
|
11
|
+
(function() {
|
|
12
|
+
var e;
|
|
13
|
+
try {
|
|
14
|
+
if (typeof document < "u") {
|
|
15
|
+
var a = document.createElement("style");
|
|
16
|
+
a.nonce = (e = document.head.querySelector("meta[property=csp-nonce]")) == null ? void 0 : e.content, a.appendChild(document.createTextNode('[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}')), document.head.appendChild(a);
|
|
17
|
+
}
|
|
18
|
+
} catch (n) {
|
|
19
|
+
console.error("vite-plugin-css-injected-by-js", n);
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
const wa = typeof window < "u" && typeof document < "u";
|
|
23
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
24
|
+
const ha = (e) => typeof e < "u";
|
|
25
|
+
function ga(e) {
|
|
26
|
+
return JSON.parse(JSON.stringify(e));
|
|
27
|
+
}
|
|
28
|
+
function Be(e, a, n, o = {}) {
|
|
29
|
+
var t, g, s;
|
|
30
|
+
const {
|
|
31
|
+
clone: m = !1,
|
|
32
|
+
passive: B = !1,
|
|
33
|
+
eventName: _,
|
|
34
|
+
deep: k = !1,
|
|
35
|
+
defaultValue: w,
|
|
36
|
+
shouldEmit: i
|
|
37
|
+
} = o, y = na(), h = n || (y == null ? void 0 : y.emit) || ((t = y == null ? void 0 : y.$emit) == null ? void 0 : t.bind(y)) || ((s = (g = y == null ? void 0 : y.proxy) == null ? void 0 : g.$emit) == null ? void 0 : s.bind(y == null ? void 0 : y.proxy));
|
|
38
|
+
let u = _;
|
|
39
|
+
a || (a = "modelValue"), u = u || `update:${a.toString()}`;
|
|
40
|
+
const N = (r) => m ? typeof m == "function" ? m(r) : ga(r) : r, L = () => ha(e[a]) ? N(e[a]) : w, v = (r) => {
|
|
41
|
+
i ? i(r) && h(u, r) : h(u, r);
|
|
42
|
+
};
|
|
43
|
+
if (B) {
|
|
44
|
+
const r = L(), c = $(r);
|
|
45
|
+
let d = !1;
|
|
46
|
+
return Q(
|
|
47
|
+
() => e[a],
|
|
48
|
+
(x) => {
|
|
49
|
+
d || (d = !0, c.value = N(x), Re(() => d = !1));
|
|
50
|
+
}
|
|
51
|
+
), Q(
|
|
52
|
+
c,
|
|
53
|
+
(x) => {
|
|
54
|
+
!d && (x !== e[a] || k) && v(x);
|
|
55
|
+
},
|
|
56
|
+
{ deep: k }
|
|
57
|
+
), c;
|
|
58
|
+
} else
|
|
59
|
+
return H({
|
|
60
|
+
get() {
|
|
61
|
+
return L();
|
|
62
|
+
},
|
|
63
|
+
set(r) {
|
|
64
|
+
v(r);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const [we, ya] = ua("DrawerRoot"), Fe = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
function R(e, a, n = !1) {
|
|
70
|
+
if (!e || !(e instanceof HTMLElement) || !a)
|
|
71
|
+
return;
|
|
72
|
+
const o = {};
|
|
73
|
+
Object.entries(a).forEach(([t, g]) => {
|
|
74
|
+
if (t.startsWith("--")) {
|
|
75
|
+
e.style.setProperty(t, g);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
o[t] = e.style[t], e.style[t] = g;
|
|
79
|
+
}), !n && Fe.set(e, o);
|
|
80
|
+
}
|
|
81
|
+
function ba(e, a) {
|
|
82
|
+
if (!e || !(e instanceof HTMLElement))
|
|
83
|
+
return;
|
|
84
|
+
const n = Fe.get(e);
|
|
85
|
+
n && Object.entries(n).forEach(([o, t]) => {
|
|
86
|
+
e.style[o] = t;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function ue(e, a) {
|
|
90
|
+
const n = window.getComputedStyle(e), o = n.transform || n.webkitTransform || n.mozTransform;
|
|
91
|
+
let t = o.match(/^matrix3d\((.+)\)$/);
|
|
92
|
+
return t ? Number.parseFloat(t[1].split(", ")[T(a) ? 13 : 12]) : (t = o.match(/^matrix\((.+)\)$/), t ? Number.parseFloat(t[1].split(", ")[T(a) ? 5 : 4]) : null);
|
|
93
|
+
}
|
|
94
|
+
function $a(e) {
|
|
95
|
+
return 8 * (Math.log(e + 1) - 2);
|
|
96
|
+
}
|
|
97
|
+
function T(e) {
|
|
98
|
+
switch (e) {
|
|
99
|
+
case "top":
|
|
100
|
+
case "bottom":
|
|
101
|
+
return !0;
|
|
102
|
+
case "left":
|
|
103
|
+
case "right":
|
|
104
|
+
return !1;
|
|
105
|
+
default:
|
|
106
|
+
return e;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function pe(e, a) {
|
|
110
|
+
if (!e)
|
|
111
|
+
return () => {
|
|
112
|
+
};
|
|
113
|
+
const n = e.style.cssText;
|
|
114
|
+
return Object.assign(e.style, a), () => {
|
|
115
|
+
e.style.cssText = n;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function xa(...e) {
|
|
119
|
+
return (...a) => {
|
|
120
|
+
for (const n of e)
|
|
121
|
+
typeof n == "function" && n(...a);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const S = {
|
|
125
|
+
DURATION: 0.5,
|
|
126
|
+
EASE: [0.32, 0.72, 0, 1]
|
|
127
|
+
}, Ie = 0.4, Da = 0.25, Sa = 100, Ne = 8, de = 16, ze = 26, _e = "vaul-dragging";
|
|
128
|
+
function Oa({
|
|
129
|
+
activeSnapPoint: e,
|
|
130
|
+
snapPoints: a,
|
|
131
|
+
drawerRef: n,
|
|
132
|
+
overlayRef: o,
|
|
133
|
+
fadeFromIndex: t,
|
|
134
|
+
onSnapPointChange: g,
|
|
135
|
+
direction: s
|
|
136
|
+
}) {
|
|
137
|
+
const m = $(typeof window < "u" ? {
|
|
138
|
+
innerWidth: window.innerWidth,
|
|
139
|
+
innerHeight: window.innerHeight
|
|
140
|
+
} : void 0);
|
|
141
|
+
function B() {
|
|
142
|
+
m.value = {
|
|
143
|
+
innerWidth: window.innerWidth,
|
|
144
|
+
innerHeight: window.innerHeight
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
ke(() => {
|
|
148
|
+
typeof window < "u" && window.addEventListener("resize", B);
|
|
149
|
+
}), oa(() => {
|
|
150
|
+
typeof window < "u" && window.removeEventListener("resize", B);
|
|
151
|
+
});
|
|
152
|
+
const _ = H(
|
|
153
|
+
() => (a.value && e.value === a.value[a.value.length - 1]) ?? null
|
|
154
|
+
), k = H(
|
|
155
|
+
() => a.value && a.value.length > 0 && ((t == null ? void 0 : t.value) || (t == null ? void 0 : t.value) === 0) && !Number.isNaN(t == null ? void 0 : t.value) && a.value[(t == null ? void 0 : t.value) ?? -1] === e.value || !a.value
|
|
156
|
+
), w = H(
|
|
157
|
+
() => {
|
|
158
|
+
var v;
|
|
159
|
+
return ((v = a.value) == null ? void 0 : v.findIndex((r) => r === e.value)) ?? null;
|
|
160
|
+
}
|
|
161
|
+
), i = H(
|
|
162
|
+
() => {
|
|
163
|
+
var v;
|
|
164
|
+
return ((v = a.value) == null ? void 0 : v.map((r) => {
|
|
165
|
+
const c = typeof r == "string";
|
|
166
|
+
let d = 0;
|
|
167
|
+
if (c && (d = Number.parseInt(r, 10)), T(s.value)) {
|
|
168
|
+
const D = c ? d : m.value ? r * m.value.innerHeight : 0;
|
|
169
|
+
return m.value ? s.value === "bottom" ? m.value.innerHeight - D : -m.value.innerHeight + D : D;
|
|
170
|
+
}
|
|
171
|
+
const x = c ? d : m.value ? r * m.value.innerWidth : 0;
|
|
172
|
+
return m.value ? s.value === "right" ? m.value.innerWidth - x : -m.value.innerWidth + x : x;
|
|
173
|
+
})) ?? [];
|
|
174
|
+
}
|
|
175
|
+
), y = H(
|
|
176
|
+
() => {
|
|
177
|
+
var v;
|
|
178
|
+
return w.value !== null ? (v = i.value) == null ? void 0 : v[w.value] : null;
|
|
179
|
+
}
|
|
180
|
+
), h = (v) => {
|
|
181
|
+
var r, c, d, x;
|
|
182
|
+
const D = ((r = i.value) == null ? void 0 : r.findIndex((F) => F === v)) ?? null;
|
|
183
|
+
Re(() => {
|
|
184
|
+
var F;
|
|
185
|
+
g(D, i.value), R((F = n.value) == null ? void 0 : F.$el, {
|
|
186
|
+
transition: `transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
187
|
+
transform: T(s.value) ? `translate3d(0, ${v}px, 0)` : `translate3d(${v}px, 0, 0)`
|
|
188
|
+
});
|
|
189
|
+
}), i.value && D !== i.value.length - 1 && D !== (t == null ? void 0 : t.value) ? R((c = o.value) == null ? void 0 : c.$el, {
|
|
190
|
+
transition: `opacity ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
191
|
+
opacity: "0"
|
|
192
|
+
}) : R((d = o.value) == null ? void 0 : d.$el, {
|
|
193
|
+
transition: `opacity ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
194
|
+
opacity: "1"
|
|
195
|
+
}), e.value = D !== null ? ((x = a.value) == null ? void 0 : x[D]) ?? null : null;
|
|
196
|
+
};
|
|
197
|
+
Q(
|
|
198
|
+
[e, i, a],
|
|
199
|
+
() => {
|
|
200
|
+
var v;
|
|
201
|
+
if (e.value) {
|
|
202
|
+
const r = ((v = a.value) == null ? void 0 : v.findIndex((c) => c === e.value)) ?? -1;
|
|
203
|
+
i.value && r !== -1 && typeof i.value[r] == "number" && h(i.value[r]);
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
immediate: !0
|
|
208
|
+
// if you want to run the effect immediately as well
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
function u({
|
|
212
|
+
draggedDistance: v,
|
|
213
|
+
closeDrawer: r,
|
|
214
|
+
velocity: c,
|
|
215
|
+
dismissible: d
|
|
216
|
+
}) {
|
|
217
|
+
var x, D, F;
|
|
218
|
+
if (t.value === void 0)
|
|
219
|
+
return;
|
|
220
|
+
const V = s.value === "bottom" || s.value === "right" ? (y.value ?? 0) - v : (y.value ?? 0) + v, oe = w.value === t.value - 1, Z = w.value === 0, M = v > 0;
|
|
221
|
+
if (oe && R((x = o.value) == null ? void 0 : x.$el, {
|
|
222
|
+
transition: `opacity ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`
|
|
223
|
+
}), c > 2 && !M) {
|
|
224
|
+
d ? r() : h(i.value[0]);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (c > 2 && M && i && a.value) {
|
|
228
|
+
h(i.value[a.value.length - 1]);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const ae = (D = i.value) == null ? void 0 : D.reduce((z, f) => typeof z != "number" || typeof f != "number" ? z : Math.abs(f - V) < Math.abs(z - V) ? f : z), K = T(s.value) ? window.innerHeight : window.innerWidth;
|
|
232
|
+
if (c > Ie && Math.abs(v) < K * 0.4) {
|
|
233
|
+
const z = M ? 1 : -1;
|
|
234
|
+
if (z > 0 && _) {
|
|
235
|
+
h(i.value[(((F = a.value) == null ? void 0 : F.length) ?? 0) - 1]);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (Z && z < 0 && d && r(), w.value === null)
|
|
239
|
+
return;
|
|
240
|
+
h(i.value[w.value + z]);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
h(ae);
|
|
244
|
+
}
|
|
245
|
+
function N({ draggedDistance: v }) {
|
|
246
|
+
var r;
|
|
247
|
+
if (y.value === null)
|
|
248
|
+
return;
|
|
249
|
+
const c = s.value === "bottom" || s.value === "right" ? y.value - v : y.value + v;
|
|
250
|
+
(s.value === "bottom" || s.value === "right") && c < i.value[i.value.length - 1] || (s.value === "top" || s.value === "left") && c > i.value[i.value.length - 1] || R((r = n.value) == null ? void 0 : r.$el, {
|
|
251
|
+
transform: T(s.value) ? `translate3d(0, ${c}px, 0)` : `translate3d(${c}px, 0, 0)`
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function L(v, r) {
|
|
255
|
+
if (!a.value || typeof w.value != "number" || !i.value || t.value === void 0)
|
|
256
|
+
return null;
|
|
257
|
+
const c = w.value === t.value - 1;
|
|
258
|
+
if (w.value >= t.value && r)
|
|
259
|
+
return 0;
|
|
260
|
+
if (c && !r)
|
|
261
|
+
return 1;
|
|
262
|
+
if (!k.value && !c)
|
|
263
|
+
return null;
|
|
264
|
+
const d = c ? w.value + 1 : w.value - 1, x = c ? i.value[d] - i.value[d - 1] : i.value[d + 1] - i.value[d], D = v / Math.abs(x);
|
|
265
|
+
return c ? 1 - D : D;
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
isLastSnapPoint: _,
|
|
269
|
+
shouldFade: k,
|
|
270
|
+
getPercentageDragged: L,
|
|
271
|
+
activeSnapPointIndex: w,
|
|
272
|
+
onRelease: u,
|
|
273
|
+
onDrag: N,
|
|
274
|
+
snapPointsOffset: i
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function Pe() {
|
|
278
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
279
|
+
}
|
|
280
|
+
let ne = null;
|
|
281
|
+
function Ta(e) {
|
|
282
|
+
const { isOpen: a, modal: n, nested: o, hasBeenOpened: t, preventScrollRestoration: g, noBodyStyles: s } = e, m = $(typeof window < "u" ? window.location.href : ""), B = $(0);
|
|
283
|
+
function _() {
|
|
284
|
+
if (Pe() && ne === null && a.value && !s.value) {
|
|
285
|
+
ne = {
|
|
286
|
+
position: document.body.style.position,
|
|
287
|
+
top: document.body.style.top,
|
|
288
|
+
left: document.body.style.left,
|
|
289
|
+
height: document.body.style.height
|
|
290
|
+
};
|
|
291
|
+
const { scrollX: w, innerHeight: i } = window;
|
|
292
|
+
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
293
|
+
top: `${-B.value}px`,
|
|
294
|
+
left: `${-w}px`,
|
|
295
|
+
right: "0px",
|
|
296
|
+
height: "auto"
|
|
297
|
+
}), setTimeout(() => {
|
|
298
|
+
requestAnimationFrame(() => {
|
|
299
|
+
const y = i - window.innerHeight;
|
|
300
|
+
y && B.value >= i && (document.body.style.top = `-${B.value + y}px`);
|
|
301
|
+
});
|
|
302
|
+
}, 300);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
function k() {
|
|
306
|
+
if (Pe() && ne !== null && !s.value) {
|
|
307
|
+
const w = -Number.parseInt(document.body.style.top, 10), i = -Number.parseInt(document.body.style.left, 10);
|
|
308
|
+
Object.assign(document.body.style, ne), window.requestAnimationFrame(() => {
|
|
309
|
+
if (g.value && m.value !== window.location.href) {
|
|
310
|
+
m.value = window.location.href;
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
window.scrollTo(i, w);
|
|
314
|
+
}), ne = null;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return ke(() => {
|
|
318
|
+
function w() {
|
|
319
|
+
B.value = window.scrollY;
|
|
320
|
+
}
|
|
321
|
+
w(), window.addEventListener("scroll", w), la(() => {
|
|
322
|
+
window.removeEventListener("scroll", w);
|
|
323
|
+
});
|
|
324
|
+
}), Q([a, t, m], () => {
|
|
325
|
+
o.value || !t.value || (a.value ? (window.matchMedia("(display-mode: standalone)").matches || _(), n.value || setTimeout(() => {
|
|
326
|
+
k();
|
|
327
|
+
}, 500)) : k());
|
|
328
|
+
}), { restorePositionSetting: k };
|
|
329
|
+
}
|
|
330
|
+
function Ba(e, a) {
|
|
331
|
+
return e && e.value ? e : a;
|
|
332
|
+
}
|
|
333
|
+
function _a(e) {
|
|
334
|
+
const {
|
|
335
|
+
emitDrag: a,
|
|
336
|
+
emitRelease: n,
|
|
337
|
+
emitClose: o,
|
|
338
|
+
emitOpenChange: t,
|
|
339
|
+
open: g,
|
|
340
|
+
dismissible: s,
|
|
341
|
+
nested: m,
|
|
342
|
+
modal: B,
|
|
343
|
+
shouldScaleBackground: _,
|
|
344
|
+
setBackgroundColorOnScale: k,
|
|
345
|
+
scrollLockTimeout: w,
|
|
346
|
+
closeThreshold: i,
|
|
347
|
+
activeSnapPoint: y,
|
|
348
|
+
fadeFromIndex: h,
|
|
349
|
+
direction: u,
|
|
350
|
+
noBodyStyles: N,
|
|
351
|
+
handleOnly: L,
|
|
352
|
+
preventScrollRestoration: v
|
|
353
|
+
} = e, r = $(g.value ?? !1), c = $(!1), d = $(!1), x = $(!1), D = $(null), F = $(null), V = $(null), oe = $(null), Z = $(null), M = $(!1), ae = $(null), K = $(0), z = $(!1);
|
|
354
|
+
$(0);
|
|
355
|
+
const f = $(null);
|
|
356
|
+
$(0);
|
|
357
|
+
const he = H(() => {
|
|
358
|
+
var l;
|
|
359
|
+
return ((l = f.value) == null ? void 0 : l.$el.getBoundingClientRect().height) || 0;
|
|
360
|
+
}), C = Ba(
|
|
361
|
+
e.snapPoints,
|
|
362
|
+
$(void 0)
|
|
363
|
+
), He = H(() => {
|
|
364
|
+
var l;
|
|
365
|
+
return C && (((l = C.value) == null ? void 0 : l.length) ?? 0) > 0;
|
|
366
|
+
}), je = $(null), {
|
|
367
|
+
activeSnapPointIndex: ge,
|
|
368
|
+
onRelease: We,
|
|
369
|
+
snapPointsOffset: Le,
|
|
370
|
+
onDrag: Me,
|
|
371
|
+
shouldFade: ye,
|
|
372
|
+
getPercentageDragged: Ue
|
|
373
|
+
} = Oa({
|
|
374
|
+
snapPoints: C,
|
|
375
|
+
activeSnapPoint: y,
|
|
376
|
+
drawerRef: f,
|
|
377
|
+
fadeFromIndex: h,
|
|
378
|
+
overlayRef: D,
|
|
379
|
+
onSnapPointChange: qe,
|
|
380
|
+
direction: u
|
|
381
|
+
});
|
|
382
|
+
function qe(l, O) {
|
|
383
|
+
C.value && l === O.length - 1 && (F.value = /* @__PURE__ */ new Date());
|
|
384
|
+
}
|
|
385
|
+
Ta({
|
|
386
|
+
isOpen: r,
|
|
387
|
+
modal: B,
|
|
388
|
+
nested: m,
|
|
389
|
+
hasBeenOpened: c,
|
|
390
|
+
noBodyStyles: N,
|
|
391
|
+
preventScrollRestoration: v
|
|
392
|
+
});
|
|
393
|
+
function le() {
|
|
394
|
+
return (window.innerWidth - ze) / window.innerWidth;
|
|
395
|
+
}
|
|
396
|
+
function be(l, O) {
|
|
397
|
+
var P;
|
|
398
|
+
if (!l)
|
|
399
|
+
return !1;
|
|
400
|
+
let b = l;
|
|
401
|
+
const E = (P = window.getSelection()) == null ? void 0 : P.toString(), A = f.value ? ue(f.value.$el, u.value) : null, I = /* @__PURE__ */ new Date();
|
|
402
|
+
if (b.hasAttribute("data-vaul-no-drag") || b.closest("[data-vaul-no-drag]"))
|
|
403
|
+
return !1;
|
|
404
|
+
if (u.value === "right" || u.value === "left")
|
|
405
|
+
return !0;
|
|
406
|
+
if (F.value && I.getTime() - F.value.getTime() < 500)
|
|
407
|
+
return !1;
|
|
408
|
+
if (A !== null && (u.value === "bottom" ? A > 0 : A < 0))
|
|
409
|
+
return !0;
|
|
410
|
+
if (E && E.length > 0)
|
|
411
|
+
return !1;
|
|
412
|
+
if (Z.value && I.getTime() - Z.value.getTime() < w.value && A === 0 || O)
|
|
413
|
+
return Z.value = I, !1;
|
|
414
|
+
for (; b; ) {
|
|
415
|
+
if (b.scrollHeight > b.clientHeight) {
|
|
416
|
+
if (b.scrollTop !== 0)
|
|
417
|
+
return Z.value = /* @__PURE__ */ new Date(), !1;
|
|
418
|
+
if (b.getAttribute("role") === "dialog")
|
|
419
|
+
return !0;
|
|
420
|
+
}
|
|
421
|
+
b = b.parentNode;
|
|
422
|
+
}
|
|
423
|
+
return !0;
|
|
424
|
+
}
|
|
425
|
+
function Ve(l) {
|
|
426
|
+
!s.value && !C.value || f.value && !f.value.$el.contains(l.target) || (d.value = !0, V.value = /* @__PURE__ */ new Date(), l.target.setPointerCapture(l.pointerId), K.value = T(u.value) ? l.clientY : l.clientX);
|
|
427
|
+
}
|
|
428
|
+
function Ye(l) {
|
|
429
|
+
var O, P, b, E, A, I;
|
|
430
|
+
if (f.value && d.value) {
|
|
431
|
+
const J = u.value === "bottom" || u.value === "right" ? 1 : -1, re = (K.value - (T(u.value) ? l.clientY : l.clientX)) * J, ie = re > 0, xe = C.value && !s.value && !ie;
|
|
432
|
+
if (xe && ge.value === 0)
|
|
433
|
+
return;
|
|
434
|
+
const ce = Math.abs(re), De = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
435
|
+
let Y = ce / he.value;
|
|
436
|
+
const Se = Ue(ce, ie);
|
|
437
|
+
if (Se !== null && (Y = Se), xe && Y >= 1 || !M.value && !be(l.target, ie))
|
|
438
|
+
return;
|
|
439
|
+
if ((O = f == null ? void 0 : f.value) == null || O.$el.classList.add(_e), M.value = !0, R((P = f.value) == null ? void 0 : P.$el, {
|
|
440
|
+
transition: "none"
|
|
441
|
+
}), R((b = D.value) == null ? void 0 : b.$el, {
|
|
442
|
+
transition: "none"
|
|
443
|
+
}), C.value && Me({ draggedDistance: re }), ie && !C.value) {
|
|
444
|
+
const X = $a(re), se = Math.min(X * -1, 0) * J;
|
|
445
|
+
R((E = f.value) == null ? void 0 : E.$el, {
|
|
446
|
+
transform: T(u.value) ? `translate3d(0, ${se}px, 0)` : `translate3d(${se}px, 0, 0)`
|
|
447
|
+
});
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
const Je = 1 - Y;
|
|
451
|
+
if ((ye.value || h.value && ge.value === h.value - 1) && (a(Y), R(
|
|
452
|
+
(A = D.value) == null ? void 0 : A.$el,
|
|
453
|
+
{
|
|
454
|
+
opacity: `${Je}`,
|
|
455
|
+
transition: "none"
|
|
456
|
+
},
|
|
457
|
+
!0
|
|
458
|
+
)), De && D.value && _.value) {
|
|
459
|
+
const X = Math.min(le() + Y * (1 - le()), 1), se = 8 - Y * 8, Oe = Math.max(0, 14 - Y * 14);
|
|
460
|
+
R(
|
|
461
|
+
De,
|
|
462
|
+
{
|
|
463
|
+
borderRadius: `${se}px`,
|
|
464
|
+
transform: T(u.value) ? `scale(${X}) translate3d(0, ${Oe}px, 0)` : `scale(${X}) translate3d(${Oe}px, 0, 0)`,
|
|
465
|
+
transition: "none"
|
|
466
|
+
},
|
|
467
|
+
!0
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
if (!C.value) {
|
|
471
|
+
const X = ce * J;
|
|
472
|
+
R((I = f.value) == null ? void 0 : I.$el, {
|
|
473
|
+
transform: T(u.value) ? `translate3d(0, ${X}px, 0)` : `translate3d(${X}px, 0, 0)`
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function $e() {
|
|
479
|
+
var l;
|
|
480
|
+
if (!f.value)
|
|
481
|
+
return;
|
|
482
|
+
const O = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]"), P = ue(f.value.$el, u.value);
|
|
483
|
+
R(f.value.$el, {
|
|
484
|
+
transform: "translate3d(0, 0, 0)",
|
|
485
|
+
transition: `transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`
|
|
486
|
+
}), R((l = D.value) == null ? void 0 : l.$el, {
|
|
487
|
+
transition: `opacity ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
488
|
+
opacity: "1"
|
|
489
|
+
}), _.value && P && P > 0 && r.value && R(
|
|
490
|
+
O,
|
|
491
|
+
{
|
|
492
|
+
borderRadius: `${Ne}px`,
|
|
493
|
+
overflow: "hidden",
|
|
494
|
+
...T(u.value) ? {
|
|
495
|
+
transform: `scale(${le()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
496
|
+
transformOrigin: "top"
|
|
497
|
+
} : {
|
|
498
|
+
transform: `scale(${le()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
499
|
+
transformOrigin: "left"
|
|
500
|
+
},
|
|
501
|
+
transitionProperty: "transform, border-radius",
|
|
502
|
+
transitionDuration: `${S.DURATION}s`,
|
|
503
|
+
transitionTimingFunction: `cubic-bezier(${S.EASE.join(",")})`
|
|
504
|
+
},
|
|
505
|
+
!0
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
function te(l) {
|
|
509
|
+
f.value && (o(), l || (r.value = !1), window.setTimeout(() => {
|
|
510
|
+
C.value && (y.value = C.value[0]);
|
|
511
|
+
}, S.DURATION * 1e3));
|
|
512
|
+
}
|
|
513
|
+
fe(() => {
|
|
514
|
+
if (!r.value && _.value && wa) {
|
|
515
|
+
const l = setTimeout(() => {
|
|
516
|
+
ba(document.body);
|
|
517
|
+
}, 200);
|
|
518
|
+
return () => clearTimeout(l);
|
|
519
|
+
}
|
|
520
|
+
}), Q(g, () => {
|
|
521
|
+
r.value = g.value, g.value || te();
|
|
522
|
+
});
|
|
523
|
+
function Xe(l) {
|
|
524
|
+
if (!d.value || !f.value)
|
|
525
|
+
return;
|
|
526
|
+
f.value.$el.classList.remove(_e), M.value = !1, d.value = !1, oe.value = /* @__PURE__ */ new Date();
|
|
527
|
+
const O = ue(f.value.$el, u.value);
|
|
528
|
+
if (!be(l.target, !1) || !O || Number.isNaN(O) || V.value === null)
|
|
529
|
+
return;
|
|
530
|
+
const P = oe.value.getTime() - V.value.getTime(), b = K.value - (T(u.value) ? l.clientY : l.clientX), E = Math.abs(b) / P;
|
|
531
|
+
if (E > 0.05 && (x.value = !0, window.setTimeout(() => {
|
|
532
|
+
x.value = !1;
|
|
533
|
+
}, 200)), C.value) {
|
|
534
|
+
const I = u.value === "bottom" || u.value === "right" ? 1 : -1;
|
|
535
|
+
We({
|
|
536
|
+
draggedDistance: b * I,
|
|
537
|
+
closeDrawer: te,
|
|
538
|
+
velocity: E,
|
|
539
|
+
dismissible: s.value
|
|
540
|
+
}), n(!0);
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
if (u.value === "bottom" || u.value === "right" ? b > 0 : b < 0) {
|
|
544
|
+
$e(), n(!0);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
if (E > Ie) {
|
|
548
|
+
te(), n(!1);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
const A = Math.min(
|
|
552
|
+
f.value.$el.getBoundingClientRect().height ?? 0,
|
|
553
|
+
window.innerHeight
|
|
554
|
+
);
|
|
555
|
+
if (O >= A * i.value) {
|
|
556
|
+
te(), n(!1);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
n(!0), $e();
|
|
560
|
+
}
|
|
561
|
+
Q(r, (l) => {
|
|
562
|
+
l && (F.value = /* @__PURE__ */ new Date()), t(l);
|
|
563
|
+
}, { immediate: !0 });
|
|
564
|
+
function Ge(l) {
|
|
565
|
+
var O, P;
|
|
566
|
+
const b = l ? (window.innerWidth - de) / window.innerWidth : 1, E = l ? -16 : 0;
|
|
567
|
+
ae.value && window.clearTimeout(ae.value), R((O = f.value) == null ? void 0 : O.$el, {
|
|
568
|
+
transition: `transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
569
|
+
transform: `scale(${b}) translate3d(0, ${E}px, 0)`
|
|
570
|
+
}), !l && (P = f.value) != null && P.$el && (ae.value = window.setTimeout(() => {
|
|
571
|
+
var A, I;
|
|
572
|
+
const J = ue((A = f.value) == null ? void 0 : A.$el, u.value);
|
|
573
|
+
R((I = f.value) == null ? void 0 : I.$el, {
|
|
574
|
+
transition: "none",
|
|
575
|
+
transform: T(u.value) ? `translate3d(0, ${J}px, 0)` : `translate3d(${J}px, 0, 0)`
|
|
576
|
+
});
|
|
577
|
+
}, 500));
|
|
578
|
+
}
|
|
579
|
+
function Ze(l) {
|
|
580
|
+
var O;
|
|
581
|
+
if (l < 0)
|
|
582
|
+
return;
|
|
583
|
+
const P = T(u.value) ? window.innerHeight : window.innerWidth, b = (P - de) / P, E = b + l * (1 - b), A = -16 + l * de;
|
|
584
|
+
R((O = f.value) == null ? void 0 : O.$el, {
|
|
585
|
+
transform: T(u.value) ? `scale(${E}) translate3d(0, ${A}px, 0)` : `scale(${E}) translate3d(${A}px, 0, 0)`,
|
|
586
|
+
transition: "none"
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
function Ke(l) {
|
|
590
|
+
var O;
|
|
591
|
+
const P = T(u.value) ? window.innerHeight : window.innerWidth, b = l ? (P - de) / P : 1, E = l ? -16 : 0;
|
|
592
|
+
l && R((O = f.value) == null ? void 0 : O.$el, {
|
|
593
|
+
transition: `transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,
|
|
594
|
+
transform: T(u.value) ? `scale(${b}) translate3d(0, ${E}px, 0)` : `scale(${b}) translate3d(${E}px, 0, 0)`
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
open: g,
|
|
599
|
+
isOpen: r,
|
|
600
|
+
modal: B,
|
|
601
|
+
keyboardIsOpen: z,
|
|
602
|
+
hasBeenOpened: c,
|
|
603
|
+
drawerRef: f,
|
|
604
|
+
drawerHeightRef: he,
|
|
605
|
+
overlayRef: D,
|
|
606
|
+
handleRef: je,
|
|
607
|
+
isDragging: d,
|
|
608
|
+
dragStartTime: V,
|
|
609
|
+
isAllowedToDrag: M,
|
|
610
|
+
snapPoints: C,
|
|
611
|
+
activeSnapPoint: y,
|
|
612
|
+
hasSnapPoints: He,
|
|
613
|
+
pointerStart: K,
|
|
614
|
+
dismissible: s,
|
|
615
|
+
snapPointsOffset: Le,
|
|
616
|
+
direction: u,
|
|
617
|
+
shouldFade: ye,
|
|
618
|
+
fadeFromIndex: h,
|
|
619
|
+
shouldScaleBackground: _,
|
|
620
|
+
setBackgroundColorOnScale: k,
|
|
621
|
+
onPress: Ve,
|
|
622
|
+
onDrag: Ye,
|
|
623
|
+
onRelease: Xe,
|
|
624
|
+
closeDrawer: te,
|
|
625
|
+
onNestedDrag: Ze,
|
|
626
|
+
onNestedRelease: Ke,
|
|
627
|
+
onNestedOpenChange: Ge,
|
|
628
|
+
emitClose: o,
|
|
629
|
+
emitDrag: a,
|
|
630
|
+
emitRelease: n,
|
|
631
|
+
emitOpenChange: t,
|
|
632
|
+
nested: m,
|
|
633
|
+
handleOnly: L,
|
|
634
|
+
noBodyStyles: N
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
const Pa = /* @__PURE__ */ j({
|
|
638
|
+
__name: "DrawerRoot",
|
|
639
|
+
props: {
|
|
640
|
+
activeSnapPoint: { default: void 0 },
|
|
641
|
+
closeThreshold: { default: Da },
|
|
642
|
+
shouldScaleBackground: { type: Boolean, default: void 0 },
|
|
643
|
+
setBackgroundColorOnScale: { type: Boolean, default: !0 },
|
|
644
|
+
scrollLockTimeout: { default: Sa },
|
|
645
|
+
fixed: { type: Boolean, default: void 0 },
|
|
646
|
+
dismissible: { type: Boolean, default: !0 },
|
|
647
|
+
modal: { type: Boolean, default: !0 },
|
|
648
|
+
open: { type: Boolean, default: void 0 },
|
|
649
|
+
defaultOpen: { type: Boolean, default: void 0 },
|
|
650
|
+
nested: { type: Boolean, default: !1 },
|
|
651
|
+
direction: { default: "bottom" },
|
|
652
|
+
noBodyStyles: { type: Boolean },
|
|
653
|
+
handleOnly: { type: Boolean, default: !1 },
|
|
654
|
+
preventScrollRestoration: { type: Boolean },
|
|
655
|
+
snapPoints: { default: void 0 },
|
|
656
|
+
fadeFromIndex: { default: void 0 }
|
|
657
|
+
},
|
|
658
|
+
emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"],
|
|
659
|
+
setup(e, { expose: a, emit: n }) {
|
|
660
|
+
const o = e, t = n;
|
|
661
|
+
Qe();
|
|
662
|
+
const g = H(() => o.fadeFromIndex ?? (o.snapPoints && o.snapPoints.length - 1)), s = Be(o, "open", t, {
|
|
663
|
+
defaultValue: o.defaultOpen,
|
|
664
|
+
passive: o.open === void 0
|
|
665
|
+
}), m = Be(o, "activeSnapPoint", t, {
|
|
666
|
+
passive: o.activeSnapPoint === void 0
|
|
667
|
+
}), B = {
|
|
668
|
+
emitDrag: (h) => t("drag", h),
|
|
669
|
+
emitRelease: (h) => t("release", h),
|
|
670
|
+
emitClose: () => t("close"),
|
|
671
|
+
emitOpenChange: (h) => {
|
|
672
|
+
t("update:open", h), setTimeout(() => {
|
|
673
|
+
t("animationEnd", h);
|
|
674
|
+
}, S.DURATION * 1e3);
|
|
675
|
+
}
|
|
676
|
+
}, { closeDrawer: _, hasBeenOpened: k, modal: w, isOpen: i } = ya(
|
|
677
|
+
_a({
|
|
678
|
+
...B,
|
|
679
|
+
...ea(o),
|
|
680
|
+
activeSnapPoint: m,
|
|
681
|
+
fadeFromIndex: g,
|
|
682
|
+
open: s
|
|
683
|
+
})
|
|
684
|
+
);
|
|
685
|
+
function y(h) {
|
|
686
|
+
if (s.value !== void 0) {
|
|
687
|
+
B.emitOpenChange(h);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
i.value = h, h ? k.value = !0 : _();
|
|
691
|
+
}
|
|
692
|
+
return a({
|
|
693
|
+
open: i
|
|
694
|
+
}), (h, u) => (W(), U(p(da), {
|
|
695
|
+
open: p(i),
|
|
696
|
+
modal: p(w),
|
|
697
|
+
"onUpdate:open": y
|
|
698
|
+
}, {
|
|
699
|
+
default: G(() => [
|
|
700
|
+
q(h.$slots, "default", { open: p(i) })
|
|
701
|
+
]),
|
|
702
|
+
_: 3
|
|
703
|
+
}, 8, ["open", "modal"]));
|
|
704
|
+
}
|
|
705
|
+
}), Ra = /* @__PURE__ */ j({
|
|
706
|
+
__name: "DrawerOverlay",
|
|
707
|
+
setup(e) {
|
|
708
|
+
const { overlayRef: a, hasSnapPoints: n, isOpen: o, shouldFade: t } = we();
|
|
709
|
+
return (g, s) => (W(), U(p(va), {
|
|
710
|
+
ref_key: "overlayRef",
|
|
711
|
+
ref: a,
|
|
712
|
+
"data-vaul-overlay": "",
|
|
713
|
+
"data-vaul-snap-points": p(o) && p(n) ? "true" : "false",
|
|
714
|
+
"data-vaul-snap-points-overlay": p(o) && p(t) ? "true" : "false"
|
|
715
|
+
}, null, 8, ["data-vaul-snap-points", "data-vaul-snap-points-overlay"]));
|
|
716
|
+
}
|
|
717
|
+
}), ka = () => () => {
|
|
718
|
+
};
|
|
719
|
+
function Ea() {
|
|
720
|
+
const { direction: e, isOpen: a, shouldScaleBackground: n, setBackgroundColorOnScale: o, noBodyStyles: t } = we(), g = $(null), s = $(document.body.style.backgroundColor);
|
|
721
|
+
function m() {
|
|
722
|
+
return (window.innerWidth - ze) / window.innerWidth;
|
|
723
|
+
}
|
|
724
|
+
fe((B) => {
|
|
725
|
+
if (a.value && n.value) {
|
|
726
|
+
g.value && clearTimeout(g.value);
|
|
727
|
+
const _ = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
728
|
+
if (!_)
|
|
729
|
+
return;
|
|
730
|
+
xa(
|
|
731
|
+
o.value && !t.value ? pe(document.body, { background: "black" }) : ka,
|
|
732
|
+
pe(_, {
|
|
733
|
+
transformOrigin: T(e.value) ? "top" : "left",
|
|
734
|
+
transitionProperty: "transform, border-radius",
|
|
735
|
+
transitionDuration: `${S.DURATION}s`,
|
|
736
|
+
transitionTimingFunction: `cubic-bezier(${S.EASE.join(",")})`
|
|
737
|
+
})
|
|
738
|
+
);
|
|
739
|
+
const k = pe(_, {
|
|
740
|
+
borderRadius: `${Ne}px`,
|
|
741
|
+
overflow: "hidden",
|
|
742
|
+
...T(e.value) ? {
|
|
743
|
+
transform: `scale(${m()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
|
|
744
|
+
} : {
|
|
745
|
+
transform: `scale(${m()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
B(() => {
|
|
749
|
+
k(), g.value = window.setTimeout(() => {
|
|
750
|
+
s.value ? document.body.style.background = s.value : document.body.style.removeProperty("background");
|
|
751
|
+
}, S.DURATION * 1e3);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}, { flush: "pre" });
|
|
755
|
+
}
|
|
756
|
+
const Aa = /* @__PURE__ */ j({
|
|
757
|
+
__name: "DrawerContent",
|
|
758
|
+
setup(e) {
|
|
759
|
+
const {
|
|
760
|
+
open: a,
|
|
761
|
+
isOpen: n,
|
|
762
|
+
snapPointsOffset: o,
|
|
763
|
+
hasSnapPoints: t,
|
|
764
|
+
drawerRef: g,
|
|
765
|
+
onPress: s,
|
|
766
|
+
onDrag: m,
|
|
767
|
+
onRelease: B,
|
|
768
|
+
modal: _,
|
|
769
|
+
emitOpenChange: k,
|
|
770
|
+
dismissible: w,
|
|
771
|
+
keyboardIsOpen: i,
|
|
772
|
+
closeDrawer: y,
|
|
773
|
+
direction: h,
|
|
774
|
+
handleOnly: u
|
|
775
|
+
} = we();
|
|
776
|
+
Ea();
|
|
777
|
+
const N = $(!1), L = H(() => o.value && o.value.length > 0 ? `${o.value[0]}px` : "0");
|
|
778
|
+
function v(d) {
|
|
779
|
+
if (!_.value || d.defaultPrevented) {
|
|
780
|
+
d.preventDefault();
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
i.value && (i.value = !1), w.value ? k(!1) : d.preventDefault();
|
|
784
|
+
}
|
|
785
|
+
function r(d) {
|
|
786
|
+
u.value || s(d);
|
|
787
|
+
}
|
|
788
|
+
function c(d) {
|
|
789
|
+
u.value || m(d);
|
|
790
|
+
}
|
|
791
|
+
return fe(() => {
|
|
792
|
+
t.value && window.requestAnimationFrame(() => {
|
|
793
|
+
N.value = !0;
|
|
794
|
+
});
|
|
795
|
+
}), (d, x) => (W(), U(p(ca), {
|
|
796
|
+
ref_key: "drawerRef",
|
|
797
|
+
ref: g,
|
|
798
|
+
"data-vaul-drawer": "",
|
|
799
|
+
"data-vaul-drawer-direction": p(h),
|
|
800
|
+
"data-vaul-delayed-snap-points": N.value ? "true" : "false",
|
|
801
|
+
"data-vaul-snap-points": p(n) && p(t) ? "true" : "false",
|
|
802
|
+
style: ta({ "--snap-point-height": L.value }),
|
|
803
|
+
onPointerdown: r,
|
|
804
|
+
onPointermove: c,
|
|
805
|
+
onPointerup: p(B),
|
|
806
|
+
onPointerDownOutside: v,
|
|
807
|
+
onOpenAutoFocus: x[0] || (x[0] = aa(() => {
|
|
808
|
+
}, ["prevent"])),
|
|
809
|
+
onEscapeKeyDown: x[1] || (x[1] = (D) => {
|
|
810
|
+
p(w) || D.preventDefault();
|
|
811
|
+
})
|
|
812
|
+
}, {
|
|
813
|
+
default: G(() => [
|
|
814
|
+
q(d.$slots, "default")
|
|
815
|
+
]),
|
|
816
|
+
_: 3
|
|
817
|
+
}, 8, ["data-vaul-drawer-direction", "data-vaul-delayed-snap-points", "data-vaul-snap-points", "style", "onPointerup"]));
|
|
818
|
+
}
|
|
819
|
+
}), Ma = /* @__PURE__ */ j({
|
|
820
|
+
__name: "Drawer",
|
|
821
|
+
props: {
|
|
822
|
+
activeSnapPoint: {},
|
|
823
|
+
closeThreshold: {},
|
|
824
|
+
shouldScaleBackground: { type: Boolean, default: !0 },
|
|
825
|
+
setBackgroundColorOnScale: { type: Boolean },
|
|
826
|
+
scrollLockTimeout: {},
|
|
827
|
+
fixed: { type: Boolean },
|
|
828
|
+
dismissible: { type: Boolean },
|
|
829
|
+
modal: { type: Boolean },
|
|
830
|
+
open: { type: Boolean },
|
|
831
|
+
defaultOpen: { type: Boolean },
|
|
832
|
+
nested: { type: Boolean },
|
|
833
|
+
direction: {},
|
|
834
|
+
noBodyStyles: { type: Boolean },
|
|
835
|
+
handleOnly: { type: Boolean },
|
|
836
|
+
preventScrollRestoration: { type: Boolean },
|
|
837
|
+
snapPoints: {},
|
|
838
|
+
fadeFromIndex: {}
|
|
839
|
+
},
|
|
840
|
+
emits: ["drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"],
|
|
841
|
+
setup(e, { emit: a }) {
|
|
842
|
+
const t = Ce(e, a);
|
|
843
|
+
return (g, s) => (W(), U(p(Pa), ra(ia(p(t))), {
|
|
844
|
+
default: G(() => [
|
|
845
|
+
q(g.$slots, "default")
|
|
846
|
+
]),
|
|
847
|
+
_: 3
|
|
848
|
+
}, 16));
|
|
849
|
+
}
|
|
850
|
+
}), Ca = /* @__PURE__ */ j({
|
|
851
|
+
__name: "DrawerOverlay",
|
|
852
|
+
props: {
|
|
853
|
+
forceMount: { type: Boolean },
|
|
854
|
+
asChild: { type: Boolean },
|
|
855
|
+
as: { type: [String, Object, Function] },
|
|
856
|
+
class: {}
|
|
857
|
+
},
|
|
858
|
+
setup(e) {
|
|
859
|
+
const a = e, n = me(a, "class");
|
|
860
|
+
return (o, t) => (W(), U(p(Ra), ve(p(n), {
|
|
861
|
+
class: p(ee)("fixed inset-0 z-50 bg-black/80", a.class)
|
|
862
|
+
}), null, 16, ["class"]));
|
|
863
|
+
}
|
|
864
|
+
}), Ua = /* @__PURE__ */ j({
|
|
865
|
+
__name: "DrawerContent",
|
|
866
|
+
props: {
|
|
867
|
+
forceMount: { type: Boolean },
|
|
868
|
+
trapFocus: { type: Boolean },
|
|
869
|
+
disableOutsidePointerEvents: { type: Boolean },
|
|
870
|
+
asChild: { type: Boolean },
|
|
871
|
+
as: { type: [String, Object, Function] },
|
|
872
|
+
class: {}
|
|
873
|
+
},
|
|
874
|
+
emits: ["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"],
|
|
875
|
+
setup(e, { emit: a }) {
|
|
876
|
+
const n = e, t = Ce(n, a);
|
|
877
|
+
return (g, s) => (W(), U(p(pa), null, {
|
|
878
|
+
default: G(() => [
|
|
879
|
+
Te(Ca),
|
|
880
|
+
Te(p(Aa), ve(p(t), {
|
|
881
|
+
class: p(ee)(
|
|
882
|
+
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
883
|
+
n.class
|
|
884
|
+
)
|
|
885
|
+
}), {
|
|
886
|
+
default: G(() => [
|
|
887
|
+
s[0] || (s[0] = sa("div", { class: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }, null, -1)),
|
|
888
|
+
q(g.$slots, "default")
|
|
889
|
+
]),
|
|
890
|
+
_: 3,
|
|
891
|
+
__: [0]
|
|
892
|
+
}, 16, ["class"])
|
|
893
|
+
]),
|
|
894
|
+
_: 3
|
|
895
|
+
}));
|
|
896
|
+
}
|
|
897
|
+
}), qa = /* @__PURE__ */ j({
|
|
898
|
+
__name: "DrawerDescription",
|
|
899
|
+
props: {
|
|
900
|
+
asChild: { type: Boolean },
|
|
901
|
+
as: { type: [String, Object, Function] },
|
|
902
|
+
class: {}
|
|
903
|
+
},
|
|
904
|
+
setup(e) {
|
|
905
|
+
const a = e, n = me(a, "class");
|
|
906
|
+
return (o, t) => (W(), U(p(fa), ve(p(n), {
|
|
907
|
+
class: p(ee)("text-sm text-muted-foreground", a.class)
|
|
908
|
+
}), {
|
|
909
|
+
default: G(() => [
|
|
910
|
+
q(o.$slots, "default")
|
|
911
|
+
]),
|
|
912
|
+
_: 3
|
|
913
|
+
}, 16, ["class"]));
|
|
914
|
+
}
|
|
915
|
+
}), Va = /* @__PURE__ */ j({
|
|
916
|
+
__name: "DrawerFooter",
|
|
917
|
+
props: {
|
|
918
|
+
class: {}
|
|
919
|
+
},
|
|
920
|
+
setup(e) {
|
|
921
|
+
const a = e;
|
|
922
|
+
return (n, o) => (W(), Ee("div", {
|
|
923
|
+
class: Ae(p(ee)("mt-auto flex flex-col gap-2 p-4", a.class))
|
|
924
|
+
}, [
|
|
925
|
+
q(n.$slots, "default")
|
|
926
|
+
], 2));
|
|
927
|
+
}
|
|
928
|
+
}), Ya = /* @__PURE__ */ j({
|
|
929
|
+
__name: "DrawerHeader",
|
|
930
|
+
props: {
|
|
931
|
+
class: {}
|
|
932
|
+
},
|
|
933
|
+
setup(e) {
|
|
934
|
+
const a = e;
|
|
935
|
+
return (n, o) => (W(), Ee("div", {
|
|
936
|
+
class: Ae(p(ee)("grid gap-1.5 p-4 text-center sm:text-left", a.class))
|
|
937
|
+
}, [
|
|
938
|
+
q(n.$slots, "default")
|
|
939
|
+
], 2));
|
|
940
|
+
}
|
|
941
|
+
}), Xa = /* @__PURE__ */ j({
|
|
942
|
+
__name: "DrawerTitle",
|
|
943
|
+
props: {
|
|
944
|
+
asChild: { type: Boolean },
|
|
945
|
+
as: { type: [String, Object, Function] },
|
|
946
|
+
class: {}
|
|
947
|
+
},
|
|
948
|
+
setup(e) {
|
|
949
|
+
const a = e, n = me(a, "class");
|
|
950
|
+
return (o, t) => (W(), U(p(ma), ve(p(n), {
|
|
951
|
+
class: p(ee)("text-lg font-semibold leading-none tracking-tight", a.class)
|
|
952
|
+
}), {
|
|
953
|
+
default: G(() => [
|
|
954
|
+
q(o.$slots, "default")
|
|
955
|
+
]),
|
|
956
|
+
_: 3
|
|
957
|
+
}, 16, ["class"]));
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
export {
|
|
961
|
+
Ma as Drawer,
|
|
962
|
+
Ka as DrawerClose,
|
|
963
|
+
Ua as DrawerContent,
|
|
964
|
+
qa as DrawerDescription,
|
|
965
|
+
Va as DrawerFooter,
|
|
966
|
+
Ya as DrawerHeader,
|
|
967
|
+
Ca as DrawerOverlay,
|
|
968
|
+
pa as DrawerPortal,
|
|
969
|
+
Xa as DrawerTitle,
|
|
970
|
+
Qa as DrawerTrigger
|
|
971
|
+
};
|