@vueuse/integrations 12.6.1 → 12.8.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/index.cjs +14 -14
- package/index.d.cts +17 -17
- package/index.d.mts +17 -17
- package/index.d.ts +17 -17
- package/index.iife.js +14 -14
- package/index.iife.min.js +1 -1
- package/index.mjs +15 -15
- package/package.json +5 -5
- package/useAsyncValidator/component.cjs +3 -3
- package/useAsyncValidator/component.mjs +4 -4
- package/useAsyncValidator.cjs +2 -2
- package/useAsyncValidator.d.cts +6 -7
- package/useAsyncValidator.d.mts +6 -7
- package/useAsyncValidator.d.ts +6 -7
- package/useAsyncValidator.iife.js +2 -2
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +3 -3
- package/useAxios.cjs +3 -3
- package/useAxios.iife.js +3 -3
- package/useAxios.iife.min.js +1 -1
- package/useAxios.mjs +3 -3
- package/useChangeCase.d.cts +1 -2
- package/useChangeCase.d.mts +1 -2
- package/useChangeCase.d.ts +1 -2
- package/useCookies.cjs +1 -1
- package/useCookies.iife.js +1 -1
- package/useCookies.iife.min.js +1 -1
- package/useCookies.mjs +2 -2
- package/useDrauu.cjs +4 -4
- package/useDrauu.d.cts +3 -3
- package/useDrauu.d.mts +3 -3
- package/useDrauu.d.ts +3 -3
- package/useDrauu.iife.js +4 -4
- package/useDrauu.iife.min.js +1 -1
- package/useDrauu.mjs +5 -5
- package/useFocusTrap/component.cjs +1 -1
- package/useFocusTrap/component.mjs +1 -1
- package/useFocusTrap.cjs +2 -2
- package/useFocusTrap.d.cts +3 -4
- package/useFocusTrap.d.mts +3 -4
- package/useFocusTrap.d.ts +3 -4
- package/useFocusTrap.iife.js +2 -2
- package/useFocusTrap.iife.min.js +1 -1
- package/useFocusTrap.mjs +3 -3
- package/useFuse.d.cts +1 -2
- package/useFuse.d.mts +1 -2
- package/useFuse.d.ts +1 -2
- package/useIDBKeyval.cjs +1 -1
- package/useIDBKeyval.d.cts +3 -3
- package/useIDBKeyval.d.mts +3 -3
- package/useIDBKeyval.d.ts +3 -3
- package/useIDBKeyval.iife.js +1 -1
- package/useIDBKeyval.iife.min.js +1 -1
- package/useIDBKeyval.mjs +2 -2
- package/useJwt.d.cts +1 -2
- package/useJwt.d.mts +1 -2
- package/useJwt.d.ts +1 -2
- package/useNProgress.d.cts +1 -1
- package/useNProgress.d.mts +1 -1
- package/useNProgress.d.ts +1 -1
- package/useQRCode.cjs +1 -1
- package/useQRCode.d.cts +2 -2
- package/useQRCode.d.mts +2 -2
- package/useQRCode.d.ts +2 -2
- package/useQRCode.iife.js +1 -1
- package/useQRCode.iife.min.js +1 -1
- package/useQRCode.mjs +2 -2
- package/useSortable/component.cjs +1 -1
- package/useSortable/component.mjs +1 -1
- package/useSortable.d.cts +2 -1
- package/useSortable.d.mts +2 -1
- package/useSortable.d.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowRef,
|
|
1
|
+
import { shallowRef, computed, toValue, watch, defineComponent, reactive } from 'vue';
|
|
2
2
|
import { toRef, until } from '@vueuse/shared';
|
|
3
3
|
import Schema from 'async-validator';
|
|
4
4
|
|
|
@@ -11,8 +11,8 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
11
11
|
} = options;
|
|
12
12
|
const valueRef = toRef(value);
|
|
13
13
|
const errorInfo = shallowRef(null);
|
|
14
|
-
const isFinished =
|
|
15
|
-
const pass =
|
|
14
|
+
const isFinished = shallowRef(true);
|
|
15
|
+
const pass = shallowRef(!immediate || manual);
|
|
16
16
|
const errors = computed(() => errorInfo.value?.errors || []);
|
|
17
17
|
const errorFields = computed(() => errorInfo.value?.fields || {});
|
|
18
18
|
const validator = computed(() => new AsyncValidatorSchema(toValue(rules)));
|
|
@@ -63,7 +63,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const UseAsyncValidator = /* @__PURE__ */
|
|
66
|
+
const UseAsyncValidator = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
67
67
|
name: "UseAsyncValidator",
|
|
68
68
|
props: {
|
|
69
69
|
form: {
|
package/useAsyncValidator.cjs
CHANGED
|
@@ -13,8 +13,8 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
13
13
|
} = options;
|
|
14
14
|
const valueRef = shared.toRef(value);
|
|
15
15
|
const errorInfo = vue.shallowRef(null);
|
|
16
|
-
const isFinished = vue.
|
|
17
|
-
const pass = vue.
|
|
16
|
+
const isFinished = vue.shallowRef(true);
|
|
17
|
+
const pass = vue.shallowRef(!immediate || manual);
|
|
18
18
|
const errors = vue.computed(() => {
|
|
19
19
|
var _a;
|
|
20
20
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
package/useAsyncValidator.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
|
-
import {
|
|
2
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
4
3
|
|
|
5
4
|
type AsyncValidatorError = Error & {
|
|
6
5
|
errors: ValidateError[];
|
|
@@ -13,11 +12,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
13
12
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
14
13
|
}
|
|
15
14
|
interface UseAsyncValidatorReturn {
|
|
16
|
-
pass:
|
|
17
|
-
isFinished:
|
|
18
|
-
errors:
|
|
19
|
-
errorInfo:
|
|
20
|
-
errorFields:
|
|
15
|
+
pass: ShallowRef<boolean>;
|
|
16
|
+
isFinished: ShallowRef<boolean>;
|
|
17
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
18
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
19
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
21
20
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
22
21
|
}
|
|
23
22
|
interface UseAsyncValidatorOptions {
|
package/useAsyncValidator.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
|
-
import {
|
|
2
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
4
3
|
|
|
5
4
|
type AsyncValidatorError = Error & {
|
|
6
5
|
errors: ValidateError[];
|
|
@@ -13,11 +12,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
13
12
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
14
13
|
}
|
|
15
14
|
interface UseAsyncValidatorReturn {
|
|
16
|
-
pass:
|
|
17
|
-
isFinished:
|
|
18
|
-
errors:
|
|
19
|
-
errorInfo:
|
|
20
|
-
errorFields:
|
|
15
|
+
pass: ShallowRef<boolean>;
|
|
16
|
+
isFinished: ShallowRef<boolean>;
|
|
17
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
18
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
19
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
21
20
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
22
21
|
}
|
|
23
22
|
interface UseAsyncValidatorOptions {
|
package/useAsyncValidator.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
|
-
import {
|
|
2
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
4
3
|
|
|
5
4
|
type AsyncValidatorError = Error & {
|
|
6
5
|
errors: ValidateError[];
|
|
@@ -13,11 +12,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
13
12
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
14
13
|
}
|
|
15
14
|
interface UseAsyncValidatorReturn {
|
|
16
|
-
pass:
|
|
17
|
-
isFinished:
|
|
18
|
-
errors:
|
|
19
|
-
errorInfo:
|
|
20
|
-
errorFields:
|
|
15
|
+
pass: ShallowRef<boolean>;
|
|
16
|
+
isFinished: ShallowRef<boolean>;
|
|
17
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
18
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
19
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
21
20
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
22
21
|
}
|
|
23
22
|
interface UseAsyncValidatorOptions {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
} = options;
|
|
11
11
|
const valueRef = shared.toRef(value);
|
|
12
12
|
const errorInfo = vue.shallowRef(null);
|
|
13
|
-
const isFinished = vue.
|
|
14
|
-
const pass = vue.
|
|
13
|
+
const isFinished = vue.shallowRef(true);
|
|
14
|
+
const pass = vue.shallowRef(!immediate || manual);
|
|
15
15
|
const errors = vue.computed(() => {
|
|
16
16
|
var _a;
|
|
17
17
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(w,s,u,t){"use strict";const m=u.default||u;function p(y,R,A={}){const{validateOption:F={},immediate:o=!0,manual:i=!1}=A,c=s.toRef(y),a=t.shallowRef(null),l=t.shallowRef(!0),r=t.shallowRef(!o||i),d=t.computed(()=>{var e;return((e=a.value)==null?void 0:e.errors)||[]}),f=t.computed(()=>{var e;return((e=a.value)==null?void 0:e.fields)||{}}),v=t.computed(()=>new m(t.toValue(R))),h=async()=>{l.value=!1,r.value=!1;try{await v.value.validate(c.value,F),r.value=!0,a.value=null}catch(e){a.value=e}finally{l.value=!0}return{pass:r.value,errorInfo:a.value,errors:d.value,errorFields:f.value}};i||t.watch([c,v],()=>h(),{immediate:o,deep:!0});const V={isFinished:l,pass:r,errors:d,errorInfo:a,errorFields:f,execute:h};function U(){return new Promise((e,n)=>{s.until(l).toBe(!0).then(()=>e(V)).catch(I=>n(I))})}return{...V,then(e,n){return U().then(e,n)}}}w.useAsyncValidator=p})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue);
|
package/useAsyncValidator.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toRef, until } from '@vueuse/shared';
|
|
2
2
|
import Schema from 'async-validator';
|
|
3
|
-
import { shallowRef,
|
|
3
|
+
import { shallowRef, computed, toValue, watch } from 'vue';
|
|
4
4
|
|
|
5
5
|
const AsyncValidatorSchema = Schema.default || Schema;
|
|
6
6
|
function useAsyncValidator(value, rules, options = {}) {
|
|
@@ -11,8 +11,8 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
11
11
|
} = options;
|
|
12
12
|
const valueRef = toRef(value);
|
|
13
13
|
const errorInfo = shallowRef(null);
|
|
14
|
-
const isFinished =
|
|
15
|
-
const pass =
|
|
14
|
+
const isFinished = shallowRef(true);
|
|
15
|
+
const pass = shallowRef(!immediate || manual);
|
|
16
16
|
const errors = computed(() => {
|
|
17
17
|
var _a;
|
|
18
18
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
package/useAxios.cjs
CHANGED
|
@@ -39,9 +39,9 @@ function useAxios(...args) {
|
|
|
39
39
|
const initialData = options.initialData;
|
|
40
40
|
const response = vue.shallowRef();
|
|
41
41
|
const data = (shallow ? vue.shallowRef : vue.ref)(initialData);
|
|
42
|
-
const isFinished = vue.
|
|
43
|
-
const isLoading = vue.
|
|
44
|
-
const isAborted = vue.
|
|
42
|
+
const isFinished = vue.shallowRef(false);
|
|
43
|
+
const isLoading = vue.shallowRef(false);
|
|
44
|
+
const isAborted = vue.shallowRef(false);
|
|
45
45
|
const error = vue.shallowRef();
|
|
46
46
|
let abortController = new AbortController();
|
|
47
47
|
const abort = (message) => {
|
package/useAxios.iife.js
CHANGED
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
const initialData = options.initialData;
|
|
37
37
|
const response = vue.shallowRef();
|
|
38
38
|
const data = (shallow ? vue.shallowRef : vue.ref)(initialData);
|
|
39
|
-
const isFinished = vue.
|
|
40
|
-
const isLoading = vue.
|
|
41
|
-
const isAborted = vue.
|
|
39
|
+
const isFinished = vue.shallowRef(false);
|
|
40
|
+
const isLoading = vue.shallowRef(false);
|
|
41
|
+
const isAborted = vue.shallowRef(false);
|
|
42
42
|
const error = vue.shallowRef();
|
|
43
43
|
let abortController = new AbortController();
|
|
44
44
|
const abort = (message) => {
|
package/useAxios.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L,h,v,
|
|
1
|
+
(function(L,h,v,n){"use strict";function O(...t){const u=typeof t[0]=="string"?t[0]:void 0,o=typeof u=="string"?1:0,m={immediate:!!o,shallow:!0,abortPrevious:!0};let E={},d=v,s=m;const w=e=>!!e?.request;t.length>0+o&&(w(t[0+o])?d=t[0+o]:E=t[0+o]),t.length>1+o&&w(t[1+o])&&(d=t[1+o]),(t.length===2+o&&!w(t[1+o])||t.length===3+o)&&(s=t[t.length-1]||m);const{shallow:U,onSuccess:j=h.noop,onError:q=h.noop,immediate:B,resetOnExecute:N=!1}=s,x=s.initialData,y=n.shallowRef(),p=(U?n.shallowRef:n.ref)(x),i=n.shallowRef(!1),c=n.shallowRef(!1),r=n.shallowRef(!1),a=n.shallowRef();let b=new AbortController;const A=e=>{i.value||!c.value||(b.abort(e),b=new AbortController,r.value=!0,c.value=!1,i.value=!1)},V=e=>{c.value=e,i.value=!e},S=()=>{N&&(p.value=x)},D=()=>new Promise((e,f)=>{h.until(i).toBe(!0).then(()=>a.value?f(a.value):e(_))}),R={then:(...e)=>D().then(...e),catch:(...e)=>D().catch(...e)};let C=0;const P=(e=u,f={})=>{a.value=void 0;const F=typeof e=="string"?e:u??f.url;if(F===void 0)return a.value=new v.AxiosError(v.AxiosError.ERR_INVALID_URL),i.value=!0,R;S(),s.abortPrevious!==!1&&A(),V(!0),C+=1;const k=C;return r.value=!1,d(F,{...E,...typeof e=="object"?e:f,signal:b.signal}).then(l=>{if(r.value)return;y.value=l;const I=l.data;p.value=I,j(I)}).catch(l=>{a.value=l,q(l)}).finally(()=>{var l;(l=s.onFinish)==null||l.call(s),k===C&&V(!1)}),R};B&&u&&P();const _={response:y,data:p,error:a,isFinished:i,isLoading:c,cancel:A,isAborted:r,isCanceled:r,abort:A,execute:P};return{..._,...R}}L.useAxios=O})(this.VueUse=this.VueUse||{},VueUse,axios,Vue);
|
package/useAxios.mjs
CHANGED
|
@@ -37,9 +37,9 @@ function useAxios(...args) {
|
|
|
37
37
|
const initialData = options.initialData;
|
|
38
38
|
const response = shallowRef();
|
|
39
39
|
const data = (shallow ? shallowRef : ref)(initialData);
|
|
40
|
-
const isFinished =
|
|
41
|
-
const isLoading =
|
|
42
|
-
const isAborted =
|
|
40
|
+
const isFinished = shallowRef(false);
|
|
41
|
+
const isLoading = shallowRef(false);
|
|
42
|
+
const isAborted = shallowRef(false);
|
|
43
43
|
const error = shallowRef();
|
|
44
44
|
let abortController = new AbortController();
|
|
45
45
|
const abort = (message) => {
|
package/useChangeCase.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MaybeRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import * as changeCase from 'change-case';
|
|
3
2
|
import { Options } from 'change-case';
|
|
4
|
-
import { WritableComputedRef, ComputedRef } from 'vue';
|
|
3
|
+
import { MaybeRef, MaybeRefOrGetter, WritableComputedRef, ComputedRef } from 'vue';
|
|
5
4
|
|
|
6
5
|
type EndsWithCase<T> = T extends `${infer _}Case` ? T : never;
|
|
7
6
|
type FilterKeys<T> = {
|
package/useChangeCase.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MaybeRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import * as changeCase from 'change-case';
|
|
3
2
|
import { Options } from 'change-case';
|
|
4
|
-
import { WritableComputedRef, ComputedRef } from 'vue';
|
|
3
|
+
import { MaybeRef, MaybeRefOrGetter, WritableComputedRef, ComputedRef } from 'vue';
|
|
5
4
|
|
|
6
5
|
type EndsWithCase<T> = T extends `${infer _}Case` ? T : never;
|
|
7
6
|
type FilterKeys<T> = {
|
package/useChangeCase.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { MaybeRef, MaybeRefOrGetter } from '@vueuse/shared';
|
|
2
1
|
import * as changeCase from 'change-case';
|
|
3
2
|
import { Options } from 'change-case';
|
|
4
|
-
import { WritableComputedRef, ComputedRef } from 'vue';
|
|
3
|
+
import { MaybeRef, MaybeRefOrGetter, WritableComputedRef, ComputedRef } from 'vue';
|
|
5
4
|
|
|
6
5
|
type EndsWithCase<T> = T extends `${infer _}Case` ? T : never;
|
|
7
6
|
type FilterKeys<T> = {
|
package/useCookies.cjs
CHANGED
|
@@ -11,7 +11,7 @@ function createCookies(req) {
|
|
|
11
11
|
function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
|
|
12
12
|
const watchingDependencies = autoUpdateDependencies ? [...dependencies || []] : dependencies;
|
|
13
13
|
let previousCookies = cookies.getAll({ doNotParse: true });
|
|
14
|
-
const touches = vue.
|
|
14
|
+
const touches = vue.shallowRef(0);
|
|
15
15
|
const onChange = () => {
|
|
16
16
|
const newCookies = cookies.getAll({ doNotParse: true });
|
|
17
17
|
if (shouldUpdate(
|
package/useCookies.iife.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
|
|
9
9
|
const watchingDependencies = autoUpdateDependencies ? [...dependencies || []] : dependencies;
|
|
10
10
|
let previousCookies = cookies.getAll({ doNotParse: true });
|
|
11
|
-
const touches = vue.
|
|
11
|
+
const touches = vue.shallowRef(0);
|
|
12
12
|
const onChange = () => {
|
|
13
13
|
const newCookies = cookies.getAll({ doNotParse: true });
|
|
14
14
|
if (shouldUpdate(
|
package/useCookies.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,C,o,g){"use strict";function v(n){const r=new o(n?n.headers.cookie:null);return(u,{doNotParse:t=!1,autoUpdateDependencies:s=!1}={})=>i(u,{doNotParse:t,autoUpdateDependencies:s},r)}function i(n,{doNotParse:r=!1,autoUpdateDependencies:u=!1}={},t=new o){const s=u?[...n||[]]:n;let f=t.getAll({doNotParse:!0});const l=g.
|
|
1
|
+
(function(a,C,o,g){"use strict";function v(n){const r=new o(n?n.headers.cookie:null);return(u,{doNotParse:t=!1,autoUpdateDependencies:s=!1}={})=>i(u,{doNotParse:t,autoUpdateDependencies:s},r)}function i(n,{doNotParse:r=!1,autoUpdateDependencies:u=!1}={},t=new o){const s=u?[...n||[]]:n;let f=t.getAll({doNotParse:!0});const l=g.shallowRef(0),h=()=>{const e=t.getAll({doNotParse:!0});c(s||null,e,f)&&l.value++,f=e};return t.addChangeListener(h),C.tryOnScopeDispose(()=>{t.removeChangeListener(h)}),{get:(...e)=>(u&&s&&!s.includes(e[0])&&s.push(e[0]),l.value,t.get(e[0],{doNotParse:r,...e[1]})),getAll:(...e)=>(l.value,t.getAll({doNotParse:r,...e[0]})),set:(...e)=>t.set(...e),remove:(...e)=>t.remove(...e),addChangeListener:(...e)=>t.addChangeListener(...e),removeChangeListener:(...e)=>t.removeChangeListener(...e)}}function c(n,r,u){if(!n)return!0;for(const t of n)if(r[t]!==u[t])return!0;return!1}a.createCookies=v,a.useCookies=i})(this.VueUse=this.VueUse||{},VueUse,UniversalCookie,Vue);
|
package/useCookies.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { tryOnScopeDispose } from '@vueuse/shared';
|
|
2
2
|
import Cookie from 'universal-cookie';
|
|
3
|
-
import {
|
|
3
|
+
import { shallowRef } from 'vue';
|
|
4
4
|
|
|
5
5
|
function createCookies(req) {
|
|
6
6
|
const universalCookie = new Cookie(req ? req.headers.cookie : null);
|
|
@@ -9,7 +9,7 @@ function createCookies(req) {
|
|
|
9
9
|
function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
|
|
10
10
|
const watchingDependencies = autoUpdateDependencies ? [...dependencies || []] : dependencies;
|
|
11
11
|
let previousCookies = cookies.getAll({ doNotParse: true });
|
|
12
|
-
const touches =
|
|
12
|
+
const touches = shallowRef(0);
|
|
13
13
|
const onChange = () => {
|
|
14
14
|
const newCookies = cookies.getAll({ doNotParse: true });
|
|
15
15
|
if (shouldUpdate(
|
package/useDrauu.cjs
CHANGED
|
@@ -13,10 +13,10 @@ function useDrauu(target, options) {
|
|
|
13
13
|
const onCommittedHook = core.createEventHook();
|
|
14
14
|
const onStartHook = core.createEventHook();
|
|
15
15
|
const onEndHook = core.createEventHook();
|
|
16
|
-
const canUndo = vue.
|
|
17
|
-
const canRedo = vue.
|
|
18
|
-
const altPressed = vue.
|
|
19
|
-
const shiftPressed = vue.
|
|
16
|
+
const canUndo = vue.shallowRef(false);
|
|
17
|
+
const canRedo = vue.shallowRef(false);
|
|
18
|
+
const altPressed = vue.shallowRef(false);
|
|
19
|
+
const shiftPressed = vue.shallowRef(false);
|
|
20
20
|
const brush = vue.ref({
|
|
21
21
|
color: "black",
|
|
22
22
|
size: 3,
|
package/useDrauu.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventHookOn, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
2
|
import { Options, Drauu, Brush } from 'drauu';
|
|
3
|
-
import { Ref } from 'vue';
|
|
3
|
+
import { Ref, ShallowRef } from 'vue';
|
|
4
4
|
|
|
5
5
|
type UseDrauuOptions = Omit<Options, 'el'>;
|
|
6
6
|
interface UseDrauuReturn {
|
|
@@ -11,8 +11,8 @@ interface UseDrauuReturn {
|
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
undo: () => boolean | undefined;
|
|
13
13
|
redo: () => boolean | undefined;
|
|
14
|
-
canUndo:
|
|
15
|
-
canRedo:
|
|
14
|
+
canUndo: ShallowRef<boolean>;
|
|
15
|
+
canRedo: ShallowRef<boolean>;
|
|
16
16
|
brush: Ref<Brush>;
|
|
17
17
|
onChanged: EventHookOn;
|
|
18
18
|
onCommitted: EventHookOn;
|
package/useDrauu.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventHookOn, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
2
|
import { Options, Drauu, Brush } from 'drauu';
|
|
3
|
-
import { Ref } from 'vue';
|
|
3
|
+
import { Ref, ShallowRef } from 'vue';
|
|
4
4
|
|
|
5
5
|
type UseDrauuOptions = Omit<Options, 'el'>;
|
|
6
6
|
interface UseDrauuReturn {
|
|
@@ -11,8 +11,8 @@ interface UseDrauuReturn {
|
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
undo: () => boolean | undefined;
|
|
13
13
|
redo: () => boolean | undefined;
|
|
14
|
-
canUndo:
|
|
15
|
-
canRedo:
|
|
14
|
+
canUndo: ShallowRef<boolean>;
|
|
15
|
+
canRedo: ShallowRef<boolean>;
|
|
16
16
|
brush: Ref<Brush>;
|
|
17
17
|
onChanged: EventHookOn;
|
|
18
18
|
onCommitted: EventHookOn;
|
package/useDrauu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventHookOn, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
2
|
import { Options, Drauu, Brush } from 'drauu';
|
|
3
|
-
import { Ref } from 'vue';
|
|
3
|
+
import { Ref, ShallowRef } from 'vue';
|
|
4
4
|
|
|
5
5
|
type UseDrauuOptions = Omit<Options, 'el'>;
|
|
6
6
|
interface UseDrauuReturn {
|
|
@@ -11,8 +11,8 @@ interface UseDrauuReturn {
|
|
|
11
11
|
cancel: () => void;
|
|
12
12
|
undo: () => boolean | undefined;
|
|
13
13
|
redo: () => boolean | undefined;
|
|
14
|
-
canUndo:
|
|
15
|
-
canRedo:
|
|
14
|
+
canUndo: ShallowRef<boolean>;
|
|
15
|
+
canRedo: ShallowRef<boolean>;
|
|
16
16
|
brush: Ref<Brush>;
|
|
17
17
|
onChanged: EventHookOn;
|
|
18
18
|
onCommitted: EventHookOn;
|
package/useDrauu.iife.js
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
const onCommittedHook = core.createEventHook();
|
|
10
10
|
const onStartHook = core.createEventHook();
|
|
11
11
|
const onEndHook = core.createEventHook();
|
|
12
|
-
const canUndo = vue.
|
|
13
|
-
const canRedo = vue.
|
|
14
|
-
const altPressed = vue.
|
|
15
|
-
const shiftPressed = vue.
|
|
12
|
+
const canUndo = vue.shallowRef(false);
|
|
13
|
+
const canRedo = vue.shallowRef(false);
|
|
14
|
+
const altPressed = vue.shallowRef(false);
|
|
15
|
+
const shiftPressed = vue.shallowRef(false);
|
|
16
16
|
const brush = vue.ref({
|
|
17
17
|
color: "black",
|
|
18
18
|
size: 3,
|
package/useDrauu.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,o,k,H,a){"use strict";function V(p,u){const n=a.ref();let
|
|
1
|
+
(function(E,o,k,H,a){"use strict";function V(p,u){const n=a.ref();let r=[];const s=o.createEventHook(),c=o.createEventHook(),d=o.createEventHook(),v=o.createEventHook(),i=o.createEventHook(),f=a.shallowRef(!1),h=a.shallowRef(!1),w=a.shallowRef(!1),S=a.shallowRef(!1),l=a.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...u?.brush});a.watch(l,()=>{const e=n.value;e&&(e.brush=l.value,e.mode=l.value.mode)},{deep:!0});const R=()=>{var e;return(e=n.value)==null?void 0:e.undo()},_=()=>{var e;return(e=n.value)==null?void 0:e.redo()},C=()=>{var e;return(e=n.value)==null?void 0:e.clear()},U=()=>{var e;return(e=n.value)==null?void 0:e.cancel()},b=e=>{var t;return(t=n.value)==null?void 0:t.load(e)},D=()=>{var e;return(e=n.value)==null?void 0:e.dump()},m=()=>{var e;r.forEach(t=>t()),(e=n.value)==null||e.unmount()},g=()=>{n.value&&(f.value=n.value.canUndo(),h.value=n.value.canRedo(),w.value=n.value.altPressed,S.value=n.value.shiftPressed)};return a.watch(()=>o.unrefElement(p),e=>{!e||typeof SVGSVGElement>"u"||!(e instanceof SVGSVGElement)||(n.value&&m(),n.value=H.createDrauu({el:e,...u}),g(),r=[n.value.on("canceled",()=>c.trigger()),n.value.on("committed",t=>d.trigger(t)),n.value.on("start",()=>v.trigger()),n.value.on("end",()=>i.trigger()),n.value.on("changed",()=>{g(),s.trigger()})])},{flush:"post"}),k.tryOnScopeDispose(()=>m()),{drauuInstance:n,load:b,dump:D,clear:C,cancel:U,undo:R,redo:_,canUndo:f,canRedo:h,brush:l,onChanged:s.on,onCommitted:d.on,onStart:v.on,onEnd:i.on,onCanceled:c.on}}E.useDrauu=V})(this.VueUse=this.VueUse||{},VueUse,VueUse,Drauu,Vue);
|
package/useDrauu.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createEventHook, unrefElement } from '@vueuse/core';
|
|
2
2
|
import { tryOnScopeDispose } from '@vueuse/shared';
|
|
3
3
|
import { createDrauu } from 'drauu';
|
|
4
|
-
import { ref, watch } from 'vue';
|
|
4
|
+
import { ref, shallowRef, watch } from 'vue';
|
|
5
5
|
|
|
6
6
|
function useDrauu(target, options) {
|
|
7
7
|
const drauuInstance = ref();
|
|
@@ -11,10 +11,10 @@ function useDrauu(target, options) {
|
|
|
11
11
|
const onCommittedHook = createEventHook();
|
|
12
12
|
const onStartHook = createEventHook();
|
|
13
13
|
const onEndHook = createEventHook();
|
|
14
|
-
const canUndo =
|
|
15
|
-
const canRedo =
|
|
16
|
-
const altPressed =
|
|
17
|
-
const shiftPressed =
|
|
14
|
+
const canUndo = shallowRef(false);
|
|
15
|
+
const canRedo = shallowRef(false);
|
|
16
|
+
const altPressed = shallowRef(false);
|
|
17
|
+
const shiftPressed = shallowRef(false);
|
|
18
18
|
const brush = ref({
|
|
19
19
|
color: "black",
|
|
20
20
|
size: 3,
|
|
@@ -4,7 +4,7 @@ var core = require('@vueuse/core');
|
|
|
4
4
|
var focusTrap = require('focus-trap');
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
|
|
7
|
-
const UseFocusTrap = /* @__PURE__ */
|
|
7
|
+
const UseFocusTrap = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
8
8
|
name: "UseFocusTrap",
|
|
9
9
|
props: ["as", "options"],
|
|
10
10
|
setup(props, { slots }) {
|
|
@@ -2,7 +2,7 @@ import { unrefElement } from '@vueuse/core';
|
|
|
2
2
|
import { createFocusTrap } from 'focus-trap';
|
|
3
3
|
import { defineComponent, ref, watch, onScopeDispose, h } from 'vue';
|
|
4
4
|
|
|
5
|
-
const UseFocusTrap = /* @__PURE__ */
|
|
5
|
+
const UseFocusTrap = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "UseFocusTrap",
|
|
7
7
|
props: ["as", "options"],
|
|
8
8
|
setup(props, { slots }) {
|
package/useFocusTrap.cjs
CHANGED
|
@@ -8,8 +8,8 @@ var vue = require('vue');
|
|
|
8
8
|
function useFocusTrap(target, options = {}) {
|
|
9
9
|
let trap;
|
|
10
10
|
const { immediate, ...focusTrapOptions } = options;
|
|
11
|
-
const hasFocus = vue.
|
|
12
|
-
const isPaused = vue.
|
|
11
|
+
const hasFocus = vue.shallowRef(false);
|
|
12
|
+
const isPaused = vue.shallowRef(false);
|
|
13
13
|
const activate = (opts) => trap && trap.activate(opts);
|
|
14
14
|
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
15
15
|
const pause = () => {
|
package/useFocusTrap.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
2
|
import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
4
|
-
import {
|
|
3
|
+
import { ShallowRef, MaybeRefOrGetter } from 'vue';
|
|
5
4
|
|
|
6
5
|
interface UseFocusTrapOptions extends Options {
|
|
7
6
|
/**
|
|
@@ -13,11 +12,11 @@ interface UseFocusTrapReturn {
|
|
|
13
12
|
/**
|
|
14
13
|
* Indicates if the focus trap is currently active
|
|
15
14
|
*/
|
|
16
|
-
hasFocus:
|
|
15
|
+
hasFocus: ShallowRef<boolean>;
|
|
17
16
|
/**
|
|
18
17
|
* Indicates if the focus trap is currently paused
|
|
19
18
|
*/
|
|
20
|
-
isPaused:
|
|
19
|
+
isPaused: ShallowRef<boolean>;
|
|
21
20
|
/**
|
|
22
21
|
* Activate the focus trap
|
|
23
22
|
*
|
package/useFocusTrap.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
2
|
import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
4
|
-
import {
|
|
3
|
+
import { ShallowRef, MaybeRefOrGetter } from 'vue';
|
|
5
4
|
|
|
6
5
|
interface UseFocusTrapOptions extends Options {
|
|
7
6
|
/**
|
|
@@ -13,11 +12,11 @@ interface UseFocusTrapReturn {
|
|
|
13
12
|
/**
|
|
14
13
|
* Indicates if the focus trap is currently active
|
|
15
14
|
*/
|
|
16
|
-
hasFocus:
|
|
15
|
+
hasFocus: ShallowRef<boolean>;
|
|
17
16
|
/**
|
|
18
17
|
* Indicates if the focus trap is currently paused
|
|
19
18
|
*/
|
|
20
|
-
isPaused:
|
|
19
|
+
isPaused: ShallowRef<boolean>;
|
|
21
20
|
/**
|
|
22
21
|
* Activate the focus trap
|
|
23
22
|
*
|
package/useFocusTrap.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fn, Arrayable, MaybeComputedElementRef } from '@vueuse/core';
|
|
2
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
3
2
|
import { Options, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
4
|
-
import {
|
|
3
|
+
import { ShallowRef, MaybeRefOrGetter } from 'vue';
|
|
5
4
|
|
|
6
5
|
interface UseFocusTrapOptions extends Options {
|
|
7
6
|
/**
|
|
@@ -13,11 +12,11 @@ interface UseFocusTrapReturn {
|
|
|
13
12
|
/**
|
|
14
13
|
* Indicates if the focus trap is currently active
|
|
15
14
|
*/
|
|
16
|
-
hasFocus:
|
|
15
|
+
hasFocus: ShallowRef<boolean>;
|
|
17
16
|
/**
|
|
18
17
|
* Indicates if the focus trap is currently paused
|
|
19
18
|
*/
|
|
20
|
-
isPaused:
|
|
19
|
+
isPaused: ShallowRef<boolean>;
|
|
21
20
|
/**
|
|
22
21
|
* Activate the focus trap
|
|
23
22
|
*
|
package/useFocusTrap.iife.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
function useFocusTrap(target, options = {}) {
|
|
5
5
|
let trap;
|
|
6
6
|
const { immediate, ...focusTrapOptions } = options;
|
|
7
|
-
const hasFocus = vue.
|
|
8
|
-
const isPaused = vue.
|
|
7
|
+
const hasFocus = vue.shallowRef(false);
|
|
8
|
+
const isPaused = vue.shallowRef(false);
|
|
9
9
|
const activate = (opts) => trap && trap.activate(opts);
|
|
10
10
|
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
11
11
|
const pause = () => {
|
package/useFocusTrap.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,u,f,p,a){"use strict";function h(v,s={}){let t;const{immediate:V,...d}=s,c=a.shallowRef(!1),n=a.shallowRef(!1),i=e=>t&&t.activate(e),r=e=>t&&t.deactivate(e),m=()=>{t&&(t.pause(),n.value=!0)},T=()=>{t&&(t.unpause(),n.value=!1)},g=a.computed(()=>{const e=a.toValue(v);return u.toArray(e).map(A=>{const o=a.toValue(A);return typeof o=="string"?o:u.unrefElement(o)}).filter(f.notNullish)});return a.watch(g,e=>{e.length&&(t=p.createFocusTrap(e,{...d,onActivate(){c.value=!0,s.onActivate&&s.onActivate()},onDeactivate(){c.value=!1,s.onDeactivate&&s.onDeactivate()}}),V&&i())},{flush:"post"}),u.tryOnScopeDispose(()=>r()),{hasFocus:c,isPaused:n,activate:i,deactivate:r,pause:m,unpause:T}}l.useFocusTrap=h})(this.VueUse=this.VueUse||{},VueUse,VueUse,focusTrap,Vue);
|
package/useFocusTrap.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { toArray, unrefElement, tryOnScopeDispose } from '@vueuse/core';
|
|
2
2
|
import { notNullish } from '@vueuse/shared';
|
|
3
3
|
import { createFocusTrap } from 'focus-trap';
|
|
4
|
-
import {
|
|
4
|
+
import { shallowRef, computed, toValue, watch } from 'vue';
|
|
5
5
|
|
|
6
6
|
function useFocusTrap(target, options = {}) {
|
|
7
7
|
let trap;
|
|
8
8
|
const { immediate, ...focusTrapOptions } = options;
|
|
9
|
-
const hasFocus =
|
|
10
|
-
const isPaused =
|
|
9
|
+
const hasFocus = shallowRef(false);
|
|
10
|
+
const isPaused = shallowRef(false);
|
|
11
11
|
const activate = (opts) => trap && trap.activate(opts);
|
|
12
12
|
const deactivate = (opts) => trap && trap.deactivate(opts);
|
|
13
13
|
const pause = () => {
|
package/useFuse.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter, ComputedRef } from 'vue';
|
|
3
3
|
import * as fuse_js from 'fuse.js';
|
|
4
4
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
5
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
6
5
|
|
|
7
6
|
type FuseOptions<T> = IFuseOptions<T>;
|
|
8
7
|
interface UseFuseOptions<T> {
|
package/useFuse.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter, ComputedRef } from 'vue';
|
|
3
3
|
import * as fuse_js from 'fuse.js';
|
|
4
4
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
5
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
6
5
|
|
|
7
6
|
type FuseOptions<T> = IFuseOptions<T>;
|
|
8
7
|
interface UseFuseOptions<T> {
|
package/useFuse.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter, ComputedRef } from 'vue';
|
|
3
3
|
import * as fuse_js from 'fuse.js';
|
|
4
4
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
5
|
-
import { MaybeRefOrGetter } from '@vueuse/shared';
|
|
6
5
|
|
|
7
6
|
type FuseOptions<T> = IFuseOptions<T>;
|
|
8
7
|
interface UseFuseOptions<T> {
|
package/useIDBKeyval.cjs
CHANGED
|
@@ -14,7 +14,7 @@ function useIDBKeyval(key, initialValue, options = {}) {
|
|
|
14
14
|
},
|
|
15
15
|
writeDefaults = true
|
|
16
16
|
} = options;
|
|
17
|
-
const isFinished = vue.
|
|
17
|
+
const isFinished = vue.shallowRef(false);
|
|
18
18
|
const data = (shallow ? vue.shallowRef : vue.ref)(initialValue);
|
|
19
19
|
const rawInit = vue.toValue(initialValue);
|
|
20
20
|
async function read() {
|
package/useIDBKeyval.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigurableFlush, RemovableRef
|
|
2
|
-
import {
|
|
1
|
+
import { ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
2
|
+
import { ShallowRef, MaybeRefOrGetter } from 'vue';
|
|
3
3
|
|
|
4
4
|
interface UseIDBOptions extends ConfigurableFlush {
|
|
5
5
|
/**
|
|
@@ -29,7 +29,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
29
29
|
}
|
|
30
30
|
interface UseIDBKeyvalReturn<T> {
|
|
31
31
|
data: RemovableRef<T>;
|
|
32
|
-
isFinished:
|
|
32
|
+
isFinished: ShallowRef<boolean>;
|
|
33
33
|
set: (value: T) => Promise<void>;
|
|
34
34
|
}
|
|
35
35
|
/**
|