@vueuse/components 10.0.1 → 10.1.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.iife.js CHANGED
@@ -112,7 +112,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
112
112
  this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
113
113
  );
114
114
  ;
115
- ;(function (exports, vueDemi, core, shared, reactivity) {
115
+ ;(function (exports, vueDemi, core, shared) {
116
116
  'use strict';
117
117
 
118
118
  const OnClickOutside = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
@@ -298,19 +298,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
298
298
  return useEventListener(target, eventName, listener, passive);
299
299
  }
300
300
 
301
- var __defProp$d = Object.defineProperty;
302
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
303
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
304
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
305
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
306
- var __spreadValues$d = (a, b) => {
301
+ var __defProp$e = Object.defineProperty;
302
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
303
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
304
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
305
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
306
+ var __spreadValues$e = (a, b) => {
307
307
  for (var prop in b || (b = {}))
308
- if (__hasOwnProp$e.call(b, prop))
309
- __defNormalProp$d(a, prop, b[prop]);
310
- if (__getOwnPropSymbols$e)
311
- for (var prop of __getOwnPropSymbols$e(b)) {
312
- if (__propIsEnum$e.call(b, prop))
313
- __defNormalProp$d(a, prop, b[prop]);
308
+ if (__hasOwnProp$g.call(b, prop))
309
+ __defNormalProp$e(a, prop, b[prop]);
310
+ if (__getOwnPropSymbols$g)
311
+ for (var prop of __getOwnPropSymbols$g(b)) {
312
+ if (__propIsEnum$g.call(b, prop))
313
+ __defNormalProp$e(a, prop, b[prop]);
314
314
  }
315
315
  return a;
316
316
  };
@@ -324,7 +324,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
324
324
  });
325
325
  } else {
326
326
  const [handler, options] = binding.value;
327
- onKeyStroke(keys, handler, __spreadValues$d({
327
+ onKeyStroke(keys, handler, __spreadValues$e({
328
328
  target: el
329
329
  }, options));
330
330
  }
@@ -445,19 +445,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
445
445
  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";
446
446
  }
447
447
 
448
- var __defProp$c = Object.defineProperty;
449
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
450
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
451
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
452
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
453
- var __spreadValues$c = (a, b) => {
448
+ var __defProp$d = Object.defineProperty;
449
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
450
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
451
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
452
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
453
+ var __spreadValues$d = (a, b) => {
454
454
  for (var prop in b || (b = {}))
455
- if (__hasOwnProp$d.call(b, prop))
456
- __defNormalProp$c(a, prop, b[prop]);
457
- if (__getOwnPropSymbols$d)
458
- for (var prop of __getOwnPropSymbols$d(b)) {
459
- if (__propIsEnum$d.call(b, prop))
460
- __defNormalProp$c(a, prop, b[prop]);
455
+ if (__hasOwnProp$f.call(b, prop))
456
+ __defNormalProp$d(a, prop, b[prop]);
457
+ if (__getOwnPropSymbols$f)
458
+ for (var prop of __getOwnPropSymbols$f(b)) {
459
+ if (__propIsEnum$f.call(b, prop))
460
+ __defNormalProp$d(a, prop, b[prop]);
461
461
  }
462
462
  return a;
463
463
  };
@@ -574,7 +574,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
574
574
  if (typeof mergeDefaults === "function")
575
575
  return mergeDefaults(value, rawInit);
576
576
  else if (type === "object" && !Array.isArray(value))
577
- return __spreadValues$c(__spreadValues$c({}, rawInit), value);
577
+ return __spreadValues$d(__spreadValues$d({}, rawInit), value);
578
578
  return value;
579
579
  } else if (typeof rawValue !== "string") {
580
580
  return rawValue;
@@ -661,19 +661,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
661
661
  return useMediaQuery("(prefers-color-scheme: dark)", options);
662
662
  }
663
663
 
664
- var __defProp$b = Object.defineProperty;
665
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
666
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
667
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
668
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
669
- var __spreadValues$b = (a, b) => {
664
+ var __defProp$c = Object.defineProperty;
665
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
666
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
667
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
668
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
669
+ var __spreadValues$c = (a, b) => {
670
670
  for (var prop in b || (b = {}))
671
- if (__hasOwnProp$c.call(b, prop))
672
- __defNormalProp$b(a, prop, b[prop]);
673
- if (__getOwnPropSymbols$c)
674
- for (var prop of __getOwnPropSymbols$c(b)) {
675
- if (__propIsEnum$c.call(b, prop))
676
- __defNormalProp$b(a, prop, b[prop]);
671
+ if (__hasOwnProp$e.call(b, prop))
672
+ __defNormalProp$c(a, prop, b[prop]);
673
+ if (__getOwnPropSymbols$e)
674
+ for (var prop of __getOwnPropSymbols$e(b)) {
675
+ if (__propIsEnum$e.call(b, prop))
676
+ __defNormalProp$c(a, prop, b[prop]);
677
677
  }
678
678
  return a;
679
679
  };
@@ -690,26 +690,21 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
690
690
  emitAuto,
691
691
  disableTransition = true
692
692
  } = options;
693
- const modes = __spreadValues$b({
693
+ const modes = __spreadValues$c({
694
694
  auto: "",
695
695
  light: "light",
696
696
  dark: "dark"
697
697
  }, options.modes || {});
698
698
  const preferredDark = usePreferredDark({ window });
699
699
  const system = vueDemi.computed(() => preferredDark.value ? "dark" : "light");
700
- const store = storageRef || (storageKey == null ? vueDemi.ref(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));
701
- const state = vueDemi.computed({
702
- get() {
703
- return store.value === "auto" && !emitAuto ? system.value : store.value;
704
- },
705
- set(v) {
706
- store.value = v;
707
- }
708
- });
700
+ const store = storageRef || (storageKey == null ? shared.toRef(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));
701
+ const state = vueDemi.computed(
702
+ () => store.value === "auto" ? system.value : store.value
703
+ );
709
704
  const updateHTMLAttrs = getSSRHandler(
710
705
  "updateHTMLAttrs",
711
706
  (selector2, attribute2, value) => {
712
- const el = typeof selector2 === "string" ? window == null ? void 0 : window.document.querySelector(selector2) : shared.toValue(selector2);
707
+ const el = typeof selector2 === "string" ? window == null ? void 0 : window.document.querySelector(selector2) : unrefElement(selector2);
713
708
  if (!el)
714
709
  return;
715
710
  let style;
@@ -737,8 +732,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
737
732
  );
738
733
  function defaultOnChanged(mode) {
739
734
  var _a;
740
- const resolvedMode = mode === "auto" ? system.value : mode;
741
- updateHTMLAttrs(selector, attribute, (_a = modes[resolvedMode]) != null ? _a : resolvedMode);
735
+ updateHTMLAttrs(selector, attribute, (_a = modes[mode]) != null ? _a : mode);
742
736
  }
743
737
  function onChanged(mode) {
744
738
  if (options.onChanged)
@@ -747,13 +741,19 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
747
741
  defaultOnChanged(mode);
748
742
  }
749
743
  vueDemi.watch(state, onChanged, { flush: "post", immediate: true });
750
- if (emitAuto)
751
- vueDemi.watch(system, () => onChanged(state.value), { flush: "post" });
752
744
  shared.tryOnMounted(() => onChanged(state.value));
745
+ const auto = vueDemi.computed({
746
+ get() {
747
+ return emitAuto ? store.value : state.value;
748
+ },
749
+ set(v) {
750
+ store.value = v;
751
+ }
752
+ });
753
753
  try {
754
- return Object.assign(state, { store, system });
754
+ return Object.assign(auto, { store, system, state });
755
755
  } catch (e) {
756
- return state;
756
+ return auto;
757
757
  }
758
758
  }
759
759
 
@@ -850,25 +850,25 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
850
850
  }
851
851
  });
852
852
 
853
- var __defProp$a = Object.defineProperty;
854
- var __defProps$8 = Object.defineProperties;
855
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
856
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
857
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
858
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
859
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
860
- var __spreadValues$a = (a, b) => {
853
+ var __defProp$b = Object.defineProperty;
854
+ var __defProps$9 = Object.defineProperties;
855
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
856
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
857
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
858
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
859
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
860
+ var __spreadValues$b = (a, b) => {
861
861
  for (var prop in b || (b = {}))
862
- if (__hasOwnProp$b.call(b, prop))
863
- __defNormalProp$a(a, prop, b[prop]);
864
- if (__getOwnPropSymbols$b)
865
- for (var prop of __getOwnPropSymbols$b(b)) {
866
- if (__propIsEnum$b.call(b, prop))
867
- __defNormalProp$a(a, prop, b[prop]);
862
+ if (__hasOwnProp$d.call(b, prop))
863
+ __defNormalProp$b(a, prop, b[prop]);
864
+ if (__getOwnPropSymbols$d)
865
+ for (var prop of __getOwnPropSymbols$d(b)) {
866
+ if (__propIsEnum$d.call(b, prop))
867
+ __defNormalProp$b(a, prop, b[prop]);
868
868
  }
869
869
  return a;
870
870
  };
871
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
871
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
872
872
  const UseDraggable = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
873
873
  name: "UseDraggable",
874
874
  props: [
@@ -901,7 +901,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
901
901
  storageValue.value.x = position.x;
902
902
  storageValue.value.y = position.y;
903
903
  };
904
- const data = vueDemi.reactive(core.useDraggable(target, __spreadProps$8(__spreadValues$a({}, props), {
904
+ const data = vueDemi.reactive(core.useDraggable(target, __spreadProps$9(__spreadValues$b({}, props), {
905
905
  handle,
906
906
  initialValue,
907
907
  onEnd
@@ -974,23 +974,23 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
974
974
  }
975
975
  });
976
976
 
977
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
978
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
979
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
980
- var __objRest = (source, exclude) => {
977
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
978
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
979
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
980
+ var __objRest$1 = (source, exclude) => {
981
981
  var target = {};
982
982
  for (var prop in source)
983
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
983
+ if (__hasOwnProp$c.call(source, prop) && exclude.indexOf(prop) < 0)
984
984
  target[prop] = source[prop];
985
- if (source != null && __getOwnPropSymbols$a)
986
- for (var prop of __getOwnPropSymbols$a(source)) {
987
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
985
+ if (source != null && __getOwnPropSymbols$c)
986
+ for (var prop of __getOwnPropSymbols$c(source)) {
987
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$c.call(source, prop))
988
988
  target[prop] = source[prop];
989
989
  }
990
990
  return target;
991
991
  };
992
992
  function useResizeObserver(target, callback, options = {}) {
993
- const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest(_a, ["window"]);
993
+ const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$1(_a, ["window"]);
994
994
  let observer;
995
995
  const isSupported = useSupported(() => window && "ResizeObserver" in window);
996
996
  const cleanup = () => {
@@ -1104,7 +1104,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1104
1104
  immediate = true
1105
1105
  } = options;
1106
1106
  const isSupported = useSupported(() => window && "IntersectionObserver" in window);
1107
- const targets = reactivity.computed(() => {
1107
+ const targets = vueDemi.computed(() => {
1108
1108
  const _target = shared.toValue(target);
1109
1109
  return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(shared.notNullish);
1110
1110
  });
@@ -1234,6 +1234,25 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1234
1234
  }
1235
1235
  });
1236
1236
 
1237
+ var __defProp$a = Object.defineProperty;
1238
+ var __defProps$8 = Object.defineProperties;
1239
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1240
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1241
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1242
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1243
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1244
+ var __spreadValues$a = (a, b) => {
1245
+ for (var prop in b || (b = {}))
1246
+ if (__hasOwnProp$b.call(b, prop))
1247
+ __defNormalProp$a(a, prop, b[prop]);
1248
+ if (__getOwnPropSymbols$b)
1249
+ for (var prop of __getOwnPropSymbols$b(b)) {
1250
+ if (__propIsEnum$b.call(b, prop))
1251
+ __defNormalProp$a(a, prop, b[prop]);
1252
+ }
1253
+ return a;
1254
+ };
1255
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1237
1256
  function useAsyncState(promise, initialState, options) {
1238
1257
  const {
1239
1258
  immediate = true,
@@ -1274,27 +1293,37 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1274
1293
  }
1275
1294
  if (immediate)
1276
1295
  execute(delay);
1277
- return {
1296
+ const shell = {
1278
1297
  state,
1279
1298
  isReady,
1280
1299
  isLoading,
1281
1300
  error,
1282
1301
  execute
1283
1302
  };
1303
+ function waitUntilIsLoaded() {
1304
+ return new Promise((resolve, reject) => {
1305
+ shared.until(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);
1306
+ });
1307
+ }
1308
+ return __spreadProps$8(__spreadValues$a({}, shell), {
1309
+ then(onFulfilled, onRejected) {
1310
+ return waitUntilIsLoaded().then(onFulfilled, onRejected);
1311
+ }
1312
+ });
1284
1313
  }
1285
1314
 
1286
1315
  var __defProp$9 = Object.defineProperty;
1287
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1288
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1289
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1316
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1317
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1318
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1290
1319
  var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1291
1320
  var __spreadValues$9 = (a, b) => {
1292
1321
  for (var prop in b || (b = {}))
1293
- if (__hasOwnProp$9.call(b, prop))
1322
+ if (__hasOwnProp$a.call(b, prop))
1294
1323
  __defNormalProp$9(a, prop, b[prop]);
1295
- if (__getOwnPropSymbols$9)
1296
- for (var prop of __getOwnPropSymbols$9(b)) {
1297
- if (__propIsEnum$9.call(b, prop))
1324
+ if (__getOwnPropSymbols$a)
1325
+ for (var prop of __getOwnPropSymbols$a(b)) {
1326
+ if (__propIsEnum$a.call(b, prop))
1298
1327
  __defNormalProp$9(a, prop, b[prop]);
1299
1328
  }
1300
1329
  return a;
@@ -1481,17 +1510,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1481
1510
  var __defProp$8 = Object.defineProperty;
1482
1511
  var __defProps$7 = Object.defineProperties;
1483
1512
  var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1484
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1485
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1486
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1513
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1514
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1515
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1487
1516
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1488
1517
  var __spreadValues$8 = (a, b) => {
1489
1518
  for (var prop in b || (b = {}))
1490
- if (__hasOwnProp$8.call(b, prop))
1519
+ if (__hasOwnProp$9.call(b, prop))
1491
1520
  __defNormalProp$8(a, prop, b[prop]);
1492
- if (__getOwnPropSymbols$8)
1493
- for (var prop of __getOwnPropSymbols$8(b)) {
1494
- if (__propIsEnum$8.call(b, prop))
1521
+ if (__getOwnPropSymbols$9)
1522
+ for (var prop of __getOwnPropSymbols$9(b)) {
1523
+ if (__propIsEnum$9.call(b, prop))
1495
1524
  __defNormalProp$8(a, prop, b[prop]);
1496
1525
  }
1497
1526
  return a;
@@ -1586,17 +1615,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1586
1615
  var __defProp$7 = Object.defineProperty;
1587
1616
  var __defProps$6 = Object.defineProperties;
1588
1617
  var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1589
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1590
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1591
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1618
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1619
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1620
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1592
1621
  var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1593
1622
  var __spreadValues$7 = (a, b) => {
1594
1623
  for (var prop in b || (b = {}))
1595
- if (__hasOwnProp$7.call(b, prop))
1624
+ if (__hasOwnProp$8.call(b, prop))
1596
1625
  __defNormalProp$7(a, prop, b[prop]);
1597
- if (__getOwnPropSymbols$7)
1598
- for (var prop of __getOwnPropSymbols$7(b)) {
1599
- if (__propIsEnum$7.call(b, prop))
1626
+ if (__getOwnPropSymbols$8)
1627
+ for (var prop of __getOwnPropSymbols$8(b)) {
1628
+ if (__propIsEnum$8.call(b, prop))
1600
1629
  __defNormalProp$7(a, prop, b[prop]);
1601
1630
  }
1602
1631
  return a;
@@ -1629,17 +1658,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1629
1658
  var __defProp$6 = Object.defineProperty;
1630
1659
  var __defProps$5 = Object.defineProperties;
1631
1660
  var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1632
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1633
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1634
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1661
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1662
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1663
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1635
1664
  var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1636
1665
  var __spreadValues$6 = (a, b) => {
1637
1666
  for (var prop in b || (b = {}))
1638
- if (__hasOwnProp$6.call(b, prop))
1667
+ if (__hasOwnProp$7.call(b, prop))
1639
1668
  __defNormalProp$6(a, prop, b[prop]);
1640
- if (__getOwnPropSymbols$6)
1641
- for (var prop of __getOwnPropSymbols$6(b)) {
1642
- if (__propIsEnum$6.call(b, prop))
1669
+ if (__getOwnPropSymbols$7)
1670
+ for (var prop of __getOwnPropSymbols$7(b)) {
1671
+ if (__propIsEnum$7.call(b, prop))
1643
1672
  __defNormalProp$6(a, prop, b[prop]);
1644
1673
  }
1645
1674
  return a;
@@ -1675,17 +1704,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1675
1704
  var __defProp$5 = Object.defineProperty;
1676
1705
  var __defProps$4 = Object.defineProperties;
1677
1706
  var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1678
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1679
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1680
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1707
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1708
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1709
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1681
1710
  var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1682
1711
  var __spreadValues$5 = (a, b) => {
1683
1712
  for (var prop in b || (b = {}))
1684
- if (__hasOwnProp$5.call(b, prop))
1713
+ if (__hasOwnProp$6.call(b, prop))
1685
1714
  __defNormalProp$5(a, prop, b[prop]);
1686
- if (__getOwnPropSymbols$5)
1687
- for (var prop of __getOwnPropSymbols$5(b)) {
1688
- if (__propIsEnum$5.call(b, prop))
1715
+ if (__getOwnPropSymbols$6)
1716
+ for (var prop of __getOwnPropSymbols$6(b)) {
1717
+ if (__propIsEnum$6.call(b, prop))
1689
1718
  __defNormalProp$5(a, prop, b[prop]);
1690
1719
  }
1691
1720
  return a;
@@ -1760,17 +1789,17 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1760
1789
  var __defProp$4 = Object.defineProperty;
1761
1790
  var __defProps$3 = Object.defineProperties;
1762
1791
  var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1763
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1764
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1765
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1792
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1793
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1794
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1766
1795
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1767
1796
  var __spreadValues$4 = (a, b) => {
1768
1797
  for (var prop in b || (b = {}))
1769
- if (__hasOwnProp$4.call(b, prop))
1798
+ if (__hasOwnProp$5.call(b, prop))
1770
1799
  __defNormalProp$4(a, prop, b[prop]);
1771
- if (__getOwnPropSymbols$4)
1772
- for (var prop of __getOwnPropSymbols$4(b)) {
1773
- if (__propIsEnum$4.call(b, prop))
1800
+ if (__getOwnPropSymbols$5)
1801
+ for (var prop of __getOwnPropSymbols$5(b)) {
1802
+ if (__propIsEnum$5.call(b, prop))
1774
1803
  __defNormalProp$4(a, prop, b[prop]);
1775
1804
  }
1776
1805
  return a;
@@ -1873,6 +1902,53 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1873
1902
  }
1874
1903
  });
1875
1904
 
1905
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1906
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1907
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1908
+ var __objRest = (source, exclude) => {
1909
+ var target = {};
1910
+ for (var prop in source)
1911
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1912
+ target[prop] = source[prop];
1913
+ if (source != null && __getOwnPropSymbols$4)
1914
+ for (var prop of __getOwnPropSymbols$4(source)) {
1915
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1916
+ target[prop] = source[prop];
1917
+ }
1918
+ return target;
1919
+ };
1920
+ function useMutationObserver(target, callback, options = {}) {
1921
+ const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest(_a, ["window"]);
1922
+ let observer;
1923
+ const isSupported = useSupported(() => window && "MutationObserver" in window);
1924
+ const cleanup = () => {
1925
+ if (observer) {
1926
+ observer.disconnect();
1927
+ observer = void 0;
1928
+ }
1929
+ };
1930
+ const stopWatch = vueDemi.watch(
1931
+ () => unrefElement(target),
1932
+ (el) => {
1933
+ cleanup();
1934
+ if (isSupported.value && window && el) {
1935
+ observer = new MutationObserver(callback);
1936
+ observer.observe(el, mutationOptions);
1937
+ }
1938
+ },
1939
+ { immediate: true }
1940
+ );
1941
+ const stop = () => {
1942
+ cleanup();
1943
+ stopWatch();
1944
+ };
1945
+ shared.tryOnScopeDispose(stop);
1946
+ return {
1947
+ isSupported,
1948
+ stop
1949
+ };
1950
+ }
1951
+
1876
1952
  function useCssVar(prop, target, options = {}) {
1877
1953
  const { window = defaultWindow, initialValue = "", observe = false } = options;
1878
1954
  const variable = vueDemi.ref(initialValue);
@@ -1890,7 +1966,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
1890
1966
  }
1891
1967
  }
1892
1968
  if (observe) {
1893
- core.useMutationObserver(elRef, updateCssVar, {
1969
+ useMutationObserver(elRef, updateCssVar, {
1894
1970
  attributes: true,
1895
1971
  window
1896
1972
  });
@@ -2311,4 +2387,4 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
2311
2387
  exports.vScroll = vScroll;
2312
2388
  exports.vScrollLock = vScrollLock;
2313
2389
 
2314
- })(this.VueUse = this.VueUse || {}, VueDemi, VueUse, VueUse, reactivity);
2390
+ })(this.VueUse = this.VueUse || {}, VueDemi, VueUse, VueUse);