@vueuse/components 9.11.1 → 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 +114 -76
- package/index.iife.js +114 -76
- package/index.iife.min.js +1 -1
- package/index.mjs +115 -77
- package/package.json +3 -3
package/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var vueDemi = require('vue-demi');
|
|
|
4
4
|
var core = require('@vueuse/core');
|
|
5
5
|
var shared = require('@vueuse/shared');
|
|
6
6
|
|
|
7
|
-
const OnClickOutside = /* @__PURE__ */ vueDemi.defineComponent({
|
|
7
|
+
const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
8
8
|
name: "OnClickOutside",
|
|
9
9
|
props: ["as", "options"],
|
|
10
10
|
emits: ["trigger"],
|
|
@@ -50,16 +50,16 @@ function useEventListener(...args) {
|
|
|
50
50
|
cleanups.forEach((fn) => fn());
|
|
51
51
|
cleanups.length = 0;
|
|
52
52
|
};
|
|
53
|
-
const register = (el, event, listener) => {
|
|
54
|
-
el.addEventListener(event, listener,
|
|
55
|
-
return () => el.removeEventListener(event, listener,
|
|
53
|
+
const register = (el, event, listener, options2) => {
|
|
54
|
+
el.addEventListener(event, listener, options2);
|
|
55
|
+
return () => el.removeEventListener(event, listener, options2);
|
|
56
56
|
};
|
|
57
|
-
const stopWatch = vueDemi.watch(() => unrefElement(target), (el) => {
|
|
57
|
+
const stopWatch = vueDemi.watch(() => [unrefElement(target), shared.resolveUnref(options)], ([el, options2]) => {
|
|
58
58
|
cleanup();
|
|
59
59
|
if (!el)
|
|
60
60
|
return;
|
|
61
61
|
cleanups.push(...events.flatMap((event) => {
|
|
62
|
-
return listeners.map((listener) => register(el, event, listener));
|
|
62
|
+
return listeners.map((listener) => register(el, event, listener, options2));
|
|
63
63
|
}));
|
|
64
64
|
}, { immediate: true, flush: "post" });
|
|
65
65
|
const stop = () => {
|
|
@@ -70,12 +70,16 @@ function useEventListener(...args) {
|
|
|
70
70
|
return stop;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
let _iOSWorkaround = false;
|
|
73
74
|
function onClickOutside(target, handler, options = {}) {
|
|
74
75
|
const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
|
|
75
76
|
if (!window)
|
|
76
77
|
return;
|
|
78
|
+
if (shared.isIOS && !_iOSWorkaround) {
|
|
79
|
+
_iOSWorkaround = true;
|
|
80
|
+
Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", shared.noop));
|
|
81
|
+
}
|
|
77
82
|
let shouldListen = true;
|
|
78
|
-
let fallback;
|
|
79
83
|
const shouldIgnore = (event) => {
|
|
80
84
|
return ignore.some((target2) => {
|
|
81
85
|
if (typeof target2 === "string") {
|
|
@@ -87,7 +91,6 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
87
91
|
});
|
|
88
92
|
};
|
|
89
93
|
const listener = (event) => {
|
|
90
|
-
window.clearTimeout(fallback);
|
|
91
94
|
const el = unrefElement(target);
|
|
92
95
|
if (!el || el === event.target || event.composedPath().includes(el))
|
|
93
96
|
return;
|
|
@@ -106,13 +109,6 @@ function onClickOutside(target, handler, options = {}) {
|
|
|
106
109
|
if (el)
|
|
107
110
|
shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
|
|
108
111
|
}, { passive: true }),
|
|
109
|
-
useEventListener(window, "pointerup", (e) => {
|
|
110
|
-
if (e.button === 0) {
|
|
111
|
-
const path = e.composedPath();
|
|
112
|
-
e.composedPath = () => path;
|
|
113
|
-
fallback = window.setTimeout(() => listener(e), 50);
|
|
114
|
-
}
|
|
115
|
-
}, { passive: true }),
|
|
116
112
|
detectIframe && useEventListener(window, "blur", (event) => {
|
|
117
113
|
var _a;
|
|
118
114
|
const el = unrefElement(target);
|
|
@@ -242,7 +238,7 @@ function onLongPress(target, handler, options) {
|
|
|
242
238
|
useEventListener(elementRef, "pointerleave", clear, listenerOptions);
|
|
243
239
|
}
|
|
244
240
|
|
|
245
|
-
const OnLongPress = /* @__PURE__ */ vueDemi.defineComponent({
|
|
241
|
+
const OnLongPress = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
246
242
|
name: "OnLongPress",
|
|
247
243
|
props: ["as", "options"],
|
|
248
244
|
emits: ["trigger"],
|
|
@@ -267,7 +263,7 @@ const vOnLongPress = {
|
|
|
267
263
|
}
|
|
268
264
|
};
|
|
269
265
|
|
|
270
|
-
const UseActiveElement = /* @__PURE__ */ vueDemi.defineComponent({
|
|
266
|
+
const UseActiveElement = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
271
267
|
name: "UseActiveElement",
|
|
272
268
|
setup(props, { slots }) {
|
|
273
269
|
const data = vueDemi.reactive({
|
|
@@ -280,7 +276,7 @@ const UseActiveElement = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
280
276
|
}
|
|
281
277
|
});
|
|
282
278
|
|
|
283
|
-
const UseBattery = /* @__PURE__ */ vueDemi.defineComponent({
|
|
279
|
+
const UseBattery = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
284
280
|
name: "UseBattery",
|
|
285
281
|
setup(props, { slots }) {
|
|
286
282
|
const data = vueDemi.reactive(core.useBattery(props));
|
|
@@ -291,7 +287,7 @@ const UseBattery = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
291
287
|
}
|
|
292
288
|
});
|
|
293
289
|
|
|
294
|
-
const UseBrowserLocation = /* @__PURE__ */ vueDemi.defineComponent({
|
|
290
|
+
const UseBrowserLocation = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
295
291
|
name: "UseBrowserLocation",
|
|
296
292
|
setup(props, { slots }) {
|
|
297
293
|
const data = vueDemi.reactive(core.useBrowserLocation());
|
|
@@ -364,6 +360,7 @@ const StorageSerializers = {
|
|
|
364
360
|
write: (v) => v.toISOString()
|
|
365
361
|
}
|
|
366
362
|
};
|
|
363
|
+
const customStorageEventName = "vueuse-storage";
|
|
367
364
|
function useStorage(key, defaults, storage, options = {}) {
|
|
368
365
|
var _a;
|
|
369
366
|
const {
|
|
@@ -396,8 +393,10 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
396
393
|
const type = guessSerializerType(rawInit);
|
|
397
394
|
const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];
|
|
398
395
|
const { pause: pauseWatch, resume: resumeWatch } = shared.pausableWatch(data, () => write(data.value), { flush, deep, eventFilter });
|
|
399
|
-
if (window && listenToStorageChanges)
|
|
396
|
+
if (window && listenToStorageChanges) {
|
|
400
397
|
useEventListener(window, "storage", update);
|
|
398
|
+
useEventListener(window, customStorageEventName, updateFromCustomEvent);
|
|
399
|
+
}
|
|
401
400
|
update();
|
|
402
401
|
return data;
|
|
403
402
|
function write(v) {
|
|
@@ -410,11 +409,13 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
410
409
|
if (oldValue !== serialized) {
|
|
411
410
|
storage.setItem(key, serialized);
|
|
412
411
|
if (window) {
|
|
413
|
-
window
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
412
|
+
window.dispatchEvent(new CustomEvent(customStorageEventName, {
|
|
413
|
+
detail: {
|
|
414
|
+
key,
|
|
415
|
+
oldValue,
|
|
416
|
+
newValue: serialized,
|
|
417
|
+
storageArea: storage
|
|
418
|
+
}
|
|
418
419
|
}));
|
|
419
420
|
}
|
|
420
421
|
}
|
|
@@ -442,6 +443,9 @@ function useStorage(key, defaults, storage, options = {}) {
|
|
|
442
443
|
return serializer.read(rawValue);
|
|
443
444
|
}
|
|
444
445
|
}
|
|
446
|
+
function updateFromCustomEvent(event) {
|
|
447
|
+
update(event.detail);
|
|
448
|
+
}
|
|
445
449
|
function update(event) {
|
|
446
450
|
if (event && event.storageArea !== storage)
|
|
447
451
|
return;
|
|
@@ -584,7 +588,7 @@ function useColorMode(options = {}) {
|
|
|
584
588
|
return state;
|
|
585
589
|
}
|
|
586
590
|
|
|
587
|
-
const UseColorMode = /* @__PURE__ */ vueDemi.defineComponent({
|
|
591
|
+
const UseColorMode = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
588
592
|
name: "UseColorMode",
|
|
589
593
|
props: ["selector", "attribute", "modes", "onChanged", "storageKey", "storage", "emitAuto"],
|
|
590
594
|
setup(props, { slots }) {
|
|
@@ -599,7 +603,7 @@ const UseColorMode = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
599
603
|
}
|
|
600
604
|
});
|
|
601
605
|
|
|
602
|
-
const UseDark = /* @__PURE__ */ vueDemi.defineComponent({
|
|
606
|
+
const UseDark = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
603
607
|
name: "UseDark",
|
|
604
608
|
props: ["selector", "attribute", "valueDark", "valueLight", "onChanged", "storageKey", "storage"],
|
|
605
609
|
setup(props, { slots }) {
|
|
@@ -615,7 +619,7 @@ const UseDark = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
615
619
|
}
|
|
616
620
|
});
|
|
617
621
|
|
|
618
|
-
const UseDeviceMotion = /* @__PURE__ */ vueDemi.defineComponent({
|
|
622
|
+
const UseDeviceMotion = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
619
623
|
name: "UseDeviceMotion",
|
|
620
624
|
setup(props, { slots }) {
|
|
621
625
|
const data = vueDemi.reactive(core.useDeviceMotion());
|
|
@@ -626,7 +630,7 @@ const UseDeviceMotion = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
626
630
|
}
|
|
627
631
|
});
|
|
628
632
|
|
|
629
|
-
const UseDeviceOrientation = /* @__PURE__ */ vueDemi.defineComponent({
|
|
633
|
+
const UseDeviceOrientation = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
630
634
|
name: "UseDeviceOrientation",
|
|
631
635
|
setup(props, { slots }) {
|
|
632
636
|
const data = vueDemi.reactive(core.useDeviceOrientation());
|
|
@@ -637,7 +641,7 @@ const UseDeviceOrientation = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
637
641
|
}
|
|
638
642
|
});
|
|
639
643
|
|
|
640
|
-
const UseDevicePixelRatio = /* @__PURE__ */ vueDemi.defineComponent({
|
|
644
|
+
const UseDevicePixelRatio = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
641
645
|
name: "UseDevicePixelRatio",
|
|
642
646
|
setup(props, { slots }) {
|
|
643
647
|
const data = vueDemi.reactive({
|
|
@@ -650,7 +654,7 @@ const UseDevicePixelRatio = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
650
654
|
}
|
|
651
655
|
});
|
|
652
656
|
|
|
653
|
-
const UseDevicesList = /* @__PURE__ */ vueDemi.defineComponent({
|
|
657
|
+
const UseDevicesList = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
654
658
|
name: "UseDevicesList",
|
|
655
659
|
props: ["onUpdated", "requestPermissions", "constraints"],
|
|
656
660
|
setup(props, { slots }) {
|
|
@@ -662,7 +666,7 @@ const UseDevicesList = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
662
666
|
}
|
|
663
667
|
});
|
|
664
668
|
|
|
665
|
-
const UseDocumentVisibility = /* @__PURE__ */ vueDemi.defineComponent({
|
|
669
|
+
const UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
666
670
|
name: "UseDocumentVisibility",
|
|
667
671
|
setup(props, { slots }) {
|
|
668
672
|
const data = vueDemi.reactive({
|
|
@@ -694,7 +698,7 @@ var __spreadValues$a = (a, b) => {
|
|
|
694
698
|
return a;
|
|
695
699
|
};
|
|
696
700
|
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
|
697
|
-
const UseDraggable = /* @__PURE__ */ vueDemi.defineComponent({
|
|
701
|
+
const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
698
702
|
name: "UseDraggable",
|
|
699
703
|
props: [
|
|
700
704
|
"storageKey",
|
|
@@ -733,7 +737,7 @@ const UseDraggable = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
733
737
|
}
|
|
734
738
|
});
|
|
735
739
|
|
|
736
|
-
const UseElementBounding = /* @__PURE__ */ vueDemi.defineComponent({
|
|
740
|
+
const UseElementBounding = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
737
741
|
name: "UseElementBounding",
|
|
738
742
|
props: ["box", "as"],
|
|
739
743
|
setup(props, { slots }) {
|
|
@@ -746,10 +750,26 @@ const UseElementBounding = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
746
750
|
}
|
|
747
751
|
});
|
|
748
752
|
|
|
749
|
-
function useElementHover(el) {
|
|
753
|
+
function useElementHover(el, options = {}) {
|
|
754
|
+
const delayEnter = options ? options.delayEnter : 0;
|
|
755
|
+
const delayLeave = options ? options.delayLeave : 0;
|
|
750
756
|
const isHovered = vueDemi.ref(false);
|
|
751
|
-
|
|
752
|
-
|
|
757
|
+
let timer;
|
|
758
|
+
const toggle = (entering) => {
|
|
759
|
+
const delay = entering ? delayEnter : delayLeave;
|
|
760
|
+
if (timer) {
|
|
761
|
+
clearTimeout(timer);
|
|
762
|
+
timer = void 0;
|
|
763
|
+
}
|
|
764
|
+
if (delay)
|
|
765
|
+
timer = setTimeout(() => isHovered.value = entering, delay);
|
|
766
|
+
else
|
|
767
|
+
isHovered.value = entering;
|
|
768
|
+
};
|
|
769
|
+
if (!window)
|
|
770
|
+
return isHovered;
|
|
771
|
+
useEventListener(el, "mouseenter", () => toggle(true), { passive: true });
|
|
772
|
+
useEventListener(el, "mouseleave", () => toggle(false), { passive: true });
|
|
753
773
|
return isHovered;
|
|
754
774
|
}
|
|
755
775
|
|
|
@@ -762,7 +782,7 @@ const vElementHover = {
|
|
|
762
782
|
}
|
|
763
783
|
};
|
|
764
784
|
|
|
765
|
-
const UseElementSize = /* @__PURE__ */ vueDemi.defineComponent({
|
|
785
|
+
const UseElementSize = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
766
786
|
name: "UseElementSize",
|
|
767
787
|
props: ["width", "height", "box"],
|
|
768
788
|
setup(props, { slots }) {
|
|
@@ -819,17 +839,31 @@ function useResizeObserver(target, callback, options = {}) {
|
|
|
819
839
|
}
|
|
820
840
|
|
|
821
841
|
function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
|
|
822
|
-
const { box = "content-box" } = options;
|
|
842
|
+
const { window = defaultWindow, box = "content-box" } = options;
|
|
843
|
+
const isSVG = vueDemi.computed(() => {
|
|
844
|
+
var _a, _b;
|
|
845
|
+
return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
|
|
846
|
+
});
|
|
823
847
|
const width = vueDemi.ref(initialSize.width);
|
|
824
848
|
const height = vueDemi.ref(initialSize.height);
|
|
825
849
|
useResizeObserver(target, ([entry]) => {
|
|
826
850
|
const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
|
|
827
|
-
if (
|
|
828
|
-
|
|
829
|
-
|
|
851
|
+
if (window && isSVG.value) {
|
|
852
|
+
const $elem = unrefElement(target);
|
|
853
|
+
if ($elem) {
|
|
854
|
+
const styles = window.getComputedStyle($elem);
|
|
855
|
+
width.value = parseFloat(styles.width);
|
|
856
|
+
height.value = parseFloat(styles.height);
|
|
857
|
+
}
|
|
830
858
|
} else {
|
|
831
|
-
|
|
832
|
-
|
|
859
|
+
if (boxSize) {
|
|
860
|
+
const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
|
|
861
|
+
width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
|
|
862
|
+
height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
|
|
863
|
+
} else {
|
|
864
|
+
width.value = entry.contentRect.width;
|
|
865
|
+
height.value = entry.contentRect.height;
|
|
866
|
+
}
|
|
833
867
|
}
|
|
834
868
|
}, options);
|
|
835
869
|
vueDemi.watch(() => unrefElement(target), (ele) => {
|
|
@@ -852,7 +886,7 @@ const vElementSize = {
|
|
|
852
886
|
}
|
|
853
887
|
};
|
|
854
888
|
|
|
855
|
-
const UseElementVisibility = /* @__PURE__ */ vueDemi.defineComponent({
|
|
889
|
+
const UseElementVisibility = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
856
890
|
name: "UseElementVisibility",
|
|
857
891
|
props: ["as"],
|
|
858
892
|
setup(props, { slots }) {
|
|
@@ -905,7 +939,7 @@ const vElementVisibility = {
|
|
|
905
939
|
}
|
|
906
940
|
};
|
|
907
941
|
|
|
908
|
-
const UseEyeDropper = /* @__PURE__ */ vueDemi.defineComponent({
|
|
942
|
+
const UseEyeDropper = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
909
943
|
name: "UseEyeDropper",
|
|
910
944
|
props: {
|
|
911
945
|
sRGBHex: String
|
|
@@ -919,7 +953,7 @@ const UseEyeDropper = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
919
953
|
}
|
|
920
954
|
});
|
|
921
955
|
|
|
922
|
-
const UseFullscreen = /* @__PURE__ */ vueDemi.defineComponent({
|
|
956
|
+
const UseFullscreen = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
923
957
|
name: "UseFullscreen",
|
|
924
958
|
props: ["as"],
|
|
925
959
|
setup(props, { slots }) {
|
|
@@ -932,7 +966,7 @@ const UseFullscreen = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
932
966
|
}
|
|
933
967
|
});
|
|
934
968
|
|
|
935
|
-
const UseGeolocation = /* @__PURE__ */ vueDemi.defineComponent({
|
|
969
|
+
const UseGeolocation = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
936
970
|
name: "UseGeolocation",
|
|
937
971
|
props: ["enableHighAccuracy", "maximumAge", "timeout", "navigator"],
|
|
938
972
|
setup(props, { slots }) {
|
|
@@ -944,7 +978,7 @@ const UseGeolocation = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
944
978
|
}
|
|
945
979
|
});
|
|
946
980
|
|
|
947
|
-
const UseIdle = /* @__PURE__ */ vueDemi.defineComponent({
|
|
981
|
+
const UseIdle = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
948
982
|
name: "UseIdle",
|
|
949
983
|
props: ["timeout", "events", "listenForVisibilityChange", "initialState"],
|
|
950
984
|
setup(props, { slots }) {
|
|
@@ -1042,7 +1076,7 @@ const useImage = (options, asyncStateOptions = {}) => {
|
|
|
1042
1076
|
return state;
|
|
1043
1077
|
};
|
|
1044
1078
|
|
|
1045
|
-
const UseImage = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1079
|
+
const UseImage = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1046
1080
|
name: "UseImage",
|
|
1047
1081
|
props: [
|
|
1048
1082
|
"src",
|
|
@@ -1125,14 +1159,17 @@ function useScroll(element, options = {}) {
|
|
|
1125
1159
|
top: false,
|
|
1126
1160
|
bottom: false
|
|
1127
1161
|
});
|
|
1128
|
-
const onScrollEnd =
|
|
1162
|
+
const onScrollEnd = (e) => {
|
|
1163
|
+
if (!isScrolling.value)
|
|
1164
|
+
return;
|
|
1129
1165
|
isScrolling.value = false;
|
|
1130
1166
|
directions.left = false;
|
|
1131
1167
|
directions.right = false;
|
|
1132
1168
|
directions.top = false;
|
|
1133
1169
|
directions.bottom = false;
|
|
1134
1170
|
onStop(e);
|
|
1135
|
-
}
|
|
1171
|
+
};
|
|
1172
|
+
const onScrollEndDebounced = shared.useDebounceFn(onScrollEnd, throttle + idle);
|
|
1136
1173
|
const onScrollHandler = (e) => {
|
|
1137
1174
|
const eventTarget = e.target === document ? e.target.documentElement : e.target;
|
|
1138
1175
|
const scrollLeft = eventTarget.scrollLeft;
|
|
@@ -1150,10 +1187,11 @@ function useScroll(element, options = {}) {
|
|
|
1150
1187
|
arrivedState.bottom = scrollTop + eventTarget.clientHeight >= eventTarget.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1151
1188
|
internalY.value = scrollTop;
|
|
1152
1189
|
isScrolling.value = true;
|
|
1153
|
-
|
|
1190
|
+
onScrollEndDebounced(e);
|
|
1154
1191
|
onScroll(e);
|
|
1155
1192
|
};
|
|
1156
1193
|
useEventListener(element, "scroll", throttle ? shared.useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);
|
|
1194
|
+
useEventListener(element, "scrollend", onScrollEnd, eventListenerOptions);
|
|
1157
1195
|
return {
|
|
1158
1196
|
x,
|
|
1159
1197
|
y,
|
|
@@ -1267,7 +1305,7 @@ const vIntersectionObserver = {
|
|
|
1267
1305
|
}
|
|
1268
1306
|
};
|
|
1269
1307
|
|
|
1270
|
-
const UseMouse = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1308
|
+
const UseMouse = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1271
1309
|
name: "UseMouse",
|
|
1272
1310
|
props: ["touch", "resetOnTouchEnds", "initialValue"],
|
|
1273
1311
|
setup(props, { slots }) {
|
|
@@ -1279,7 +1317,7 @@ const UseMouse = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1279
1317
|
}
|
|
1280
1318
|
});
|
|
1281
1319
|
|
|
1282
|
-
const UseMouseInElement = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1320
|
+
const UseMouseInElement = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1283
1321
|
name: "UseMouseElement",
|
|
1284
1322
|
props: ["handleOutside", "as"],
|
|
1285
1323
|
setup(props, { slots }) {
|
|
@@ -1311,7 +1349,7 @@ var __spreadValues$7 = (a, b) => {
|
|
|
1311
1349
|
return a;
|
|
1312
1350
|
};
|
|
1313
1351
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1314
|
-
const UseMousePressed = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1352
|
+
const UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1315
1353
|
name: "UseMousePressed",
|
|
1316
1354
|
props: ["touch", "initialValue", "as"],
|
|
1317
1355
|
setup(props, { slots }) {
|
|
@@ -1324,7 +1362,7 @@ const UseMousePressed = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1324
1362
|
}
|
|
1325
1363
|
});
|
|
1326
1364
|
|
|
1327
|
-
const UseNetwork = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1365
|
+
const UseNetwork = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1328
1366
|
name: "UseNetwork",
|
|
1329
1367
|
setup(props, { slots }) {
|
|
1330
1368
|
const data = vueDemi.reactive(core.useNetwork());
|
|
@@ -1354,7 +1392,7 @@ var __spreadValues$6 = (a, b) => {
|
|
|
1354
1392
|
return a;
|
|
1355
1393
|
};
|
|
1356
1394
|
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1357
|
-
const UseNow = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1395
|
+
const UseNow = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1358
1396
|
name: "UseNow",
|
|
1359
1397
|
props: ["interval"],
|
|
1360
1398
|
setup(props, { slots }) {
|
|
@@ -1366,7 +1404,7 @@ const UseNow = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1366
1404
|
}
|
|
1367
1405
|
});
|
|
1368
1406
|
|
|
1369
|
-
const UseObjectUrl = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1407
|
+
const UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1370
1408
|
name: "UseObjectUrl",
|
|
1371
1409
|
props: [
|
|
1372
1410
|
"object"
|
|
@@ -1400,7 +1438,7 @@ var __spreadValues$5 = (a, b) => {
|
|
|
1400
1438
|
return a;
|
|
1401
1439
|
};
|
|
1402
1440
|
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1403
|
-
const UseOffsetPagination = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1441
|
+
const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1404
1442
|
name: "UseOffsetPagination",
|
|
1405
1443
|
props: [
|
|
1406
1444
|
"total",
|
|
@@ -1440,7 +1478,7 @@ const UseOffsetPagination = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1440
1478
|
}
|
|
1441
1479
|
});
|
|
1442
1480
|
|
|
1443
|
-
const UseOnline = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1481
|
+
const UseOnline = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1444
1482
|
name: "UseOnline",
|
|
1445
1483
|
setup(props, { slots }) {
|
|
1446
1484
|
const data = vueDemi.reactive({
|
|
@@ -1453,7 +1491,7 @@ const UseOnline = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1453
1491
|
}
|
|
1454
1492
|
});
|
|
1455
1493
|
|
|
1456
|
-
const UsePageLeave = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1494
|
+
const UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1457
1495
|
name: "UsePageLeave",
|
|
1458
1496
|
setup(props, { slots }) {
|
|
1459
1497
|
const data = vueDemi.reactive({
|
|
@@ -1485,7 +1523,7 @@ var __spreadValues$4 = (a, b) => {
|
|
|
1485
1523
|
return a;
|
|
1486
1524
|
};
|
|
1487
1525
|
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1488
|
-
const UsePointer = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1526
|
+
const UsePointer = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1489
1527
|
name: "UsePointer",
|
|
1490
1528
|
props: [
|
|
1491
1529
|
"pointerTypes",
|
|
@@ -1504,7 +1542,7 @@ const UsePointer = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1504
1542
|
}
|
|
1505
1543
|
});
|
|
1506
1544
|
|
|
1507
|
-
const UsePointerLock = vueDemi.defineComponent({
|
|
1545
|
+
const UsePointerLock = /* #__PURE__ */ vueDemi.defineComponent({
|
|
1508
1546
|
name: "UsePointerLock",
|
|
1509
1547
|
props: ["as"],
|
|
1510
1548
|
setup(props, { slots }) {
|
|
@@ -1517,7 +1555,7 @@ const UsePointerLock = vueDemi.defineComponent({
|
|
|
1517
1555
|
}
|
|
1518
1556
|
});
|
|
1519
1557
|
|
|
1520
|
-
const UsePreferredColorScheme = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1558
|
+
const UsePreferredColorScheme = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1521
1559
|
name: "UsePreferredColorScheme",
|
|
1522
1560
|
setup(props, { slots }) {
|
|
1523
1561
|
const data = vueDemi.reactive({
|
|
@@ -1530,7 +1568,7 @@ const UsePreferredColorScheme = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1530
1568
|
}
|
|
1531
1569
|
});
|
|
1532
1570
|
|
|
1533
|
-
const UsePreferredContrast = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1571
|
+
const UsePreferredContrast = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1534
1572
|
name: "UsePreferredContrast",
|
|
1535
1573
|
setup(props, { slots }) {
|
|
1536
1574
|
const data = vueDemi.reactive({
|
|
@@ -1543,7 +1581,7 @@ const UsePreferredContrast = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1543
1581
|
}
|
|
1544
1582
|
});
|
|
1545
1583
|
|
|
1546
|
-
const UsePreferredDark = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1584
|
+
const UsePreferredDark = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1547
1585
|
name: "UsePreferredDark",
|
|
1548
1586
|
setup(props, { slots }) {
|
|
1549
1587
|
const data = vueDemi.reactive({
|
|
@@ -1556,7 +1594,7 @@ const UsePreferredDark = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1556
1594
|
}
|
|
1557
1595
|
});
|
|
1558
1596
|
|
|
1559
|
-
const UsePreferredLanguages = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1597
|
+
const UsePreferredLanguages = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1560
1598
|
name: "UsePreferredLanguages",
|
|
1561
1599
|
setup(props, { slots }) {
|
|
1562
1600
|
const data = vueDemi.reactive({
|
|
@@ -1569,7 +1607,7 @@ const UsePreferredLanguages = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1569
1607
|
}
|
|
1570
1608
|
});
|
|
1571
1609
|
|
|
1572
|
-
const UsePreferredReducedMotion = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1610
|
+
const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1573
1611
|
name: "UsePreferredReducedMotion",
|
|
1574
1612
|
setup(props, { slots }) {
|
|
1575
1613
|
const data = vueDemi.reactive({
|
|
@@ -1642,7 +1680,7 @@ function getValue(position) {
|
|
|
1642
1680
|
return getComputedStyle(document.documentElement).getPropertyValue(position);
|
|
1643
1681
|
}
|
|
1644
1682
|
|
|
1645
|
-
const UseScreenSafeArea = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1683
|
+
const UseScreenSafeArea = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1646
1684
|
name: "UseScreenSafeArea",
|
|
1647
1685
|
props: {
|
|
1648
1686
|
top: Boolean,
|
|
@@ -1727,7 +1765,7 @@ const vScroll = {
|
|
|
1727
1765
|
|
|
1728
1766
|
function checkOverflowScroll(ele) {
|
|
1729
1767
|
const style = window.getComputedStyle(ele);
|
|
1730
|
-
if (style.overflowX === "scroll" || style.overflowY === "scroll") {
|
|
1768
|
+
if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientHeight < ele.scrollHeight || style.overflowY === "auto" && ele.clientWidth < ele.scrollWidth) {
|
|
1731
1769
|
return true;
|
|
1732
1770
|
} else {
|
|
1733
1771
|
const parent = ele.parentNode;
|
|
@@ -1828,7 +1866,7 @@ var __spreadValues$2 = (a, b) => {
|
|
|
1828
1866
|
return a;
|
|
1829
1867
|
};
|
|
1830
1868
|
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1831
|
-
const UseTimeAgo = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1869
|
+
const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1832
1870
|
name: "UseTimeAgo",
|
|
1833
1871
|
props: ["time", "updateInterval", "max", "fullDateFormatter", "messages", "showSecond"],
|
|
1834
1872
|
setup(props, { slots }) {
|
|
@@ -1859,7 +1897,7 @@ var __spreadValues$1 = (a, b) => {
|
|
|
1859
1897
|
return a;
|
|
1860
1898
|
};
|
|
1861
1899
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1862
|
-
const UseTimestamp = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1900
|
+
const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1863
1901
|
name: "UseTimestamp",
|
|
1864
1902
|
props: ["immediate", "interval", "offset"],
|
|
1865
1903
|
setup(props, { slots }) {
|
|
@@ -1887,7 +1925,7 @@ var __spreadValues = (a, b) => {
|
|
|
1887
1925
|
}
|
|
1888
1926
|
return a;
|
|
1889
1927
|
};
|
|
1890
|
-
const UseVirtualList = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1928
|
+
const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1891
1929
|
name: "UseVirtualList",
|
|
1892
1930
|
props: [
|
|
1893
1931
|
"list",
|
|
@@ -1905,7 +1943,7 @@ const UseVirtualList = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1905
1943
|
}
|
|
1906
1944
|
});
|
|
1907
1945
|
|
|
1908
|
-
const UseWindowFocus = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1946
|
+
const UseWindowFocus = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1909
1947
|
name: "UseWindowFocus",
|
|
1910
1948
|
setup(props, { slots }) {
|
|
1911
1949
|
const data = vueDemi.reactive({
|
|
@@ -1918,7 +1956,7 @@ const UseWindowFocus = /* @__PURE__ */ vueDemi.defineComponent({
|
|
|
1918
1956
|
}
|
|
1919
1957
|
});
|
|
1920
1958
|
|
|
1921
|
-
const UseWindowSize = /* @__PURE__ */ vueDemi.defineComponent({
|
|
1959
|
+
const UseWindowSize = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
1922
1960
|
name: "UseWindowSize",
|
|
1923
1961
|
props: ["initialWidth", "initialHeight"],
|
|
1924
1962
|
setup(props, { slots }) {
|