@vueuse/integrations 10.3.0 → 10.4.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 +40 -162
- package/index.d.cts +8 -18
- package/index.d.mts +8 -18
- package/index.d.ts +8 -18
- package/index.iife.js +40 -162
- package/index.iife.min.js +1 -1
- package/index.mjs +42 -164
- package/package.json +36 -36
- package/useAsyncValidator/component.cjs +5 -29
- package/useAsyncValidator/component.mjs +5 -29
- package/useAsyncValidator.cjs +3 -21
- package/useAsyncValidator.d.cts +1 -1
- package/useAsyncValidator.d.mts +1 -1
- package/useAsyncValidator.d.ts +1 -1
- package/useAsyncValidator.iife.js +3 -21
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +3 -21
- package/useAxios.cjs +5 -21
- package/useAxios.d.cts +1 -1
- package/useAxios.d.mts +1 -1
- package/useAxios.d.ts +1 -1
- package/useAxios.iife.js +5 -21
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +5 -21
- package/useChangeCase.d.cts +2 -14
- package/useChangeCase.d.mts +2 -14
- package/useChangeCase.d.ts +2 -14
- package/useCookies.cjs +2 -18
- package/useCookies.iife.js +2 -18
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +2 -18
- package/useDrauu.cjs +1 -17
- package/useDrauu.d.cts +1 -1
- package/useDrauu.d.mts +1 -1
- package/useDrauu.d.ts +1 -1
- package/useDrauu.iife.js +1 -17
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +1 -17
- package/useFocusTrap/component.d.cts +1 -1
- package/useFocusTrap/component.d.mts +1 -1
- package/useFocusTrap/component.d.ts +1 -1
- package/useFocusTrap.cjs +4 -34
- package/useFocusTrap.d.cts +1 -1
- package/useFocusTrap.d.mts +1 -1
- package/useFocusTrap.d.ts +1 -1
- package/useFocusTrap.iife.js +4 -34
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +4 -34
- package/useFuse.d.cts +1 -1
- package/useFuse.d.mts +1 -1
- package/useFuse.d.ts +1 -1
- package/useIDBKeyval.cjs +17 -19
- package/useIDBKeyval.d.cts +8 -6
- package/useIDBKeyval.d.mts +8 -6
- package/useIDBKeyval.d.ts +8 -6
- package/useIDBKeyval.iife.js +18 -21
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +18 -20
- package/useJwt.d.cts +1 -1
- package/useJwt.d.mts +1 -1
- package/useJwt.d.ts +1 -1
- package/useNProgress.d.cts +1 -1
- package/useNProgress.d.mts +1 -1
- package/useNProgress.d.ts +1 -1
- package/useSortable/component.cjs +13 -36
- package/useSortable/component.mjs +14 -37
- package/useSortable.cjs +9 -32
- package/useSortable.d.cts +1 -1
- package/useSortable.d.mts +1 -1
- package/useSortable.d.ts +1 -1
- package/useSortable.iife.js +9 -32
- package/useSortable.iife.min.js +1 -1
- package/useSortable.mjs +10 -33
package/useDrauu.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(e,n,
|
|
1
|
+
var VueDemi=function(e,n,d){if(e.install)return e;if(!n)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if(n.version.slice(0,4)==="2.7."){let s=function(a,c){var o,f={},v={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(i,l){return f[i]=l,this},directive:function(i,l){return l?(n.directive(i,l),v):n.directive(i)},mount:function(i,l){return o||(o=new n(Object.assign({propsData:c},a,{provide:Object.assign(f,a.provide)})),o.$mount(i,l),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return v};var h=s;for(var t in n)e[t]=n[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.warn=n.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=s}else if(n.version.slice(0,2)==="2.")if(d){for(var t in d)e[t]=d[t];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=n,e.Vue2=n,e.version=n.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(n.version.slice(0,2)==="3."){for(var t in n)e[t]=n[t];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=n,e.Vue2=void 0,e.version=n.version,e.set=function(s,a,c){return Array.isArray(s)?(s.length=Math.max(s.length,a),s.splice(a,1,c),c):(s[a]=c,c)},e.del=function(s,a){if(Array.isArray(s)){s.splice(a,1);return}delete s[a]}}else console.error("[vue-demi] Vue version "+n.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(e,n,d,t,h){"use strict";function s(a,c){const o=n.ref();let f=[];const v=t.createEventHook(),i=t.createEventHook(),l=t.createEventHook(),g=t.createEventHook(),b=t.createEventHook(),E=n.ref(!1),C=n.ref(!1),k=n.ref(!1),S=n.ref(!1),p=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw"});n.watch(p,()=>{const r=o.value;r&&(r.brush=p.value,r.mode=p.value.mode)},{deep:!0});const w=()=>{var r;return(r=o.value)==null?void 0:r.undo()},A=()=>{var r;return(r=o.value)==null?void 0:r.redo()},I=()=>{var r;return(r=o.value)==null?void 0:r.clear()},_=()=>{var r;return(r=o.value)==null?void 0:r.cancel()},P=r=>{var u;return(u=o.value)==null?void 0:u.load(r)},U=()=>{var r;return(r=o.value)==null?void 0:r.dump()},y=()=>{var r;f.forEach(u=>u()),(r=o.value)==null||r.unmount()},H=()=>{o.value&&(E.value=o.value.canUndo(),C.value=o.value.canRedo(),k.value=o.value.altPressed,S.value=o.value.shiftPressed)};return n.watch(()=>t.unrefElement(a),r=>{!r||typeof SVGSVGElement>"u"||!(r instanceof SVGSVGElement)||(o.value&&y(),o.value=d.createDrauu({el:r,...c}),H(),f=[o.value.on("canceled",()=>i.trigger()),o.value.on("committed",u=>l.trigger(u)),o.value.on("start",()=>g.trigger()),o.value.on("end",()=>b.trigger()),o.value.on("changed",()=>{H(),v.trigger()})])},{flush:"post"}),h.tryOnScopeDispose(()=>y()),{drauuInstance:o,load:P,dump:U,clear:I,cancel:_,undo:w,redo:A,canUndo:E,canRedo:C,brush:p,onChanged:v.on,onCommitted:l.on,onStart:g.on,onEnd:b.on,onCanceled:i.on}}e.useDrauu=s})(this.VueUse=this.VueUse||{},VueDemi,Drauu,VueUse,VueUse);
|
package/useDrauu.mjs
CHANGED
|
@@ -3,22 +3,6 @@ import { createDrauu } from 'drauu';
|
|
|
3
3
|
import { createEventHook, unrefElement } from '@vueuse/core';
|
|
4
4
|
import { tryOnScopeDispose } from '@vueuse/shared';
|
|
5
5
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
6
|
function useDrauu(target, options) {
|
|
23
7
|
const drauuInstance = ref();
|
|
24
8
|
let disposables = [];
|
|
@@ -91,7 +75,7 @@ function useDrauu(target, options) {
|
|
|
91
75
|
return;
|
|
92
76
|
if (drauuInstance.value)
|
|
93
77
|
cleanup();
|
|
94
|
-
drauuInstance.value = createDrauu(
|
|
78
|
+
drauuInstance.value = createDrauu({ el, ...options });
|
|
95
79
|
syncStatus();
|
|
96
80
|
disposables = [
|
|
97
81
|
drauuInstance.value.on("canceled", () => onCanceledHook.trigger()),
|
|
@@ -14,4 +14,4 @@ interface ComponentUseFocusTrapOptions extends RenderableComponent {
|
|
|
14
14
|
}
|
|
15
15
|
declare const UseFocusTrap: vue_demi.DefineComponent<ComponentUseFocusTrapOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<ComponentUseFocusTrapOptions>, {}, {}>;
|
|
16
16
|
|
|
17
|
-
export { ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
17
|
+
export { type ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
@@ -14,4 +14,4 @@ interface ComponentUseFocusTrapOptions extends RenderableComponent {
|
|
|
14
14
|
}
|
|
15
15
|
declare const UseFocusTrap: vue_demi.DefineComponent<ComponentUseFocusTrapOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<ComponentUseFocusTrapOptions>, {}, {}>;
|
|
16
16
|
|
|
17
|
-
export { ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
17
|
+
export { type ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
@@ -14,4 +14,4 @@ interface ComponentUseFocusTrapOptions extends RenderableComponent {
|
|
|
14
14
|
}
|
|
15
15
|
declare const UseFocusTrap: vue_demi.DefineComponent<ComponentUseFocusTrapOptions, {}, {}, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<ComponentUseFocusTrapOptions>, {}, {}>;
|
|
16
16
|
|
|
17
|
-
export { ComponentUseFocusTrapOptions, UseFocusTrap };
|
|
17
|
+
export { type ComponentUseFocusTrapOptions, UseFocusTrap };
|
package/useFocusTrap.cjs
CHANGED
|
@@ -4,40 +4,9 @@ var core = require('@vueuse/core');
|
|
|
4
4
|
var vueDemi = require('vue-demi');
|
|
5
5
|
var focusTrap = require('focus-trap');
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
-
var __objRest = (source, exclude) => {
|
|
27
|
-
var target = {};
|
|
28
|
-
for (var prop in source)
|
|
29
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
if (source != null && __getOwnPropSymbols)
|
|
32
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
7
|
function useFocusTrap(target, options = {}) {
|
|
39
8
|
let trap;
|
|
40
|
-
const
|
|
9
|
+
const { immediate, ...focusTrapOptions } = options;
|
|
41
10
|
const hasFocus = vueDemi.ref(false);
|
|
42
11
|
const isPaused = vueDemi.ref(false);
|
|
43
12
|
const activate = (opts) => trap && trap.activate(opts);
|
|
@@ -59,7 +28,8 @@ function useFocusTrap(target, options = {}) {
|
|
|
59
28
|
(el) => {
|
|
60
29
|
if (!el)
|
|
61
30
|
return;
|
|
62
|
-
trap = focusTrap.createFocusTrap(el,
|
|
31
|
+
trap = focusTrap.createFocusTrap(el, {
|
|
32
|
+
...focusTrapOptions,
|
|
63
33
|
onActivate() {
|
|
64
34
|
hasFocus.value = true;
|
|
65
35
|
if (options.onActivate)
|
|
@@ -70,7 +40,7 @@ function useFocusTrap(target, options = {}) {
|
|
|
70
40
|
if (options.onDeactivate)
|
|
71
41
|
options.onDeactivate();
|
|
72
42
|
}
|
|
73
|
-
})
|
|
43
|
+
});
|
|
74
44
|
if (immediate)
|
|
75
45
|
activate();
|
|
76
46
|
},
|
package/useFocusTrap.d.cts
CHANGED
|
@@ -54,4 +54,4 @@ interface UseFocusTrapReturn {
|
|
|
54
54
|
*/
|
|
55
55
|
declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
56
56
|
|
|
57
|
-
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
|
57
|
+
export { type UseFocusTrapOptions, type UseFocusTrapReturn, useFocusTrap };
|
package/useFocusTrap.d.mts
CHANGED
|
@@ -54,4 +54,4 @@ interface UseFocusTrapReturn {
|
|
|
54
54
|
*/
|
|
55
55
|
declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
56
56
|
|
|
57
|
-
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
|
57
|
+
export { type UseFocusTrapOptions, type UseFocusTrapReturn, useFocusTrap };
|
package/useFocusTrap.d.ts
CHANGED
|
@@ -54,4 +54,4 @@ interface UseFocusTrapReturn {
|
|
|
54
54
|
*/
|
|
55
55
|
declare function useFocusTrap(target: MaybeElementRef, options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
56
56
|
|
|
57
|
-
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
|
57
|
+
export { type UseFocusTrapOptions, type UseFocusTrapReturn, useFocusTrap };
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -117,40 +117,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
117
117
|
;(function (exports, core, vueDemi, focusTrap) {
|
|
118
118
|
'use strict';
|
|
119
119
|
|
|
120
|
-
var __defProp = Object.defineProperty;
|
|
121
|
-
var __defProps = Object.defineProperties;
|
|
122
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
123
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
124
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
125
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
126
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
127
|
-
var __spreadValues = (a, b) => {
|
|
128
|
-
for (var prop in b || (b = {}))
|
|
129
|
-
if (__hasOwnProp.call(b, prop))
|
|
130
|
-
__defNormalProp(a, prop, b[prop]);
|
|
131
|
-
if (__getOwnPropSymbols)
|
|
132
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
133
|
-
if (__propIsEnum.call(b, prop))
|
|
134
|
-
__defNormalProp(a, prop, b[prop]);
|
|
135
|
-
}
|
|
136
|
-
return a;
|
|
137
|
-
};
|
|
138
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
139
|
-
var __objRest = (source, exclude) => {
|
|
140
|
-
var target = {};
|
|
141
|
-
for (var prop in source)
|
|
142
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
143
|
-
target[prop] = source[prop];
|
|
144
|
-
if (source != null && __getOwnPropSymbols)
|
|
145
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
146
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
147
|
-
target[prop] = source[prop];
|
|
148
|
-
}
|
|
149
|
-
return target;
|
|
150
|
-
};
|
|
151
120
|
function useFocusTrap(target, options = {}) {
|
|
152
121
|
let trap;
|
|
153
|
-
const
|
|
122
|
+
const { immediate, ...focusTrapOptions } = options;
|
|
154
123
|
const hasFocus = vueDemi.ref(false);
|
|
155
124
|
const isPaused = vueDemi.ref(false);
|
|
156
125
|
const activate = (opts) => trap && trap.activate(opts);
|
|
@@ -172,7 +141,8 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
172
141
|
(el) => {
|
|
173
142
|
if (!el)
|
|
174
143
|
return;
|
|
175
|
-
trap = focusTrap.createFocusTrap(el,
|
|
144
|
+
trap = focusTrap.createFocusTrap(el, {
|
|
145
|
+
...focusTrapOptions,
|
|
176
146
|
onActivate() {
|
|
177
147
|
hasFocus.value = true;
|
|
178
148
|
if (options.onActivate)
|
|
@@ -183,7 +153,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
183
153
|
if (options.onDeactivate)
|
|
184
154
|
options.onDeactivate();
|
|
185
155
|
}
|
|
186
|
-
})
|
|
156
|
+
});
|
|
187
157
|
if (immediate)
|
|
188
158
|
activate();
|
|
189
159
|
},
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
1
|
+
var VueDemi=function(n,t,f){if(n.install)return n;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(t.version.slice(0,4)==="2.7."){let r=function(s,e){var o,l={},u={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(a,c){return l[a]=c,this},directive:function(a,c){return c?(t.directive(a,c),u):t.directive(a)},mount:function(a,c){return o||(o=new t(Object.assign({propsData:e},s,{provide:Object.assign(l,s.provide)})),o.$mount(a,c),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return u};var d=r;for(var i in t)n[i]=t[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.warn=t.util.warn,n.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=r}else if(t.version.slice(0,2)==="2.")if(f){for(var i in f)n[i]=f[i];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=t,n.Vue2=t,n.version=t.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(t.version.slice(0,2)==="3."){for(var i in t)n[i]=t[i];n.isVue2=!1,n.isVue3=!0,n.install=function(){},n.Vue=t,n.Vue2=void 0,n.version=t.version,n.set=function(r,s,e){return Array.isArray(r)?(r.length=Math.max(r.length,s),r.splice(s,1,e),e):(r[s]=e,e)},n.del=function(r,s){if(Array.isArray(r)){r.splice(s,1);return}delete r[s]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return n}(this.VueDemi=this.VueDemi||(typeof VueDemi<"u"?VueDemi:{}),this.Vue||(typeof Vue<"u"?Vue:void 0),this.VueCompositionAPI||(typeof VueCompositionAPI<"u"?VueCompositionAPI:void 0));(function(n,t,f,i){"use strict";function d(r,s={}){let e;const{immediate:o,...l}=s,u=f.ref(!1),a=f.ref(!1),c=v=>e&&e.activate(v),p=v=>e&&e.deactivate(v),h=()=>{e&&(e.pause(),a.value=!0)},A=()=>{e&&(e.unpause(),a.value=!1)};return f.watch(()=>t.unrefElement(r),v=>{v&&(e=i.createFocusTrap(v,{...l,onActivate(){u.value=!0,s.onActivate&&s.onActivate()},onDeactivate(){u.value=!1,s.onDeactivate&&s.onDeactivate()}}),o&&c())},{flush:"post"}),t.tryOnScopeDispose(()=>p()),{hasFocus:u,isPaused:a,activate:c,deactivate:p,pause:h,unpause:A}}n.useFocusTrap=d})(this.VueUse=this.VueUse||{},VueUse,VueDemi,focusTrap);
|
package/useFocusTrap.mjs
CHANGED
|
@@ -2,40 +2,9 @@ import { unrefElement, tryOnScopeDispose } from '@vueuse/core';
|
|
|
2
2
|
import { ref, watch } from 'vue-demi';
|
|
3
3
|
import { createFocusTrap } from 'focus-trap';
|
|
4
4
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defProps = Object.defineProperties;
|
|
7
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
5
|
function useFocusTrap(target, options = {}) {
|
|
37
6
|
let trap;
|
|
38
|
-
const
|
|
7
|
+
const { immediate, ...focusTrapOptions } = options;
|
|
39
8
|
const hasFocus = ref(false);
|
|
40
9
|
const isPaused = ref(false);
|
|
41
10
|
const activate = (opts) => trap && trap.activate(opts);
|
|
@@ -57,7 +26,8 @@ function useFocusTrap(target, options = {}) {
|
|
|
57
26
|
(el) => {
|
|
58
27
|
if (!el)
|
|
59
28
|
return;
|
|
60
|
-
trap = createFocusTrap(el,
|
|
29
|
+
trap = createFocusTrap(el, {
|
|
30
|
+
...focusTrapOptions,
|
|
61
31
|
onActivate() {
|
|
62
32
|
hasFocus.value = true;
|
|
63
33
|
if (options.onActivate)
|
|
@@ -68,7 +38,7 @@ function useFocusTrap(target, options = {}) {
|
|
|
68
38
|
if (options.onDeactivate)
|
|
69
39
|
options.onDeactivate();
|
|
70
40
|
}
|
|
71
|
-
})
|
|
41
|
+
});
|
|
72
42
|
if (immediate)
|
|
73
43
|
activate();
|
|
74
44
|
},
|
package/useFuse.d.cts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useFuse.d.mts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useFuse.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ declare function useFuse<DataItem>(search: MaybeRefOrGetter<string>, data: Maybe
|
|
|
22
22
|
};
|
|
23
23
|
type UseFuseReturn = ReturnType<typeof useFuse>;
|
|
24
24
|
|
|
25
|
-
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
|
25
|
+
export { type FuseOptions, type UseFuseOptions, type UseFuseReturn, useFuse };
|
package/useIDBKeyval.cjs
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var shared = require('@vueuse/shared');
|
|
4
|
+
var core = require('@vueuse/core');
|
|
4
5
|
var vueDemi = require('vue-demi');
|
|
5
6
|
var idbKeyval = require('idb-keyval');
|
|
6
7
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
8
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
24
9
|
const {
|
|
25
10
|
flush = "pre",
|
|
@@ -56,7 +41,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
56
41
|
if (Array.isArray(data.value))
|
|
57
42
|
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
58
43
|
else if (typeof data.value === "object")
|
|
59
|
-
await idbKeyval.update(key, () =>
|
|
44
|
+
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
60
45
|
else
|
|
61
46
|
await idbKeyval.update(key, () => data.value);
|
|
62
47
|
}
|
|
@@ -64,8 +49,21 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
64
49
|
onError(e);
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
const {
|
|
53
|
+
pause: pauseWatch,
|
|
54
|
+
resume: resumeWatch
|
|
55
|
+
} = core.watchPausable(data, () => write(), { flush, deep });
|
|
56
|
+
async function setData(value) {
|
|
57
|
+
pauseWatch();
|
|
58
|
+
data.value = value;
|
|
59
|
+
await write();
|
|
60
|
+
resumeWatch();
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
set: setData,
|
|
64
|
+
isFinished,
|
|
65
|
+
data
|
|
66
|
+
};
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
exports.useIDBKeyval = useIDBKeyval;
|
package/useIDBKeyval.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigurableFlush,
|
|
1
|
+
import { ConfigurableFlush, RemovableRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
2
|
import { Ref } from 'vue-demi';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
@@ -27,15 +27,17 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
27
27
|
*/
|
|
28
28
|
writeDefaults?: boolean;
|
|
29
29
|
}
|
|
30
|
+
interface UseIDBKeyvalReturn<T> {
|
|
31
|
+
data: RemovableRef<T>;
|
|
32
|
+
isFinished: Ref<boolean>;
|
|
33
|
+
set(value: T): Promise<void>;
|
|
34
|
+
}
|
|
30
35
|
/**
|
|
31
36
|
*
|
|
32
37
|
* @param key
|
|
33
38
|
* @param initialValue
|
|
34
39
|
* @param options
|
|
35
40
|
*/
|
|
36
|
-
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions):
|
|
37
|
-
data: RemovableRef<T>;
|
|
38
|
-
isFinished: Ref<boolean>;
|
|
39
|
-
};
|
|
41
|
+
declare function useIDBKeyval<T>(key: IDBValidKey, initialValue: MaybeRefOrGetter<T>, options?: UseIDBOptions): UseIDBKeyvalReturn<T>;
|
|
40
42
|
|
|
41
|
-
export { UseIDBOptions, useIDBKeyval };
|
|
43
|
+
export { type UseIDBKeyvalReturn, type UseIDBOptions, useIDBKeyval };
|
package/useIDBKeyval.iife.js
CHANGED
|
@@ -114,25 +114,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
114
114
|
this.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
115
115
|
);
|
|
116
116
|
;
|
|
117
|
-
;(function (exports, shared, vueDemi, idbKeyval) {
|
|
117
|
+
;(function (exports, shared, core, vueDemi, idbKeyval) {
|
|
118
118
|
'use strict';
|
|
119
119
|
|
|
120
|
-
var __defProp = Object.defineProperty;
|
|
121
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
122
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
123
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
124
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
125
|
-
var __spreadValues = (a, b) => {
|
|
126
|
-
for (var prop in b || (b = {}))
|
|
127
|
-
if (__hasOwnProp.call(b, prop))
|
|
128
|
-
__defNormalProp(a, prop, b[prop]);
|
|
129
|
-
if (__getOwnPropSymbols)
|
|
130
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
131
|
-
if (__propIsEnum.call(b, prop))
|
|
132
|
-
__defNormalProp(a, prop, b[prop]);
|
|
133
|
-
}
|
|
134
|
-
return a;
|
|
135
|
-
};
|
|
136
120
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
137
121
|
const {
|
|
138
122
|
flush = "pre",
|
|
@@ -169,7 +153,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
169
153
|
if (Array.isArray(data.value))
|
|
170
154
|
await idbKeyval.update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
171
155
|
else if (typeof data.value === "object")
|
|
172
|
-
await idbKeyval.update(key, () =>
|
|
156
|
+
await idbKeyval.update(key, () => ({ ...data.value }));
|
|
173
157
|
else
|
|
174
158
|
await idbKeyval.update(key, () => data.value);
|
|
175
159
|
}
|
|
@@ -177,10 +161,23 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
177
161
|
onError(e);
|
|
178
162
|
}
|
|
179
163
|
}
|
|
180
|
-
|
|
181
|
-
|
|
164
|
+
const {
|
|
165
|
+
pause: pauseWatch,
|
|
166
|
+
resume: resumeWatch
|
|
167
|
+
} = core.watchPausable(data, () => write(), { flush, deep });
|
|
168
|
+
async function setData(value) {
|
|
169
|
+
pauseWatch();
|
|
170
|
+
data.value = value;
|
|
171
|
+
await write();
|
|
172
|
+
resumeWatch();
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
set: setData,
|
|
176
|
+
isFinished,
|
|
177
|
+
data
|
|
178
|
+
};
|
|
182
179
|
}
|
|
183
180
|
|
|
184
181
|
exports.useIDBKeyval = useIDBKeyval;
|
|
185
182
|
|
|
186
|
-
})(this.VueUse = this.VueUse || {}, VueUse, VueDemi, idbKeyval);
|
|
183
|
+
})(this.VueUse = this.VueUse || {}, VueUse, VueUse, VueDemi, idbKeyval);
|
package/useIDBKeyval.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VueDemi=function(n,
|
|
1
|
+
var VueDemi=function(n,e,d){if(n.install)return n;if(!e)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),n;if(e.version.slice(0,4)==="2.7."){let s=function(t,f){var i,v={},p={config:e.config,use:e.use.bind(e),mixin:e.mixin.bind(e),component:e.component.bind(e),provide:function(l,c){return v[l]=c,this},directive:function(l,c){return c?(e.directive(l,c),p):e.directive(l)},mount:function(l,c){return i||(i=new e(Object.assign({propsData:f},t,{provide:Object.assign(v,t.provide)})),i.$mount(l,c),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return p};var u=s;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.hasInjectionContext=()=>!!n.getCurrentInstance(),n.createApp=s}else if(e.version.slice(0,2)==="2.")if(d){for(var r in d)n[r]=d[r];n.isVue2=!0,n.isVue3=!1,n.install=function(){},n.Vue=e,n.Vue2=e,n.version=e.version,n.hasInjectionContext=()=>!!n.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if(e.version.slice(0,2)==="3."){for(var 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(s,t,f){return Array.isArray(s)?(s.length=Math.max(s.length,t),s.splice(t,1,f),f):(s[t]=f,f)},n.del=function(s,t){if(Array.isArray(s)){s.splice(t,1);return}delete s[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,d,r,u){"use strict";function s(t,f,i={}){const{flush:v="pre",deep:p=!0,shallow:l=!1,onError:c=a=>{console.error(a)},writeDefaults:I=!0}=i,w=r.ref(!1),o=(l?r.shallowRef:r.ref)(f),h=e.toValue(f);async function y(){try{const a=await u.get(t);a===void 0?h!=null&&I&&await u.set(t,h):o.value=a}catch(a){c(a)}w.value=!0}y();async function A(){try{o.value==null?await u.del(t):Array.isArray(o.value)?await u.update(t,()=>JSON.parse(JSON.stringify(o.value))):typeof o.value=="object"?await u.update(t,()=>({...o.value})):await u.update(t,()=>o.value)}catch(a){c(a)}}const{pause:b,resume:j}=d.watchPausable(o,()=>A(),{flush:v,deep:p});async function x(a){b(),o.value=a,await A(),j()}return{set:x,isFinished:w,data:o}}n.useIDBKeyval=s})(this.VueUse=this.VueUse||{},VueUse,VueUse,VueDemi,idbKeyval);
|
package/useIDBKeyval.mjs
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { toValue } from '@vueuse/shared';
|
|
2
|
-
import {
|
|
2
|
+
import { watchPausable } from '@vueuse/core';
|
|
3
|
+
import { ref, shallowRef } from 'vue-demi';
|
|
3
4
|
import { get, set, del, update } from 'idb-keyval';
|
|
4
5
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
6
|
function useIDBKeyval(key, initialValue, options = {}) {
|
|
22
7
|
const {
|
|
23
8
|
flush = "pre",
|
|
@@ -54,7 +39,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
54
39
|
if (Array.isArray(data.value))
|
|
55
40
|
await update(key, () => JSON.parse(JSON.stringify(data.value)));
|
|
56
41
|
else if (typeof data.value === "object")
|
|
57
|
-
await update(key, () =>
|
|
42
|
+
await update(key, () => ({ ...data.value }));
|
|
58
43
|
else
|
|
59
44
|
await update(key, () => data.value);
|
|
60
45
|
}
|
|
@@ -62,8 +47,21 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
62
47
|
onError(e);
|
|
63
48
|
}
|
|
64
49
|
}
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
const {
|
|
51
|
+
pause: pauseWatch,
|
|
52
|
+
resume: resumeWatch
|
|
53
|
+
} = watchPausable(data, () => write(), { flush, deep });
|
|
54
|
+
async function setData(value) {
|
|
55
|
+
pauseWatch();
|
|
56
|
+
data.value = value;
|
|
57
|
+
await write();
|
|
58
|
+
resumeWatch();
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
set: setData,
|
|
62
|
+
isFinished,
|
|
63
|
+
data
|
|
64
|
+
};
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
export { useIDBKeyval };
|
package/useJwt.d.cts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
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
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|
package/useJwt.d.mts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
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
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|
package/useJwt.d.ts
CHANGED
|
@@ -26,4 +26,4 @@ interface UseJwtReturn<Payload, Header, Fallback> {
|
|
|
26
26
|
*/
|
|
27
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
|
-
export { UseJwtOptions, UseJwtReturn, useJwt };
|
|
29
|
+
export { type UseJwtOptions, type UseJwtReturn, useJwt };
|