@vueuse/integrations 12.2.0 → 12.3.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 +20 -20
- package/index.d.cts +19 -13
- package/index.d.mts +19 -13
- package/index.d.ts +19 -13
- package/index.iife.js +20 -20
- package/index.iife.min.js +1 -1
- package/index.mjs +6 -6
- package/package.json +3 -3
- package/useAsyncValidator/component.cjs +1 -1
- package/useAsyncValidator/component.mjs +2 -2
- package/useAsyncValidator.cjs +1 -1
- package/useAsyncValidator.iife.js +1 -1
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +2 -2
- package/useAxios.cjs +1 -1
- package/useAxios.d.cts +19 -13
- package/useAxios.d.mts +19 -13
- package/useAxios.d.ts +19 -13
- package/useAxios.iife.js +1 -1
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +1 -1
- package/useChangeCase.cjs +3 -4
- package/useChangeCase.iife.js +5 -5
- package/useChangeCase.iife.min.js +1 -1
- package/useChangeCase.mjs +1 -2
- 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 +8 -9
- package/useFuse.iife.js +10 -10
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +1 -2
- 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 +2 -3
- package/useJwt.iife.js +4 -4
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +1 -2
- package/useSortable/component.cjs +1 -1
- package/useSortable/component.mjs +2 -2
- package/useSortable.cjs +1 -1
- package/useSortable.iife.js +1 -1
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +2 -2
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 ? void 0 : _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 ? void 0 : _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 ? void 0 : resolved.matchAllWhenSearchEmpty) && !
|
|
33
|
-
return
|
|
31
|
+
const resolved = vue.toValue(options);
|
|
32
|
+
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !vue.toValue(search))
|
|
33
|
+
return vue.toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
34
34
|
const limit = resolved == null ? void 0 : resolved.resultLimit;
|
|
35
|
-
return fuse.value.search(
|
|
35
|
+
return fuse.value.search(vue.toValue(search), limit ? { limit } : void 0);
|
|
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(a,i,e){"use strict";function c(o,s,n){const r=()=>{var t,u;return new i((t=e.toValue(s))!=null?t:[],(u=e.toValue(n))==null?void 0:u.fuseOptions)},l=e.ref(r());e.watch(()=>{var t;return(t=e.toValue(n))==null?void 0:t.fuseOptions},()=>{l.value=r()},{deep:!0}),e.watch(()=>e.toValue(s),t=>{l.value.setCollection(t)},{deep:!0});const V=e.computed(()=>{const t=e.toValue(n);if(t?.matchAllWhenSearchEmpty&&!e.toValue(o))return e.toValue(s).map((d,f)=>({item:d,refIndex:f}));const u=t?.resultLimit;return l.value.search(e.toValue(o),u?{limit:u}:void 0)});return{fuse:l,results:V}}a.useFuse=c})(this.VueUse=this.VueUse||{},Fuse,Vue);
|
package/useFuse.mjs
CHANGED
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
|
|
|
@@ -17,8 +16,8 @@ function useJwt(encodedJwt, options = {}) {
|
|
|
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 = {}) {
|
|
@@ -14,8 +14,8 @@
|
|
|
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(u,c,t){"use strict";function n(e,a={}){const{onError:o,fallbackValue:l=null}=a,r=(i,h)=>{try{return c.jwtDecode(i,h)}catch(V){return o?.(V),l}},s=t.computed(()=>r(t.toValue(e),{header:!0})),d=t.computed(()=>r(t.toValue(e)));return{header:s,payload:d}}u.useJwt=n})(this.VueUse=this.VueUse||{},jwt_decode,Vue);
|
package/useJwt.mjs
CHANGED
|
@@ -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 = {}) {
|
package/useSortable.cjs
CHANGED
|
@@ -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
|
@@ -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(() => {
|
package/useSortable.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,u,N,d){"use strict";function V(t,i,o={}){let e;const{document:s=u.defaultDocument,...r}=o,c={onUpdate:n=>{m(i,n.oldIndex,n.newIndex,n)}},p=()=>{const n=typeof t=="string"?s?.querySelector(t):u.unrefElement(t);!n||e!==void 0||(e=new N(n,{...c,...r}))},v=()=>{e?.destroy(),e=void 0},h=(n,y)=>{if(y!==void 0)e?.option(n,y);else return e?.option(n)};return u.tryOnMounted(p),u.tryOnScopeDispose(v),{stop:v,start:p,option:h}}function f(t,i,o){const e=t.children[o];t.insertBefore(i,e)}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,i,o,e=null){e!=null&&(a(e.item),f(e.from,e.item,i));const s=d.isRef(t),r=s?[...d.toValue(t)]:d.toValue(t);if(o>=0&&o<r.length){const c=r.splice(i,1)[0];d.nextTick(()=>{r.splice(o,0,c),s&&(t.value=r)})}}l.insertNodeAt=f,l.moveArrayElement=m,l.removeNode=a,l.useSortable=V})(this.VueUse=this.VueUse||{},VueUse,Sortable,Vue);
|
package/useSortable.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { tryOnMounted, tryOnScopeDispose,
|
|
1
|
+
import { tryOnMounted, tryOnScopeDispose, unrefElement, defaultDocument } from '@vueuse/core';
|
|
2
2
|
import Sortable from 'sortablejs';
|
|
3
|
-
import { isRef, nextTick } from 'vue';
|
|
3
|
+
import { isRef, toValue, nextTick } from 'vue';
|
|
4
4
|
|
|
5
5
|
function useSortable(el, list, options = {}) {
|
|
6
6
|
let sortable;
|