@vueuse/integrations 14.0.0-alpha.3 → 14.0.0
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/dist/{index-CVYRMe4c.d.ts → index-BBxze4rb.d.ts} +1 -1
- package/dist/{index-D3uXOWrE.d.ts → index-BNQzWj9J.d.ts} +3 -3
- package/dist/{index-CM7xq5Oz.d.ts → index-BgoBW25H.d.ts} +1 -1
- package/dist/{index-CALxGyfU.d.ts → index-BzCjewPQ.d.ts} +4 -4
- package/dist/{index-CoyW3s9X.d.ts → index-C0C_B0mW.d.ts} +1 -1
- package/dist/{index-BnBEyclv.d.ts → index-C1eGK6nC.d.ts} +3 -3
- package/dist/{index-D_Amzds0.d.ts → index-CDFJRy7j.d.ts} +1 -1
- package/dist/{index-BUhmH0MN.d.ts → index-CJw_eFkJ.d.ts} +1 -1
- package/dist/{index-CjlS21lW.d.ts → index-CxO-Pb3x.d.ts} +1 -1
- package/dist/{index-CHM2uNF6.d.ts → index-DfI2VwxT.d.ts} +1 -1
- package/dist/{index-CiXzNxys.d.ts → index-ch2MM_8w.d.ts} +1 -1
- package/dist/{index-iORVJpmd.d.ts → index-is9DY6jN.d.ts} +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.iife.js +665 -673
- package/dist/index.iife.min.js +1 -1
- package/dist/index.js +12 -12
- package/dist/useAsyncValidator/component.d.ts +4 -4
- package/dist/useAsyncValidator/component.js +1 -1
- package/dist/{useAsyncValidator-CdpFGG0_.js → useAsyncValidator-pcZPyeq7.js} +1 -1
- package/dist/useAsyncValidator.d.ts +1 -1
- package/dist/useAsyncValidator.iife.js +81 -81
- package/dist/useAsyncValidator.iife.min.js +1 -1
- package/dist/useAsyncValidator.js +1 -1
- package/dist/{useAxios-CgpWHvXy.js → useAxios-D34f-L7j.js} +1 -1
- package/dist/useAxios.d.ts +1 -1
- package/dist/useAxios.iife.js +132 -132
- package/dist/useAxios.iife.min.js +1 -1
- package/dist/useAxios.js +1 -1
- package/dist/{useChangeCase-D_SfshE-.js → useChangeCase-CdpkIhHH.js} +1 -1
- package/dist/useChangeCase.d.ts +1 -1
- package/dist/useChangeCase.iife.js +48 -48
- package/dist/useChangeCase.iife.min.js +1 -1
- package/dist/useChangeCase.js +1 -1
- package/dist/{useCookies-DV8rtu7w.js → useCookies-Bv215dgK.js} +1 -1
- package/dist/useCookies.d.ts +1 -1
- package/dist/useCookies.iife.js +86 -86
- package/dist/useCookies.iife.min.js +1 -1
- package/dist/useCookies.js +1 -1
- package/dist/{useDrauu-DIlnBHXG.js → useDrauu-DgG1pWis.js} +1 -1
- package/dist/useDrauu.d.ts +1 -1
- package/dist/useDrauu.iife.js +129 -129
- package/dist/useDrauu.iife.min.js +1 -1
- package/dist/useDrauu.js +1 -1
- package/dist/useFocusTrap/component.d.ts +4 -4
- package/dist/useFocusTrap/component.js +1 -1
- package/dist/{useFocusTrap-Cdh2yRDg.js → useFocusTrap-lXZ_YG-8.js} +4 -6
- package/dist/useFocusTrap.d.ts +1 -1
- package/dist/useFocusTrap.iife.js +79 -81
- package/dist/useFocusTrap.iife.min.js +1 -1
- package/dist/useFocusTrap.js +1 -1
- package/dist/{useFuse-DVX4q4hC.js → useFuse-CWPfSDMU.js} +10 -11
- package/dist/useFuse.d.ts +1 -1
- package/dist/useFuse.iife.js +48 -49
- package/dist/useFuse.iife.min.js +1 -1
- package/dist/useFuse.js +1 -1
- package/dist/{useIDBKeyval-DpSVAiRp.js → useIDBKeyval-D_wVPeQ7.js} +2 -5
- package/dist/useIDBKeyval.d.ts +1 -1
- package/dist/useIDBKeyval.iife.js +71 -74
- package/dist/useIDBKeyval.iife.min.js +1 -1
- package/dist/useIDBKeyval.js +1 -1
- package/dist/{useJwt-Dw35Xg9b.js → useJwt-BB8OIN1z.js} +3 -5
- package/dist/useJwt.d.ts +1 -1
- package/dist/useJwt.iife.js +39 -41
- package/dist/useJwt.iife.min.js +1 -1
- package/dist/useJwt.js +1 -1
- package/dist/{useNProgress-D_tDuA-y.js → useNProgress-ClU-n87O.js} +1 -1
- package/dist/useNProgress.d.ts +1 -1
- package/dist/useNProgress.iife.js +51 -51
- package/dist/useNProgress.iife.min.js +1 -1
- package/dist/useNProgress.js +1 -1
- package/dist/{useQRCode--Eb_FnI8.js → useQRCode-DtYpMi-Z.js} +1 -1
- package/dist/useQRCode.d.ts +1 -1
- package/dist/useQRCode.iife.js +34 -34
- package/dist/useQRCode.iife.min.js +1 -1
- package/dist/useQRCode.js +1 -1
- package/dist/useSortable/component.d.ts +4 -4
- package/dist/useSortable/component.js +1 -1
- package/dist/{useSortable-7LV1E1RD.js → useSortable-jtnNPDb0.js} +1 -1
- package/dist/useSortable.d.ts +1 -1
- package/dist/useSortable.iife.js +87 -87
- package/dist/useSortable.iife.min.js +1 -1
- package/dist/useSortable.js +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { n as UseFocusTrapReturn, t as UseFocusTrapOptions } from "../index-CJw_eFkJ.js";
|
|
2
|
+
import * as vue3 from "vue";
|
|
3
3
|
import { Reactive, SlotsType } from "vue";
|
|
4
4
|
import { RenderableComponent } from "@vueuse/core";
|
|
5
5
|
|
|
@@ -14,8 +14,8 @@ interface ComponentUseFocusTrapOptions extends UseFocusTrapProps {}
|
|
|
14
14
|
interface UseFocusTrapSlots {
|
|
15
15
|
default: (data: Reactive<UseFocusTrapReturn>) => any;
|
|
16
16
|
}
|
|
17
|
-
declare const UseFocusTrap:
|
|
17
|
+
declare const UseFocusTrap: vue3.DefineSetupFnComponent<UseFocusTrapProps, Record<string, never>, SlotsType<UseFocusTrapSlots>, UseFocusTrapProps & {
|
|
18
18
|
[x: `on${Capitalize<string>}`]: ((...args: unknown[]) => any) | undefined;
|
|
19
|
-
},
|
|
19
|
+
}, vue3.PublicProps>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { ComponentUseFocusTrapOptions, UseFocusTrap, UseFocusTrapProps };
|
|
@@ -28,14 +28,12 @@ function useFocusTrap(target, options = {}) {
|
|
|
28
28
|
isPaused.value = false;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return toArray(_targets).map((el) => {
|
|
31
|
+
watch(computed(() => {
|
|
32
|
+
return toArray(toValue(target)).map((el) => {
|
|
34
33
|
const _el = toValue(el);
|
|
35
34
|
return typeof _el === "string" ? _el : unrefElement(_el);
|
|
36
35
|
}).filter(notNullish);
|
|
37
|
-
})
|
|
38
|
-
watch(targets, (els) => {
|
|
36
|
+
}), (els) => {
|
|
39
37
|
if (!els.length) return;
|
|
40
38
|
if (!trap) {
|
|
41
39
|
trap = createFocusTrap(els, {
|
|
@@ -68,4 +66,4 @@ function useFocusTrap(target, options = {}) {
|
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
//#endregion
|
|
71
|
-
export { useFocusTrap };
|
|
69
|
+
export { useFocusTrap as t };
|
package/dist/useFocusTrap.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as UseFocusTrapReturn, r as useFocusTrap, t as UseFocusTrapOptions } from "./index-CJw_eFkJ.js";
|
|
2
2
|
export { UseFocusTrapOptions, UseFocusTrapReturn, useFocusTrap };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
(function(exports, __vueuse_core, __vueuse_shared, focus_trap, vue) {
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) : target, mod));
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
__vueuse_core = __toESM(__vueuse_core);
|
|
@@ -30,67 +30,65 @@ vue = __toESM(vue);
|
|
|
30
30
|
|
|
31
31
|
//#region useFocusTrap/index.ts
|
|
32
32
|
/**
|
|
33
|
-
* Reactive focus-trap
|
|
34
|
-
*
|
|
35
|
-
* @see https://vueuse.org/useFocusTrap
|
|
36
|
-
*/
|
|
37
|
-
function useFocusTrap(target, options = {}) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
}
|
|
33
|
+
* Reactive focus-trap
|
|
34
|
+
*
|
|
35
|
+
* @see https://vueuse.org/useFocusTrap
|
|
36
|
+
*/
|
|
37
|
+
function useFocusTrap(target, options = {}) {
|
|
38
|
+
let trap;
|
|
39
|
+
const { immediate,...focusTrapOptions } = options;
|
|
40
|
+
const hasFocus = (0, vue.shallowRef)(false);
|
|
41
|
+
const isPaused = (0, vue.shallowRef)(false);
|
|
42
|
+
const activate = (opts) => trap && trap.activate(opts);
|
|
43
|
+
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
44
|
+
const pause = () => {
|
|
45
|
+
if (trap) {
|
|
46
|
+
trap.pause();
|
|
47
|
+
isPaused.value = true;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const unpause = () => {
|
|
51
|
+
if (trap) {
|
|
52
|
+
trap.unpause();
|
|
53
|
+
isPaused.value = false;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
(0, vue.watch)((0, vue.computed)(() => {
|
|
57
|
+
return (0, __vueuse_core.toArray)((0, vue.toValue)(target)).map((el) => {
|
|
58
|
+
const _el = (0, vue.toValue)(el);
|
|
59
|
+
return typeof _el === "string" ? _el : (0, __vueuse_core.unrefElement)(_el);
|
|
60
|
+
}).filter(__vueuse_shared.notNullish);
|
|
61
|
+
}), (els) => {
|
|
62
|
+
if (!els.length) return;
|
|
63
|
+
if (!trap) {
|
|
64
|
+
trap = (0, focus_trap.createFocusTrap)(els, {
|
|
65
|
+
...focusTrapOptions,
|
|
66
|
+
onActivate() {
|
|
67
|
+
hasFocus.value = true;
|
|
68
|
+
if (options.onActivate) options.onActivate();
|
|
69
|
+
},
|
|
70
|
+
onDeactivate() {
|
|
71
|
+
hasFocus.value = false;
|
|
72
|
+
if (options.onDeactivate) options.onDeactivate();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
if (immediate) activate();
|
|
76
|
+
} else {
|
|
77
|
+
const isActive = trap === null || trap === void 0 ? void 0 : trap.active;
|
|
78
|
+
trap === null || trap === void 0 || trap.updateContainerElements(els);
|
|
79
|
+
if (!isActive && immediate) activate();
|
|
80
|
+
}
|
|
81
|
+
}, { flush: "post" });
|
|
82
|
+
(0, __vueuse_core.tryOnScopeDispose)(() => deactivate());
|
|
83
|
+
return {
|
|
84
|
+
hasFocus,
|
|
85
|
+
isPaused,
|
|
86
|
+
activate,
|
|
87
|
+
deactivate,
|
|
88
|
+
pause,
|
|
89
|
+
unpause
|
|
90
|
+
};
|
|
91
|
+
}
|
|
94
92
|
|
|
95
93
|
//#endregion
|
|
96
94
|
exports.useFocusTrap = useFocusTrap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t,n,r,i){var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:a(l(e)),d(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e));t=f(t),n=f(n),r=f(r),i=f(i);function p(e,a={}){let o,{immediate:s,...c}=a,l=(0,i.shallowRef)(!1),u=(0,i.shallowRef)(!1),d=e=>o&&o.activate(e),f=e=>o&&o.deactivate(e);return(0,i.watch)((0,i.computed)(()=>(0,t.toArray)((0,i.toValue)(e)).map(e=>{let n=(0,i.toValue)(e);return typeof n==`string`?n:(0,t.unrefElement)(n)}).filter(n.notNullish)),e=>{if(e.length)if(!o)o=(0,r.createFocusTrap)(e,{...c,onActivate(){l.value=!0,a.onActivate&&a.onActivate()},onDeactivate(){l.value=!1,a.onDeactivate&&a.onDeactivate()}}),s&&d();else{let t=o==null?void 0:o.active;o==null||o.updateContainerElements(e),!t&&s&&d()}},{flush:`post`}),(0,t.tryOnScopeDispose)(()=>f()),{hasFocus:l,isPaused:u,activate:d,deactivate:f,pause:()=>{o&&(o.pause(),u.value=!0)},unpause:()=>{o&&(o.unpause(),u.value=!1)}}}e.useFocusTrap=p})(this.VueUse=this.VueUse||{},VueUse,VueUse,focusTrap,Vue);
|
package/dist/useFocusTrap.js
CHANGED
|
@@ -17,20 +17,19 @@ function useFuse(search, data, options) {
|
|
|
17
17
|
watch(() => toValue(data), (newData) => {
|
|
18
18
|
fuse.value.setCollection(newData);
|
|
19
19
|
}, { deep: true });
|
|
20
|
-
const results = computed(() => {
|
|
21
|
-
const resolved = toValue(options);
|
|
22
|
-
if ((resolved === null || resolved === void 0 ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search)) return toValue(data).map((item, index) => ({
|
|
23
|
-
item,
|
|
24
|
-
refIndex: index
|
|
25
|
-
}));
|
|
26
|
-
const limit = resolved === null || resolved === void 0 ? void 0 : resolved.resultLimit;
|
|
27
|
-
return fuse.value.search(toValue(search), limit ? { limit } : void 0);
|
|
28
|
-
});
|
|
29
20
|
return {
|
|
30
21
|
fuse,
|
|
31
|
-
results
|
|
22
|
+
results: computed(() => {
|
|
23
|
+
const resolved = toValue(options);
|
|
24
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.matchAllWhenSearchEmpty) && !toValue(search)) return toValue(data).map((item, index) => ({
|
|
25
|
+
item,
|
|
26
|
+
refIndex: index
|
|
27
|
+
}));
|
|
28
|
+
const limit = resolved === null || resolved === void 0 ? void 0 : resolved.resultLimit;
|
|
29
|
+
return fuse.value.search(toValue(search), limit ? { limit } : void 0);
|
|
30
|
+
})
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
//#endregion
|
|
36
|
-
export { useFuse };
|
|
35
|
+
export { useFuse as t };
|
package/dist/useFuse.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as useFuse, n as UseFuseOptions, r as UseFuseReturn, t as FuseOptions } from "./index-BNQzWj9J.js";
|
|
2
2
|
export { FuseOptions, UseFuseOptions, UseFuseReturn, useFuse };
|
package/dist/useFuse.iife.js
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
1
|
(function(exports, fuse_js, vue) {
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) : target, mod));
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
fuse_js = __toESM(fuse_js);
|
|
27
27
|
vue = __toESM(vue);
|
|
28
28
|
|
|
29
29
|
//#region useFuse/index.ts
|
|
30
|
-
function useFuse(search, data, options) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
}
|
|
30
|
+
function useFuse(search, data, options) {
|
|
31
|
+
const createFuse = () => {
|
|
32
|
+
var _toValue, _toValue2;
|
|
33
|
+
return new fuse_js.default((_toValue = (0, vue.toValue)(data)) !== null && _toValue !== void 0 ? _toValue : [], (_toValue2 = (0, vue.toValue)(options)) === null || _toValue2 === void 0 ? void 0 : _toValue2.fuseOptions);
|
|
34
|
+
};
|
|
35
|
+
const fuse = (0, vue.ref)(createFuse());
|
|
36
|
+
(0, vue.watch)(() => {
|
|
37
|
+
var _toValue3;
|
|
38
|
+
return (_toValue3 = (0, vue.toValue)(options)) === null || _toValue3 === void 0 ? void 0 : _toValue3.fuseOptions;
|
|
39
|
+
}, () => {
|
|
40
|
+
fuse.value = createFuse();
|
|
41
|
+
}, { deep: true });
|
|
42
|
+
(0, vue.watch)(() => (0, vue.toValue)(data), (newData) => {
|
|
43
|
+
fuse.value.setCollection(newData);
|
|
44
|
+
}, { deep: true });
|
|
45
|
+
return {
|
|
46
|
+
fuse,
|
|
47
|
+
results: (0, vue.computed)(() => {
|
|
48
|
+
const resolved = (0, vue.toValue)(options);
|
|
49
|
+
if ((resolved === null || resolved === void 0 ? void 0 : resolved.matchAllWhenSearchEmpty) && !(0, vue.toValue)(search)) return (0, vue.toValue)(data).map((item, index) => ({
|
|
50
|
+
item,
|
|
51
|
+
refIndex: index
|
|
52
|
+
}));
|
|
53
|
+
const limit = resolved === null || resolved === void 0 ? void 0 : resolved.resultLimit;
|
|
54
|
+
return fuse.value.search((0, vue.toValue)(search), limit ? { limit } : void 0);
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
59
58
|
|
|
60
59
|
//#endregion
|
|
61
60
|
exports.useFuse = useFuse;
|
package/dist/useFuse.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t,n){var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},u=(e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e));t=u(t),n=u(n);function d(e,r,i){let a=()=>{var e,a;return new t.default((e=(0,n.toValue)(r))==null?[]:e,(a=(0,n.toValue)(i))==null?void 0:a.fuseOptions)},o=(0,n.ref)(a());return(0,n.watch)(()=>{var e;return(e=(0,n.toValue)(i))==null?void 0:e.fuseOptions},()=>{o.value=a()},{deep:!0}),(0,n.watch)(()=>(0,n.toValue)(r),e=>{o.value.setCollection(e)},{deep:!0}),{fuse:o,results:(0,n.computed)(()=>{let t=(0,n.toValue)(i);if(t!=null&&t.matchAllWhenSearchEmpty&&!(0,n.toValue)(e))return(0,n.toValue)(r).map((e,t)=>({item:e,refIndex:t}));let a=t==null?void 0:t.resultLimit;return o.value.search((0,n.toValue)(e),a?{limit:a}:void 0)})}}e.useFuse=d})(this.VueUse=this.VueUse||{},Fuse,Vue);
|
package/dist/useFuse.js
CHANGED
|
@@ -23,10 +23,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
23
23
|
try {
|
|
24
24
|
const rawValue = await get(key);
|
|
25
25
|
if (rawValue === void 0) {
|
|
26
|
-
if (rawInit !== void 0 && rawInit !== null && writeDefaults)
|
|
27
|
-
const initValue = serializer.write(rawInit);
|
|
28
|
-
await set(key, initValue);
|
|
29
|
-
}
|
|
26
|
+
if (rawInit !== void 0 && rawInit !== null && writeDefaults) await set(key, serializer.write(rawInit));
|
|
30
27
|
} else data.value = serializer.read(rawValue);
|
|
31
28
|
} catch (e) {
|
|
32
29
|
onError(e);
|
|
@@ -64,4 +61,4 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
//#endregion
|
|
67
|
-
export { useIDBKeyval };
|
|
64
|
+
export { useIDBKeyval as t };
|
package/dist/useIDBKeyval.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as UseIDBOptions, r as useIDBKeyval, t as UseIDBKeyvalReturn } from "./index-DfI2VwxT.js";
|
|
2
2
|
export { UseIDBKeyvalReturn, UseIDBOptions, useIDBKeyval };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
(function(exports, __vueuse_core, idb_keyval, vue) {
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}) : target, mod));
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
26
|
__vueuse_core = __toESM(__vueuse_core);
|
|
@@ -29,64 +29,61 @@ vue = __toESM(vue);
|
|
|
29
29
|
|
|
30
30
|
//#region useIDBKeyval/index.ts
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param key
|
|
34
|
-
* @param initialValue
|
|
35
|
-
* @param options
|
|
36
|
-
*/
|
|
37
|
-
function useIDBKeyval(key, initialValue, options = {}) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
onError(e);
|
|
32
|
+
*
|
|
33
|
+
* @param key
|
|
34
|
+
* @param initialValue
|
|
35
|
+
* @param options
|
|
36
|
+
*/
|
|
37
|
+
function useIDBKeyval(key, initialValue, options = {}) {
|
|
38
|
+
const { flush = "pre", deep = true, shallow = false, onError = (e) => {
|
|
39
|
+
console.error(e);
|
|
40
|
+
}, writeDefaults = true, serializer = {
|
|
41
|
+
read: (raw) => raw,
|
|
42
|
+
write: (value) => value
|
|
43
|
+
} } = options;
|
|
44
|
+
const isFinished = (0, vue.shallowRef)(false);
|
|
45
|
+
const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
|
|
46
|
+
const rawInit = (0, vue.toValue)(initialValue);
|
|
47
|
+
async function read() {
|
|
48
|
+
try {
|
|
49
|
+
const rawValue = await (0, idb_keyval.get)(key);
|
|
50
|
+
if (rawValue === void 0) {
|
|
51
|
+
if (rawInit !== void 0 && rawInit !== null && writeDefaults) await (0, idb_keyval.set)(key, serializer.write(rawInit));
|
|
52
|
+
} else data.value = serializer.read(rawValue);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
onError(e);
|
|
55
|
+
}
|
|
56
|
+
isFinished.value = true;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
read();
|
|
59
|
+
async function write() {
|
|
60
|
+
try {
|
|
61
|
+
if (data.value == null) await (0, idb_keyval.del)(key);
|
|
62
|
+
else {
|
|
63
|
+
const rawValue = (0, vue.toRaw)(data.value);
|
|
64
|
+
const serializedValue = serializer.write(rawValue);
|
|
65
|
+
await (0, idb_keyval.update)(key, () => serializedValue);
|
|
66
|
+
}
|
|
67
|
+
} catch (e) {
|
|
68
|
+
onError(e);
|
|
69
69
|
}
|
|
70
|
-
} catch (e) {
|
|
71
|
-
onError(e);
|
|
72
70
|
}
|
|
71
|
+
const { pause: pauseWatch, resume: resumeWatch } = (0, __vueuse_core.watchPausable)(data, () => write(), {
|
|
72
|
+
flush,
|
|
73
|
+
deep
|
|
74
|
+
});
|
|
75
|
+
async function setData(value) {
|
|
76
|
+
pauseWatch();
|
|
77
|
+
data.value = value;
|
|
78
|
+
await write();
|
|
79
|
+
resumeWatch();
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
set: setData,
|
|
83
|
+
isFinished,
|
|
84
|
+
data
|
|
85
|
+
};
|
|
73
86
|
}
|
|
74
|
-
const { pause: pauseWatch, resume: resumeWatch } = (0, __vueuse_core.watchPausable)(data, () => write(), {
|
|
75
|
-
flush,
|
|
76
|
-
deep
|
|
77
|
-
});
|
|
78
|
-
async function setData(value) {
|
|
79
|
-
pauseWatch();
|
|
80
|
-
data.value = value;
|
|
81
|
-
await write();
|
|
82
|
-
resumeWatch();
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
set: setData,
|
|
86
|
-
isFinished,
|
|
87
|
-
data
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
87
|
|
|
91
88
|
//#endregion
|
|
92
89
|
exports.useIDBKeyval = useIDBKeyval;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t,n,r){var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e));t=d(t),n=d(n),r=d(r);function f(e,i,a={}){let{flush:o=`pre`,deep:s=!0,shallow:c=!1,onError:l=e=>{console.error(e)},writeDefaults:u=!0,serializer:d={read:e=>e,write:e=>e}}=a,f=(0,r.shallowRef)(!1),p=(c?r.shallowRef:r.ref)(i),m=(0,r.toValue)(i);async function h(){try{let t=await(0,n.get)(e);t===void 0?m!=null&&u&&await(0,n.set)(e,d.write(m)):p.value=d.read(t)}catch(e){l(e)}f.value=!0}h();async function g(){try{if(p.value==null)await(0,n.del)(e);else{let t=(0,r.toRaw)(p.value),i=d.write(t);await(0,n.update)(e,()=>i)}}catch(e){l(e)}}let{pause:_,resume:v}=(0,t.watchPausable)(p,()=>g(),{flush:o,deep:s});async function y(e){_(),p.value=e,await g(),v()}return{set:y,isFinished:f,data:p}}e.useIDBKeyval=f})(this.VueUse=this.VueUse||{},VueUse,idbKeyval,Vue);
|
package/dist/useIDBKeyval.js
CHANGED
|
@@ -17,13 +17,11 @@ function useJwt(encodedJwt, options = {}) {
|
|
|
17
17
|
return fallbackValue;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const header = computed(() => decodeWithFallback(toValue(encodedJwt), { header: true }));
|
|
21
|
-
const payload = computed(() => decodeWithFallback(toValue(encodedJwt)));
|
|
22
20
|
return {
|
|
23
|
-
header,
|
|
24
|
-
payload
|
|
21
|
+
header: computed(() => decodeWithFallback(toValue(encodedJwt), { header: true })),
|
|
22
|
+
payload: computed(() => decodeWithFallback(toValue(encodedJwt)))
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
//#endregion
|
|
29
|
-
export { useJwt };
|
|
27
|
+
export { useJwt as t };
|
package/dist/useJwt.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as UseJwtReturn, r as useJwt, t as UseJwtOptions } from "./index-is9DY6jN.js";
|
|
2
2
|
export { UseJwtOptions, UseJwtReturn, useJwt };
|