@vueuse/integrations
Advanced tools
Comparing version 4.8.3 to 4.8.4
@@ -9,3 +9,2 @@ 'use strict'; | ||
var Cookie = require('universal-cookie'); | ||
require('@antfu/utils'); | ||
var focusTrap = require('focus-trap'); | ||
@@ -12,0 +11,0 @@ var jwt_decode = require('jwt-decode'); |
@@ -5,3 +5,2 @@ import { shallowRef, ref, unref, watch, computed, isRef, watchEffect } from 'vue-demi'; | ||
import Cookie from 'universal-cookie'; | ||
import '@antfu/utils'; | ||
import { createFocusTrap } from 'focus-trap'; | ||
@@ -8,0 +7,0 @@ import jwt_decode from 'jwt-decode'; |
@@ -62,3 +62,3 @@ ;(function (window) { | ||
; | ||
;(function (exports, vueDemi, axios, shared, Cookie, utils, focusTrap, jwt_decode, nprogress, QRCode) { | ||
;(function (exports, vueDemi, axios, shared, Cookie, focusTrap, jwt_decode, nprogress, QRCode) { | ||
'use strict'; | ||
@@ -407,2 +407,2 @@ | ||
}(this.VueUse = this.VueUse || {}, VueDemi, axios, VueUse, UniversalCookie, null, focusTrap, jwt_decode, nprogress, QRCode)); | ||
}(this.VueUse = this.VueUse || {}, VueDemi, axios, VueUse, UniversalCookie, focusTrap, jwt_decode, nprogress, QRCode)); |
@@ -1,1 +0,1 @@ | ||
!function(e){if(!e.VueDemi){var t={},n=e.Vue;if(n)if("2."===n.version.slice(0,2)){var a=e.VueCompositionAPI;if(a){for(var o in a)t[o]=a[o];t.isVue2=!0,t.isVue3=!1,t.install=function(){},t.Vue=n,t.Vue2=n,t.version=n.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if("3."===n.version.slice(0,2)){for(var o in n)t[o]=n[o];t.isVue2=!1,t.isVue3=!0,t.install=function(){},t.Vue=n,t.Vue2=void 0,t.version=n.version,t.set=function(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)},t.del=function(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");e.VueDemi=t}}(window),function(e,t,n,a,o,u,r,s,i,l){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d,f=c(n),v=c(o),p=c(s),m=c(i),g=c(l);function h(e,{doNotParse:n=!1,autoUpdateDependencies:o=!1}={},u=new v.default){const r=o?[...e||[]]:e;let s=u.getAll({doNotParse:!0});const i=t.ref(0),l=()=>{const e=u.getAll({doNotParse:!0});(function(e,t,n){if(!e)return!0;for(const a of e)if(t[a]!==n[a])return!0;return!1})(r||null,e,s)&&i.value++,s=e};return a.tryOnMounted((()=>{u.addChangeListener(l)})),a.tryOnUnmounted((()=>{u.removeChangeListener(l)})),{get:(...e)=>(o&&r&&!r.includes(e[0])&&r.push(e[0]),i.value,u.get(e[0],Object.assign({doNotParse:n},e[1]))),getAll:(...e)=>(i.value,u.getAll(Object.assign({doNotParse:n},e[0]))),set:(...e)=>u.set(...e),remove:(...e)=>u.remove(...e),addChangeListener:(...e)=>u.addChangeListener(...e),removeChangeListener:(...e)=>u.removeChangeListener(...e)}}!function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"}(d||(d={})),e.createCookies=function(e){const t=new v.default(e?e.headers.cookie:null);return(e,{doNotParse:n=!1,autoUpdateDependencies:a=!1}={})=>h(e,{doNotParse:n,autoUpdateDependencies:a},t)},e.useAxios=function(e,...n){let a={},o=f.default;n.length>0&&("request"in n[0]?o=n[0]:a=n[0]),n.length>1&&"request"in n[1]&&(o=n[1]);const u=t.shallowRef(),r=t.shallowRef(),s=t.ref(!1),i=t.ref(!0),l=t.ref(!1),c=t.shallowRef(),d=f.default.CancelToken.source();return o(e,Object.assign(Object.assign({},a),{cancelToken:d.token})).then((e=>{u.value=e,r.value=e.data})).catch((e=>{c.value=e})).finally((()=>{i.value=!1,s.value=!0})),{response:u,data:r,error:c,finished:s,loading:i,cancel:e=>{!s.value&&i.value&&(d.cancel(e),l.value=!0,i.value=!1,s.value=!1)},canceled:l}},e.useCookies=h,e.useFocusTrap=function(e,n={}){let o;const{immediate:u}=n,s=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(n,["immediate"]),i=t.ref(!1),l=t.ref(!1),c=e=>o&&o.activate(e),d=e=>o&&o.deactivate(e);return t.watch((()=>function(e){var n,a;const o=t.unref(e);return null!==(a=null===(n=o)||void 0===n?void 0:n.$el)&&void 0!==a?a:o}(e)),(e=>{o=r.createFocusTrap(e,Object.assign(Object.assign({},s),{onActivate(){i.value=!0,n.onActivate&&n.onActivate()},onDeactivate(){i.value=!1,n.onDeactivate&&n.onDeactivate()}})),u&&c()}),{flush:"post"}),a.tryOnUnmounted((()=>d())),{hasFocus:i,isPaused:l,activate:c,deactivate:d,pause:()=>{o&&(o.pause(),l.value=!0)},unpause:()=>{o&&(o.unpause(),l.value=!1)}}},e.useJwt=function(e,n={}){const a=t.ref(e),{onError:o,fallbackValue:u=null}=n,r=(e,t)=>{try{return p.default(e,t)}catch(e){return null==o||o(e),u}};return{header:t.computed((()=>r(a.value,{header:!0}))),payload:t.computed((()=>r(a.value)))}},e.useNProgress=function(e=null,n){const o=t.isRef(e)?e:t.ref(e),u=t.computed({set:e=>e?m.default.start():m.default.done(),get:()=>a.isNumber(o.value)&&o.value<1});n&&m.default.configure(n);const r=m.default.set;return m.default.set=e=>(o.value=e,r.call(m.default,e)),t.watchEffect((()=>{a.isNumber(o.value)&&r.call(m.default,o.value)})),a.tryOnUnmounted(m.default.remove),{isLoading:u,progress:o,start:m.default.start,done:m.default.done,remove:()=>{o.value=null,m.default.remove()}}},e.useQRCode=function(e,n){const o=t.ref(e),u=t.ref("");return t.watch(o,(async e=>{o.value&&a.isClient&&(u.value=await g.default.toDataURL(e,n))}),{immediate:!0}),u},Object.defineProperty(e,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueDemi,axios,VueUse,UniversalCookie,0,focusTrap,jwt_decode,nprogress,QRCode); | ||
!function(e){if(!e.VueDemi){var t={},n=e.Vue;if(n)if("2."===n.version.slice(0,2)){var a=e.VueCompositionAPI;if(a){for(var o in a)t[o]=a[o];t.isVue2=!0,t.isVue3=!1,t.install=function(){},t.Vue=n,t.Vue2=n,t.version=n.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.")}else if("3."===n.version.slice(0,2)){for(var o in n)t[o]=n[o];t.isVue2=!1,t.isVue3=!0,t.install=function(){},t.Vue=n,t.Vue2=void 0,t.version=n.version,t.set=function(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)},t.del=function(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");else console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.");e.VueDemi=t}}(window),function(e,t,n,a,o,u,r,s,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c,d=l(n),f=l(o),v=l(r),p=l(s),m=l(i);function g(e,{doNotParse:n=!1,autoUpdateDependencies:o=!1}={},u=new f.default){const r=o?[...e||[]]:e;let s=u.getAll({doNotParse:!0});const i=t.ref(0),l=()=>{const e=u.getAll({doNotParse:!0});(function(e,t,n){if(!e)return!0;for(const a of e)if(t[a]!==n[a])return!0;return!1})(r||null,e,s)&&i.value++,s=e};return a.tryOnMounted((()=>{u.addChangeListener(l)})),a.tryOnUnmounted((()=>{u.removeChangeListener(l)})),{get:(...e)=>(o&&r&&!r.includes(e[0])&&r.push(e[0]),i.value,u.get(e[0],Object.assign({doNotParse:n},e[1]))),getAll:(...e)=>(i.value,u.getAll(Object.assign({doNotParse:n},e[0]))),set:(...e)=>u.set(...e),remove:(...e)=>u.remove(...e),addChangeListener:(...e)=>u.addChangeListener(...e),removeChangeListener:(...e)=>u.removeChangeListener(...e)}}!function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"}(c||(c={})),e.createCookies=function(e){const t=new f.default(e?e.headers.cookie:null);return(e,{doNotParse:n=!1,autoUpdateDependencies:a=!1}={})=>g(e,{doNotParse:n,autoUpdateDependencies:a},t)},e.useAxios=function(e,...n){let a={},o=d.default;n.length>0&&("request"in n[0]?o=n[0]:a=n[0]),n.length>1&&"request"in n[1]&&(o=n[1]);const u=t.shallowRef(),r=t.shallowRef(),s=t.ref(!1),i=t.ref(!0),l=t.ref(!1),c=t.shallowRef(),f=d.default.CancelToken.source();return o(e,Object.assign(Object.assign({},a),{cancelToken:f.token})).then((e=>{u.value=e,r.value=e.data})).catch((e=>{c.value=e})).finally((()=>{i.value=!1,s.value=!0})),{response:u,data:r,error:c,finished:s,loading:i,cancel:e=>{!s.value&&i.value&&(f.cancel(e),l.value=!0,i.value=!1,s.value=!1)},canceled:l}},e.useCookies=g,e.useFocusTrap=function(e,n={}){let o;const{immediate:r}=n,s=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]])}return n}(n,["immediate"]),i=t.ref(!1),l=t.ref(!1),c=e=>o&&o.activate(e),d=e=>o&&o.deactivate(e);return t.watch((()=>function(e){var n,a;const o=t.unref(e);return null!==(a=null===(n=o)||void 0===n?void 0:n.$el)&&void 0!==a?a:o}(e)),(e=>{o=u.createFocusTrap(e,Object.assign(Object.assign({},s),{onActivate(){i.value=!0,n.onActivate&&n.onActivate()},onDeactivate(){i.value=!1,n.onDeactivate&&n.onDeactivate()}})),r&&c()}),{flush:"post"}),a.tryOnUnmounted((()=>d())),{hasFocus:i,isPaused:l,activate:c,deactivate:d,pause:()=>{o&&(o.pause(),l.value=!0)},unpause:()=>{o&&(o.unpause(),l.value=!1)}}},e.useJwt=function(e,n={}){const a=t.ref(e),{onError:o,fallbackValue:u=null}=n,r=(e,t)=>{try{return v.default(e,t)}catch(e){return null==o||o(e),u}};return{header:t.computed((()=>r(a.value,{header:!0}))),payload:t.computed((()=>r(a.value)))}},e.useNProgress=function(e=null,n){const o=t.isRef(e)?e:t.ref(e),u=t.computed({set:e=>e?p.default.start():p.default.done(),get:()=>a.isNumber(o.value)&&o.value<1});n&&p.default.configure(n);const r=p.default.set;return p.default.set=e=>(o.value=e,r.call(p.default,e)),t.watchEffect((()=>{a.isNumber(o.value)&&r.call(p.default,o.value)})),a.tryOnUnmounted(p.default.remove),{isLoading:u,progress:o,start:p.default.start,done:p.default.done,remove:()=>{o.value=null,p.default.remove()}}},e.useQRCode=function(e,n){const o=t.ref(e),u=t.ref("");return t.watch(o,(async e=>{o.value&&a.isClient&&(u.value=await m.default.toDataURL(e,n))}),{immediate:!0}),u},Object.defineProperty(e,"__esModule",{value:!0})}(this.VueUse=this.VueUse||{},VueDemi,axios,VueUse,UniversalCookie,focusTrap,jwt_decode,nprogress,QRCode); |
{ | ||
"name": "@vueuse/integrations", | ||
"description": "Integration wrappers for utility libraries", | ||
"version": "4.8.3", | ||
"version": "4.8.4", | ||
"main": "./dist/index.cjs.js", | ||
@@ -30,3 +30,3 @@ "types": "./dist/index.d.ts", | ||
"dependencies": { | ||
"@vueuse/shared": "4.8.3", | ||
"@vueuse/shared": "4.8.4", | ||
"vue-demi": "latest" | ||
@@ -33,0 +33,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55030
1229
+ Added@vueuse/shared@4.8.4(transitive)
- Removed@vueuse/shared@4.8.3(transitive)
Updated@vueuse/shared@4.8.4