@vueuse/components 12.6.1 → 12.8.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 +95 -94
- package/index.d.cts +23 -23
- package/index.d.mts +23 -23
- package/index.d.ts +23 -23
- package/index.iife.js +95 -94
- package/index.iife.min.js +1 -1
- package/index.mjs +96 -95
- package/package.json +3 -3
package/index.cjs
CHANGED
|
@@ -4,12 +4,12 @@ var core = require('@vueuse/core');
|
|
|
4
4
|
var vue = require('vue');
|
|
5
5
|
var shared = require('@vueuse/shared');
|
|
6
6
|
|
|
7
|
-
const OnClickOutside = /* @__PURE__ */
|
|
7
|
+
const OnClickOutside = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
8
8
|
name: "OnClickOutside",
|
|
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);
|
|
@@ -333,12 +333,12 @@ function onLongPress(target, handler, options) {
|
|
|
333
333
|
return stop;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
const OnLongPress = /* @__PURE__ */
|
|
336
|
+
const OnLongPress = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
337
337
|
name: "OnLongPress",
|
|
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) => {
|
|
@@ -362,7 +362,7 @@ const vOnLongPress = {
|
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
364
|
|
|
365
|
-
const UseActiveElement = /* @__PURE__ */
|
|
365
|
+
const UseActiveElement = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
366
366
|
name: "UseActiveElement",
|
|
367
367
|
setup(props, { slots }) {
|
|
368
368
|
const data = vue.reactive({
|
|
@@ -375,7 +375,7 @@ const UseActiveElement = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
375
375
|
}
|
|
376
376
|
});
|
|
377
377
|
|
|
378
|
-
const UseBattery = /* @__PURE__ */
|
|
378
|
+
const UseBattery = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
379
379
|
name: "UseBattery",
|
|
380
380
|
setup(props, { slots }) {
|
|
381
381
|
const data = vue.reactive(core.useBattery(props));
|
|
@@ -386,7 +386,7 @@ const UseBattery = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
386
386
|
}
|
|
387
387
|
});
|
|
388
388
|
|
|
389
|
-
const UseBrowserLocation = /* @__PURE__ */
|
|
389
|
+
const UseBrowserLocation = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
390
390
|
name: "UseBrowserLocation",
|
|
391
391
|
setup(props, { slots }) {
|
|
392
392
|
const data = vue.reactive(core.useBrowserLocation());
|
|
@@ -397,7 +397,7 @@ const UseBrowserLocation = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
397
397
|
}
|
|
398
398
|
});
|
|
399
399
|
|
|
400
|
-
const UseClipboard = /* @__PURE__ */
|
|
400
|
+
const UseClipboard = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
401
401
|
name: "UseClipboard",
|
|
402
402
|
props: [
|
|
403
403
|
"source",
|
|
@@ -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(() => {
|
|
@@ -455,9 +455,9 @@ function useSupported(callback) {
|
|
|
455
455
|
function useMediaQuery(query, options = {}) {
|
|
456
456
|
const { window = defaultWindow, ssrWidth = useSSRWidth() } = options;
|
|
457
457
|
const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
|
|
458
|
-
const ssrSupport = vue.
|
|
458
|
+
const ssrSupport = vue.shallowRef(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
|
};
|
|
@@ -750,7 +750,7 @@ function useColorMode(options = {}) {
|
|
|
750
750
|
return Object.assign(auto, { store, system, state });
|
|
751
751
|
}
|
|
752
752
|
|
|
753
|
-
const UseColorMode = /* @__PURE__ */
|
|
753
|
+
const UseColorMode = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
754
754
|
name: "UseColorMode",
|
|
755
755
|
props: ["selector", "attribute", "modes", "onChanged", "storageKey", "storage", "emitAuto"],
|
|
756
756
|
setup(props, { slots }) {
|
|
@@ -767,7 +767,7 @@ const UseColorMode = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
769
|
|
|
770
|
-
const UseDark = /* @__PURE__ */
|
|
770
|
+
const UseDark = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
771
771
|
name: "UseDark",
|
|
772
772
|
props: ["selector", "attribute", "valueDark", "valueLight", "onChanged", "storageKey", "storage"],
|
|
773
773
|
setup(props, { slots }) {
|
|
@@ -783,7 +783,7 @@ const UseDark = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
783
783
|
}
|
|
784
784
|
});
|
|
785
785
|
|
|
786
|
-
const UseDeviceMotion = /* @__PURE__ */
|
|
786
|
+
const UseDeviceMotion = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
787
787
|
name: "UseDeviceMotion",
|
|
788
788
|
setup(props, { slots }) {
|
|
789
789
|
const data = core.useDeviceMotion();
|
|
@@ -794,7 +794,7 @@ const UseDeviceMotion = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
794
794
|
}
|
|
795
795
|
});
|
|
796
796
|
|
|
797
|
-
const UseDeviceOrientation = /* @__PURE__ */
|
|
797
|
+
const UseDeviceOrientation = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
798
798
|
name: "UseDeviceOrientation",
|
|
799
799
|
setup(props, { slots }) {
|
|
800
800
|
const data = vue.reactive(core.useDeviceOrientation());
|
|
@@ -805,7 +805,7 @@ const UseDeviceOrientation = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent
|
|
|
805
805
|
}
|
|
806
806
|
});
|
|
807
807
|
|
|
808
|
-
const UseDevicePixelRatio = /* @__PURE__ */
|
|
808
|
+
const UseDevicePixelRatio = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
809
809
|
name: "UseDevicePixelRatio",
|
|
810
810
|
setup(props, { slots }) {
|
|
811
811
|
const data = vue.reactive({
|
|
@@ -818,7 +818,7 @@ const UseDevicePixelRatio = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent(
|
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
820
|
|
|
821
|
-
const UseDevicesList = /* @__PURE__ */
|
|
821
|
+
const UseDevicesList = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
822
822
|
name: "UseDevicesList",
|
|
823
823
|
props: ["onUpdated", "requestPermissions", "constraints"],
|
|
824
824
|
setup(props, { slots }) {
|
|
@@ -830,7 +830,7 @@ const UseDevicesList = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
830
830
|
}
|
|
831
831
|
});
|
|
832
832
|
|
|
833
|
-
const UseDocumentVisibility = /* @__PURE__ */
|
|
833
|
+
const UseDocumentVisibility = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
834
834
|
name: "UseDocumentVisibility",
|
|
835
835
|
setup(props, { slots }) {
|
|
836
836
|
const data = vue.reactive({
|
|
@@ -843,7 +843,7 @@ const UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponen
|
|
|
843
843
|
}
|
|
844
844
|
});
|
|
845
845
|
|
|
846
|
-
const UseDraggable = /* @__PURE__ */
|
|
846
|
+
const UseDraggable = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
847
847
|
name: "UseDraggable",
|
|
848
848
|
props: [
|
|
849
849
|
"storageKey",
|
|
@@ -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;
|
|
@@ -903,11 +903,11 @@ const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
903
903
|
}
|
|
904
904
|
});
|
|
905
905
|
|
|
906
|
-
const UseElementBounding = /* @__PURE__ */
|
|
906
|
+
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;
|
|
@@ -1174,7 +1174,7 @@ const vElementHover = {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
};
|
|
1176
1176
|
|
|
1177
|
-
const UseElementSize = /* @__PURE__ */
|
|
1177
|
+
const UseElementSize = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1178
1178
|
name: "UseElementSize",
|
|
1179
1179
|
props: ["width", "height", "box", "as"],
|
|
1180
1180
|
setup(props, { slots }) {
|
|
@@ -1193,8 +1193,8 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
|
|
|
1193
1193
|
var _a, _b;
|
|
1194
1194
|
return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
|
|
1195
1195
|
});
|
|
1196
|
-
const width = vue.
|
|
1197
|
-
const height = vue.
|
|
1196
|
+
const width = vue.shallowRef(initialSize.width);
|
|
1197
|
+
const height = vue.shallowRef(initialSize.height);
|
|
1198
1198
|
const { stop: stop1 } = useResizeObserver(
|
|
1199
1199
|
target,
|
|
1200
1200
|
([entry]) => {
|
|
@@ -1254,7 +1254,7 @@ const vElementSize = {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
};
|
|
1256
1256
|
|
|
1257
|
-
const UseElementVisibility = /* @__PURE__ */
|
|
1257
|
+
const UseElementVisibility = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1258
1258
|
name: "UseElementVisibility",
|
|
1259
1259
|
props: ["as"],
|
|
1260
1260
|
setup(props, { slots }) {
|
|
@@ -1283,7 +1283,7 @@ function useIntersectionObserver(target, callback, options = {}) {
|
|
|
1283
1283
|
return shared.toArray(_target).map(unrefElement).filter(shared.notNullish);
|
|
1284
1284
|
});
|
|
1285
1285
|
let cleanup = shared.noop;
|
|
1286
|
-
const isActive = vue.
|
|
1286
|
+
const isActive = vue.shallowRef(immediate);
|
|
1287
1287
|
const stopWatch = isSupported.value ? vue.watch(
|
|
1288
1288
|
() => [targets.value, unrefElement(root), isActive.value],
|
|
1289
1289
|
([targets2, root2]) => {
|
|
@@ -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) => {
|
|
@@ -1379,7 +1379,7 @@ const vElementVisibility = {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
};
|
|
1381
1381
|
|
|
1382
|
-
const UseEyeDropper = /* @__PURE__ */
|
|
1382
|
+
const UseEyeDropper = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1383
1383
|
name: "UseEyeDropper",
|
|
1384
1384
|
props: {
|
|
1385
1385
|
sRGBHex: String
|
|
@@ -1393,7 +1393,7 @@ const UseEyeDropper = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
1393
1393
|
}
|
|
1394
1394
|
});
|
|
1395
1395
|
|
|
1396
|
-
const UseFullscreen = /* @__PURE__ */
|
|
1396
|
+
const UseFullscreen = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1397
1397
|
name: "UseFullscreen",
|
|
1398
1398
|
props: ["as"],
|
|
1399
1399
|
setup(props, { slots }) {
|
|
@@ -1406,7 +1406,7 @@ const UseFullscreen = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
1406
1406
|
}
|
|
1407
1407
|
});
|
|
1408
1408
|
|
|
1409
|
-
const UseGeolocation = /* @__PURE__ */
|
|
1409
|
+
const UseGeolocation = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1410
1410
|
name: "UseGeolocation",
|
|
1411
1411
|
props: ["enableHighAccuracy", "maximumAge", "timeout", "navigator"],
|
|
1412
1412
|
setup(props, { slots }) {
|
|
@@ -1418,7 +1418,7 @@ const UseGeolocation = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
1418
1418
|
}
|
|
1419
1419
|
});
|
|
1420
1420
|
|
|
1421
|
-
const UseIdle = /* @__PURE__ */
|
|
1421
|
+
const UseIdle = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1422
1422
|
name: "UseIdle",
|
|
1423
1423
|
props: ["timeout", "events", "listenForVisibilityChange", "initialState"],
|
|
1424
1424
|
setup(props, { slots }) {
|
|
@@ -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)
|
|
@@ -1541,7 +1541,7 @@ function useImage(options, asyncStateOptions = {}) {
|
|
|
1541
1541
|
return state;
|
|
1542
1542
|
}
|
|
1543
1543
|
|
|
1544
|
-
const UseImage = /* @__PURE__ */
|
|
1544
|
+
const UseImage = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1545
1545
|
name: "UseImage",
|
|
1546
1546
|
props: [
|
|
1547
1547
|
"src",
|
|
@@ -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,
|
|
@@ -1675,8 +1675,8 @@ function useScroll(element, options = {}) {
|
|
|
1675
1675
|
const scrollLeft = el.scrollLeft;
|
|
1676
1676
|
directions.left = scrollLeft < internalX.value;
|
|
1677
1677
|
directions.right = scrollLeft > internalX.value;
|
|
1678
|
-
const left = scrollLeft * directionMultipler <= (offset.left || 0);
|
|
1679
|
-
const right = scrollLeft * directionMultipler + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1678
|
+
const left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);
|
|
1679
|
+
const right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1680
1680
|
if (display === "flex" && flexDirection === "row-reverse") {
|
|
1681
1681
|
arrivedState.left = right;
|
|
1682
1682
|
arrivedState.right = left;
|
|
@@ -1690,8 +1690,8 @@ function useScroll(element, options = {}) {
|
|
|
1690
1690
|
scrollTop = window.document.body.scrollTop;
|
|
1691
1691
|
directions.top = scrollTop < internalY.value;
|
|
1692
1692
|
directions.bottom = scrollTop > internalY.value;
|
|
1693
|
-
const top = scrollTop <= (offset.top || 0);
|
|
1694
|
-
const bottom = scrollTop + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1693
|
+
const top = Math.abs(scrollTop) <= (offset.top || 0);
|
|
1694
|
+
const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1695
1695
|
if (display === "flex" && flexDirection === "column-reverse") {
|
|
1696
1696
|
arrivedState.top = bottom;
|
|
1697
1697
|
arrivedState.bottom = top;
|
|
@@ -1820,7 +1820,7 @@ const vIntersectionObserver = {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
};
|
|
1822
1822
|
|
|
1823
|
-
const UseMouse = /* @__PURE__ */
|
|
1823
|
+
const UseMouse = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1824
1824
|
name: "UseMouse",
|
|
1825
1825
|
props: ["touch", "resetOnTouchEnds", "initialValue"],
|
|
1826
1826
|
setup(props, { slots }) {
|
|
@@ -1832,7 +1832,7 @@ const UseMouse = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
1832
1832
|
}
|
|
1833
1833
|
});
|
|
1834
1834
|
|
|
1835
|
-
const UseMouseInElement = /* @__PURE__ */
|
|
1835
|
+
const UseMouseInElement = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
1836
1836
|
name: "UseMouseElement",
|
|
1837
1837
|
props: ["handleOutside", "as"],
|
|
1838
1838
|
setup(props, { slots }) {
|
|
@@ -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);
|
|
@@ -1931,14 +1931,14 @@ function useMouseInElement(target, options = {}) {
|
|
|
1931
1931
|
} = options;
|
|
1932
1932
|
const type = options.type || "page";
|
|
1933
1933
|
const { x, y, sourceType } = useMouse(options);
|
|
1934
|
-
const targetRef = vue.
|
|
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.
|
|
1934
|
+
const targetRef = vue.shallowRef(target != null ? target : window == null ? void 0 : window.document.body);
|
|
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) {
|
|
@@ -1998,7 +1998,7 @@ const vMouseInElement = {
|
|
|
1998
1998
|
}
|
|
1999
1999
|
};
|
|
2000
2000
|
|
|
2001
|
-
const UseMousePressed = /* @__PURE__ */
|
|
2001
|
+
const UseMousePressed = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2002
2002
|
name: "UseMousePressed",
|
|
2003
2003
|
props: ["touch", "initialValue", "as"],
|
|
2004
2004
|
setup(props, { slots }) {
|
|
@@ -2011,7 +2011,7 @@ const UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2011
2011
|
}
|
|
2012
2012
|
});
|
|
2013
2013
|
|
|
2014
|
-
const UseNetwork = /* @__PURE__ */
|
|
2014
|
+
const UseNetwork = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2015
2015
|
name: "UseNetwork",
|
|
2016
2016
|
setup(props, { slots }) {
|
|
2017
2017
|
const data = vue.reactive(core.useNetwork());
|
|
@@ -2022,7 +2022,7 @@ const UseNetwork = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2022
2022
|
}
|
|
2023
2023
|
});
|
|
2024
2024
|
|
|
2025
|
-
const UseNow = /* @__PURE__ */
|
|
2025
|
+
const UseNow = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2026
2026
|
name: "UseNow",
|
|
2027
2027
|
props: ["interval"],
|
|
2028
2028
|
setup(props, { slots }) {
|
|
@@ -2034,7 +2034,7 @@ const UseNow = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2034
2034
|
}
|
|
2035
2035
|
});
|
|
2036
2036
|
|
|
2037
|
-
const UseObjectUrl = /* @__PURE__ */
|
|
2037
|
+
const UseObjectUrl = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2038
2038
|
name: "UseObjectUrl",
|
|
2039
2039
|
props: [
|
|
2040
2040
|
"object"
|
|
@@ -2049,7 +2049,7 @@ const UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2049
2049
|
}
|
|
2050
2050
|
});
|
|
2051
2051
|
|
|
2052
|
-
const UseOffsetPagination = /* @__PURE__ */
|
|
2052
|
+
const UseOffsetPagination = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2053
2053
|
name: "UseOffsetPagination",
|
|
2054
2054
|
props: [
|
|
2055
2055
|
"total",
|
|
@@ -2090,7 +2090,7 @@ const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent(
|
|
|
2090
2090
|
}
|
|
2091
2091
|
});
|
|
2092
2092
|
|
|
2093
|
-
const UseOnline = /* @__PURE__ */
|
|
2093
|
+
const UseOnline = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2094
2094
|
name: "UseOnline",
|
|
2095
2095
|
setup(props, { slots }) {
|
|
2096
2096
|
const data = vue.reactive({
|
|
@@ -2103,7 +2103,7 @@ const UseOnline = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2103
2103
|
}
|
|
2104
2104
|
});
|
|
2105
2105
|
|
|
2106
|
-
const UsePageLeave = /* @__PURE__ */
|
|
2106
|
+
const UsePageLeave = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2107
2107
|
name: "UsePageLeave",
|
|
2108
2108
|
setup(props, { slots }) {
|
|
2109
2109
|
const data = vue.reactive({
|
|
@@ -2116,7 +2116,7 @@ const UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2116
2116
|
}
|
|
2117
2117
|
});
|
|
2118
2118
|
|
|
2119
|
-
const UsePointer = /* @__PURE__ */
|
|
2119
|
+
const UsePointer = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2120
2120
|
name: "UsePointer",
|
|
2121
2121
|
props: [
|
|
2122
2122
|
"pointerTypes",
|
|
@@ -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
|
|
@@ -2136,7 +2136,7 @@ const UsePointer = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2136
2136
|
}
|
|
2137
2137
|
});
|
|
2138
2138
|
|
|
2139
|
-
const UsePointerLock =
|
|
2139
|
+
const UsePointerLock = /*@__PURE__*/ vue.defineComponent({
|
|
2140
2140
|
name: "UsePointerLock",
|
|
2141
2141
|
props: ["as"],
|
|
2142
2142
|
setup(props, { slots }) {
|
|
@@ -2149,7 +2149,7 @@ const UsePointerLock = /* #__PURE__ */ vue.defineComponent({
|
|
|
2149
2149
|
}
|
|
2150
2150
|
});
|
|
2151
2151
|
|
|
2152
|
-
const UsePreferredColorScheme = /* @__PURE__ */
|
|
2152
|
+
const UsePreferredColorScheme = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2153
2153
|
name: "UsePreferredColorScheme",
|
|
2154
2154
|
setup(props, { slots }) {
|
|
2155
2155
|
const data = vue.reactive({
|
|
@@ -2162,7 +2162,7 @@ const UsePreferredColorScheme = /* @__PURE__ */ /* #__PURE__ */ vue.defineCompon
|
|
|
2162
2162
|
}
|
|
2163
2163
|
});
|
|
2164
2164
|
|
|
2165
|
-
const UsePreferredContrast = /* @__PURE__ */
|
|
2165
|
+
const UsePreferredContrast = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2166
2166
|
name: "UsePreferredContrast",
|
|
2167
2167
|
setup(props, { slots }) {
|
|
2168
2168
|
const data = vue.reactive({
|
|
@@ -2175,7 +2175,7 @@ const UsePreferredContrast = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent
|
|
|
2175
2175
|
}
|
|
2176
2176
|
});
|
|
2177
2177
|
|
|
2178
|
-
const UsePreferredDark = /* @__PURE__ */
|
|
2178
|
+
const UsePreferredDark = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2179
2179
|
name: "UsePreferredDark",
|
|
2180
2180
|
setup(props, { slots }) {
|
|
2181
2181
|
const data = vue.reactive({
|
|
@@ -2188,7 +2188,7 @@ const UsePreferredDark = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2188
2188
|
}
|
|
2189
2189
|
});
|
|
2190
2190
|
|
|
2191
|
-
const UsePreferredLanguages = /* @__PURE__ */
|
|
2191
|
+
const UsePreferredLanguages = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2192
2192
|
name: "UsePreferredLanguages",
|
|
2193
2193
|
setup(props, { slots }) {
|
|
2194
2194
|
const data = vue.reactive({
|
|
@@ -2201,7 +2201,7 @@ const UsePreferredLanguages = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponen
|
|
|
2201
2201
|
}
|
|
2202
2202
|
});
|
|
2203
2203
|
|
|
2204
|
-
const UsePreferredReducedMotion = /* @__PURE__ */
|
|
2204
|
+
const UsePreferredReducedMotion = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2205
2205
|
name: "UsePreferredReducedMotion",
|
|
2206
2206
|
setup(props, { slots }) {
|
|
2207
2207
|
const data = vue.reactive({
|
|
@@ -2214,7 +2214,7 @@ const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ vue.defineComp
|
|
|
2214
2214
|
}
|
|
2215
2215
|
});
|
|
2216
2216
|
|
|
2217
|
-
const UsePreferredReducedTransparency = /* @__PURE__ */
|
|
2217
|
+
const UsePreferredReducedTransparency = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2218
2218
|
name: "UsePreferredReducedTransparency",
|
|
2219
2219
|
setup(props, { slots }) {
|
|
2220
2220
|
const data = vue.reactive({
|
|
@@ -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);
|
|
@@ -2264,7 +2264,8 @@ function useCssVar(prop, target, options = {}) {
|
|
|
2264
2264
|
if (old[0] && old[1])
|
|
2265
2265
|
old[0].style.removeProperty(old[1]);
|
|
2266
2266
|
updateCssVar();
|
|
2267
|
-
}
|
|
2267
|
+
},
|
|
2268
|
+
{ immediate: true }
|
|
2268
2269
|
);
|
|
2269
2270
|
vue.watch(
|
|
2270
2271
|
[variable, elRef],
|
|
@@ -2287,10 +2288,10 @@ const rightVarName = "--vueuse-safe-area-right";
|
|
|
2287
2288
|
const bottomVarName = "--vueuse-safe-area-bottom";
|
|
2288
2289
|
const leftVarName = "--vueuse-safe-area-left";
|
|
2289
2290
|
function useScreenSafeArea() {
|
|
2290
|
-
const top = vue.
|
|
2291
|
-
const right = vue.
|
|
2292
|
-
const bottom = vue.
|
|
2293
|
-
const left = vue.
|
|
2291
|
+
const top = vue.shallowRef("");
|
|
2292
|
+
const right = vue.shallowRef("");
|
|
2293
|
+
const bottom = vue.shallowRef("");
|
|
2294
|
+
const left = vue.shallowRef("");
|
|
2294
2295
|
if (shared.isClient) {
|
|
2295
2296
|
const topCssVar = useCssVar(topVarName);
|
|
2296
2297
|
const rightCssVar = useCssVar(rightVarName);
|
|
@@ -2321,7 +2322,7 @@ function getValue(position) {
|
|
|
2321
2322
|
return getComputedStyle(document.documentElement).getPropertyValue(position);
|
|
2322
2323
|
}
|
|
2323
2324
|
|
|
2324
|
-
const UseScreenSafeArea = /* @__PURE__ */
|
|
2325
|
+
const UseScreenSafeArea = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2325
2326
|
name: "UseScreenSafeArea",
|
|
2326
2327
|
props: {
|
|
2327
2328
|
top: Boolean,
|
|
@@ -2410,7 +2411,7 @@ function preventDefault(rawEvent) {
|
|
|
2410
2411
|
}
|
|
2411
2412
|
const elInitialOverflow = /* @__PURE__ */ new WeakMap();
|
|
2412
2413
|
function useScrollLock(element, initialState = false) {
|
|
2413
|
-
const isLocked = vue.
|
|
2414
|
+
const isLocked = vue.shallowRef(initialState);
|
|
2414
2415
|
let stopTouchMoveListener = null;
|
|
2415
2416
|
let initialOverflow = "";
|
|
2416
2417
|
vue.watch(shared.toRef(element), (el) => {
|
|
@@ -2471,7 +2472,7 @@ function useScrollLock(element, initialState = false) {
|
|
|
2471
2472
|
|
|
2472
2473
|
function onScrollLock() {
|
|
2473
2474
|
let isMounted = false;
|
|
2474
|
-
const state = vue.
|
|
2475
|
+
const state = vue.shallowRef(false);
|
|
2475
2476
|
return (el, binding) => {
|
|
2476
2477
|
state.value = binding.value;
|
|
2477
2478
|
if (isMounted)
|
|
@@ -2483,7 +2484,7 @@ function onScrollLock() {
|
|
|
2483
2484
|
}
|
|
2484
2485
|
const vScrollLock = onScrollLock();
|
|
2485
2486
|
|
|
2486
|
-
const UseTimeAgo = /* @__PURE__ */
|
|
2487
|
+
const UseTimeAgo = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2487
2488
|
name: "UseTimeAgo",
|
|
2488
2489
|
props: ["time", "updateInterval", "max", "fullDateFormatter", "messages", "showSecond"],
|
|
2489
2490
|
setup(props, { slots }) {
|
|
@@ -2495,7 +2496,7 @@ const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2495
2496
|
}
|
|
2496
2497
|
});
|
|
2497
2498
|
|
|
2498
|
-
const UseTimestamp = /* @__PURE__ */
|
|
2499
|
+
const UseTimestamp = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2499
2500
|
name: "UseTimestamp",
|
|
2500
2501
|
props: ["immediate", "interval", "offset"],
|
|
2501
2502
|
setup(props, { slots }) {
|
|
@@ -2507,7 +2508,7 @@ const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2507
2508
|
}
|
|
2508
2509
|
});
|
|
2509
2510
|
|
|
2510
|
-
const UseVirtualList = /* @__PURE__ */
|
|
2511
|
+
const UseVirtualList = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2511
2512
|
name: "UseVirtualList",
|
|
2512
2513
|
props: [
|
|
2513
2514
|
"list",
|
|
@@ -2526,7 +2527,7 @@ const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2526
2527
|
}
|
|
2527
2528
|
});
|
|
2528
2529
|
|
|
2529
|
-
const UseWindowFocus = /* @__PURE__ */
|
|
2530
|
+
const UseWindowFocus = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2530
2531
|
name: "UseWindowFocus",
|
|
2531
2532
|
setup(props, { slots }) {
|
|
2532
2533
|
const data = vue.reactive({
|
|
@@ -2539,7 +2540,7 @@ const UseWindowFocus = /* @__PURE__ */ /* #__PURE__ */ vue.defineComponent({
|
|
|
2539
2540
|
}
|
|
2540
2541
|
});
|
|
2541
2542
|
|
|
2542
|
-
const UseWindowSize = /* @__PURE__ */
|
|
2543
|
+
const UseWindowSize = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
2543
2544
|
name: "UseWindowSize",
|
|
2544
2545
|
props: ["initialWidth", "initialHeight"],
|
|
2545
2546
|
setup(props, { slots }) {
|