@vueuse/integrations 10.0.0-beta.2 → 10.0.0-beta.4
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 +130 -83
- package/index.d.ts +30 -42
- package/index.iife.js +130 -83
- package/index.iife.min.js +1 -1
- package/index.mjs +133 -86
- package/package.json +5 -5
- package/useAsyncValidator/component.cjs +7 -3
- package/useAsyncValidator/component.mjs +8 -4
- package/useAsyncValidator.cjs +7 -3
- package/useAsyncValidator.d.ts +2 -2
- package/useAsyncValidator.iife.js +7 -3
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +8 -4
- package/useAxios.cjs +25 -17
- package/useAxios.d.ts +18 -30
- package/useAxios.iife.js +25 -17
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +26 -18
- package/useChangeCase.cjs +1 -1
- package/useChangeCase.d.ts +2 -2
- package/useChangeCase.iife.js +1 -1
- package/useChangeCase.iife.min.js +1 -1
- package/useChangeCase.mjs +2 -2
- package/useCookies.cjs +11 -1
- package/useCookies.iife.js +11 -1
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +11 -1
- package/useDrauu.cjs +22 -18
- package/useDrauu.iife.js +22 -18
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +22 -18
- package/useFocusTrap/component.cjs +10 -6
- package/useFocusTrap/component.mjs +10 -6
- package/useFocusTrap.cjs +22 -18
- package/useFocusTrap.iife.js +22 -18
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +22 -18
- package/useFuse.cjs +25 -14
- package/useFuse.d.ts +2 -2
- package/useFuse.iife.js +25 -14
- package/useFuse.iife.min.js +1 -1
- package/useFuse.mjs +27 -16
- package/useIDBKeyval.cjs +1 -1
- package/useIDBKeyval.d.ts +2 -2
- package/useIDBKeyval.iife.js +1 -1
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +2 -2
- package/useJwt.cjs +2 -2
- package/useJwt.d.ts +2 -2
- package/useJwt.iife.js +2 -2
- package/useJwt.iife.min.js +1 -1
- package/useJwt.mjs +3 -3
- package/useNProgress.d.ts +2 -2
- package/useNProgress.iife.min.js +1 -1
- package/useQRCode.cjs +9 -5
- package/useQRCode.d.ts +2 -2
- package/useQRCode.iife.js +9 -5
- package/useQRCode.iife.min.js +1 -1
- package/useQRCode.mjs +10 -6
- package/useSortable/component.cjs +6 -3
- package/useSortable/component.mjs +8 -5
- package/useSortable.cjs +6 -3
- package/useSortable.d.ts +4 -4
- package/useSortable.iife.js +7 -5
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +7 -4
package/useDrauu.iife.js
CHANGED
|
@@ -196,24 +196,28 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
196
196
|
shiftPressed.value = drauuInstance.value.shiftPressed;
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
vueDemi.watch(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
199
|
+
vueDemi.watch(
|
|
200
|
+
() => core.unrefElement(target),
|
|
201
|
+
(el) => {
|
|
202
|
+
if (!el || typeof SVGSVGElement === "undefined" || !(el instanceof SVGSVGElement))
|
|
203
|
+
return;
|
|
204
|
+
if (drauuInstance.value)
|
|
205
|
+
cleanup();
|
|
206
|
+
drauuInstance.value = drauu.createDrauu(__spreadValues({ el }, options));
|
|
207
|
+
syncStatus();
|
|
208
|
+
disposables = [
|
|
209
|
+
drauuInstance.value.on("canceled", () => onCanceledHook.trigger()),
|
|
210
|
+
drauuInstance.value.on("committed", () => onCommittedHook.trigger()),
|
|
211
|
+
drauuInstance.value.on("start", () => onStartHook.trigger()),
|
|
212
|
+
drauuInstance.value.on("end", () => onEndHook.trigger()),
|
|
213
|
+
drauuInstance.value.on("changed", () => {
|
|
214
|
+
syncStatus();
|
|
215
|
+
onChangedHook.trigger();
|
|
216
|
+
})
|
|
217
|
+
];
|
|
218
|
+
},
|
|
219
|
+
{ flush: "post" }
|
|
220
|
+
);
|
|
217
221
|
shared.tryOnScopeDispose(() => cleanup());
|
|
218
222
|
return {
|
|
219
223
|
drauuInstance,
|
package/useDrauu.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(r,n,f){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let a=function(l,c){var u,v={},p={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(d,t){return v[d]=t,this},directive:function(d,t){return t?(n.directive(d,t),p):n.directive(d)},mount:function(d,t){return u||(u=new n(Object.assign({propsData:c},l,{provide:Object.assign(v,l.provide)})),u.$mount(d,t),u)},unmount:function(){u&&(u.$destroy(),u=void 0)}};return p};var A=a;for(var s in n)r[s]=n[s];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=a}else if(n.version.slice(0,2)==="2.")if(f){for(var s in f)r[s]=f[s];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.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 s in n)r[s]=n[s];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(a,l,c){return Array.isArray(a)?(a.length=Math.max(a.length,l),a.splice(l,1,c),c):(a[l]=c,c)},r.del=function(a,l){if(Array.isArray(a)){a.splice(l,1);return}delete a[l]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return r}(this.VueDemi=this.VueDemi||(typeof VueDemi
|
|
1
|
+
var VueDemi=function(r,n,f){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let a=function(l,c){var u,v={},p={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(d,t){return v[d]=t,this},directive:function(d,t){return t?(n.directive(d,t),p):n.directive(d)},mount:function(d,t){return u||(u=new n(Object.assign({propsData:c},l,{provide:Object.assign(v,l.provide)})),u.$mount(d,t),u)},unmount:function(){u&&(u.$destroy(),u=void 0)}};return p};var A=a;for(var s in n)r[s]=n[s];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=a}else if(n.version.slice(0,2)==="2.")if(f){for(var s in f)r[s]=f[s];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.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 s in n)r[s]=n[s];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(a,l,c){return Array.isArray(a)?(a.length=Math.max(a.length,l),a.splice(l,1,c),c):(a[l]=c,c)},r.del=function(a,l){if(Array.isArray(a)){a.splice(l,1);return}delete a[l]}}else console.error("[vue-demi] Vue version "+n.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,n,f,s,A){"use strict";var a=Object.defineProperty,l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,v=(t,i,e)=>i in t?a(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,p=(t,i)=>{for(var e in i||(i={}))c.call(i,e)&&v(t,e,i[e]);if(l)for(var e of l(i))u.call(i,e)&&v(t,e,i[e]);return t};function d(t,i){const e=n.ref();let g=[];const y=s.createEventHook(),b=s.createEventHook(),E=s.createEventHook(),P=s.createEventHook(),w=s.createEventHook(),O=n.ref(!1),H=n.ref(!1),C=n.ref(!1),m=n.ref(!1),h=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(h,()=>{const o=e.value;o&&(o.brush=h.value,o.mode=h.value.mode)},{deep:!0});const U=()=>{var o;return(o=e.value)==null?void 0:o.undo()},I=()=>{var o;return(o=e.value)==null?void 0:o.redo()},j=()=>{var o;return(o=e.value)==null?void 0:o.clear()},G=()=>{var o;return(o=e.value)==null?void 0:o.cancel()},x=o=>{var _;return(_=e.value)==null?void 0:_.load(o)},R=()=>{var o;return(o=e.value)==null?void 0:o.dump()},S=()=>{var o;g.forEach(_=>_()),(o=e.value)==null||o.unmount()},k=()=>{e.value&&(O.value=e.value.canUndo(),H.value=e.value.canRedo(),C.value=e.value.altPressed,m.value=e.value.shiftPressed)};return n.watch(()=>s.unrefElement(t),o=>{!o||typeof SVGSVGElement>"u"||!(o instanceof SVGSVGElement)||(e.value&&S(),e.value=f.createDrauu(p({el:o},i)),k(),g=[e.value.on("canceled",()=>b.trigger()),e.value.on("committed",()=>E.trigger()),e.value.on("start",()=>P.trigger()),e.value.on("end",()=>w.trigger()),e.value.on("changed",()=>{k(),y.trigger()})])},{flush:"post"}),A.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:x,dump:R,clear:j,cancel:G,undo:U,redo:I,canUndo:O,canRedo:H,brush:h,onChanged:y.on,onCommitted:E.on,onStart:P.on,onEnd:w.on,onCanceled:b.on}}r.useDrauu=d})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
|
package/useDrauu.mjs
CHANGED
|
@@ -84,24 +84,28 @@ function useDrauu(target, options) {
|
|
|
84
84
|
shiftPressed.value = drauuInstance.value.shiftPressed;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
watch(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
87
|
+
watch(
|
|
88
|
+
() => unrefElement(target),
|
|
89
|
+
(el) => {
|
|
90
|
+
if (!el || typeof SVGSVGElement === "undefined" || !(el instanceof SVGSVGElement))
|
|
91
|
+
return;
|
|
92
|
+
if (drauuInstance.value)
|
|
93
|
+
cleanup();
|
|
94
|
+
drauuInstance.value = createDrauu(__spreadValues({ el }, options));
|
|
95
|
+
syncStatus();
|
|
96
|
+
disposables = [
|
|
97
|
+
drauuInstance.value.on("canceled", () => onCanceledHook.trigger()),
|
|
98
|
+
drauuInstance.value.on("committed", () => onCommittedHook.trigger()),
|
|
99
|
+
drauuInstance.value.on("start", () => onStartHook.trigger()),
|
|
100
|
+
drauuInstance.value.on("end", () => onEndHook.trigger()),
|
|
101
|
+
drauuInstance.value.on("changed", () => {
|
|
102
|
+
syncStatus();
|
|
103
|
+
onChangedHook.trigger();
|
|
104
|
+
})
|
|
105
|
+
];
|
|
106
|
+
},
|
|
107
|
+
{ flush: "post" }
|
|
108
|
+
);
|
|
105
109
|
tryOnScopeDispose(() => cleanup());
|
|
106
110
|
return {
|
|
107
111
|
drauuInstance,
|
|
@@ -12,12 +12,16 @@ const UseFocusTrap = /* @__PURE__ */ /* #__PURE__ */ vueDemi.defineComponent({
|
|
|
12
12
|
const target = vueDemi.ref();
|
|
13
13
|
const activate = () => trap && trap.activate();
|
|
14
14
|
const deactivate = () => trap && trap.deactivate();
|
|
15
|
-
vueDemi.watch(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
vueDemi.watch(
|
|
16
|
+
() => core.unrefElement(target),
|
|
17
|
+
(el) => {
|
|
18
|
+
if (!el)
|
|
19
|
+
return;
|
|
20
|
+
trap = focusTrap.createFocusTrap(el, props.options || {});
|
|
21
|
+
activate();
|
|
22
|
+
},
|
|
23
|
+
{ flush: "post" }
|
|
24
|
+
);
|
|
21
25
|
vueDemi.onScopeDispose(() => deactivate());
|
|
22
26
|
return () => {
|
|
23
27
|
if (slots.default)
|
|
@@ -10,12 +10,16 @@ const UseFocusTrap = /* @__PURE__ */ /* #__PURE__ */ defineComponent({
|
|
|
10
10
|
const target = ref();
|
|
11
11
|
const activate = () => trap && trap.activate();
|
|
12
12
|
const deactivate = () => trap && trap.deactivate();
|
|
13
|
-
watch(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
watch(
|
|
14
|
+
() => unrefElement(target),
|
|
15
|
+
(el) => {
|
|
16
|
+
if (!el)
|
|
17
|
+
return;
|
|
18
|
+
trap = createFocusTrap(el, props.options || {});
|
|
19
|
+
activate();
|
|
20
|
+
},
|
|
21
|
+
{ flush: "post" }
|
|
22
|
+
);
|
|
19
23
|
onScopeDispose(() => deactivate());
|
|
20
24
|
return () => {
|
|
21
25
|
if (slots.default)
|
package/useFocusTrap.cjs
CHANGED
|
@@ -54,24 +54,28 @@ function useFocusTrap(target, options = {}) {
|
|
|
54
54
|
isPaused.value = false;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
vueDemi.watch(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
vueDemi.watch(
|
|
58
|
+
() => core.unrefElement(target),
|
|
59
|
+
(el) => {
|
|
60
|
+
if (!el)
|
|
61
|
+
return;
|
|
62
|
+
trap = focusTrap.createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
|
|
63
|
+
onActivate() {
|
|
64
|
+
hasFocus.value = true;
|
|
65
|
+
if (options.onActivate)
|
|
66
|
+
options.onActivate();
|
|
67
|
+
},
|
|
68
|
+
onDeactivate() {
|
|
69
|
+
hasFocus.value = false;
|
|
70
|
+
if (options.onDeactivate)
|
|
71
|
+
options.onDeactivate();
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
if (immediate)
|
|
75
|
+
activate();
|
|
76
|
+
},
|
|
77
|
+
{ flush: "post" }
|
|
78
|
+
);
|
|
75
79
|
core.tryOnScopeDispose(() => deactivate());
|
|
76
80
|
return {
|
|
77
81
|
hasFocus,
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -165,24 +165,28 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
165
165
|
isPaused.value = false;
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
vueDemi.watch(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
168
|
+
vueDemi.watch(
|
|
169
|
+
() => core.unrefElement(target),
|
|
170
|
+
(el) => {
|
|
171
|
+
if (!el)
|
|
172
|
+
return;
|
|
173
|
+
trap = focusTrap.createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
|
|
174
|
+
onActivate() {
|
|
175
|
+
hasFocus.value = true;
|
|
176
|
+
if (options.onActivate)
|
|
177
|
+
options.onActivate();
|
|
178
|
+
},
|
|
179
|
+
onDeactivate() {
|
|
180
|
+
hasFocus.value = false;
|
|
181
|
+
if (options.onDeactivate)
|
|
182
|
+
options.onDeactivate();
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
if (immediate)
|
|
186
|
+
activate();
|
|
187
|
+
},
|
|
188
|
+
{ flush: "post" }
|
|
189
|
+
);
|
|
186
190
|
core.tryOnScopeDispose(() => deactivate());
|
|
187
191
|
return {
|
|
188
192
|
hasFocus,
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(r,n,u){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let s=function(a,f){var c,_={},O={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,p){return _[l]=p,this},directive:function(l,p){return p?(n.directive(l,p),O):n.directive(l)},mount:function(l,p){return c||(c=new n(Object.assign({propsData:f},a,{provide:Object.assign(_,a.provide)})),c.$mount(l,p),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return O};var w=s;for(var v in n)r[v]=n[v];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=s}else if(n.version.slice(0,2)==="2.")if(u){for(var v in u)r[v]=u[v];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.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 v in n)r[v]=n[v];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(s,a,f){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,f),f):(s[a]=f,f)},r.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 r}(this.VueDemi=this.VueDemi||(typeof VueDemi
|
|
1
|
+
var VueDemi=function(r,n,u){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let s=function(a,f){var c,_={},O={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(l,p){return _[l]=p,this},directive:function(l,p){return p?(n.directive(l,p),O):n.directive(l)},mount:function(l,p){return c||(c=new n(Object.assign({propsData:f},a,{provide:Object.assign(_,a.provide)})),c.$mount(l,p),c)},unmount:function(){c&&(c.$destroy(),c=void 0)}};return O};var w=s;for(var v in n)r[v]=n[v];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=s}else if(n.version.slice(0,2)==="2.")if(u){for(var v in u)r[v]=u[v];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.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 v in n)r[v]=n[v];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(s,a,f){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,f),f):(s[a]=f,f)},r.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 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,n,u,v){"use strict";var w=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable,O=(i,t,e)=>t in i?w(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,l=(i,t)=>{for(var e in t||(t={}))c.call(t,e)&&O(i,e,t[e]);if(f)for(var e of f(t))_.call(t,e)&&O(i,e,t[e]);return i},p=(i,t)=>s(i,a(t)),A=(i,t)=>{var e={};for(var o in i)c.call(i,o)&&t.indexOf(o)<0&&(e[o]=i[o]);if(i!=null&&f)for(var o of f(i))t.indexOf(o)<0&&_.call(i,o)&&(e[o]=i[o]);return e};function j(i,t={}){let e;const o=t,{immediate:g}=o,T=A(o,["immediate"]),h=u.ref(!1),P=u.ref(!1),b=d=>e&&e.activate(d),y=d=>e&&e.deactivate(d),x=()=>{e&&(e.pause(),P.value=!0)},F=()=>{e&&(e.unpause(),P.value=!1)};return u.watch(()=>n.unrefElement(i),d=>{d&&(e=v.createFocusTrap(d,p(l({},T),{onActivate(){h.value=!0,t.onActivate&&t.onActivate()},onDeactivate(){h.value=!1,t.onDeactivate&&t.onDeactivate()}})),g&&b())},{flush:"post"}),n.tryOnScopeDispose(()=>y()),{hasFocus:h,isPaused:P,activate:b,deactivate:y,pause:x,unpause:F}}r.useFocusTrap=j})(this.VueUse=this.VueUse||{},VueUse,VueDemi,focusTrap);
|
package/useFocusTrap.mjs
CHANGED
|
@@ -52,24 +52,28 @@ function useFocusTrap(target, options = {}) {
|
|
|
52
52
|
isPaused.value = false;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
watch(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
watch(
|
|
56
|
+
() => unrefElement(target),
|
|
57
|
+
(el) => {
|
|
58
|
+
if (!el)
|
|
59
|
+
return;
|
|
60
|
+
trap = createFocusTrap(el, __spreadProps(__spreadValues({}, focusTrapOptions), {
|
|
61
|
+
onActivate() {
|
|
62
|
+
hasFocus.value = true;
|
|
63
|
+
if (options.onActivate)
|
|
64
|
+
options.onActivate();
|
|
65
|
+
},
|
|
66
|
+
onDeactivate() {
|
|
67
|
+
hasFocus.value = false;
|
|
68
|
+
if (options.onDeactivate)
|
|
69
|
+
options.onDeactivate();
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
if (immediate)
|
|
73
|
+
activate();
|
|
74
|
+
},
|
|
75
|
+
{ flush: "post" }
|
|
76
|
+
);
|
|
73
77
|
tryOnScopeDispose(() => deactivate());
|
|
74
78
|
return {
|
|
75
79
|
hasFocus,
|
package/useFuse.cjs
CHANGED
|
@@ -7,24 +7,35 @@ var shared = require('@vueuse/shared');
|
|
|
7
7
|
function useFuse(search, data, options) {
|
|
8
8
|
const createFuse = () => {
|
|
9
9
|
var _a, _b;
|
|
10
|
-
return new Fuse(
|
|
10
|
+
return new Fuse(
|
|
11
|
+
(_a = shared.toValue(data)) != null ? _a : [],
|
|
12
|
+
(_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
|
|
13
|
+
);
|
|
11
14
|
};
|
|
12
15
|
const fuse = vueDemi.ref(createFuse());
|
|
13
|
-
vueDemi.watch(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
vueDemi.watch(
|
|
17
|
+
() => {
|
|
18
|
+
var _a;
|
|
19
|
+
return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
20
|
+
},
|
|
21
|
+
() => {
|
|
22
|
+
fuse.value = createFuse();
|
|
23
|
+
},
|
|
24
|
+
{ deep: true }
|
|
25
|
+
);
|
|
26
|
+
vueDemi.watch(
|
|
27
|
+
() => shared.toValue(data),
|
|
28
|
+
(newData) => {
|
|
29
|
+
fuse.value.setCollection(newData);
|
|
30
|
+
},
|
|
31
|
+
{ deep: true }
|
|
32
|
+
);
|
|
22
33
|
const results = vueDemi.computed(() => {
|
|
23
|
-
const resolved = shared.
|
|
24
|
-
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !
|
|
25
|
-
return shared.
|
|
34
|
+
const resolved = shared.toValue(options);
|
|
35
|
+
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
|
|
36
|
+
return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
26
37
|
const limit = resolved == null ? void 0 : resolved.resultLimit;
|
|
27
|
-
return fuse.value.search(shared.
|
|
38
|
+
return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
|
|
28
39
|
});
|
|
29
40
|
return {
|
|
30
41
|
fuse,
|
package/useFuse.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
2
|
import { ComputedRef } from 'vue-demi';
|
|
3
3
|
import Fuse from 'fuse.js';
|
|
4
|
-
import {
|
|
4
|
+
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
5
5
|
|
|
6
6
|
type FuseOptions<T> = Fuse.IFuseOptions<T>;
|
|
7
7
|
interface UseFuseOptions<T> {
|
|
@@ -9,7 +9,7 @@ interface UseFuseOptions<T> {
|
|
|
9
9
|
resultLimit?: number;
|
|
10
10
|
matchAllWhenSearchEmpty?: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare function useFuse<DataItem>(search:
|
|
12
|
+
declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: MaybeRefOrGetter<DataItem[]>, options?: MaybeRefOrGetter<UseFuseOptions<DataItem>>): {
|
|
13
13
|
fuse: vue_demi.Ref<{
|
|
14
14
|
search: <R = DataItem>(pattern: string | Fuse.Expression, options?: Fuse.FuseSearchOptions | undefined) => Fuse.FuseResult<R>[];
|
|
15
15
|
setCollection: (docs: readonly DataItem[], index?: Fuse.FuseIndex<DataItem> | undefined) => void;
|
package/useFuse.iife.js
CHANGED
|
@@ -118,24 +118,35 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
118
118
|
function useFuse(search, data, options) {
|
|
119
119
|
const createFuse = () => {
|
|
120
120
|
var _a, _b;
|
|
121
|
-
return new Fuse(
|
|
121
|
+
return new Fuse(
|
|
122
|
+
(_a = shared.toValue(data)) != null ? _a : [],
|
|
123
|
+
(_b = shared.toValue(options)) == null ? void 0 : _b.fuseOptions
|
|
124
|
+
);
|
|
122
125
|
};
|
|
123
126
|
const fuse = vueDemi.ref(createFuse());
|
|
124
|
-
vueDemi.watch(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
vueDemi.watch(
|
|
128
|
+
() => {
|
|
129
|
+
var _a;
|
|
130
|
+
return (_a = shared.toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
131
|
+
},
|
|
132
|
+
() => {
|
|
133
|
+
fuse.value = createFuse();
|
|
134
|
+
},
|
|
135
|
+
{ deep: true }
|
|
136
|
+
);
|
|
137
|
+
vueDemi.watch(
|
|
138
|
+
() => shared.toValue(data),
|
|
139
|
+
(newData) => {
|
|
140
|
+
fuse.value.setCollection(newData);
|
|
141
|
+
},
|
|
142
|
+
{ deep: true }
|
|
143
|
+
);
|
|
133
144
|
const results = vueDemi.computed(() => {
|
|
134
|
-
const resolved = shared.
|
|
135
|
-
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !
|
|
136
|
-
return shared.
|
|
145
|
+
const resolved = shared.toValue(options);
|
|
146
|
+
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !shared.toValue(search))
|
|
147
|
+
return shared.toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
137
148
|
const limit = resolved == null ? void 0 : resolved.resultLimit;
|
|
138
|
-
return fuse.value.search(shared.
|
|
149
|
+
return fuse.value.search(shared.toValue(search), limit ? { limit } : void 0);
|
|
139
150
|
});
|
|
140
151
|
return {
|
|
141
152
|
fuse,
|
package/useFuse.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,e,
|
|
1
|
+
var VueDemi=function(n,e,f){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 o=function(t,u){var l,c={},v={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(i,s){return c[i]=s,this},directive:function(i,s){return s?(e.directive(i,s),v):e.directive(i)},mount:function(i,s){return l||(l=new e(Object.assign({propsData:u},t,{provide:Object.assign(c,t.provide)})),l.$mount(i,s),l)},unmount:function(){l&&(l.$destroy(),l=void 0)}};return v};var d=o;for(var r in e)n[r]=e[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.warn=e.util.warn,n.createApp=o}else if(e.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=e,n.Vue2=e,n.version=e.version}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(e.version.slice(0,2)==="3."){for(var r in e)n[r]=e[r];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=e,n.Vue2=void 0,n.version=e.version,n.set=function(o,t,u){return Array.isArray(o)?(o.length=Math.max(o.length,t),o.splice(t,1,u),u):(o[t]=u,u)},n.del=function(o,t){if(Array.isArray(o)){o.splice(t,1);return}delete o[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,f,r){"use strict";function d(o,t,u){const l=()=>{var i,s;return new e((i=r.toValue(t))!=null?i:[],(s=r.toValue(u))==null?void 0:s.fuseOptions)},c=f.ref(l());f.watch(()=>{var i;return(i=r.toValue(u))==null?void 0:i.fuseOptions},()=>{c.value=l()},{deep:!0}),f.watch(()=>r.toValue(t),i=>{c.value.setCollection(i)},{deep:!0});const v=f.computed(()=>{const i=r.toValue(u);if(i?.matchAllWhenSearchEmpty&&!r.toValue(o))return r.toValue(t).map((a,p)=>({item:a,refIndex:p}));const s=i?.resultLimit;return c.value.search(r.toValue(o),s?{limit:s}:void 0)});return{fuse:c,results:v}}n.useFuse=d})(this.VueUse=this.VueUse||{},Fuse,VueDemi,VueUse);
|
package/useFuse.mjs
CHANGED
|
@@ -1,28 +1,39 @@
|
|
|
1
1
|
import Fuse from 'fuse.js';
|
|
2
|
-
import { ref, watch, computed
|
|
3
|
-
import {
|
|
2
|
+
import { ref, watch, computed } from 'vue-demi';
|
|
3
|
+
import { toValue } from '@vueuse/shared';
|
|
4
4
|
|
|
5
5
|
function useFuse(search, data, options) {
|
|
6
6
|
const createFuse = () => {
|
|
7
7
|
var _a, _b;
|
|
8
|
-
return new Fuse(
|
|
8
|
+
return new Fuse(
|
|
9
|
+
(_a = toValue(data)) != null ? _a : [],
|
|
10
|
+
(_b = toValue(options)) == null ? void 0 : _b.fuseOptions
|
|
11
|
+
);
|
|
9
12
|
};
|
|
10
13
|
const fuse = ref(createFuse());
|
|
11
|
-
watch(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
watch(
|
|
15
|
+
() => {
|
|
16
|
+
var _a;
|
|
17
|
+
return (_a = toValue(options)) == null ? void 0 : _a.fuseOptions;
|
|
18
|
+
},
|
|
19
|
+
() => {
|
|
20
|
+
fuse.value = createFuse();
|
|
21
|
+
},
|
|
22
|
+
{ deep: true }
|
|
23
|
+
);
|
|
24
|
+
watch(
|
|
25
|
+
() => toValue(data),
|
|
26
|
+
(newData) => {
|
|
27
|
+
fuse.value.setCollection(newData);
|
|
28
|
+
},
|
|
29
|
+
{ deep: true }
|
|
30
|
+
);
|
|
20
31
|
const results = computed(() => {
|
|
21
|
-
const resolved =
|
|
22
|
-
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !
|
|
23
|
-
return
|
|
32
|
+
const resolved = toValue(options);
|
|
33
|
+
if ((resolved == null ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search))
|
|
34
|
+
return toValue(data).map((item, index) => ({ item, refIndex: index }));
|
|
24
35
|
const limit = resolved == null ? void 0 : resolved.resultLimit;
|
|
25
|
-
return fuse.value.search(
|
|
36
|
+
return fuse.value.search(toValue(search), limit ? { limit } : void 0);
|
|
26
37
|
});
|
|
27
38
|
return {
|
|
28
39
|
fuse,
|
package/useIDBKeyval.cjs
CHANGED
|
@@ -32,7 +32,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
32
32
|
} = options;
|
|
33
33
|
const isFinished = vueDemi.ref(false);
|
|
34
34
|
const data = (shallow ? vueDemi.shallowRef : vueDemi.ref)(initialValue);
|
|
35
|
-
const rawInit = shared.
|
|
35
|
+
const rawInit = shared.toValue(initialValue);
|
|
36
36
|
async function read() {
|
|
37
37
|
try {
|
|
38
38
|
const rawValue = await idbKeyval.get(key);
|
package/useIDBKeyval.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, MaybeRefOrGetter, RemovableRef } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -33,7 +33,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
33
33
|
* @param initialValue
|
|
34
34
|
* @param options
|
|
35
35
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue:
|
|
36
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): {
|
|
37
37
|
data: RemovableRef<T>;
|
|
38
38
|
isFinished: Ref<boolean>;
|
|
39
39
|
};
|
package/useIDBKeyval.iife.js
CHANGED
|
@@ -143,7 +143,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
143
143
|
} = options;
|
|
144
144
|
const isFinished = vueDemi.ref(false);
|
|
145
145
|
const data = (shallow ? vueDemi.shallowRef : vueDemi.ref)(initialValue);
|
|
146
|
-
const rawInit = shared.
|
|
146
|
+
const rawInit = shared.toValue(initialValue);
|
|
147
147
|
async function read() {
|
|
148
148
|
try {
|
|
149
149
|
const rawValue = await idbKeyval.get(key);
|
package/useIDBKeyval.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(r,n,c){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let
|
|
1
|
+
var VueDemi=function(r,n,c){if(r.install)return r;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),r;if(n.version.slice(0,4)==="2.7."){let s=function(a,u){var f,d={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(e,t){return d[e]=t,this},directive:function(e,t){return t?(n.directive(e,t),v):n.directive(e)},mount:function(e,t){return f||(f=new n(Object.assign({propsData:u},a,{provide:Object.assign(d,a.provide)})),f.$mount(e,t),f)},unmount:function(){f&&(f.$destroy(),f=void 0)}};return v};var O=s;for(var o in n)r[o]=n[o];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.version=n.version,r.warn=n.util.warn,r.createApp=s}else if(n.version.slice(0,2)==="2.")if(c){for(var o in c)r[o]=c[o];r.isVue2=!0,r.isVue3=!1,r.install=function(){},r.Vue=n,r.Vue2=n,r.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 o in n)r[o]=n[o];r.isVue2=!1,r.isVue3=!0,r.install=function(){},r.Vue=n,r.Vue2=void 0,r.version=n.version,r.set=function(s,a,u){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,u),u):(s[a]=u,u)},r.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 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,n,c,o){"use strict";var O=Object.defineProperty,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,f=(e,t,i)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,d=(e,t)=>{for(var i in t||(t={}))a.call(t,i)&&f(e,i,t[i]);if(s)for(var i of s(t))u.call(t,i)&&f(e,i,t[i]);return e};function v(e,t,i={}){const{flush:_="pre",deep:A=!0,shallow:P=!1,onError:h=p=>{console.error(p)},writeDefaults:b=!0}=i,y=c.ref(!1),l=(P?c.shallowRef:c.ref)(t),w=n.toValue(t);async function I(){try{const p=await o.get(e);p===void 0?w!=null&&b&&await o.set(e,w):l.value=p}catch(p){h(p)}y.value=!0}I();async function g(){try{l.value==null?await o.del(e):Array.isArray(l.value)?await o.update(e,()=>JSON.parse(JSON.stringify(l.value))):typeof l.value=="object"?await o.update(e,()=>d({},l.value)):await o.update(e,()=>l.value)}catch(p){h(p)}}return c.watch(l,()=>g(),{flush:_,deep:A}),{isFinished:y,data:l}}r.useIDBKeyval=v})(this.VueUse=this.VueUse||{},VueUse,VueDemi,idbKeyval);
|
package/useIDBKeyval.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toValue } from '@vueuse/shared';
|
|
2
2
|
import { ref, shallowRef, watch } from 'vue-demi';
|
|
3
3
|
import { get, set, del, update } from 'idb-keyval';
|
|
4
4
|
|
|
@@ -30,7 +30,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
30
30
|
} = options;
|
|
31
31
|
const isFinished = ref(false);
|
|
32
32
|
const data = (shallow ? shallowRef : ref)(initialValue);
|
|
33
|
-
const rawInit =
|
|
33
|
+
const rawInit = toValue(initialValue);
|
|
34
34
|
async function read() {
|
|
35
35
|
try {
|
|
36
36
|
const rawValue = await get(key);
|
package/useJwt.cjs
CHANGED
|
@@ -17,8 +17,8 @@ function useJwt(encodedJwt, options = {}) {
|
|
|
17
17
|
return fallbackValue;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const header = vueDemi.computed(() => decodeWithFallback(shared.
|
|
21
|
-
const payload = vueDemi.computed(() => decodeWithFallback(shared.
|
|
20
|
+
const header = vueDemi.computed(() => decodeWithFallback(shared.toValue(encodedJwt), { header: true }));
|
|
21
|
+
const payload = vueDemi.computed(() => decodeWithFallback(shared.toValue(encodedJwt)));
|
|
22
22
|
return {
|
|
23
23
|
header,
|
|
24
24
|
payload
|
package/useJwt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue-demi';
|
|
2
|
-
import {
|
|
2
|
+
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
3
|
import { JwtPayload, JwtHeader } from 'jwt-decode';
|
|
4
4
|
|
|
5
5
|
interface UseJwtOptions<Fallback> {
|
|
@@ -24,6 +24,6 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
24
24
|
* @see https://vueuse.org/useJwt
|
|
25
25
|
* @param jwt
|
|
26
26
|
*/
|
|
27
|
-
declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt:
|
|
27
|
+
declare function useJwt<Payload extends object = JwtPayload, Header extends object = JwtHeader, Fallback = null>(encodedJwt: MaybeRefOrGetter<string>, options?: UseJwtOptions<Fallback>): UseJwtReturn<Payload, Header, Fallback>;
|
|
28
28
|
|
|
29
29
|
export { UseJwtOptions, UseJwtReturn, useJwt };
|
package/useJwt.iife.js
CHANGED
|
@@ -128,8 +128,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
128
128
|
return fallbackValue;
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
const header = vueDemi.computed(() => decodeWithFallback(shared.
|
|
132
|
-
const payload = vueDemi.computed(() => decodeWithFallback(shared.
|
|
131
|
+
const header = vueDemi.computed(() => decodeWithFallback(shared.toValue(encodedJwt), { header: true }));
|
|
132
|
+
const payload = vueDemi.computed(() => decodeWithFallback(shared.toValue(encodedJwt)));
|
|
133
133
|
return {
|
|
134
134
|
header,
|
|
135
135
|
payload
|