@vueuse/integrations 10.3.0 → 10.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 +62 -214
- package/index.d.cts +8 -18
- package/index.d.mts +8 -18
- package/index.d.ts +8 -18
- package/index.iife.js +62 -214
- package/index.iife.min.js +1 -1
- package/index.mjs +64 -216
- package/package.json +6 -6
- package/useAsyncValidator/component.cjs +5 -29
- package/useAsyncValidator/component.mjs +5 -29
- package/useAsyncValidator.cjs +5 -29
- package/useAsyncValidator.d.cts +1 -1
- package/useAsyncValidator.d.mts +1 -1
- package/useAsyncValidator.d.ts +1 -1
- package/useAsyncValidator.iife.js +5 -29
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +5 -29
- package/useAxios.cjs +8 -25
- package/useAxios.d.cts +1 -1
- package/useAxios.d.mts +1 -1
- package/useAxios.d.ts +1 -1
- package/useAxios.iife.js +8 -25
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +8 -25
- package/useChangeCase.d.cts +2 -14
- package/useChangeCase.d.mts +2 -14
- package/useChangeCase.d.ts +2 -14
- package/useCookies.cjs +2 -18
- package/useCookies.iife.js +2 -18
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +2 -18
- package/useDrauu.cjs +8 -43
- package/useDrauu.d.cts +1 -1
- package/useDrauu.d.mts +1 -1
- package/useDrauu.d.ts +1 -1
- package/useDrauu.iife.js +8 -43
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +8 -43
- package/useFocusTrap/component.d.cts +1 -1
- package/useFocusTrap/component.d.mts +1 -1
- package/useFocusTrap/component.d.ts +1 -1
- package/useFocusTrap.cjs +4 -34
- package/useFocusTrap.d.cts +1 -1
- package/useFocusTrap.d.mts +1 -1
- package/useFocusTrap.d.ts +1 -1
- package/useFocusTrap.iife.js +4 -34
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +4 -34
- package/useFuse.cjs +5 -9
- package/useFuse.d.cts +1 -1
- package/useFuse.d.mts +1 -1
- package/useFuse.d.ts +1 -1
- package/useFuse.iife.js +5 -9
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +5 -9
- package/useIDBKeyval.cjs +17 -19
- package/useIDBKeyval.d.cts +8 -6
- package/useIDBKeyval.d.mts +8 -6
- package/useIDBKeyval.d.ts +8 -6
- package/useIDBKeyval.iife.js +18 -21
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +18 -20
- package/useJwt.cjs +1 -1
- package/useJwt.d.cts +1 -1
- package/useJwt.d.mts +1 -1
- package/useJwt.d.ts +1 -1
- package/useJwt.iife.js +1 -1
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +1 -1
- package/useNProgress.d.cts +1 -1
- package/useNProgress.d.mts +1 -1
- package/useNProgress.d.ts +1 -1
- package/useSortable/component.cjs +13 -36
- package/useSortable/component.mjs +14 -37
- package/useSortable.cjs +13 -36
- package/useSortable.d.cts +1 -1
- package/useSortable.d.mts +1 -1
- package/useSortable.d.ts +1 -1
- package/useSortable.iife.js +13 -36
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +14 -37
package/useFuse.cjs
CHANGED
|
@@ -6,18 +6,14 @@ var shared = require('@vueuse/shared');
|
|
|
6
6
|
|
|
7
7
|
function useFuse(search, data, options) {
|
|
8
8
|
const createFuse = () => {
|
|
9
|
-
var _a, _b;
|
|
10
9
|
return new Fuse(
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
shared.toValue(data) ?? [],
|
|
11
|
+
shared.toValue(options)?.fuseOptions
|
|
13
12
|
);
|
|
14
13
|
};
|
|
15
14
|
const fuse = vueDemi.ref(createFuse());
|
|
16
15
|
vueDemi.watch(
|
|
17
|
-
() =>
|
|
18
|
-
var _a;
|
|
19
|
-
return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
20
|
-
},
|
|
16
|
+
() => shared.toValue(options)?.fuseOptions,
|
|
21
17
|
() => {
|
|
22
18
|
fuse.value = createFuse();
|
|
23
19
|
},
|
|
@@ -32,9 +28,9 @@ function useFuse(search, data, options) {
|
|
|
32
28
|
);
|
|
33
29
|
const results = vueDemi.computed(() => {
|
|
34
30
|
const resolved = shared.toValue(options);
|
|
35
|
-
if (
|
|
31
|
+
if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
|
|
36
32
|
return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
37
|
-
const limit = resolved
|
|
33
|
+
const limit = resolved?.resultLimit;
|
|
38
34
|
return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
|
|
39
35
|
});
|
|
40
36
|
return {
|
package/useFuse.d.cts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useFuse.d.mts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useFuse.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useFuse.iife.js
CHANGED
|
@@ -119,18 +119,14 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
119
119
|
|
|
120
120
|
function useFuse(search, data, options) {
|
|
121
121
|
const createFuse = () => {
|
|
122
|
-
var _a, _b;
|
|
123
122
|
return new Fuse(
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
shared.toValue(data) ?? [],
|
|
124
|
+
shared.toValue(options)?.fuseOptions
|
|
126
125
|
);
|
|
127
126
|
};
|
|
128
127
|
const fuse = vueDemi.ref(createFuse());
|
|
129
128
|
vueDemi.watch(
|
|
130
|
-
() =>
|
|
131
|
-
var _a;
|
|
132
|
-
return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
133
|
-
},
|
|
129
|
+
() => shared.toValue(options)?.fuseOptions,
|
|
134
130
|
() => {
|
|
135
131
|
fuse.value = createFuse();
|
|
136
132
|
},
|
|
@@ -145,9 +141,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
145
141
|
);
|
|
146
142
|
const results = vueDemi.computed(() => {
|
|
147
143
|
const resolved = shared.toValue(options);
|
|
148
|
-
if (
|
|
144
|
+
if (resolved?.matchAllWhenSearchEmpty && !shared.toValue(search))
|
|
149
145
|
return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
150
|
-
const limit = resolved
|
|
146
|
+
const limit = resolved?.resultLimit;
|
|
151
147
|
return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
|
|
152
148
|
});
|
|
153
149
|
return {
|
package/useFuse.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,t,
|
|
1
|
+
var VueDemi=function(n,t,u){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let r=function(o,f){var s,l={},a={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(i,c){return l[i]=c,this},directive:function(i,c){return c?(t.directive(i,c),a):t.directive(i)},mount:function(i,c){return s||(s=new t(Object.assign({propsData:f},o,{provide:Object.assign(l,o.provide)})),s.$mount(i,c),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var v=r;for(var e in t)n[e]=t[e];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=r}else if(t.version.slice(0,2)==="2.")if(u){for(var e in u)n[e]=u[e];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var e in t)n[e]=t[e];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(r,o,f){return Array.isArray(r)?(r.length=Math.max(r.length,o),r.splice(o,1,f),f):(r[o]=f,f)},n.del=function(r,o){if(Array.isArray(r)){r.splice(o,1);return}delete r[o]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,t,u,e){"use strict";function v(r,o,f){const s=()=>new t(e.toValue(o)??[],e.toValue(f)?.fuseOptions),l=u.ref(s());u.watch(()=>e.toValue(f)?.fuseOptions,()=>{l.value=s()},{deep:!0}),u.watch(()=>e.toValue(o),i=>{l.value.setCollection(i)},{deep:!0});const a=u.computed(()=>{const i=e.toValue(f);if(i?.matchAllWhenSearchEmpty&&!e.toValue(r))return e.toValue(o).map((d,p)=>({item:d,refIndex:p}));const c=i?.resultLimit;return l.value.search(e.toValue(r),c?{limit:c}:void 0)});return{fuse:l,results:a}}n.useFuse=v})(this.VueUse=this.VueUse||{},Fuse,VueDemi,VueUse);
|
package/useFuse.mjs
CHANGED
|
@@ -4,18 +4,14 @@ import { toValue } from '@vueuse/shared';
|
|
|
4
4
|
|
|
5
5
|
function useFuse(search, data, options) {
|
|
6
6
|
const createFuse = () => {
|
|
7
|
-
var _a, _b;
|
|
8
7
|
return new Fuse(
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
toValue(data) ?? [],
|
|
9
|
+
toValue(options)?.fuseOptions
|
|
11
10
|
);
|
|
12
11
|
};
|
|
13
12
|
const fuse = ref(createFuse());
|
|
14
13
|
watch(
|
|
15
|
-
() =>
|
|
16
|
-
var _a;
|
|
17
|
-
return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
18
|
-
},
|
|
14
|
+
() => toValue(options)?.fuseOptions,
|
|
19
15
|
() => {
|
|
20
16
|
fuse.value = createFuse();
|
|
21
17
|
},
|
|
@@ -30,9 +26,9 @@ function useFuse(search, data, options) {
|
|
|
30
26
|
);
|
|
31
27
|
const results = computed(() => {
|
|
32
28
|
const resolved = toValue(options);
|
|
33
|
-
if (
|
|
29
|
+
if (resolved?.matchAllWhenSearchEmpty && !toValue(search))
|
|
34
30
|
return toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
35
|
-
const limit = resolved
|
|
31
|
+
const limit = resolved?.resultLimit;
|
|
36
32
|
return fuse.value.search(toValue(search), limit ? { limit } : void 0);
|
|
37
33
|
});
|
|
38
34
|
return {
|
package/useIDBKeyval.cjs
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var shared = require('@vueuse/shared');
|
|
4
|
+
var core = require('@vueuse/core');
|
|
4
5
|
var vueDemi = require('vue-demi');
|
|
5
6
|
var idbKeyval = require('idb-keyval');
|
|
6
7
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
8
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
24
9
|
const {
|
|
25
10
|
flush = "pre",
|
|
@@ -56,7 +41,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
56
41
|
if (Array.isArray(data.value))
|
|
57
42
|
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
58
43
|
else if (typeof data.value === "object")
|
|
59
|
-
await idbKeyval.update(key, () =>
|
|
44
|
+
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
60
45
|
else
|
|
61
46
|
await idbKeyval.update(key, () => data.value);
|
|
62
47
|
}
|
|
@@ -64,8 +49,21 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
64
49
|
onError(e);
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
const {
|
|
53
|
+
pause: pauseWatch,
|
|
54
|
+
resume: resumeWatch
|
|
55
|
+
} = core.watchPausable(data, () => write(), { flush, deep });
|
|
56
|
+
async function setData(value) {
|
|
57
|
+
pauseWatch();
|
|
58
|
+
data.value = value;
|
|
59
|
+
await write();
|
|
60
|
+
resumeWatch();
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
set: setData,
|
|
64
|
+
isFinished,
|
|
65
|
+
data
|
|
66
|
+
};
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
exports.useIDBKeyval = useIDBKeyval;
|
package/useIDBKeyval.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.iife.js
CHANGED
|
@@ -114,25 +114,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
114
114
|
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
115
115
|
);
|
|
116
116
|
;
|
|
117
|
-
;(function (exports, shared, vueDemi, idbKeyval) {
|
|
117
|
+
;(function (exports, shared, core, vueDemi, idbKeyval) {
|
|
118
118
|
'use strict';
|
|
119
119
|
|
|
120
|
-
var __defProp = Object.defineProperty;
|
|
121
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
122
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
123
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
124
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
125
|
-
var __spreadValues = (a, b) => {
|
|
126
|
-
for (var prop in b || (b = {}))
|
|
127
|
-
if (__hasOwnProp.call(b, prop))
|
|
128
|
-
__defNormalProp(a, prop, b[prop]);
|
|
129
|
-
if (__getOwnPropSymbols)
|
|
130
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
131
|
-
if (__propIsEnum.call(b, prop))
|
|
132
|
-
__defNormalProp(a, prop, b[prop]);
|
|
133
|
-
}
|
|
134
|
-
return a;
|
|
135
|
-
};
|
|
136
120
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
137
121
|
const {
|
|
138
122
|
flush = "pre",
|
|
@@ -169,7 +153,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
169
153
|
if (Array.isArray(data.value))
|
|
170
154
|
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
171
155
|
else if (typeof data.value === "object")
|
|
172
|
-
await idbKeyval.update(key, () =>
|
|
156
|
+
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
173
157
|
else
|
|
174
158
|
await idbKeyval.update(key, () => data.value);
|
|
175
159
|
}
|
|
@@ -177,10 +161,23 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
177
161
|
onError(e);
|
|
178
162
|
}
|
|
179
163
|
}
|
|
180
|
-
|
|
181
|
-
|
|
164
|
+
const {
|
|
165
|
+
pause: pauseWatch,
|
|
166
|
+
resume: resumeWatch
|
|
167
|
+
} = core.watchPausable(data, () => write(), { flush, deep });
|
|
168
|
+
async function setData(value) {
|
|
169
|
+
pauseWatch();
|
|
170
|
+
data.value = value;
|
|
171
|
+
await write();
|
|
172
|
+
resumeWatch();
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
set: setData,
|
|
176
|
+
isFinished,
|
|
177
|
+
data
|
|
178
|
+
};
|
|
182
179
|
}
|
|
183
180
|
|
|
184
181
|
exports.useIDBKeyval = useIDBKeyval;
|
|
185
182
|
|
|
186
|
-
})(this.VueUse = this.VueUse || {}, VueUse, VueDemi, idbKeyval);
|
|
183
|
+
})(this.VueUse = this.VueUse || {}, VueUse, VueUse, VueDemi, idbKeyval);
|
package/useIDBKeyval.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
1
|
+
var VueDemi=function(n,e,d){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let s=function(t,f){var i,v={},p={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(l,c){return v[l]=c,this},directive:function(l,c){return c?(e.directive(l,c),p):e.directive(l)},mount:function(l,c){return i||(i=new e(Object.assign({propsData:f},t,{provide:Object.assign(v,t.provide)})),i.$mount(l,c),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return p};var u=s;for(var r in e)n[r]=e[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=s}else if(e.version.slice(0,2)==="2.")if(d){for(var r in d)n[r]=d[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(e.version.slice(0,2)==="3."){for(var r in e)n[r]=e[r];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(s,t,f){return Array.isArray(s)?(s.length=Math.max(s.length,t),s.splice(t,1,f),f):(s[t]=f,f)},n.del=function(s,t){if(Array.isArray(s)){s.splice(t,1);return}delete s[t]}}else console.error("[vue-demi] Vue version "+e.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,e,d,r,u){"use strict";function s(t,f,i={}){const{flush:v="pre",deep:p=!0,shallow:l=!1,onError:c=a=>{console.error(a)},writeDefaults:I=!0}=i,w=r.ref(!1),o=(l?r.shallowRef:r.ref)(f),h=e.toValue(f);async function y(){try{const a=await u.get(t);a===void 0?h!=null&&I&&await u.set(t,h):o.value=a}catch(a){c(a)}w.value=!0}y();async function A(){try{o.value==null?await u.del(t):Array.isArray(o.value)?await u.update(t,()=>JSON.parse(JSON.stringify(o.value))):typeof o.value=="object"?await u.update(t,()=>({...o.value})):await u.update(t,()=>o.value)}catch(a){c(a)}}const{pause:b,resume:j}=d.watchPausable(o,()=>A(),{flush:v,deep:p});async function x(a){b(),o.value=a,await A(),j()}return{set:x,isFinished:w,data:o}}n.useIDBKeyval=s})(this.VueUse=this.VueUse||{},VueUse,VueUse,VueDemi,idbKeyval);
|
package/useIDBKeyval.mjs
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { toValue } from '@vueuse/shared';
|
|
2
|
-
import {
|
|
2
|
+
import { watchPausable } from '@vueuse/core';
|
|
3
|
+
import { ref, shallowRef } from 'vue-demi';
|
|
3
4
|
import { get, set, del, update } from 'idb-keyval';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
6
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
22
7
|
const {
|
|
23
8
|
flush = "pre",
|
|
@@ -54,7 +39,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
54
39
|
if (Array.isArray(data.value))
|
|
55
40
|
await update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
56
41
|
else if (typeof data.value === "object")
|
|
57
|
-
await update(key, () =>
|
|
42
|
+
await update(key, () => ({ ...data.value }));
|
|
58
43
|
else
|
|
59
44
|
await update(key, () => data.value);
|
|
60
45
|
}
|
|
@@ -62,8 +47,21 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
62
47
|
onError(e);
|
|
63
48
|
}
|
|
64
49
|
}
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
const {
|
|
51
|
+
pause: pauseWatch,
|
|
52
|
+
resume: resumeWatch
|
|
53
|
+
} = watchPausable(data, () => write(), { flush, deep });
|
|
54
|
+
async function setData(value) {
|
|
55
|
+
pauseWatch();
|
|
56
|
+
data.value = value;
|
|
57
|
+
await write();
|
|
58
|
+
resumeWatch();
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
set: setData,
|
|
62
|
+
isFinished,
|
|
63
|
+
data
|
|
64
|
+
};
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
export { useIDBKeyval };
|
package/useJwt.cjs
CHANGED
package/useJwt.d.cts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
27
|
declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
|
|
28
28
|
|
|
29
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|
package/useJwt.d.mts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
27
|
declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
|
|
28
28
|
|
|
29
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|
package/useJwt.d.ts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
27
|
declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
|
|
28
28
|
|
|
29
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|
package/useJwt.iife.js
CHANGED
package/useJwt.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,r,d){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let t=function(o,e){var s,l={},a={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(c,f){return l[c]=f,this},directive:function(c,f){return f?(r.directive(c,f),a):r.directive(c)},mount:function(c,f){return s||(s=new r(Object.assign({propsData:e},o,{provide:Object.assign(l,o.provide)})),s.$mount(c,f),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var u=t;for(var i in r)n[i]=r[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=t}else if(r.version.slice(0,2)==="2.")if(d){for(var i in d)n[i]=d[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var i in r)n[i]=r[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(t,o,e){return Array.isArray(t)?(t.length=Math.max(t.length,o),t.splice(o,1,e),e):(t[o]=e,e)},n.del=function(t,o){if(Array.isArray(t)){t.splice(o,1);return}delete t[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,r,d,i){"use strict";function u(t,o={}){const{onError:e,fallbackValue:s=null}=o,l=(f,
|
|
1
|
+
var VueDemi=function(n,r,d){if(n.install)return n;if(!r)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(r.version.slice(0,4)==="2.7."){let t=function(o,e){var s,l={},a={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(c,f){return l[c]=f,this},directive:function(c,f){return f?(r.directive(c,f),a):r.directive(c)},mount:function(c,f){return s||(s=new r(Object.assign({propsData:e},o,{provide:Object.assign(l,o.provide)})),s.$mount(c,f),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return a};var u=t;for(var i in r)n[i]=r[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.warn=r.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=t}else if(r.version.slice(0,2)==="2.")if(d){for(var i in d)n[i]=d[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(r.version.slice(0,2)==="3."){for(var i in r)n[i]=r[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(t,o,e){return Array.isArray(t)?(t.length=Math.max(t.length,o),t.splice(o,1,e),e):(t[o]=e,e)},n.del=function(t,o){if(Array.isArray(t)){t.splice(o,1);return}delete t[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,r,d,i){"use strict";function u(t,o={}){const{onError:e,fallbackValue:s=null}=o,l=(f,p)=>{try{return i(f,p)}catch(v){return e?.(v),s}},a=r.computed(()=>l(d.toValue(t),{header:!0})),c=r.computed(()=>l(d.toValue(t)));return{header:a,payload:c}}n.useJwt=u})(this.VueUse=this.VueUse||{},VueDemi,VueUse,jwt_decode);
|
package/useJwt.mjs
CHANGED
package/useNProgress.d.cts
CHANGED
|
@@ -17,4 +17,4 @@ declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null |
|
|
|
17
17
|
};
|
|
18
18
|
type UseNProgressReturn = ReturnType<typeof useNProgress>;
|
|
19
19
|
|
|
20
|
-
export { UseNProgressOptions, UseNProgressReturn, useNProgress };
|
|
20
|
+
export { type UseNProgressOptions, type UseNProgressReturn, useNProgress };
|
package/useNProgress.d.mts
CHANGED
|
@@ -17,4 +17,4 @@ declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null |
|
|
|
17
17
|
};
|
|
18
18
|
type UseNProgressReturn = ReturnType<typeof useNProgress>;
|
|
19
19
|
|
|
20
|
-
export { UseNProgressOptions, UseNProgressReturn, useNProgress };
|
|
20
|
+
export { type UseNProgressOptions, type UseNProgressReturn, useNProgress };
|
package/useNProgress.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ declare function useNProgress(currentProgress?: MaybeRefOrGetter<number | null |
|
|
|
17
17
|
};
|
|
18
18
|
type UseNProgressReturn = ReturnType<typeof useNProgress>;
|
|
19
19
|
|
|
20
|
-
export { UseNProgressOptions, UseNProgressReturn, useNProgress };
|
|
20
|
+
export { type UseNProgressOptions, type UseNProgressReturn, useNProgress };
|
|
@@ -4,64 +4,41 @@ var vueDemi = require('vue-demi');
|
|
|
4
4
|
var core = require('@vueuse/core');
|
|
5
5
|
var Sortable = require('sortablejs');
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __objRest = (source, exclude) => {
|
|
24
|
-
var target = {};
|
|
25
|
-
for (var prop in source)
|
|
26
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
-
target[prop] = source[prop];
|
|
28
|
-
if (source != null && __getOwnPropSymbols)
|
|
29
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
-
target[prop] = source[prop];
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
7
|
function useSortable(el, list, options = {}) {
|
|
36
8
|
let sortable;
|
|
37
|
-
const
|
|
9
|
+
const { document = core.defaultDocument, ...resetOptions } = options;
|
|
38
10
|
const defaultOptions = {
|
|
39
11
|
onUpdate: (e) => {
|
|
40
12
|
moveArrayElement(list, e.oldIndex, e.newIndex);
|
|
41
13
|
}
|
|
42
14
|
};
|
|
43
15
|
const start = () => {
|
|
44
|
-
const target = typeof el === "string" ? document
|
|
16
|
+
const target = typeof el === "string" ? document?.querySelector(el) : core.unrefElement(el);
|
|
45
17
|
if (!target)
|
|
46
18
|
return;
|
|
47
|
-
sortable = new Sortable(target,
|
|
19
|
+
sortable = new Sortable(target, { ...defaultOptions, ...resetOptions });
|
|
48
20
|
};
|
|
49
|
-
const stop = () => sortable
|
|
21
|
+
const stop = () => sortable?.destroy();
|
|
50
22
|
const option = (name, value) => {
|
|
51
23
|
if (value !== void 0)
|
|
52
|
-
sortable
|
|
24
|
+
sortable?.option(name, value);
|
|
53
25
|
else
|
|
54
|
-
return sortable
|
|
26
|
+
return sortable?.option(name);
|
|
55
27
|
};
|
|
56
28
|
core.tryOnMounted(start);
|
|
57
29
|
core.tryOnScopeDispose(stop);
|
|
58
30
|
return { stop, start, option };
|
|
59
31
|
}
|
|
60
32
|
function moveArrayElement(list, from, to) {
|
|
61
|
-
const
|
|
33
|
+
const _valueIsRef = vueDemi.isRef(list);
|
|
34
|
+
const array = _valueIsRef ? [...core.toValue(list)] : core.toValue(list);
|
|
62
35
|
if (to >= 0 && to < array.length) {
|
|
63
36
|
const element = array.splice(from, 1)[0];
|
|
64
|
-
vueDemi.nextTick(() =>
|
|
37
|
+
vueDemi.nextTick(() => {
|
|
38
|
+
array.splice(to, 0, element);
|
|
39
|
+
if (_valueIsRef)
|
|
40
|
+
list.value = array;
|
|
41
|
+
});
|
|
65
42
|
}
|
|
66
43
|
}
|
|
67
44
|
|