@vueuse/integrations 10.7.2 → 10.9.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 +10 -9
- package/index.d.cts +8 -3
- package/index.d.mts +8 -3
- package/index.d.ts +8 -3
- package/index.iife.js +16 -11
- package/index.iife.min.js +1 -1
- package/index.mjs +11 -10
- package/package.json +7 -7
- package/useAsyncValidator.iife.js +6 -2
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAxios.cjs +4 -2
- package/useAxios.d.cts +6 -0
- package/useAxios.d.mts +6 -0
- package/useAxios.d.ts +6 -0
- package/useAxios.iife.js +10 -4
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +4 -2
- package/useChangeCase.iife.js +6 -2
- package/useChangeCase.iife.min.js +1 -1
- package/useCookies.iife.js +6 -2
- package/useCookies.iife.min.js +1 -1
- package/useDrauu.iife.js +6 -2
- package/useDrauu.iife.min.js +1 -1
- package/useFocusTrap.iife.js +6 -2
- package/useFocusTrap.iife.min.js +1 -1
- package/useFuse.iife.js +6 -2
- package/useFuse.iife.min.js +1 -1
- package/useIDBKeyval.cjs +1 -6
- package/useIDBKeyval.d.cts +1 -1
- package/useIDBKeyval.d.mts +1 -1
- package/useIDBKeyval.d.ts +1 -1
- package/useIDBKeyval.iife.js +7 -8
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +2 -7
- package/useJwt.iife.js +6 -2
- package/useJwt.iife.min.js +1 -1
- package/useNProgress.iife.js +6 -2
- package/useNProgress.iife.min.js +1 -1
- package/useQRCode.iife.js +6 -2
- package/useQRCode.iife.min.js +1 -1
- package/useSortable/component.cjs +5 -1
- package/useSortable/component.mjs +5 -1
- package/useSortable.cjs +5 -1
- package/useSortable.d.cts +1 -2
- package/useSortable.d.mts +1 -2
- package/useSortable.d.ts +1 -2
- package/useSortable.iife.js +11 -3
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +5 -1
package/index.cjs
CHANGED
|
@@ -88,7 +88,8 @@ function useAxios(...args) {
|
|
|
88
88
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
89
89
|
const defaultOptions = {
|
|
90
90
|
immediate: !!argsPlaceholder,
|
|
91
|
-
shallow: true
|
|
91
|
+
shallow: true,
|
|
92
|
+
abortPrevious: true
|
|
92
93
|
};
|
|
93
94
|
let defaultConfig = {};
|
|
94
95
|
let instance = axios;
|
|
@@ -156,7 +157,8 @@ function useAxios(...args) {
|
|
|
156
157
|
return promise;
|
|
157
158
|
}
|
|
158
159
|
resetData();
|
|
159
|
-
|
|
160
|
+
if (options.abortPrevious !== false)
|
|
161
|
+
abort();
|
|
160
162
|
loading(true);
|
|
161
163
|
executeCounter += 1;
|
|
162
164
|
const currentExecuteCounter = executeCounter;
|
|
@@ -516,12 +518,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
516
518
|
if (data.value == null) {
|
|
517
519
|
await idbKeyval.del(key);
|
|
518
520
|
} else {
|
|
519
|
-
|
|
520
|
-
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
521
|
-
else if (typeof data.value === "object")
|
|
522
|
-
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
523
|
-
else
|
|
524
|
-
await idbKeyval.update(key, () => data.value);
|
|
521
|
+
await idbKeyval.update(key, () => vueDemi.toRaw(data.value));
|
|
525
522
|
}
|
|
526
523
|
} catch (e) {
|
|
527
524
|
onError(e);
|
|
@@ -635,7 +632,11 @@ function useSortable(el, list, options = {}) {
|
|
|
635
632
|
};
|
|
636
633
|
core.tryOnMounted(start);
|
|
637
634
|
core.tryOnScopeDispose(stop);
|
|
638
|
-
return {
|
|
635
|
+
return {
|
|
636
|
+
stop,
|
|
637
|
+
start,
|
|
638
|
+
option
|
|
639
|
+
};
|
|
639
640
|
}
|
|
640
641
|
function moveArrayElement(list, from, to) {
|
|
641
642
|
const _valueIsRef = vueDemi.isRef(list);
|
package/index.d.cts
CHANGED
|
@@ -121,6 +121,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
121
121
|
* @default true
|
|
122
122
|
*/
|
|
123
123
|
shallow?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Abort previous request when a new request is made.
|
|
126
|
+
*
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
129
|
+
abortPrevious?: boolean;
|
|
124
130
|
/**
|
|
125
131
|
* Callback when error is caught.
|
|
126
132
|
*/
|
|
@@ -341,7 +347,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
341
347
|
interface UseIDBKeyvalReturn<T> {
|
|
342
348
|
data: RemovableRef<T>;
|
|
343
349
|
isFinished: Ref<boolean>;
|
|
344
|
-
set(value: T)
|
|
350
|
+
set: (value: T) => Promise<void>;
|
|
345
351
|
}
|
|
346
352
|
/**
|
|
347
353
|
*
|
|
@@ -412,8 +418,7 @@ interface UseSortableReturn {
|
|
|
412
418
|
* @param name a Sortable.Options property.
|
|
413
419
|
* @param value a value.
|
|
414
420
|
*/
|
|
415
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
416
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
421
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
417
422
|
}
|
|
418
423
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
419
424
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter$1<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/index.d.mts
CHANGED
|
@@ -121,6 +121,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
121
121
|
* @default true
|
|
122
122
|
*/
|
|
123
123
|
shallow?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Abort previous request when a new request is made.
|
|
126
|
+
*
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
129
|
+
abortPrevious?: boolean;
|
|
124
130
|
/**
|
|
125
131
|
* Callback when error is caught.
|
|
126
132
|
*/
|
|
@@ -341,7 +347,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
341
347
|
interface UseIDBKeyvalReturn<T> {
|
|
342
348
|
data: RemovableRef<T>;
|
|
343
349
|
isFinished: Ref<boolean>;
|
|
344
|
-
set(value: T)
|
|
350
|
+
set: (value: T) => Promise<void>;
|
|
345
351
|
}
|
|
346
352
|
/**
|
|
347
353
|
*
|
|
@@ -412,8 +418,7 @@ interface UseSortableReturn {
|
|
|
412
418
|
* @param name a Sortable.Options property.
|
|
413
419
|
* @param value a value.
|
|
414
420
|
*/
|
|
415
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
416
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
421
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
417
422
|
}
|
|
418
423
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
419
424
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter$1<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/index.d.ts
CHANGED
|
@@ -121,6 +121,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
121
121
|
* @default true
|
|
122
122
|
*/
|
|
123
123
|
shallow?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Abort previous request when a new request is made.
|
|
126
|
+
*
|
|
127
|
+
* @default true
|
|
128
|
+
*/
|
|
129
|
+
abortPrevious?: boolean;
|
|
124
130
|
/**
|
|
125
131
|
* Callback when error is caught.
|
|
126
132
|
*/
|
|
@@ -341,7 +347,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
341
347
|
interface UseIDBKeyvalReturn<T> {
|
|
342
348
|
data: RemovableRef<T>;
|
|
343
349
|
isFinished: Ref<boolean>;
|
|
344
|
-
set(value: T)
|
|
350
|
+
set: (value: T) => Promise<void>;
|
|
345
351
|
}
|
|
346
352
|
/**
|
|
347
353
|
*
|
|
@@ -412,8 +418,7 @@ interface UseSortableReturn {
|
|
|
412
418
|
* @param name a Sortable.Options property.
|
|
413
419
|
* @param value a value.
|
|
414
420
|
*/
|
|
415
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
416
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
421
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
417
422
|
}
|
|
418
423
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
419
424
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter$1<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/index.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -189,7 +193,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
189
193
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
190
194
|
const defaultOptions = {
|
|
191
195
|
immediate: !!argsPlaceholder,
|
|
192
|
-
shallow: true
|
|
196
|
+
shallow: true,
|
|
197
|
+
abortPrevious: true
|
|
193
198
|
};
|
|
194
199
|
let defaultConfig = {};
|
|
195
200
|
let instance = axios;
|
|
@@ -257,7 +262,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
257
262
|
return promise;
|
|
258
263
|
}
|
|
259
264
|
resetData();
|
|
260
|
-
|
|
265
|
+
if (options.abortPrevious !== false)
|
|
266
|
+
abort();
|
|
261
267
|
loading(true);
|
|
262
268
|
executeCounter += 1;
|
|
263
269
|
const currentExecuteCounter = executeCounter;
|
|
@@ -617,12 +623,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
617
623
|
if (data.value == null) {
|
|
618
624
|
await idbKeyval.del(key);
|
|
619
625
|
} else {
|
|
620
|
-
|
|
621
|
-
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
622
|
-
else if (typeof data.value === "object")
|
|
623
|
-
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
624
|
-
else
|
|
625
|
-
await idbKeyval.update(key, () => data.value);
|
|
626
|
+
await idbKeyval.update(key, () => vueDemi.toRaw(data.value));
|
|
626
627
|
}
|
|
627
628
|
} catch (e) {
|
|
628
629
|
onError(e);
|
|
@@ -736,7 +737,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
736
737
|
};
|
|
737
738
|
core.tryOnMounted(start);
|
|
738
739
|
core.tryOnScopeDispose(stop);
|
|
739
|
-
return {
|
|
740
|
+
return {
|
|
741
|
+
stop,
|
|
742
|
+
start,
|
|
743
|
+
option
|
|
744
|
+
};
|
|
740
745
|
}
|
|
741
746
|
function moveArrayElement(list, from, to) {
|
|
742
747
|
const _valueIsRef = vueDemi.isRef(list);
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(l,o,T){if(l.install)return l;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),l;if(o.version.slice(0,4)==="2.7."){let h=function(b,k){var C,B={},G={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,L){return B[E]=L,this},directive:function(E,L){return L?(o.directive(E,L),G):o.directive(E)},mount:function(E,L){return C||(C=new o(Object.assign({propsData:k},b,{provide:Object.assign(B,b.provide)})),C.$mount(E,L),C)},unmount:function(){C&&(C.$destroy(),C=void 0)}};return G};var j=h;for(var n in o)l[n]=o[n];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.warn=o.util.warn,l.hasInjectionContext=()=>!!l.getCurrentInstance(),l.createApp=h}else if(o.version.slice(0,2)==="2.")if(T){for(var n in T)l[n]=T[n];l.isVue2=!0,l.isVue3=!1,l.install=function(){},l.Vue=o,l.Vue2=o,l.version=o.version,l.hasInjectionContext=()=>!!l.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)l[n]=o[n];l.isVue2=!1,l.isVue3=!0,l.install=function(){},l.Vue=o,l.Vue2=void 0,l.version=o.version,l.set=function(h,b,k){return Array.isArray(h)?(h.length=Math.max(h.length,b),h.splice(b,1,k),k):(h[b]=k,k)},l.del=function(h,b){if(Array.isArray(h)){h.splice(b,1);return}delete h[b]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return l}(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(l,o,T,n,j,h,b,k,C,B,G,E,L,_,V,$){"use strict";const D=T.default||T;function ee(t,r,e={}){const{validateOption:a={},immediate:s=!0,manual:f=!1}=e,c=o.toRef(t),i=n.shallowRef(null),u=n.ref(!0),p=n.ref(!s||f),w=n.computed(()=>{var d;return((d=i.value)==null?void 0:d.errors)||[]}),y=n.computed(()=>{var d;return((d=i.value)==null?void 0:d.fields)||{}}),R=n.computed(()=>new D(o.toValue(r))),g=async()=>{u.value=!1,p.value=!1;try{await R.value.validate(c.value,a),p.value=!0,i.value=null}catch(d){i.value=d}finally{u.value=!0}return{pass:p.value,errorInfo:i.value,errors:w.value,errorFields:y.value}};f||n.watch([c,R],()=>g(),{immediate:s,deep:!0});const I={isFinished:u,pass:p,errors:w,errorInfo:i,errorFields:y,execute:g};function O(){return new Promise((d,S)=>{o.until(u).toBe(!0).then(()=>d(I)).catch(F=>S(F))})}return{...I,then(d,S){return O().then(d,S)}}}function te(...t){const r=typeof t[0]=="string"?t[0]:void 0,e=typeof r=="string"?1:0,a={immediate:!!e,shallow:!0};let s={},f=j,c=a;const i=A=>!!A?.request;t.length>0+e&&(i(t[0+e])?f=t[0+e]:s=t[0+e]),t.length>1+e&&i(t[1+e])&&(f=t[1+e]),(t.length===2+e&&!i(t[1+e])||t.length===3+e)&&(c=t[t.length-1]||a);const{initialData:u,shallow:p,onSuccess:w=o.noop,onError:y=o.noop,immediate:R,resetOnExecute:g=!1}=c,I=n.shallowRef(),O=(p?n.shallowRef:n.ref)(u),d=n.ref(!1),S=n.ref(!1),F=n.ref(!1),m=n.shallowRef(),N=j.CancelToken.source;let U=N();const v=A=>{d.value||!S.value||(U.cancel(A),U=N(),F.value=!0,S.value=!1,d.value=!1)},P=A=>{S.value=A,d.value=!A},ve=()=>{g&&(O.value=u)},q=()=>new Promise((A,W)=>{o.until(d).toBe(!0).then(()=>m.value?W(m.value):A(Y))}),J={then:(...A)=>q().then(...A),catch:(...A)=>q().catch(...A)};let Q=0;const X=(A=r,W={})=>{m.value=void 0;const Z=typeof A=="string"?A:r??W.url;if(Z===void 0)return m.value=new j.AxiosError(j.AxiosError.ERR_INVALID_URL),d.value=!0,J;ve(),v(),P(!0),Q+=1;const pe=Q;return F.value=!1,f(Z,{...s,...typeof A=="object"?A:W,cancelToken:U.token}).then(H=>{if(F.value)return;I.value=H;const K=H.data;O.value=K,w(K)}).catch(H=>{m.value=H,y(H)}).finally(()=>{var H;(H=c.onFinish)==null||H.call(c),pe===Q&&P(!1)}),J};R&&r&&X();const Y={response:I,data:O,error:m,isFinished:d,isLoading:S,cancel:v,isAborted:F,isCanceled:F,abort:v,execute:X};return{...Y,...J}}var x=Object.freeze({__proto__:null,camelCase:h.camelCase,capitalCase:h.capitalCase,constantCase:h.constantCase,dotCase:h.dotCase,headerCase:h.headerCase,noCase:h.noCase,paramCase:h.paramCase,pascalCase:h.pascalCase,pathCase:h.pathCase,sentenceCase:h.sentenceCase,snakeCase:h.snakeCase});function ne(t,r,e){if(typeof t=="function")return n.computed(()=>x[r](o.toValue(t),e));const a=n.ref(t);return n.computed({get(){return x[r](a.value,e)},set(s){a.value=s}})}function oe(t){const r=new b(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>z(e,{doNotParse:a,autoUpdateDependencies:s},r)}function z(t,{doNotParse:r=!1,autoUpdateDependencies:e=!1}={},a=new b){const s=e?[...t||[]]:t;let f=a.getAll({doNotParse:!0});const c=n.ref(0),i=()=>{const u=a.getAll({doNotParse:!0});ae(s||null,u,f)&&c.value++,f=u};return a.addChangeListener(i),o.tryOnScopeDispose(()=>{a.removeChangeListener(i)}),{get:(...u)=>(e&&s&&!s.includes(u[0])&&s.push(u[0]),c.value,a.get(u[0],{doNotParse:r,...u[1]})),getAll:(...u)=>(c.value,a.getAll({doNotParse:r,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ae(t,r,e){if(!t)return!0;for(const a of t)if(r[a]!==e[a])return!0;return!1}function le(t,r){const e=n.ref();let a=[];const s=C.createEventHook(),f=C.createEventHook(),c=C.createEventHook(),i=C.createEventHook(),u=C.createEventHook(),p=n.ref(!1),w=n.ref(!1),y=n.ref(!1),R=n.ref(!1),g=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...r?.brush});n.watch(g,()=>{const v=e.value;v&&(v.brush=g.value,v.mode=g.value.mode)},{deep:!0});const I=()=>{var v;return(v=e.value)==null?void 0:v.undo()},O=()=>{var v;return(v=e.value)==null?void 0:v.redo()},d=()=>{var v;return(v=e.value)==null?void 0:v.clear()},S=()=>{var v;return(v=e.value)==null?void 0:v.cancel()},F=v=>{var P;return(P=e.value)==null?void 0:P.load(v)},m=()=>{var v;return(v=e.value)==null?void 0:v.dump()},N=()=>{var v;a.forEach(P=>P()),(v=e.value)==null||v.unmount()},U=()=>{e.value&&(p.value=e.value.canUndo(),w.value=e.value.canRedo(),y.value=e.value.altPressed,R.value=e.value.shiftPressed)};return n.watch(()=>C.unrefElement(t),v=>{!v||typeof SVGSVGElement>"u"||!(v instanceof SVGSVGElement)||(e.value&&N(),e.value=k.createDrauu({el:v,...r}),U(),a=[e.value.on("canceled",()=>f.trigger()),e.value.on("committed",P=>c.trigger(P)),e.value.on("start",()=>i.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{U(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>N()),{drauuInstance:e,load:F,dump:m,clear:d,cancel:S,undo:I,redo:O,canUndo:p,canRedo:w,brush:g,onChanged:s.on,onCommitted:c.on,onStart:i.on,onEnd:u.on,onCanceled:f.on}}function re(t,r={}){let e;const{immediate:a,...s}=r,f=n.ref(!1),c=n.ref(!1),i=y=>e&&e.activate(y),u=y=>e&&e.deactivate(y),p=()=>{e&&(e.pause(),c.value=!0)},w=()=>{e&&(e.unpause(),c.value=!1)};return n.watch(()=>C.unrefElement(t),y=>{y&&(e=B.createFocusTrap(y,{...s,onActivate(){f.value=!0,r.onActivate&&r.onActivate()},onDeactivate(){f.value=!1,r.onDeactivate&&r.onDeactivate()}}),a&&i())},{flush:"post"}),C.tryOnScopeDispose(()=>u()),{hasFocus:f,isPaused:c,activate:i,deactivate:u,pause:p,unpause:w}}function se(t,r,e){const a=()=>{var c,i;return new G((c=o.toValue(r))!=null?c:[],(i=o.toValue(e))==null?void 0:i.fuseOptions)},s=n.ref(a());n.watch(()=>{var c;return(c=o.toValue(e))==null?void 0:c.fuseOptions},()=>{s.value=a()},{deep:!0}),n.watch(()=>o.toValue(r),c=>{s.value.setCollection(c)},{deep:!0});const f=n.computed(()=>{const c=o.toValue(e);if(c?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(r).map((u,p)=>({item:u,refIndex:p}));const i=c?.resultLimit;return s.value.search(o.toValue(t),i?{limit:i}:void 0)});return{fuse:s,results:f}}function ue(t,r,e={}){const{flush:a="pre",deep:s=!0,shallow:f=!1,onError:c=d=>{console.error(d)},writeDefaults:i=!0}=e,u=n.ref(!1),p=(f?n.shallowRef:n.ref)(r),w=o.toValue(r);async function y(){try{const d=await E.get(t);d===void 0?w!=null&&i&&await E.set(t,w):p.value=d}catch(d){c(d)}u.value=!0}y();async function R(){try{p.value==null?await E.del(t):Array.isArray(p.value)?await E.update(t,()=>JSON.parse(JSON.stringify(p.value))):typeof p.value=="object"?await E.update(t,()=>({...p.value})):await E.update(t,()=>p.value)}catch(d){c(d)}}const{pause:g,resume:I}=C.watchPausable(p,()=>R(),{flush:a,deep:s});async function O(d){g(),p.value=d,await R(),I()}return{set:O,isFinished:u,data:p}}function ce(t,r={}){const{onError:e,fallbackValue:a=null}=r,s=(i,u)=>{try{return L(i,u)}catch(p){return e?.(p),a}},f=n.computed(()=>s(o.toValue(t),{header:!0})),c=n.computed(()=>s(o.toValue(t)));return{header:f,payload:c}}function ie(t=null,r){const e=n.ref(t),a=n.computed({set:f=>f?_.start():_.done(),get:()=>typeof e.value=="number"&&e.value<1});r&&_.configure(r);const s=_.set;return _.set=f=>(e.value=f,s.call(_,f)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(_,e.value)}),o.tryOnScopeDispose(_.remove),{isLoading:a,progress:e,start:_.start,done:_.done,remove:()=>{e.value=null,_.remove()}}}function fe(t,r){const e=o.toRef(t),a=n.ref("");return n.watch(e,async s=>{e.value&&o.isClient&&(a.value=await V.toDataURL(s,r))},{immediate:!0}),a}function de(t,r,e={}){let a;const{document:s=C.defaultDocument,...f}=e,c={onUpdate:w=>{M(r,w.oldIndex,w.newIndex)}},i=()=>{const w=typeof t=="string"?s?.querySelector(t):C.unrefElement(t);!w||a!==void 0||(a=new $(w,{...c,...f}))},u=()=>{a?.destroy(),a=void 0},p=(w,y)=>{if(y!==void 0)a?.option(w,y);else return a?.option(w)};return C.tryOnMounted(i),C.tryOnScopeDispose(u),{stop:u,start:i,option:p}}function M(t,r,e){const a=n.isRef(t),s=a?[...C.toValue(t)]:C.toValue(t);if(e>=0&&e<s.length){const f=s.splice(r,1)[0];n.nextTick(()=>{s.splice(e,0,f),a&&(t.value=s)})}}l.createCookies=oe,l.moveArrayElement=M,l.useAsyncValidator=ee,l.useAxios=te,l.useChangeCase=ne,l.useCookies=z,l.useDrauu=le,l.useFocusTrap=re,l.useFuse=se,l.useIDBKeyval=ue,l.useJwt=ce,l.useNProgress=ie,l.useQRCode=fe,l.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
|
|
1
|
+
var VueDemi=function(r,o,T){if(r.install)return r;if(!o)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(o.version.slice(0,4)==="2.7."){let p=function(A,k){var h,G={},N={config:o.config,use:o.use.bind(o),mixin:o.mixin.bind(o),component:o.component.bind(o),provide:function(E,L){return G[E]=L,this},directive:function(E,L){return L?(o.directive(E,L),N):o.directive(E)},mount:function(E,L){return h||(h=new o(Object.assign({propsData:k},A,{provide:Object.assign(G,A.provide)})),h.$mount(E,L),h)},unmount:function(){h&&(h.$destroy(),h=void 0)}};return N};var j=p;for(var n in o)r[n]=o[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.warn=o.util.warn,r.hasInjectionContext=function(){return!!r.getCurrentInstance()},r.createApp=p}else if(o.version.slice(0,2)==="2.")if(T){for(var n in T)r[n]=T[n];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=o,r.Vue2=o,r.version=o.version,r.hasInjectionContext=function(){return!!r.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(o.version.slice(0,2)==="3."){for(var n in o)r[n]=o[n];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=o,r.Vue2=void 0,r.version=o.version,r.set=function(p,A,k){return Array.isArray(p)?(p.length=Math.max(p.length,A),p.splice(A,1,k),k):(p[A]=k,k)},r.del=function(p,A){if(Array.isArray(p)){p.splice(A,1);return}delete p[A]}}else console.error("[vue-demi] Vue version "+o.version+" is unsupported.");return r}(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(r,o,T,n,j,p,A,k,h,G,N,E,L,_,V,$){"use strict";const D=T.default||T;function ee(t,l,e={}){const{validateOption:a={},immediate:s=!0,manual:f=!1}=e,c=o.toRef(t),i=n.shallowRef(null),u=n.ref(!0),C=n.ref(!s||f),w=n.computed(()=>{var d;return((d=i.value)==null?void 0:d.errors)||[]}),y=n.computed(()=>{var d;return((d=i.value)==null?void 0:d.fields)||{}}),I=n.computed(()=>new D(o.toValue(l))),R=async()=>{u.value=!1,C.value=!1;try{await I.value.validate(c.value,a),C.value=!0,i.value=null}catch(d){i.value=d}finally{u.value=!0}return{pass:C.value,errorInfo:i.value,errors:w.value,errorFields:y.value}};f||n.watch([c,I],()=>R(),{immediate:s,deep:!0});const S={isFinished:u,pass:C,errors:w,errorInfo:i,errorFields:y,execute:R};function F(){return new Promise((d,g)=>{o.until(u).toBe(!0).then(()=>d(S)).catch(O=>g(O))})}return{...S,then(d,g){return F().then(d,g)}}}function te(...t){const l=typeof t[0]=="string"?t[0]:void 0,e=typeof l=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let s={},f=j,c=a;const i=b=>!!b?.request;t.length>0+e&&(i(t[0+e])?f=t[0+e]:s=t[0+e]),t.length>1+e&&i(t[1+e])&&(f=t[1+e]),(t.length===2+e&&!i(t[1+e])||t.length===3+e)&&(c=t[t.length-1]||a);const{initialData:u,shallow:C,onSuccess:w=o.noop,onError:y=o.noop,immediate:I,resetOnExecute:R=!1}=c,S=n.shallowRef(),F=(C?n.shallowRef:n.ref)(u),d=n.ref(!1),g=n.ref(!1),O=n.ref(!1),m=n.shallowRef(),B=j.CancelToken.source;let U=B();const v=b=>{d.value||!g.value||(U.cancel(b),U=B(),O.value=!0,g.value=!1,d.value=!1)},P=b=>{g.value=b,d.value=!b},ve=()=>{R&&(F.value=u)},J=()=>new Promise((b,W)=>{o.until(d).toBe(!0).then(()=>m.value?W(m.value):b(X))}),Q={then:(...b)=>J().then(...b),catch:(...b)=>J().catch(...b)};let x=0;const K=(b=l,W={})=>{m.value=void 0;const Y=typeof b=="string"?b:l??W.url;if(Y===void 0)return m.value=new j.AxiosError(j.AxiosError.ERR_INVALID_URL),d.value=!0,Q;ve(),c.abortPrevious!==!1&&v(),P(!0),x+=1;const pe=x;return O.value=!1,f(Y,{...s,...typeof b=="object"?b:W,cancelToken:U.token}).then(H=>{if(O.value)return;S.value=H;const Z=H.data;F.value=Z,w(Z)}).catch(H=>{m.value=H,y(H)}).finally(()=>{var H;(H=c.onFinish)==null||H.call(c),pe===x&&P(!1)}),Q};I&&l&&K();const X={response:S,data:F,error:m,isFinished:d,isLoading:g,cancel:v,isAborted:O,isCanceled:O,abort:v,execute:K};return{...X,...Q}}var z=Object.freeze({__proto__:null,camelCase:p.camelCase,capitalCase:p.capitalCase,constantCase:p.constantCase,dotCase:p.dotCase,headerCase:p.headerCase,noCase:p.noCase,paramCase:p.paramCase,pascalCase:p.pascalCase,pathCase:p.pathCase,sentenceCase:p.sentenceCase,snakeCase:p.snakeCase});function ne(t,l,e){if(typeof t=="function")return n.computed(()=>z[l](o.toValue(t),e));const a=n.ref(t);return n.computed({get(){return z[l](a.value,e)},set(s){a.value=s}})}function oe(t){const l=new A(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:s=!1}={})=>M(e,{doNotParse:a,autoUpdateDependencies:s},l)}function M(t,{doNotParse:l=!1,autoUpdateDependencies:e=!1}={},a=new A){const s=e?[...t||[]]:t;let f=a.getAll({doNotParse:!0});const c=n.ref(0),i=()=>{const u=a.getAll({doNotParse:!0});ae(s||null,u,f)&&c.value++,f=u};return a.addChangeListener(i),o.tryOnScopeDispose(()=>{a.removeChangeListener(i)}),{get:(...u)=>(e&&s&&!s.includes(u[0])&&s.push(u[0]),c.value,a.get(u[0],{doNotParse:l,...u[1]})),getAll:(...u)=>(c.value,a.getAll({doNotParse:l,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ae(t,l,e){if(!t)return!0;for(const a of t)if(l[a]!==e[a])return!0;return!1}function re(t,l){const e=n.ref();let a=[];const s=h.createEventHook(),f=h.createEventHook(),c=h.createEventHook(),i=h.createEventHook(),u=h.createEventHook(),C=n.ref(!1),w=n.ref(!1),y=n.ref(!1),I=n.ref(!1),R=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...l?.brush});n.watch(R,()=>{const v=e.value;v&&(v.brush=R.value,v.mode=R.value.mode)},{deep:!0});const S=()=>{var v;return(v=e.value)==null?void 0:v.undo()},F=()=>{var v;return(v=e.value)==null?void 0:v.redo()},d=()=>{var v;return(v=e.value)==null?void 0:v.clear()},g=()=>{var v;return(v=e.value)==null?void 0:v.cancel()},O=v=>{var P;return(P=e.value)==null?void 0:P.load(v)},m=()=>{var v;return(v=e.value)==null?void 0:v.dump()},B=()=>{var v;a.forEach(P=>P()),(v=e.value)==null||v.unmount()},U=()=>{e.value&&(C.value=e.value.canUndo(),w.value=e.value.canRedo(),y.value=e.value.altPressed,I.value=e.value.shiftPressed)};return n.watch(()=>h.unrefElement(t),v=>{!v||typeof SVGSVGElement>"u"||!(v instanceof SVGSVGElement)||(e.value&&B(),e.value=k.createDrauu({el:v,...l}),U(),a=[e.value.on("canceled",()=>f.trigger()),e.value.on("committed",P=>c.trigger(P)),e.value.on("start",()=>i.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{U(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>B()),{drauuInstance:e,load:O,dump:m,clear:d,cancel:g,undo:S,redo:F,canUndo:C,canRedo:w,brush:R,onChanged:s.on,onCommitted:c.on,onStart:i.on,onEnd:u.on,onCanceled:f.on}}function le(t,l={}){let e;const{immediate:a,...s}=l,f=n.ref(!1),c=n.ref(!1),i=y=>e&&e.activate(y),u=y=>e&&e.deactivate(y),C=()=>{e&&(e.pause(),c.value=!0)},w=()=>{e&&(e.unpause(),c.value=!1)};return n.watch(()=>h.unrefElement(t),y=>{y&&(e=G.createFocusTrap(y,{...s,onActivate(){f.value=!0,l.onActivate&&l.onActivate()},onDeactivate(){f.value=!1,l.onDeactivate&&l.onDeactivate()}}),a&&i())},{flush:"post"}),h.tryOnScopeDispose(()=>u()),{hasFocus:f,isPaused:c,activate:i,deactivate:u,pause:C,unpause:w}}function se(t,l,e){const a=()=>{var c,i;return new N((c=o.toValue(l))!=null?c:[],(i=o.toValue(e))==null?void 0:i.fuseOptions)},s=n.ref(a());n.watch(()=>{var c;return(c=o.toValue(e))==null?void 0:c.fuseOptions},()=>{s.value=a()},{deep:!0}),n.watch(()=>o.toValue(l),c=>{s.value.setCollection(c)},{deep:!0});const f=n.computed(()=>{const c=o.toValue(e);if(c?.matchAllWhenSearchEmpty&&!o.toValue(t))return o.toValue(l).map((u,C)=>({item:u,refIndex:C}));const i=c?.resultLimit;return s.value.search(o.toValue(t),i?{limit:i}:void 0)});return{fuse:s,results:f}}function ue(t,l,e={}){const{flush:a="pre",deep:s=!0,shallow:f=!1,onError:c=d=>{console.error(d)},writeDefaults:i=!0}=e,u=n.ref(!1),C=(f?n.shallowRef:n.ref)(l),w=o.toValue(l);async function y(){try{const d=await E.get(t);d===void 0?w!=null&&i&&await E.set(t,w):C.value=d}catch(d){c(d)}u.value=!0}y();async function I(){try{C.value==null?await E.del(t):await E.update(t,()=>n.toRaw(C.value))}catch(d){c(d)}}const{pause:R,resume:S}=h.watchPausable(C,()=>I(),{flush:a,deep:s});async function F(d){R(),C.value=d,await I(),S()}return{set:F,isFinished:u,data:C}}function ce(t,l={}){const{onError:e,fallbackValue:a=null}=l,s=(i,u)=>{try{return L(i,u)}catch(C){return e?.(C),a}},f=n.computed(()=>s(o.toValue(t),{header:!0})),c=n.computed(()=>s(o.toValue(t)));return{header:f,payload:c}}function ie(t=null,l){const e=n.ref(t),a=n.computed({set:f=>f?_.start():_.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&_.configure(l);const s=_.set;return _.set=f=>(e.value=f,s.call(_,f)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(_,e.value)}),o.tryOnScopeDispose(_.remove),{isLoading:a,progress:e,start:_.start,done:_.done,remove:()=>{e.value=null,_.remove()}}}function fe(t,l){const e=o.toRef(t),a=n.ref("");return n.watch(e,async s=>{e.value&&o.isClient&&(a.value=await V.toDataURL(s,l))},{immediate:!0}),a}function de(t,l,e={}){let a;const{document:s=h.defaultDocument,...f}=e,c={onUpdate:w=>{q(l,w.oldIndex,w.newIndex)}},i=()=>{const w=typeof t=="string"?s?.querySelector(t):h.unrefElement(t);!w||a!==void 0||(a=new $(w,{...c,...f}))},u=()=>{a?.destroy(),a=void 0},C=(w,y)=>{if(y!==void 0)a?.option(w,y);else return a?.option(w)};return h.tryOnMounted(i),h.tryOnScopeDispose(u),{stop:u,start:i,option:C}}function q(t,l,e){const a=n.isRef(t),s=a?[...h.toValue(t)]:h.toValue(t);if(e>=0&&e<s.length){const f=s.splice(l,1)[0];n.nextTick(()=>{s.splice(e,0,f),a&&(t.value=s)})}}r.createCookies=oe,r.moveArrayElement=q,r.useAsyncValidator=ee,r.useAxios=te,r.useChangeCase=ne,r.useCookies=M,r.useDrauu=re,r.useFocusTrap=le,r.useFuse=se,r.useIDBKeyval=ue,r.useJwt=ce,r.useNProgress=ie,r.useQRCode=fe,r.useSortable=de})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi,axios,changeCase,UniversalCookie,Drauu,VueUse,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toRef, toValue, until, noop, tryOnScopeDispose, isClient } from '@vueuse/shared';
|
|
2
2
|
import Schema from 'async-validator';
|
|
3
|
-
import { shallowRef, ref, computed, watch, watchEffect, isRef, nextTick } from 'vue-demi';
|
|
3
|
+
import { shallowRef, ref, computed, watch, toRaw, watchEffect, isRef, nextTick } from 'vue-demi';
|
|
4
4
|
import axios, { AxiosError } from 'axios';
|
|
5
5
|
import { camelCase, capitalCase, constantCase, dotCase, headerCase, noCase, paramCase, pascalCase, pathCase, sentenceCase, snakeCase } from 'change-case';
|
|
6
6
|
import Cookie from 'universal-cookie';
|
|
@@ -86,7 +86,8 @@ function useAxios(...args) {
|
|
|
86
86
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
87
87
|
const defaultOptions = {
|
|
88
88
|
immediate: !!argsPlaceholder,
|
|
89
|
-
shallow: true
|
|
89
|
+
shallow: true,
|
|
90
|
+
abortPrevious: true
|
|
90
91
|
};
|
|
91
92
|
let defaultConfig = {};
|
|
92
93
|
let instance = axios;
|
|
@@ -154,7 +155,8 @@ function useAxios(...args) {
|
|
|
154
155
|
return promise;
|
|
155
156
|
}
|
|
156
157
|
resetData();
|
|
157
|
-
|
|
158
|
+
if (options.abortPrevious !== false)
|
|
159
|
+
abort();
|
|
158
160
|
loading(true);
|
|
159
161
|
executeCounter += 1;
|
|
160
162
|
const currentExecuteCounter = executeCounter;
|
|
@@ -514,12 +516,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
514
516
|
if (data.value == null) {
|
|
515
517
|
await del(key);
|
|
516
518
|
} else {
|
|
517
|
-
|
|
518
|
-
await update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
519
|
-
else if (typeof data.value === "object")
|
|
520
|
-
await update(key, () => ({ ...data.value }));
|
|
521
|
-
else
|
|
522
|
-
await update(key, () => data.value);
|
|
519
|
+
await update(key, () => toRaw(data.value));
|
|
523
520
|
}
|
|
524
521
|
} catch (e) {
|
|
525
522
|
onError(e);
|
|
@@ -633,7 +630,11 @@ function useSortable(el, list, options = {}) {
|
|
|
633
630
|
};
|
|
634
631
|
tryOnMounted(start);
|
|
635
632
|
tryOnScopeDispose$1(stop);
|
|
636
|
-
return {
|
|
633
|
+
return {
|
|
634
|
+
stop,
|
|
635
|
+
start,
|
|
636
|
+
option
|
|
637
|
+
};
|
|
637
638
|
}
|
|
638
639
|
function moveArrayElement(list, from, to) {
|
|
639
640
|
const _valueIsRef = isRef(list);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/integrations",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.0",
|
|
4
4
|
"description": "Integration wrappers for utility libraries",
|
|
5
5
|
"author": "Anthony Fu <https://github.com/antfu>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -145,16 +145,16 @@
|
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
"dependencies": {
|
|
148
|
-
"@vueuse/core": "10.
|
|
149
|
-
"@vueuse/shared": "10.
|
|
150
|
-
"vue-demi": ">=0.14.
|
|
148
|
+
"@vueuse/core": "10.9.0",
|
|
149
|
+
"@vueuse/shared": "10.9.0",
|
|
150
|
+
"vue-demi": ">=0.14.7"
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
153
|
"@types/nprogress": "^0.2.3",
|
|
154
154
|
"@types/qrcode": "^1.5.5",
|
|
155
|
-
"@types/sortablejs": "^1.15.
|
|
155
|
+
"@types/sortablejs": "^1.15.8",
|
|
156
156
|
"async-validator": "^4.2.5",
|
|
157
|
-
"axios": "^1.6.
|
|
157
|
+
"axios": "^1.6.7",
|
|
158
158
|
"change-case": "^4.1.2",
|
|
159
159
|
"drauu": "^0.3.7",
|
|
160
160
|
"focus-trap": "^7.5.4",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"jwt-decode": "^3.1.2",
|
|
164
164
|
"nprogress": "^0.2.0",
|
|
165
165
|
"qrcode": "^1.5.3",
|
|
166
|
-
"sortablejs": "^1.15.
|
|
166
|
+
"sortablejs": "^1.15.2",
|
|
167
167
|
"universal-cookie": "^6.1.3"
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,r,
|
|
1
|
+
var VueDemi=function(n,r,u){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 e=function(o,c){var i,v={},d={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(a,l){return v[a]=l,this},directive:function(a,l){return l?(r.directive(a,l),d):r.directive(a)},mount:function(a,l){return i||(i=new r(Object.assign({propsData:c},o,{provide:Object.assign(v,o.provide)})),i.$mount(a,l),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return d};var A=e;for(var t in r)n[t]=r[t];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=function(){return!!n.getCurrentInstance()},n.createApp=e}else if(r.version.slice(0,2)==="2.")if(u){for(var t in u)n[t]=u[t];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=function(){return!!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 t in r)n[t]=r[t];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(e,o,c){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,c),c):(e[o]=c,c)},n.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[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,u,t){"use strict";const A=u.default||u;function e(o,c,i={}){const{validateOption:v={},immediate:d=!0,manual:a=!1}=i,l=r.toRef(o),f=t.shallowRef(null),p=t.ref(!0),h=t.ref(!d||a),b=t.computed(()=>{var s;return((s=f.value)==null?void 0:s.errors)||[]}),w=t.computed(()=>{var s;return((s=f.value)==null?void 0:s.fields)||{}}),I=t.computed(()=>new A(r.toValue(c))),x=async()=>{p.value=!1,h.value=!1;try{await I.value.validate(l.value,v),h.value=!0,f.value=null}catch(s){f.value=s}finally{p.value=!0}return{pass:h.value,errorInfo:f.value,errors:b.value,errorFields:w.value}};a||t.watch([l,I],()=>x(),{immediate:d,deep:!0});const C={isFinished:p,pass:h,errors:b,errorInfo:f,errorFields:w,execute:x};function j(){return new Promise((s,y)=>{r.until(p).toBe(!0).then(()=>s(C)).catch(F=>y(F))})}return{...C,then(s,y){return j().then(s,y)}}}n.useAsyncValidator=e})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,VueDemi);
|
package/useAxios.cjs
CHANGED
|
@@ -9,7 +9,8 @@ function useAxios(...args) {
|
|
|
9
9
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
10
10
|
const defaultOptions = {
|
|
11
11
|
immediate: !!argsPlaceholder,
|
|
12
|
-
shallow: true
|
|
12
|
+
shallow: true,
|
|
13
|
+
abortPrevious: true
|
|
13
14
|
};
|
|
14
15
|
let defaultConfig = {};
|
|
15
16
|
let instance = axios;
|
|
@@ -77,7 +78,8 @@ function useAxios(...args) {
|
|
|
77
78
|
return promise;
|
|
78
79
|
}
|
|
79
80
|
resetData();
|
|
80
|
-
|
|
81
|
+
if (options.abortPrevious !== false)
|
|
82
|
+
abort();
|
|
81
83
|
loading(true);
|
|
82
84
|
executeCounter += 1;
|
|
83
85
|
const currentExecuteCounter = executeCounter;
|
package/useAxios.d.cts
CHANGED
|
@@ -63,6 +63,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
65
|
shallow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Abort previous request when a new request is made.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
abortPrevious?: boolean;
|
|
66
72
|
/**
|
|
67
73
|
* Callback when error is caught.
|
|
68
74
|
*/
|
package/useAxios.d.mts
CHANGED
|
@@ -63,6 +63,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
65
|
shallow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Abort previous request when a new request is made.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
abortPrevious?: boolean;
|
|
66
72
|
/**
|
|
67
73
|
* Callback when error is caught.
|
|
68
74
|
*/
|
package/useAxios.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ interface UseAxiosOptions<T = any> {
|
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
65
|
shallow?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Abort previous request when a new request is made.
|
|
68
|
+
*
|
|
69
|
+
* @default true
|
|
70
|
+
*/
|
|
71
|
+
abortPrevious?: boolean;
|
|
66
72
|
/**
|
|
67
73
|
* Callback when error is caught.
|
|
68
74
|
*/
|
package/useAxios.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -122,7 +126,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
122
126
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
123
127
|
const defaultOptions = {
|
|
124
128
|
immediate: !!argsPlaceholder,
|
|
125
|
-
shallow: true
|
|
129
|
+
shallow: true,
|
|
130
|
+
abortPrevious: true
|
|
126
131
|
};
|
|
127
132
|
let defaultConfig = {};
|
|
128
133
|
let instance = axios;
|
|
@@ -190,7 +195,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
190
195
|
return promise;
|
|
191
196
|
}
|
|
192
197
|
resetData();
|
|
193
|
-
|
|
198
|
+
if (options.abortPrevious !== false)
|
|
199
|
+
abort();
|
|
194
200
|
loading(true);
|
|
195
201
|
executeCounter += 1;
|
|
196
202
|
const currentExecuteCounter = executeCounter;
|
package/useAxios.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(e,n,u){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let t=function(i,o){var
|
|
1
|
+
var VueDemi=function(e,n,u){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let t=function(i,o){var c,h={},d={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,f){return h[l]=f,this},directive:function(l,f){return f?(n.directive(l,f),d):n.directive(l)},mount:function(l,f){return c||(c=new n(Object.assign({propsData:o},i,{provide:Object.assign(h,i.provide)})),c.$mount(l,f),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return d};var P=t;for(var r in n)e[r]=n[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=function(){return!!e.getCurrentInstance()},e.createApp=t}else if(n.version.slice(0,2)==="2.")if(u){for(var r in u)e[r]=u[r];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=function(){return!!e.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var r in n)e[r]=n[r];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(t,i,o){return Array.isArray(t)?(t.length=Math.max(t.length,i),t.splice(i,1,o),o):(t[i]=o,o)},e.del=function(t,i){if(Array.isArray(t)){t.splice(i,1);return}delete t[i]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,u,r){"use strict";function P(...t){const i=typeof t[0]=="string"?t[0]:void 0,o=typeof i=="string"?1:0,c={immediate:!!o,shallow:!0,abortPrevious:!0};let h={},d=r,l=c;const f=s=>!!s?.request;t.length>0+o&&(f(t[0+o])?d=t[0+o]:h=t[0+o]),t.length>1+o&&f(t[1+o])&&(d=t[1+o]),(t.length===2+o&&!f(t[1+o])||t.length===3+o)&&(l=t[t.length-1]||c);const{initialData:R,shallow:U,onSuccess:$=u.noop,onError:q=u.noop,immediate:B,resetOnExecute:M=!1}=l,j=n.shallowRef(),y=(U?n.shallowRef:n.ref)(R),v=n.ref(!1),A=n.ref(!1),b=n.ref(!1),p=n.shallowRef(),O=r.CancelToken.source;let C=O();const x=s=>{v.value||!A.value||(C.cancel(s),C=O(),b.value=!0,A.value=!1,v.value=!1)},T=s=>{A.value=s,v.value=!s},N=()=>{M&&(y.value=R)},_=()=>new Promise((s,w)=>{u.until(v).toBe(!0).then(()=>p.value?w(p.value):s(F))}),I={then:(...s)=>_().then(...s),catch:(...s)=>_().catch(...s)};let E=0;const k=(s=i,w={})=>{p.value=void 0;const L=typeof s=="string"?s:i??w.url;if(L===void 0)return p.value=new r.AxiosError(r.AxiosError.ERR_INVALID_URL),v.value=!0,I;N(),l.abortPrevious!==!1&&x(),T(!0),E+=1;const z=E;return b.value=!1,d(L,{...h,...typeof s=="object"?s:w,cancelToken:C.token}).then(a=>{if(b.value)return;j.value=a;const S=a.data;y.value=S,$(S)}).catch(a=>{p.value=a,q(a)}).finally(()=>{var a;(a=l.onFinish)==null||a.call(l),z===E&&T(!1)}),I};B&&i&&k();const F={response:j,data:y,error:p,isFinished:v,isLoading:A,cancel:x,isAborted:b,isCanceled:b,abort:x,execute:k};return{...F,...I}}e.useAxios=P})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);
|
package/useAxios.mjs
CHANGED
|
@@ -7,7 +7,8 @@ function useAxios(...args) {
|
|
|
7
7
|
const argsPlaceholder = typeof url === "string" ? 1 : 0;
|
|
8
8
|
const defaultOptions = {
|
|
9
9
|
immediate: !!argsPlaceholder,
|
|
10
|
-
shallow: true
|
|
10
|
+
shallow: true,
|
|
11
|
+
abortPrevious: true
|
|
11
12
|
};
|
|
12
13
|
let defaultConfig = {};
|
|
13
14
|
let instance = axios;
|
|
@@ -75,7 +76,8 @@ function useAxios(...args) {
|
|
|
75
76
|
return promise;
|
|
76
77
|
}
|
|
77
78
|
resetData();
|
|
78
|
-
|
|
79
|
+
if (options.abortPrevious !== false)
|
|
80
|
+
abort();
|
|
79
81
|
loading(true);
|
|
80
82
|
executeCounter += 1;
|
|
81
83
|
const currentExecuteCounter = executeCounter;
|
package/useChangeCase.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
1
|
+
var VueDemi=function(n,e,a){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 r=function(t,i){var o,d={},l={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(f,c){return d[f]=c,this},directive:function(f,c){return c?(e.directive(f,c),l):e.directive(f)},mount:function(f,c){return o||(o=new e(Object.assign({propsData:i},t,{provide:Object.assign(d,t.provide)})),o.$mount(f,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return l};var u=r;for(var s in e)n[s]=e[s];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=function(){return!!n.getCurrentInstance()},n.createApp=r}else if(e.version.slice(0,2)==="2.")if(a){for(var s in a)n[s]=a[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.hasInjectionContext=function(){return!!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 s in e)n[s]=e[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(r,t,i){return Array.isArray(r)?(r.length=Math.max(r.length,t),r.splice(t,1,i),i):(r[t]=i,i)},n.del=function(r,t){if(Array.isArray(r)){r.splice(t,1);return}delete r[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,a,s){"use strict";var u=Object.freeze({__proto__:null,camelCase:s.camelCase,capitalCase:s.capitalCase,constantCase:s.constantCase,dotCase:s.dotCase,headerCase:s.headerCase,noCase:s.noCase,paramCase:s.paramCase,pascalCase:s.pascalCase,pathCase:s.pathCase,sentenceCase:s.sentenceCase,snakeCase:s.snakeCase});function r(t,i,o){if(typeof t=="function")return a.computed(()=>u[i](e.toValue(t),o));const d=a.ref(t);return a.computed({get(){return u[i](d.value,o)},set(l){d.value=l}})}n.useChangeCase=r})(this.VueUse=this.VueUse||{},VueUse,VueDemi,changeCase);
|
package/useCookies.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useCookies.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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(u,i){var o,a={},r={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(f,c){return a[f]=c,this},directive:function(f,c){return c?(e.directive(f,c),r):e.directive(f)},mount:function(f,c){return o||(o=new e(Object.assign({propsData:i},u,{provide:Object.assign(a,u.provide)})),o.$mount(f,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return r};var p=s;for(var l in e)n[l]=e[l];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=()
|
|
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(u,i){var o,a={},r={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(f,c){return a[f]=c,this},directive:function(f,c){return c?(e.directive(f,c),r):e.directive(f)},mount:function(f,c){return o||(o=new e(Object.assign({propsData:i},u,{provide:Object.assign(a,u.provide)})),o.$mount(f,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return r};var p=s;for(var l in e)n[l]=e[l];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=function(){return!!n.getCurrentInstance()},n.createApp=s}else if(e.version.slice(0,2)==="2.")if(d){for(var l in d)n[l]=d[l];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.hasInjectionContext=function(){return!!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 l in e)n[l]=e[l];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(s,u,i){return Array.isArray(s)?(s.length=Math.max(s.length,u),s.splice(u,1,i),i):(s[u]=i,i)},n.del=function(s,u){if(Array.isArray(s)){s.splice(u,1);return}delete s[u]}}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,l){"use strict";function p(i){const o=new l(i?i.headers.cookie:null);return(a,{doNotParse:r=!1,autoUpdateDependencies:f=!1}={})=>s(a,{doNotParse:r,autoUpdateDependencies:f},o)}function s(i,{doNotParse:o=!1,autoUpdateDependencies:a=!1}={},r=new l){const f=a?[...i||[]]:i;let c=r.getAll({doNotParse:!0});const v=d.ref(0),h=()=>{const t=r.getAll({doNotParse:!0});u(f||null,t,c)&&v.value++,c=t};return r.addChangeListener(h),e.tryOnScopeDispose(()=>{r.removeChangeListener(h)}),{get:(...t)=>(a&&f&&!f.includes(t[0])&&f.push(t[0]),v.value,r.get(t[0],{doNotParse:o,...t[1]})),getAll:(...t)=>(v.value,r.getAll({doNotParse:o,...t[0]})),set:(...t)=>r.set(...t),remove:(...t)=>r.remove(...t),addChangeListener:(...t)=>r.addChangeListener(...t),removeChangeListener:(...t)=>r.removeChangeListener(...t)}}function u(i,o,a){if(!i)return!0;for(const r of i)if(o[r]!==a[r])return!0;return!1}n.createCookies=p,n.useCookies=s})(this.VueUse=this.VueUse||{},VueUse,VueDemi,UniversalCookie);
|
package/useDrauu.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useDrauu.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,i){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,
|
|
1
|
+
var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,i){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,u){return f[l]=u,this},directive:function(l,u){return u?(n.directive(l,u),v):n.directive(l)},mount:function(l,u){return o||(o=new n(Object.assign({propsData:i},a,{provide:Object.assign(f,a.provide)})),o.$mount(l,u),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=function(){return!!e.getCurrentInstance()},e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=function(){return!!e.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,i){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,i),i):(s[a]=i,i)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(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(e,n,d,t,h){"use strict";function s(a,i){const o=n.ref();let f=[];const v=t.createEventHook(),l=t.createEventHook(),u=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...i?.brush});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var c;return(c=o.value)==null?void 0:c.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(c=>c()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...i}),H(),f=[o.value.on("canceled",()=>l.trigger()),o.value.on("committed",c=>u.trigger(c)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:u.on,onStart:g.on,onEnd:b.on,onCanceled:l.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,t,f){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(s,e){var o,l={},u={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(a,c){return l[a]=c,this},directive:function(a,c){return c?(t.directive(a,c),u):t.directive(a)},mount:function(a,c){return o||(o=new t(Object.assign({propsData:e},s,{provide:Object.assign(l,s.provide)})),o.$mount(a,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return u};var d=r;for(var i in t)n[i]=t[i];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=()
|
|
1
|
+
var VueDemi=function(n,t,f){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(s,e){var o,l={},u={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(a,c){return l[a]=c,this},directive:function(a,c){return c?(t.directive(a,c),u):t.directive(a)},mount:function(a,c){return o||(o=new t(Object.assign({propsData:e},s,{provide:Object.assign(l,s.provide)})),o.$mount(a,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return u};var d=r;for(var i in t)n[i]=t[i];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=function(){return!!n.getCurrentInstance()},n.createApp=r}else if(t.version.slice(0,2)==="2.")if(f){for(var i in f)n[i]=f[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=function(){return!!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 i in t)n[i]=t[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(r,s,e){return Array.isArray(r)?(r.length=Math.max(r.length,s),r.splice(s,1,e),e):(r[s]=e,e)},n.del=function(r,s){if(Array.isArray(r)){r.splice(s,1);return}delete r[s]}}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,f,i){"use strict";function d(r,s={}){let e;const{immediate:o,...l}=s,u=f.ref(!1),a=f.ref(!1),c=v=>e&&e.activate(v),p=v=>e&&e.deactivate(v),h=()=>{e&&(e.pause(),a.value=!0)},A=()=>{e&&(e.unpause(),a.value=!1)};return f.watch(()=>t.unrefElement(r),v=>{v&&(e=i.createFocusTrap(v,{...l,onActivate(){u.value=!0,s.onActivate&&s.onActivate()},onDeactivate(){u.value=!1,s.onDeactivate&&s.onDeactivate()}}),o&&c())},{flush:"post"}),t.tryOnScopeDispose(()=>p()),{hasFocus:u,isPaused:a,activate:c,deactivate:p,pause:h,unpause:A}}n.useFocusTrap=d})(this.VueUse=this.VueUse||{},VueUse,VueDemi,focusTrap);
|
package/useFuse.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useFuse.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,t,f){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 o=function(i,
|
|
1
|
+
var VueDemi=function(n,t,f){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 o=function(i,l){var u,c={},v={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(e,s){return c[e]=s,this},directive:function(e,s){return s?(t.directive(e,s),v):t.directive(e)},mount:function(e,s){return u||(u=new t(Object.assign({propsData:l},i,{provide:Object.assign(c,i.provide)})),u.$mount(e,s),u)},unmount:function(){u&&(u.$destroy(),u=void 0)}};return v};var a=o;for(var r in t)n[r]=t[r];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=function(){return!!n.getCurrentInstance()},n.createApp=o}else if(t.version.slice(0,2)==="2.")if(f){for(var r in f)n[r]=f[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=function(){return!!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 r in t)n[r]=t[r];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(o,i,l){return Array.isArray(o)?(o.length=Math.max(o.length,i),o.splice(i,1,l),l):(o[i]=l,l)},n.del=function(o,i){if(Array.isArray(o)){o.splice(i,1);return}delete o[i]}}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,f,r){"use strict";function a(o,i,l){const u=()=>{var e,s;return new t((e=r.toValue(i))!=null?e:[],(s=r.toValue(l))==null?void 0:s.fuseOptions)},c=f.ref(u());f.watch(()=>{var e;return(e=r.toValue(l))==null?void 0:e.fuseOptions},()=>{c.value=u()},{deep:!0}),f.watch(()=>r.toValue(i),e=>{c.value.setCollection(e)},{deep:!0});const v=f.computed(()=>{const e=r.toValue(l);if(e?.matchAllWhenSearchEmpty&&!r.toValue(o))return r.toValue(i).map((d,p)=>({item:d,refIndex:p}));const s=e?.resultLimit;return c.value.search(r.toValue(o),s?{limit:s}:void 0)});return{fuse:c,results:v}}n.useFuse=a})(this.VueUse=this.VueUse||{},Fuse,VueDemi,VueUse);
|
package/useIDBKeyval.cjs
CHANGED
|
@@ -38,12 +38,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
38
38
|
if (data.value == null) {
|
|
39
39
|
await idbKeyval.del(key);
|
|
40
40
|
} else {
|
|
41
|
-
|
|
42
|
-
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
43
|
-
else if (typeof data.value === "object")
|
|
44
|
-
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
45
|
-
else
|
|
46
|
-
await idbKeyval.update(key, () => data.value);
|
|
41
|
+
await idbKeyval.update(key, () => vueDemi.toRaw(data.value));
|
|
47
42
|
}
|
|
48
43
|
} catch (e) {
|
|
49
44
|
onError(e);
|
package/useIDBKeyval.d.cts
CHANGED
package/useIDBKeyval.d.mts
CHANGED
package/useIDBKeyval.d.ts
CHANGED
package/useIDBKeyval.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -150,12 +154,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
150
154
|
if (data.value == null) {
|
|
151
155
|
await idbKeyval.del(key);
|
|
152
156
|
} else {
|
|
153
|
-
|
|
154
|
-
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
155
|
-
else if (typeof data.value === "object")
|
|
156
|
-
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
157
|
-
else
|
|
158
|
-
await idbKeyval.update(key, () => data.value);
|
|
157
|
+
await idbKeyval.update(key, () => vueDemi.toRaw(data.value));
|
|
159
158
|
}
|
|
160
159
|
} catch (e) {
|
|
161
160
|
onError(e);
|
package/useIDBKeyval.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
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(s,a){var o,v={},p={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(f,c){return v[f]=c,this},directive:function(f,c){return c?(t.directive(f,c),p):t.directive(f)},mount:function(f,c){return o||(o=new t(Object.assign({propsData:a},s,{provide:Object.assign(v,s.provide)})),o.$mount(f,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return p};var d=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=function(){return!!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=function(){return!!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,s,a){return Array.isArray(r)?(r.length=Math.max(r.length,s),r.splice(s,1,a),a):(r[s]=a,a)},n.del=function(r,s){if(Array.isArray(r)){r.splice(s,1);return}delete r[s]}}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,d){"use strict";function r(s,a,o={}){const{flush:v="pre",deep:p=!0,shallow:f=!1,onError:c=i=>{console.error(i)},writeDefaults:b=!0}=o,w=e.ref(!1),l=(f?e.shallowRef:e.ref)(a),h=t.toValue(a);async function y(){try{const i=await d.get(s);i===void 0?h!=null&&b&&await d.set(s,h):l.value=i}catch(i){c(i)}w.value=!0}y();async function I(){try{l.value==null?await d.del(s):await d.update(s,()=>e.toRaw(l.value))}catch(i){c(i)}}const{pause:A,resume:x}=u.watchPausable(l,()=>I(),{flush:v,deep:p});async function C(i){A(),l.value=i,await I(),x()}return{set:C,isFinished:w,data:l}}n.useIDBKeyval=r})(this.VueUse=this.VueUse||{},VueUse,VueUse,VueDemi,idbKeyval);
|
package/useIDBKeyval.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toValue } from '@vueuse/shared';
|
|
2
2
|
import { watchPausable } from '@vueuse/core';
|
|
3
|
-
import { ref, shallowRef } from 'vue-demi';
|
|
3
|
+
import { ref, shallowRef, toRaw } from 'vue-demi';
|
|
4
4
|
import { get, set, del, update } from 'idb-keyval';
|
|
5
5
|
|
|
6
6
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
@@ -36,12 +36,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
36
36
|
if (data.value == null) {
|
|
37
37
|
await del(key);
|
|
38
38
|
} else {
|
|
39
|
-
|
|
40
|
-
await update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
41
|
-
else if (typeof data.value === "object")
|
|
42
|
-
await update(key, () => ({ ...data.value }));
|
|
43
|
-
else
|
|
44
|
-
await update(key, () => data.value);
|
|
39
|
+
await update(key, () => toRaw(data.value));
|
|
45
40
|
}
|
|
46
41
|
} catch (e) {
|
|
47
42
|
onError(e);
|
package/useJwt.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
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,
|
|
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,s){var e,l={},u={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),u):r.directive(c)},mount:function(c,f){return e||(e=new r(Object.assign({propsData:s},o,{provide:Object.assign(l,o.provide)})),e.$mount(c,f),e)},unmount:function(){e&&(e.$destroy(),e=void 0)}};return u};var a=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=function(){return!!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=function(){return!!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,s){return Array.isArray(t)?(t.length=Math.max(t.length,o),t.splice(o,1,s),s):(t[o]=s,s)},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 a(t,o={}){const{onError:s,fallbackValue:e=null}=o,l=(f,v)=>{try{return i(f,v)}catch(p){return s?.(p),e}},u=r.computed(()=>l(d.toValue(t),{header:!0})),c=r.computed(()=>l(d.toValue(t)));return{header:u,payload:c}}n.useJwt=a})(this.VueUse=this.VueUse||{},VueDemi,VueUse,jwt_decode);
|
package/useNProgress.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useNProgress.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(t,n,c){if(t.install)return t;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),t;if(n.version.slice(0,4)==="2.7."){let e=function(o,
|
|
1
|
+
var VueDemi=function(t,n,c){if(t.install)return t;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),t;if(n.version.slice(0,4)==="2.7."){let e=function(o,r){var s,a={},f={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,u){return a[l]=u,this},directive:function(l,u){return u?(n.directive(l,u),f):n.directive(l)},mount:function(l,u){return s||(s=new n(Object.assign({propsData:r},o,{provide:Object.assign(a,o.provide)})),s.$mount(l,u),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return f};var d=e;for(var i in n)t[i]=n[i];t.isVue2=!0,t.isVue3=!1,t.install=function(){},t.Vue=n,t.Vue2=n,t.version=n.version,t.warn=n.util.warn,t.hasInjectionContext=function(){return!!t.getCurrentInstance()},t.createApp=e}else if(n.version.slice(0,2)==="2.")if(c){for(var i in c)t[i]=c[i];t.isVue2=!0,t.isVue3=!1,t.install=function(){},t.Vue=n,t.Vue2=n,t.version=n.version,t.hasInjectionContext=function(){return!!t.getCurrentInstance()}}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var i in n)t[i]=n[i];t.isVue2=!1,t.isVue3=!0,t.install=function(){},t.Vue=n,t.Vue2=void 0,t.version=n.version,t.set=function(e,o,r){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,r),r):(e[o]=r,r)},t.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[o]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return t}(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(t,n,c,i){"use strict";function d(e=null,o){const r=i.ref(e),s=i.computed({set:f=>f?n.start():n.done(),get:()=>typeof r.value=="number"&&r.value<1});o&&n.configure(o);const a=n.set;return n.set=f=>(r.value=f,a.call(n,f)),i.watchEffect(()=>{typeof r.value=="number"&&c.isClient&&a.call(n,r.value)}),c.tryOnScopeDispose(n.remove),{isLoading:s,progress:r,start:n.start,done:n.done,remove:()=>{r.value=null,n.remove()}}}t.useNProgress=d})(this.VueUse=this.VueUse||{},nprogress,VueUse,VueDemi);
|
package/useQRCode.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
package/useQRCode.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
1
|
+
var VueDemi=function(n,r,f){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 i=function(t,e){var o,a={},l={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(c,d){return a[c]=d,this},directive:function(c,d){return d?(r.directive(c,d),l):r.directive(c)},mount:function(c,d){return o||(o=new r(Object.assign({propsData:e},t,{provide:Object.assign(a,t.provide)})),o.$mount(c,d),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return l};var u=i;for(var s in r)n[s]=r[s];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=function(){return!!n.getCurrentInstance()},n.createApp=i}else if(r.version.slice(0,2)==="2.")if(f){for(var s in f)n[s]=f[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version,n.hasInjectionContext=function(){return!!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 s in r)n[s]=r[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(i,t,e){return Array.isArray(i)?(i.length=Math.max(i.length,t),i.splice(t,1,e),e):(i[t]=e,e)},n.del=function(i,t){if(Array.isArray(i)){i.splice(t,1);return}delete i[t]}}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,f,s){"use strict";function u(i,t){const e=r.toRef(i),o=f.ref("");return f.watch(e,async a=>{e.value&&r.isClient&&(o.value=await s.toDataURL(a,t))},{immediate:!0}),o}n.useQRCode=u})(this.VueUse=this.VueUse||{},VueUse,VueDemi,QRCode);
|
|
@@ -30,7 +30,11 @@ function useSortable(el, list, options = {}) {
|
|
|
30
30
|
};
|
|
31
31
|
core.tryOnMounted(start);
|
|
32
32
|
core.tryOnScopeDispose(stop);
|
|
33
|
-
return {
|
|
33
|
+
return {
|
|
34
|
+
stop,
|
|
35
|
+
start,
|
|
36
|
+
option
|
|
37
|
+
};
|
|
34
38
|
}
|
|
35
39
|
function moveArrayElement(list, from, to) {
|
|
36
40
|
const _valueIsRef = vueDemi.isRef(list);
|
|
@@ -28,7 +28,11 @@ function useSortable(el, list, options = {}) {
|
|
|
28
28
|
};
|
|
29
29
|
tryOnMounted(start);
|
|
30
30
|
tryOnScopeDispose(stop);
|
|
31
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
stop,
|
|
33
|
+
start,
|
|
34
|
+
option
|
|
35
|
+
};
|
|
32
36
|
}
|
|
33
37
|
function moveArrayElement(list, from, to) {
|
|
34
38
|
const _valueIsRef = isRef(list);
|
package/useSortable.cjs
CHANGED
|
@@ -30,7 +30,11 @@ function useSortable(el, list, options = {}) {
|
|
|
30
30
|
};
|
|
31
31
|
core.tryOnMounted(start);
|
|
32
32
|
core.tryOnScopeDispose(stop);
|
|
33
|
-
return {
|
|
33
|
+
return {
|
|
34
|
+
stop,
|
|
35
|
+
start,
|
|
36
|
+
option
|
|
37
|
+
};
|
|
34
38
|
}
|
|
35
39
|
function moveArrayElement(list, from, to) {
|
|
36
40
|
const _valueIsRef = vueDemi.isRef(list);
|
package/useSortable.d.cts
CHANGED
|
@@ -15,8 +15,7 @@ interface UseSortableReturn {
|
|
|
15
15
|
* @param name a Sortable.Options property.
|
|
16
16
|
* @param value a value.
|
|
17
17
|
*/
|
|
18
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
19
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
18
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
20
19
|
}
|
|
21
20
|
type UseSortableOptions = Options & ConfigurableDocument;
|
|
22
21
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/useSortable.d.mts
CHANGED
|
@@ -15,8 +15,7 @@ interface UseSortableReturn {
|
|
|
15
15
|
* @param name a Sortable.Options property.
|
|
16
16
|
* @param value a value.
|
|
17
17
|
*/
|
|
18
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
19
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
18
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
20
19
|
}
|
|
21
20
|
type UseSortableOptions = Options & ConfigurableDocument;
|
|
22
21
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/useSortable.d.ts
CHANGED
|
@@ -15,8 +15,7 @@ interface UseSortableReturn {
|
|
|
15
15
|
* @param name a Sortable.Options property.
|
|
16
16
|
* @param value a value.
|
|
17
17
|
*/
|
|
18
|
-
option<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]):
|
|
19
|
-
option<K extends keyof Sortable.Options>(name: K): Sortable.Options[K];
|
|
18
|
+
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
20
19
|
}
|
|
21
20
|
type UseSortableOptions = Options & ConfigurableDocument;
|
|
22
21
|
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
package/useSortable.iife.js
CHANGED
|
@@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
19
19
|
VueDemi.Vue2 = Vue
|
|
20
20
|
VueDemi.version = Vue.version
|
|
21
21
|
VueDemi.warn = Vue.util.warn
|
|
22
|
-
VueDemi.hasInjectionContext = ()
|
|
22
|
+
VueDemi.hasInjectionContext = function() {
|
|
23
|
+
return !!VueDemi.getCurrentInstance()
|
|
24
|
+
}
|
|
23
25
|
function createApp(rootComponent, rootProps) {
|
|
24
26
|
var vm
|
|
25
27
|
var provide = {}
|
|
@@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
72
74
|
VueDemi.Vue = Vue
|
|
73
75
|
VueDemi.Vue2 = Vue
|
|
74
76
|
VueDemi.version = Vue.version
|
|
75
|
-
VueDemi.hasInjectionContext = ()
|
|
77
|
+
VueDemi.hasInjectionContext = function() {
|
|
78
|
+
return !!VueDemi.getCurrentInstance()
|
|
79
|
+
}
|
|
76
80
|
} else {
|
|
77
81
|
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
78
82
|
}
|
|
@@ -143,7 +147,11 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
143
147
|
};
|
|
144
148
|
core.tryOnMounted(start);
|
|
145
149
|
core.tryOnScopeDispose(stop);
|
|
146
|
-
return {
|
|
150
|
+
return {
|
|
151
|
+
stop,
|
|
152
|
+
start,
|
|
153
|
+
option
|
|
154
|
+
};
|
|
147
155
|
}
|
|
148
156
|
function moveArrayElement(list, from, to) {
|
|
149
157
|
const _valueIsRef = vueDemi.isRef(list);
|
package/useSortable.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,t,a){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 e=function(o,f){var i,r={},
|
|
1
|
+
var VueDemi=function(n,t,a){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 e=function(o,f){var i,r={},c={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(l,d){return r[l]=d,this},directive:function(l,d){return d?(t.directive(l,d),c):t.directive(l)},mount:function(l,d){return i||(i=new t(Object.assign({propsData:f},o,{provide:Object.assign(r,o.provide)})),i.$mount(l,d),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return c};var v=e;for(var s in t)n[s]=t[s];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=function(){return!!n.getCurrentInstance()},n.createApp=e}else if(t.version.slice(0,2)==="2.")if(a){for(var s in a)n[s]=a[s];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=function(){return!!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 s in t)n[s]=t[s];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(e,o,f){return Array.isArray(e)?(e.length=Math.max(e.length,o),e.splice(o,1,f),f):(e[o]=f,f)},n.del=function(e,o){if(Array.isArray(e)){e.splice(o,1);return}delete e[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,a,s){"use strict";function v(o,f,i={}){let r;const{document:c=t.defaultDocument,...l}=i,d={onUpdate:u=>{e(f,u.oldIndex,u.newIndex)}},p=()=>{const u=typeof o=="string"?c?.querySelector(o):t.unrefElement(o);!u||r!==void 0||(r=new a(u,{...d,...l}))},y=()=>{r?.destroy(),r=void 0},h=(u,b)=>{if(b!==void 0)r?.option(u,b);else return r?.option(u)};return t.tryOnMounted(p),t.tryOnScopeDispose(y),{stop:y,start:p,option:h}}function e(o,f,i){const r=s.isRef(o),c=r?[...t.toValue(o)]:t.toValue(o);if(i>=0&&i<c.length){const l=c.splice(f,1)[0];s.nextTick(()=>{c.splice(i,0,l),r&&(o.value=c)})}}n.moveArrayElement=e,n.useSortable=v})(this.VueUse=this.VueUse||{},VueUse,Sortable,VueDemi);
|
package/useSortable.mjs
CHANGED
|
@@ -28,7 +28,11 @@ function useSortable(el, list, options = {}) {
|
|
|
28
28
|
};
|
|
29
29
|
tryOnMounted(start);
|
|
30
30
|
tryOnScopeDispose(stop);
|
|
31
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
stop,
|
|
33
|
+
start,
|
|
34
|
+
option
|
|
35
|
+
};
|
|
32
36
|
}
|
|
33
37
|
function moveArrayElement(list, from, to) {
|
|
34
38
|
const _valueIsRef = isRef(list);
|