@vueuse/components 10.3.0 → 10.4.1

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, h, watch, computed, reactive, shallowRef, nextTick, getCurrentInstance, onMounted, watchEffect, 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 { toValue, isClient, noop, tryOnScopeDispose, isIOS, directiveHooks, pausableWatch, toRef, tryOnMounted, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn } from '@vueuse/shared';
3
+ import { toValue, isClient, noop, isObject, tryOnScopeDispose, isIOS, directiveHooks, pausableWatch, toRef, tryOnMounted, useToggle, notNullish, promiseTimeout, until, useDebounceFn, useThrottleFn } from '@vueuse/shared';
4
4
 
5
5
  const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
6
6
  name: "OnClickOutside",
@@ -58,9 +58,10 @@ function useEventListener(...args) {
58
58
  cleanup();
59
59
  if (!el)
60
60
  return;
61
+ const optionsClone = isObject(options2) ? { ...options2 } : options2;
61
62
  cleanups.push(
62
63
  ...events.flatMap((event) => {
63
- return listeners.map((listener) => register(el, event, listener, options2));
64
+ return listeners.map((listener) => register(el, event, listener, optionsClone));
64
65
  })
65
66
  );
66
67
  },
@@ -188,22 +189,6 @@ function onKeyStroke(...args) {
188
189
  return useEventListener(target, eventName, listener, passive);
189
190
  }
190
191
 
191
- var __defProp$e = Object.defineProperty;
192
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
193
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
194
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
195
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
196
- var __spreadValues$e = (a, b) => {
197
- for (var prop in b || (b = {}))
198
- if (__hasOwnProp$g.call(b, prop))
199
- __defNormalProp$e(a, prop, b[prop]);
200
- if (__getOwnPropSymbols$g)
201
- for (var prop of __getOwnPropSymbols$g(b)) {
202
- if (__propIsEnum$g.call(b, prop))
203
- __defNormalProp$e(a, prop, b[prop]);
204
- }
205
- return a;
206
- };
207
192
  const vOnKeyStroke = {
208
193
  [directiveHooks.mounted](el, binding) {
209
194
  var _a, _b;
@@ -214,9 +199,10 @@ const vOnKeyStroke = {
214
199
  });
215
200
  } else {
216
201
  const [handler, options] = binding.value;
217
- onKeyStroke(keys, handler, __spreadValues$e({
218
- target: el
219
- }, options));
202
+ onKeyStroke(keys, handler, {
203
+ target: el,
204
+ ...options
205
+ });
220
206
  }
221
207
  }
222
208
  };
@@ -334,22 +320,6 @@ function guessSerializerType(rawInit) {
334
320
  return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
335
321
  }
336
322
 
337
- var __defProp$d = Object.defineProperty;
338
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
339
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
340
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
341
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
342
- var __spreadValues$d = (a, b) => {
343
- for (var prop in b || (b = {}))
344
- if (__hasOwnProp$f.call(b, prop))
345
- __defNormalProp$d(a, prop, b[prop]);
346
- if (__getOwnPropSymbols$f)
347
- for (var prop of __getOwnPropSymbols$f(b)) {
348
- if (__propIsEnum$f.call(b, prop))
349
- __defNormalProp$d(a, prop, b[prop]);
350
- }
351
- return a;
352
- };
353
323
  const StorageSerializers = {
354
324
  boolean: {
355
325
  read: (v) => v === "true",
@@ -463,7 +433,7 @@ function useStorage(key, defaults, storage, options = {}) {
463
433
  if (typeof mergeDefaults === "function")
464
434
  return mergeDefaults(value, rawInit);
465
435
  else if (type === "object" && !Array.isArray(value))
466
- return __spreadValues$d(__spreadValues$d({}, rawInit), value);
436
+ return { ...rawInit, ...value };
467
437
  return value;
468
438
  } else if (typeof rawValue !== "string") {
469
439
  return rawValue;
@@ -485,7 +455,8 @@ function useStorage(key, defaults, storage, options = {}) {
485
455
  return;
486
456
  pauseWatch();
487
457
  try {
488
- data.value = read(event);
458
+ if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value))
459
+ data.value = read(event);
489
460
  } catch (e) {
490
461
  onError(e);
491
462
  } finally {
@@ -554,22 +525,6 @@ function usePreferredDark(options) {
554
525
  return useMediaQuery("(prefers-color-scheme: dark)", options);
555
526
  }
556
527
 
557
- var __defProp$c = Object.defineProperty;
558
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
559
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
560
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
561
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
562
- var __spreadValues$c = (a, b) => {
563
- for (var prop in b || (b = {}))
564
- if (__hasOwnProp$e.call(b, prop))
565
- __defNormalProp$c(a, prop, b[prop]);
566
- if (__getOwnPropSymbols$e)
567
- for (var prop of __getOwnPropSymbols$e(b)) {
568
- if (__propIsEnum$e.call(b, prop))
569
- __defNormalProp$c(a, prop, b[prop]);
570
- }
571
- return a;
572
- };
573
528
  function useColorMode(options = {}) {
574
529
  const {
575
530
  selector = "html",
@@ -583,11 +538,12 @@ function useColorMode(options = {}) {
583
538
  emitAuto,
584
539
  disableTransition = true
585
540
  } = options;
586
- const modes = __spreadValues$c({
541
+ const modes = {
587
542
  auto: "",
588
543
  light: "light",
589
- dark: "dark"
590
- }, options.modes || {});
544
+ dark: "dark",
545
+ ...options.modes || {}
546
+ };
591
547
  const preferredDark = usePreferredDark({ window });
592
548
  const system = computed(() => preferredDark.value ? "dark" : "light");
593
549
  const store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));
@@ -744,25 +700,6 @@ const UseDocumentVisibility = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
744
700
  }
745
701
  });
746
702
 
747
- var __defProp$b = Object.defineProperty;
748
- var __defProps$9 = Object.defineProperties;
749
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
750
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
751
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
752
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
753
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
754
- var __spreadValues$b = (a, b) => {
755
- for (var prop in b || (b = {}))
756
- if (__hasOwnProp$d.call(b, prop))
757
- __defNormalProp$b(a, prop, b[prop]);
758
- if (__getOwnPropSymbols$d)
759
- for (var prop of __getOwnPropSymbols$d(b)) {
760
- if (__propIsEnum$d.call(b, prop))
761
- __defNormalProp$b(a, prop, b[prop]);
762
- }
763
- return a;
764
- };
765
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
766
703
  const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
767
704
  name: "UseDraggable",
768
705
  props: [
@@ -800,11 +737,12 @@ const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
800
737
  storageValue.value.x = position.x;
801
738
  storageValue.value.y = position.y;
802
739
  };
803
- const data = reactive(useDraggable(target, __spreadProps$9(__spreadValues$b({}, props), {
740
+ const data = reactive(useDraggable(target, {
741
+ ...props,
804
742
  handle,
805
743
  initialValue,
806
744
  onEnd
807
- })));
745
+ }));
808
746
  return () => {
809
747
  if (slots.default)
810
748
  return h(props.as || "div", { ref: target, style: `touch-action:none;${data.style}` }, slots.default(data));
@@ -862,7 +800,7 @@ const vElementHover = {
862
800
 
863
801
  const UseElementSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
864
802
  name: "UseElementSize",
865
- props: ["width", "height", "box"],
803
+ props: ["width", "height", "box", "as"],
866
804
  setup(props, { slots }) {
867
805
  const target = ref();
868
806
  const data = reactive(useElementSize$1(target, { width: props.width, height: props.height }, { box: props.box }));
@@ -873,23 +811,8 @@ const UseElementSize = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
873
811
  }
874
812
  });
875
813
 
876
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
877
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
878
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
879
- var __objRest$1 = (source, exclude) => {
880
- var target = {};
881
- for (var prop in source)
882
- if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
883
- target[prop] = source[prop];
884
- if (source != null && __getOwnPropSymbols$c)
885
- for (var prop of __getOwnPropSymbols$c(source)) {
886
- if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
887
- target[prop] = source[prop];
888
- }
889
- return target;
890
- };
891
814
  function useResizeObserver(target, callback, options = {}) {
892
- const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$1(_a, ["window"]);
815
+ const { window = defaultWindow, ...observerOptions } = options;
893
816
  let observer;
894
817
  const isSupported = useSupported(() => window && "ResizeObserver" in window);
895
818
  const cleanup = () => {
@@ -1062,7 +985,8 @@ function useElementVisibility(element, { window = defaultWindow, scrollTarget }
1062
985
  },
1063
986
  {
1064
987
  root: scrollTarget,
1065
- window
988
+ window,
989
+ threshold: 0
1066
990
  }
1067
991
  );
1068
992
  return elementIsVisible;
@@ -1133,25 +1057,6 @@ const UseIdle = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1133
1057
  }
1134
1058
  });
1135
1059
 
1136
- var __defProp$a = Object.defineProperty;
1137
- var __defProps$8 = Object.defineProperties;
1138
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1139
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1140
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1141
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1142
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1143
- var __spreadValues$a = (a, b) => {
1144
- for (var prop in b || (b = {}))
1145
- if (__hasOwnProp$b.call(b, prop))
1146
- __defNormalProp$a(a, prop, b[prop]);
1147
- if (__getOwnPropSymbols$b)
1148
- for (var prop of __getOwnPropSymbols$b(b)) {
1149
- if (__propIsEnum$b.call(b, prop))
1150
- __defNormalProp$a(a, prop, b[prop]);
1151
- }
1152
- return a;
1153
- };
1154
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1155
1060
  function useAsyncState(promise, initialState, options) {
1156
1061
  const {
1157
1062
  immediate = true,
@@ -1204,29 +1109,14 @@ function useAsyncState(promise, initialState, options) {
1204
1109
  until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);
1205
1110
  });
1206
1111
  }
1207
- return __spreadProps$8(__spreadValues$a({}, shell), {
1112
+ return {
1113
+ ...shell,
1208
1114
  then(onFulfilled, onRejected) {
1209
1115
  return waitUntilIsLoaded().then(onFulfilled, onRejected);
1210
1116
  }
1211
- });
1117
+ };
1212
1118
  }
1213
1119
 
1214
- var __defProp$9 = Object.defineProperty;
1215
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1216
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1217
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1218
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1219
- var __spreadValues$9 = (a, b) => {
1220
- for (var prop in b || (b = {}))
1221
- if (__hasOwnProp$a.call(b, prop))
1222
- __defNormalProp$9(a, prop, b[prop]);
1223
- if (__getOwnPropSymbols$a)
1224
- for (var prop of __getOwnPropSymbols$a(b)) {
1225
- if (__propIsEnum$a.call(b, prop))
1226
- __defNormalProp$9(a, prop, b[prop]);
1227
- }
1228
- return a;
1229
- };
1230
1120
  async function loadImage(options) {
1231
1121
  return new Promise((resolve, reject) => {
1232
1122
  const img = new Image();
@@ -1252,9 +1142,10 @@ function useImage(options, asyncStateOptions = {}) {
1252
1142
  const state = useAsyncState(
1253
1143
  () => loadImage(toValue(options)),
1254
1144
  void 0,
1255
- __spreadValues$9({
1256
- resetOnExecute: true
1257
- }, asyncStateOptions)
1145
+ {
1146
+ resetOnExecute: true,
1147
+ ...asyncStateOptions
1148
+ }
1258
1149
  );
1259
1150
  watch(
1260
1151
  () => toValue(options),
@@ -1367,9 +1258,10 @@ function useScroll(element, options = {}) {
1367
1258
  };
1368
1259
  const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);
1369
1260
  const setArrivedState = (target) => {
1261
+ var _a;
1370
1262
  if (!window)
1371
1263
  return;
1372
- const el = target === window ? target.document.documentElement : target === window.document ? target.documentElement : target;
1264
+ const el = target.document ? target.document.documentElement : (_a = target.documentElement) != null ? _a : target;
1373
1265
  const { display, flexDirection } = getComputedStyle(el);
1374
1266
  const scrollLeft = el.scrollLeft;
1375
1267
  directions.left = scrollLeft < internalX.value;
@@ -1401,9 +1293,10 @@ function useScroll(element, options = {}) {
1401
1293
  internalY.value = scrollTop;
1402
1294
  };
1403
1295
  const onScrollHandler = (e) => {
1296
+ var _a;
1404
1297
  if (!window)
1405
1298
  return;
1406
- const eventTarget = e.target === window.document ? e.target.documentElement : e.target;
1299
+ const eventTarget = (_a = e.target.documentElement) != null ? _a : e.target;
1407
1300
  setArrivedState(eventTarget);
1408
1301
  isScrolling.value = true;
1409
1302
  onScrollEndDebounced(e);
@@ -1435,25 +1328,14 @@ function useScroll(element, options = {}) {
1435
1328
  };
1436
1329
  }
1437
1330
 
1438
- var __defProp$8 = Object.defineProperty;
1439
- var __defProps$7 = Object.defineProperties;
1440
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1441
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1442
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1443
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1444
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1445
- var __spreadValues$8 = (a, b) => {
1446
- for (var prop in b || (b = {}))
1447
- if (__hasOwnProp$9.call(b, prop))
1448
- __defNormalProp$8(a, prop, b[prop]);
1449
- if (__getOwnPropSymbols$9)
1450
- for (var prop of __getOwnPropSymbols$9(b)) {
1451
- if (__propIsEnum$9.call(b, prop))
1452
- __defNormalProp$8(a, prop, b[prop]);
1453
- }
1454
- return a;
1455
- };
1456
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1331
+ function resolveElement(el) {
1332
+ if (typeof Window !== "undefined" && el instanceof Window)
1333
+ return el.document.documentElement;
1334
+ if (typeof Document !== "undefined" && el instanceof Document)
1335
+ return el.documentElement;
1336
+ return el;
1337
+ }
1338
+
1457
1339
  function useInfiniteScroll(element, onLoadMore, options = {}) {
1458
1340
  var _a;
1459
1341
  const {
@@ -1462,21 +1344,18 @@ function useInfiniteScroll(element, onLoadMore, options = {}) {
1462
1344
  } = options;
1463
1345
  const state = reactive(useScroll(
1464
1346
  element,
1465
- __spreadProps$7(__spreadValues$8({}, options), {
1466
- offset: __spreadValues$8({
1467
- [direction]: (_a = options.distance) != null ? _a : 0
1468
- }, options.offset)
1469
- })
1347
+ {
1348
+ ...options,
1349
+ offset: {
1350
+ [direction]: (_a = options.distance) != null ? _a : 0,
1351
+ ...options.offset
1352
+ }
1353
+ }
1470
1354
  ));
1471
1355
  const promise = ref();
1472
1356
  const isLoading = computed(() => !!promise.value);
1473
1357
  const observedElement = computed(() => {
1474
- const el = toValue(element);
1475
- if (el instanceof Window)
1476
- return window.document.documentElement;
1477
- if (el instanceof Document)
1478
- return document.documentElement;
1479
- return el;
1358
+ return resolveElement(toValue(element));
1480
1359
  });
1481
1360
  const isElementVisible = useElementVisibility(observedElement);
1482
1361
  function checkAndLoad() {
@@ -1550,31 +1429,12 @@ const UseMouseInElement = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1550
1429
  }
1551
1430
  });
1552
1431
 
1553
- var __defProp$7 = Object.defineProperty;
1554
- var __defProps$6 = Object.defineProperties;
1555
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1556
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1557
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1558
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1559
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1560
- var __spreadValues$7 = (a, b) => {
1561
- for (var prop in b || (b = {}))
1562
- if (__hasOwnProp$8.call(b, prop))
1563
- __defNormalProp$7(a, prop, b[prop]);
1564
- if (__getOwnPropSymbols$8)
1565
- for (var prop of __getOwnPropSymbols$8(b)) {
1566
- if (__propIsEnum$8.call(b, prop))
1567
- __defNormalProp$7(a, prop, b[prop]);
1568
- }
1569
- return a;
1570
- };
1571
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1572
1432
  const UseMousePressed = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1573
1433
  name: "UseMousePressed",
1574
1434
  props: ["touch", "initialValue", "as"],
1575
1435
  setup(props, { slots }) {
1576
1436
  const target = ref();
1577
- const data = reactive(useMousePressed(__spreadProps$6(__spreadValues$7({}, props), { target })));
1437
+ const data = reactive(useMousePressed({ ...props, target }));
1578
1438
  return () => {
1579
1439
  if (slots.default)
1580
1440
  return h(props.as || "div", { ref: target }, slots.default(data));
@@ -1593,30 +1453,11 @@ const UseNetwork = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1593
1453
  }
1594
1454
  });
1595
1455
 
1596
- var __defProp$6 = Object.defineProperty;
1597
- var __defProps$5 = Object.defineProperties;
1598
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1599
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1600
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1601
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1602
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1603
- var __spreadValues$6 = (a, b) => {
1604
- for (var prop in b || (b = {}))
1605
- if (__hasOwnProp$7.call(b, prop))
1606
- __defNormalProp$6(a, prop, b[prop]);
1607
- if (__getOwnPropSymbols$7)
1608
- for (var prop of __getOwnPropSymbols$7(b)) {
1609
- if (__propIsEnum$7.call(b, prop))
1610
- __defNormalProp$6(a, prop, b[prop]);
1611
- }
1612
- return a;
1613
- };
1614
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1615
1456
  const UseNow = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1616
1457
  name: "UseNow",
1617
1458
  props: ["interval"],
1618
1459
  setup(props, { slots }) {
1619
- const data = reactive(useNow(__spreadProps$5(__spreadValues$6({}, props), { controls: true })));
1460
+ const data = reactive(useNow({ ...props, controls: true }));
1620
1461
  return () => {
1621
1462
  if (slots.default)
1622
1463
  return slots.default(data);
@@ -1639,25 +1480,6 @@ const UseObjectUrl = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1639
1480
  }
1640
1481
  });
1641
1482
 
1642
- var __defProp$5 = Object.defineProperty;
1643
- var __defProps$4 = Object.defineProperties;
1644
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1645
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1646
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1647
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1648
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1649
- var __spreadValues$5 = (a, b) => {
1650
- for (var prop in b || (b = {}))
1651
- if (__hasOwnProp$6.call(b, prop))
1652
- __defNormalProp$5(a, prop, b[prop]);
1653
- if (__getOwnPropSymbols$6)
1654
- for (var prop of __getOwnPropSymbols$6(b)) {
1655
- if (__propIsEnum$6.call(b, prop))
1656
- __defNormalProp$5(a, prop, b[prop]);
1657
- }
1658
- return a;
1659
- };
1660
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1661
1483
  const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1662
1484
  name: "UseOffsetPagination",
1663
1485
  props: [
@@ -1674,7 +1496,8 @@ const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1674
1496
  "page-count-change"
1675
1497
  ],
1676
1498
  setup(props, { slots, emit }) {
1677
- const data = reactive(useOffsetPagination(__spreadProps$4(__spreadValues$5({}, props), {
1499
+ const data = reactive(useOffsetPagination({
1500
+ ...props,
1678
1501
  onPageChange(...args) {
1679
1502
  var _a;
1680
1503
  (_a = props.onPageChange) == null ? void 0 : _a.call(props, ...args);
@@ -1690,7 +1513,7 @@ const UseOffsetPagination = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1690
1513
  (_a = props.onPageCountChange) == null ? void 0 : _a.call(props, ...args);
1691
1514
  emit("page-count-change", ...args);
1692
1515
  }
1693
- })));
1516
+ }));
1694
1517
  return () => {
1695
1518
  if (slots.default)
1696
1519
  return slots.default(data);
@@ -1724,25 +1547,6 @@ const UsePageLeave = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1724
1547
  }
1725
1548
  });
1726
1549
 
1727
- var __defProp$4 = Object.defineProperty;
1728
- var __defProps$3 = Object.defineProperties;
1729
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1730
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1731
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1732
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1733
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1734
- var __spreadValues$4 = (a, b) => {
1735
- for (var prop in b || (b = {}))
1736
- if (__hasOwnProp$5.call(b, prop))
1737
- __defNormalProp$4(a, prop, b[prop]);
1738
- if (__getOwnPropSymbols$5)
1739
- for (var prop of __getOwnPropSymbols$5(b)) {
1740
- if (__propIsEnum$5.call(b, prop))
1741
- __defNormalProp$4(a, prop, b[prop]);
1742
- }
1743
- return a;
1744
- };
1745
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1746
1550
  const UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1747
1551
  name: "UsePointer",
1748
1552
  props: [
@@ -1752,9 +1556,10 @@ const UsePointer = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1752
1556
  ],
1753
1557
  setup(props, { slots }) {
1754
1558
  const el = ref(null);
1755
- const data = reactive(usePointer(__spreadProps$3(__spreadValues$4({}, props), {
1559
+ const data = reactive(usePointer({
1560
+ ...props,
1756
1561
  target: props.target === "self" ? el : defaultWindow
1757
- })));
1562
+ }));
1758
1563
  return () => {
1759
1564
  if (slots.default)
1760
1565
  return slots.default(data, { ref: el });
@@ -1840,23 +1645,8 @@ const UsePreferredReducedMotion = /* @__PURE__ */ /* #__PURE__ */ defineComponen
1840
1645
  }
1841
1646
  });
1842
1647
 
1843
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1844
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1845
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1846
- var __objRest = (source, exclude) => {
1847
- var target = {};
1848
- for (var prop in source)
1849
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1850
- target[prop] = source[prop];
1851
- if (source != null && __getOwnPropSymbols$4)
1852
- for (var prop of __getOwnPropSymbols$4(source)) {
1853
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1854
- target[prop] = source[prop];
1855
- }
1856
- return target;
1857
- };
1858
1648
  function useMutationObserver(target, callback, options = {}) {
1859
- const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest(_a, ["window"]);
1649
+ const { window = defaultWindow, ...mutationOptions } = options;
1860
1650
  let observer;
1861
1651
  const isSupported = useSupported(() => window && "MutationObserver" in window);
1862
1652
  const cleanup = () => {
@@ -1998,25 +1788,6 @@ const UseScreenSafeArea = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
1998
1788
  }
1999
1789
  });
2000
1790
 
2001
- var __defProp$3 = Object.defineProperty;
2002
- var __defProps$2 = Object.defineProperties;
2003
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2004
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
2005
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
2006
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
2007
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2008
- var __spreadValues$3 = (a, b) => {
2009
- for (var prop in b || (b = {}))
2010
- if (__hasOwnProp$3.call(b, prop))
2011
- __defNormalProp$3(a, prop, b[prop]);
2012
- if (__getOwnPropSymbols$3)
2013
- for (var prop of __getOwnPropSymbols$3(b)) {
2014
- if (__propIsEnum$3.call(b, prop))
2015
- __defNormalProp$3(a, prop, b[prop]);
2016
- }
2017
- return a;
2018
- };
2019
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
2020
1791
  const vScroll = {
2021
1792
  [directiveHooks.mounted](el, binding) {
2022
1793
  if (typeof binding.value === "function") {
@@ -2031,7 +1802,8 @@ const vScroll = {
2031
1802
  });
2032
1803
  } else {
2033
1804
  const [handler, options] = binding.value;
2034
- const state = useScroll(el, __spreadProps$2(__spreadValues$3({}, options), {
1805
+ const state = useScroll(el, {
1806
+ ...options,
2035
1807
  onScroll(e) {
2036
1808
  var _a;
2037
1809
  (_a = options.onScroll) == null ? void 0 : _a.call(options, e);
@@ -2042,7 +1814,7 @@ const vScroll = {
2042
1814
  (_a = options.onStop) == null ? void 0 : _a.call(options, e);
2043
1815
  handler(state);
2044
1816
  }
2045
- }));
1817
+ });
2046
1818
  }
2047
1819
  }
2048
1820
  };
@@ -2074,8 +1846,9 @@ function useScrollLock(element, initialState = false) {
2074
1846
  let stopTouchMoveListener = null;
2075
1847
  let initialOverflow;
2076
1848
  watch(toRef(element), (el) => {
2077
- if (el) {
2078
- const ele = el;
1849
+ const target = resolveElement(toValue(el));
1850
+ if (target) {
1851
+ const ele = target;
2079
1852
  initialOverflow = ele.style.overflow;
2080
1853
  if (isLocked.value)
2081
1854
  ele.style.overflow = "hidden";
@@ -2084,12 +1857,12 @@ function useScrollLock(element, initialState = false) {
2084
1857
  immediate: true
2085
1858
  });
2086
1859
  const lock = () => {
2087
- const ele = toValue(element);
2088
- if (!ele || isLocked.value)
1860
+ const el = resolveElement(toValue(element));
1861
+ if (!el || isLocked.value)
2089
1862
  return;
2090
1863
  if (isIOS) {
2091
1864
  stopTouchMoveListener = useEventListener(
2092
- ele,
1865
+ el,
2093
1866
  "touchmove",
2094
1867
  (e) => {
2095
1868
  preventDefault(e);
@@ -2097,15 +1870,15 @@ function useScrollLock(element, initialState = false) {
2097
1870
  { passive: false }
2098
1871
  );
2099
1872
  }
2100
- ele.style.overflow = "hidden";
1873
+ el.style.overflow = "hidden";
2101
1874
  isLocked.value = true;
2102
1875
  };
2103
1876
  const unlock = () => {
2104
- const ele = toValue(element);
2105
- if (!ele || !isLocked.value)
1877
+ const el = resolveElement(toValue(element));
1878
+ if (!el || !isLocked.value)
2106
1879
  return;
2107
1880
  isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());
2108
- ele.style.overflow = initialOverflow;
1881
+ el.style.overflow = initialOverflow;
2109
1882
  isLocked.value = false;
2110
1883
  };
2111
1884
  tryOnScopeDispose(unlock);
@@ -2136,30 +1909,11 @@ function onScrollLock() {
2136
1909
  }
2137
1910
  const vScrollLock = onScrollLock();
2138
1911
 
2139
- var __defProp$2 = Object.defineProperty;
2140
- var __defProps$1 = Object.defineProperties;
2141
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2142
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
2143
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
2144
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
2145
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2146
- var __spreadValues$2 = (a, b) => {
2147
- for (var prop in b || (b = {}))
2148
- if (__hasOwnProp$2.call(b, prop))
2149
- __defNormalProp$2(a, prop, b[prop]);
2150
- if (__getOwnPropSymbols$2)
2151
- for (var prop of __getOwnPropSymbols$2(b)) {
2152
- if (__propIsEnum$2.call(b, prop))
2153
- __defNormalProp$2(a, prop, b[prop]);
2154
- }
2155
- return a;
2156
- };
2157
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2158
1912
  const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2159
1913
  name: "UseTimeAgo",
2160
1914
  props: ["time", "updateInterval", "max", "fullDateFormatter", "messages", "showSecond"],
2161
1915
  setup(props, { slots }) {
2162
- const data = reactive(useTimeAgo(() => props.time, __spreadProps$1(__spreadValues$2({}, props), { controls: true })));
1916
+ const data = reactive(useTimeAgo(() => props.time, { ...props, controls: true }));
2163
1917
  return () => {
2164
1918
  if (slots.default)
2165
1919
  return slots.default(data);
@@ -2167,30 +1921,11 @@ const UseTimeAgo = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2167
1921
  }
2168
1922
  });
2169
1923
 
2170
- var __defProp$1 = Object.defineProperty;
2171
- var __defProps = Object.defineProperties;
2172
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2173
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2174
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2175
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2176
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2177
- var __spreadValues$1 = (a, b) => {
2178
- for (var prop in b || (b = {}))
2179
- if (__hasOwnProp$1.call(b, prop))
2180
- __defNormalProp$1(a, prop, b[prop]);
2181
- if (__getOwnPropSymbols$1)
2182
- for (var prop of __getOwnPropSymbols$1(b)) {
2183
- if (__propIsEnum$1.call(b, prop))
2184
- __defNormalProp$1(a, prop, b[prop]);
2185
- }
2186
- return a;
2187
- };
2188
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2189
1924
  const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2190
1925
  name: "UseTimestamp",
2191
1926
  props: ["immediate", "interval", "offset"],
2192
1927
  setup(props, { slots }) {
2193
- const data = reactive(useTimestamp(__spreadProps(__spreadValues$1({}, props), { controls: true })));
1928
+ const data = reactive(useTimestamp({ ...props, controls: true }));
2194
1929
  return () => {
2195
1930
  if (slots.default)
2196
1931
  return slots.default(data);
@@ -2198,22 +1933,6 @@ const UseTimestamp = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2198
1933
  }
2199
1934
  });
2200
1935
 
2201
- var __defProp = Object.defineProperty;
2202
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2203
- var __hasOwnProp = Object.prototype.hasOwnProperty;
2204
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
2205
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2206
- var __spreadValues = (a, b) => {
2207
- for (var prop in b || (b = {}))
2208
- if (__hasOwnProp.call(b, prop))
2209
- __defNormalProp(a, prop, b[prop]);
2210
- if (__getOwnPropSymbols)
2211
- for (var prop of __getOwnPropSymbols(b)) {
2212
- if (__propIsEnum.call(b, prop))
2213
- __defNormalProp(a, prop, b[prop]);
2214
- }
2215
- return a;
2216
- };
2217
1936
  const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2218
1937
  name: "UseVirtualList",
2219
1938
  props: [
@@ -2228,11 +1947,11 @@ const UseVirtualList = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
2228
1947
  typeof containerProps.style === "object" && !Array.isArray(containerProps.style) && (containerProps.style.height = props.height || "300px");
2229
1948
  return () => h(
2230
1949
  "div",
2231
- __spreadValues({}, containerProps),
1950
+ { ...containerProps },
2232
1951
  [
2233
1952
  h(
2234
1953
  "div",
2235
- __spreadValues({}, wrapperProps.value),
1954
+ { ...wrapperProps.value },
2236
1955
  list.value.map((item) => h(
2237
1956
  "div",
2238
1957
  { style: { overFlow: "hidden", height: item.height } },