@vueuse/components 12.6.0 → 12.7.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/index.cjs +38 -38
- package/index.d.cts +32 -32
- package/index.d.mts +32 -32
- package/index.d.ts +32 -32
- package/index.iife.js +38 -38
- package/index.iife.min.js +1 -1
- package/index.mjs +39 -39
- package/package.json +3 -3
package/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
9
9
|
props: ["as", "options"],
|
|
10
10
|
emits: ["trigger"],
|
|
11
11
|
setup(props, { slots, emit }) {
|
|
12
|
-
const target = vue.
|
|
12
|
+
const target = vue.shallowRef();
|
|
13
13
|
core.onClickOutside(target, (e) => {
|
|
14
14
|
emit("trigger", e);
|
|
15
15
|
}, props.options);
|
|
@@ -338,7 +338,7 @@ const OnLongPress = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
338
338
|
props: ["as", "options"],
|
|
339
339
|
emits: ["trigger"],
|
|
340
340
|
setup(props, { slots, emit }) {
|
|
341
|
-
const target = vue.
|
|
341
|
+
const target = vue.shallowRef();
|
|
342
342
|
onLongPress(
|
|
343
343
|
target,
|
|
344
344
|
(e) => {
|
|
@@ -434,7 +434,7 @@ function useSSRWidth() {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
function useMounted() {
|
|
437
|
-
const isMounted = vue.
|
|
437
|
+
const isMounted = vue.shallowRef(false);
|
|
438
438
|
const instance = vue.getCurrentInstance();
|
|
439
439
|
if (instance) {
|
|
440
440
|
vue.onMounted(() => {
|
|
@@ -457,7 +457,7 @@ function useMediaQuery(query, options = {}) {
|
|
|
457
457
|
const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
|
|
458
458
|
const ssrSupport = vue.ref(typeof ssrWidth === "number");
|
|
459
459
|
const mediaQuery = vue.shallowRef();
|
|
460
|
-
const matches = vue.
|
|
460
|
+
const matches = vue.shallowRef(false);
|
|
461
461
|
const handler = (event) => {
|
|
462
462
|
matches.value = event.matches;
|
|
463
463
|
};
|
|
@@ -864,7 +864,7 @@ const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
864
864
|
"containerElement"
|
|
865
865
|
],
|
|
866
866
|
setup(props, { slots }) {
|
|
867
|
-
const target = vue.
|
|
867
|
+
const target = vue.shallowRef();
|
|
868
868
|
const handle = vue.computed(() => {
|
|
869
869
|
var _a;
|
|
870
870
|
return (_a = props.handle) != null ? _a : target.value;
|
|
@@ -907,7 +907,7 @@ const UseElementBounding = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
907
907
|
name: "UseElementBounding",
|
|
908
908
|
props: ["box", "as"],
|
|
909
909
|
setup(props, { slots }) {
|
|
910
|
-
const target = vue.
|
|
910
|
+
const target = vue.shallowRef();
|
|
911
911
|
const data = vue.reactive(core.useElementBounding(target));
|
|
912
912
|
return () => {
|
|
913
913
|
if (slots.default)
|
|
@@ -1004,14 +1004,14 @@ function useElementBounding(target, options = {}) {
|
|
|
1004
1004
|
immediate = true,
|
|
1005
1005
|
updateTiming = "sync"
|
|
1006
1006
|
} = options;
|
|
1007
|
-
const height = vue.
|
|
1008
|
-
const bottom = vue.
|
|
1009
|
-
const left = vue.
|
|
1010
|
-
const right = vue.
|
|
1011
|
-
const top = vue.
|
|
1012
|
-
const width = vue.
|
|
1013
|
-
const x = vue.
|
|
1014
|
-
const y = vue.
|
|
1007
|
+
const height = vue.shallowRef(0);
|
|
1008
|
+
const bottom = vue.shallowRef(0);
|
|
1009
|
+
const left = vue.shallowRef(0);
|
|
1010
|
+
const right = vue.shallowRef(0);
|
|
1011
|
+
const top = vue.shallowRef(0);
|
|
1012
|
+
const width = vue.shallowRef(0);
|
|
1013
|
+
const x = vue.shallowRef(0);
|
|
1014
|
+
const y = vue.shallowRef(0);
|
|
1015
1015
|
function recalculate() {
|
|
1016
1016
|
const el = unrefElement(target);
|
|
1017
1017
|
if (!el) {
|
|
@@ -1134,7 +1134,7 @@ function useElementHover(el, options = {}) {
|
|
|
1134
1134
|
triggerOnRemoval = false,
|
|
1135
1135
|
window = defaultWindow
|
|
1136
1136
|
} = options;
|
|
1137
|
-
const isHovered = vue.
|
|
1137
|
+
const isHovered = vue.shallowRef(false);
|
|
1138
1138
|
let timer;
|
|
1139
1139
|
const toggle = (entering) => {
|
|
1140
1140
|
const delay = entering ? delayEnter : delayLeave;
|
|
@@ -1336,7 +1336,7 @@ function useElementVisibility(element, options = {}) {
|
|
|
1336
1336
|
rootMargin,
|
|
1337
1337
|
once = false
|
|
1338
1338
|
} = options;
|
|
1339
|
-
const elementIsVisible = vue.
|
|
1339
|
+
const elementIsVisible = vue.shallowRef(false);
|
|
1340
1340
|
const { stop } = useIntersectionObserver(
|
|
1341
1341
|
element,
|
|
1342
1342
|
(intersectionObserverEntries) => {
|
|
@@ -1441,8 +1441,8 @@ function useAsyncState(promise, initialState, options) {
|
|
|
1441
1441
|
throwError
|
|
1442
1442
|
} = options != null ? options : {};
|
|
1443
1443
|
const state = shallow ? vue.shallowRef(initialState) : vue.ref(initialState);
|
|
1444
|
-
const isReady = vue.
|
|
1445
|
-
const isLoading = vue.
|
|
1444
|
+
const isReady = vue.shallowRef(false);
|
|
1445
|
+
const isLoading = vue.shallowRef(false);
|
|
1446
1446
|
const error = vue.shallowRef(void 0);
|
|
1447
1447
|
async function execute(delay2 = 0, ...args) {
|
|
1448
1448
|
if (resetOnExecute)
|
|
@@ -1605,8 +1605,8 @@ function useScroll(element, options = {}) {
|
|
|
1605
1605
|
console.error(e);
|
|
1606
1606
|
}
|
|
1607
1607
|
} = options;
|
|
1608
|
-
const internalX = vue.
|
|
1609
|
-
const internalY = vue.
|
|
1608
|
+
const internalX = vue.shallowRef(0);
|
|
1609
|
+
const internalY = vue.shallowRef(0);
|
|
1610
1610
|
const x = vue.computed({
|
|
1611
1611
|
get() {
|
|
1612
1612
|
return internalX.value;
|
|
@@ -1641,7 +1641,7 @@ function useScroll(element, options = {}) {
|
|
|
1641
1641
|
if (y != null)
|
|
1642
1642
|
internalY.value = scrollContainer.scrollTop;
|
|
1643
1643
|
}
|
|
1644
|
-
const isScrolling = vue.
|
|
1644
|
+
const isScrolling = vue.shallowRef(false);
|
|
1645
1645
|
const arrivedState = vue.reactive({
|
|
1646
1646
|
left: true,
|
|
1647
1647
|
right: false,
|
|
@@ -1865,9 +1865,9 @@ function useMouse(options = {}) {
|
|
|
1865
1865
|
let _prevMouseEvent = null;
|
|
1866
1866
|
let _prevScrollX = 0;
|
|
1867
1867
|
let _prevScrollY = 0;
|
|
1868
|
-
const x = vue.
|
|
1869
|
-
const y = vue.
|
|
1870
|
-
const sourceType = vue.
|
|
1868
|
+
const x = vue.shallowRef(initialValue.x);
|
|
1869
|
+
const y = vue.shallowRef(initialValue.y);
|
|
1870
|
+
const sourceType = vue.shallowRef(null);
|
|
1871
1871
|
const extractor = typeof type === "function" ? type : UseMouseBuiltinExtractors[type];
|
|
1872
1872
|
const mouseHandler = (event) => {
|
|
1873
1873
|
const result = extractor(event);
|
|
@@ -1932,13 +1932,13 @@ function useMouseInElement(target, options = {}) {
|
|
|
1932
1932
|
const type = options.type || "page";
|
|
1933
1933
|
const { x, y, sourceType } = useMouse(options);
|
|
1934
1934
|
const targetRef = vue.ref(target != null ? target : window == null ? void 0 : window.document.body);
|
|
1935
|
-
const elementX = vue.
|
|
1936
|
-
const elementY = vue.
|
|
1937
|
-
const elementPositionX = vue.
|
|
1938
|
-
const elementPositionY = vue.
|
|
1939
|
-
const elementHeight = vue.
|
|
1940
|
-
const elementWidth = vue.
|
|
1941
|
-
const isOutside = vue.
|
|
1935
|
+
const elementX = vue.shallowRef(0);
|
|
1936
|
+
const elementY = vue.shallowRef(0);
|
|
1937
|
+
const elementPositionX = vue.shallowRef(0);
|
|
1938
|
+
const elementPositionY = vue.shallowRef(0);
|
|
1939
|
+
const elementHeight = vue.shallowRef(0);
|
|
1940
|
+
const elementWidth = vue.shallowRef(0);
|
|
1941
|
+
const isOutside = vue.shallowRef(true);
|
|
1942
1942
|
let stop = () => {
|
|
1943
1943
|
};
|
|
1944
1944
|
if (window) {
|
|
@@ -2124,7 +2124,7 @@ const UsePointer = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2124
2124
|
"target"
|
|
2125
2125
|
],
|
|
2126
2126
|
setup(props, { slots }) {
|
|
2127
|
-
const el = vue.
|
|
2127
|
+
const el = vue.shallowRef(null);
|
|
2128
2128
|
const data = vue.reactive(core.usePointer({
|
|
2129
2129
|
...props,
|
|
2130
2130
|
target: props.target === "self" ? el : defaultWindow
|
|
@@ -2238,7 +2238,7 @@ const vResizeObserver = {
|
|
|
2238
2238
|
|
|
2239
2239
|
function useCssVar(prop, target, options = {}) {
|
|
2240
2240
|
const { window = defaultWindow, initialValue, observe = false } = options;
|
|
2241
|
-
const variable = vue.
|
|
2241
|
+
const variable = vue.shallowRef(initialValue);
|
|
2242
2242
|
const elRef = vue.computed(() => {
|
|
2243
2243
|
var _a;
|
|
2244
2244
|
return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
|
|
@@ -2287,10 +2287,10 @@ const rightVarName = "--vueuse-safe-area-right";
|
|
|
2287
2287
|
const bottomVarName = "--vueuse-safe-area-bottom";
|
|
2288
2288
|
const leftVarName = "--vueuse-safe-area-left";
|
|
2289
2289
|
function useScreenSafeArea() {
|
|
2290
|
-
const top = vue.
|
|
2291
|
-
const right = vue.
|
|
2292
|
-
const bottom = vue.
|
|
2293
|
-
const left = vue.
|
|
2290
|
+
const top = vue.shallowRef("");
|
|
2291
|
+
const right = vue.shallowRef("");
|
|
2292
|
+
const bottom = vue.shallowRef("");
|
|
2293
|
+
const left = vue.shallowRef("");
|
|
2294
2294
|
if (shared.isClient) {
|
|
2295
2295
|
const topCssVar = useCssVar(topVarName);
|
|
2296
2296
|
const rightCssVar = useCssVar(rightVarName);
|
|
@@ -2471,7 +2471,7 @@ function useScrollLock(element, initialState = false) {
|
|
|
2471
2471
|
|
|
2472
2472
|
function onScrollLock() {
|
|
2473
2473
|
let isMounted = false;
|
|
2474
|
-
const state = vue.
|
|
2474
|
+
const state = vue.shallowRef(false);
|
|
2475
2475
|
return (el, binding) => {
|
|
2476
2476
|
state.value = binding.value;
|
|
2477
2477
|
if (isMounted)
|
package/index.d.cts
CHANGED
|
@@ -7,6 +7,19 @@ interface ConfigurableWindow {
|
|
|
7
7
|
window?: Window;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
interface Position {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
interface RenderableComponent {
|
|
15
|
+
/**
|
|
16
|
+
* The element that the component should be rendered as
|
|
17
|
+
*
|
|
18
|
+
* @default 'div'
|
|
19
|
+
*/
|
|
20
|
+
as?: object | string;
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
type VueInstance = ComponentPublicInstance;
|
|
11
24
|
type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
|
|
12
25
|
type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<T>;
|
|
@@ -41,19 +54,6 @@ type OnClickOutsideHandler<T extends {
|
|
|
41
54
|
controls: false;
|
|
42
55
|
}> = (event: T['controls'] extends true ? Event | (T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) : T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) => void;
|
|
43
56
|
|
|
44
|
-
interface Position {
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
}
|
|
48
|
-
interface RenderableComponent {
|
|
49
|
-
/**
|
|
50
|
-
* The element that the component should be rendered as
|
|
51
|
-
*
|
|
52
|
-
* @default 'div'
|
|
53
|
-
*/
|
|
54
|
-
as?: object | string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
57
|
interface OnClickOutsideProps extends RenderableComponent {
|
|
58
58
|
options?: Omit<OnClickOutsideOptions, 'controls'>;
|
|
59
59
|
}
|
|
@@ -378,14 +378,14 @@ interface UseElementBoundingOptions {
|
|
|
378
378
|
* @param target
|
|
379
379
|
*/
|
|
380
380
|
declare function useElementBounding(target: MaybeComputedElementRef, options?: UseElementBoundingOptions): {
|
|
381
|
-
height: vue.
|
|
382
|
-
bottom: vue.
|
|
383
|
-
left: vue.
|
|
384
|
-
right: vue.
|
|
385
|
-
top: vue.
|
|
386
|
-
width: vue.
|
|
387
|
-
x: vue.
|
|
388
|
-
y: vue.
|
|
381
|
+
height: vue.ShallowRef<number, number>;
|
|
382
|
+
bottom: vue.ShallowRef<number, number>;
|
|
383
|
+
left: vue.ShallowRef<number, number>;
|
|
384
|
+
right: vue.ShallowRef<number, number>;
|
|
385
|
+
top: vue.ShallowRef<number, number>;
|
|
386
|
+
width: vue.ShallowRef<number, number>;
|
|
387
|
+
x: vue.ShallowRef<number, number>;
|
|
388
|
+
y: vue.ShallowRef<number, number>;
|
|
389
389
|
update: () => void;
|
|
390
390
|
};
|
|
391
391
|
type UseElementBoundingReturn = ReturnType<typeof useElementBounding>;
|
|
@@ -589,7 +589,7 @@ interface UseScrollOptions extends ConfigurableWindow {
|
|
|
589
589
|
declare function useScroll(element: MaybeRefOrGetter<HTMLElement | SVGElement | Window | Document | null | undefined>, options?: UseScrollOptions): {
|
|
590
590
|
x: vue.WritableComputedRef<number, number>;
|
|
591
591
|
y: vue.WritableComputedRef<number, number>;
|
|
592
|
-
isScrolling: vue.
|
|
592
|
+
isScrolling: vue.ShallowRef<boolean, boolean>;
|
|
593
593
|
arrivedState: {
|
|
594
594
|
left: boolean;
|
|
595
595
|
right: boolean;
|
|
@@ -705,16 +705,16 @@ interface MouseInElementOptions extends UseMouseOptions {
|
|
|
705
705
|
* @param options
|
|
706
706
|
*/
|
|
707
707
|
declare function useMouseInElement(target?: MaybeElementRef, options?: MouseInElementOptions): {
|
|
708
|
-
x: vue.
|
|
709
|
-
y: vue.
|
|
710
|
-
sourceType: vue.
|
|
711
|
-
elementX: vue.
|
|
712
|
-
elementY: vue.
|
|
713
|
-
elementPositionX: vue.
|
|
714
|
-
elementPositionY: vue.
|
|
715
|
-
elementHeight: vue.
|
|
716
|
-
elementWidth: vue.
|
|
717
|
-
isOutside: vue.
|
|
708
|
+
x: vue.ShallowRef<number, number>;
|
|
709
|
+
y: vue.ShallowRef<number, number>;
|
|
710
|
+
sourceType: vue.ShallowRef<UseMouseSourceType, UseMouseSourceType>;
|
|
711
|
+
elementX: vue.ShallowRef<number, number>;
|
|
712
|
+
elementY: vue.ShallowRef<number, number>;
|
|
713
|
+
elementPositionX: vue.ShallowRef<number, number>;
|
|
714
|
+
elementPositionY: vue.ShallowRef<number, number>;
|
|
715
|
+
elementHeight: vue.ShallowRef<number, number>;
|
|
716
|
+
elementWidth: vue.ShallowRef<number, number>;
|
|
717
|
+
isOutside: vue.ShallowRef<boolean, boolean>;
|
|
718
718
|
stop: () => void;
|
|
719
719
|
};
|
|
720
720
|
type UseMouseInElementReturn = ReturnType<typeof useMouseInElement>;
|
package/index.d.mts
CHANGED
|
@@ -7,6 +7,19 @@ interface ConfigurableWindow {
|
|
|
7
7
|
window?: Window;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
interface Position {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
interface RenderableComponent {
|
|
15
|
+
/**
|
|
16
|
+
* The element that the component should be rendered as
|
|
17
|
+
*
|
|
18
|
+
* @default 'div'
|
|
19
|
+
*/
|
|
20
|
+
as?: object | string;
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
type VueInstance = ComponentPublicInstance;
|
|
11
24
|
type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
|
|
12
25
|
type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<T>;
|
|
@@ -41,19 +54,6 @@ type OnClickOutsideHandler<T extends {
|
|
|
41
54
|
controls: false;
|
|
42
55
|
}> = (event: T['controls'] extends true ? Event | (T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) : T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) => void;
|
|
43
56
|
|
|
44
|
-
interface Position {
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
}
|
|
48
|
-
interface RenderableComponent {
|
|
49
|
-
/**
|
|
50
|
-
* The element that the component should be rendered as
|
|
51
|
-
*
|
|
52
|
-
* @default 'div'
|
|
53
|
-
*/
|
|
54
|
-
as?: object | string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
57
|
interface OnClickOutsideProps extends RenderableComponent {
|
|
58
58
|
options?: Omit<OnClickOutsideOptions, 'controls'>;
|
|
59
59
|
}
|
|
@@ -378,14 +378,14 @@ interface UseElementBoundingOptions {
|
|
|
378
378
|
* @param target
|
|
379
379
|
*/
|
|
380
380
|
declare function useElementBounding(target: MaybeComputedElementRef, options?: UseElementBoundingOptions): {
|
|
381
|
-
height: vue.
|
|
382
|
-
bottom: vue.
|
|
383
|
-
left: vue.
|
|
384
|
-
right: vue.
|
|
385
|
-
top: vue.
|
|
386
|
-
width: vue.
|
|
387
|
-
x: vue.
|
|
388
|
-
y: vue.
|
|
381
|
+
height: vue.ShallowRef<number, number>;
|
|
382
|
+
bottom: vue.ShallowRef<number, number>;
|
|
383
|
+
left: vue.ShallowRef<number, number>;
|
|
384
|
+
right: vue.ShallowRef<number, number>;
|
|
385
|
+
top: vue.ShallowRef<number, number>;
|
|
386
|
+
width: vue.ShallowRef<number, number>;
|
|
387
|
+
x: vue.ShallowRef<number, number>;
|
|
388
|
+
y: vue.ShallowRef<number, number>;
|
|
389
389
|
update: () => void;
|
|
390
390
|
};
|
|
391
391
|
type UseElementBoundingReturn = ReturnType<typeof useElementBounding>;
|
|
@@ -589,7 +589,7 @@ interface UseScrollOptions extends ConfigurableWindow {
|
|
|
589
589
|
declare function useScroll(element: MaybeRefOrGetter<HTMLElement | SVGElement | Window | Document | null | undefined>, options?: UseScrollOptions): {
|
|
590
590
|
x: vue.WritableComputedRef<number, number>;
|
|
591
591
|
y: vue.WritableComputedRef<number, number>;
|
|
592
|
-
isScrolling: vue.
|
|
592
|
+
isScrolling: vue.ShallowRef<boolean, boolean>;
|
|
593
593
|
arrivedState: {
|
|
594
594
|
left: boolean;
|
|
595
595
|
right: boolean;
|
|
@@ -705,16 +705,16 @@ interface MouseInElementOptions extends UseMouseOptions {
|
|
|
705
705
|
* @param options
|
|
706
706
|
*/
|
|
707
707
|
declare function useMouseInElement(target?: MaybeElementRef, options?: MouseInElementOptions): {
|
|
708
|
-
x: vue.
|
|
709
|
-
y: vue.
|
|
710
|
-
sourceType: vue.
|
|
711
|
-
elementX: vue.
|
|
712
|
-
elementY: vue.
|
|
713
|
-
elementPositionX: vue.
|
|
714
|
-
elementPositionY: vue.
|
|
715
|
-
elementHeight: vue.
|
|
716
|
-
elementWidth: vue.
|
|
717
|
-
isOutside: vue.
|
|
708
|
+
x: vue.ShallowRef<number, number>;
|
|
709
|
+
y: vue.ShallowRef<number, number>;
|
|
710
|
+
sourceType: vue.ShallowRef<UseMouseSourceType, UseMouseSourceType>;
|
|
711
|
+
elementX: vue.ShallowRef<number, number>;
|
|
712
|
+
elementY: vue.ShallowRef<number, number>;
|
|
713
|
+
elementPositionX: vue.ShallowRef<number, number>;
|
|
714
|
+
elementPositionY: vue.ShallowRef<number, number>;
|
|
715
|
+
elementHeight: vue.ShallowRef<number, number>;
|
|
716
|
+
elementWidth: vue.ShallowRef<number, number>;
|
|
717
|
+
isOutside: vue.ShallowRef<boolean, boolean>;
|
|
718
718
|
stop: () => void;
|
|
719
719
|
};
|
|
720
720
|
type UseMouseInElementReturn = ReturnType<typeof useMouseInElement>;
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,19 @@ interface ConfigurableWindow {
|
|
|
7
7
|
window?: Window;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
interface Position {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
interface RenderableComponent {
|
|
15
|
+
/**
|
|
16
|
+
* The element that the component should be rendered as
|
|
17
|
+
*
|
|
18
|
+
* @default 'div'
|
|
19
|
+
*/
|
|
20
|
+
as?: object | string;
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
type VueInstance = ComponentPublicInstance;
|
|
11
24
|
type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
|
|
12
25
|
type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeRefOrGetter<T>;
|
|
@@ -41,19 +54,6 @@ type OnClickOutsideHandler<T extends {
|
|
|
41
54
|
controls: false;
|
|
42
55
|
}> = (event: T['controls'] extends true ? Event | (T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) : T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) => void;
|
|
43
56
|
|
|
44
|
-
interface Position {
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
}
|
|
48
|
-
interface RenderableComponent {
|
|
49
|
-
/**
|
|
50
|
-
* The element that the component should be rendered as
|
|
51
|
-
*
|
|
52
|
-
* @default 'div'
|
|
53
|
-
*/
|
|
54
|
-
as?: object | string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
57
|
interface OnClickOutsideProps extends RenderableComponent {
|
|
58
58
|
options?: Omit<OnClickOutsideOptions, 'controls'>;
|
|
59
59
|
}
|
|
@@ -378,14 +378,14 @@ interface UseElementBoundingOptions {
|
|
|
378
378
|
* @param target
|
|
379
379
|
*/
|
|
380
380
|
declare function useElementBounding(target: MaybeComputedElementRef, options?: UseElementBoundingOptions): {
|
|
381
|
-
height: vue.
|
|
382
|
-
bottom: vue.
|
|
383
|
-
left: vue.
|
|
384
|
-
right: vue.
|
|
385
|
-
top: vue.
|
|
386
|
-
width: vue.
|
|
387
|
-
x: vue.
|
|
388
|
-
y: vue.
|
|
381
|
+
height: vue.ShallowRef<number, number>;
|
|
382
|
+
bottom: vue.ShallowRef<number, number>;
|
|
383
|
+
left: vue.ShallowRef<number, number>;
|
|
384
|
+
right: vue.ShallowRef<number, number>;
|
|
385
|
+
top: vue.ShallowRef<number, number>;
|
|
386
|
+
width: vue.ShallowRef<number, number>;
|
|
387
|
+
x: vue.ShallowRef<number, number>;
|
|
388
|
+
y: vue.ShallowRef<number, number>;
|
|
389
389
|
update: () => void;
|
|
390
390
|
};
|
|
391
391
|
type UseElementBoundingReturn = ReturnType<typeof useElementBounding>;
|
|
@@ -589,7 +589,7 @@ interface UseScrollOptions extends ConfigurableWindow {
|
|
|
589
589
|
declare function useScroll(element: MaybeRefOrGetter<HTMLElement | SVGElement | Window | Document | null | undefined>, options?: UseScrollOptions): {
|
|
590
590
|
x: vue.WritableComputedRef<number, number>;
|
|
591
591
|
y: vue.WritableComputedRef<number, number>;
|
|
592
|
-
isScrolling: vue.
|
|
592
|
+
isScrolling: vue.ShallowRef<boolean, boolean>;
|
|
593
593
|
arrivedState: {
|
|
594
594
|
left: boolean;
|
|
595
595
|
right: boolean;
|
|
@@ -705,16 +705,16 @@ interface MouseInElementOptions extends UseMouseOptions {
|
|
|
705
705
|
* @param options
|
|
706
706
|
*/
|
|
707
707
|
declare function useMouseInElement(target?: MaybeElementRef, options?: MouseInElementOptions): {
|
|
708
|
-
x: vue.
|
|
709
|
-
y: vue.
|
|
710
|
-
sourceType: vue.
|
|
711
|
-
elementX: vue.
|
|
712
|
-
elementY: vue.
|
|
713
|
-
elementPositionX: vue.
|
|
714
|
-
elementPositionY: vue.
|
|
715
|
-
elementHeight: vue.
|
|
716
|
-
elementWidth: vue.
|
|
717
|
-
isOutside: vue.
|
|
708
|
+
x: vue.ShallowRef<number, number>;
|
|
709
|
+
y: vue.ShallowRef<number, number>;
|
|
710
|
+
sourceType: vue.ShallowRef<UseMouseSourceType, UseMouseSourceType>;
|
|
711
|
+
elementX: vue.ShallowRef<number, number>;
|
|
712
|
+
elementY: vue.ShallowRef<number, number>;
|
|
713
|
+
elementPositionX: vue.ShallowRef<number, number>;
|
|
714
|
+
elementPositionY: vue.ShallowRef<number, number>;
|
|
715
|
+
elementHeight: vue.ShallowRef<number, number>;
|
|
716
|
+
elementWidth: vue.ShallowRef<number, number>;
|
|
717
|
+
isOutside: vue.ShallowRef<boolean, boolean>;
|
|
718
718
|
stop: () => void;
|
|
719
719
|
};
|
|
720
720
|
type UseMouseInElementReturn = ReturnType<typeof useMouseInElement>;
|
package/index.iife.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
props: ["as", "options"],
|
|
7
7
|
emits: ["trigger"],
|
|
8
8
|
setup(props, { slots, emit }) {
|
|
9
|
-
const target = vue.
|
|
9
|
+
const target = vue.shallowRef();
|
|
10
10
|
core.onClickOutside(target, (e) => {
|
|
11
11
|
emit("trigger", e);
|
|
12
12
|
}, props.options);
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
props: ["as", "options"],
|
|
336
336
|
emits: ["trigger"],
|
|
337
337
|
setup(props, { slots, emit }) {
|
|
338
|
-
const target = vue.
|
|
338
|
+
const target = vue.shallowRef();
|
|
339
339
|
onLongPress(
|
|
340
340
|
target,
|
|
341
341
|
(e) => {
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
function useMounted() {
|
|
434
|
-
const isMounted = vue.
|
|
434
|
+
const isMounted = vue.shallowRef(false);
|
|
435
435
|
const instance = vue.getCurrentInstance();
|
|
436
436
|
if (instance) {
|
|
437
437
|
vue.onMounted(() => {
|
|
@@ -454,7 +454,7 @@
|
|
|
454
454
|
const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
|
|
455
455
|
const ssrSupport = vue.ref(typeof ssrWidth === "number");
|
|
456
456
|
const mediaQuery = vue.shallowRef();
|
|
457
|
-
const matches = vue.
|
|
457
|
+
const matches = vue.shallowRef(false);
|
|
458
458
|
const handler = (event) => {
|
|
459
459
|
matches.value = event.matches;
|
|
460
460
|
};
|
|
@@ -861,7 +861,7 @@
|
|
|
861
861
|
"containerElement"
|
|
862
862
|
],
|
|
863
863
|
setup(props, { slots }) {
|
|
864
|
-
const target = vue.
|
|
864
|
+
const target = vue.shallowRef();
|
|
865
865
|
const handle = vue.computed(() => {
|
|
866
866
|
var _a;
|
|
867
867
|
return (_a = props.handle) != null ? _a : target.value;
|
|
@@ -904,7 +904,7 @@
|
|
|
904
904
|
name: "UseElementBounding",
|
|
905
905
|
props: ["box", "as"],
|
|
906
906
|
setup(props, { slots }) {
|
|
907
|
-
const target = vue.
|
|
907
|
+
const target = vue.shallowRef();
|
|
908
908
|
const data = vue.reactive(core.useElementBounding(target));
|
|
909
909
|
return () => {
|
|
910
910
|
if (slots.default)
|
|
@@ -1001,14 +1001,14 @@
|
|
|
1001
1001
|
immediate = true,
|
|
1002
1002
|
updateTiming = "sync"
|
|
1003
1003
|
} = options;
|
|
1004
|
-
const height = vue.
|
|
1005
|
-
const bottom = vue.
|
|
1006
|
-
const left = vue.
|
|
1007
|
-
const right = vue.
|
|
1008
|
-
const top = vue.
|
|
1009
|
-
const width = vue.
|
|
1010
|
-
const x = vue.
|
|
1011
|
-
const y = vue.
|
|
1004
|
+
const height = vue.shallowRef(0);
|
|
1005
|
+
const bottom = vue.shallowRef(0);
|
|
1006
|
+
const left = vue.shallowRef(0);
|
|
1007
|
+
const right = vue.shallowRef(0);
|
|
1008
|
+
const top = vue.shallowRef(0);
|
|
1009
|
+
const width = vue.shallowRef(0);
|
|
1010
|
+
const x = vue.shallowRef(0);
|
|
1011
|
+
const y = vue.shallowRef(0);
|
|
1012
1012
|
function recalculate() {
|
|
1013
1013
|
const el = unrefElement(target);
|
|
1014
1014
|
if (!el) {
|
|
@@ -1131,7 +1131,7 @@
|
|
|
1131
1131
|
triggerOnRemoval = false,
|
|
1132
1132
|
window = defaultWindow
|
|
1133
1133
|
} = options;
|
|
1134
|
-
const isHovered = vue.
|
|
1134
|
+
const isHovered = vue.shallowRef(false);
|
|
1135
1135
|
let timer;
|
|
1136
1136
|
const toggle = (entering) => {
|
|
1137
1137
|
const delay = entering ? delayEnter : delayLeave;
|
|
@@ -1333,7 +1333,7 @@
|
|
|
1333
1333
|
rootMargin,
|
|
1334
1334
|
once = false
|
|
1335
1335
|
} = options;
|
|
1336
|
-
const elementIsVisible = vue.
|
|
1336
|
+
const elementIsVisible = vue.shallowRef(false);
|
|
1337
1337
|
const { stop } = useIntersectionObserver(
|
|
1338
1338
|
element,
|
|
1339
1339
|
(intersectionObserverEntries) => {
|
|
@@ -1438,8 +1438,8 @@
|
|
|
1438
1438
|
throwError
|
|
1439
1439
|
} = options != null ? options : {};
|
|
1440
1440
|
const state = shallow ? vue.shallowRef(initialState) : vue.ref(initialState);
|
|
1441
|
-
const isReady = vue.
|
|
1442
|
-
const isLoading = vue.
|
|
1441
|
+
const isReady = vue.shallowRef(false);
|
|
1442
|
+
const isLoading = vue.shallowRef(false);
|
|
1443
1443
|
const error = vue.shallowRef(void 0);
|
|
1444
1444
|
async function execute(delay2 = 0, ...args) {
|
|
1445
1445
|
if (resetOnExecute)
|
|
@@ -1602,8 +1602,8 @@
|
|
|
1602
1602
|
console.error(e);
|
|
1603
1603
|
}
|
|
1604
1604
|
} = options;
|
|
1605
|
-
const internalX = vue.
|
|
1606
|
-
const internalY = vue.
|
|
1605
|
+
const internalX = vue.shallowRef(0);
|
|
1606
|
+
const internalY = vue.shallowRef(0);
|
|
1607
1607
|
const x = vue.computed({
|
|
1608
1608
|
get() {
|
|
1609
1609
|
return internalX.value;
|
|
@@ -1638,7 +1638,7 @@
|
|
|
1638
1638
|
if (y != null)
|
|
1639
1639
|
internalY.value = scrollContainer.scrollTop;
|
|
1640
1640
|
}
|
|
1641
|
-
const isScrolling = vue.
|
|
1641
|
+
const isScrolling = vue.shallowRef(false);
|
|
1642
1642
|
const arrivedState = vue.reactive({
|
|
1643
1643
|
left: true,
|
|
1644
1644
|
right: false,
|
|
@@ -1862,9 +1862,9 @@
|
|
|
1862
1862
|
let _prevMouseEvent = null;
|
|
1863
1863
|
let _prevScrollX = 0;
|
|
1864
1864
|
let _prevScrollY = 0;
|
|
1865
|
-
const x = vue.
|
|
1866
|
-
const y = vue.
|
|
1867
|
-
const sourceType = vue.
|
|
1865
|
+
const x = vue.shallowRef(initialValue.x);
|
|
1866
|
+
const y = vue.shallowRef(initialValue.y);
|
|
1867
|
+
const sourceType = vue.shallowRef(null);
|
|
1868
1868
|
const extractor = typeof type === "function" ? type : UseMouseBuiltinExtractors[type];
|
|
1869
1869
|
const mouseHandler = (event) => {
|
|
1870
1870
|
const result = extractor(event);
|
|
@@ -1929,13 +1929,13 @@
|
|
|
1929
1929
|
const type = options.type || "page";
|
|
1930
1930
|
const { x, y, sourceType } = useMouse(options);
|
|
1931
1931
|
const targetRef = vue.ref(target != null ? target : window == null ? void 0 : window.document.body);
|
|
1932
|
-
const elementX = vue.
|
|
1933
|
-
const elementY = vue.
|
|
1934
|
-
const elementPositionX = vue.
|
|
1935
|
-
const elementPositionY = vue.
|
|
1936
|
-
const elementHeight = vue.
|
|
1937
|
-
const elementWidth = vue.
|
|
1938
|
-
const isOutside = vue.
|
|
1932
|
+
const elementX = vue.shallowRef(0);
|
|
1933
|
+
const elementY = vue.shallowRef(0);
|
|
1934
|
+
const elementPositionX = vue.shallowRef(0);
|
|
1935
|
+
const elementPositionY = vue.shallowRef(0);
|
|
1936
|
+
const elementHeight = vue.shallowRef(0);
|
|
1937
|
+
const elementWidth = vue.shallowRef(0);
|
|
1938
|
+
const isOutside = vue.shallowRef(true);
|
|
1939
1939
|
let stop = () => {
|
|
1940
1940
|
};
|
|
1941
1941
|
if (window) {
|
|
@@ -2121,7 +2121,7 @@
|
|
|
2121
2121
|
"target"
|
|
2122
2122
|
],
|
|
2123
2123
|
setup(props, { slots }) {
|
|
2124
|
-
const el = vue.
|
|
2124
|
+
const el = vue.shallowRef(null);
|
|
2125
2125
|
const data = vue.reactive(core.usePointer({
|
|
2126
2126
|
...props,
|
|
2127
2127
|
target: props.target === "self" ? el : defaultWindow
|
|
@@ -2235,7 +2235,7 @@
|
|
|
2235
2235
|
|
|
2236
2236
|
function useCssVar(prop, target, options = {}) {
|
|
2237
2237
|
const { window = defaultWindow, initialValue, observe = false } = options;
|
|
2238
|
-
const variable = vue.
|
|
2238
|
+
const variable = vue.shallowRef(initialValue);
|
|
2239
2239
|
const elRef = vue.computed(() => {
|
|
2240
2240
|
var _a;
|
|
2241
2241
|
return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
|
|
@@ -2284,10 +2284,10 @@
|
|
|
2284
2284
|
const bottomVarName = "--vueuse-safe-area-bottom";
|
|
2285
2285
|
const leftVarName = "--vueuse-safe-area-left";
|
|
2286
2286
|
function useScreenSafeArea() {
|
|
2287
|
-
const top = vue.
|
|
2288
|
-
const right = vue.
|
|
2289
|
-
const bottom = vue.
|
|
2290
|
-
const left = vue.
|
|
2287
|
+
const top = vue.shallowRef("");
|
|
2288
|
+
const right = vue.shallowRef("");
|
|
2289
|
+
const bottom = vue.shallowRef("");
|
|
2290
|
+
const left = vue.shallowRef("");
|
|
2291
2291
|
if (shared.isClient) {
|
|
2292
2292
|
const topCssVar = useCssVar(topVarName);
|
|
2293
2293
|
const rightCssVar = useCssVar(rightVarName);
|
|
@@ -2468,7 +2468,7 @@
|
|
|
2468
2468
|
|
|
2469
2469
|
function onScrollLock() {
|
|
2470
2470
|
let isMounted = false;
|
|
2471
|
-
const state = vue.
|
|
2471
|
+
const state = vue.shallowRef(false);
|
|
2472
2472
|
return (el, binding) => {
|
|
2473
2473
|
state.value = binding.value;
|
|
2474
2474
|
if (isMounted)
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(y,C,o,S){"use strict";const ge=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return C.onClickOutside(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),A=S.isClient?window:void 0;function k(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function _(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},r=(s,c,f,u)=>(s.addEventListener(c,f,u),()=>s.removeEventListener(c,f,u)),a=o.computed(()=>{const s=S.toArray(o.toValue(e[0])).filter(c=>c!=null);return s.every(c=>typeof c!="string")?s:void 0}),i=S.watchImmediate(()=>{var s,c;return[(c=(s=a.value)==null?void 0:s.map(f=>k(f)))!=null?c:[A].filter(f=>f!=null),S.toArray(o.toValue(a.value?e[1]:e[0])),S.toArray(o.unref(a.value?e[2]:e[1])),o.toValue(a.value?e[3]:e[2])]},([s,c,f,u])=>{if(n(),!s?.length||!c?.length||!f?.length)return;const d=S.isObject(u)?{...u}:u;t.push(...s.flatMap(p=>c.flatMap(U=>f.map(g=>r(p,U,g,d)))))},{flush:"post"}),l=()=>{i(),n()};return S.tryOnScopeDispose(n),l}let Q=!1;function Z(e,t,n={}){const{window:r=A,ignore:a=[],capture:i=!0,detectIframe:l=!1,controls:s=!1}=n;if(!r)return s?{stop:S.noop,cancel:S.noop,trigger:S.noop}:S.noop;if(S.isIOS&&!Q){Q=!0;const h={passive:!0};Array.from(r.document.body.children).forEach(m=>_(m,"click",S.noop,h)),_(r.document.documentElement,"click",S.noop,h)}let c=!0;const f=h=>o.toValue(a).some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(w=>w===h.target||h.composedPath().includes(w));{const w=k(m);return w&&(h.target===w||h.composedPath().includes(w))}});function u(h){const m=o.toValue(h);return m&&m.$.subTree.shapeFlag===16}function d(h,m){const w=o.toValue(h),P=w.$.subTree&&w.$.subTree.children;return P==null||!Array.isArray(P)?!1:P.some(E=>E.el===m.target||m.composedPath().includes(E.el))}const p=h=>{const m=k(e);if(h.target!=null&&!(!(m instanceof Element)&&u(e)&&d(e,h))&&!(!m||m===h.target||h.composedPath().includes(m))){if("detail"in h&&h.detail===0&&(c=!f(h)),!c){c=!0;return}t(h)}};let U=!1;const g=[_(r,"click",h=>{U||(U=!0,setTimeout(()=>{U=!1},0),p(h))},{passive:!0,capture:i}),_(r,"pointerdown",h=>{const m=k(e);c=!f(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),l&&_(r,"blur",h=>{setTimeout(()=>{var m;const w=k(e);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!w?.contains(r.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean),b=()=>g.forEach(h=>h());return s?{stop:b,cancel:()=>{c=!1},trigger:h=>{c=!0,p(h),c=!1}}:b}const ee={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Z(e,t.value,{capture:n});else{const[r,a]=t.value;e.__onClickOutside_stop=Z(e,r,Object.assign({capture:n},a))}},unmounted(e){e.__onClickOutside_stop()}};function ye(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function te(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=A,eventName:i="keydown",passive:l=!1,dedupe:s=!1}=r,c=ye(t);return _(a,i,u=>{u.repeat&&o.toValue(s)||c(u)&&n(u)},l)}const we={mounted(e,t){var n,r;const a=(r=(n=t.arg)==null?void 0:n.split(","))!=null?r:!0;if(typeof t.value=="function")te(a,t.value,{target:e});else{const[i,l]=t.value;te(a,i,{target:e,...l})}}},Ue=500,Se=10;function X(e,t,n){var r,a;const i=o.computed(()=>k(e));let l,s,c,f=!1;function u(){l&&(clearTimeout(l),l=void 0),s=void 0,c=void 0,f=!1}function d(m){var w,P,E;const[D,R,v]=[c,s,f];if(u(),!n?.onMouseUp||!R||!D||(w=n?.modifiers)!=null&&w.self&&m.target!==i.value)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation();const L=m.x-R.x,T=m.y-R.y,I=Math.sqrt(L*L+T*T);n.onMouseUp(m.timeStamp-D,I,v)}function p(m){var w,P,E,D;(w=n?.modifiers)!=null&&w.self&&m.target!==i.value||(u(),(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation(),s={x:m.x,y:m.y},c=m.timeStamp,l=setTimeout(()=>{f=!0,t(m)},(D=n?.delay)!=null?D:Ue))}function U(m){var w,P,E,D;if((w=n?.modifiers)!=null&&w.self&&m.target!==i.value||!s||n?.distanceThreshold===!1)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation();const R=m.x-s.x,v=m.y-s.y;Math.sqrt(R*R+v*v)>=((D=n?.distanceThreshold)!=null?D:Se)&&u()}const g={capture:(r=n?.modifiers)==null?void 0:r.capture,once:(a=n?.modifiers)==null?void 0:a.once},b=[_(i,"pointerdown",p,g),_(i,"pointermove",U,g),_(i,["pointerup","pointerleave"],d,g)];return()=>b.forEach(m=>m())}const be=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const r=o.ref();return X(r,a=>{n("trigger",a)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:r},t.default())}}}),ne={mounted(e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ce=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var r;return(r=t.default)==null?void 0:r.call(t,n)}}}),B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__",Ve=De();function De(){return H in B||(B[H]=B[H]||{}),B[H]}function oe(e,t){return Ve[e]||t}const Me=Symbol("vueuse-ssr-width");function _e(){const e=o.hasInjectionContext()?S.injectLocal(Me,null):null;return typeof e=="number"?e:void 0}function Te(){const e=o.ref(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function N(e){const t=Te();return o.computed(()=>(t.value,!!e()))}function ke(e,t={}){const{window:n=A,ssrWidth:r=_e()}=t,a=N(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=o.ref(typeof r=="number"),l=o.shallowRef(),s=o.ref(!1),c=f=>{s.value=f.matches};return o.watchEffect(()=>{if(i.value){i.value=!a.value;const f=o.toValue(e).split(",");s.value=f.some(u=>{const d=u.includes("not all"),p=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),U=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let g=!!(p||U);return p&&g&&(g=r>=S.pxValue(p[1])),U&&g&&(g=r<=S.pxValue(U[1])),d?!g:g});return}a.value&&(l.value=n.matchMedia(o.toValue(e)),s.value=l.value.matches)}),_(l,"change",c,{passive:!0}),o.computed(()=>s.value)}function Le(e){return ke("(prefers-color-scheme: dark)",e)}function Re(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ae={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},re="vueuse-storage";function Ie(e,t,n,r={}){var a;const{flush:i="pre",deep:l=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:u,window:d=A,eventFilter:p,onError:U=O=>{console.error(O)},initOnMounted:g}=r,b=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),h=o.computed(()=>o.toValue(e));if(!n)try{n=oe("getDefaultStorage",()=>{var O;return(O=A)==null?void 0:O.localStorage})()}catch(O){U(O)}if(!n)return b;const m=o.toValue(t),w=Re(m),P=(a=r.serializer)!=null?a:Ae[w],{pause:E,resume:D}=S.pausableWatch(b,()=>v(b.value),{flush:i,deep:l,eventFilter:p});o.watch(h,()=>T(),{flush:i}),d&&s&&S.tryOnMounted(()=>{n instanceof Storage?_(d,"storage",T,{passive:!0}):_(d,re,I),g&&T()}),g||T();function R(O,M){if(d){const V={key:h.value,oldValue:O,newValue:M,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",V):new CustomEvent(re,{detail:V}))}}function v(O){try{const M=n.getItem(h.value);if(O==null)R(M,null),n.removeItem(h.value);else{const V=P.write(O);M!==V&&(n.setItem(h.value,V),R(M,V))}}catch(M){U(M)}}function L(O){const M=O?O.newValue:n.getItem(h.value);if(M==null)return c&&m!=null&&n.setItem(h.value,P.write(m)),m;if(!O&&f){const V=P.read(M);return typeof f=="function"?f(V,m):w==="object"&&!Array.isArray(V)?{...m,...V}:V}else return typeof M!="string"?M:P.read(M)}function T(O){if(!(O&&O.storageArea!==n)){if(O&&O.key==null){b.value=m;return}if(!(O&&O.key!==h.value)){E();try{O?.newValue!==P.write(b.value)&&(b.value=L(O))}catch(M){U(M)}finally{O?o.nextTick(D):D()}}}}function I(O){T(O.detail)}return b}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function We(e={}){const{selector:t="html",attribute:n="class",initialValue:r="auto",window:a=A,storage:i,storageKey:l="vueuse-color-scheme",listenToStorageChanges:s=!0,storageRef:c,emitAuto:f,disableTransition:u=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=Le({window:a}),U=o.computed(()=>p.value?"dark":"light"),g=c||(l==null?S.toRef(r):Ie(l,r,i,{window:a,listenToStorageChanges:s})),b=o.computed(()=>g.value==="auto"?U.value:g.value),h=oe("updateHTMLAttrs",(E,D,R)=>{const v=typeof E=="string"?a?.document.querySelector(E):k(E);if(!v)return;const L=new Set,T=new Set;let I=null;if(D==="class"){const M=R.split(/\s/g);Object.values(d).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{M.includes(V)?L.add(V):T.add(V)})}else I={key:D,value:R};if(L.size===0&&T.size===0&&I===null)return;let O;u&&(O=a.document.createElement("style"),O.appendChild(document.createTextNode(ze)),a.document.head.appendChild(O));for(const M of L)v.classList.add(M);for(const M of T)v.classList.remove(M);I&&v.setAttribute(I.key,I.value),u&&(a.getComputedStyle(O).opacity,document.head.removeChild(O))});function m(E){var D;h(t,n,(D=d[E])!=null?D:E)}function w(E){e.onChanged?e.onChanged(E,m):m(E)}o.watch(b,w,{flush:"post",immediate:!0}),S.tryOnMounted(()=>w(b.value));const P=o.computed({get(){return f?g.value:b.value},set(E){g.value=E}});return Object.assign(P,{store:g,system:U,state:b})}const Be=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=We(e),r=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(r)}}}),He=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),r=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(r)}}}),Ne=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.ref(),r=o.computed(()=>{var u;return(u=e.handle)!=null?u:n.value}),a=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),i=o.computed(()=>!!e.disabled),l=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),s=l||e.initialValue||{x:0,y:0},c=(u,d)=>{var p;(p=e.onEnd)==null||p.call(e,u,d),l&&(l.value.x=u.x,l.value.y=u.y)},f=o.reactive(C.useDraggable(n,{...e,handle:r,initialValue:s,onEnd:c,disabled:i,containerElement:a}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),Ke=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function K(e,t,n={}){const{window:r=A,...a}=n;let i;const l=N(()=>r&&"MutationObserver"in r),s=()=>{i&&(i.disconnect(),i=void 0)},c=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(k).filter(S.notNullish);return new Set(U)}),f=o.watch(()=>c.value,p=>{s(),l.value&&p.size&&(i=new MutationObserver(t),p.forEach(U=>i.observe(U,a)))},{immediate:!0,flush:"post"}),u=()=>i?.takeRecords(),d=()=>{f(),s()};return S.tryOnScopeDispose(d),{isSupported:l,stop:d,takeRecords:u}}function F(e,t,n={}){const{window:r=A,...a}=n;let i;const l=N(()=>r&&"ResizeObserver"in r),s=()=>{i&&(i.disconnect(),i=void 0)},c=o.computed(()=>{const d=o.toValue(e);return Array.isArray(d)?d.map(p=>k(p)):[k(d)]}),f=o.watch(c,d=>{if(s(),l.value&&r){i=new ResizeObserver(t);for(const p of d)p&&i.observe(p,a)}},{immediate:!0,flush:"post"}),u=()=>{s(),f()};return S.tryOnScopeDispose(u),{isSupported:l,stop:u}}function Ge(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:a=!0,immediate:i=!0,updateTiming:l="sync"}=t,s=o.ref(0),c=o.ref(0),f=o.ref(0),u=o.ref(0),d=o.ref(0),p=o.ref(0),U=o.ref(0),g=o.ref(0);function b(){const m=k(e);if(!m){n&&(s.value=0,c.value=0,f.value=0,u.value=0,d.value=0,p.value=0,U.value=0,g.value=0);return}const w=m.getBoundingClientRect();s.value=w.height,c.value=w.bottom,f.value=w.left,u.value=w.right,d.value=w.top,p.value=w.width,U.value=w.x,g.value=w.y}function h(){l==="sync"?b():l==="next-frame"&&requestAnimationFrame(()=>b())}return F(e,h),o.watch(()=>k(e),m=>!m&&h()),K(e,h,{attributeFilter:["style","class"]}),a&&_("scroll",h,{capture:!0,passive:!0}),r&&_("resize",h,{passive:!0}),S.tryOnMounted(()=>{i&&h()}),{height:s,bottom:c,left:f,right:u,top:d,width:p,x:U,y:g,update:h}}const Je={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,{height:a,bottom:i,left:l,right:s,top:c,width:f,x:u,y:d}=Ge(e,r);o.watch([a,i,l,s,c,f,u,d],()=>n({height:a,bottom:i,left:l,right:s,top:c,width:f,x:u,y:d}))}};function $e(e,t,n={}){const{window:r=A,document:a=r?.document,flush:i="sync"}=n;if(!r||!a)return S.noop;let l;const s=u=>{l?.(),l=u},c=o.watchEffect(()=>{const u=k(e);if(u){const{stop:d}=K(a,p=>{p.map(g=>[...g.removedNodes]).flat().some(g=>g===u||g.contains(u))&&t(p)},{window:r,childList:!0,subtree:!0});s(d)}},{flush:i}),f=()=>{c(),s()};return S.tryOnScopeDispose(f),f}function ae(e,t={}){const{delayEnter:n=0,delayLeave:r=0,triggerOnRemoval:a=!1,window:i=A}=t,l=o.ref(!1);let s;const c=f=>{const u=f?n:r;s&&(clearTimeout(s),s=void 0),u?s=setTimeout(()=>l.value=f,u):l.value=f};return i&&(_(e,"mouseenter",()=>c(!0),{passive:!0}),_(e,"mouseleave",()=>c(!1),{passive:!0}),a&&$e(o.computed(()=>k(e)),()=>c(!1))),l}const qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const r=ae(e);o.watch(r,a=>n(a))}else{const[r,a]=n,i=ae(e,a);o.watch(i,l=>r(l))}}},Qe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function Ze(e,t={width:0,height:0},n={}){const{window:r=A,box:a="content-box"}=n,i=o.computed(()=>{var d,p;return(p=(d=k(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),l=o.ref(t.width),s=o.ref(t.height),{stop:c}=F(e,([d])=>{const p=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&i.value){const U=k(e);if(U){const g=U.getBoundingClientRect();l.value=g.width,s.value=g.height}}else if(p){const U=S.toArray(p);l.value=U.reduce((g,{inlineSize:b})=>g+b,0),s.value=U.reduce((g,{blockSize:b})=>g+b,0)}else l.value=d.contentRect.width,s.value=d.contentRect.height},n);S.tryOnMounted(()=>{const d=k(e);d&&(l.value="offsetWidth"in d?d.offsetWidth:t.width,s.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>k(e),d=>{l.value=d?t.width:0,s.value=d?t.height:0});function u(){c(),f()}return{width:l,height:s,stop:u}}const et={mounted(e,t){var n;const r=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],a=typeof t.value=="function"?[]:t.value.slice(1),{width:i,height:l}=Ze(e,...a);o.watch([i,l],([s,c])=>r({width:s,height:c}))}},tt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}});function G(e,t,n={}){const{root:r,rootMargin:a="0px",threshold:i=0,window:l=A,immediate:s=!0}=n,c=N(()=>l&&"IntersectionObserver"in l),f=o.computed(()=>{const g=o.toValue(e);return S.toArray(g).map(k).filter(S.notNullish)});let u=S.noop;const d=o.ref(s),p=c.value?o.watch(()=>[f.value,k(r),d.value],([g,b])=>{if(u(),!d.value||!g.length)return;const h=new IntersectionObserver(t,{root:k(b),rootMargin:a,threshold:i});g.forEach(m=>m&&h.observe(m)),u=()=>{h.disconnect(),u=S.noop}},{immediate:s,flush:"post"}):S.noop,U=()=>{u(),p(),d.value=!1};return S.tryOnScopeDispose(U),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:U}}function J(e,t={}){const{window:n=A,scrollTarget:r,threshold:a=0,rootMargin:i,once:l=!1}=t,s=o.ref(!1),{stop:c}=G(e,f=>{let u=s.value,d=0;for(const p of f)p.time>=d&&(d=p.time,u=p.isIntersecting);s.value=u,l&&S.watchOnce(s,()=>{c()})},{root:r,window:n,threshold:a,rootMargin:o.toValue(i)});return s}const nt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=J(e);o.watch(r,a=>n(a),{immediate:!0})}else{const[n,r]=t.value,a=J(e,r);o.watch(a,i=>n(i),{immediate:!0})}}},ot=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),rt=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),at=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),st=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function it(e,t,n){const{immediate:r=!0,delay:a=0,onError:i=S.noop,onSuccess:l=S.noop,resetOnExecute:s=!0,shallow:c=!0,throwError:f}=n??{},u=c?o.shallowRef(t):o.ref(t),d=o.ref(!1),p=o.ref(!1),U=o.shallowRef(void 0);async function g(m=0,...w){s&&(u.value=t),U.value=void 0,d.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const P=typeof e=="function"?e(...w):e;try{const E=await P;u.value=E,d.value=!0,l(E)}catch(E){if(U.value=E,i(E),f)throw E}finally{p.value=!1}return u.value}r&&g(a);const b={state:u,isReady:d,isLoading:p,error:U,execute:g};function h(){return new Promise((m,w)=>{S.until(p).toBe(!1).then(()=>m(b)).catch(w)})}return{...b,then(m,w){return h().then(m,w)}}}async function lt(e){return new Promise((t,n)=>{const r=new Image,{src:a,srcset:i,sizes:l,class:s,loading:c,crossorigin:f,referrerPolicy:u,width:d,height:p,decoding:U,fetchPriority:g,ismap:b,usemap:h}=e;r.src=a,i!=null&&(r.srcset=i),l!=null&&(r.sizes=l),s!=null&&(r.className=s),c!=null&&(r.loading=c),f!=null&&(r.crossOrigin=f),u!=null&&(r.referrerPolicy=u),d!=null&&(r.width=d),p!=null&&(r.height=p),U!=null&&(r.decoding=U),g!=null&&(r.fetchPriority=g),b!=null&&(r.isMap=b),h!=null&&(r.useMap=h),r.onload=()=>t(r),r.onerror=n})}function ut(e,t={}){const n=it(()=>lt(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ct=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ut(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const se=1;function $(e,t={}){const{throttle:n=0,idle:r=200,onStop:a=S.noop,onScroll:i=S.noop,offset:l={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:c="auto",window:f=A,onError:u=v=>{console.error(v)}}=t,d=o.ref(0),p=o.ref(0),U=o.computed({get(){return d.value},set(v){b(v,void 0)}}),g=o.computed({get(){return p.value},set(v){b(void 0,v)}});function b(v,L){var T,I,O,M;if(!f)return;const V=o.toValue(e);if(!V)return;(O=V instanceof Document?f.document.body:V)==null||O.scrollTo({top:(T=o.toValue(L))!=null?T:g.value,left:(I=o.toValue(v))!=null?I:U.value,behavior:o.toValue(c)});const z=((M=V?.document)==null?void 0:M.documentElement)||V?.documentElement||V;U!=null&&(d.value=z.scrollLeft),g!=null&&(p.value=z.scrollTop)}const h=o.ref(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),w=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),P=v=>{h.value&&(h.value=!1,w.left=!1,w.right=!1,w.top=!1,w.bottom=!1,a(v))},E=S.useDebounceFn(P,n+r),D=v=>{var L;if(!f)return;const T=((L=v?.document)==null?void 0:L.documentElement)||v?.documentElement||k(v),{display:I,flexDirection:O,direction:M}=getComputedStyle(T),V=M==="rtl"?-1:1,z=T.scrollLeft;w.left=z<d.value,w.right=z>d.value;const me=z*V<=(l.left||0),pe=z*V+T.clientWidth>=T.scrollWidth-(l.right||0)-se;I==="flex"&&O==="row-reverse"?(m.left=pe,m.right=me):(m.left=me,m.right=pe),d.value=z;let W=T.scrollTop;v===f.document&&!W&&(W=f.document.body.scrollTop),w.top=W<p.value,w.bottom=W>p.value;const he=W<=(l.top||0),ve=W+T.clientHeight>=T.scrollHeight-(l.bottom||0)-se;I==="flex"&&O==="column-reverse"?(m.top=ve,m.bottom=he):(m.top=he,m.bottom=ve),p.value=W},R=v=>{var L;if(!f)return;const T=(L=v.target.documentElement)!=null?L:v.target;D(T),h.value=!0,E(v),i(v)};return _(e,"scroll",n?S.useThrottleFn(R,n,!0,!1):R,s),S.tryOnMounted(()=>{try{const v=o.toValue(e);if(!v)return;D(v)}catch(v){u(v)}}),_(e,"scrollend",P,s),{x:U,y:g,isScrolling:h,arrivedState:m,directions:w,measure(){const v=o.toValue(e);f&&v&&D(v)}}}function ie(e,t,n={}){var r;const{direction:a="bottom",interval:i=100,canLoadMore:l=()=>!0}=n,s=o.reactive($(e,{...n,offset:{[a]:(r=n.distance)!=null?r:0,...n.offset}})),c=o.ref(),f=o.computed(()=>!!c.value),u=o.computed(()=>j(o.toValue(e))),d=J(u);function p(){if(s.measure(),!u.value||!d.value||!l(u.value))return;const{scrollHeight:g,clientHeight:b,scrollWidth:h,clientWidth:m}=u.value,w=a==="bottom"||a==="top"?g<=b:h<=m;(s.arrivedState[a]||w)&&(c.value||(c.value=Promise.all([t(s),new Promise(P=>setTimeout(P,i))]).finally(()=>{c.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[s.arrivedState[a],d.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>p())}}}const ft={mounted(e,t){typeof t.value=="function"?ie(e,t.value):ie(e,...t.value)}},dt={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}},mt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),ht={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function vt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:r=!1,initialValue:a={x:0,y:0},window:i=A,target:l=i,scroll:s=!0,eventFilter:c}=e;let f=null,u=0,d=0;const p=o.ref(a.x),U=o.ref(a.y),g=o.ref(null),b=typeof t=="function"?t:ht[t],h=v=>{const L=b(v);f=v,L&&([p.value,U.value]=L,g.value="mouse"),i&&(u=i.scrollX,d=i.scrollY)},m=v=>{if(v.touches.length>0){const L=b(v.touches[0]);L&&([p.value,U.value]=L,g.value="touch")}},w=()=>{if(!f||!i)return;const v=b(f);f instanceof MouseEvent&&v&&(p.value=v[0]+i.scrollX-u,U.value=v[1]+i.scrollY-d)},P=()=>{p.value=a.x,U.value=a.y},E=c?v=>c(()=>h(v),{}):v=>h(v),D=c?v=>c(()=>m(v),{}):v=>m(v),R=c?()=>c(()=>w(),{}):()=>w();if(l){const v={passive:!0};_(l,["mousemove","dragover"],E,v),n&&t!=="movement"&&(_(l,["touchstart","touchmove"],D,v),r&&_(l,"touchend",P,v)),s&&t==="page"&&_(i,"scroll",R,v)}return{x:p,y:U,sourceType:g}}function gt(e,t={}){const{handleOutside:n=!0,window:r=A}=t,a=t.type||"page",{x:i,y:l,sourceType:s}=vt(t),c=o.ref(e??r?.document.body),f=o.ref(0),u=o.ref(0),d=o.ref(0),p=o.ref(0),U=o.ref(0),g=o.ref(0),b=o.ref(!0);let h=()=>{};return r&&(h=o.watch([c,i,l],()=>{const m=k(c);if(!m||!(m instanceof Element))return;const{left:w,top:P,width:E,height:D}=m.getBoundingClientRect();d.value=w+(a==="page"?r.pageXOffset:0),p.value=P+(a==="page"?r.pageYOffset:0),U.value=D,g.value=E;const R=i.value-d.value,v=l.value-p.value;b.value=E===0||D===0||R<0||v<0||R>E||v>D,(n||!b.value)&&(f.value=R,u.value=v)},{immediate:!0}),_(document,"mouseleave",()=>b.value=!0,{passive:!0})),{x:i,y:l,sourceType:s,elementX:f,elementY:u,elementPositionX:d,elementPositionY:p,elementHeight:U,elementWidth:g,isOutside:b,stop:h}}const yt={mounted(e,t){const[n,r]=typeof t.value=="function"?[t.value,{}]:t.value,a=S.reactiveOmit(o.reactive(gt(e,r)),"stop");o.watch(a,i=>n(i))}},wt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Ut=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),r=C.useObjectUrl(n);return()=>{if(t.default&&r.value)return t.default(r)}}}),Ct=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const r=o.reactive(C.useOffsetPagination({...e,onPageChange(...a){var i;(i=e.onPageChange)==null||i.call(e,...a),n("page-change",...a)},onPageSizeChange(...a){var i;(i=e.onPageSizeChange)==null||i.call(e,...a),n("page-size-change",...a)},onPageCountChange(...a){var i;(i=e.onPageCountChange)==null||i.call(e,...a),n("page-count-change",...a)}}));return()=>{if(t.default)return t.default(r)}}}),Et=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.ref(null),r=o.reactive(C.usePointer({...e,target:e.target==="self"?n:A}));return()=>{if(t.default)return t.default(r,{ref:n})}}}),Vt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),r=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(r))}}}),Dt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),_t=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),Lt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),Rt={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function Y(e,t,n={}){const{window:r=A,initialValue:a,observe:i=!1}=n,l=o.ref(a),s=o.computed(()=>{var f;return k(t)||((f=r?.document)==null?void 0:f.documentElement)});function c(){var f;const u=o.toValue(e),d=o.toValue(s);if(d&&r&&u){const p=(f=r.getComputedStyle(d).getPropertyValue(u))==null?void 0:f.trim();l.value=p||l.value||a}}return i&&K(s,c,{attributeFilter:["style","class"],window:r}),o.watch([s,()=>o.toValue(e)],(f,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),c()}),o.watch([l,s],([f,u])=>{const d=o.toValue(e);u?.style&&d&&(f==null?u.style.removeProperty(d):u.style.setProperty(d,f))},{immediate:!0}),l}const le="--vueuse-safe-area-top",ue="--vueuse-safe-area-right",ce="--vueuse-safe-area-bottom",fe="--vueuse-safe-area-left";function At(){const e=o.ref(""),t=o.ref(""),n=o.ref(""),r=o.ref("");if(S.isClient){const i=Y(le),l=Y(ue),s=Y(ce),c=Y(fe);i.value="env(safe-area-inset-top, 0px)",l.value="env(safe-area-inset-right, 0px)",s.value="env(safe-area-inset-bottom, 0px)",c.value="env(safe-area-inset-left, 0px)",a(),_("resize",S.useDebounceFn(a),{passive:!0})}function a(){e.value=x(le),t.value=x(ue),n.value=x(ce),r.value=x(fe)}return{top:e,right:t,bottom:n,left:r,update:a}}function x(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const It=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:r,bottom:a,left:i}=At();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?r.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?i.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,r=$(e,{onScroll(){n(r)},onStop(){n(r)}})}else{const[n,r]=t.value,a=$(e,{...r,onScroll(i){var l;(l=r.onScroll)==null||l.call(r,i),n(a)},onStop(i){var l;(l=r.onStop)==null||l.call(r,i),n(a)}})}}};function de(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:de(n)}}function Wt(e){const t=e||window.event,n=t.target;return de(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Bt(e,t=!1){const n=o.ref(t);let r=null,a="";o.watch(S.toRef(e),s=>{const c=j(o.toValue(s));if(c){const f=c;if(q.get(f)||q.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(a=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const i=()=>{const s=j(o.toValue(e));!s||n.value||(S.isIOS&&(r=_(s,"touchmove",c=>{Wt(c)},{passive:!1})),s.style.overflow="hidden",n.value=!0)},l=()=>{const s=j(o.toValue(e));!s||!n.value||(S.isIOS&&r?.(),s.style.overflow=a,q.delete(s),n.value=!1)};return S.tryOnScopeDispose(l),o.computed({get(){return n.value},set(s){s?i():l()}})}function Ht(){let e=!1;const t=o.ref(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const a=Bt(n,r.value);o.watch(t,i=>a.value=i)}}const Nt=Ht(),Ft=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),jt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:r}=o.toRefs(e),{list:a,containerProps:i,wrapperProps:l,scrollTo:s}=C.useVirtualList(r,e.options);return n({scrollTo:s}),i.style&&typeof i.style=="object"&&!Array.isArray(i.style)&&(i.style.height=e.height||"300px"),()=>o.h("div",{...i},[o.h("div",{...l.value},a.value.map(c=>o.h("div",{style:{overflow:"hidden",height:c.height}},t.default?t.default(c):"Please set content!")))])}}),xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});y.OnClickOutside=ge,y.OnLongPress=be,y.UseActiveElement=Ce,y.UseBattery=Ee,y.UseBrowserLocation=Oe,y.UseClipboard=Pe,y.UseColorMode=Be,y.UseDark=He,y.UseDeviceMotion=Ne,y.UseDeviceOrientation=Fe,y.UseDevicePixelRatio=je,y.UseDevicesList=Ye,y.UseDocumentVisibility=xe,y.UseDraggable=Xe,y.UseElementBounding=Ke,y.UseElementSize=Qe,y.UseElementVisibility=tt,y.UseEyeDropper=ot,y.UseFullscreen=rt,y.UseGeolocation=at,y.UseIdle=st,y.UseImage=ct,y.UseMouse=mt,y.UseMouseInElement=pt,y.UseMousePressed=wt,y.UseNetwork=Ut,y.UseNow=St,y.UseObjectUrl=bt,y.UseOffsetPagination=Ct,y.UseOnline=Et,y.UsePageLeave=Ot,y.UsePointer=Pt,y.UsePointerLock=Vt,y.UsePreferredColorScheme=Dt,y.UsePreferredContrast=Mt,y.UsePreferredDark=_t,y.UsePreferredLanguages=Tt,y.UsePreferredReducedMotion=kt,y.UsePreferredReducedTransparency=Lt,y.UseScreenSafeArea=It,y.UseTimeAgo=Ft,y.UseTimestamp=jt,y.UseVirtualList=Yt,y.UseWindowFocus=xt,y.UseWindowSize=Xt,y.VOnClickOutside=ee,y.VOnLongPress=ne,y.vElementBounding=Je,y.vElementHover=qe,y.vElementSize=et,y.vElementVisibility=nt,y.vInfiniteScroll=ft,y.vIntersectionObserver=dt,y.vMouseInElement=yt,y.vOnClickOutside=ee,y.vOnKeyStroke=we,y.vOnLongPress=ne,y.vResizeObserver=Rt,y.vScroll=zt,y.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
|
|
1
|
+
(function(y,C,o,S){"use strict";const ge=o.defineComponent({name:"OnClickOutside",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return C.onClickOutside(a,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),A=S.isClient?window:void 0;function T(e){var t;const n=o.toValue(e);return(t=n?.$el)!=null?t:n}function M(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},a=(l,c,f,u)=>(l.addEventListener(c,f,u),()=>l.removeEventListener(c,f,u)),s=o.computed(()=>{const l=S.toArray(o.toValue(e[0])).filter(c=>c!=null);return l.every(c=>typeof c!="string")?l:void 0}),r=S.watchImmediate(()=>{var l,c;return[(c=(l=s.value)==null?void 0:l.map(f=>T(f)))!=null?c:[A].filter(f=>f!=null),S.toArray(o.toValue(s.value?e[1]:e[0])),S.toArray(o.unref(s.value?e[2]:e[1])),o.toValue(s.value?e[3]:e[2])]},([l,c,f,u])=>{if(n(),!l?.length||!c?.length||!f?.length)return;const d=S.isObject(u)?{...u}:u;t.push(...l.flatMap(p=>c.flatMap(U=>f.map(g=>a(p,U,g,d)))))},{flush:"post"}),i=()=>{r(),n()};return S.tryOnScopeDispose(n),i}let Q=!1;function Z(e,t,n={}){const{window:a=A,ignore:s=[],capture:r=!0,detectIframe:i=!1,controls:l=!1}=n;if(!a)return l?{stop:S.noop,cancel:S.noop,trigger:S.noop}:S.noop;if(S.isIOS&&!Q){Q=!0;const h={passive:!0};Array.from(a.document.body.children).forEach(m=>M(m,"click",S.noop,h)),M(a.document.documentElement,"click",S.noop,h)}let c=!0;const f=h=>o.toValue(s).some(m=>{if(typeof m=="string")return Array.from(a.document.querySelectorAll(m)).some(w=>w===h.target||h.composedPath().includes(w));{const w=T(m);return w&&(h.target===w||h.composedPath().includes(w))}});function u(h){const m=o.toValue(h);return m&&m.$.subTree.shapeFlag===16}function d(h,m){const w=o.toValue(h),P=w.$.subTree&&w.$.subTree.children;return P==null||!Array.isArray(P)?!1:P.some(E=>E.el===m.target||m.composedPath().includes(E.el))}const p=h=>{const m=T(e);if(h.target!=null&&!(!(m instanceof Element)&&u(e)&&d(e,h))&&!(!m||m===h.target||h.composedPath().includes(m))){if("detail"in h&&h.detail===0&&(c=!f(h)),!c){c=!0;return}t(h)}};let U=!1;const g=[M(a,"click",h=>{U||(U=!0,setTimeout(()=>{U=!1},0),p(h))},{passive:!0,capture:r}),M(a,"pointerdown",h=>{const m=T(e);c=!f(h)&&!!(m&&!h.composedPath().includes(m))},{passive:!0}),i&&M(a,"blur",h=>{setTimeout(()=>{var m;const w=T(e);((m=a.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!w?.contains(a.document.activeElement)&&t(h)},0)},{passive:!0})].filter(Boolean),b=()=>g.forEach(h=>h());return l?{stop:b,cancel:()=>{c=!1},trigger:h=>{c=!0,p(h),c=!1}}:b}const ee={mounted(e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=Z(e,t.value,{capture:n});else{const[a,s]=t.value;e.__onClickOutside_stop=Z(e,a,Object.assign({capture:n},s))}},unmounted(e){e.__onClickOutside_stop()}};function ye(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function te(...e){let t,n,a={};e.length===3?(t=e[0],n=e[1],a=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],a=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:s=A,eventName:r="keydown",passive:i=!1,dedupe:l=!1}=a,c=ye(t);return M(s,r,u=>{u.repeat&&o.toValue(l)||c(u)&&n(u)},i)}const we={mounted(e,t){var n,a;const s=(a=(n=t.arg)==null?void 0:n.split(","))!=null?a:!0;if(typeof t.value=="function")te(s,t.value,{target:e});else{const[r,i]=t.value;te(s,r,{target:e,...i})}}},Ue=500,Se=10;function X(e,t,n){var a,s;const r=o.computed(()=>T(e));let i,l,c,f=!1;function u(){i&&(clearTimeout(i),i=void 0),l=void 0,c=void 0,f=!1}function d(m){var w,P,E;const[V,L,v]=[c,l,f];if(u(),!n?.onMouseUp||!L||!V||(w=n?.modifiers)!=null&&w.self&&m.target!==r.value)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation();const k=m.x-L.x,_=m.y-L.y,I=Math.sqrt(k*k+_*_);n.onMouseUp(m.timeStamp-V,I,v)}function p(m){var w,P,E,V;(w=n?.modifiers)!=null&&w.self&&m.target!==r.value||(u(),(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation(),l={x:m.x,y:m.y},c=m.timeStamp,i=setTimeout(()=>{f=!0,t(m)},(V=n?.delay)!=null?V:Ue))}function U(m){var w,P,E,V;if((w=n?.modifiers)!=null&&w.self&&m.target!==r.value||!l||n?.distanceThreshold===!1)return;(P=n?.modifiers)!=null&&P.prevent&&m.preventDefault(),(E=n?.modifiers)!=null&&E.stop&&m.stopPropagation();const L=m.x-l.x,v=m.y-l.y;Math.sqrt(L*L+v*v)>=((V=n?.distanceThreshold)!=null?V:Se)&&u()}const g={capture:(a=n?.modifiers)==null?void 0:a.capture,once:(s=n?.modifiers)==null?void 0:s.once},b=[M(r,"pointerdown",p,g),M(r,"pointermove",U,g),M(r,["pointerup","pointerleave"],d,g)];return()=>b.forEach(m=>m())}const be=o.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:t,emit:n}){const a=o.shallowRef();return X(a,s=>{n("trigger",s)},e.options),()=>{if(t.default)return o.h(e.as||"div",{ref:a},t.default())}}}),ne={mounted(e,t){typeof t.value=="function"?X(e,t.value,{modifiers:t.modifiers}):X(e,...t.value)}},Ce=o.defineComponent({name:"UseActiveElement",setup(e,{slots:t}){const n=o.reactive({element:C.useActiveElement()});return()=>{if(t.default)return t.default(n)}}}),Ee=o.defineComponent({name:"UseBattery",setup(e,{slots:t}){const n=o.reactive(C.useBattery(e));return()=>{if(t.default)return t.default(n)}}}),Oe=o.defineComponent({name:"UseBrowserLocation",setup(e,{slots:t}){const n=o.reactive(C.useBrowserLocation());return()=>{if(t.default)return t.default(n)}}}),Pe=o.defineComponent({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:t}){const n=o.reactive(C.useClipboard(e));return()=>{var a;return(a=t.default)==null?void 0:a.call(t,n)}}}),B=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H="__vueuse_ssr_handlers__",Re=Ve();function Ve(){return H in B||(B[H]=B[H]||{}),B[H]}function oe(e,t){return Re[e]||t}const De=Symbol("vueuse-ssr-width");function Me(){const e=o.hasInjectionContext()?S.injectLocal(De,null):null;return typeof e=="number"?e:void 0}function _e(){const e=o.shallowRef(!1),t=o.getCurrentInstance();return t&&o.onMounted(()=>{e.value=!0},t),e}function N(e){const t=_e();return o.computed(()=>(t.value,!!e()))}function Te(e,t={}){const{window:n=A,ssrWidth:a=Me()}=t,s=N(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),r=o.ref(typeof a=="number"),i=o.shallowRef(),l=o.shallowRef(!1),c=f=>{l.value=f.matches};return o.watchEffect(()=>{if(r.value){r.value=!s.value;const f=o.toValue(e).split(",");l.value=f.some(u=>{const d=u.includes("not all"),p=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),U=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let g=!!(p||U);return p&&g&&(g=a>=S.pxValue(p[1])),U&&g&&(g=a<=S.pxValue(U[1])),d?!g:g});return}s.value&&(i.value=n.matchMedia(o.toValue(e)),l.value=i.value.matches)}),M(i,"change",c,{passive:!0}),o.computed(()=>l.value)}function ke(e){return Te("(prefers-color-scheme: dark)",e)}function Le(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Ae={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},ae="vueuse-storage";function Ie(e,t,n,a={}){var s;const{flush:r="pre",deep:i=!0,listenToStorageChanges:l=!0,writeDefaults:c=!0,mergeDefaults:f=!1,shallow:u,window:d=A,eventFilter:p,onError:U=O=>{console.error(O)},initOnMounted:g}=a,b=(u?o.shallowRef:o.ref)(typeof t=="function"?t():t),h=o.computed(()=>o.toValue(e));if(!n)try{n=oe("getDefaultStorage",()=>{var O;return(O=A)==null?void 0:O.localStorage})()}catch(O){U(O)}if(!n)return b;const m=o.toValue(t),w=Le(m),P=(s=a.serializer)!=null?s:Ae[w],{pause:E,resume:V}=S.pausableWatch(b,()=>v(b.value),{flush:r,deep:i,eventFilter:p});o.watch(h,()=>_(),{flush:r}),d&&l&&S.tryOnMounted(()=>{n instanceof Storage?M(d,"storage",_,{passive:!0}):M(d,ae,I),g&&_()}),g||_();function L(O,D){if(d){const R={key:h.value,oldValue:O,newValue:D,storageArea:n};d.dispatchEvent(n instanceof Storage?new StorageEvent("storage",R):new CustomEvent(ae,{detail:R}))}}function v(O){try{const D=n.getItem(h.value);if(O==null)L(D,null),n.removeItem(h.value);else{const R=P.write(O);D!==R&&(n.setItem(h.value,R),L(D,R))}}catch(D){U(D)}}function k(O){const D=O?O.newValue:n.getItem(h.value);if(D==null)return c&&m!=null&&n.setItem(h.value,P.write(m)),m;if(!O&&f){const R=P.read(D);return typeof f=="function"?f(R,m):w==="object"&&!Array.isArray(R)?{...m,...R}:R}else return typeof D!="string"?D:P.read(D)}function _(O){if(!(O&&O.storageArea!==n)){if(O&&O.key==null){b.value=m;return}if(!(O&&O.key!==h.value)){E();try{O?.newValue!==P.write(b.value)&&(b.value=k(O))}catch(D){U(D)}finally{O?o.nextTick(V):V()}}}}function I(O){_(O.detail)}return b}const ze="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function We(e={}){const{selector:t="html",attribute:n="class",initialValue:a="auto",window:s=A,storage:r,storageKey:i="vueuse-color-scheme",listenToStorageChanges:l=!0,storageRef:c,emitAuto:f,disableTransition:u=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},p=ke({window:s}),U=o.computed(()=>p.value?"dark":"light"),g=c||(i==null?S.toRef(a):Ie(i,a,r,{window:s,listenToStorageChanges:l})),b=o.computed(()=>g.value==="auto"?U.value:g.value),h=oe("updateHTMLAttrs",(E,V,L)=>{const v=typeof E=="string"?s?.document.querySelector(E):T(E);if(!v)return;const k=new Set,_=new Set;let I=null;if(V==="class"){const D=L.split(/\s/g);Object.values(d).flatMap(R=>(R||"").split(/\s/g)).filter(Boolean).forEach(R=>{D.includes(R)?k.add(R):_.add(R)})}else I={key:V,value:L};if(k.size===0&&_.size===0&&I===null)return;let O;u&&(O=s.document.createElement("style"),O.appendChild(document.createTextNode(ze)),s.document.head.appendChild(O));for(const D of k)v.classList.add(D);for(const D of _)v.classList.remove(D);I&&v.setAttribute(I.key,I.value),u&&(s.getComputedStyle(O).opacity,document.head.removeChild(O))});function m(E){var V;h(t,n,(V=d[E])!=null?V:E)}function w(E){e.onChanged?e.onChanged(E,m):m(E)}o.watch(b,w,{flush:"post",immediate:!0}),S.tryOnMounted(()=>w(b.value));const P=o.computed({get(){return f?g.value:b.value},set(E){g.value=E}});return Object.assign(P,{store:g,system:U,state:b})}const Be=o.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:t}){const n=We(e),a=o.reactive({mode:n,system:n.system,store:n.store});return()=>{if(t.default)return t.default(a)}}}),He=o.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:t}){const n=C.useDark(e),a=o.reactive({isDark:n,toggleDark:S.useToggle(n)});return()=>{if(t.default)return t.default(a)}}}),Ne=o.defineComponent({name:"UseDeviceMotion",setup(e,{slots:t}){const n=C.useDeviceMotion();return()=>{if(t.default)return t.default(n)}}}),Fe=o.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:t}){const n=o.reactive(C.useDeviceOrientation());return()=>{if(t.default)return t.default(n)}}}),je=o.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:t}){const n=o.reactive({pixelRatio:C.useDevicePixelRatio()});return()=>{if(t.default)return t.default(n)}}}),Ye=o.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:t}){const n=o.reactive(C.useDevicesList(e));return()=>{if(t.default)return t.default(n)}}}),xe=o.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:t}){const n=o.reactive({visibility:C.useDocumentVisibility()});return()=>{if(t.default)return t.default(n)}}}),Xe=o.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as","handle","axis","onStart","onMove","onEnd","disabled","buttons","containerElement"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.computed(()=>{var u;return(u=e.handle)!=null?u:n.value}),s=o.computed(()=>{var u;return(u=e.containerElement)!=null?u:void 0}),r=o.computed(()=>!!e.disabled),i=e.storageKey&&C.useStorage(e.storageKey,o.toValue(e.initialValue)||{x:0,y:0},C.isClient?e.storageType==="session"?sessionStorage:localStorage:void 0),l=i||e.initialValue||{x:0,y:0},c=(u,d)=>{var p;(p=e.onEnd)==null||p.call(e,u,d),i&&(i.value.x=u.x,i.value.y=u.y)},f=o.reactive(C.useDraggable(n,{...e,handle:a,initialValue:l,onEnd:c,disabled:r,containerElement:s}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n,style:`touch-action:none;${f.style}`},t.default(f))}}}),Ke=o.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:t}){const n=o.shallowRef(),a=o.reactive(C.useElementBounding(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function K(e,t,n={}){const{window:a=A,...s}=n;let r;const i=N(()=>a&&"MutationObserver"in a),l=()=>{r&&(r.disconnect(),r=void 0)},c=o.computed(()=>{const p=o.toValue(e),U=S.toArray(p).map(T).filter(S.notNullish);return new Set(U)}),f=o.watch(()=>c.value,p=>{l(),i.value&&p.size&&(r=new MutationObserver(t),p.forEach(U=>r.observe(U,s)))},{immediate:!0,flush:"post"}),u=()=>r?.takeRecords(),d=()=>{f(),l()};return S.tryOnScopeDispose(d),{isSupported:i,stop:d,takeRecords:u}}function F(e,t,n={}){const{window:a=A,...s}=n;let r;const i=N(()=>a&&"ResizeObserver"in a),l=()=>{r&&(r.disconnect(),r=void 0)},c=o.computed(()=>{const d=o.toValue(e);return Array.isArray(d)?d.map(p=>T(p)):[T(d)]}),f=o.watch(c,d=>{if(l(),i.value&&a){r=new ResizeObserver(t);for(const p of d)p&&r.observe(p,s)}},{immediate:!0,flush:"post"}),u=()=>{l(),f()};return S.tryOnScopeDispose(u),{isSupported:i,stop:u}}function Ge(e,t={}){const{reset:n=!0,windowResize:a=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:i="sync"}=t,l=o.shallowRef(0),c=o.shallowRef(0),f=o.shallowRef(0),u=o.shallowRef(0),d=o.shallowRef(0),p=o.shallowRef(0),U=o.shallowRef(0),g=o.shallowRef(0);function b(){const m=T(e);if(!m){n&&(l.value=0,c.value=0,f.value=0,u.value=0,d.value=0,p.value=0,U.value=0,g.value=0);return}const w=m.getBoundingClientRect();l.value=w.height,c.value=w.bottom,f.value=w.left,u.value=w.right,d.value=w.top,p.value=w.width,U.value=w.x,g.value=w.y}function h(){i==="sync"?b():i==="next-frame"&&requestAnimationFrame(()=>b())}return F(e,h),o.watch(()=>T(e),m=>!m&&h()),K(e,h,{attributeFilter:["style","class"]}),s&&M("scroll",h,{capture:!0,passive:!0}),a&&M("resize",h,{passive:!0}),S.tryOnMounted(()=>{r&&h()}),{height:l,bottom:c,left:f,right:u,top:d,width:p,x:U,y:g,update:h}}const Je={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,{height:s,bottom:r,left:i,right:l,top:c,width:f,x:u,y:d}=Ge(e,a);o.watch([s,r,i,l,c,f,u,d],()=>n({height:s,bottom:r,left:i,right:l,top:c,width:f,x:u,y:d}))}};function $e(e,t,n={}){const{window:a=A,document:s=a?.document,flush:r="sync"}=n;if(!a||!s)return S.noop;let i;const l=u=>{i?.(),i=u},c=o.watchEffect(()=>{const u=T(e);if(u){const{stop:d}=K(s,p=>{p.map(g=>[...g.removedNodes]).flat().some(g=>g===u||g.contains(u))&&t(p)},{window:a,childList:!0,subtree:!0});l(d)}},{flush:r}),f=()=>{c(),l()};return S.tryOnScopeDispose(f),f}function se(e,t={}){const{delayEnter:n=0,delayLeave:a=0,triggerOnRemoval:s=!1,window:r=A}=t,i=o.shallowRef(!1);let l;const c=f=>{const u=f?n:a;l&&(clearTimeout(l),l=void 0),u?l=setTimeout(()=>i.value=f,u):i.value=f};return r&&(M(e,"mouseenter",()=>c(!0),{passive:!0}),M(e,"mouseleave",()=>c(!1),{passive:!0}),s&&$e(o.computed(()=>T(e)),()=>c(!1))),i}const qe={mounted(e,t){const n=t.value;if(typeof n=="function"){const a=se(e);o.watch(a,s=>n(s))}else{const[a,s]=n,r=se(e,s);o.watch(r,i=>a(i))}}},Qe=o.defineComponent({name:"UseElementSize",props:["width","height","box","as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive(C.useElementSize(n,{width:e.width,height:e.height},{box:e.box}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function Ze(e,t={width:0,height:0},n={}){const{window:a=A,box:s="content-box"}=n,r=o.computed(()=>{var d,p;return(p=(d=T(e))==null?void 0:d.namespaceURI)==null?void 0:p.includes("svg")}),i=o.ref(t.width),l=o.ref(t.height),{stop:c}=F(e,([d])=>{const p=s==="border-box"?d.borderBoxSize:s==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(a&&r.value){const U=T(e);if(U){const g=U.getBoundingClientRect();i.value=g.width,l.value=g.height}}else if(p){const U=S.toArray(p);i.value=U.reduce((g,{inlineSize:b})=>g+b,0),l.value=U.reduce((g,{blockSize:b})=>g+b,0)}else i.value=d.contentRect.width,l.value=d.contentRect.height},n);S.tryOnMounted(()=>{const d=T(e);d&&(i.value="offsetWidth"in d?d.offsetWidth:t.width,l.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=o.watch(()=>T(e),d=>{i.value=d?t.width:0,l.value=d?t.height:0});function u(){c(),f()}return{width:i,height:l,stop:u}}const et={mounted(e,t){var n;const a=typeof t.value=="function"?t.value:(n=t.value)==null?void 0:n[0],s=typeof t.value=="function"?[]:t.value.slice(1),{width:r,height:i}=Ze(e,...s);o.watch([r,i],([l,c])=>a({width:l,height:c}))}},tt=o.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive({isVisible:C.useElementVisibility(n)});return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}});function G(e,t,n={}){const{root:a,rootMargin:s="0px",threshold:r=0,window:i=A,immediate:l=!0}=n,c=N(()=>i&&"IntersectionObserver"in i),f=o.computed(()=>{const g=o.toValue(e);return S.toArray(g).map(T).filter(S.notNullish)});let u=S.noop;const d=o.ref(l),p=c.value?o.watch(()=>[f.value,T(a),d.value],([g,b])=>{if(u(),!d.value||!g.length)return;const h=new IntersectionObserver(t,{root:T(b),rootMargin:s,threshold:r});g.forEach(m=>m&&h.observe(m)),u=()=>{h.disconnect(),u=S.noop}},{immediate:l,flush:"post"}):S.noop,U=()=>{u(),p(),d.value=!1};return S.tryOnScopeDispose(U),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:U}}function J(e,t={}){const{window:n=A,scrollTarget:a,threshold:s=0,rootMargin:r,once:i=!1}=t,l=o.shallowRef(!1),{stop:c}=G(e,f=>{let u=l.value,d=0;for(const p of f)p.time>=d&&(d=p.time,u=p.isIntersecting);l.value=u,i&&S.watchOnce(l,()=>{c()})},{root:a,window:n,threshold:s,rootMargin:o.toValue(r)});return l}const nt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=J(e);o.watch(a,s=>n(s),{immediate:!0})}else{const[n,a]=t.value,s=J(e,a);o.watch(s,r=>n(r),{immediate:!0})}}},ot=o.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:t}){const n=o.reactive(C.useEyeDropper());return()=>{if(t.default)return t.default(n)}}}),at=o.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive(C.useFullscreen(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),st=o.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:t}){const n=o.reactive(C.useGeolocation(e));return()=>{if(t.default)return t.default(n)}}}),lt=o.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:t}){const n=o.reactive(C.useIdle(e.timeout,e));return()=>{if(t.default)return t.default(n)}}});function rt(e,t,n){const{immediate:a=!0,delay:s=0,onError:r=S.noop,onSuccess:i=S.noop,resetOnExecute:l=!0,shallow:c=!0,throwError:f}=n??{},u=c?o.shallowRef(t):o.ref(t),d=o.shallowRef(!1),p=o.shallowRef(!1),U=o.shallowRef(void 0);async function g(m=0,...w){l&&(u.value=t),U.value=void 0,d.value=!1,p.value=!0,m>0&&await S.promiseTimeout(m);const P=typeof e=="function"?e(...w):e;try{const E=await P;u.value=E,d.value=!0,i(E)}catch(E){if(U.value=E,r(E),f)throw E}finally{p.value=!1}return u.value}a&&g(s);const b={state:u,isReady:d,isLoading:p,error:U,execute:g};function h(){return new Promise((m,w)=>{S.until(p).toBe(!1).then(()=>m(b)).catch(w)})}return{...b,then(m,w){return h().then(m,w)}}}async function it(e){return new Promise((t,n)=>{const a=new Image,{src:s,srcset:r,sizes:i,class:l,loading:c,crossorigin:f,referrerPolicy:u,width:d,height:p,decoding:U,fetchPriority:g,ismap:b,usemap:h}=e;a.src=s,r!=null&&(a.srcset=r),i!=null&&(a.sizes=i),l!=null&&(a.className=l),c!=null&&(a.loading=c),f!=null&&(a.crossOrigin=f),u!=null&&(a.referrerPolicy=u),d!=null&&(a.width=d),p!=null&&(a.height=p),U!=null&&(a.decoding=U),g!=null&&(a.fetchPriority=g),b!=null&&(a.isMap=b),h!=null&&(a.useMap=h),a.onload=()=>t(a),a.onerror=n})}function ut(e,t={}){const n=rt(()=>it(o.toValue(e)),void 0,{resetOnExecute:!0,...t});return o.watch(()=>o.toValue(e),()=>n.execute(t.delay),{deep:!0}),n}const ct=o.defineComponent({name:"UseImage",props:["src","srcset","sizes","as","alt","class","loading","crossorigin","referrerPolicy","width","height","decoding","fetchPriority","ismap","usemap"],setup(e,{slots:t}){const n=o.reactive(ut(e));return()=>n.isLoading&&t.loading?t.loading(n):n.error&&t.error?t.error(n.error):t.default?t.default(n):o.h(e.as||"img",e)}});function j(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const le=1;function $(e,t={}){const{throttle:n=0,idle:a=200,onStop:s=S.noop,onScroll:r=S.noop,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:l={capture:!1,passive:!0},behavior:c="auto",window:f=A,onError:u=v=>{console.error(v)}}=t,d=o.shallowRef(0),p=o.shallowRef(0),U=o.computed({get(){return d.value},set(v){b(v,void 0)}}),g=o.computed({get(){return p.value},set(v){b(void 0,v)}});function b(v,k){var _,I,O,D;if(!f)return;const R=o.toValue(e);if(!R)return;(O=R instanceof Document?f.document.body:R)==null||O.scrollTo({top:(_=o.toValue(k))!=null?_:g.value,left:(I=o.toValue(v))!=null?I:U.value,behavior:o.toValue(c)});const z=((D=R?.document)==null?void 0:D.documentElement)||R?.documentElement||R;U!=null&&(d.value=z.scrollLeft),g!=null&&(p.value=z.scrollTop)}const h=o.shallowRef(!1),m=o.reactive({left:!0,right:!1,top:!0,bottom:!1}),w=o.reactive({left:!1,right:!1,top:!1,bottom:!1}),P=v=>{h.value&&(h.value=!1,w.left=!1,w.right=!1,w.top=!1,w.bottom=!1,s(v))},E=S.useDebounceFn(P,n+a),V=v=>{var k;if(!f)return;const _=((k=v?.document)==null?void 0:k.documentElement)||v?.documentElement||T(v),{display:I,flexDirection:O,direction:D}=getComputedStyle(_),R=D==="rtl"?-1:1,z=_.scrollLeft;w.left=z<d.value,w.right=z>d.value;const me=z*R<=(i.left||0),pe=z*R+_.clientWidth>=_.scrollWidth-(i.right||0)-le;I==="flex"&&O==="row-reverse"?(m.left=pe,m.right=me):(m.left=me,m.right=pe),d.value=z;let W=_.scrollTop;v===f.document&&!W&&(W=f.document.body.scrollTop),w.top=W<p.value,w.bottom=W>p.value;const he=W<=(i.top||0),ve=W+_.clientHeight>=_.scrollHeight-(i.bottom||0)-le;I==="flex"&&O==="column-reverse"?(m.top=ve,m.bottom=he):(m.top=he,m.bottom=ve),p.value=W},L=v=>{var k;if(!f)return;const _=(k=v.target.documentElement)!=null?k:v.target;V(_),h.value=!0,E(v),r(v)};return M(e,"scroll",n?S.useThrottleFn(L,n,!0,!1):L,l),S.tryOnMounted(()=>{try{const v=o.toValue(e);if(!v)return;V(v)}catch(v){u(v)}}),M(e,"scrollend",P,l),{x:U,y:g,isScrolling:h,arrivedState:m,directions:w,measure(){const v=o.toValue(e);f&&v&&V(v)}}}function re(e,t,n={}){var a;const{direction:s="bottom",interval:r=100,canLoadMore:i=()=>!0}=n,l=o.reactive($(e,{...n,offset:{[s]:(a=n.distance)!=null?a:0,...n.offset}})),c=o.ref(),f=o.computed(()=>!!c.value),u=o.computed(()=>j(o.toValue(e))),d=J(u);function p(){if(l.measure(),!u.value||!d.value||!i(u.value))return;const{scrollHeight:g,clientHeight:b,scrollWidth:h,clientWidth:m}=u.value,w=s==="bottom"||s==="top"?g<=b:h<=m;(l.arrivedState[s]||w)&&(c.value||(c.value=Promise.all([t(l),new Promise(P=>setTimeout(P,r))]).finally(()=>{c.value=null,o.nextTick(()=>p())})))}const U=o.watch(()=>[l.arrivedState[s],d.value],p,{immediate:!0});return S.tryOnUnmounted(U),{isLoading:f,reset(){o.nextTick(()=>p())}}}const ft={mounted(e,t){typeof t.value=="function"?re(e,t.value):re(e,...t.value)}},dt={mounted(e,t){typeof t.value=="function"?G(e,t.value):G(e,...t.value)}},mt=o.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:t}){const n=o.reactive(C.useMouse(e));return()=>{if(t.default)return t.default(n)}}}),pt=o.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive(C.useMouseInElement(n,e));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),ht={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function vt(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:a=!1,initialValue:s={x:0,y:0},window:r=A,target:i=r,scroll:l=!0,eventFilter:c}=e;let f=null,u=0,d=0;const p=o.shallowRef(s.x),U=o.shallowRef(s.y),g=o.shallowRef(null),b=typeof t=="function"?t:ht[t],h=v=>{const k=b(v);f=v,k&&([p.value,U.value]=k,g.value="mouse"),r&&(u=r.scrollX,d=r.scrollY)},m=v=>{if(v.touches.length>0){const k=b(v.touches[0]);k&&([p.value,U.value]=k,g.value="touch")}},w=()=>{if(!f||!r)return;const v=b(f);f instanceof MouseEvent&&v&&(p.value=v[0]+r.scrollX-u,U.value=v[1]+r.scrollY-d)},P=()=>{p.value=s.x,U.value=s.y},E=c?v=>c(()=>h(v),{}):v=>h(v),V=c?v=>c(()=>m(v),{}):v=>m(v),L=c?()=>c(()=>w(),{}):()=>w();if(i){const v={passive:!0};M(i,["mousemove","dragover"],E,v),n&&t!=="movement"&&(M(i,["touchstart","touchmove"],V,v),a&&M(i,"touchend",P,v)),l&&t==="page"&&M(r,"scroll",L,v)}return{x:p,y:U,sourceType:g}}function gt(e,t={}){const{handleOutside:n=!0,window:a=A}=t,s=t.type||"page",{x:r,y:i,sourceType:l}=vt(t),c=o.ref(e??a?.document.body),f=o.shallowRef(0),u=o.shallowRef(0),d=o.shallowRef(0),p=o.shallowRef(0),U=o.shallowRef(0),g=o.shallowRef(0),b=o.shallowRef(!0);let h=()=>{};return a&&(h=o.watch([c,r,i],()=>{const m=T(c);if(!m||!(m instanceof Element))return;const{left:w,top:P,width:E,height:V}=m.getBoundingClientRect();d.value=w+(s==="page"?a.pageXOffset:0),p.value=P+(s==="page"?a.pageYOffset:0),U.value=V,g.value=E;const L=r.value-d.value,v=i.value-p.value;b.value=E===0||V===0||L<0||v<0||L>E||v>V,(n||!b.value)&&(f.value=L,u.value=v)},{immediate:!0}),M(document,"mouseleave",()=>b.value=!0,{passive:!0})),{x:r,y:i,sourceType:l,elementX:f,elementY:u,elementPositionX:d,elementPositionY:p,elementHeight:U,elementWidth:g,isOutside:b,stop:h}}const yt={mounted(e,t){const[n,a]=typeof t.value=="function"?[t.value,{}]:t.value,s=S.reactiveOmit(o.reactive(gt(e,a)),"stop");o.watch(s,r=>n(r))}},wt=o.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive(C.useMousePressed({...e,target:n}));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),Ut=o.defineComponent({name:"UseNetwork",setup(e,{slots:t}){const n=o.reactive(C.useNetwork());return()=>{if(t.default)return t.default(n)}}}),St=o.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:t}){const n=o.reactive(C.useNow({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),bt=o.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:t}){const n=S.toRef(e,"object"),a=C.useObjectUrl(n);return()=>{if(t.default&&a.value)return t.default(a)}}}),Ct=o.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:t,emit:n}){const a=o.reactive(C.useOffsetPagination({...e,onPageChange(...s){var r;(r=e.onPageChange)==null||r.call(e,...s),n("page-change",...s)},onPageSizeChange(...s){var r;(r=e.onPageSizeChange)==null||r.call(e,...s),n("page-size-change",...s)},onPageCountChange(...s){var r;(r=e.onPageCountChange)==null||r.call(e,...s),n("page-count-change",...s)}}));return()=>{if(t.default)return t.default(a)}}}),Et=o.defineComponent({name:"UseOnline",setup(e,{slots:t}){const n=o.reactive({isOnline:C.useOnline()});return()=>{if(t.default)return t.default(n)}}}),Ot=o.defineComponent({name:"UsePageLeave",setup(e,{slots:t}){const n=o.reactive({isLeft:C.usePageLeave()});return()=>{if(t.default)return t.default(n)}}}),Pt=o.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:t}){const n=o.shallowRef(null),a=o.reactive(C.usePointer({...e,target:e.target==="self"?n:A}));return()=>{if(t.default)return t.default(a,{ref:n})}}}),Rt=o.defineComponent({name:"UsePointerLock",props:["as"],setup(e,{slots:t}){const n=o.ref(),a=o.reactive(C.usePointerLock(n));return()=>{if(t.default)return o.h(e.as||"div",{ref:n},t.default(a))}}}),Vt=o.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:t}){const n=o.reactive({colorScheme:C.usePreferredColorScheme()});return()=>{if(t.default)return t.default(n)}}}),Dt=o.defineComponent({name:"UsePreferredContrast",setup(e,{slots:t}){const n=o.reactive({contrast:C.usePreferredContrast()});return()=>{if(t.default)return t.default(n)}}}),Mt=o.defineComponent({name:"UsePreferredDark",setup(e,{slots:t}){const n=o.reactive({prefersDark:C.usePreferredDark()});return()=>{if(t.default)return t.default(n)}}}),_t=o.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:t}){const n=o.reactive({languages:C.usePreferredLanguages()});return()=>{if(t.default)return t.default(n)}}}),Tt=o.defineComponent({name:"UsePreferredReducedMotion",setup(e,{slots:t}){const n=o.reactive({motion:C.usePreferredReducedMotion()});return()=>{if(t.default)return t.default(n)}}}),kt=o.defineComponent({name:"UsePreferredReducedTransparency",setup(e,{slots:t}){const n=o.reactive({transparency:C.usePreferredReducedTransparency()});return()=>{if(t.default)return t.default(n)}}}),Lt={mounted(e,t){typeof t.value=="function"?F(e,t.value):F(e,...t.value)}};function Y(e,t,n={}){const{window:a=A,initialValue:s,observe:r=!1}=n,i=o.shallowRef(s),l=o.computed(()=>{var f;return T(t)||((f=a?.document)==null?void 0:f.documentElement)});function c(){var f;const u=o.toValue(e),d=o.toValue(l);if(d&&a&&u){const p=(f=a.getComputedStyle(d).getPropertyValue(u))==null?void 0:f.trim();i.value=p||i.value||s}}return r&&K(l,c,{attributeFilter:["style","class"],window:a}),o.watch([l,()=>o.toValue(e)],(f,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),c()}),o.watch([i,l],([f,u])=>{const d=o.toValue(e);u?.style&&d&&(f==null?u.style.removeProperty(d):u.style.setProperty(d,f))},{immediate:!0}),i}const ie="--vueuse-safe-area-top",ue="--vueuse-safe-area-right",ce="--vueuse-safe-area-bottom",fe="--vueuse-safe-area-left";function At(){const e=o.shallowRef(""),t=o.shallowRef(""),n=o.shallowRef(""),a=o.shallowRef("");if(S.isClient){const r=Y(ie),i=Y(ue),l=Y(ce),c=Y(fe);r.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",l.value="env(safe-area-inset-bottom, 0px)",c.value="env(safe-area-inset-left, 0px)",s(),M("resize",S.useDebounceFn(s),{passive:!0})}function s(){e.value=x(ie),t.value=x(ue),n.value=x(ce),a.value=x(fe)}return{top:e,right:t,bottom:n,left:a,update:s}}function x(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}const It=o.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:t}){const{top:n,right:a,bottom:s,left:r}=At();return()=>{if(t.default)return o.h("div",{style:{paddingTop:e.top?n.value:"",paddingRight:e.right?a.value:"",paddingBottom:e.bottom?s.value:"",paddingLeft:e.left?r.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},t.default())}}}),zt={mounted(e,t){if(typeof t.value=="function"){const n=t.value,a=$(e,{onScroll(){n(a)},onStop(){n(a)}})}else{const[n,a]=t.value,s=$(e,{...a,onScroll(r){var i;(i=a.onScroll)==null||i.call(a,r),n(s)},onStop(r){var i;(i=a.onStop)==null||i.call(a,r),n(s)}})}}};function de(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:de(n)}}function Wt(e){const t=e||window.event,n=t.target;return de(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const q=new WeakMap;function Bt(e,t=!1){const n=o.ref(t);let a=null,s="";o.watch(S.toRef(e),l=>{const c=j(o.toValue(l));if(c){const f=c;if(q.get(f)||q.set(f,f.style.overflow),f.style.overflow!=="hidden"&&(s=f.style.overflow),f.style.overflow==="hidden")return n.value=!0;if(n.value)return f.style.overflow="hidden"}},{immediate:!0});const r=()=>{const l=j(o.toValue(e));!l||n.value||(S.isIOS&&(a=M(l,"touchmove",c=>{Wt(c)},{passive:!1})),l.style.overflow="hidden",n.value=!0)},i=()=>{const l=j(o.toValue(e));!l||!n.value||(S.isIOS&&a?.(),l.style.overflow=s,q.delete(l),n.value=!1)};return S.tryOnScopeDispose(i),o.computed({get(){return n.value},set(l){l?r():i()}})}function Ht(){let e=!1;const t=o.shallowRef(!1);return(n,a)=>{if(t.value=a.value,e)return;e=!0;const s=Bt(n,a.value);o.watch(t,r=>s.value=r)}}const Nt=Ht(),Ft=o.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:t}){const n=o.reactive(C.useTimeAgo(()=>e.time,{...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),jt=o.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:t}){const n=o.reactive(C.useTimestamp({...e,controls:!0}));return()=>{if(t.default)return t.default(n)}}}),Yt=o.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:t,expose:n}){const{list:a}=o.toRefs(e),{list:s,containerProps:r,wrapperProps:i,scrollTo:l}=C.useVirtualList(a,e.options);return n({scrollTo:l}),r.style&&typeof r.style=="object"&&!Array.isArray(r.style)&&(r.style.height=e.height||"300px"),()=>o.h("div",{...r},[o.h("div",{...i.value},s.value.map(c=>o.h("div",{style:{overflow:"hidden",height:c.height}},t.default?t.default(c):"Please set content!")))])}}),xt=o.defineComponent({name:"UseWindowFocus",setup(e,{slots:t}){const n=o.reactive({focused:C.useWindowFocus()});return()=>{if(t.default)return t.default(n)}}}),Xt=o.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:t}){const n=o.reactive(C.useWindowSize(e));return()=>{if(t.default)return t.default(n)}}});y.OnClickOutside=ge,y.OnLongPress=be,y.UseActiveElement=Ce,y.UseBattery=Ee,y.UseBrowserLocation=Oe,y.UseClipboard=Pe,y.UseColorMode=Be,y.UseDark=He,y.UseDeviceMotion=Ne,y.UseDeviceOrientation=Fe,y.UseDevicePixelRatio=je,y.UseDevicesList=Ye,y.UseDocumentVisibility=xe,y.UseDraggable=Xe,y.UseElementBounding=Ke,y.UseElementSize=Qe,y.UseElementVisibility=tt,y.UseEyeDropper=ot,y.UseFullscreen=at,y.UseGeolocation=st,y.UseIdle=lt,y.UseImage=ct,y.UseMouse=mt,y.UseMouseInElement=pt,y.UseMousePressed=wt,y.UseNetwork=Ut,y.UseNow=St,y.UseObjectUrl=bt,y.UseOffsetPagination=Ct,y.UseOnline=Et,y.UsePageLeave=Ot,y.UsePointer=Pt,y.UsePointerLock=Rt,y.UsePreferredColorScheme=Vt,y.UsePreferredContrast=Dt,y.UsePreferredDark=Mt,y.UsePreferredLanguages=_t,y.UsePreferredReducedMotion=Tt,y.UsePreferredReducedTransparency=kt,y.UseScreenSafeArea=It,y.UseTimeAgo=Ft,y.UseTimestamp=jt,y.UseVirtualList=Yt,y.UseWindowFocus=xt,y.UseWindowSize=Xt,y.VOnClickOutside=ee,y.VOnLongPress=ne,y.vElementBounding=Je,y.vElementHover=qe,y.vElementSize=et,y.vElementVisibility=nt,y.vInfiniteScroll=ft,y.vIntersectionObserver=dt,y.vMouseInElement=yt,y.vOnClickOutside=ee,y.vOnKeyStroke=we,y.vOnLongPress=ne,y.vResizeObserver=Lt,y.vScroll=zt,y.vScrollLock=Nt})(this.VueUse=this.VueUse||{},VueUse,Vue,VueUse);
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { onClickOutside as onClickOutside$1, useActiveElement, useBattery, useBrowserLocation, useClipboard, useDark, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDocumentVisibility, useStorage as useStorage$1, isClient as isClient$1, useDraggable, useElementBounding as useElementBounding$1, useElementSize as useElementSize$1, useElementVisibility as useElementVisibility$1, useEyeDropper, useFullscreen, useGeolocation, useIdle, useMouse as useMouse$1, useMouseInElement as useMouseInElement$1, useMousePressed, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, usePointer, usePointerLock, usePreferredColorScheme, usePreferredContrast, usePreferredDark as usePreferredDark$1, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, useTimeAgo, useTimestamp, useVirtualList, useWindowFocus, useWindowSize } from '@vueuse/core';
|
|
2
|
-
import { defineComponent,
|
|
2
|
+
import { defineComponent, shallowRef, h, toValue, computed, unref, reactive, hasInjectionContext, getCurrentInstance, onMounted, ref, watchEffect, watch, nextTick, toRefs } from 'vue';
|
|
3
3
|
import { isClient, toArray, watchImmediate, isObject, tryOnScopeDispose, noop, isIOS, injectLocal, pxValue, pausableWatch, tryOnMounted, toRef, useToggle, notNullish, watchOnce, promiseTimeout, until, useDebounceFn, useThrottleFn, tryOnUnmounted, reactiveOmit } from '@vueuse/shared';
|
|
4
4
|
|
|
5
5
|
const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
@@ -7,7 +7,7 @@ const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
7
7
|
props: ["as", "options"],
|
|
8
8
|
emits: ["trigger"],
|
|
9
9
|
setup(props, { slots, emit }) {
|
|
10
|
-
const target =
|
|
10
|
+
const target = shallowRef();
|
|
11
11
|
onClickOutside$1(target, (e) => {
|
|
12
12
|
emit("trigger", e);
|
|
13
13
|
}, props.options);
|
|
@@ -336,7 +336,7 @@ const OnLongPress = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
336
336
|
props: ["as", "options"],
|
|
337
337
|
emits: ["trigger"],
|
|
338
338
|
setup(props, { slots, emit }) {
|
|
339
|
-
const target =
|
|
339
|
+
const target = shallowRef();
|
|
340
340
|
onLongPress(
|
|
341
341
|
target,
|
|
342
342
|
(e) => {
|
|
@@ -432,7 +432,7 @@ function useSSRWidth() {
|
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
function useMounted() {
|
|
435
|
-
const isMounted =
|
|
435
|
+
const isMounted = shallowRef(false);
|
|
436
436
|
const instance = getCurrentInstance();
|
|
437
437
|
if (instance) {
|
|
438
438
|
onMounted(() => {
|
|
@@ -455,7 +455,7 @@ function useMediaQuery(query, options = {}) {
|
|
|
455
455
|
const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
|
|
456
456
|
const ssrSupport = ref(typeof ssrWidth === "number");
|
|
457
457
|
const mediaQuery = shallowRef();
|
|
458
|
-
const matches =
|
|
458
|
+
const matches = shallowRef(false);
|
|
459
459
|
const handler = (event) => {
|
|
460
460
|
matches.value = event.matches;
|
|
461
461
|
};
|
|
@@ -862,7 +862,7 @@ const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
862
862
|
"containerElement"
|
|
863
863
|
],
|
|
864
864
|
setup(props, { slots }) {
|
|
865
|
-
const target =
|
|
865
|
+
const target = shallowRef();
|
|
866
866
|
const handle = computed(() => {
|
|
867
867
|
var _a;
|
|
868
868
|
return (_a = props.handle) != null ? _a : target.value;
|
|
@@ -905,7 +905,7 @@ const UseElementBounding = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
905
905
|
name: "UseElementBounding",
|
|
906
906
|
props: ["box", "as"],
|
|
907
907
|
setup(props, { slots }) {
|
|
908
|
-
const target =
|
|
908
|
+
const target = shallowRef();
|
|
909
909
|
const data = reactive(useElementBounding$1(target));
|
|
910
910
|
return () => {
|
|
911
911
|
if (slots.default)
|
|
@@ -1002,14 +1002,14 @@ function useElementBounding(target, options = {}) {
|
|
|
1002
1002
|
immediate = true,
|
|
1003
1003
|
updateTiming = "sync"
|
|
1004
1004
|
} = options;
|
|
1005
|
-
const height =
|
|
1006
|
-
const bottom =
|
|
1007
|
-
const left =
|
|
1008
|
-
const right =
|
|
1009
|
-
const top =
|
|
1010
|
-
const width =
|
|
1011
|
-
const x =
|
|
1012
|
-
const y =
|
|
1005
|
+
const height = shallowRef(0);
|
|
1006
|
+
const bottom = shallowRef(0);
|
|
1007
|
+
const left = shallowRef(0);
|
|
1008
|
+
const right = shallowRef(0);
|
|
1009
|
+
const top = shallowRef(0);
|
|
1010
|
+
const width = shallowRef(0);
|
|
1011
|
+
const x = shallowRef(0);
|
|
1012
|
+
const y = shallowRef(0);
|
|
1013
1013
|
function recalculate() {
|
|
1014
1014
|
const el = unrefElement(target);
|
|
1015
1015
|
if (!el) {
|
|
@@ -1132,7 +1132,7 @@ function useElementHover(el, options = {}) {
|
|
|
1132
1132
|
triggerOnRemoval = false,
|
|
1133
1133
|
window = defaultWindow
|
|
1134
1134
|
} = options;
|
|
1135
|
-
const isHovered =
|
|
1135
|
+
const isHovered = shallowRef(false);
|
|
1136
1136
|
let timer;
|
|
1137
1137
|
const toggle = (entering) => {
|
|
1138
1138
|
const delay = entering ? delayEnter : delayLeave;
|
|
@@ -1334,7 +1334,7 @@ function useElementVisibility(element, options = {}) {
|
|
|
1334
1334
|
rootMargin,
|
|
1335
1335
|
once = false
|
|
1336
1336
|
} = options;
|
|
1337
|
-
const elementIsVisible =
|
|
1337
|
+
const elementIsVisible = shallowRef(false);
|
|
1338
1338
|
const { stop } = useIntersectionObserver(
|
|
1339
1339
|
element,
|
|
1340
1340
|
(intersectionObserverEntries) => {
|
|
@@ -1439,8 +1439,8 @@ function useAsyncState(promise, initialState, options) {
|
|
|
1439
1439
|
throwError
|
|
1440
1440
|
} = options != null ? options : {};
|
|
1441
1441
|
const state = shallow ? shallowRef(initialState) : ref(initialState);
|
|
1442
|
-
const isReady =
|
|
1443
|
-
const isLoading =
|
|
1442
|
+
const isReady = shallowRef(false);
|
|
1443
|
+
const isLoading = shallowRef(false);
|
|
1444
1444
|
const error = shallowRef(void 0);
|
|
1445
1445
|
async function execute(delay2 = 0, ...args) {
|
|
1446
1446
|
if (resetOnExecute)
|
|
@@ -1603,8 +1603,8 @@ function useScroll(element, options = {}) {
|
|
|
1603
1603
|
console.error(e);
|
|
1604
1604
|
}
|
|
1605
1605
|
} = options;
|
|
1606
|
-
const internalX =
|
|
1607
|
-
const internalY =
|
|
1606
|
+
const internalX = shallowRef(0);
|
|
1607
|
+
const internalY = shallowRef(0);
|
|
1608
1608
|
const x = computed({
|
|
1609
1609
|
get() {
|
|
1610
1610
|
return internalX.value;
|
|
@@ -1639,7 +1639,7 @@ function useScroll(element, options = {}) {
|
|
|
1639
1639
|
if (y != null)
|
|
1640
1640
|
internalY.value = scrollContainer.scrollTop;
|
|
1641
1641
|
}
|
|
1642
|
-
const isScrolling =
|
|
1642
|
+
const isScrolling = shallowRef(false);
|
|
1643
1643
|
const arrivedState = reactive({
|
|
1644
1644
|
left: true,
|
|
1645
1645
|
right: false,
|
|
@@ -1863,9 +1863,9 @@ function useMouse(options = {}) {
|
|
|
1863
1863
|
let _prevMouseEvent = null;
|
|
1864
1864
|
let _prevScrollX = 0;
|
|
1865
1865
|
let _prevScrollY = 0;
|
|
1866
|
-
const x =
|
|
1867
|
-
const y =
|
|
1868
|
-
const sourceType =
|
|
1866
|
+
const x = shallowRef(initialValue.x);
|
|
1867
|
+
const y = shallowRef(initialValue.y);
|
|
1868
|
+
const sourceType = shallowRef(null);
|
|
1869
1869
|
const extractor = typeof type === "function" ? type : UseMouseBuiltinExtractors[type];
|
|
1870
1870
|
const mouseHandler = (event) => {
|
|
1871
1871
|
const result = extractor(event);
|
|
@@ -1930,13 +1930,13 @@ function useMouseInElement(target, options = {}) {
|
|
|
1930
1930
|
const type = options.type || "page";
|
|
1931
1931
|
const { x, y, sourceType } = useMouse(options);
|
|
1932
1932
|
const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);
|
|
1933
|
-
const elementX =
|
|
1934
|
-
const elementY =
|
|
1935
|
-
const elementPositionX =
|
|
1936
|
-
const elementPositionY =
|
|
1937
|
-
const elementHeight =
|
|
1938
|
-
const elementWidth =
|
|
1939
|
-
const isOutside =
|
|
1933
|
+
const elementX = shallowRef(0);
|
|
1934
|
+
const elementY = shallowRef(0);
|
|
1935
|
+
const elementPositionX = shallowRef(0);
|
|
1936
|
+
const elementPositionY = shallowRef(0);
|
|
1937
|
+
const elementHeight = shallowRef(0);
|
|
1938
|
+
const elementWidth = shallowRef(0);
|
|
1939
|
+
const isOutside = shallowRef(true);
|
|
1940
1940
|
let stop = () => {
|
|
1941
1941
|
};
|
|
1942
1942
|
if (window) {
|
|
@@ -2122,7 +2122,7 @@ const UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2122
2122
|
"target"
|
|
2123
2123
|
],
|
|
2124
2124
|
setup(props, { slots }) {
|
|
2125
|
-
const el =
|
|
2125
|
+
const el = shallowRef(null);
|
|
2126
2126
|
const data = reactive(usePointer({
|
|
2127
2127
|
...props,
|
|
2128
2128
|
target: props.target === "self" ? el : defaultWindow
|
|
@@ -2236,7 +2236,7 @@ const vResizeObserver = {
|
|
|
2236
2236
|
|
|
2237
2237
|
function useCssVar(prop, target, options = {}) {
|
|
2238
2238
|
const { window = defaultWindow, initialValue, observe = false } = options;
|
|
2239
|
-
const variable =
|
|
2239
|
+
const variable = shallowRef(initialValue);
|
|
2240
2240
|
const elRef = computed(() => {
|
|
2241
2241
|
var _a;
|
|
2242
2242
|
return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
|
|
@@ -2285,10 +2285,10 @@ const rightVarName = "--vueuse-safe-area-right";
|
|
|
2285
2285
|
const bottomVarName = "--vueuse-safe-area-bottom";
|
|
2286
2286
|
const leftVarName = "--vueuse-safe-area-left";
|
|
2287
2287
|
function useScreenSafeArea() {
|
|
2288
|
-
const top =
|
|
2289
|
-
const right =
|
|
2290
|
-
const bottom =
|
|
2291
|
-
const left =
|
|
2288
|
+
const top = shallowRef("");
|
|
2289
|
+
const right = shallowRef("");
|
|
2290
|
+
const bottom = shallowRef("");
|
|
2291
|
+
const left = shallowRef("");
|
|
2292
2292
|
if (isClient) {
|
|
2293
2293
|
const topCssVar = useCssVar(topVarName);
|
|
2294
2294
|
const rightCssVar = useCssVar(rightVarName);
|
|
@@ -2469,7 +2469,7 @@ function useScrollLock(element, initialState = false) {
|
|
|
2469
2469
|
|
|
2470
2470
|
function onScrollLock() {
|
|
2471
2471
|
let isMounted = false;
|
|
2472
|
-
const state =
|
|
2472
|
+
const state = shallowRef(false);
|
|
2473
2473
|
return (el, binding) => {
|
|
2474
2474
|
state.value = binding.value;
|
|
2475
2475
|
if (isMounted)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.7.0",
|
|
5
5
|
"description": "Renderless components for VueUse",
|
|
6
6
|
"author": "Jacob Clevenger<https://github.com/wheatjs>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"vue": "^3.5.13",
|
|
45
|
-
"@vueuse/
|
|
46
|
-
"@vueuse/
|
|
45
|
+
"@vueuse/shared": "12.7.0",
|
|
46
|
+
"@vueuse/core": "12.7.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild"
|