@vueuse/components 9.12.0 → 9.13.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 +94 -70
- package/index.iife.js +94 -70
- package/index.iife.min.js +1 -1
- package/index.mjs +95 -71
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, ref, h, watch, computed, reactive, shallowRef, nextTick, watchEffect, toRef, toRefs } from 'vue-demi';
|
|
2
2
|
import { onClickOutside as onClickOutside$1, useActiveElement, useBattery, useBrowserLocation, useDark, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDocumentVisibility, useStorage as useStorage$1, isClient as isClient$1, useDraggable, useElementBounding, useElementSize as useElementSize$1, useElementVisibility as useElementVisibility$1, useEyeDropper, useFullscreen, useGeolocation, useIdle, useMouse, useMouseInElement, useMousePressed, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, usePointer, usePointerLock, usePreferredColorScheme, usePreferredContrast, usePreferredDark as usePreferredDark$1, usePreferredLanguages, usePreferredReducedMotion, useTimeAgo, useTimestamp, useVirtualList, useWindowFocus, useWindowSize } from '@vueuse/core';
|
|
3
|
-
import { resolveUnref, isClient, isString, noop, tryOnScopeDispose, directiveHooks, pausableWatch, isFunction, tryOnMounted, resolveRef, useToggle, promiseTimeout, useDebounceFn, useThrottleFn
|
|
3
|
+
import { resolveUnref, isClient, isString, noop, tryOnScopeDispose, isIOS, directiveHooks, pausableWatch, isFunction, tryOnMounted, resolveRef, useToggle, promiseTimeout, useDebounceFn, useThrottleFn } from '@vueuse/shared';
|
|
4
4
|
|
|
5
|
-
const OnClickOutside = /* @__PURE__ */ defineComponent({
|
|
5
|
+
const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
6
6
|
name: "OnClickOutside",
|
|
7
7
|
props: ["as", "options"],
|
|
8
8
|
emits: ["trigger"],
|
|
@@ -48,16 +48,16 @@ function useEventListener(...args) {
|
|
|
48
48
|
cleanups.forEach((fn) => fn());
|
|
49
49
|
cleanups.length = 0;
|
|
50
50
|
};
|
|
51
|
-
const register = (el, event, listener) => {
|
|
52
|
-
el.addEventListener(event, listener,
|
|
53
|
-
return () => el.removeEventListener(event, listener,
|
|
51
|
+
const register = (el, event, listener, options2) => {
|
|
52
|
+
el.addEventListener(event, listener, options2);
|
|
53
|
+
return () => el.removeEventListener(event, listener, options2);
|
|
54
54
|
};
|
|
55
|
-
const stopWatch = watch(() => unrefElement(target), (el) => {
|
|
55
|
+
const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
|
|
56
56
|
cleanup();
|
|
57
57
|
if (!el)
|
|
58
58
|
return;
|
|
59
59
|
cleanups.push(...events.flatMap((event) => {
|
|
60
|
-
return listeners.map((listener) => register(el, event, listener));
|
|
60
|
+
return listeners.map((listener) => register(el, event, listener, options2));
|
|
61
61
|
}));
|
|
62
62
|
}, { immediate: true, flush: "post" });
|
|
63
63
|
const stop = () => {
|
|
@@ -68,12 +68,16 @@ function useEventListener(...args) {
|
|
|
68
68
|
return stop;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
let _iOSWorkaround = false;
|
|
71
72
|
function onClickOutside(target, handler, options = {}) {
|
|
72
73
|
const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
|
|
73
74
|
if (!window)
|
|
74
75
|
return;
|
|
76
|
+
if (isIOS && !_iOSWorkaround) {
|
|
77
|
+
_iOSWorkaround = true;
|
|
78
|
+
Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop));
|
|
79
|
+
}
|
|
75
80
|
let shouldListen = true;
|
|
76
|
-
let fallback;
|
|
77
81
|
const shouldIgnore = (event) => {
|
|
78
82
|
return ignore.some((target2) => {
|
|
79
83
|
if (typeof target2 === "string") {
|
|
@@ -85,7 +89,6 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
85
89
|
});
|
|
86
90
|
};
|
|
87
91
|
const listener = (event) => {
|
|
88
|
-
window.clearTimeout(fallback);
|
|
89
92
|
const el = unrefElement(target);
|
|
90
93
|
if (!el || el === event.target || event.composedPath().includes(el))
|
|
91
94
|
return;
|
|
@@ -104,13 +107,6 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
104
107
|
if (el)
|
|
105
108
|
shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
|
|
106
109
|
}, { passive: true }),
|
|
107
|
-
useEventListener(window, "pointerup", (e) => {
|
|
108
|
-
if (e.button === 0) {
|
|
109
|
-
const path = e.composedPath();
|
|
110
|
-
e.composedPath = () => path;
|
|
111
|
-
fallback = window.setTimeout(() => listener(e), 50);
|
|
112
|
-
}
|
|
113
|
-
}, { passive: true }),
|
|
114
110
|
detectIframe && useEventListener(window, "blur", (event) => {
|
|
115
111
|
var _a;
|
|
116
112
|
const el = unrefElement(target);
|
|
@@ -240,7 +236,7 @@ function onLongPress(target, handler, options) {
|
|
|
240
236
|
useEventListener(elementRef, "pointerleave", clear, listenerOptions);
|
|
241
237
|
}
|
|
242
238
|
|
|
243
|
-
const OnLongPress = /* @__PURE__ */ defineComponent({
|
|
239
|
+
const OnLongPress = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
244
240
|
name: "OnLongPress",
|
|
245
241
|
props: ["as", "options"],
|
|
246
242
|
emits: ["trigger"],
|
|
@@ -265,7 +261,7 @@ const vOnLongPress = {
|
|
|
265
261
|
}
|
|
266
262
|
};
|
|
267
263
|
|
|
268
|
-
const UseActiveElement = /* @__PURE__ */ defineComponent({
|
|
264
|
+
const UseActiveElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
269
265
|
name: "UseActiveElement",
|
|
270
266
|
setup(props, { slots }) {
|
|
271
267
|
const data = reactive({
|
|
@@ -278,7 +274,7 @@ const UseActiveElement = /* @__PURE__ */ defineComponent({
|
|
|
278
274
|
}
|
|
279
275
|
});
|
|
280
276
|
|
|
281
|
-
const UseBattery = /* @__PURE__ */ defineComponent({
|
|
277
|
+
const UseBattery = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
282
278
|
name: "UseBattery",
|
|
283
279
|
setup(props, { slots }) {
|
|
284
280
|
const data = reactive(useBattery(props));
|
|
@@ -289,7 +285,7 @@ const UseBattery = /* @__PURE__ */ defineComponent({
|
|
|
289
285
|
}
|
|
290
286
|
});
|
|
291
287
|
|
|
292
|
-
const UseBrowserLocation = /* @__PURE__ */ defineComponent({
|
|
288
|
+
const UseBrowserLocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
293
289
|
name: "UseBrowserLocation",
|
|
294
290
|
setup(props, { slots }) {
|
|
295
291
|
const data = reactive(useBrowserLocation());
|
|
@@ -362,6 +358,7 @@ const StorageSerializers = {
|
|
|
362
358
|
write: (v) => v.toISOString()
|
|
363
359
|
}
|
|
364
360
|
};
|
|
361
|
+
const customStorageEventName = "vueuse-storage";
|
|
365
362
|
function useStorage(key, defaults, storage, options = {}) {
|
|
366
363
|
var _a;
|
|
367
364
|
const {
|
|
@@ -394,8 +391,10 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
394
391
|
const type = guessSerializerType(rawInit);
|
|
395
392
|
const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
|
|
396
393
|
const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, () => write(data.value), { flush, deep, eventFilter });
|
|
397
|
-
if (window && listenToStorageChanges)
|
|
394
|
+
if (window && listenToStorageChanges) {
|
|
398
395
|
useEventListener(window, "storage", update);
|
|
396
|
+
useEventListener(window, customStorageEventName, updateFromCustomEvent);
|
|
397
|
+
}
|
|
399
398
|
update();
|
|
400
399
|
return data;
|
|
401
400
|
function write(v) {
|
|
@@ -408,11 +407,13 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
408
407
|
if (oldValue !== serialized) {
|
|
409
408
|
storage.setItem(key, serialized);
|
|
410
409
|
if (window) {
|
|
411
|
-
window
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
410
|
+
window.dispatchEvent(new CustomEvent(customStorageEventName, {
|
|
411
|
+
detail: {
|
|
412
|
+
key,
|
|
413
|
+
oldValue,
|
|
414
|
+
newValue: serialized,
|
|
415
|
+
storageArea: storage
|
|
416
|
+
}
|
|
416
417
|
}));
|
|
417
418
|
}
|
|
418
419
|
}
|
|
@@ -440,6 +441,9 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
440
441
|
return serializer.read(rawValue);
|
|
441
442
|
}
|
|
442
443
|
}
|
|
444
|
+
function updateFromCustomEvent(event) {
|
|
445
|
+
update(event.detail);
|
|
446
|
+
}
|
|
443
447
|
function update(event) {
|
|
444
448
|
if (event && event.storageArea !== storage)
|
|
445
449
|
return;
|
|
@@ -582,7 +586,7 @@ function useColorMode(options = {}) {
|
|
|
582
586
|
return state;
|
|
583
587
|
}
|
|
584
588
|
|
|
585
|
-
const UseColorMode = /* @__PURE__ */ defineComponent({
|
|
589
|
+
const UseColorMode = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
586
590
|
name: "UseColorMode",
|
|
587
591
|
props: ["selector", "attribute", "modes", "onChanged", "storageKey", "storage", "emitAuto"],
|
|
588
592
|
setup(props, { slots }) {
|
|
@@ -597,7 +601,7 @@ const UseColorMode = /* @__PURE__ */ defineComponent({
|
|
|
597
601
|
}
|
|
598
602
|
});
|
|
599
603
|
|
|
600
|
-
const UseDark = /* @__PURE__ */ defineComponent({
|
|
604
|
+
const UseDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
601
605
|
name: "UseDark",
|
|
602
606
|
props: ["selector", "attribute", "valueDark", "valueLight", "onChanged", "storageKey", "storage"],
|
|
603
607
|
setup(props, { slots }) {
|
|
@@ -613,7 +617,7 @@ const UseDark = /* @__PURE__ */ defineComponent({
|
|
|
613
617
|
}
|
|
614
618
|
});
|
|
615
619
|
|
|
616
|
-
const UseDeviceMotion = /* @__PURE__ */ defineComponent({
|
|
620
|
+
const UseDeviceMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
617
621
|
name: "UseDeviceMotion",
|
|
618
622
|
setup(props, { slots }) {
|
|
619
623
|
const data = reactive(useDeviceMotion());
|
|
@@ -624,7 +628,7 @@ const UseDeviceMotion = /* @__PURE__ */ defineComponent({
|
|
|
624
628
|
}
|
|
625
629
|
});
|
|
626
630
|
|
|
627
|
-
const UseDeviceOrientation = /* @__PURE__ */ defineComponent({
|
|
631
|
+
const UseDeviceOrientation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
628
632
|
name: "UseDeviceOrientation",
|
|
629
633
|
setup(props, { slots }) {
|
|
630
634
|
const data = reactive(useDeviceOrientation());
|
|
@@ -635,7 +639,7 @@ const UseDeviceOrientation = /* @__PURE__ */ defineComponent({
|
|
|
635
639
|
}
|
|
636
640
|
});
|
|
637
641
|
|
|
638
|
-
const UseDevicePixelRatio = /* @__PURE__ */ defineComponent({
|
|
642
|
+
const UseDevicePixelRatio = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
639
643
|
name: "UseDevicePixelRatio",
|
|
640
644
|
setup(props, { slots }) {
|
|
641
645
|
const data = reactive({
|
|
@@ -648,7 +652,7 @@ const UseDevicePixelRatio = /* @__PURE__ */ defineComponent({
|
|
|
648
652
|
}
|
|
649
653
|
});
|
|
650
654
|
|
|
651
|
-
const UseDevicesList = /* @__PURE__ */ defineComponent({
|
|
655
|
+
const UseDevicesList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
652
656
|
name: "UseDevicesList",
|
|
653
657
|
props: ["onUpdated", "requestPermissions", "constraints"],
|
|
654
658
|
setup(props, { slots }) {
|
|
@@ -660,7 +664,7 @@ const UseDevicesList = /* @__PURE__ */ defineComponent({
|
|
|
660
664
|
}
|
|
661
665
|
});
|
|
662
666
|
|
|
663
|
-
const UseDocumentVisibility = /* @__PURE__ */ defineComponent({
|
|
667
|
+
const UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
664
668
|
name: "UseDocumentVisibility",
|
|
665
669
|
setup(props, { slots }) {
|
|
666
670
|
const data = reactive({
|
|
@@ -692,7 +696,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
692
696
|
return a;
|
|
693
697
|
};
|
|
694
698
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
695
|
-
const UseDraggable = /* @__PURE__ */ defineComponent({
|
|
699
|
+
const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
696
700
|
name: "UseDraggable",
|
|
697
701
|
props: [
|
|
698
702
|
"storageKey",
|
|
@@ -731,7 +735,7 @@ const UseDraggable = /* @__PURE__ */ defineComponent({
|
|
|
731
735
|
}
|
|
732
736
|
});
|
|
733
737
|
|
|
734
|
-
const UseElementBounding = /* @__PURE__ */ defineComponent({
|
|
738
|
+
const UseElementBounding = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
735
739
|
name: "UseElementBounding",
|
|
736
740
|
props: ["box", "as"],
|
|
737
741
|
setup(props, { slots }) {
|
|
@@ -744,10 +748,26 @@ const UseElementBounding = /* @__PURE__ */ defineComponent({
|
|
|
744
748
|
}
|
|
745
749
|
});
|
|
746
750
|
|
|
747
|
-
function useElementHover(el) {
|
|
751
|
+
function useElementHover(el, options = {}) {
|
|
752
|
+
const delayEnter = options ? options.delayEnter : 0;
|
|
753
|
+
const delayLeave = options ? options.delayLeave : 0;
|
|
748
754
|
const isHovered = ref(false);
|
|
749
|
-
|
|
750
|
-
|
|
755
|
+
let timer;
|
|
756
|
+
const toggle = (entering) => {
|
|
757
|
+
const delay = entering ? delayEnter : delayLeave;
|
|
758
|
+
if (timer) {
|
|
759
|
+
clearTimeout(timer);
|
|
760
|
+
timer = void 0;
|
|
761
|
+
}
|
|
762
|
+
if (delay)
|
|
763
|
+
timer = setTimeout(() => isHovered.value = entering, delay);
|
|
764
|
+
else
|
|
765
|
+
isHovered.value = entering;
|
|
766
|
+
};
|
|
767
|
+
if (!window)
|
|
768
|
+
return isHovered;
|
|
769
|
+
useEventListener(el, "mouseenter", () => toggle(true), { passive: true });
|
|
770
|
+
useEventListener(el, "mouseleave", () => toggle(false), { passive: true });
|
|
751
771
|
return isHovered;
|
|
752
772
|
}
|
|
753
773
|
|
|
@@ -760,7 +780,7 @@ const vElementHover = {
|
|
|
760
780
|
}
|
|
761
781
|
};
|
|
762
782
|
|
|
763
|
-
const UseElementSize = /* @__PURE__ */ defineComponent({
|
|
783
|
+
const UseElementSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
764
784
|
name: "UseElementSize",
|
|
765
785
|
props: ["width", "height", "box"],
|
|
766
786
|
setup(props, { slots }) {
|
|
@@ -864,7 +884,7 @@ const vElementSize = {
|
|
|
864
884
|
}
|
|
865
885
|
};
|
|
866
886
|
|
|
867
|
-
const UseElementVisibility = /* @__PURE__ */ defineComponent({
|
|
887
|
+
const UseElementVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
868
888
|
name: "UseElementVisibility",
|
|
869
889
|
props: ["as"],
|
|
870
890
|
setup(props, { slots }) {
|
|
@@ -917,7 +937,7 @@ const vElementVisibility = {
|
|
|
917
937
|
}
|
|
918
938
|
};
|
|
919
939
|
|
|
920
|
-
const UseEyeDropper = /* @__PURE__ */ defineComponent({
|
|
940
|
+
const UseEyeDropper = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
921
941
|
name: "UseEyeDropper",
|
|
922
942
|
props: {
|
|
923
943
|
sRGBHex: String
|
|
@@ -931,7 +951,7 @@ const UseEyeDropper = /* @__PURE__ */ defineComponent({
|
|
|
931
951
|
}
|
|
932
952
|
});
|
|
933
953
|
|
|
934
|
-
const UseFullscreen = /* @__PURE__ */ defineComponent({
|
|
954
|
+
const UseFullscreen = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
935
955
|
name: "UseFullscreen",
|
|
936
956
|
props: ["as"],
|
|
937
957
|
setup(props, { slots }) {
|
|
@@ -944,7 +964,7 @@ const UseFullscreen = /* @__PURE__ */ defineComponent({
|
|
|
944
964
|
}
|
|
945
965
|
});
|
|
946
966
|
|
|
947
|
-
const UseGeolocation = /* @__PURE__ */ defineComponent({
|
|
967
|
+
const UseGeolocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
948
968
|
name: "UseGeolocation",
|
|
949
969
|
props: ["enableHighAccuracy", "maximumAge", "timeout", "navigator"],
|
|
950
970
|
setup(props, { slots }) {
|
|
@@ -956,7 +976,7 @@ const UseGeolocation = /* @__PURE__ */ defineComponent({
|
|
|
956
976
|
}
|
|
957
977
|
});
|
|
958
978
|
|
|
959
|
-
const UseIdle = /* @__PURE__ */ defineComponent({
|
|
979
|
+
const UseIdle = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
960
980
|
name: "UseIdle",
|
|
961
981
|
props: ["timeout", "events", "listenForVisibilityChange", "initialState"],
|
|
962
982
|
setup(props, { slots }) {
|
|
@@ -1054,7 +1074,7 @@ const useImage = (options, asyncStateOptions = {}) => {
|
|
|
1054
1074
|
return state;
|
|
1055
1075
|
};
|
|
1056
1076
|
|
|
1057
|
-
const UseImage = /* @__PURE__ */ defineComponent({
|
|
1077
|
+
const UseImage = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1058
1078
|
name: "UseImage",
|
|
1059
1079
|
props: [
|
|
1060
1080
|
"src",
|
|
@@ -1137,14 +1157,17 @@ function useScroll(element, options = {}) {
|
|
|
1137
1157
|
top: false,
|
|
1138
1158
|
bottom: false
|
|
1139
1159
|
});
|
|
1140
|
-
const onScrollEnd =
|
|
1160
|
+
const onScrollEnd = (e) => {
|
|
1161
|
+
if (!isScrolling.value)
|
|
1162
|
+
return;
|
|
1141
1163
|
isScrolling.value = false;
|
|
1142
1164
|
directions.left = false;
|
|
1143
1165
|
directions.right = false;
|
|
1144
1166
|
directions.top = false;
|
|
1145
1167
|
directions.bottom = false;
|
|
1146
1168
|
onStop(e);
|
|
1147
|
-
}
|
|
1169
|
+
};
|
|
1170
|
+
const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);
|
|
1148
1171
|
const onScrollHandler = (e) => {
|
|
1149
1172
|
const eventTarget = e.target === document ? e.target.documentElement : e.target;
|
|
1150
1173
|
const scrollLeft = eventTarget.scrollLeft;
|
|
@@ -1162,10 +1185,11 @@ function useScroll(element, options = {}) {
|
|
|
1162
1185
|
arrivedState.bottom = scrollTop + eventTarget.clientHeight >= eventTarget.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1163
1186
|
internalY.value = scrollTop;
|
|
1164
1187
|
isScrolling.value = true;
|
|
1165
|
-
|
|
1188
|
+
onScrollEndDebounced(e);
|
|
1166
1189
|
onScroll(e);
|
|
1167
1190
|
};
|
|
1168
1191
|
useEventListener(element, "scroll", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);
|
|
1192
|
+
useEventListener(element, "scrollend", onScrollEnd, eventListenerOptions);
|
|
1169
1193
|
return {
|
|
1170
1194
|
x,
|
|
1171
1195
|
y,
|
|
@@ -1279,7 +1303,7 @@ const vIntersectionObserver = {
|
|
|
1279
1303
|
}
|
|
1280
1304
|
};
|
|
1281
1305
|
|
|
1282
|
-
const UseMouse = /* @__PURE__ */ defineComponent({
|
|
1306
|
+
const UseMouse = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1283
1307
|
name: "UseMouse",
|
|
1284
1308
|
props: ["touch", "resetOnTouchEnds", "initialValue"],
|
|
1285
1309
|
setup(props, { slots }) {
|
|
@@ -1291,7 +1315,7 @@ const UseMouse = /* @__PURE__ */ defineComponent({
|
|
|
1291
1315
|
}
|
|
1292
1316
|
});
|
|
1293
1317
|
|
|
1294
|
-
const UseMouseInElement = /* @__PURE__ */ defineComponent({
|
|
1318
|
+
const UseMouseInElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1295
1319
|
name: "UseMouseElement",
|
|
1296
1320
|
props: ["handleOutside", "as"],
|
|
1297
1321
|
setup(props, { slots }) {
|
|
@@ -1323,7 +1347,7 @@ var __spreadValues$7 = (a, b) => {
|
|
|
1323
1347
|
return a;
|
|
1324
1348
|
};
|
|
1325
1349
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1326
|
-
const UseMousePressed = /* @__PURE__ */ defineComponent({
|
|
1350
|
+
const UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1327
1351
|
name: "UseMousePressed",
|
|
1328
1352
|
props: ["touch", "initialValue", "as"],
|
|
1329
1353
|
setup(props, { slots }) {
|
|
@@ -1336,7 +1360,7 @@ const UseMousePressed = /* @__PURE__ */ defineComponent({
|
|
|
1336
1360
|
}
|
|
1337
1361
|
});
|
|
1338
1362
|
|
|
1339
|
-
const UseNetwork = /* @__PURE__ */ defineComponent({
|
|
1363
|
+
const UseNetwork = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1340
1364
|
name: "UseNetwork",
|
|
1341
1365
|
setup(props, { slots }) {
|
|
1342
1366
|
const data = reactive(useNetwork());
|
|
@@ -1366,7 +1390,7 @@ var __spreadValues$6 = (a, b) => {
|
|
|
1366
1390
|
return a;
|
|
1367
1391
|
};
|
|
1368
1392
|
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1369
|
-
const UseNow = /* @__PURE__ */ defineComponent({
|
|
1393
|
+
const UseNow = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1370
1394
|
name: "UseNow",
|
|
1371
1395
|
props: ["interval"],
|
|
1372
1396
|
setup(props, { slots }) {
|
|
@@ -1378,7 +1402,7 @@ const UseNow = /* @__PURE__ */ defineComponent({
|
|
|
1378
1402
|
}
|
|
1379
1403
|
});
|
|
1380
1404
|
|
|
1381
|
-
const UseObjectUrl = /* @__PURE__ */ defineComponent({
|
|
1405
|
+
const UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1382
1406
|
name: "UseObjectUrl",
|
|
1383
1407
|
props: [
|
|
1384
1408
|
"object"
|
|
@@ -1412,7 +1436,7 @@ var __spreadValues$5 = (a, b) => {
|
|
|
1412
1436
|
return a;
|
|
1413
1437
|
};
|
|
1414
1438
|
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1415
|
-
const UseOffsetPagination = /* @__PURE__ */ defineComponent({
|
|
1439
|
+
const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1416
1440
|
name: "UseOffsetPagination",
|
|
1417
1441
|
props: [
|
|
1418
1442
|
"total",
|
|
@@ -1452,7 +1476,7 @@ const UseOffsetPagination = /* @__PURE__ */ defineComponent({
|
|
|
1452
1476
|
}
|
|
1453
1477
|
});
|
|
1454
1478
|
|
|
1455
|
-
const UseOnline = /* @__PURE__ */ defineComponent({
|
|
1479
|
+
const UseOnline = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1456
1480
|
name: "UseOnline",
|
|
1457
1481
|
setup(props, { slots }) {
|
|
1458
1482
|
const data = reactive({
|
|
@@ -1465,7 +1489,7 @@ const UseOnline = /* @__PURE__ */ defineComponent({
|
|
|
1465
1489
|
}
|
|
1466
1490
|
});
|
|
1467
1491
|
|
|
1468
|
-
const UsePageLeave = /* @__PURE__ */ defineComponent({
|
|
1492
|
+
const UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1469
1493
|
name: "UsePageLeave",
|
|
1470
1494
|
setup(props, { slots }) {
|
|
1471
1495
|
const data = reactive({
|
|
@@ -1497,7 +1521,7 @@ var __spreadValues$4 = (a, b) => {
|
|
|
1497
1521
|
return a;
|
|
1498
1522
|
};
|
|
1499
1523
|
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1500
|
-
const UsePointer = /* @__PURE__ */ defineComponent({
|
|
1524
|
+
const UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1501
1525
|
name: "UsePointer",
|
|
1502
1526
|
props: [
|
|
1503
1527
|
"pointerTypes",
|
|
@@ -1516,7 +1540,7 @@ const UsePointer = /* @__PURE__ */ defineComponent({
|
|
|
1516
1540
|
}
|
|
1517
1541
|
});
|
|
1518
1542
|
|
|
1519
|
-
const UsePointerLock = defineComponent({
|
|
1543
|
+
const UsePointerLock = /* #__PURE__ */ defineComponent({
|
|
1520
1544
|
name: "UsePointerLock",
|
|
1521
1545
|
props: ["as"],
|
|
1522
1546
|
setup(props, { slots }) {
|
|
@@ -1529,7 +1553,7 @@ const UsePointerLock = defineComponent({
|
|
|
1529
1553
|
}
|
|
1530
1554
|
});
|
|
1531
1555
|
|
|
1532
|
-
const UsePreferredColorScheme = /* @__PURE__ */ defineComponent({
|
|
1556
|
+
const UsePreferredColorScheme = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1533
1557
|
name: "UsePreferredColorScheme",
|
|
1534
1558
|
setup(props, { slots }) {
|
|
1535
1559
|
const data = reactive({
|
|
@@ -1542,7 +1566,7 @@ const UsePreferredColorScheme = /* @__PURE__ */ defineComponent({
|
|
|
1542
1566
|
}
|
|
1543
1567
|
});
|
|
1544
1568
|
|
|
1545
|
-
const UsePreferredContrast = /* @__PURE__ */ defineComponent({
|
|
1569
|
+
const UsePreferredContrast = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1546
1570
|
name: "UsePreferredContrast",
|
|
1547
1571
|
setup(props, { slots }) {
|
|
1548
1572
|
const data = reactive({
|
|
@@ -1555,7 +1579,7 @@ const UsePreferredContrast = /* @__PURE__ */ defineComponent({
|
|
|
1555
1579
|
}
|
|
1556
1580
|
});
|
|
1557
1581
|
|
|
1558
|
-
const UsePreferredDark = /* @__PURE__ */ defineComponent({
|
|
1582
|
+
const UsePreferredDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1559
1583
|
name: "UsePreferredDark",
|
|
1560
1584
|
setup(props, { slots }) {
|
|
1561
1585
|
const data = reactive({
|
|
@@ -1568,7 +1592,7 @@ const UsePreferredDark = /* @__PURE__ */ defineComponent({
|
|
|
1568
1592
|
}
|
|
1569
1593
|
});
|
|
1570
1594
|
|
|
1571
|
-
const UsePreferredLanguages = /* @__PURE__ */ defineComponent({
|
|
1595
|
+
const UsePreferredLanguages = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1572
1596
|
name: "UsePreferredLanguages",
|
|
1573
1597
|
setup(props, { slots }) {
|
|
1574
1598
|
const data = reactive({
|
|
@@ -1581,7 +1605,7 @@ const UsePreferredLanguages = /* @__PURE__ */ defineComponent({
|
|
|
1581
1605
|
}
|
|
1582
1606
|
});
|
|
1583
1607
|
|
|
1584
|
-
const UsePreferredReducedMotion = /* @__PURE__ */ defineComponent({
|
|
1608
|
+
const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1585
1609
|
name: "UsePreferredReducedMotion",
|
|
1586
1610
|
setup(props, { slots }) {
|
|
1587
1611
|
const data = reactive({
|
|
@@ -1654,7 +1678,7 @@ function getValue(position) {
|
|
|
1654
1678
|
return getComputedStyle(document.documentElement).getPropertyValue(position);
|
|
1655
1679
|
}
|
|
1656
1680
|
|
|
1657
|
-
const UseScreenSafeArea = /* @__PURE__ */ defineComponent({
|
|
1681
|
+
const UseScreenSafeArea = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1658
1682
|
name: "UseScreenSafeArea",
|
|
1659
1683
|
props: {
|
|
1660
1684
|
top: Boolean,
|
|
@@ -1739,7 +1763,7 @@ const vScroll = {
|
|
|
1739
1763
|
|
|
1740
1764
|
function checkOverflowScroll(ele) {
|
|
1741
1765
|
const style = window.getComputedStyle(ele);
|
|
1742
|
-
if (style.overflowX === "scroll" || style.overflowY === "scroll") {
|
|
1766
|
+
if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientHeight < ele.scrollHeight || style.overflowY === "auto" && ele.clientWidth < ele.scrollWidth) {
|
|
1743
1767
|
return true;
|
|
1744
1768
|
} else {
|
|
1745
1769
|
const parent = ele.parentNode;
|
|
@@ -1840,7 +1864,7 @@ var __spreadValues$2 = (a, b) => {
|
|
|
1840
1864
|
return a;
|
|
1841
1865
|
};
|
|
1842
1866
|
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1843
|
-
const UseTimeAgo = /* @__PURE__ */ defineComponent({
|
|
1867
|
+
const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1844
1868
|
name: "UseTimeAgo",
|
|
1845
1869
|
props: ["time", "updateInterval", "max", "fullDateFormatter", "messages", "showSecond"],
|
|
1846
1870
|
setup(props, { slots }) {
|
|
@@ -1871,7 +1895,7 @@ var __spreadValues$1 = (a, b) => {
|
|
|
1871
1895
|
return a;
|
|
1872
1896
|
};
|
|
1873
1897
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1874
|
-
const UseTimestamp = /* @__PURE__ */ defineComponent({
|
|
1898
|
+
const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1875
1899
|
name: "UseTimestamp",
|
|
1876
1900
|
props: ["immediate", "interval", "offset"],
|
|
1877
1901
|
setup(props, { slots }) {
|
|
@@ -1899,7 +1923,7 @@ var __spreadValues = (a, b) => {
|
|
|
1899
1923
|
}
|
|
1900
1924
|
return a;
|
|
1901
1925
|
};
|
|
1902
|
-
const UseVirtualList = /* @__PURE__ */ defineComponent({
|
|
1926
|
+
const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1903
1927
|
name: "UseVirtualList",
|
|
1904
1928
|
props: [
|
|
1905
1929
|
"list",
|
|
@@ -1917,7 +1941,7 @@ const UseVirtualList = /* @__PURE__ */ defineComponent({
|
|
|
1917
1941
|
}
|
|
1918
1942
|
});
|
|
1919
1943
|
|
|
1920
|
-
const UseWindowFocus = /* @__PURE__ */ defineComponent({
|
|
1944
|
+
const UseWindowFocus = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1921
1945
|
name: "UseWindowFocus",
|
|
1922
1946
|
setup(props, { slots }) {
|
|
1923
1947
|
const data = reactive({
|
|
@@ -1930,7 +1954,7 @@ const UseWindowFocus = /* @__PURE__ */ defineComponent({
|
|
|
1930
1954
|
}
|
|
1931
1955
|
});
|
|
1932
1956
|
|
|
1933
|
-
const UseWindowSize = /* @__PURE__ */ defineComponent({
|
|
1957
|
+
const UseWindowSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
1934
1958
|
name: "UseWindowSize",
|
|
1935
1959
|
props: ["initialWidth", "initialHeight"],
|
|
1936
1960
|
setup(props, { slots }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/components",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"description": "Renderless components for VueUse",
|
|
5
5
|
"author": "Jacob Clevenger<https://github.com/wheatjs>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"jsdelivr": "./index.iife.min.js",
|
|
34
34
|
"types": "./index.d.ts",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vueuse/core": "9.
|
|
37
|
-
"@vueuse/shared": "9.
|
|
36
|
+
"@vueuse/core": "9.13.0",
|
|
37
|
+
"@vueuse/shared": "9.13.0",
|
|
38
38
|
"vue-demi": "*"
|
|
39
39
|
}
|
|
40
40
|
}
|