@vueuse/integrations 12.7.0 → 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 +1 -1
- package/index.d.cts +16 -16
- package/index.d.mts +16 -16
- package/index.d.ts +16 -16
- package/index.iife.js +1 -1
- package/index.iife.min.js +1 -1
- package/index.mjs +2 -2
- package/package.json +5 -5
- package/useAsyncValidator/component.cjs +2 -2
- package/useAsyncValidator/component.mjs +3 -3
- package/useAsyncValidator.cjs +1 -1
- package/useAsyncValidator.d.cts +6 -7
- package/useAsyncValidator.d.mts +6 -7
- package/useAsyncValidator.d.ts +6 -7
- package/useAsyncValidator.iife.js +1 -1
- package/useAsyncValidator.iife.min.js +1 -1
- package/useAsyncValidator.mjs +2 -2
- package/useChangeCase.d.cts +1 -2
- package/useChangeCase.d.mts +1 -2
- package/useChangeCase.d.ts +1 -2
- package/useDrauu.d.cts +3 -3
- package/useDrauu.d.mts +3 -3
- package/useDrauu.d.ts +3 -3
- package/useFocusTrap/component.cjs +1 -1
- package/useFocusTrap/component.mjs +1 -1
- package/useFocusTrap.d.cts +3 -4
- package/useFocusTrap.d.mts +3 -4
- package/useFocusTrap.d.ts +3 -4
- package/useFuse.d.cts +1 -2
- package/useFuse.d.mts +1 -2
- package/useFuse.d.ts +1 -2
- package/useIDBKeyval.d.cts +3 -3
- package/useIDBKeyval.d.mts +3 -3
- package/useIDBKeyval.d.ts +3 -3
- 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.d.cts +1 -1
- package/useQRCode.d.mts +1 -1
- package/useQRCode.d.ts +1 -1
- 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
package/index.cjs
CHANGED
|
@@ -45,7 +45,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
45
45
|
const valueRef = shared.toRef(value);
|
|
46
46
|
const errorInfo = vue.shallowRef(null);
|
|
47
47
|
const isFinished = vue.shallowRef(true);
|
|
48
|
-
const pass = vue.
|
|
48
|
+
const pass = vue.shallowRef(!immediate || manual);
|
|
49
49
|
const errors = vue.computed(() => {
|
|
50
50
|
var _a;
|
|
51
51
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
package/index.d.cts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, MaybeRef, ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
2
|
import * as vue from 'vue';
|
|
4
|
-
import { Ref,
|
|
3
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter, Ref, MaybeRef, WritableComputedRef } from 'vue';
|
|
5
4
|
import { AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
6
5
|
import * as changeCase from 'change-case';
|
|
7
6
|
import { Options } from 'change-case';
|
|
8
7
|
import * as universal_cookie from 'universal-cookie';
|
|
9
8
|
import universal_cookie__default from 'universal-cookie';
|
|
10
9
|
import { IncomingMessage } from 'node:http';
|
|
11
|
-
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument
|
|
10
|
+
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument } from '@vueuse/core';
|
|
12
11
|
import { Options as Options$1, Drauu, Brush } from 'drauu';
|
|
13
12
|
import { Options as Options$2, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
14
13
|
import * as fuse_js from 'fuse.js';
|
|
15
14
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
15
|
+
import { ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
16
16
|
import { JwtPayload, JwtHeader } from 'jwt-decode';
|
|
17
17
|
import nprogress, { NProgressOptions } from 'nprogress';
|
|
18
18
|
import QRCode from 'qrcode';
|
|
@@ -29,11 +29,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
29
29
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
30
30
|
}
|
|
31
31
|
interface UseAsyncValidatorReturn {
|
|
32
|
-
pass:
|
|
33
|
-
isFinished:
|
|
34
|
-
errors:
|
|
35
|
-
errorInfo:
|
|
36
|
-
errorFields:
|
|
32
|
+
pass: ShallowRef<boolean>;
|
|
33
|
+
isFinished: ShallowRef<boolean>;
|
|
34
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
35
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
36
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
37
37
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
38
38
|
}
|
|
39
39
|
interface UseAsyncValidatorOptions {
|
|
@@ -230,8 +230,8 @@ interface UseDrauuReturn {
|
|
|
230
230
|
cancel: () => void;
|
|
231
231
|
undo: () => boolean | undefined;
|
|
232
232
|
redo: () => boolean | undefined;
|
|
233
|
-
canUndo:
|
|
234
|
-
canRedo:
|
|
233
|
+
canUndo: ShallowRef<boolean>;
|
|
234
|
+
canRedo: ShallowRef<boolean>;
|
|
235
235
|
brush: Ref<Brush>;
|
|
236
236
|
onChanged: EventHookOn;
|
|
237
237
|
onCommitted: EventHookOn;
|
|
@@ -258,11 +258,11 @@ interface UseFocusTrapReturn {
|
|
|
258
258
|
/**
|
|
259
259
|
* Indicates if the focus trap is currently active
|
|
260
260
|
*/
|
|
261
|
-
hasFocus:
|
|
261
|
+
hasFocus: ShallowRef<boolean>;
|
|
262
262
|
/**
|
|
263
263
|
* Indicates if the focus trap is currently paused
|
|
264
264
|
*/
|
|
265
|
-
isPaused:
|
|
265
|
+
isPaused: ShallowRef<boolean>;
|
|
266
266
|
/**
|
|
267
267
|
* Activate the focus trap
|
|
268
268
|
*
|
|
@@ -351,7 +351,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
351
351
|
}
|
|
352
352
|
interface UseIDBKeyvalReturn<T> {
|
|
353
353
|
data: RemovableRef<T>;
|
|
354
|
-
isFinished:
|
|
354
|
+
isFinished: ShallowRef<boolean>;
|
|
355
355
|
set: (value: T) => Promise<void>;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
@@ -426,8 +426,8 @@ interface UseSortableReturn {
|
|
|
426
426
|
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
427
427
|
}
|
|
428
428
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
429
|
-
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter
|
|
430
|
-
declare function useSortable<T>(el: MaybeRefOrGetter
|
|
429
|
+
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
430
|
+
declare function useSortable<T>(el: MaybeRefOrGetter<HTMLElement | null | undefined>, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
431
431
|
/**
|
|
432
432
|
* Inserts a element into the DOM at a given index.
|
|
433
433
|
* @param parentElement
|
|
@@ -442,6 +442,6 @@ declare function insertNodeAt(parentElement: Element, element: Element, index: n
|
|
|
442
442
|
* @see https://github.com/Alfred-Skyblue/vue-draggable-plus/blob/a3829222095e1949bf2c9a20979d7b5930e66f14/src/utils/index.ts#L96C1-L102C2
|
|
443
443
|
*/
|
|
444
444
|
declare function removeNode(node: Node): void;
|
|
445
|
-
declare function moveArrayElement<T>(list: MaybeRefOrGetter
|
|
445
|
+
declare function moveArrayElement<T>(list: MaybeRefOrGetter<T[]>, from: number, to: number, e?: Sortable.SortableEvent | null): void;
|
|
446
446
|
|
|
447
447
|
export { type AsyncValidatorError, type ChangeCaseType, type EasyUseAxiosReturn, type FuseOptions, type StrictUseAxiosReturn, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, type UseAxiosOptions, type UseAxiosOptionsBase, type UseAxiosOptionsWithInitialData, type UseAxiosReturn, type UseDrauuOptions, type UseDrauuReturn, type UseFocusTrapOptions, type UseFocusTrapReturn, type UseFuseOptions, type UseFuseReturn, type UseIDBKeyvalReturn, type UseIDBOptions, type UseJwtOptions, type UseJwtReturn, type UseNProgressOptions, type UseNProgressReturn, type UseSortableOptions, type UseSortableReturn, createCookies, insertNodeAt, moveArrayElement, removeNode, useAsyncValidator, useAxios, useChangeCase, useCookies, useDrauu, useFocusTrap, useFuse, useIDBKeyval, useJwt, useNProgress, useQRCode, useSortable };
|
package/index.d.mts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, MaybeRef, ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
2
|
import * as vue from 'vue';
|
|
4
|
-
import { Ref,
|
|
3
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter, Ref, MaybeRef, WritableComputedRef } from 'vue';
|
|
5
4
|
import { AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
6
5
|
import * as changeCase from 'change-case';
|
|
7
6
|
import { Options } from 'change-case';
|
|
8
7
|
import * as universal_cookie from 'universal-cookie';
|
|
9
8
|
import universal_cookie__default from 'universal-cookie';
|
|
10
9
|
import { IncomingMessage } from 'node:http';
|
|
11
|
-
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument
|
|
10
|
+
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument } from '@vueuse/core';
|
|
12
11
|
import { Options as Options$1, Drauu, Brush } from 'drauu';
|
|
13
12
|
import { Options as Options$2, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
14
13
|
import * as fuse_js from 'fuse.js';
|
|
15
14
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
15
|
+
import { ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
16
16
|
import { JwtPayload, JwtHeader } from 'jwt-decode';
|
|
17
17
|
import nprogress, { NProgressOptions } from 'nprogress';
|
|
18
18
|
import QRCode from 'qrcode';
|
|
@@ -29,11 +29,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
29
29
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
30
30
|
}
|
|
31
31
|
interface UseAsyncValidatorReturn {
|
|
32
|
-
pass:
|
|
33
|
-
isFinished:
|
|
34
|
-
errors:
|
|
35
|
-
errorInfo:
|
|
36
|
-
errorFields:
|
|
32
|
+
pass: ShallowRef<boolean>;
|
|
33
|
+
isFinished: ShallowRef<boolean>;
|
|
34
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
35
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
36
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
37
37
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
38
38
|
}
|
|
39
39
|
interface UseAsyncValidatorOptions {
|
|
@@ -230,8 +230,8 @@ interface UseDrauuReturn {
|
|
|
230
230
|
cancel: () => void;
|
|
231
231
|
undo: () => boolean | undefined;
|
|
232
232
|
redo: () => boolean | undefined;
|
|
233
|
-
canUndo:
|
|
234
|
-
canRedo:
|
|
233
|
+
canUndo: ShallowRef<boolean>;
|
|
234
|
+
canRedo: ShallowRef<boolean>;
|
|
235
235
|
brush: Ref<Brush>;
|
|
236
236
|
onChanged: EventHookOn;
|
|
237
237
|
onCommitted: EventHookOn;
|
|
@@ -258,11 +258,11 @@ interface UseFocusTrapReturn {
|
|
|
258
258
|
/**
|
|
259
259
|
* Indicates if the focus trap is currently active
|
|
260
260
|
*/
|
|
261
|
-
hasFocus:
|
|
261
|
+
hasFocus: ShallowRef<boolean>;
|
|
262
262
|
/**
|
|
263
263
|
* Indicates if the focus trap is currently paused
|
|
264
264
|
*/
|
|
265
|
-
isPaused:
|
|
265
|
+
isPaused: ShallowRef<boolean>;
|
|
266
266
|
/**
|
|
267
267
|
* Activate the focus trap
|
|
268
268
|
*
|
|
@@ -351,7 +351,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
351
351
|
}
|
|
352
352
|
interface UseIDBKeyvalReturn<T> {
|
|
353
353
|
data: RemovableRef<T>;
|
|
354
|
-
isFinished:
|
|
354
|
+
isFinished: ShallowRef<boolean>;
|
|
355
355
|
set: (value: T) => Promise<void>;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
@@ -426,8 +426,8 @@ interface UseSortableReturn {
|
|
|
426
426
|
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
427
427
|
}
|
|
428
428
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
429
|
-
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter
|
|
430
|
-
declare function useSortable<T>(el: MaybeRefOrGetter
|
|
429
|
+
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
430
|
+
declare function useSortable<T>(el: MaybeRefOrGetter<HTMLElement | null | undefined>, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
431
431
|
/**
|
|
432
432
|
* Inserts a element into the DOM at a given index.
|
|
433
433
|
* @param parentElement
|
|
@@ -442,6 +442,6 @@ declare function insertNodeAt(parentElement: Element, element: Element, index: n
|
|
|
442
442
|
* @see https://github.com/Alfred-Skyblue/vue-draggable-plus/blob/a3829222095e1949bf2c9a20979d7b5930e66f14/src/utils/index.ts#L96C1-L102C2
|
|
443
443
|
*/
|
|
444
444
|
declare function removeNode(node: Node): void;
|
|
445
|
-
declare function moveArrayElement<T>(list: MaybeRefOrGetter
|
|
445
|
+
declare function moveArrayElement<T>(list: MaybeRefOrGetter<T[]>, from: number, to: number, e?: Sortable.SortableEvent | null): void;
|
|
446
446
|
|
|
447
447
|
export { type AsyncValidatorError, type ChangeCaseType, type EasyUseAxiosReturn, type FuseOptions, type StrictUseAxiosReturn, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, type UseAxiosOptions, type UseAxiosOptionsBase, type UseAxiosOptionsWithInitialData, type UseAxiosReturn, type UseDrauuOptions, type UseDrauuReturn, type UseFocusTrapOptions, type UseFocusTrapReturn, type UseFuseOptions, type UseFuseReturn, type UseIDBKeyvalReturn, type UseIDBOptions, type UseJwtOptions, type UseJwtReturn, type UseNProgressOptions, type UseNProgressReturn, type UseSortableOptions, type UseSortableReturn, createCookies, insertNodeAt, moveArrayElement, removeNode, useAsyncValidator, useAxios, useChangeCase, useCookies, useDrauu, useFocusTrap, useFuse, useIDBKeyval, useJwt, useNProgress, useQRCode, useSortable };
|
package/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { MaybeRefOrGetter, MaybeRef, ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
2
1
|
import { ValidateError, ValidateOption, Rules } from 'async-validator';
|
|
3
2
|
import * as vue from 'vue';
|
|
4
|
-
import { Ref,
|
|
3
|
+
import { ShallowRef, ComputedRef, MaybeRefOrGetter, Ref, MaybeRef, WritableComputedRef } from 'vue';
|
|
5
4
|
import { AxiosResponse, AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
6
5
|
import * as changeCase from 'change-case';
|
|
7
6
|
import { Options } from 'change-case';
|
|
8
7
|
import * as universal_cookie from 'universal-cookie';
|
|
9
8
|
import universal_cookie__default from 'universal-cookie';
|
|
10
9
|
import { IncomingMessage } from 'node:http';
|
|
11
|
-
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument
|
|
10
|
+
import { EventHookOn, MaybeComputedElementRef, Fn, Arrayable, ConfigurableDocument } from '@vueuse/core';
|
|
12
11
|
import { Options as Options$1, Drauu, Brush } from 'drauu';
|
|
13
12
|
import { Options as Options$2, ActivateOptions, DeactivateOptions } from 'focus-trap';
|
|
14
13
|
import * as fuse_js from 'fuse.js';
|
|
15
14
|
import fuse_js__default, { IFuseOptions, FuseResult } from 'fuse.js';
|
|
15
|
+
import { ConfigurableFlush, RemovableRef } from '@vueuse/shared';
|
|
16
16
|
import { JwtPayload, JwtHeader } from 'jwt-decode';
|
|
17
17
|
import nprogress, { NProgressOptions } from 'nprogress';
|
|
18
18
|
import QRCode from 'qrcode';
|
|
@@ -29,11 +29,11 @@ interface UseAsyncValidatorExecuteReturn {
|
|
|
29
29
|
errorFields: AsyncValidatorError['fields'] | undefined;
|
|
30
30
|
}
|
|
31
31
|
interface UseAsyncValidatorReturn {
|
|
32
|
-
pass:
|
|
33
|
-
isFinished:
|
|
34
|
-
errors:
|
|
35
|
-
errorInfo:
|
|
36
|
-
errorFields:
|
|
32
|
+
pass: ShallowRef<boolean>;
|
|
33
|
+
isFinished: ShallowRef<boolean>;
|
|
34
|
+
errors: ComputedRef<AsyncValidatorError['errors'] | undefined>;
|
|
35
|
+
errorInfo: ShallowRef<AsyncValidatorError | null>;
|
|
36
|
+
errorFields: ComputedRef<AsyncValidatorError['fields'] | undefined>;
|
|
37
37
|
execute: () => Promise<UseAsyncValidatorExecuteReturn>;
|
|
38
38
|
}
|
|
39
39
|
interface UseAsyncValidatorOptions {
|
|
@@ -230,8 +230,8 @@ interface UseDrauuReturn {
|
|
|
230
230
|
cancel: () => void;
|
|
231
231
|
undo: () => boolean | undefined;
|
|
232
232
|
redo: () => boolean | undefined;
|
|
233
|
-
canUndo:
|
|
234
|
-
canRedo:
|
|
233
|
+
canUndo: ShallowRef<boolean>;
|
|
234
|
+
canRedo: ShallowRef<boolean>;
|
|
235
235
|
brush: Ref<Brush>;
|
|
236
236
|
onChanged: EventHookOn;
|
|
237
237
|
onCommitted: EventHookOn;
|
|
@@ -258,11 +258,11 @@ interface UseFocusTrapReturn {
|
|
|
258
258
|
/**
|
|
259
259
|
* Indicates if the focus trap is currently active
|
|
260
260
|
*/
|
|
261
|
-
hasFocus:
|
|
261
|
+
hasFocus: ShallowRef<boolean>;
|
|
262
262
|
/**
|
|
263
263
|
* Indicates if the focus trap is currently paused
|
|
264
264
|
*/
|
|
265
|
-
isPaused:
|
|
265
|
+
isPaused: ShallowRef<boolean>;
|
|
266
266
|
/**
|
|
267
267
|
* Activate the focus trap
|
|
268
268
|
*
|
|
@@ -351,7 +351,7 @@ interface UseIDBOptions extends ConfigurableFlush {
|
|
|
351
351
|
}
|
|
352
352
|
interface UseIDBKeyvalReturn<T> {
|
|
353
353
|
data: RemovableRef<T>;
|
|
354
|
-
isFinished:
|
|
354
|
+
isFinished: ShallowRef<boolean>;
|
|
355
355
|
set: (value: T) => Promise<void>;
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
@@ -426,8 +426,8 @@ interface UseSortableReturn {
|
|
|
426
426
|
option: (<K extends keyof Sortable.Options>(name: K, value: Sortable.Options[K]) => void) & (<K extends keyof Sortable.Options>(name: K) => Sortable.Options[K]);
|
|
427
427
|
}
|
|
428
428
|
type UseSortableOptions = Options$3 & ConfigurableDocument;
|
|
429
|
-
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter
|
|
430
|
-
declare function useSortable<T>(el: MaybeRefOrGetter
|
|
429
|
+
declare function useSortable<T>(selector: string, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
430
|
+
declare function useSortable<T>(el: MaybeRefOrGetter<HTMLElement | null | undefined>, list: MaybeRefOrGetter<T[]>, options?: UseSortableOptions): UseSortableReturn;
|
|
431
431
|
/**
|
|
432
432
|
* Inserts a element into the DOM at a given index.
|
|
433
433
|
* @param parentElement
|
|
@@ -442,6 +442,6 @@ declare function insertNodeAt(parentElement: Element, element: Element, index: n
|
|
|
442
442
|
* @see https://github.com/Alfred-Skyblue/vue-draggable-plus/blob/a3829222095e1949bf2c9a20979d7b5930e66f14/src/utils/index.ts#L96C1-L102C2
|
|
443
443
|
*/
|
|
444
444
|
declare function removeNode(node: Node): void;
|
|
445
|
-
declare function moveArrayElement<T>(list: MaybeRefOrGetter
|
|
445
|
+
declare function moveArrayElement<T>(list: MaybeRefOrGetter<T[]>, from: number, to: number, e?: Sortable.SortableEvent | null): void;
|
|
446
446
|
|
|
447
447
|
export { type AsyncValidatorError, type ChangeCaseType, type EasyUseAxiosReturn, type FuseOptions, type StrictUseAxiosReturn, type UseAsyncValidatorExecuteReturn, type UseAsyncValidatorOptions, type UseAsyncValidatorReturn, type UseAxiosOptions, type UseAxiosOptionsBase, type UseAxiosOptionsWithInitialData, type UseAxiosReturn, type UseDrauuOptions, type UseDrauuReturn, type UseFocusTrapOptions, type UseFocusTrapReturn, type UseFuseOptions, type UseFuseReturn, type UseIDBKeyvalReturn, type UseIDBOptions, type UseJwtOptions, type UseJwtReturn, type UseNProgressOptions, type UseNProgressReturn, type UseSortableOptions, type UseSortableReturn, createCookies, insertNodeAt, moveArrayElement, removeNode, useAsyncValidator, useAxios, useChangeCase, useCookies, useDrauu, useFocusTrap, useFuse, useIDBKeyval, useJwt, useNProgress, useQRCode, useSortable };
|
package/index.iife.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
const valueRef = shared.toRef(value);
|
|
31
31
|
const errorInfo = vue.shallowRef(null);
|
|
32
32
|
const isFinished = vue.shallowRef(true);
|
|
33
|
-
const pass = vue.
|
|
33
|
+
const pass = vue.shallowRef(!immediate || manual);
|
|
34
34
|
const errors = vue.computed(() => {
|
|
35
35
|
var _a;
|
|
36
36
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
package/index.iife.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,C,U,n,L,$,k,p,K,X,Y,P,Z,V,x,ee){"use strict";function te(t){var o=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),o.default=t,Object.freeze(o)}var ne=te($);const ae=U.default||U;function oe(t,o,e={}){const{validateOption:a={},immediate:r=!0,manual:
|
|
1
|
+
(function(w,C,U,n,L,$,k,p,K,X,Y,P,Z,V,x,ee){"use strict";function te(t){var o=Object.create(null);return t&&Object.keys(t).forEach(function(e){if(e!=="default"){var a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,a.get?a:{enumerable:!0,get:function(){return t[e]}})}}),o.default=t,Object.freeze(o)}var ne=te($);const ae=U.default||U;function oe(t,o,e={}){const{validateOption:a={},immediate:r=!0,manual:s=!1}=e,l=C.toRef(t),c=n.shallowRef(null),u=n.shallowRef(!0),d=n.shallowRef(!r||s),v=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.errors)||[]}),g=n.computed(()=>{var i;return((i=c.value)==null?void 0:i.fields)||{}}),h=n.computed(()=>new ae(n.toValue(o))),y=async()=>{u.value=!1,d.value=!1;try{await h.value.validate(l.value,a),d.value=!0,c.value=null}catch(i){c.value=i}finally{u.value=!0}return{pass:d.value,errorInfo:c.value,errors:v.value,errorFields:g.value}};s||n.watch([l,h],()=>y(),{immediate:r,deep:!0});const R={isFinished:u,pass:d,errors:v,errorInfo:c,errorFields:g,execute:y};function E(){return new Promise((i,b)=>{C.until(u).toBe(!0).then(()=>i(R)).catch(A=>b(A))})}return{...R,then(i,b){return E().then(i,b)}}}function le(...t){const o=typeof t[0]=="string"?t[0]:void 0,e=typeof o=="string"?1:0,a={immediate:!!e,shallow:!0,abortPrevious:!0};let r={},s=L,l=a;const c=m=>!!m?.request;t.length>0+e&&(c(t[0+e])?s=t[0+e]:r=t[0+e]),t.length>1+e&&c(t[1+e])&&(s=t[1+e]),(t.length===2+e&&!c(t[1+e])||t.length===3+e)&&(l=t[t.length-1]||a);const{shallow:u,onSuccess:d=C.noop,onError:v=C.noop,immediate:g,resetOnExecute:h=!1}=l,y=l.initialData,R=n.shallowRef(),E=(u?n.shallowRef:n.ref)(y),i=n.shallowRef(!1),b=n.shallowRef(!1),A=n.shallowRef(!1),D=n.shallowRef();let S=new AbortController;const F=m=>{i.value||!b.value||(S.abort(m),S=new AbortController,A.value=!0,b.value=!1,i.value=!1)},f=m=>{b.value=m,i.value=!m},_=()=>{h&&(E.value=y)},Q=()=>new Promise((m,I)=>{C.until(i).toBe(!0).then(()=>D.value?I(D.value):m(q))}),H={then:(...m)=>Q().then(...m),catch:(...m)=>Q().catch(...m)};let j=0;const z=(m=o,I={})=>{D.value=void 0;const J=typeof m=="string"?m:o??I.url;if(J===void 0)return D.value=new L.AxiosError(L.AxiosError.ERR_INVALID_URL),i.value=!0,H;_(),l.abortPrevious!==!1&&F(),f(!0),j+=1;const pe=j;return A.value=!1,s(J,{...r,...typeof m=="object"?m:I,signal:S.signal}).then(O=>{if(A.value)return;R.value=O;const M=O.data;E.value=M,d(M)}).catch(O=>{D.value=O,v(O)}).finally(()=>{var O;(O=l.onFinish)==null||O.call(l),pe===j&&f(!1)}),H};g&&o&&z();const q={response:R,data:E,error:D,isFinished:i,isLoading:b,cancel:F,isAborted:A,isCanceled:A,abort:F,execute:z};return{...q,...H}}const N=Object.entries(ne).filter(([t,o])=>typeof o=="function"&&t.endsWith("Case")).reduce((t,[o,e])=>(t[o]=e,t),{});function re(t,o,e){const a=n.computed(()=>{const s=n.toValue(o);if(!N[s])throw new Error(`Invalid change case type "${s}"`);return s});if(typeof t=="function")return n.computed(()=>N[a.value](n.toValue(t),n.toValue(e)));const r=n.ref(t);return n.computed({get(){return N[a.value](r.value,n.toValue(e))},set(s){r.value=s}})}function se(t){const o=new k(t?t.headers.cookie:null);return(e,{doNotParse:a=!1,autoUpdateDependencies:r=!1}={})=>T(e,{doNotParse:a,autoUpdateDependencies:r},o)}function T(t,{doNotParse:o=!1,autoUpdateDependencies:e=!1}={},a=new k){const r=e?[...t||[]]:t;let s=a.getAll({doNotParse:!0});const l=n.shallowRef(0),c=()=>{const u=a.getAll({doNotParse:!0});ue(r||null,u,s)&&l.value++,s=u};return a.addChangeListener(c),C.tryOnScopeDispose(()=>{a.removeChangeListener(c)}),{get:(...u)=>(e&&r&&!r.includes(u[0])&&r.push(u[0]),l.value,a.get(u[0],{doNotParse:o,...u[1]})),getAll:(...u)=>(l.value,a.getAll({doNotParse:o,...u[0]})),set:(...u)=>a.set(...u),remove:(...u)=>a.remove(...u),addChangeListener:(...u)=>a.addChangeListener(...u),removeChangeListener:(...u)=>a.removeChangeListener(...u)}}function ue(t,o,e){if(!t)return!0;for(const a of t)if(o[a]!==e[a])return!0;return!1}function ce(t,o){const e=n.ref();let a=[];const r=p.createEventHook(),s=p.createEventHook(),l=p.createEventHook(),c=p.createEventHook(),u=p.createEventHook(),d=n.shallowRef(!1),v=n.shallowRef(!1),g=n.shallowRef(!1),h=n.shallowRef(!1),y=n.ref({color:"black",size:3,arrowEnd:!1,cornerRadius:0,dasharray:void 0,fill:"transparent",mode:"draw",...o?.brush});n.watch(y,()=>{const f=e.value;f&&(f.brush=y.value,f.mode=y.value.mode)},{deep:!0});const R=()=>{var f;return(f=e.value)==null?void 0:f.undo()},E=()=>{var f;return(f=e.value)==null?void 0:f.redo()},i=()=>{var f;return(f=e.value)==null?void 0:f.clear()},b=()=>{var f;return(f=e.value)==null?void 0:f.cancel()},A=f=>{var _;return(_=e.value)==null?void 0:_.load(f)},D=()=>{var f;return(f=e.value)==null?void 0:f.dump()},S=()=>{var f;a.forEach(_=>_()),(f=e.value)==null||f.unmount()},F=()=>{e.value&&(d.value=e.value.canUndo(),v.value=e.value.canRedo(),g.value=e.value.altPressed,h.value=e.value.shiftPressed)};return n.watch(()=>p.unrefElement(t),f=>{!f||typeof SVGSVGElement>"u"||!(f instanceof SVGSVGElement)||(e.value&&S(),e.value=K.createDrauu({el:f,...o}),F(),a=[e.value.on("canceled",()=>s.trigger()),e.value.on("committed",_=>l.trigger(_)),e.value.on("start",()=>c.trigger()),e.value.on("end",()=>u.trigger()),e.value.on("changed",()=>{F(),r.trigger()})])},{flush:"post"}),C.tryOnScopeDispose(()=>S()),{drauuInstance:e,load:A,dump:D,clear:i,cancel:b,undo:R,redo:E,canUndo:d,canRedo:v,brush:y,onChanged:r.on,onCommitted:l.on,onStart:c.on,onEnd:u.on,onCanceled:s.on}}function ie(t,o={}){let e;const{immediate:a,...r}=o,s=n.shallowRef(!1),l=n.shallowRef(!1),c=h=>e&&e.activate(h),u=h=>e&&e.deactivate(h),d=()=>{e&&(e.pause(),l.value=!0)},v=()=>{e&&(e.unpause(),l.value=!1)},g=n.computed(()=>{const h=n.toValue(t);return p.toArray(h).map(y=>{const R=n.toValue(y);return typeof R=="string"?R:p.unrefElement(R)}).filter(C.notNullish)});return n.watch(g,h=>{h.length&&(e=X.createFocusTrap(h,{...r,onActivate(){s.value=!0,o.onActivate&&o.onActivate()},onDeactivate(){s.value=!1,o.onDeactivate&&o.onDeactivate()}}),a&&c())},{flush:"post"}),p.tryOnScopeDispose(()=>u()),{hasFocus:s,isPaused:l,activate:c,deactivate:u,pause:d,unpause:v}}function fe(t,o,e){const a=()=>{var l,c;return new Y((l=n.toValue(o))!=null?l:[],(c=n.toValue(e))==null?void 0:c.fuseOptions)},r=n.ref(a());n.watch(()=>{var l;return(l=n.toValue(e))==null?void 0:l.fuseOptions},()=>{r.value=a()},{deep:!0}),n.watch(()=>n.toValue(o),l=>{r.value.setCollection(l)},{deep:!0});const s=n.computed(()=>{const l=n.toValue(e);if(l?.matchAllWhenSearchEmpty&&!n.toValue(t))return n.toValue(o).map((u,d)=>({item:u,refIndex:d}));const c=l?.resultLimit;return r.value.search(n.toValue(t),c?{limit:c}:void 0)});return{fuse:r,results:s}}function de(t,o,e={}){const{flush:a="pre",deep:r=!0,shallow:s=!1,onError:l=i=>{console.error(i)},writeDefaults:c=!0}=e,u=n.shallowRef(!1),d=(s?n.shallowRef:n.ref)(o),v=n.toValue(o);async function g(){try{const i=await P.get(t);i===void 0?v!=null&&c&&await P.set(t,v):d.value=i}catch(i){l(i)}u.value=!0}g();async function h(){try{d.value==null?await P.del(t):await P.update(t,()=>n.toRaw(d.value))}catch(i){l(i)}}const{pause:y,resume:R}=p.watchPausable(d,()=>h(),{flush:a,deep:r});async function E(i){y(),d.value=i,await h(),R()}return{set:E,isFinished:u,data:d}}function ve(t,o={}){const{onError:e,fallbackValue:a=null}=o,r=(c,u)=>{try{return Z.jwtDecode(c,u)}catch(d){return e?.(d),a}},s=n.computed(()=>r(n.toValue(t),{header:!0})),l=n.computed(()=>r(n.toValue(t)));return{header:s,payload:l}}function he(t=null,o){const e=C.toRef(t),a=n.computed({set:s=>s?V.start():V.done(),get:()=>typeof e.value=="number"&&e.value<1});o&&V.configure(o);const r=V.set;return V.set=s=>(e.value=s,r.call(V,s)),n.watchEffect(()=>{typeof e.value=="number"&&C.isClient&&r.call(V,e.value)}),C.tryOnScopeDispose(V.remove),{isLoading:a,progress:e,start:V.start,done:V.done,remove:()=>{e.value=null,V.remove()}}}function me(t,o){const e=C.toRef(t),a=n.shallowRef("");return n.watch(e,async r=>{e.value&&C.isClient&&(a.value=await x.toDataURL(r,o))},{immediate:!0}),a}function we(t,o,e={}){let a;const{document:r=p.defaultDocument,...s}=e,l={onUpdate:v=>{G(o,v.oldIndex,v.newIndex,v)}},c=()=>{const v=typeof t=="string"?r?.querySelector(t):p.unrefElement(t);!v||a!==void 0||(a=new ee(v,{...l,...s}))},u=()=>{a?.destroy(),a=void 0},d=(v,g)=>{if(g!==void 0)a?.option(v,g);else return a?.option(v)};return p.tryOnMounted(c),p.tryOnScopeDispose(u),{stop:u,start:c,option:d}}function B(t,o,e){const a=t.children[e];t.insertBefore(o,a)}function W(t){t.parentNode&&t.parentNode.removeChild(t)}function G(t,o,e,a=null){a!=null&&(W(a.item),B(a.from,a.item,o));const r=n.isRef(t),s=r?[...n.toValue(t)]:n.toValue(t);if(e>=0&&e<s.length){const l=s.splice(o,1)[0];n.nextTick(()=>{s.splice(e,0,l),r&&(t.value=s)})}}w.createCookies=se,w.insertNodeAt=B,w.moveArrayElement=G,w.removeNode=W,w.useAsyncValidator=oe,w.useAxios=le,w.useChangeCase=re,w.useCookies=T,w.useDrauu=ce,w.useFocusTrap=ie,w.useFuse=fe,w.useIDBKeyval=de,w.useJwt=ve,w.useNProgress=he,w.useQRCode=me,w.useSortable=we})(this.VueUse=this.VueUse||{},VueUse,AsyncValidator,Vue,axios,changeCase,UniversalCookie,VueUse,Drauu,focusTrap,Fuse,idbKeyval,jwt_decode,nprogress,QRCode,Sortable);
|
package/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toRef, until, noop, tryOnScopeDispose, notNullish, isClient } from '@vueuse/shared';
|
|
2
2
|
import Schema from 'async-validator';
|
|
3
|
-
import { shallowRef,
|
|
3
|
+
import { shallowRef, computed, toValue, watch, ref, toRaw, watchEffect, isRef, nextTick } from 'vue';
|
|
4
4
|
import axios, { AxiosError } from 'axios';
|
|
5
5
|
import * as changeCase from 'change-case';
|
|
6
6
|
import Cookie from 'universal-cookie';
|
|
@@ -24,7 +24,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
24
24
|
const valueRef = toRef(value);
|
|
25
25
|
const errorInfo = shallowRef(null);
|
|
26
26
|
const isFinished = shallowRef(true);
|
|
27
|
-
const pass =
|
|
27
|
+
const pass = shallowRef(!immediate || manual);
|
|
28
28
|
const errors = computed(() => {
|
|
29
29
|
var _a;
|
|
30
30
|
return ((_a = errorInfo.value) == null ? void 0 : _a.errors) || [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vueuse/integrations",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.8.0",
|
|
5
5
|
"description": "Integration wrappers for utility libraries",
|
|
6
6
|
"author": "Anthony Fu <https://github.com/antfu>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -155,17 +155,17 @@
|
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
157
|
"vue": "^3.5.13",
|
|
158
|
-
"@vueuse/
|
|
159
|
-
"@vueuse/
|
|
158
|
+
"@vueuse/core": "12.8.0",
|
|
159
|
+
"@vueuse/shared": "12.8.0"
|
|
160
160
|
},
|
|
161
161
|
"devDependencies": {
|
|
162
162
|
"@types/nprogress": "^0.2.3",
|
|
163
163
|
"@types/qrcode": "^1.5.5",
|
|
164
164
|
"@types/sortablejs": "^1.15.8",
|
|
165
165
|
"async-validator": "^4.2.5",
|
|
166
|
-
"axios": "^1.
|
|
166
|
+
"axios": "^1.8.1",
|
|
167
167
|
"change-case": "^5.4.4",
|
|
168
|
-
"drauu": "^0.4.
|
|
168
|
+
"drauu": "^0.4.3",
|
|
169
169
|
"focus-trap": "^7.6.4",
|
|
170
170
|
"fuse.js": "^7.1.0",
|
|
171
171
|
"idb-keyval": "^6.2.1",
|
|
@@ -14,7 +14,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
14
14
|
const valueRef = shared.toRef(value);
|
|
15
15
|
const errorInfo = vue.shallowRef(null);
|
|
16
16
|
const isFinished = vue.shallowRef(true);
|
|
17
|
-
const pass = vue.
|
|
17
|
+
const pass = vue.shallowRef(!immediate || manual);
|
|
18
18
|
const errors = vue.computed(() => errorInfo.value?.errors || []);
|
|
19
19
|
const errorFields = vue.computed(() => errorInfo.value?.fields || {});
|
|
20
20
|
const validator = vue.computed(() => new AsyncValidatorSchema(vue.toValue(rules)));
|
|
@@ -65,7 +65,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
const UseAsyncValidator = /* @__PURE__ */
|
|
68
|
+
const UseAsyncValidator = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
69
69
|
name: "UseAsyncValidator",
|
|
70
70
|
props: {
|
|
71
71
|
form: {
|
|
@@ -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
|
|
|
@@ -12,7 +12,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
12
12
|
const valueRef = toRef(value);
|
|
13
13
|
const errorInfo = shallowRef(null);
|
|
14
14
|
const isFinished = shallowRef(true);
|
|
15
|
-
const pass =
|
|
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
|
@@ -14,7 +14,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
14
14
|
const valueRef = shared.toRef(value);
|
|
15
15
|
const errorInfo = vue.shallowRef(null);
|
|
16
16
|
const isFinished = vue.shallowRef(true);
|
|
17
|
-
const pass = vue.
|
|
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 {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const valueRef = shared.toRef(value);
|
|
12
12
|
const errorInfo = vue.shallowRef(null);
|
|
13
13
|
const isFinished = vue.shallowRef(true);
|
|
14
|
-
const pass = vue.
|
|
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 = {}) {
|
|
@@ -12,7 +12,7 @@ function useAsyncValidator(value, rules, options = {}) {
|
|
|
12
12
|
const valueRef = toRef(value);
|
|
13
13
|
const errorInfo = shallowRef(null);
|
|
14
14
|
const isFinished = shallowRef(true);
|
|
15
|
-
const pass =
|
|
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/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/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;
|
|
@@ -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.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/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.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
|
/**
|
package/useIDBKeyval.d.mts
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
|
/**
|
package/useIDBKeyval.d.ts
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
|
/**
|
package/useJwt.d.cts
CHANGED
package/useJwt.d.mts
CHANGED
package/useJwt.d.ts
CHANGED
package/useNProgress.d.cts
CHANGED
package/useNProgress.d.mts
CHANGED
package/useNProgress.d.ts
CHANGED
package/useQRCode.d.cts
CHANGED
package/useQRCode.d.mts
CHANGED
package/useQRCode.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ function moveArrayElement(list, from, to, e = null) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const UseSortable = /* @__PURE__ */
|
|
64
|
+
const UseSortable = /* @__PURE__ */ /*@__PURE__*/ vue.defineComponent({
|
|
65
65
|
name: "UseSortable",
|
|
66
66
|
props: {
|
|
67
67
|
modelValue: {
|
|
@@ -59,7 +59,7 @@ function moveArrayElement(list, from, to, e = null) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
const UseSortable = /* @__PURE__ */
|
|
62
|
+
const UseSortable = /* @__PURE__ */ /*@__PURE__*/ defineComponent({
|
|
63
63
|
name: "UseSortable",
|
|
64
64
|
props: {
|
|
65
65
|
modelValue: {
|
package/useSortable.d.cts
CHANGED
package/useSortable.d.mts
CHANGED
package/useSortable.d.ts
CHANGED