@vueuse/integrations 12.2.0 → 12.4.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.
Files changed (61) hide show
  1. package/index.cjs +46 -46
  2. package/index.d.cts +20 -14
  3. package/index.d.mts +20 -14
  4. package/index.d.ts +20 -14
  5. package/index.iife.js +46 -46
  6. package/index.iife.min.js +1 -1
  7. package/index.mjs +36 -36
  8. package/package.json +3 -3
  9. package/useAsyncValidator/component.cjs +1 -1
  10. package/useAsyncValidator/component.mjs +2 -2
  11. package/useAsyncValidator.cjs +3 -3
  12. package/useAsyncValidator.iife.js +3 -3
  13. package/useAsyncValidator.iife.min.js +1 -1
  14. package/useAsyncValidator.mjs +4 -4
  15. package/useAxios.cjs +6 -6
  16. package/useAxios.d.cts +19 -13
  17. package/useAxios.d.mts +19 -13
  18. package/useAxios.d.ts +19 -13
  19. package/useAxios.iife.js +6 -6
  20. package/useAxios.iife.min.js +1 -1
  21. package/useAxios.mjs +6 -6
  22. package/useChangeCase.cjs +3 -4
  23. package/useChangeCase.iife.js +5 -5
  24. package/useChangeCase.iife.min.js +1 -1
  25. package/useChangeCase.mjs +1 -2
  26. package/useDrauu.cjs +9 -9
  27. package/useDrauu.iife.js +9 -9
  28. package/useDrauu.iife.min.js +1 -1
  29. package/useDrauu.mjs +9 -9
  30. package/useFocusTrap.cjs +3 -3
  31. package/useFocusTrap.d.cts +1 -1
  32. package/useFocusTrap.d.mts +1 -1
  33. package/useFocusTrap.d.ts +1 -1
  34. package/useFocusTrap.iife.js +3 -3
  35. package/useFocusTrap.iife.min.js +1 -1
  36. package/useFocusTrap.mjs +4 -4
  37. package/useFuse.cjs +9 -10
  38. package/useFuse.iife.js +11 -11
  39. package/useFuse.iife.min.js +1 -1
  40. package/useFuse.mjs +6 -7
  41. package/useIDBKeyval.cjs +1 -2
  42. package/useIDBKeyval.iife.js +3 -3
  43. package/useIDBKeyval.iife.min.js +1 -1
  44. package/useIDBKeyval.mjs +1 -2
  45. package/useJwt.cjs +3 -4
  46. package/useJwt.iife.js +5 -5
  47. package/useJwt.iife.min.js +1 -1
  48. package/useJwt.mjs +2 -3
  49. package/useNProgress.cjs +1 -1
  50. package/useNProgress.d.cts +1 -1
  51. package/useNProgress.d.mts +1 -1
  52. package/useNProgress.d.ts +1 -1
  53. package/useNProgress.iife.js +1 -1
  54. package/useNProgress.iife.min.js +1 -1
  55. package/useNProgress.mjs +3 -3
  56. package/useSortable/component.cjs +4 -4
  57. package/useSortable/component.mjs +5 -5
  58. package/useSortable.cjs +8 -8
  59. package/useSortable.iife.js +8 -8
  60. package/useSortable.iife.min.js +1 -1
  61. package/useSortable.mjs +9 -9
package/useDrauu.mjs CHANGED
@@ -20,10 +20,10 @@ function useDrauu(target, options) {
20
20
  size: 3,
21
21
  arrowEnd: false,
22
22
  cornerRadius: 0,
23
- dasharray: void 0,
23
+ dasharray: undefined,
24
24
  fill: "transparent",
25
25
  mode: "draw",
26
- ...options == null ? void 0 : options.brush
26
+ ...options == null ? undefined : options.brush
27
27
  });
28
28
  watch(brush, () => {
29
29
  const instance = drauuInstance.value;
@@ -34,32 +34,32 @@ function useDrauu(target, options) {
34
34
  }, { deep: true });
35
35
  const undo = () => {
36
36
  var _a;
37
- return (_a = drauuInstance.value) == null ? void 0 : _a.undo();
37
+ return (_a = drauuInstance.value) == null ? undefined : _a.undo();
38
38
  };
39
39
  const redo = () => {
40
40
  var _a;
41
- return (_a = drauuInstance.value) == null ? void 0 : _a.redo();
41
+ return (_a = drauuInstance.value) == null ? undefined : _a.redo();
42
42
  };
43
43
  const clear = () => {
44
44
  var _a;
45
- return (_a = drauuInstance.value) == null ? void 0 : _a.clear();
45
+ return (_a = drauuInstance.value) == null ? undefined : _a.clear();
46
46
  };
47
47
  const cancel = () => {
48
48
  var _a;
49
- return (_a = drauuInstance.value) == null ? void 0 : _a.cancel();
49
+ return (_a = drauuInstance.value) == null ? undefined : _a.cancel();
50
50
  };
51
51
  const load = (svg) => {
52
52
  var _a;
53
- return (_a = drauuInstance.value) == null ? void 0 : _a.load(svg);
53
+ return (_a = drauuInstance.value) == null ? undefined : _a.load(svg);
54
54
  };
55
55
  const dump = () => {
56
56
  var _a;
57
- return (_a = drauuInstance.value) == null ? void 0 : _a.dump();
57
+ return (_a = drauuInstance.value) == null ? undefined : _a.dump();
58
58
  };
59
59
  const cleanup = () => {
60
60
  var _a;
61
61
  disposables.forEach((dispose) => dispose());
62
- (_a = drauuInstance.value) == null ? void 0 : _a.unmount();
62
+ (_a = drauuInstance.value) == null ? undefined : _a.unmount();
63
63
  };
64
64
  const syncStatus = () => {
65
65
  if (drauuInstance.value) {
package/useFocusTrap.cjs CHANGED
@@ -25,9 +25,9 @@ function useFocusTrap(target, options = {}) {
25
25
  }
26
26
  };
27
27
  const targets = vue.computed(() => {
28
- const _targets = shared.toValue(target);
29
- return (Array.isArray(_targets) ? _targets : [_targets]).map((el) => {
30
- const _el = shared.toValue(el);
28
+ const _targets = vue.toValue(target);
29
+ return core.toArray(_targets).map((el) => {
30
+ const _el = vue.toValue(el);
31
31
  return typeof _el === "string" ? _el : core.unrefElement(_el);
32
32
  }).filter(shared.notNullish);
33
33
  });
@@ -1,7 +1,7 @@
1
1
  import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
2
+ import { MaybeRefOrGetter } from '@vueuse/shared';
2
3
  import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
3
4
  import { Ref } from 'vue';
4
- import { MaybeRefOrGetter } from '@vueuse/shared';
5
5
 
6
6
  interface UseFocusTrapOptions extends Options {
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
2
+ import { MaybeRefOrGetter } from '@vueuse/shared';
2
3
  import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
3
4
  import { Ref } from 'vue';
4
- import { MaybeRefOrGetter } from '@vueuse/shared';
5
5
 
6
6
  interface UseFocusTrapOptions extends Options {
7
7
  /**
package/useFocusTrap.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
2
+ import { MaybeRefOrGetter } from '@vueuse/shared';
2
3
  import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
3
4
  import { Ref } from 'vue';
4
- import { MaybeRefOrGetter } from '@vueuse/shared';
5
5
 
6
6
  interface UseFocusTrapOptions extends Options {
7
7
  /**
@@ -21,9 +21,9 @@
21
21
  }
22
22
  };
23
23
  const targets = vue.computed(() => {
24
- const _targets = shared.toValue(target);
25
- return (Array.isArray(_targets) ? _targets : [_targets]).map((el) => {
26
- const _el = shared.toValue(el);
24
+ const _targets = vue.toValue(target);
25
+ return core.toArray(_targets).map((el) => {
26
+ const _el = vue.toValue(el);
27
27
  return typeof _el === "string" ? _el : core.unrefElement(_el);
28
28
  }).filter(shared.notNullish);
29
29
  });
@@ -1 +1 @@
1
- (function(l,i,u,p,s){"use strict";function v(V,a={}){let t;const{immediate:h,...m}=a,c=s.ref(!1),n=s.ref(!1),o=e=>t&&t.activate(e),f=e=>t&&t.deactivate(e),A=()=>{t&&(t.pause(),n.value=!0)},T=()=>{t&&(t.unpause(),n.value=!1)},g=s.computed(()=>{const e=u.toValue(V);return(Array.isArray(e)?e:[e]).map(y=>{const r=u.toValue(y);return typeof r=="string"?r:i.unrefElement(r)}).filter(u.notNullish)});return s.watch(g,e=>{e.length&&(t=p.createFocusTrap(e,{...m,onActivate(){c.value=!0,a.onActivate&&a.onActivate()},onDeactivate(){c.value=!1,a.onDeactivate&&a.onDeactivate()}}),h&&o())},{flush:"post"}),i.tryOnScopeDispose(()=>f()),{hasFocus:c,isPaused:n,activate:o,deactivate:f,pause:A,unpause:T}}l.useFocusTrap=v})(this.VueUse=this.VueUse||{},VueUse,VueUse,focusTrap,Vue);
1
+ (function(f,u,l,p,a){"use strict";function v(h,s={}){let t;const{immediate:V,...d}=s,c=a.ref(!1),n=a.ref(!1),i=e=>t&&t.activate(e),o=e=>t&&t.deactivate(e),m=()=>{t&&(t.pause(),n.value=!0)},T=()=>{t&&(t.unpause(),n.value=!1)},g=a.computed(()=>{const e=a.toValue(h);return u.toArray(e).map(A=>{const r=a.toValue(A);return typeof r=="string"?r:u.unrefElement(r)}).filter(l.notNullish)});return a.watch(g,e=>{e.length&&(t=p.createFocusTrap(e,{...d,onActivate(){c.value=!0,s.onActivate&&s.onActivate()},onDeactivate(){c.value=!1,s.onDeactivate&&s.onDeactivate()}}),V&&i())},{flush:"post"}),u.tryOnScopeDispose(()=>o()),{hasFocus:c,isPaused:n,activate:i,deactivate:o,pause:m,unpause:T}}f.useFocusTrap=v})(this.VueUse=this.VueUse||{},VueUse,VueUse,focusTrap,Vue);
package/useFocusTrap.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { unrefElement, tryOnScopeDispose } from '@vueuse/core';
2
- import { toValue, notNullish } from '@vueuse/shared';
1
+ import { toArray, unrefElement, tryOnScopeDispose } from '@vueuse/core';
2
+ import { notNullish } from '@vueuse/shared';
3
3
  import { createFocusTrap } from 'focus-trap';
4
- import { ref, computed, watch } from 'vue';
4
+ import { ref, computed, toValue, watch } from 'vue';
5
5
 
6
6
  function useFocusTrap(target, options = {}) {
7
7
  let trap;
@@ -24,7 +24,7 @@ function useFocusTrap(target, options = {}) {
24
24
  };
25
25
  const targets = computed(() => {
26
26
  const _targets = toValue(target);
27
- return (Array.isArray(_targets) ? _targets : [_targets]).map((el) => {
27
+ return toArray(_targets).map((el) => {
28
28
  const _el = toValue(el);
29
29
  return typeof _el === "string" ? _el : unrefElement(_el);
30
30
  }).filter(notNullish);
package/useFuse.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var shared = require('@vueuse/shared');
4
3
  var Fuse = require('fuse.js');
5
4
  var vue = require('vue');
6
5
 
@@ -8,15 +7,15 @@ function useFuse(search, data, options) {
8
7
  const createFuse = () => {
9
8
  var _a, _b;
10
9
  return new Fuse(
11
- (_a = shared.toValue(data)) != null ? _a : [],
12
- (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
10
+ (_a = vue.toValue(data)) != null ? _a : [],
11
+ (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
13
12
  );
14
13
  };
15
14
  const fuse = vue.ref(createFuse());
16
15
  vue.watch(
17
16
  () => {
18
17
  var _a;
19
- return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
18
+ return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
20
19
  },
21
20
  () => {
22
21
  fuse.value = createFuse();
@@ -24,18 +23,18 @@ function useFuse(search, data, options) {
24
23
  { deep: true }
25
24
  );
26
25
  vue.watch(
27
- () => shared.toValue(data),
26
+ () => vue.toValue(data),
28
27
  (newData) => {
29
28
  fuse.value.setCollection(newData);
30
29
  },
31
30
  { deep: true }
32
31
  );
33
32
  const results = vue.computed(() => {
34
- const resolved = shared.toValue(options);
35
- if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
36
- return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
37
- const limit = resolved == null ? void 0 : resolved.resultLimit;
38
- return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
33
+ const resolved = vue.toValue(options);
34
+ if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
35
+ return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
36
+ const limit = resolved == null ? undefined : resolved.resultLimit;
37
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
39
38
  });
40
39
  return {
41
40
  fuse,
package/useFuse.iife.js CHANGED
@@ -1,19 +1,19 @@
1
- (function (exports, shared, Fuse, vue) {
1
+ (function (exports, Fuse, vue) {
2
2
  'use strict';
3
3
 
4
4
  function useFuse(search, data, options) {
5
5
  const createFuse = () => {
6
6
  var _a, _b;
7
7
  return new Fuse(
8
- (_a = shared.toValue(data)) != null ? _a : [],
9
- (_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
8
+ (_a = vue.toValue(data)) != null ? _a : [],
9
+ (_b = vue.toValue(options)) == null ? undefined : _b.fuseOptions
10
10
  );
11
11
  };
12
12
  const fuse = vue.ref(createFuse());
13
13
  vue.watch(
14
14
  () => {
15
15
  var _a;
16
- return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
16
+ return (_a = vue.toValue(options)) == null ? undefined : _a.fuseOptions;
17
17
  },
18
18
  () => {
19
19
  fuse.value = createFuse();
@@ -21,18 +21,18 @@
21
21
  { deep: true }
22
22
  );
23
23
  vue.watch(
24
- () => shared.toValue(data),
24
+ () => vue.toValue(data),
25
25
  (newData) => {
26
26
  fuse.value.setCollection(newData);
27
27
  },
28
28
  { deep: true }
29
29
  );
30
30
  const results = vue.computed(() => {
31
- const resolved = shared.toValue(options);
32
- if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
33
- return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
34
- const limit = resolved == null ? void 0 : resolved.resultLimit;
35
- return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
31
+ const resolved = vue.toValue(options);
32
+ if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
33
+ return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
34
+ const limit = resolved == null ? undefined : resolved.resultLimit;
35
+ return fuse.value.search(vue.toValue(search), limit ? { limit } : undefined);
36
36
  });
37
37
  return {
38
38
  fuse,
@@ -42,4 +42,4 @@
42
42
 
43
43
  exports.useFuse = useFuse;
44
44
 
45
- })(this.VueUse = this.VueUse || {}, VueUse, Fuse, Vue);
45
+ })(this.VueUse = this.VueUse || {}, Fuse, Vue);
@@ -1 +1 @@
1
- (function(r,u,V,l){"use strict";function a(i,o,s){const c=()=>{var e,t;return new V((e=u.toValue(o))!=null?e:[],(t=u.toValue(s))==null?void 0:t.fuseOptions)},n=l.ref(c());l.watch(()=>{var e;return(e=u.toValue(s))==null?void 0:e.fuseOptions},()=>{n.value=c()},{deep:!0}),l.watch(()=>u.toValue(o),e=>{n.value.setCollection(e)},{deep:!0});const f=l.computed(()=>{const e=u.toValue(s);if(e?.matchAllWhenSearchEmpty&&!u.toValue(i))return u.toValue(o).map((v,m)=>({item:v,refIndex:m}));const t=e?.resultLimit;return n.value.search(u.toValue(i),t?{limit:t}:void 0)});return{fuse:n,results:f}}r.useFuse=a})(this.VueUse=this.VueUse||{},VueUse,Fuse,Vue);
1
+ (function(o,i,e){"use strict";function c(r,l,s){const a=()=>{var t,u;return new i((t=e.toValue(l))!=null?t:[],(u=e.toValue(s))==null?void 0:u.fuseOptions)},n=e.ref(a());e.watch(()=>{var t;return(t=e.toValue(s))==null?void 0:t.fuseOptions},()=>{n.value=a()},{deep:!0}),e.watch(()=>e.toValue(l),t=>{n.value.setCollection(t)},{deep:!0});const d=e.computed(()=>{const t=e.toValue(s);if(t?.matchAllWhenSearchEmpty&&!e.toValue(r))return e.toValue(l).map((f,V)=>({item:f,refIndex:V}));const u=t?.resultLimit;return n.value.search(e.toValue(r),u?{limit:u}:void 0)});return{fuse:n,results:d}}o.useFuse=c})(this.VueUse=this.VueUse||{},Fuse,Vue);
package/useFuse.mjs CHANGED
@@ -1,20 +1,19 @@
1
- import { toValue } from '@vueuse/shared';
2
1
  import Fuse from 'fuse.js';
3
- import { ref, watch, computed } from 'vue';
2
+ import { ref, watch, toValue, computed } from 'vue';
4
3
 
5
4
  function useFuse(search, data, options) {
6
5
  const createFuse = () => {
7
6
  var _a, _b;
8
7
  return new Fuse(
9
8
  (_a = toValue(data)) != null ? _a : [],
10
- (_b = toValue(options)) == null ? void 0 : _b.fuseOptions
9
+ (_b = toValue(options)) == null ? undefined : _b.fuseOptions
11
10
  );
12
11
  };
13
12
  const fuse = ref(createFuse());
14
13
  watch(
15
14
  () => {
16
15
  var _a;
17
- return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
16
+ return (_a = toValue(options)) == null ? undefined : _a.fuseOptions;
18
17
  },
19
18
  () => {
20
19
  fuse.value = createFuse();
@@ -30,10 +29,10 @@ function useFuse(search, data, options) {
30
29
  );
31
30
  const results = computed(() => {
32
31
  const resolved = toValue(options);
33
- if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
32
+ if ((resolved == null ? undefined : resolved.matchAllWhenSearchEmpty) && !toValue(search))
34
33
  return toValue(data).map((item, index) => ({ item, refIndex: index }));
35
- const limit = resolved == null ? void 0 : resolved.resultLimit;
36
- return fuse.value.search(toValue(search), limit ? { limit } : void 0);
34
+ const limit = resolved == null ? undefined : resolved.resultLimit;
35
+ return fuse.value.search(toValue(search), limit ? { limit } : undefined);
37
36
  });
38
37
  return {
39
38
  fuse,
package/useIDBKeyval.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@vueuse/core');
4
- var shared = require('@vueuse/shared');
5
4
  var idbKeyval = require('idb-keyval');
6
5
  var vue = require('vue');
7
6
 
@@ -17,7 +16,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
17
16
  } = options;
18
17
  const isFinished = vue.ref(false);
19
18
  const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
20
- const rawInit = shared.toValue(initialValue);
19
+ const rawInit = vue.toValue(initialValue);
21
20
  async function read() {
22
21
  try {
23
22
  const rawValue = await idbKeyval.get(key);
@@ -1,4 +1,4 @@
1
- (function (exports, core, shared, idbKeyval, vue) {
1
+ (function (exports, core, idbKeyval, vue) {
2
2
  'use strict';
3
3
 
4
4
  function useIDBKeyval(key, initialValue, options = {}) {
@@ -13,7 +13,7 @@
13
13
  } = options;
14
14
  const isFinished = vue.ref(false);
15
15
  const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
16
- const rawInit = shared.toValue(initialValue);
16
+ const rawInit = vue.toValue(initialValue);
17
17
  async function read() {
18
18
  try {
19
19
  const rawValue = await idbKeyval.get(key);
@@ -59,4 +59,4 @@
59
59
 
60
60
  exports.useIDBKeyval = useIDBKeyval;
61
61
 
62
- })(this.VueUse = this.VueUse || {}, VueUse, VueUse, idbKeyval, Vue);
62
+ })(this.VueUse = this.VueUse || {}, VueUse, idbKeyval, Vue);
@@ -1 +1 @@
1
- (function(i,f,w,a,s){"use strict";function h(u,r,d={}){const{flush:V="pre",deep:p=!0,shallow:v=!1,onError:c=e=>{console.error(e)},writeDefaults:D=!0}=d,l=s.ref(!1),t=(v?s.shallowRef:s.ref)(r),n=w.toValue(r);async function U(){try{const e=await a.get(u);e===void 0?n!=null&&D&&await a.set(u,n):t.value=e}catch(e){c(e)}l.value=!0}U();async function o(){try{t.value==null?await a.del(u):await a.update(u,()=>s.toRaw(t.value))}catch(e){c(e)}}const{pause:I,resume:m}=f.watchPausable(t,()=>o(),{flush:V,deep:p});async function y(e){I(),t.value=e,await o(),m()}return{set:y,isFinished:l,data:t}}i.useIDBKeyval=h})(this.VueUse=this.VueUse||{},VueUse,VueUse,idbKeyval,Vue);
1
+ (function(i,f,s,a){"use strict";function w(u,r,h={}){const{flush:d="pre",deep:p=!0,shallow:V=!1,onError:c=e=>{console.error(e)},writeDefaults:D=!0}=h,l=a.ref(!1),t=(V?a.shallowRef:a.ref)(r),n=a.toValue(r);async function v(){try{const e=await s.get(u);e===void 0?n!=null&&D&&await s.set(u,n):t.value=e}catch(e){c(e)}l.value=!0}v();async function o(){try{t.value==null?await s.del(u):await s.update(u,()=>a.toRaw(t.value))}catch(e){c(e)}}const{pause:I,resume:U}=f.watchPausable(t,()=>o(),{flush:d,deep:p});async function m(e){I(),t.value=e,await o(),U()}return{set:m,isFinished:l,data:t}}i.useIDBKeyval=w})(this.VueUse=this.VueUse||{},VueUse,idbKeyval,Vue);
package/useIDBKeyval.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { watchPausable } from '@vueuse/core';
2
- import { toValue } from '@vueuse/shared';
3
2
  import { get, set, del, update } from 'idb-keyval';
4
- import { ref, shallowRef, toRaw } from 'vue';
3
+ import { ref, shallowRef, toValue, toRaw } from 'vue';
5
4
 
6
5
  function useIDBKeyval(key, initialValue, options = {}) {
7
6
  const {
package/useJwt.cjs CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var shared = require('@vueuse/shared');
4
3
  var jwtDecode = require('jwt-decode');
5
4
  var vue = require('vue');
6
5
 
@@ -13,12 +12,12 @@ function useJwt(encodedJwt, options = {}) {
13
12
  try {
14
13
  return jwtDecode.jwtDecode(encodedJwt2, options2);
15
14
  } catch (err) {
16
- onError == null ? void 0 : onError(err);
15
+ onError == null ? undefined : onError(err);
17
16
  return fallbackValue;
18
17
  }
19
18
  };
20
- const header = vue.computed(() => decodeWithFallback(shared.toValue(encodedJwt), { header: true }));
21
- const payload = vue.computed(() => decodeWithFallback(shared.toValue(encodedJwt)));
19
+ const header = vue.computed(() => decodeWithFallback(vue.toValue(encodedJwt), { header: true }));
20
+ const payload = vue.computed(() => decodeWithFallback(vue.toValue(encodedJwt)));
22
21
  return {
23
22
  header,
24
23
  payload
package/useJwt.iife.js CHANGED
@@ -1,4 +1,4 @@
1
- (function (exports, shared, jwtDecode, vue) {
1
+ (function (exports, jwtDecode, vue) {
2
2
  'use strict';
3
3
 
4
4
  function useJwt(encodedJwt, options = {}) {
@@ -10,12 +10,12 @@
10
10
  try {
11
11
  return jwtDecode.jwtDecode(encodedJwt2, options2);
12
12
  } catch (err) {
13
- onError == null ? void 0 : onError(err);
13
+ onError == null ? undefined : onError(err);
14
14
  return fallbackValue;
15
15
  }
16
16
  };
17
- const header = vue.computed(() => decodeWithFallback(shared.toValue(encodedJwt), { header: true }));
18
- const payload = vue.computed(() => decodeWithFallback(shared.toValue(encodedJwt)));
17
+ const header = vue.computed(() => decodeWithFallback(vue.toValue(encodedJwt), { header: true }));
18
+ const payload = vue.computed(() => decodeWithFallback(vue.toValue(encodedJwt)));
19
19
  return {
20
20
  header,
21
21
  payload
@@ -24,4 +24,4 @@
24
24
 
25
25
  exports.useJwt = useJwt;
26
26
 
27
- })(this.VueUse = this.VueUse || {}, VueUse, jwt_decode, Vue);
27
+ })(this.VueUse = this.VueUse || {}, jwt_decode, Vue);
@@ -1 +1 @@
1
- (function(r,e,n,t){"use strict";function l(u,s={}){const{onError:o,fallbackValue:a=null}=s,c=(V,h)=>{try{return n.jwtDecode(V,h)}catch(f){return o?.(f),a}},d=t.computed(()=>c(e.toValue(u),{header:!0})),i=t.computed(()=>c(e.toValue(u)));return{header:d,payload:i}}r.useJwt=l})(this.VueUse=this.VueUse||{},VueUse,jwt_decode,Vue);
1
+ (function(c,n,e){"use strict";function o(t,a={}){const{onError:u,fallbackValue:l=null}=a,r=(i,h)=>{try{return n.jwtDecode(i,h)}catch(V){return u?.(V),l}},s=e.computed(()=>r(e.toValue(t),{header:!0})),d=e.computed(()=>r(e.toValue(t)));return{header:s,payload:d}}c.useJwt=o})(this.VueUse=this.VueUse||{},jwt_decode,Vue);
package/useJwt.mjs CHANGED
@@ -1,6 +1,5 @@
1
- import { toValue } from '@vueuse/shared';
2
1
  import { jwtDecode } from 'jwt-decode';
3
- import { computed } from 'vue';
2
+ import { computed, toValue } from 'vue';
4
3
 
5
4
  function useJwt(encodedJwt, options = {}) {
6
5
  const {
@@ -11,7 +10,7 @@ function useJwt(encodedJwt, options = {}) {
11
10
  try {
12
11
  return jwtDecode(encodedJwt2, options2);
13
12
  } catch (err) {
14
- onError == null ? void 0 : onError(err);
13
+ onError == null ? undefined : onError(err);
15
14
  return fallbackValue;
16
15
  }
17
16
  };
package/useNProgress.cjs CHANGED
@@ -5,7 +5,7 @@ var nprogress = require('nprogress');
5
5
  var vue = require('vue');
6
6
 
7
7
  function useNProgress(currentProgress = null, options) {
8
- const progress = vue.ref(currentProgress);
8
+ const progress = shared.toRef(currentProgress);
9
9
  const isLoading = vue.computed({
10
10
  set: (load) => load ? nprogress.start() : nprogress.done(),
11
11
  get: () => typeof progress.value === "number" && progress.value < 1
@@ -10,7 +10,7 @@ type UseNProgressOptions = Partial<NProgressOptions>;
10
10
  */
11
11
  declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null | undefined>, options?: UseNProgressOptions): {
12
12
  isLoading: vue.WritableComputedRef<boolean, boolean>;
13
- progress: vue.Ref<number | (() => number | null | undefined) | null | undefined, number | vue.Ref<number | null | undefined, number | null | undefined> | vue.ShallowRef<number | null | undefined, number | null | undefined> | vue.WritableComputedRef<number | null | undefined, number | null | undefined> | vue.ComputedRef<number | null | undefined> | (() => number | null | undefined) | null | undefined>;
13
+ progress: vue.Ref<number | null | undefined, number | null | undefined>;
14
14
  start: () => nprogress.NProgress;
15
15
  done: (force?: boolean) => nprogress.NProgress;
16
16
  remove: () => void;
@@ -10,7 +10,7 @@ type UseNProgressOptions = Partial<NProgressOptions>;
10
10
  */
11
11
  declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null | undefined>, options?: UseNProgressOptions): {
12
12
  isLoading: vue.WritableComputedRef<boolean, boolean>;
13
- progress: vue.Ref<number | (() => number | null | undefined) | null | undefined, number | vue.Ref<number | null | undefined, number | null | undefined> | vue.ShallowRef<number | null | undefined, number | null | undefined> | vue.WritableComputedRef<number | null | undefined, number | null | undefined> | vue.ComputedRef<number | null | undefined> | (() => number | null | undefined) | null | undefined>;
13
+ progress: vue.Ref<number | null | undefined, number | null | undefined>;
14
14
  start: () => nprogress.NProgress;
15
15
  done: (force?: boolean) => nprogress.NProgress;
16
16
  remove: () => void;
package/useNProgress.d.ts CHANGED
@@ -10,7 +10,7 @@ type UseNProgressOptions = Partial<NProgressOptions>;
10
10
  */
11
11
  declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null | undefined>, options?: UseNProgressOptions): {
12
12
  isLoading: vue.WritableComputedRef<boolean, boolean>;
13
- progress: vue.Ref<number | (() => number | null | undefined) | null | undefined, number | vue.Ref<number | null | undefined, number | null | undefined> | vue.ShallowRef<number | null | undefined, number | null | undefined> | vue.WritableComputedRef<number | null | undefined, number | null | undefined> | vue.ComputedRef<number | null | undefined> | (() => number | null | undefined) | null | undefined>;
13
+ progress: vue.Ref<number | null | undefined, number | null | undefined>;
14
14
  start: () => nprogress.NProgress;
15
15
  done: (force?: boolean) => nprogress.NProgress;
16
16
  remove: () => void;
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  function useNProgress(currentProgress = null, options) {
5
- const progress = vue.ref(currentProgress);
5
+ const progress = shared.toRef(currentProgress);
6
6
  const isLoading = vue.computed({
7
7
  set: (load) => load ? nprogress.start() : nprogress.done(),
8
8
  get: () => typeof progress.value === "number" && progress.value < 1
@@ -1 +1 @@
1
- (function(o,c,e,l){"use strict";function s(f=null,a){const t=l.ref(f),n=l.computed({set:u=>u?e.start():e.done(),get:()=>typeof t.value=="number"&&t.value<1});a&&e.configure(a);const i=e.set;return e.set=u=>(t.value=u,i.call(e,u)),l.watchEffect(()=>{typeof t.value=="number"&&c.isClient&&i.call(e,t.value)}),c.tryOnScopeDispose(e.remove),{isLoading:n,progress:t,start:e.start,done:e.done,remove:()=>{t.value=null,e.remove()}}}o.useNProgress=s})(this.VueUse=this.VueUse||{},VueUse,nprogress,Vue);
1
+ (function(a,l,e,c){"use strict";function f(s=null,i){const t=l.toRef(s),n=c.computed({set:u=>u?e.start():e.done(),get:()=>typeof t.value=="number"&&t.value<1});i&&e.configure(i);const o=e.set;return e.set=u=>(t.value=u,o.call(e,u)),c.watchEffect(()=>{typeof t.value=="number"&&l.isClient&&o.call(e,t.value)}),l.tryOnScopeDispose(e.remove),{isLoading:n,progress:t,start:e.start,done:e.done,remove:()=>{t.value=null,e.remove()}}}a.useNProgress=f})(this.VueUse=this.VueUse||{},VueUse,nprogress,Vue);
package/useNProgress.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { isClient, tryOnScopeDispose } from '@vueuse/shared';
1
+ import { toRef, isClient, tryOnScopeDispose } from '@vueuse/shared';
2
2
  import nprogress from 'nprogress';
3
- import { ref, computed, watchEffect } from 'vue';
3
+ import { computed, watchEffect } from 'vue';
4
4
 
5
5
  function useNProgress(currentProgress = null, options) {
6
- const progress = ref(currentProgress);
6
+ const progress = toRef(currentProgress);
7
7
  const isLoading = computed({
8
8
  set: (load) => load ? nprogress.start() : nprogress.done(),
9
9
  get: () => typeof progress.value === "number" && progress.value < 1
@@ -14,16 +14,16 @@ function useSortable(el, list, options = {}) {
14
14
  };
15
15
  const start = () => {
16
16
  const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
17
- if (!target || sortable !== void 0)
17
+ if (!target || sortable !== undefined)
18
18
  return;
19
19
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
20
20
  };
21
21
  const stop = () => {
22
22
  sortable?.destroy();
23
- sortable = void 0;
23
+ sortable = undefined;
24
24
  };
25
25
  const option = (name, value) => {
26
- if (value !== void 0)
26
+ if (value !== undefined)
27
27
  sortable?.option(name, value);
28
28
  else
29
29
  return sortable?.option(name);
@@ -50,7 +50,7 @@ function moveArrayElement(list, from, to, e = null) {
50
50
  insertNodeAt(e.from, e.item, from);
51
51
  }
52
52
  const _valueIsRef = vue.isRef(list);
53
- const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
53
+ const array = _valueIsRef ? [...vue.toValue(list)] : vue.toValue(list);
54
54
  if (to >= 0 && to < array.length) {
55
55
  const element = array.splice(from, 1)[0];
56
56
  vue.nextTick(() => {
@@ -1,5 +1,5 @@
1
- import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument, toValue, useVModel } from '@vueuse/core';
2
- import { isRef, nextTick, defineComponent, ref, reactive, h } from 'vue';
1
+ import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument, useVModel } from '@vueuse/core';
2
+ import { isRef, toValue, nextTick, defineComponent, ref, reactive, h } from 'vue';
3
3
  import Sortable from 'sortablejs';
4
4
 
5
5
  function useSortable(el, list, options = {}) {
@@ -12,16 +12,16 @@ function useSortable(el, list, options = {}) {
12
12
  };
13
13
  const start = () => {
14
14
  const target = typeof el === "string" ? document?.querySelector(el) : unrefElement(el);
15
- if (!target || sortable !== void 0)
15
+ if (!target || sortable !== undefined)
16
16
  return;
17
17
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
18
18
  };
19
19
  const stop = () => {
20
20
  sortable?.destroy();
21
- sortable = void 0;
21
+ sortable = undefined;
22
22
  };
23
23
  const option = (name, value) => {
24
- if (value !== void 0)
24
+ if (value !== undefined)
25
25
  sortable?.option(name, value);
26
26
  else
27
27
  return sortable?.option(name);
package/useSortable.cjs CHANGED
@@ -13,20 +13,20 @@ function useSortable(el, list, options = {}) {
13
13
  }
14
14
  };
15
15
  const start = () => {
16
- const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
17
- if (!target || sortable !== void 0)
16
+ const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
17
+ if (!target || sortable !== undefined)
18
18
  return;
19
19
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
20
20
  };
21
21
  const stop = () => {
22
- sortable == null ? void 0 : sortable.destroy();
23
- sortable = void 0;
22
+ sortable == null ? undefined : sortable.destroy();
23
+ sortable = undefined;
24
24
  };
25
25
  const option = (name, value) => {
26
- if (value !== void 0)
27
- sortable == null ? void 0 : sortable.option(name, value);
26
+ if (value !== undefined)
27
+ sortable == null ? undefined : sortable.option(name, value);
28
28
  else
29
- return sortable == null ? void 0 : sortable.option(name);
29
+ return sortable == null ? undefined : sortable.option(name);
30
30
  };
31
31
  core.tryOnMounted(start);
32
32
  core.tryOnScopeDispose(stop);
@@ -50,7 +50,7 @@ function moveArrayElement(list, from, to, e = null) {
50
50
  insertNodeAt(e.from, e.item, from);
51
51
  }
52
52
  const _valueIsRef = vue.isRef(list);
53
- const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
53
+ const array = _valueIsRef ? [...vue.toValue(list)] : vue.toValue(list);
54
54
  if (to >= 0 && to < array.length) {
55
55
  const element = array.splice(from, 1)[0];
56
56
  vue.nextTick(() => {
@@ -10,20 +10,20 @@
10
10
  }
11
11
  };
12
12
  const start = () => {
13
- const target = typeof el === "string" ? document == null ? void 0 : document.querySelector(el) : core.unrefElement(el);
14
- if (!target || sortable !== void 0)
13
+ const target = typeof el === "string" ? document == null ? undefined : document.querySelector(el) : core.unrefElement(el);
14
+ if (!target || sortable !== undefined)
15
15
  return;
16
16
  sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
17
17
  };
18
18
  const stop = () => {
19
- sortable == null ? void 0 : sortable.destroy();
20
- sortable = void 0;
19
+ sortable == null ? undefined : sortable.destroy();
20
+ sortable = undefined;
21
21
  };
22
22
  const option = (name, value) => {
23
- if (value !== void 0)
24
- sortable == null ? void 0 : sortable.option(name, value);
23
+ if (value !== undefined)
24
+ sortable == null ? undefined : sortable.option(name, value);
25
25
  else
26
- return sortable == null ? void 0 : sortable.option(name);
26
+ return sortable == null ? undefined : sortable.option(name);
27
27
  };
28
28
  core.tryOnMounted(start);
29
29
  core.tryOnScopeDispose(stop);
@@ -47,7 +47,7 @@
47
47
  insertNodeAt(e.from, e.item, from);
48
48
  }
49
49
  const _valueIsRef = vue.isRef(list);
50
- const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
50
+ const array = _valueIsRef ? [...vue.toValue(list)] : vue.toValue(list);
51
51
  if (to >= 0 && to < array.length) {
52
52
  const element = array.splice(from, 1)[0];
53
53
  vue.nextTick(() => {