@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.
- package/index.cjs +46 -46
- package/index.d.cts +20 -14
- package/index.d.mts +20 -14
- package/index.d.ts +20 -14
- package/index.iife.js +46 -46
- package/index.iife.min.js +1 -1
- package/index.mjs +36 -36
- package/package.json +3 -3
- package/useAsyncValidator/component.cjs +1 -1
- package/useAsyncValidator/component.mjs +2 -2
- package/useAsyncValidator.cjs +3 -3
- package/useAsyncValidator.iife.js +3 -3
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +4 -4
- package/useAxios.cjs +6 -6
- package/useAxios.d.cts +19 -13
- package/useAxios.d.mts +19 -13
- package/useAxios.d.ts +19 -13
- package/useAxios.iife.js +6 -6
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +6 -6
- package/useChangeCase.cjs +3 -4
- package/useChangeCase.iife.js +5 -5
- package/useChangeCase.iife.min.js +1 -1
- package/useChangeCase.mjs +1 -2
- package/useDrauu.cjs +9 -9
- package/useDrauu.iife.js +9 -9
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +9 -9
- package/useFocusTrap.cjs +3 -3
- package/useFocusTrap.d.cts +1 -1
- package/useFocusTrap.d.mts +1 -1
- package/useFocusTrap.d.ts +1 -1
- package/useFocusTrap.iife.js +3 -3
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +4 -4
- package/useFuse.cjs +9 -10
- package/useFuse.iife.js +11 -11
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +6 -7
- package/useIDBKeyval.cjs +1 -2
- package/useIDBKeyval.iife.js +3 -3
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +1 -2
- package/useJwt.cjs +3 -4
- package/useJwt.iife.js +5 -5
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +2 -3
- package/useNProgress.cjs +1 -1
- package/useNProgress.d.cts +1 -1
- package/useNProgress.d.mts +1 -1
- package/useNProgress.d.ts +1 -1
- package/useNProgress.iife.js +1 -1
- package/useNProgress.iife.min.js +1 -1
- package/useNProgress.mjs +3 -3
- package/useSortable/component.cjs +4 -4
- package/useSortable/component.mjs +5 -5
- package/useSortable.cjs +8 -8
- package/useSortable.iife.js +8 -8
- package/useSortable.iife.min.js +1 -1
- 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:
|
|
23
|
+
dasharray: undefined,
|
|
24
24
|
fill: "transparent",
|
|
25
25
|
mode: "draw",
|
|
26
|
-
...options == null ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 =
|
|
29
|
-
return
|
|
30
|
-
const _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
|
});
|
package/useFocusTrap.d.cts
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
|
/**
|
package/useFocusTrap.d.mts
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
|
/**
|
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
|
/**
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
const targets = vue.computed(() => {
|
|
24
|
-
const _targets =
|
|
25
|
-
return
|
|
26
|
-
const _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
|
});
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 {
|
|
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 (
|
|
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 =
|
|
12
|
-
(_b =
|
|
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 =
|
|
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
|
-
() =>
|
|
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 =
|
|
35
|
-
if ((resolved == null ?
|
|
36
|
-
return
|
|
37
|
-
const limit = resolved == null ?
|
|
38
|
-
return fuse.value.search(
|
|
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,
|
|
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 =
|
|
9
|
-
(_b =
|
|
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 =
|
|
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
|
-
() =>
|
|
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 =
|
|
32
|
-
if ((resolved == null ?
|
|
33
|
-
return
|
|
34
|
-
const limit = resolved == null ?
|
|
35
|
-
return fuse.value.search(
|
|
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 || {},
|
|
45
|
+
})(this.VueUse = this.VueUse || {}, Fuse, Vue);
|
package/useFuse.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
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 ?
|
|
36
|
-
return fuse.value.search(toValue(search), limit ? { limit } :
|
|
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 =
|
|
19
|
+
const rawInit = vue.toValue(initialValue);
|
|
21
20
|
async function read() {
|
|
22
21
|
try {
|
|
23
22
|
const rawValue = await idbKeyval.get(key);
|
package/useIDBKeyval.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function (exports, core,
|
|
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 =
|
|
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,
|
|
62
|
+
})(this.VueUse = this.VueUse || {}, VueUse, idbKeyval, Vue);
|
package/useIDBKeyval.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,f,
|
|
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 ?
|
|
15
|
+
onError == null ? undefined : onError(err);
|
|
17
16
|
return fallbackValue;
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
|
-
const header = vue.computed(() => decodeWithFallback(
|
|
21
|
-
const payload = vue.computed(() => decodeWithFallback(
|
|
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,
|
|
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 ?
|
|
13
|
+
onError == null ? undefined : onError(err);
|
|
14
14
|
return fallbackValue;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
const header = vue.computed(() => decodeWithFallback(
|
|
18
|
-
const payload = vue.computed(() => decodeWithFallback(
|
|
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 || {},
|
|
27
|
+
})(this.VueUse = this.VueUse || {}, jwt_decode, Vue);
|
package/useJwt.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 ?
|
|
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 =
|
|
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
|
package/useNProgress.d.cts
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 |
|
|
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.mts
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 |
|
|
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 |
|
|
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.iife.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
function useNProgress(currentProgress = null, options) {
|
|
5
|
-
const progress =
|
|
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
|
package/useNProgress.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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 {
|
|
3
|
+
import { computed, watchEffect } from 'vue';
|
|
4
4
|
|
|
5
5
|
function useNProgress(currentProgress = null, options) {
|
|
6
|
-
const progress =
|
|
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 !==
|
|
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 =
|
|
23
|
+
sortable = undefined;
|
|
24
24
|
};
|
|
25
25
|
const option = (name, value) => {
|
|
26
|
-
if (value !==
|
|
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 ? [...
|
|
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,
|
|
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 !==
|
|
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 =
|
|
21
|
+
sortable = undefined;
|
|
22
22
|
};
|
|
23
23
|
const option = (name, value) => {
|
|
24
|
-
if (value !==
|
|
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 ?
|
|
17
|
-
if (!target || sortable !==
|
|
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 ?
|
|
23
|
-
sortable =
|
|
22
|
+
sortable == null ? undefined : sortable.destroy();
|
|
23
|
+
sortable = undefined;
|
|
24
24
|
};
|
|
25
25
|
const option = (name, value) => {
|
|
26
|
-
if (value !==
|
|
27
|
-
sortable == null ?
|
|
26
|
+
if (value !== undefined)
|
|
27
|
+
sortable == null ? undefined : sortable.option(name, value);
|
|
28
28
|
else
|
|
29
|
-
return sortable == null ?
|
|
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 ? [...
|
|
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(() => {
|
package/useSortable.iife.js
CHANGED
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
const start = () => {
|
|
13
|
-
const target = typeof el === "string" ? document == null ?
|
|
14
|
-
if (!target || sortable !==
|
|
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 ?
|
|
20
|
-
sortable =
|
|
19
|
+
sortable == null ? undefined : sortable.destroy();
|
|
20
|
+
sortable = undefined;
|
|
21
21
|
};
|
|
22
22
|
const option = (name, value) => {
|
|
23
|
-
if (value !==
|
|
24
|
-
sortable == null ?
|
|
23
|
+
if (value !== undefined)
|
|
24
|
+
sortable == null ? undefined : sortable.option(name, value);
|
|
25
25
|
else
|
|
26
|
-
return sortable == null ?
|
|
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 ? [...
|
|
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(() => {
|