@vueuse/integrations 9.2.0 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +20 -32
- package/index.d.ts +19 -13
- package/index.iife.js +114 -85
- package/index.iife.min.js +1 -1
- package/index.mjs +2 -2
- package/package.json +6 -6
- package/useAsyncValidator/component.cjs +1 -7
- package/useAsyncValidator.cjs +1 -7
- package/useAsyncValidator.iife.js +95 -60
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAxios.cjs +4 -10
- package/useAxios.d.ts +19 -13
- package/useAxios.iife.js +98 -63
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +2 -2
- package/useChangeCase.cjs +0 -2
- package/useChangeCase.iife.js +94 -55
- package/useChangeCase.iife.min.js +1 -1
- package/useCookies.cjs +2 -8
- package/useCookies.iife.js +96 -61
- package/useCookies.iife.min.js +1 -1
- package/useDrauu.cjs +0 -2
- package/useDrauu.iife.js +94 -55
- package/useDrauu.iife.min.js +1 -1
- package/useFocusTrap/component.cjs +2 -4
- package/useFocusTrap/component.d.ts +13 -2
- package/useFocusTrap/component.mjs +2 -2
- package/useFocusTrap.cjs +0 -2
- package/useFocusTrap.iife.js +94 -55
- package/useFocusTrap.iife.min.js +1 -1
- package/useFuse.cjs +1 -7
- package/useFuse.iife.js +95 -60
- package/useFuse.iife.min.js +1 -1
- package/useJwt.cjs +1 -7
- package/useJwt.iife.js +95 -60
- package/useJwt.iife.min.js +1 -1
- package/useNProgress.cjs +10 -16
- package/useNProgress.iife.js +104 -69
- package/useNProgress.iife.min.js +1 -1
- package/useQRCode.cjs +1 -7
- package/useQRCode.iife.js +95 -60
- package/useQRCode.iife.min.js +1 -1
package/useJwt.iife.js
CHANGED
|
@@ -1,83 +1,120 @@
|
|
|
1
|
-
|
|
1
|
+
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
2
2
|
if (VueDemi.install) {
|
|
3
3
|
return VueDemi
|
|
4
4
|
}
|
|
5
|
-
if (Vue) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (!Vue) {
|
|
6
|
+
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
|
|
7
|
+
return VueDemi
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Vue 2.7
|
|
11
|
+
if (Vue.version.slice(0, 4) === '2.7.') {
|
|
12
|
+
for (var key in Vue) {
|
|
13
|
+
VueDemi[key] = Vue[key]
|
|
14
|
+
}
|
|
15
|
+
VueDemi.isVue2 = true
|
|
16
|
+
VueDemi.isVue3 = false
|
|
17
|
+
VueDemi.install = function () {}
|
|
18
|
+
VueDemi.Vue = Vue
|
|
19
|
+
VueDemi.Vue2 = Vue
|
|
20
|
+
VueDemi.version = Vue.version
|
|
21
|
+
VueDemi.warn = Vue.util.warn
|
|
22
|
+
function createApp(rootComponent, rootProps) {
|
|
23
|
+
var vm
|
|
24
|
+
var provide = {}
|
|
25
|
+
var app = {
|
|
26
|
+
config: Vue.config,
|
|
27
|
+
use: Vue.use.bind(Vue),
|
|
28
|
+
mixin: Vue.mixin.bind(Vue),
|
|
29
|
+
component: Vue.component.bind(Vue),
|
|
30
|
+
provide: function (key, value) {
|
|
31
|
+
provide[key] = value
|
|
32
|
+
return this
|
|
33
|
+
},
|
|
34
|
+
directive: function (name, dir) {
|
|
35
|
+
if (dir) {
|
|
36
|
+
Vue.directive(name, dir)
|
|
37
|
+
return app
|
|
38
|
+
} else {
|
|
39
|
+
return Vue.directive(name)
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
mount: function (el, hydrating) {
|
|
43
|
+
if (!vm) {
|
|
44
|
+
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
|
|
45
|
+
vm.$mount(el, hydrating)
|
|
46
|
+
return vm
|
|
47
|
+
} else {
|
|
48
|
+
return vm
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
unmount: function () {
|
|
52
|
+
if (vm) {
|
|
53
|
+
vm.$destroy()
|
|
54
|
+
vm = undefined
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
return app
|
|
59
|
+
}
|
|
60
|
+
VueDemi.createApp = createApp
|
|
61
|
+
}
|
|
62
|
+
// Vue 2.6.x
|
|
63
|
+
else if (Vue.version.slice(0, 2) === '2.') {
|
|
64
|
+
if (VueCompositionAPI) {
|
|
65
|
+
for (var key in VueCompositionAPI) {
|
|
66
|
+
VueDemi[key] = VueCompositionAPI[key]
|
|
9
67
|
}
|
|
10
68
|
VueDemi.isVue2 = true
|
|
11
69
|
VueDemi.isVue3 = false
|
|
12
|
-
VueDemi.install = function (){}
|
|
70
|
+
VueDemi.install = function () {}
|
|
13
71
|
VueDemi.Vue = Vue
|
|
14
72
|
VueDemi.Vue2 = Vue
|
|
15
73
|
VueDemi.version = Vue.version
|
|
74
|
+
} else {
|
|
75
|
+
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
16
76
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
} else if (Vue.version.slice(0, 2) === '3.') {
|
|
34
|
-
for (var key in Vue) {
|
|
35
|
-
VueDemi[key] = Vue[key]
|
|
36
|
-
}
|
|
37
|
-
VueDemi.isVue2 = false
|
|
38
|
-
VueDemi.isVue3 = true
|
|
39
|
-
VueDemi.install = function (){}
|
|
40
|
-
VueDemi.Vue = Vue
|
|
41
|
-
VueDemi.Vue2 = undefined
|
|
42
|
-
VueDemi.version = Vue.version
|
|
43
|
-
VueDemi.set = function(target, key, val) {
|
|
44
|
-
if (Array.isArray(target)) {
|
|
45
|
-
target.length = Math.max(target.length, key)
|
|
46
|
-
target.splice(key, 1, val)
|
|
47
|
-
return val
|
|
48
|
-
}
|
|
49
|
-
target[key] = val
|
|
77
|
+
}
|
|
78
|
+
// Vue 3
|
|
79
|
+
else if (Vue.version.slice(0, 2) === '3.') {
|
|
80
|
+
for (var key in Vue) {
|
|
81
|
+
VueDemi[key] = Vue[key]
|
|
82
|
+
}
|
|
83
|
+
VueDemi.isVue2 = false
|
|
84
|
+
VueDemi.isVue3 = true
|
|
85
|
+
VueDemi.install = function () {}
|
|
86
|
+
VueDemi.Vue = Vue
|
|
87
|
+
VueDemi.Vue2 = undefined
|
|
88
|
+
VueDemi.version = Vue.version
|
|
89
|
+
VueDemi.set = function (target, key, val) {
|
|
90
|
+
if (Array.isArray(target)) {
|
|
91
|
+
target.length = Math.max(target.length, key)
|
|
92
|
+
target.splice(key, 1, val)
|
|
50
93
|
return val
|
|
51
94
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
target[key] = val
|
|
96
|
+
return val
|
|
97
|
+
}
|
|
98
|
+
VueDemi.del = function (target, key) {
|
|
99
|
+
if (Array.isArray(target)) {
|
|
100
|
+
target.splice(key, 1)
|
|
101
|
+
return
|
|
58
102
|
}
|
|
59
|
-
|
|
60
|
-
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
103
|
+
delete target[key]
|
|
61
104
|
}
|
|
62
105
|
} else {
|
|
63
|
-
console.error(
|
|
64
|
-
'[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.'
|
|
65
|
-
)
|
|
106
|
+
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
66
107
|
}
|
|
67
108
|
return VueDemi
|
|
68
109
|
})(
|
|
69
|
-
this.VueDemi = this.VueDemi || (typeof VueDemi !==
|
|
70
|
-
this.Vue || (typeof Vue !==
|
|
71
|
-
this.VueCompositionAPI || (typeof VueCompositionAPI !==
|
|
110
|
+
(this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
|
|
111
|
+
this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
|
|
112
|
+
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
72
113
|
);
|
|
73
114
|
;
|
|
74
115
|
;(function (exports, vueDemi, shared, jwt_decode) {
|
|
75
116
|
'use strict';
|
|
76
117
|
|
|
77
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
78
|
-
|
|
79
|
-
var jwt_decode__default = /*#__PURE__*/_interopDefaultLegacy(jwt_decode);
|
|
80
|
-
|
|
81
118
|
function useJwt(encodedJwt, options = {}) {
|
|
82
119
|
const {
|
|
83
120
|
onError,
|
|
@@ -85,7 +122,7 @@
|
|
|
85
122
|
} = options;
|
|
86
123
|
const decodeWithFallback = (encodedJwt2, options2) => {
|
|
87
124
|
try {
|
|
88
|
-
return
|
|
125
|
+
return jwt_decode(encodedJwt2, options2);
|
|
89
126
|
} catch (err) {
|
|
90
127
|
onError == null ? void 0 : onError(err);
|
|
91
128
|
return fallbackValue;
|
|
@@ -101,6 +138,4 @@
|
|
|
101
138
|
|
|
102
139
|
exports.useJwt = useJwt;
|
|
103
140
|
|
|
104
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
105
|
-
|
|
106
141
|
})(this.VueUse = this.VueUse || {}, VueDemi, VueUse, jwt_decode);
|
package/useJwt.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
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 i=function(o,t){var s,l={},u={config:r.config,use:r.use.bind(r),mixin:r.mixin.bind(r),component:r.component.bind(r),provide:function(f,c){return l[f]=c,this},directive:function(f,c){return c?(r.directive(f,c),u):r.directive(f)},mount:function(f,c){return s||(s=new r(Object.assign({propsData:t},o,{provide:Object.assign(l,o.provide)})),s.$mount(f,c),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return u};var a=i;for(var e in r)n[e]=r[e];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.createApp=i}else if(r.version.slice(0,2)==="2.")if(d){for(var e in d)n[e]=d[e];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=r,n.Vue2=r,n.version=r.version}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 e in r)n[e]=r[e];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=r,n.Vue2=void 0,n.version=r.version,n.set=function(i,o,t){return Array.isArray(i)?(i.length=Math.max(i.length,o),i.splice(o,1,t),t):(i[o]=t,t)},n.del=function(i,o){if(Array.isArray(i)){i.splice(o,1);return}delete i[o]}}else console.error("[vue-demi] Vue version "+r.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi!="undefined"?VueDemi:{}),this.Vue||(typeof Vue!="undefined"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI!="undefined"?VueCompositionAPI:void 0));(function(n,r,d,e){"use strict";function a(i,o={}){const{onError:t,fallbackValue:s=null}=o,l=(c,v)=>{try{return e(c,v)}catch(p){return t==null||t(p),s}},u=r.computed(()=>l(d.resolveUnref(i),{header:!0})),f=r.computed(()=>l(d.resolveUnref(i)));return{header:u,payload:f}}n.useJwt=a})(this.VueUse=this.VueUse||{},VueDemi,VueUse,jwt_decode);
|
package/useNProgress.cjs
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var nprogress = require('nprogress');
|
|
6
4
|
var shared = require('@vueuse/shared');
|
|
7
5
|
var vueDemi = require('vue-demi');
|
|
8
6
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var nprogress__default = /*#__PURE__*/_interopDefaultLegacy(nprogress);
|
|
12
|
-
|
|
13
7
|
function useNProgress(currentProgress = null, options) {
|
|
14
8
|
const progress = vueDemi.ref(currentProgress);
|
|
15
9
|
const isLoading = vueDemi.computed({
|
|
16
|
-
set: (load) => load ?
|
|
10
|
+
set: (load) => load ? nprogress.start() : nprogress.done(),
|
|
17
11
|
get: () => shared.isNumber(progress.value) && progress.value < 1
|
|
18
12
|
});
|
|
19
13
|
if (options)
|
|
20
|
-
|
|
21
|
-
const setProgress =
|
|
22
|
-
|
|
14
|
+
nprogress.configure(options);
|
|
15
|
+
const setProgress = nprogress.set;
|
|
16
|
+
nprogress.set = (n) => {
|
|
23
17
|
progress.value = n;
|
|
24
|
-
return setProgress.call(
|
|
18
|
+
return setProgress.call(nprogress, n);
|
|
25
19
|
};
|
|
26
20
|
vueDemi.watchEffect(() => {
|
|
27
21
|
if (shared.isNumber(progress.value) && shared.isClient)
|
|
28
|
-
setProgress.call(
|
|
22
|
+
setProgress.call(nprogress, progress.value);
|
|
29
23
|
});
|
|
30
|
-
shared.tryOnScopeDispose(
|
|
24
|
+
shared.tryOnScopeDispose(nprogress.remove);
|
|
31
25
|
return {
|
|
32
26
|
isLoading,
|
|
33
27
|
progress,
|
|
34
|
-
start:
|
|
35
|
-
done:
|
|
28
|
+
start: nprogress.start,
|
|
29
|
+
done: nprogress.done,
|
|
36
30
|
remove: () => {
|
|
37
31
|
progress.value = null;
|
|
38
|
-
|
|
32
|
+
nprogress.remove();
|
|
39
33
|
}
|
|
40
34
|
};
|
|
41
35
|
}
|
package/useNProgress.iife.js
CHANGED
|
@@ -1,115 +1,150 @@
|
|
|
1
|
-
|
|
1
|
+
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
2
2
|
if (VueDemi.install) {
|
|
3
3
|
return VueDemi
|
|
4
4
|
}
|
|
5
|
-
if (Vue) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
if (!Vue) {
|
|
6
|
+
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
|
|
7
|
+
return VueDemi
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Vue 2.7
|
|
11
|
+
if (Vue.version.slice(0, 4) === '2.7.') {
|
|
12
|
+
for (var key in Vue) {
|
|
13
|
+
VueDemi[key] = Vue[key]
|
|
14
|
+
}
|
|
15
|
+
VueDemi.isVue2 = true
|
|
16
|
+
VueDemi.isVue3 = false
|
|
17
|
+
VueDemi.install = function () {}
|
|
18
|
+
VueDemi.Vue = Vue
|
|
19
|
+
VueDemi.Vue2 = Vue
|
|
20
|
+
VueDemi.version = Vue.version
|
|
21
|
+
VueDemi.warn = Vue.util.warn
|
|
22
|
+
function createApp(rootComponent, rootProps) {
|
|
23
|
+
var vm
|
|
24
|
+
var provide = {}
|
|
25
|
+
var app = {
|
|
26
|
+
config: Vue.config,
|
|
27
|
+
use: Vue.use.bind(Vue),
|
|
28
|
+
mixin: Vue.mixin.bind(Vue),
|
|
29
|
+
component: Vue.component.bind(Vue),
|
|
30
|
+
provide: function (key, value) {
|
|
31
|
+
provide[key] = value
|
|
32
|
+
return this
|
|
33
|
+
},
|
|
34
|
+
directive: function (name, dir) {
|
|
35
|
+
if (dir) {
|
|
36
|
+
Vue.directive(name, dir)
|
|
37
|
+
return app
|
|
38
|
+
} else {
|
|
39
|
+
return Vue.directive(name)
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
mount: function (el, hydrating) {
|
|
43
|
+
if (!vm) {
|
|
44
|
+
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
|
|
45
|
+
vm.$mount(el, hydrating)
|
|
46
|
+
return vm
|
|
47
|
+
} else {
|
|
48
|
+
return vm
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
unmount: function () {
|
|
52
|
+
if (vm) {
|
|
53
|
+
vm.$destroy()
|
|
54
|
+
vm = undefined
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
return app
|
|
59
|
+
}
|
|
60
|
+
VueDemi.createApp = createApp
|
|
61
|
+
}
|
|
62
|
+
// Vue 2.6.x
|
|
63
|
+
else if (Vue.version.slice(0, 2) === '2.') {
|
|
64
|
+
if (VueCompositionAPI) {
|
|
65
|
+
for (var key in VueCompositionAPI) {
|
|
66
|
+
VueDemi[key] = VueCompositionAPI[key]
|
|
9
67
|
}
|
|
10
68
|
VueDemi.isVue2 = true
|
|
11
69
|
VueDemi.isVue3 = false
|
|
12
|
-
VueDemi.install = function (){}
|
|
70
|
+
VueDemi.install = function () {}
|
|
13
71
|
VueDemi.Vue = Vue
|
|
14
72
|
VueDemi.Vue2 = Vue
|
|
15
73
|
VueDemi.version = Vue.version
|
|
74
|
+
} else {
|
|
75
|
+
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
16
76
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
} else if (Vue.version.slice(0, 2) === '3.') {
|
|
34
|
-
for (var key in Vue) {
|
|
35
|
-
VueDemi[key] = Vue[key]
|
|
36
|
-
}
|
|
37
|
-
VueDemi.isVue2 = false
|
|
38
|
-
VueDemi.isVue3 = true
|
|
39
|
-
VueDemi.install = function (){}
|
|
40
|
-
VueDemi.Vue = Vue
|
|
41
|
-
VueDemi.Vue2 = undefined
|
|
42
|
-
VueDemi.version = Vue.version
|
|
43
|
-
VueDemi.set = function(target, key, val) {
|
|
44
|
-
if (Array.isArray(target)) {
|
|
45
|
-
target.length = Math.max(target.length, key)
|
|
46
|
-
target.splice(key, 1, val)
|
|
47
|
-
return val
|
|
48
|
-
}
|
|
49
|
-
target[key] = val
|
|
77
|
+
}
|
|
78
|
+
// Vue 3
|
|
79
|
+
else if (Vue.version.slice(0, 2) === '3.') {
|
|
80
|
+
for (var key in Vue) {
|
|
81
|
+
VueDemi[key] = Vue[key]
|
|
82
|
+
}
|
|
83
|
+
VueDemi.isVue2 = false
|
|
84
|
+
VueDemi.isVue3 = true
|
|
85
|
+
VueDemi.install = function () {}
|
|
86
|
+
VueDemi.Vue = Vue
|
|
87
|
+
VueDemi.Vue2 = undefined
|
|
88
|
+
VueDemi.version = Vue.version
|
|
89
|
+
VueDemi.set = function (target, key, val) {
|
|
90
|
+
if (Array.isArray(target)) {
|
|
91
|
+
target.length = Math.max(target.length, key)
|
|
92
|
+
target.splice(key, 1, val)
|
|
50
93
|
return val
|
|
51
94
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
target[key] = val
|
|
96
|
+
return val
|
|
97
|
+
}
|
|
98
|
+
VueDemi.del = function (target, key) {
|
|
99
|
+
if (Array.isArray(target)) {
|
|
100
|
+
target.splice(key, 1)
|
|
101
|
+
return
|
|
58
102
|
}
|
|
59
|
-
|
|
60
|
-
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
103
|
+
delete target[key]
|
|
61
104
|
}
|
|
62
105
|
} else {
|
|
63
|
-
console.error(
|
|
64
|
-
'[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.'
|
|
65
|
-
)
|
|
106
|
+
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
66
107
|
}
|
|
67
108
|
return VueDemi
|
|
68
109
|
})(
|
|
69
|
-
this.VueDemi = this.VueDemi || (typeof VueDemi !==
|
|
70
|
-
this.Vue || (typeof Vue !==
|
|
71
|
-
this.VueCompositionAPI || (typeof VueCompositionAPI !==
|
|
110
|
+
(this.VueDemi = this.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
|
|
111
|
+
this.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
|
|
112
|
+
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
72
113
|
);
|
|
73
114
|
;
|
|
74
115
|
;(function (exports, nprogress, shared, vueDemi) {
|
|
75
116
|
'use strict';
|
|
76
117
|
|
|
77
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
78
|
-
|
|
79
|
-
var nprogress__default = /*#__PURE__*/_interopDefaultLegacy(nprogress);
|
|
80
|
-
|
|
81
118
|
function useNProgress(currentProgress = null, options) {
|
|
82
119
|
const progress = vueDemi.ref(currentProgress);
|
|
83
120
|
const isLoading = vueDemi.computed({
|
|
84
|
-
set: (load) => load ?
|
|
121
|
+
set: (load) => load ? nprogress.start() : nprogress.done(),
|
|
85
122
|
get: () => shared.isNumber(progress.value) && progress.value < 1
|
|
86
123
|
});
|
|
87
124
|
if (options)
|
|
88
|
-
|
|
89
|
-
const setProgress =
|
|
90
|
-
|
|
125
|
+
nprogress.configure(options);
|
|
126
|
+
const setProgress = nprogress.set;
|
|
127
|
+
nprogress.set = (n) => {
|
|
91
128
|
progress.value = n;
|
|
92
|
-
return setProgress.call(
|
|
129
|
+
return setProgress.call(nprogress, n);
|
|
93
130
|
};
|
|
94
131
|
vueDemi.watchEffect(() => {
|
|
95
132
|
if (shared.isNumber(progress.value) && shared.isClient)
|
|
96
|
-
setProgress.call(
|
|
133
|
+
setProgress.call(nprogress, progress.value);
|
|
97
134
|
});
|
|
98
|
-
shared.tryOnScopeDispose(
|
|
135
|
+
shared.tryOnScopeDispose(nprogress.remove);
|
|
99
136
|
return {
|
|
100
137
|
isLoading,
|
|
101
138
|
progress,
|
|
102
|
-
start:
|
|
103
|
-
done:
|
|
139
|
+
start: nprogress.start,
|
|
140
|
+
done: nprogress.done,
|
|
104
141
|
remove: () => {
|
|
105
142
|
progress.value = null;
|
|
106
|
-
|
|
143
|
+
nprogress.remove();
|
|
107
144
|
}
|
|
108
145
|
};
|
|
109
146
|
}
|
|
110
147
|
|
|
111
148
|
exports.useNProgress = useNProgress;
|
|
112
149
|
|
|
113
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
114
|
-
|
|
115
150
|
})(this.VueUse = this.VueUse || {}, nprogress, VueUse, VueDemi);
|
package/useNProgress.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(
|
|
1
|
+
var VueDemi=function(i,n,f){if(i.install)return i;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),i;if(n.version.slice(0,4)==="2.7."){let e=function(o,r){var s,v={},c={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,u){return v[l]=u,this},directive:function(l,u){return u?(n.directive(l,u),c):n.directive(l)},mount:function(l,u){return s||(s=new n(Object.assign({propsData:r},o,{provide:Object.assign(v,o.provide)})),s.$mount(l,u),s)},unmount:function(){s&&(s.$destroy(),s=void 0)}};return c};var d=e;for(var t in n)i[t]=n[t];i.isVue2=!0,i.isVue3=!1,i.install=function(){},i.Vue=n,i.Vue2=n,i.version=n.version,i.warn=n.util.warn,i.createApp=e}else if(n.version.slice(0,2)==="2.")if(f){for(var t in f)i[t]=f[t];i.isVue2=!0,i.isVue3=!1,i.install=function(){},i.Vue=n,i.Vue2=n,i.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(n.version.slice(0,2)==="3."){for(var t in n)i[t]=n[t];i.isVue2=!1,i.isVue3=!0,i.install=function(){},i.Vue=n,i.Vue2=void 0,i.version=n.version,i.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)},i.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 i}(this.VueDemi=this.VueDemi||(typeof VueDemi!="undefined"?VueDemi:{}),this.Vue||(typeof Vue!="undefined"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI!="undefined"?VueCompositionAPI:void 0));(function(i,n,f,t){"use strict";function d(e=null,o){const r=t.ref(e),s=t.computed({set:c=>c?n.start():n.done(),get:()=>f.isNumber(r.value)&&r.value<1});o&&n.configure(o);const v=n.set;return n.set=c=>(r.value=c,v.call(n,c)),t.watchEffect(()=>{f.isNumber(r.value)&&f.isClient&&v.call(n,r.value)}),f.tryOnScopeDispose(n.remove),{isLoading:s,progress:r,start:n.start,done:n.done,remove:()=>{r.value=null,n.remove()}}}i.useNProgress=d})(this.VueUse=this.VueUse||{},nprogress,VueUse,VueDemi);
|
package/useQRCode.cjs
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var shared = require('@vueuse/shared');
|
|
6
4
|
var vueDemi = require('vue-demi');
|
|
7
5
|
var QRCode = require('qrcode');
|
|
8
6
|
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var QRCode__default = /*#__PURE__*/_interopDefaultLegacy(QRCode);
|
|
12
|
-
|
|
13
7
|
function useQRCode(text, options) {
|
|
14
8
|
const src = shared.resolveRef(text);
|
|
15
9
|
const result = vueDemi.ref("");
|
|
16
10
|
vueDemi.watch(src, async (value) => {
|
|
17
11
|
if (src.value && shared.isClient)
|
|
18
|
-
result.value = await
|
|
12
|
+
result.value = await QRCode.toDataURL(value, options);
|
|
19
13
|
}, { immediate: true });
|
|
20
14
|
return result;
|
|
21
15
|
}
|