Socket
Socket
Sign inDemoInstall

@vueuse/integrations

Package Overview
Dependencies
3
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.9.0 to 10.10.0

9

index.iife.js

@@ -229,9 +229,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {

const error = vueDemi.shallowRef();
const cancelTokenSource = axios.CancelToken.source;
let cancelToken = cancelTokenSource();
let abortController = new AbortController();
const abort = (message) => {
if (isFinished.value || !isLoading.value)
return;
cancelToken.cancel(message);
cancelToken = cancelTokenSource();
abortController.abort(message);
abortController = new AbortController();
isAborted.value = true;

@@ -272,3 +271,3 @@ isLoading.value = false;

isAborted.value = false;
instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, cancelToken: cancelToken.token }).then((r) => {
instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, signal: abortController.signal }).then((r) => {
if (isAborted.value)

@@ -275,0 +274,0 @@ return;

@@ -1,1 +0,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);
var VueDemi=function(r,o,U){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,P){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:P},A,{provide:Object.assign(G,A.provide)})),h.$mount(E,L),h)},unmount:function(){h&&(h.$destroy(),h=void 0)}};return N};var B=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(U){for(var n in U)r[n]=U[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,P){return Array.isArray(p)?(p.length=Math.max(p.length,A),p.splice(A,1,P),P):(p[A]=P,P)},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,U,n,B,p,A,P,h,G,N,E,L,g,V,$){"use strict";const D=U.default||U;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))),_=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],()=>_(),{immediate:s,deep:!0});const S={isFinished:u,pass:C,errors:w,errorInfo:i,errorFields:y,execute:_};function F(){return new Promise((d,R)=>{o.until(u).toBe(!0).then(()=>d(S)).catch(O=>R(O))})}return{...S,then(d,R){return F().then(d,R)}}}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=B,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:_=!1}=c,S=n.shallowRef(),F=(C?n.shallowRef:n.ref)(u),d=n.ref(!1),R=n.ref(!1),O=n.ref(!1),k=n.shallowRef();let j=new AbortController;const T=b=>{d.value||!R.value||(j.abort(b),j=new AbortController,O.value=!0,R.value=!1,d.value=!1)},v=b=>{R.value=b,d.value=!b},m=()=>{_&&(F.value=u)},J=()=>new Promise((b,W)=>{o.until(d).toBe(!0).then(()=>k.value?W(k.value):b(X))}),x={then:(...b)=>J().then(...b),catch:(...b)=>J().catch(...b)};let Q=0;const K=(b=l,W={})=>{k.value=void 0;const Y=typeof b=="string"?b:l??W.url;if(Y===void 0)return k.value=new B.AxiosError(B.AxiosError.ERR_INVALID_URL),d.value=!0,x;m(),c.abortPrevious!==!1&&T(),v(!0),Q+=1;const ve=Q;return O.value=!1,f(Y,{...s,...typeof b=="object"?b:W,signal:j.signal}).then(H=>{if(O.value)return;S.value=H;const Z=H.data;F.value=Z,w(Z)}).catch(H=>{k.value=H,y(H)}).finally(()=>{var H;(H=c.onFinish)==null||H.call(c),ve===Q&&v(!1)}),x};I&&l&&K();const X={response:S,data:F,error:k,isFinished:d,isLoading:R,cancel:T,isAborted:O,isCanceled:O,abort:T,execute:K};return{...X,...x}}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),_=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...l?.brush});n.watch(_,()=>{const v=e.value;v&&(v.brush=_.value,v.mode=_.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()},R=()=>{var v;return(v=e.value)==null?void 0:v.cancel()},O=v=>{var m;return(m=e.value)==null?void 0:m.load(v)},k=()=>{var v;return(v=e.value)==null?void 0:v.dump()},j=()=>{var v;a.forEach(m=>m()),(v=e.value)==null||v.unmount()},T=()=>{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&&j(),e.value=P.createDrauu({el:v,...l}),T(),a=[e.value.on("canceled",()=>f.trigger()),e.value.on("committed",m=>c.trigger(m)),e.value.on("start",()=>i.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{T(),s.trigger()})])},{flush:"post"}),o.tryOnScopeDispose(()=>j()),{drauuInstance:e,load:O,dump:k,clear:d,cancel:R,undo:S,redo:F,canUndo:C,canRedo:w,brush:_,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:_,resume:S}=h.watchPausable(C,()=>I(),{flush:a,deep:s});async function F(d){_(),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?g.start():g.done(),get:()=>typeof e.value=="number"&&e.value<1});l&&g.configure(l);const s=g.set;return g.set=f=>(e.value=f,s.call(g,f)),n.watchEffect(()=>{typeof e.value=="number"&&o.isClient&&s.call(g,e.value)}),o.tryOnScopeDispose(g.remove),{isLoading:a,progress:e,start:g.start,done:g.done,remove:()=>{e.value=null,g.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);
{
"name": "@vueuse/integrations",
"version": "10.9.0",
"version": "10.10.0",
"description": "Integration wrappers for utility libraries",

@@ -148,4 +148,4 @@ "author": "Anthony Fu <https://github.com/antfu>",

"dependencies": {
"@vueuse/core": "10.9.0",
"@vueuse/shared": "10.9.0",
"@vueuse/core": "10.10.0",
"@vueuse/shared": "10.10.0",
"vue-demi": ">=0.14.7"

@@ -158,3 +158,3 @@ },

"async-validator": "^4.2.5",
"axios": "^1.6.7",
"axios": "^1.7.2",
"change-case": "^4.1.2",

@@ -161,0 +161,0 @@ "drauu": "^0.3.7",

@@ -162,9 +162,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {

const error = vueDemi.shallowRef();
const cancelTokenSource = axios.CancelToken.source;
let cancelToken = cancelTokenSource();
let abortController = new AbortController();
const abort = (message) => {
if (isFinished.value || !isLoading.value)
return;
cancelToken.cancel(message);
cancelToken = cancelTokenSource();
abortController.abort(message);
abortController = new AbortController();
isAborted.value = true;

@@ -205,3 +204,3 @@ isLoading.value = false;

isAborted.value = false;
instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, cancelToken: cancelToken.token }).then((r) => {
instance(_url, { ...defaultConfig, ...typeof executeUrl === "object" ? executeUrl : config, signal: abortController.signal }).then((r) => {
if (isAborted.value)

@@ -208,0 +207,0 @@ return;

@@ -1,1 +0,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);
var VueDemi=function(t,n,u){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(s,o){var f,h={},d={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,c){return h[l]=c,this},directive:function(l,c){return c?(n.directive(l,c),d):n.directive(l)},mount:function(l,c){return f||(f=new n(Object.assign({propsData:o},s,{provide:Object.assign(h,s.provide)})),f.$mount(l,c),f)},unmount:function(){f&&(f.$destroy(),f=void 0)}};return d};var P=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(u){for(var i in u)t[i]=u[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,s,o){return Array.isArray(e)?(e.length=Math.max(e.length,s),e.splice(s,1,o),o):(e[s]=o,o)},t.del=function(e,s){if(Array.isArray(e)){e.splice(s,1);return}delete e[s]}}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,u,i){"use strict";function P(...e){const s=typeof e[0]=="string"?e[0]:void 0,o=typeof s=="string"?1:0,f={immediate:!!o,shallow:!0,abortPrevious:!0};let h={},d=i,l=f;const c=r=>!!r?.request;e.length>0+o&&(c(e[0+o])?d=e[0+o]:h=e[0+o]),e.length>1+o&&c(e[1+o])&&(d=e[1+o]),(e.length===2+o&&!c(e[1+o])||e.length===3+o)&&(l=e[e.length-1]||f);const{initialData:R,shallow:g,onSuccess:q=u.noop,onError:B=u.noop,immediate:M,resetOnExecute:N=!1}=l,j=n.shallowRef(),C=(g?n.shallowRef:n.ref)(R),v=n.ref(!1),A=n.ref(!1),b=n.ref(!1),p=n.shallowRef();let y=new AbortController;const x=r=>{v.value||!A.value||(y.abort(r),y=new AbortController,b.value=!0,A.value=!1,v.value=!1)},O=r=>{A.value=r,v.value=!r},S=()=>{N&&(C.value=R)},_=()=>new Promise((r,w)=>{u.until(v).toBe(!0).then(()=>p.value?w(p.value):r(L))}),I={then:(...r)=>_().then(...r),catch:(...r)=>_().catch(...r)};let E=0;const F=(r=s,w={})=>{p.value=void 0;const U=typeof r=="string"?r:s??w.url;if(U===void 0)return p.value=new i.AxiosError(i.AxiosError.ERR_INVALID_URL),v.value=!0,I;S(),l.abortPrevious!==!1&&x(),O(!0),E+=1;const z=E;return b.value=!1,d(U,{...h,...typeof r=="object"?r:w,signal:y.signal}).then(a=>{if(b.value)return;j.value=a;const $=a.data;C.value=$,q($)}).catch(a=>{p.value=a,B(a)}).finally(()=>{var a;(a=l.onFinish)==null||a.call(l),z===E&&O(!1)}),I};M&&s&&F();const L={response:j,data:C,error:p,isFinished:v,isLoading:A,cancel:x,isAborted:b,isCanceled:b,abort:x,execute:F};return{...L,...I}}t.useAxios=P})(this.VueUse=this.VueUse||{},VueDemi,VueUse,axios);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc