@vueuse/components 12.7.0 → 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 +57 -56
- package/index.d.cts +4 -4
- package/index.d.mts +4 -4
- package/index.d.ts +4 -4
- package/index.iife.js +57 -56
- package/index.iife.min.js +1 -1
- package/index.mjs +58 -57
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, shallowRef, h, toValue, computed, unref, reactive, hasInjectionContext, getCurrentInstance, onMounted,
|
|
2
|
+
import { defineComponent, shallowRef, h, toValue, computed, unref, reactive, hasInjectionContext, getCurrentInstance, onMounted, watchEffect, ref, 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
|
-
const OnClickOutside = /* @__PURE__ */
|
|
5
|
+
const OnClickOutside = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "OnClickOutside",
|
|
7
7
|
props: ["as", "options"],
|
|
8
8
|
emits: ["trigger"],
|
|
@@ -331,7 +331,7 @@ function onLongPress(target, handler, options) {
|
|
|
331
331
|
return stop;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
const OnLongPress = /* @__PURE__ */
|
|
334
|
+
const OnLongPress = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
335
335
|
name: "OnLongPress",
|
|
336
336
|
props: ["as", "options"],
|
|
337
337
|
emits: ["trigger"],
|
|
@@ -360,7 +360,7 @@ const vOnLongPress = {
|
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
-
const UseActiveElement = /* @__PURE__ */
|
|
363
|
+
const UseActiveElement = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
364
364
|
name: "UseActiveElement",
|
|
365
365
|
setup(props, { slots }) {
|
|
366
366
|
const data = reactive({
|
|
@@ -373,7 +373,7 @@ const UseActiveElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
373
373
|
}
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
-
const UseBattery = /* @__PURE__ */
|
|
376
|
+
const UseBattery = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
377
377
|
name: "UseBattery",
|
|
378
378
|
setup(props, { slots }) {
|
|
379
379
|
const data = reactive(useBattery(props));
|
|
@@ -384,7 +384,7 @@ const UseBattery = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
384
384
|
}
|
|
385
385
|
});
|
|
386
386
|
|
|
387
|
-
const UseBrowserLocation = /* @__PURE__ */
|
|
387
|
+
const UseBrowserLocation = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
388
388
|
name: "UseBrowserLocation",
|
|
389
389
|
setup(props, { slots }) {
|
|
390
390
|
const data = reactive(useBrowserLocation());
|
|
@@ -395,7 +395,7 @@ const UseBrowserLocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
395
395
|
}
|
|
396
396
|
});
|
|
397
397
|
|
|
398
|
-
const UseClipboard = /* @__PURE__ */
|
|
398
|
+
const UseClipboard = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
399
399
|
name: "UseClipboard",
|
|
400
400
|
props: [
|
|
401
401
|
"source",
|
|
@@ -453,7 +453,7 @@ function useSupported(callback) {
|
|
|
453
453
|
function useMediaQuery(query, options = {}) {
|
|
454
454
|
const { window = defaultWindow, ssrWidth = useSSRWidth() } = options;
|
|
455
455
|
const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
|
|
456
|
-
const ssrSupport =
|
|
456
|
+
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
457
457
|
const mediaQuery = shallowRef();
|
|
458
458
|
const matches = shallowRef(false);
|
|
459
459
|
const handler = (event) => {
|
|
@@ -748,7 +748,7 @@ function useColorMode(options = {}) {
|
|
|
748
748
|
return Object.assign(auto, { store, system, state });
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
const UseColorMode = /* @__PURE__ */
|
|
751
|
+
const UseColorMode = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
752
752
|
name: "UseColorMode",
|
|
753
753
|
props: ["selector", "attribute", "modes", "onChanged", "storageKey", "storage", "emitAuto"],
|
|
754
754
|
setup(props, { slots }) {
|
|
@@ -765,7 +765,7 @@ const UseColorMode = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
765
765
|
}
|
|
766
766
|
});
|
|
767
767
|
|
|
768
|
-
const UseDark = /* @__PURE__ */
|
|
768
|
+
const UseDark = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
769
769
|
name: "UseDark",
|
|
770
770
|
props: ["selector", "attribute", "valueDark", "valueLight", "onChanged", "storageKey", "storage"],
|
|
771
771
|
setup(props, { slots }) {
|
|
@@ -781,7 +781,7 @@ const UseDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
781
781
|
}
|
|
782
782
|
});
|
|
783
783
|
|
|
784
|
-
const UseDeviceMotion = /* @__PURE__ */
|
|
784
|
+
const UseDeviceMotion = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
785
785
|
name: "UseDeviceMotion",
|
|
786
786
|
setup(props, { slots }) {
|
|
787
787
|
const data = useDeviceMotion();
|
|
@@ -792,7 +792,7 @@ const UseDeviceMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
792
792
|
}
|
|
793
793
|
});
|
|
794
794
|
|
|
795
|
-
const UseDeviceOrientation = /* @__PURE__ */
|
|
795
|
+
const UseDeviceOrientation = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
796
796
|
name: "UseDeviceOrientation",
|
|
797
797
|
setup(props, { slots }) {
|
|
798
798
|
const data = reactive(useDeviceOrientation());
|
|
@@ -803,7 +803,7 @@ const UseDeviceOrientation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
|
|
806
|
-
const UseDevicePixelRatio = /* @__PURE__ */
|
|
806
|
+
const UseDevicePixelRatio = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
807
807
|
name: "UseDevicePixelRatio",
|
|
808
808
|
setup(props, { slots }) {
|
|
809
809
|
const data = reactive({
|
|
@@ -816,7 +816,7 @@ const UseDevicePixelRatio = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
816
816
|
}
|
|
817
817
|
});
|
|
818
818
|
|
|
819
|
-
const UseDevicesList = /* @__PURE__ */
|
|
819
|
+
const UseDevicesList = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
820
820
|
name: "UseDevicesList",
|
|
821
821
|
props: ["onUpdated", "requestPermissions", "constraints"],
|
|
822
822
|
setup(props, { slots }) {
|
|
@@ -828,7 +828,7 @@ const UseDevicesList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
828
828
|
}
|
|
829
829
|
});
|
|
830
830
|
|
|
831
|
-
const UseDocumentVisibility = /* @__PURE__ */
|
|
831
|
+
const UseDocumentVisibility = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
832
832
|
name: "UseDocumentVisibility",
|
|
833
833
|
setup(props, { slots }) {
|
|
834
834
|
const data = reactive({
|
|
@@ -841,7 +841,7 @@ const UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
841
841
|
}
|
|
842
842
|
});
|
|
843
843
|
|
|
844
|
-
const UseDraggable = /* @__PURE__ */
|
|
844
|
+
const UseDraggable = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
845
845
|
name: "UseDraggable",
|
|
846
846
|
props: [
|
|
847
847
|
"storageKey",
|
|
@@ -901,7 +901,7 @@ const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
901
901
|
}
|
|
902
902
|
});
|
|
903
903
|
|
|
904
|
-
const UseElementBounding = /* @__PURE__ */
|
|
904
|
+
const UseElementBounding = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
905
905
|
name: "UseElementBounding",
|
|
906
906
|
props: ["box", "as"],
|
|
907
907
|
setup(props, { slots }) {
|
|
@@ -1172,7 +1172,7 @@ const vElementHover = {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
};
|
|
1174
1174
|
|
|
1175
|
-
const UseElementSize = /* @__PURE__ */
|
|
1175
|
+
const UseElementSize = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1176
1176
|
name: "UseElementSize",
|
|
1177
1177
|
props: ["width", "height", "box", "as"],
|
|
1178
1178
|
setup(props, { slots }) {
|
|
@@ -1191,8 +1191,8 @@ function useElementSize(target, initialSize = { width: 0, height: 0 }, options =
|
|
|
1191
1191
|
var _a, _b;
|
|
1192
1192
|
return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
|
|
1193
1193
|
});
|
|
1194
|
-
const width =
|
|
1195
|
-
const height =
|
|
1194
|
+
const width = shallowRef(initialSize.width);
|
|
1195
|
+
const height = shallowRef(initialSize.height);
|
|
1196
1196
|
const { stop: stop1 } = useResizeObserver(
|
|
1197
1197
|
target,
|
|
1198
1198
|
([entry]) => {
|
|
@@ -1252,7 +1252,7 @@ const vElementSize = {
|
|
|
1252
1252
|
}
|
|
1253
1253
|
};
|
|
1254
1254
|
|
|
1255
|
-
const UseElementVisibility = /* @__PURE__ */
|
|
1255
|
+
const UseElementVisibility = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1256
1256
|
name: "UseElementVisibility",
|
|
1257
1257
|
props: ["as"],
|
|
1258
1258
|
setup(props, { slots }) {
|
|
@@ -1281,7 +1281,7 @@ function useIntersectionObserver(target, callback, options = {}) {
|
|
|
1281
1281
|
return toArray(_target).map(unrefElement).filter(notNullish);
|
|
1282
1282
|
});
|
|
1283
1283
|
let cleanup = noop;
|
|
1284
|
-
const isActive =
|
|
1284
|
+
const isActive = shallowRef(immediate);
|
|
1285
1285
|
const stopWatch = isSupported.value ? watch(
|
|
1286
1286
|
() => [targets.value, unrefElement(root), isActive.value],
|
|
1287
1287
|
([targets2, root2]) => {
|
|
@@ -1377,7 +1377,7 @@ const vElementVisibility = {
|
|
|
1377
1377
|
}
|
|
1378
1378
|
};
|
|
1379
1379
|
|
|
1380
|
-
const UseEyeDropper = /* @__PURE__ */
|
|
1380
|
+
const UseEyeDropper = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1381
1381
|
name: "UseEyeDropper",
|
|
1382
1382
|
props: {
|
|
1383
1383
|
sRGBHex: String
|
|
@@ -1391,7 +1391,7 @@ const UseEyeDropper = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
1391
1391
|
}
|
|
1392
1392
|
});
|
|
1393
1393
|
|
|
1394
|
-
const UseFullscreen = /* @__PURE__ */
|
|
1394
|
+
const UseFullscreen = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1395
1395
|
name: "UseFullscreen",
|
|
1396
1396
|
props: ["as"],
|
|
1397
1397
|
setup(props, { slots }) {
|
|
@@ -1404,7 +1404,7 @@ const UseFullscreen = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
1404
1404
|
}
|
|
1405
1405
|
});
|
|
1406
1406
|
|
|
1407
|
-
const UseGeolocation = /* @__PURE__ */
|
|
1407
|
+
const UseGeolocation = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1408
1408
|
name: "UseGeolocation",
|
|
1409
1409
|
props: ["enableHighAccuracy", "maximumAge", "timeout", "navigator"],
|
|
1410
1410
|
setup(props, { slots }) {
|
|
@@ -1416,7 +1416,7 @@ const UseGeolocation = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
1416
1416
|
}
|
|
1417
1417
|
});
|
|
1418
1418
|
|
|
1419
|
-
const UseIdle = /* @__PURE__ */
|
|
1419
|
+
const UseIdle = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1420
1420
|
name: "UseIdle",
|
|
1421
1421
|
props: ["timeout", "events", "listenForVisibilityChange", "initialState"],
|
|
1422
1422
|
setup(props, { slots }) {
|
|
@@ -1539,7 +1539,7 @@ function useImage(options, asyncStateOptions = {}) {
|
|
|
1539
1539
|
return state;
|
|
1540
1540
|
}
|
|
1541
1541
|
|
|
1542
|
-
const UseImage = /* @__PURE__ */
|
|
1542
|
+
const UseImage = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1543
1543
|
name: "UseImage",
|
|
1544
1544
|
props: [
|
|
1545
1545
|
"src",
|
|
@@ -1673,8 +1673,8 @@ function useScroll(element, options = {}) {
|
|
|
1673
1673
|
const scrollLeft = el.scrollLeft;
|
|
1674
1674
|
directions.left = scrollLeft < internalX.value;
|
|
1675
1675
|
directions.right = scrollLeft > internalX.value;
|
|
1676
|
-
const left = scrollLeft * directionMultipler <= (offset.left || 0);
|
|
1677
|
-
const right = scrollLeft * directionMultipler + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1676
|
+
const left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);
|
|
1677
|
+
const right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1678
1678
|
if (display === "flex" && flexDirection === "row-reverse") {
|
|
1679
1679
|
arrivedState.left = right;
|
|
1680
1680
|
arrivedState.right = left;
|
|
@@ -1688,8 +1688,8 @@ function useScroll(element, options = {}) {
|
|
|
1688
1688
|
scrollTop = window.document.body.scrollTop;
|
|
1689
1689
|
directions.top = scrollTop < internalY.value;
|
|
1690
1690
|
directions.bottom = scrollTop > internalY.value;
|
|
1691
|
-
const top = scrollTop <= (offset.top || 0);
|
|
1692
|
-
const bottom = scrollTop + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1691
|
+
const top = Math.abs(scrollTop) <= (offset.top || 0);
|
|
1692
|
+
const bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;
|
|
1693
1693
|
if (display === "flex" && flexDirection === "column-reverse") {
|
|
1694
1694
|
arrivedState.top = bottom;
|
|
1695
1695
|
arrivedState.bottom = top;
|
|
@@ -1818,7 +1818,7 @@ const vIntersectionObserver = {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
};
|
|
1820
1820
|
|
|
1821
|
-
const UseMouse = /* @__PURE__ */
|
|
1821
|
+
const UseMouse = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1822
1822
|
name: "UseMouse",
|
|
1823
1823
|
props: ["touch", "resetOnTouchEnds", "initialValue"],
|
|
1824
1824
|
setup(props, { slots }) {
|
|
@@ -1830,7 +1830,7 @@ const UseMouse = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
1830
1830
|
}
|
|
1831
1831
|
});
|
|
1832
1832
|
|
|
1833
|
-
const UseMouseInElement = /* @__PURE__ */
|
|
1833
|
+
const UseMouseInElement = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
1834
1834
|
name: "UseMouseElement",
|
|
1835
1835
|
props: ["handleOutside", "as"],
|
|
1836
1836
|
setup(props, { slots }) {
|
|
@@ -1929,7 +1929,7 @@ function useMouseInElement(target, options = {}) {
|
|
|
1929
1929
|
} = options;
|
|
1930
1930
|
const type = options.type || "page";
|
|
1931
1931
|
const { x, y, sourceType } = useMouse(options);
|
|
1932
|
-
const targetRef =
|
|
1932
|
+
const targetRef = shallowRef(target != null ? target : window == null ? void 0 : window.document.body);
|
|
1933
1933
|
const elementX = shallowRef(0);
|
|
1934
1934
|
const elementY = shallowRef(0);
|
|
1935
1935
|
const elementPositionX = shallowRef(0);
|
|
@@ -1996,7 +1996,7 @@ const vMouseInElement = {
|
|
|
1996
1996
|
}
|
|
1997
1997
|
};
|
|
1998
1998
|
|
|
1999
|
-
const UseMousePressed = /* @__PURE__ */
|
|
1999
|
+
const UseMousePressed = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2000
2000
|
name: "UseMousePressed",
|
|
2001
2001
|
props: ["touch", "initialValue", "as"],
|
|
2002
2002
|
setup(props, { slots }) {
|
|
@@ -2009,7 +2009,7 @@ const UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2009
2009
|
}
|
|
2010
2010
|
});
|
|
2011
2011
|
|
|
2012
|
-
const UseNetwork = /* @__PURE__ */
|
|
2012
|
+
const UseNetwork = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2013
2013
|
name: "UseNetwork",
|
|
2014
2014
|
setup(props, { slots }) {
|
|
2015
2015
|
const data = reactive(useNetwork());
|
|
@@ -2020,7 +2020,7 @@ const UseNetwork = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2020
2020
|
}
|
|
2021
2021
|
});
|
|
2022
2022
|
|
|
2023
|
-
const UseNow = /* @__PURE__ */
|
|
2023
|
+
const UseNow = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2024
2024
|
name: "UseNow",
|
|
2025
2025
|
props: ["interval"],
|
|
2026
2026
|
setup(props, { slots }) {
|
|
@@ -2032,7 +2032,7 @@ const UseNow = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2032
2032
|
}
|
|
2033
2033
|
});
|
|
2034
2034
|
|
|
2035
|
-
const UseObjectUrl = /* @__PURE__ */
|
|
2035
|
+
const UseObjectUrl = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2036
2036
|
name: "UseObjectUrl",
|
|
2037
2037
|
props: [
|
|
2038
2038
|
"object"
|
|
@@ -2047,7 +2047,7 @@ const UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2047
2047
|
}
|
|
2048
2048
|
});
|
|
2049
2049
|
|
|
2050
|
-
const UseOffsetPagination = /* @__PURE__ */
|
|
2050
|
+
const UseOffsetPagination = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2051
2051
|
name: "UseOffsetPagination",
|
|
2052
2052
|
props: [
|
|
2053
2053
|
"total",
|
|
@@ -2088,7 +2088,7 @@ const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2088
2088
|
}
|
|
2089
2089
|
});
|
|
2090
2090
|
|
|
2091
|
-
const UseOnline = /* @__PURE__ */
|
|
2091
|
+
const UseOnline = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2092
2092
|
name: "UseOnline",
|
|
2093
2093
|
setup(props, { slots }) {
|
|
2094
2094
|
const data = reactive({
|
|
@@ -2101,7 +2101,7 @@ const UseOnline = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2101
2101
|
}
|
|
2102
2102
|
});
|
|
2103
2103
|
|
|
2104
|
-
const UsePageLeave = /* @__PURE__ */
|
|
2104
|
+
const UsePageLeave = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2105
2105
|
name: "UsePageLeave",
|
|
2106
2106
|
setup(props, { slots }) {
|
|
2107
2107
|
const data = reactive({
|
|
@@ -2114,7 +2114,7 @@ const UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2114
2114
|
}
|
|
2115
2115
|
});
|
|
2116
2116
|
|
|
2117
|
-
const UsePointer = /* @__PURE__ */
|
|
2117
|
+
const UsePointer = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2118
2118
|
name: "UsePointer",
|
|
2119
2119
|
props: [
|
|
2120
2120
|
"pointerTypes",
|
|
@@ -2134,7 +2134,7 @@ const UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2134
2134
|
}
|
|
2135
2135
|
});
|
|
2136
2136
|
|
|
2137
|
-
const UsePointerLock =
|
|
2137
|
+
const UsePointerLock = /*@__PURE__*/ defineComponent({
|
|
2138
2138
|
name: "UsePointerLock",
|
|
2139
2139
|
props: ["as"],
|
|
2140
2140
|
setup(props, { slots }) {
|
|
@@ -2147,7 +2147,7 @@ const UsePointerLock = /* #__PURE__ */ defineComponent({
|
|
|
2147
2147
|
}
|
|
2148
2148
|
});
|
|
2149
2149
|
|
|
2150
|
-
const UsePreferredColorScheme = /* @__PURE__ */
|
|
2150
|
+
const UsePreferredColorScheme = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2151
2151
|
name: "UsePreferredColorScheme",
|
|
2152
2152
|
setup(props, { slots }) {
|
|
2153
2153
|
const data = reactive({
|
|
@@ -2160,7 +2160,7 @@ const UsePreferredColorScheme = /* @__PURE__ */ /* #__PURE__ */ defineComponent(
|
|
|
2160
2160
|
}
|
|
2161
2161
|
});
|
|
2162
2162
|
|
|
2163
|
-
const UsePreferredContrast = /* @__PURE__ */
|
|
2163
|
+
const UsePreferredContrast = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2164
2164
|
name: "UsePreferredContrast",
|
|
2165
2165
|
setup(props, { slots }) {
|
|
2166
2166
|
const data = reactive({
|
|
@@ -2173,7 +2173,7 @@ const UsePreferredContrast = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2173
2173
|
}
|
|
2174
2174
|
});
|
|
2175
2175
|
|
|
2176
|
-
const UsePreferredDark = /* @__PURE__ */
|
|
2176
|
+
const UsePreferredDark = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2177
2177
|
name: "UsePreferredDark",
|
|
2178
2178
|
setup(props, { slots }) {
|
|
2179
2179
|
const data = reactive({
|
|
@@ -2186,7 +2186,7 @@ const UsePreferredDark = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2186
2186
|
}
|
|
2187
2187
|
});
|
|
2188
2188
|
|
|
2189
|
-
const UsePreferredLanguages = /* @__PURE__ */
|
|
2189
|
+
const UsePreferredLanguages = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2190
2190
|
name: "UsePreferredLanguages",
|
|
2191
2191
|
setup(props, { slots }) {
|
|
2192
2192
|
const data = reactive({
|
|
@@ -2199,7 +2199,7 @@ const UsePreferredLanguages = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2199
2199
|
}
|
|
2200
2200
|
});
|
|
2201
2201
|
|
|
2202
|
-
const UsePreferredReducedMotion = /* @__PURE__ */
|
|
2202
|
+
const UsePreferredReducedMotion = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2203
2203
|
name: "UsePreferredReducedMotion",
|
|
2204
2204
|
setup(props, { slots }) {
|
|
2205
2205
|
const data = reactive({
|
|
@@ -2212,7 +2212,7 @@ const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponen
|
|
|
2212
2212
|
}
|
|
2213
2213
|
});
|
|
2214
2214
|
|
|
2215
|
-
const UsePreferredReducedTransparency = /* @__PURE__ */
|
|
2215
|
+
const UsePreferredReducedTransparency = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2216
2216
|
name: "UsePreferredReducedTransparency",
|
|
2217
2217
|
setup(props, { slots }) {
|
|
2218
2218
|
const data = reactive({
|
|
@@ -2262,7 +2262,8 @@ function useCssVar(prop, target, options = {}) {
|
|
|
2262
2262
|
if (old[0] && old[1])
|
|
2263
2263
|
old[0].style.removeProperty(old[1]);
|
|
2264
2264
|
updateCssVar();
|
|
2265
|
-
}
|
|
2265
|
+
},
|
|
2266
|
+
{ immediate: true }
|
|
2266
2267
|
);
|
|
2267
2268
|
watch(
|
|
2268
2269
|
[variable, elRef],
|
|
@@ -2319,7 +2320,7 @@ function getValue(position) {
|
|
|
2319
2320
|
return getComputedStyle(document.documentElement).getPropertyValue(position);
|
|
2320
2321
|
}
|
|
2321
2322
|
|
|
2322
|
-
const UseScreenSafeArea = /* @__PURE__ */
|
|
2323
|
+
const UseScreenSafeArea = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2323
2324
|
name: "UseScreenSafeArea",
|
|
2324
2325
|
props: {
|
|
2325
2326
|
top: Boolean,
|
|
@@ -2408,7 +2409,7 @@ function preventDefault(rawEvent) {
|
|
|
2408
2409
|
}
|
|
2409
2410
|
const elInitialOverflow = /* @__PURE__ */ new WeakMap();
|
|
2410
2411
|
function useScrollLock(element, initialState = false) {
|
|
2411
|
-
const isLocked =
|
|
2412
|
+
const isLocked = shallowRef(initialState);
|
|
2412
2413
|
let stopTouchMoveListener = null;
|
|
2413
2414
|
let initialOverflow = "";
|
|
2414
2415
|
watch(toRef(element), (el) => {
|
|
@@ -2481,7 +2482,7 @@ function onScrollLock() {
|
|
|
2481
2482
|
}
|
|
2482
2483
|
const vScrollLock = onScrollLock();
|
|
2483
2484
|
|
|
2484
|
-
const UseTimeAgo = /* @__PURE__ */
|
|
2485
|
+
const UseTimeAgo = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2485
2486
|
name: "UseTimeAgo",
|
|
2486
2487
|
props: ["time", "updateInterval", "max", "fullDateFormatter", "messages", "showSecond"],
|
|
2487
2488
|
setup(props, { slots }) {
|
|
@@ -2493,7 +2494,7 @@ const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2493
2494
|
}
|
|
2494
2495
|
});
|
|
2495
2496
|
|
|
2496
|
-
const UseTimestamp = /* @__PURE__ */
|
|
2497
|
+
const UseTimestamp = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2497
2498
|
name: "UseTimestamp",
|
|
2498
2499
|
props: ["immediate", "interval", "offset"],
|
|
2499
2500
|
setup(props, { slots }) {
|
|
@@ -2505,7 +2506,7 @@ const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2505
2506
|
}
|
|
2506
2507
|
});
|
|
2507
2508
|
|
|
2508
|
-
const UseVirtualList = /* @__PURE__ */
|
|
2509
|
+
const UseVirtualList = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2509
2510
|
name: "UseVirtualList",
|
|
2510
2511
|
props: [
|
|
2511
2512
|
"list",
|
|
@@ -2524,7 +2525,7 @@ const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2524
2525
|
}
|
|
2525
2526
|
});
|
|
2526
2527
|
|
|
2527
|
-
const UseWindowFocus = /* @__PURE__ */
|
|
2528
|
+
const UseWindowFocus = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2528
2529
|
name: "UseWindowFocus",
|
|
2529
2530
|
setup(props, { slots }) {
|
|
2530
2531
|
const data = reactive({
|
|
@@ -2537,7 +2538,7 @@ const UseWindowFocus = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
2537
2538
|
}
|
|
2538
2539
|
});
|
|
2539
2540
|
|
|
2540
|
-
const UseWindowSize = /* @__PURE__ */
|
|
2541
|
+
const UseWindowSize = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
2541
2542
|
name: "UseWindowSize",
|
|
2542
2543
|
props: ["initialWidth", "initialHeight"],
|
|
2543
2544
|
setup(props, { slots }) {
|
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.8.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/core": "12.8.0",
|
|
46
|
+
"@vueuse/shared": "12.8.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "rollup --config=rollup.config.ts --configPlugin=rollup-plugin-esbuild"
|