vee-validate 4.9.3 → 4.9.5
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/vee-validate.d.ts +269 -199
- package/dist/vee-validate.esm.js +23 -10
- package/dist/vee-validate.js +21 -8
- package/dist/vee-validate.min.js +2 -2
- package/package.json +2 -2
package/dist/vee-validate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { Ref, ComputedRef,
|
|
2
|
+
import { Ref, ComputedRef, VNode, PropType, UnwrapRef, InjectionKey } from 'vue';
|
|
3
3
|
import { PartialDeep } from 'type-fest';
|
|
4
4
|
|
|
5
5
|
type BrowserNativeObject = Date | FileList | File;
|
|
@@ -448,17 +448,23 @@ type RuleExpression<TValue> = string | Record<string, unknown> | GenericValidate
|
|
|
448
448
|
*/
|
|
449
449
|
declare function useField<TValue = unknown>(path: MaybeRefOrLazy<string>, rules?: MaybeRef<RuleExpression<TValue>>, opts?: Partial<FieldOptions<TValue>>): FieldContext<TValue>;
|
|
450
450
|
|
|
451
|
-
interface
|
|
451
|
+
interface SharedBindingObject<TValue = any> {
|
|
452
452
|
name: string;
|
|
453
453
|
onBlur: (e: Event) => void;
|
|
454
454
|
onInput: (e: Event) => void;
|
|
455
455
|
onChange: (e: Event) => void;
|
|
456
456
|
'onUpdate:modelValue'?: ((e: TValue) => unknown) | undefined;
|
|
457
|
+
}
|
|
458
|
+
interface FieldBindingObject<TValue = any> extends SharedBindingObject<TValue> {
|
|
457
459
|
value?: TValue;
|
|
458
460
|
checked?: boolean;
|
|
459
461
|
}
|
|
462
|
+
interface ComponentFieldBindingObject<TValue = any> extends SharedBindingObject<TValue> {
|
|
463
|
+
modelValue?: TValue;
|
|
464
|
+
}
|
|
460
465
|
interface FieldSlotProps<TValue = unknown> extends Pick<FieldContext, 'validate' | 'resetField' | 'handleChange' | 'handleReset' | 'handleBlur' | 'setTouched' | 'setErrors'> {
|
|
461
466
|
field: FieldBindingObject<TValue>;
|
|
467
|
+
componentField: ComponentFieldBindingObject<TValue>;
|
|
462
468
|
value: TValue;
|
|
463
469
|
meta: FieldMeta<TValue>;
|
|
464
470
|
errors: string[];
|
|
@@ -469,88 +475,68 @@ declare const Field: {
|
|
|
469
475
|
new (...args: any[]): {
|
|
470
476
|
$: vue.ComponentInternalInstance;
|
|
471
477
|
$data: {};
|
|
472
|
-
$props:
|
|
473
|
-
label
|
|
474
|
-
as
|
|
475
|
-
bails
|
|
476
|
-
uncheckedValue
|
|
477
|
-
validateOnInput
|
|
478
|
-
validateOnChange
|
|
479
|
-
validateOnBlur
|
|
480
|
-
validateOnModelUpdate
|
|
481
|
-
modelValue
|
|
482
|
-
validateOnMount
|
|
483
|
-
standalone
|
|
484
|
-
modelModifiers
|
|
485
|
-
rules
|
|
486
|
-
'onUpdate:modelValue'
|
|
487
|
-
keepValue
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
type: any;
|
|
535
|
-
default: any;
|
|
536
|
-
};
|
|
537
|
-
modelModifiers: {
|
|
538
|
-
type: any;
|
|
539
|
-
default: () => {};
|
|
540
|
-
};
|
|
541
|
-
'onUpdate:modelValue': {
|
|
542
|
-
type: PropType<(e: any) => unknown>;
|
|
543
|
-
default: any;
|
|
544
|
-
};
|
|
545
|
-
standalone: {
|
|
546
|
-
type: BooleanConstructor;
|
|
547
|
-
default: boolean;
|
|
548
|
-
};
|
|
549
|
-
keepValue: {
|
|
550
|
-
type: BooleanConstructor;
|
|
551
|
-
default: any;
|
|
552
|
-
};
|
|
553
|
-
}>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "label" | "as" | "bails" | "uncheckedValue" | "validateOnInput" | "validateOnChange" | "validateOnBlur" | "validateOnModelUpdate" | "modelValue" | "validateOnMount" | "standalone" | "modelModifiers" | "rules" | "onUpdate:modelValue" | "keepValue">;
|
|
478
|
+
$props: {
|
|
479
|
+
label?: string;
|
|
480
|
+
as?: string | Record<string, any>;
|
|
481
|
+
bails?: boolean;
|
|
482
|
+
uncheckedValue?: any;
|
|
483
|
+
validateOnInput?: boolean;
|
|
484
|
+
validateOnChange?: boolean;
|
|
485
|
+
validateOnBlur?: boolean;
|
|
486
|
+
validateOnModelUpdate?: boolean;
|
|
487
|
+
modelValue?: any;
|
|
488
|
+
validateOnMount?: boolean;
|
|
489
|
+
standalone?: boolean;
|
|
490
|
+
modelModifiers?: any;
|
|
491
|
+
rules?: RuleExpression<unknown>;
|
|
492
|
+
'onUpdate:modelValue'?: (e: any) => unknown;
|
|
493
|
+
keepValue?: boolean;
|
|
494
|
+
key?: string | number | symbol;
|
|
495
|
+
readonly name: string;
|
|
496
|
+
style?: unknown;
|
|
497
|
+
class?: unknown;
|
|
498
|
+
ref?: vue.VNodeRef;
|
|
499
|
+
ref_for?: boolean;
|
|
500
|
+
ref_key?: string;
|
|
501
|
+
onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
502
|
+
[key: string]: any;
|
|
503
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
504
|
+
[key: string]: any;
|
|
505
|
+
}>) => void)[];
|
|
506
|
+
onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
507
|
+
[key: string]: any;
|
|
508
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
509
|
+
[key: string]: any;
|
|
510
|
+
}>) => void)[];
|
|
511
|
+
onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
512
|
+
[key: string]: any;
|
|
513
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
514
|
+
[key: string]: any;
|
|
515
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
516
|
+
[key: string]: any;
|
|
517
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
518
|
+
[key: string]: any;
|
|
519
|
+
}>) => void)[];
|
|
520
|
+
onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
521
|
+
[key: string]: any;
|
|
522
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
523
|
+
[key: string]: any;
|
|
524
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
525
|
+
[key: string]: any;
|
|
526
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
527
|
+
[key: string]: any;
|
|
528
|
+
}>) => void)[];
|
|
529
|
+
onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
530
|
+
[key: string]: any;
|
|
531
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
532
|
+
[key: string]: any;
|
|
533
|
+
}>) => void)[];
|
|
534
|
+
onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
535
|
+
[key: string]: any;
|
|
536
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
537
|
+
[key: string]: any;
|
|
538
|
+
}>) => void)[];
|
|
539
|
+
};
|
|
554
540
|
$attrs: {
|
|
555
541
|
[x: string]: unknown;
|
|
556
542
|
};
|
|
@@ -558,10 +544,10 @@ declare const Field: {
|
|
|
558
544
|
[x: string]: unknown;
|
|
559
545
|
};
|
|
560
546
|
$slots: Readonly<{
|
|
561
|
-
[name: string]: vue.Slot
|
|
547
|
+
[name: string]: vue.Slot<any>;
|
|
562
548
|
}>;
|
|
563
|
-
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
564
|
-
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
549
|
+
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
550
|
+
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
565
551
|
$emit: (event: string, ...args: any[]) => void;
|
|
566
552
|
$el: any;
|
|
567
553
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<{
|
|
@@ -631,9 +617,9 @@ declare const Field: {
|
|
|
631
617
|
};
|
|
632
618
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
633
619
|
[key: string]: any;
|
|
634
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
620
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
635
621
|
[key: string]: any;
|
|
636
|
-
}>[] |
|
|
622
|
+
}>[] | {
|
|
637
623
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
638
624
|
[key: string]: any;
|
|
639
625
|
}>[];
|
|
@@ -653,7 +639,7 @@ declare const Field: {
|
|
|
653
639
|
rules: RuleExpression<unknown>;
|
|
654
640
|
'onUpdate:modelValue': (e: any) => unknown;
|
|
655
641
|
keepValue: boolean;
|
|
656
|
-
}, {}, string> & {
|
|
642
|
+
}, {}, string, {}> & {
|
|
657
643
|
beforeCreate?: (() => void) | (() => void)[];
|
|
658
644
|
created?: (() => void) | (() => void)[];
|
|
659
645
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -668,7 +654,7 @@ declare const Field: {
|
|
|
668
654
|
unmounted?: (() => void) | (() => void)[];
|
|
669
655
|
renderTracked?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
670
656
|
renderTriggered?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
671
|
-
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
|
|
657
|
+
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void)[];
|
|
672
658
|
};
|
|
673
659
|
$forceUpdate: () => void;
|
|
674
660
|
$nextTick: typeof vue.nextTick;
|
|
@@ -740,9 +726,9 @@ declare const Field: {
|
|
|
740
726
|
};
|
|
741
727
|
}>> & vue.ShallowUnwrapRef<() => VNode<vue.RendererNode, vue.RendererElement, {
|
|
742
728
|
[key: string]: any;
|
|
743
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
729
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
744
730
|
[key: string]: any;
|
|
745
|
-
}>[] |
|
|
731
|
+
}>[] | {
|
|
746
732
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
747
733
|
[key: string]: any;
|
|
748
734
|
}>[];
|
|
@@ -817,9 +803,9 @@ declare const Field: {
|
|
|
817
803
|
};
|
|
818
804
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
819
805
|
[key: string]: any;
|
|
820
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
806
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
821
807
|
[key: string]: any;
|
|
822
|
-
}>[] |
|
|
808
|
+
}>[] | {
|
|
823
809
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
824
810
|
[key: string]: any;
|
|
825
811
|
}>[];
|
|
@@ -839,7 +825,7 @@ declare const Field: {
|
|
|
839
825
|
rules: RuleExpression<unknown>;
|
|
840
826
|
'onUpdate:modelValue': (e: any) => unknown;
|
|
841
827
|
keepValue: boolean;
|
|
842
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
828
|
+
}, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
843
829
|
setErrors: FieldContext['setErrors'];
|
|
844
830
|
setTouched: FieldContext['setTouched'];
|
|
845
831
|
reset: FieldContext['resetField'];
|
|
@@ -861,54 +847,61 @@ declare const Form: {
|
|
|
861
847
|
new (...args: any[]): {
|
|
862
848
|
$: vue.ComponentInternalInstance;
|
|
863
849
|
$data: {};
|
|
864
|
-
$props:
|
|
865
|
-
onSubmit
|
|
866
|
-
as
|
|
867
|
-
initialValues
|
|
868
|
-
validateOnMount
|
|
869
|
-
validationSchema
|
|
870
|
-
initialErrors
|
|
871
|
-
initialTouched
|
|
872
|
-
onInvalidSubmit
|
|
873
|
-
keepValues
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
};
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
|
|
850
|
+
$props: {
|
|
851
|
+
onSubmit?: SubmissionHandler;
|
|
852
|
+
as?: string;
|
|
853
|
+
initialValues?: Record<string, any>;
|
|
854
|
+
validateOnMount?: boolean;
|
|
855
|
+
validationSchema?: Record<string, any>;
|
|
856
|
+
initialErrors?: Record<string, any>;
|
|
857
|
+
initialTouched?: Record<string, any>;
|
|
858
|
+
onInvalidSubmit?: InvalidSubmissionHandler;
|
|
859
|
+
keepValues?: boolean;
|
|
860
|
+
key?: string | number | symbol;
|
|
861
|
+
style?: unknown;
|
|
862
|
+
class?: unknown;
|
|
863
|
+
ref?: vue.VNodeRef;
|
|
864
|
+
ref_for?: boolean;
|
|
865
|
+
ref_key?: string;
|
|
866
|
+
onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
867
|
+
[key: string]: any;
|
|
868
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
869
|
+
[key: string]: any;
|
|
870
|
+
}>) => void)[];
|
|
871
|
+
onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
872
|
+
[key: string]: any;
|
|
873
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
874
|
+
[key: string]: any;
|
|
875
|
+
}>) => void)[];
|
|
876
|
+
onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
877
|
+
[key: string]: any;
|
|
878
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
879
|
+
[key: string]: any;
|
|
880
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
881
|
+
[key: string]: any;
|
|
882
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
883
|
+
[key: string]: any;
|
|
884
|
+
}>) => void)[];
|
|
885
|
+
onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
886
|
+
[key: string]: any;
|
|
887
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
888
|
+
[key: string]: any;
|
|
889
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
890
|
+
[key: string]: any;
|
|
891
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
892
|
+
[key: string]: any;
|
|
893
|
+
}>) => void)[];
|
|
894
|
+
onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
895
|
+
[key: string]: any;
|
|
896
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
897
|
+
[key: string]: any;
|
|
898
|
+
}>) => void)[];
|
|
899
|
+
onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
900
|
+
[key: string]: any;
|
|
901
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
902
|
+
[key: string]: any;
|
|
903
|
+
}>) => void)[];
|
|
904
|
+
};
|
|
912
905
|
$attrs: {
|
|
913
906
|
[x: string]: unknown;
|
|
914
907
|
};
|
|
@@ -916,10 +909,10 @@ declare const Form: {
|
|
|
916
909
|
[x: string]: unknown;
|
|
917
910
|
};
|
|
918
911
|
$slots: Readonly<{
|
|
919
|
-
[name: string]: vue.Slot
|
|
912
|
+
[name: string]: vue.Slot<any>;
|
|
920
913
|
}>;
|
|
921
|
-
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
922
|
-
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
914
|
+
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
915
|
+
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
923
916
|
$emit: (event: string, ...args: any[]) => void;
|
|
924
917
|
$el: any;
|
|
925
918
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<{
|
|
@@ -961,9 +954,9 @@ declare const Form: {
|
|
|
961
954
|
};
|
|
962
955
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
963
956
|
[key: string]: any;
|
|
964
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
957
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
965
958
|
[key: string]: any;
|
|
966
|
-
}>[] |
|
|
959
|
+
}>[] | {
|
|
967
960
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
968
961
|
[key: string]: any;
|
|
969
962
|
}>[];
|
|
@@ -977,7 +970,7 @@ declare const Form: {
|
|
|
977
970
|
initialTouched: Record<string, any>;
|
|
978
971
|
onInvalidSubmit: InvalidSubmissionHandler;
|
|
979
972
|
keepValues: boolean;
|
|
980
|
-
}, {}, string> & {
|
|
973
|
+
}, {}, string, {}> & {
|
|
981
974
|
beforeCreate?: (() => void) | (() => void)[];
|
|
982
975
|
created?: (() => void) | (() => void)[];
|
|
983
976
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -992,7 +985,7 @@ declare const Form: {
|
|
|
992
985
|
unmounted?: (() => void) | (() => void)[];
|
|
993
986
|
renderTracked?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
994
987
|
renderTriggered?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
995
|
-
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
|
|
988
|
+
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void)[];
|
|
996
989
|
};
|
|
997
990
|
$forceUpdate: () => void;
|
|
998
991
|
$nextTick: typeof vue.nextTick;
|
|
@@ -1036,9 +1029,9 @@ declare const Form: {
|
|
|
1036
1029
|
};
|
|
1037
1030
|
}>> & vue.ShallowUnwrapRef<() => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1038
1031
|
[key: string]: any;
|
|
1039
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1032
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1040
1033
|
[key: string]: any;
|
|
1041
|
-
}>[] |
|
|
1034
|
+
}>[] | {
|
|
1042
1035
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1043
1036
|
[key: string]: any;
|
|
1044
1037
|
}>[];
|
|
@@ -1085,9 +1078,9 @@ declare const Form: {
|
|
|
1085
1078
|
};
|
|
1086
1079
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1087
1080
|
[key: string]: any;
|
|
1088
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1081
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1089
1082
|
[key: string]: any;
|
|
1090
|
-
}>[] |
|
|
1083
|
+
}>[] | {
|
|
1091
1084
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1092
1085
|
[key: string]: any;
|
|
1093
1086
|
}>[];
|
|
@@ -1101,7 +1094,7 @@ declare const Form: {
|
|
|
1101
1094
|
initialTouched: Record<string, any>;
|
|
1102
1095
|
onInvalidSubmit: InvalidSubmissionHandler;
|
|
1103
1096
|
keepValues: boolean;
|
|
1104
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1097
|
+
}, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1105
1098
|
setFieldError: FormContext['setFieldError'];
|
|
1106
1099
|
setErrors: FormContext['setErrors'];
|
|
1107
1100
|
setFieldValue: FormContext['setFieldValue'];
|
|
@@ -1124,12 +1117,53 @@ declare const FieldArray: {
|
|
|
1124
1117
|
new (...args: any[]): {
|
|
1125
1118
|
$: vue.ComponentInternalInstance;
|
|
1126
1119
|
$data: {};
|
|
1127
|
-
$props:
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1120
|
+
$props: {
|
|
1121
|
+
key?: string | number | symbol;
|
|
1122
|
+
readonly name: string;
|
|
1123
|
+
style?: unknown;
|
|
1124
|
+
class?: unknown;
|
|
1125
|
+
ref?: vue.VNodeRef;
|
|
1126
|
+
ref_for?: boolean;
|
|
1127
|
+
ref_key?: string;
|
|
1128
|
+
onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1129
|
+
[key: string]: any;
|
|
1130
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1131
|
+
[key: string]: any;
|
|
1132
|
+
}>) => void)[];
|
|
1133
|
+
onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1134
|
+
[key: string]: any;
|
|
1135
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1136
|
+
[key: string]: any;
|
|
1137
|
+
}>) => void)[];
|
|
1138
|
+
onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1139
|
+
[key: string]: any;
|
|
1140
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1141
|
+
[key: string]: any;
|
|
1142
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1143
|
+
[key: string]: any;
|
|
1144
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1145
|
+
[key: string]: any;
|
|
1146
|
+
}>) => void)[];
|
|
1147
|
+
onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1148
|
+
[key: string]: any;
|
|
1149
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1150
|
+
[key: string]: any;
|
|
1151
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1152
|
+
[key: string]: any;
|
|
1153
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1154
|
+
[key: string]: any;
|
|
1155
|
+
}>) => void)[];
|
|
1156
|
+
onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1157
|
+
[key: string]: any;
|
|
1158
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1159
|
+
[key: string]: any;
|
|
1160
|
+
}>) => void)[];
|
|
1161
|
+
onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1162
|
+
[key: string]: any;
|
|
1163
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1164
|
+
[key: string]: any;
|
|
1165
|
+
}>) => void)[];
|
|
1166
|
+
};
|
|
1133
1167
|
$attrs: {
|
|
1134
1168
|
[x: string]: unknown;
|
|
1135
1169
|
};
|
|
@@ -1137,10 +1171,10 @@ declare const FieldArray: {
|
|
|
1137
1171
|
[x: string]: unknown;
|
|
1138
1172
|
};
|
|
1139
1173
|
$slots: Readonly<{
|
|
1140
|
-
[name: string]: vue.Slot
|
|
1174
|
+
[name: string]: vue.Slot<any>;
|
|
1141
1175
|
}>;
|
|
1142
|
-
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
1143
|
-
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
1176
|
+
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
1177
|
+
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
1144
1178
|
$emit: (event: string, ...args: any[]) => void;
|
|
1145
1179
|
$el: any;
|
|
1146
1180
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<{
|
|
@@ -1148,13 +1182,13 @@ declare const FieldArray: {
|
|
|
1148
1182
|
type: StringConstructor;
|
|
1149
1183
|
required: true;
|
|
1150
1184
|
};
|
|
1151
|
-
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1185
|
+
}>>, () => vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1152
1186
|
[key: string]: any;
|
|
1153
|
-
}>[] |
|
|
1187
|
+
}>[] | {
|
|
1154
1188
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1155
1189
|
[key: string]: any;
|
|
1156
1190
|
}>[];
|
|
1157
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string> & {
|
|
1191
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}> & {
|
|
1158
1192
|
beforeCreate?: (() => void) | (() => void)[];
|
|
1159
1193
|
created?: (() => void) | (() => void)[];
|
|
1160
1194
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -1169,7 +1203,7 @@ declare const FieldArray: {
|
|
|
1169
1203
|
unmounted?: (() => void) | (() => void)[];
|
|
1170
1204
|
renderTracked?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
1171
1205
|
renderTriggered?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
1172
|
-
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
|
|
1206
|
+
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void)[];
|
|
1173
1207
|
};
|
|
1174
1208
|
$forceUpdate: () => void;
|
|
1175
1209
|
$nextTick: typeof vue.nextTick;
|
|
@@ -1179,9 +1213,9 @@ declare const FieldArray: {
|
|
|
1179
1213
|
type: StringConstructor;
|
|
1180
1214
|
required: true;
|
|
1181
1215
|
};
|
|
1182
|
-
}>> & vue.ShallowUnwrapRef<() => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1216
|
+
}>> & vue.ShallowUnwrapRef<() => vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1183
1217
|
[key: string]: any;
|
|
1184
|
-
}>[] |
|
|
1218
|
+
}>[] | {
|
|
1185
1219
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1186
1220
|
[key: string]: any;
|
|
1187
1221
|
}>[];
|
|
@@ -1194,13 +1228,13 @@ declare const FieldArray: {
|
|
|
1194
1228
|
type: StringConstructor;
|
|
1195
1229
|
required: true;
|
|
1196
1230
|
};
|
|
1197
|
-
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1231
|
+
}>>, () => vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1198
1232
|
[key: string]: any;
|
|
1199
|
-
}>[] |
|
|
1233
|
+
}>[] | {
|
|
1200
1234
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1201
1235
|
[key: string]: any;
|
|
1202
1236
|
}>[];
|
|
1203
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1237
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1204
1238
|
push: FieldArrayContext['push'];
|
|
1205
1239
|
remove: FieldArrayContext['remove'];
|
|
1206
1240
|
swap: FieldArrayContext['swap'];
|
|
@@ -1221,18 +1255,54 @@ declare const ErrorMessage: {
|
|
|
1221
1255
|
new (...args: any[]): {
|
|
1222
1256
|
$: vue.ComponentInternalInstance;
|
|
1223
1257
|
$data: {};
|
|
1224
|
-
$props:
|
|
1225
|
-
as
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1258
|
+
$props: {
|
|
1259
|
+
as?: string;
|
|
1260
|
+
key?: string | number | symbol;
|
|
1261
|
+
readonly name: string;
|
|
1262
|
+
style?: unknown;
|
|
1263
|
+
class?: unknown;
|
|
1264
|
+
ref?: vue.VNodeRef;
|
|
1265
|
+
ref_for?: boolean;
|
|
1266
|
+
ref_key?: string;
|
|
1267
|
+
onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1268
|
+
[key: string]: any;
|
|
1269
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1270
|
+
[key: string]: any;
|
|
1271
|
+
}>) => void)[];
|
|
1272
|
+
onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1273
|
+
[key: string]: any;
|
|
1274
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1275
|
+
[key: string]: any;
|
|
1276
|
+
}>) => void)[];
|
|
1277
|
+
onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1278
|
+
[key: string]: any;
|
|
1279
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1280
|
+
[key: string]: any;
|
|
1281
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1282
|
+
[key: string]: any;
|
|
1283
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1284
|
+
[key: string]: any;
|
|
1285
|
+
}>) => void)[];
|
|
1286
|
+
onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1287
|
+
[key: string]: any;
|
|
1288
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1289
|
+
[key: string]: any;
|
|
1290
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1291
|
+
[key: string]: any;
|
|
1292
|
+
}>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1293
|
+
[key: string]: any;
|
|
1294
|
+
}>) => void)[];
|
|
1295
|
+
onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1296
|
+
[key: string]: any;
|
|
1297
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1298
|
+
[key: string]: any;
|
|
1299
|
+
}>) => void)[];
|
|
1300
|
+
onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1301
|
+
[key: string]: any;
|
|
1302
|
+
}>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
|
|
1303
|
+
[key: string]: any;
|
|
1304
|
+
}>) => void)[];
|
|
1305
|
+
};
|
|
1236
1306
|
$attrs: {
|
|
1237
1307
|
[x: string]: unknown;
|
|
1238
1308
|
};
|
|
@@ -1240,10 +1310,10 @@ declare const ErrorMessage: {
|
|
|
1240
1310
|
[x: string]: unknown;
|
|
1241
1311
|
};
|
|
1242
1312
|
$slots: Readonly<{
|
|
1243
|
-
[name: string]: vue.Slot
|
|
1313
|
+
[name: string]: vue.Slot<any>;
|
|
1244
1314
|
}>;
|
|
1245
|
-
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
1246
|
-
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
|
|
1315
|
+
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
1316
|
+
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
|
1247
1317
|
$emit: (event: string, ...args: any[]) => void;
|
|
1248
1318
|
$el: any;
|
|
1249
1319
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<{
|
|
@@ -1257,15 +1327,15 @@ declare const ErrorMessage: {
|
|
|
1257
1327
|
};
|
|
1258
1328
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1259
1329
|
[key: string]: any;
|
|
1260
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1330
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1261
1331
|
[key: string]: any;
|
|
1262
|
-
}>[] |
|
|
1332
|
+
}>[] | {
|
|
1263
1333
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1264
1334
|
[key: string]: any;
|
|
1265
1335
|
}>[];
|
|
1266
1336
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
|
|
1267
1337
|
as: string;
|
|
1268
|
-
}, {}, string> & {
|
|
1338
|
+
}, {}, string, {}> & {
|
|
1269
1339
|
beforeCreate?: (() => void) | (() => void)[];
|
|
1270
1340
|
created?: (() => void) | (() => void)[];
|
|
1271
1341
|
beforeMount?: (() => void) | (() => void)[];
|
|
@@ -1280,7 +1350,7 @@ declare const ErrorMessage: {
|
|
|
1280
1350
|
unmounted?: (() => void) | (() => void)[];
|
|
1281
1351
|
renderTracked?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
1282
1352
|
renderTriggered?: ((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[];
|
|
1283
|
-
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
|
|
1353
|
+
errorCaptured?: ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>, info: string) => boolean | void)[];
|
|
1284
1354
|
};
|
|
1285
1355
|
$forceUpdate: () => void;
|
|
1286
1356
|
$nextTick: typeof vue.nextTick;
|
|
@@ -1296,9 +1366,9 @@ declare const ErrorMessage: {
|
|
|
1296
1366
|
};
|
|
1297
1367
|
}>> & vue.ShallowUnwrapRef<() => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1298
1368
|
[key: string]: any;
|
|
1299
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1369
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1300
1370
|
[key: string]: any;
|
|
1301
|
-
}>[] |
|
|
1371
|
+
}>[] | {
|
|
1302
1372
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1303
1373
|
[key: string]: any;
|
|
1304
1374
|
}>[];
|
|
@@ -1317,15 +1387,15 @@ declare const ErrorMessage: {
|
|
|
1317
1387
|
};
|
|
1318
1388
|
}>>, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1319
1389
|
[key: string]: any;
|
|
1320
|
-
}> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1390
|
+
}> | vue.Slot<any> | VNode<vue.RendererNode, vue.RendererElement, {
|
|
1321
1391
|
[key: string]: any;
|
|
1322
|
-
}>[] |
|
|
1392
|
+
}>[] | {
|
|
1323
1393
|
default: () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
1324
1394
|
[key: string]: any;
|
|
1325
1395
|
}>[];
|
|
1326
1396
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {
|
|
1327
1397
|
as: string;
|
|
1328
|
-
}, {}, string> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1398
|
+
}, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1329
1399
|
$slots: {
|
|
1330
1400
|
default: (arg: ErrorMessageSlotProps) => VNode[];
|
|
1331
1401
|
};
|
|
@@ -1334,7 +1404,7 @@ declare const ErrorMessage: {
|
|
|
1334
1404
|
type FormSchema<TValues extends Record<string, unknown>> = FlattenAndSetPathsType<TValues, GenericValidateFunction | string | GenericObject> | undefined;
|
|
1335
1405
|
interface FormOptions<TValues extends GenericObject, TOutput = TValues, TSchema extends TypedSchema<TValues, TOutput> | FormSchema<TValues> = FormSchema<TValues> | TypedSchema<TValues, TOutput>> {
|
|
1336
1406
|
validationSchema?: MaybeRef<TSchema extends TypedSchema ? TypedSchema<TValues, TOutput> : any>;
|
|
1337
|
-
initialValues?: MaybeRef<PartialDeep<TValues
|
|
1407
|
+
initialValues?: MaybeRef<PartialDeep<TValues> | undefined | null>;
|
|
1338
1408
|
initialErrors?: FlattenAndSetPathsType<TValues, string | undefined>;
|
|
1339
1409
|
initialTouched?: FlattenAndSetPathsType<TValues, boolean>;
|
|
1340
1410
|
validateOnMount?: boolean;
|
package/dist/vee-validate.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vee-validate v4.9.
|
|
2
|
+
* vee-validate v4.9.5
|
|
3
3
|
* (c) 2023 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -1373,11 +1373,11 @@ function encodeNodeId(form, stateOrField) {
|
|
|
1373
1373
|
const type = stateOrField ? ('path' in stateOrField ? 'pathState' : 'field') : 'form';
|
|
1374
1374
|
const fieldPath = stateOrField ? ('path' in stateOrField ? stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.path : unref(stateOrField === null || stateOrField === void 0 ? void 0 : stateOrField.name)) : '';
|
|
1375
1375
|
const idObject = { f: form === null || form === void 0 ? void 0 : form.formId, ff: fieldPath, type };
|
|
1376
|
-
return btoa(JSON.stringify(idObject));
|
|
1376
|
+
return btoa(encodeURIComponent(JSON.stringify(idObject)));
|
|
1377
1377
|
}
|
|
1378
1378
|
function decodeNodeId(nodeId) {
|
|
1379
1379
|
try {
|
|
1380
|
-
const idObject = JSON.parse(atob(nodeId));
|
|
1380
|
+
const idObject = JSON.parse(decodeURIComponent(atob(nodeId)));
|
|
1381
1381
|
const form = DEVTOOLS_FORMS[idObject.f];
|
|
1382
1382
|
if (!form && idObject.ff) {
|
|
1383
1383
|
const field = DEVTOOLS_FIELDS[idObject.ff];
|
|
@@ -1864,7 +1864,7 @@ function getCurrentModelValue(vm, propName) {
|
|
|
1864
1864
|
return vm.props[propName];
|
|
1865
1865
|
}
|
|
1866
1866
|
|
|
1867
|
-
const FieldImpl = defineComponent({
|
|
1867
|
+
const FieldImpl = /** #__PURE__ */ defineComponent({
|
|
1868
1868
|
name: 'Field',
|
|
1869
1869
|
inheritAttrs: false,
|
|
1870
1870
|
props: {
|
|
@@ -1957,7 +1957,7 @@ const FieldImpl = defineComponent({
|
|
|
1957
1957
|
handleChange(e, shouldValidate);
|
|
1958
1958
|
ctx.emit('update:modelValue', value.value);
|
|
1959
1959
|
};
|
|
1960
|
-
const
|
|
1960
|
+
const sharedProps = computed(() => {
|
|
1961
1961
|
const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = resolveValidationTriggers(props);
|
|
1962
1962
|
function baseOnBlur(e) {
|
|
1963
1963
|
handleBlur(e);
|
|
@@ -1987,6 +1987,10 @@ const FieldImpl = defineComponent({
|
|
|
1987
1987
|
onChange: baseOnChange,
|
|
1988
1988
|
};
|
|
1989
1989
|
attrs['onUpdate:modelValue'] = e => onChangeHandler(e, validateOnModelUpdate);
|
|
1990
|
+
return attrs;
|
|
1991
|
+
});
|
|
1992
|
+
const fieldProps = computed(() => {
|
|
1993
|
+
const attrs = Object.assign({}, sharedProps.value);
|
|
1990
1994
|
if (hasCheckedAttr(ctx.attrs.type) && checked) {
|
|
1991
1995
|
attrs.checked = checked.value;
|
|
1992
1996
|
}
|
|
@@ -1996,9 +2000,13 @@ const FieldImpl = defineComponent({
|
|
|
1996
2000
|
}
|
|
1997
2001
|
return attrs;
|
|
1998
2002
|
});
|
|
2003
|
+
const componentProps = computed(() => {
|
|
2004
|
+
return Object.assign(Object.assign({}, sharedProps.value), { modelValue: value.value });
|
|
2005
|
+
});
|
|
1999
2006
|
function slotProps() {
|
|
2000
2007
|
return {
|
|
2001
2008
|
field: fieldProps.value,
|
|
2009
|
+
componentField: componentProps.value,
|
|
2002
2010
|
value: value.value,
|
|
2003
2011
|
meta,
|
|
2004
2012
|
errors: errors.value,
|
|
@@ -2090,10 +2098,13 @@ function useForm(opts) {
|
|
|
2090
2098
|
function setFieldError(field, message) {
|
|
2091
2099
|
const state = findPathState(field);
|
|
2092
2100
|
if (!state) {
|
|
2093
|
-
|
|
2101
|
+
if (typeof field === 'string') {
|
|
2102
|
+
extraErrorsBag.value[field] = normalizeErrorItem(message);
|
|
2103
|
+
}
|
|
2094
2104
|
return;
|
|
2095
2105
|
}
|
|
2096
2106
|
state.errors = normalizeErrorItem(message);
|
|
2107
|
+
state.valid = !state.errors.length;
|
|
2097
2108
|
}
|
|
2098
2109
|
/**
|
|
2099
2110
|
* Sets errors for the fields specified in the object
|
|
@@ -2795,7 +2806,9 @@ function useFormInitialValues(pathsState, formValues, opts) {
|
|
|
2795
2806
|
}
|
|
2796
2807
|
if (isRef(providedValues)) {
|
|
2797
2808
|
watch(providedValues, value => {
|
|
2798
|
-
|
|
2809
|
+
if (value) {
|
|
2810
|
+
setInitialValues(value, true);
|
|
2811
|
+
}
|
|
2799
2812
|
}, {
|
|
2800
2813
|
deep: true,
|
|
2801
2814
|
});
|
|
@@ -2807,7 +2820,7 @@ function useFormInitialValues(pathsState, formValues, opts) {
|
|
|
2807
2820
|
};
|
|
2808
2821
|
}
|
|
2809
2822
|
|
|
2810
|
-
const FormImpl = defineComponent({
|
|
2823
|
+
const FormImpl = /** #__PURE__ */ defineComponent({
|
|
2811
2824
|
name: 'Form',
|
|
2812
2825
|
inheritAttrs: false,
|
|
2813
2826
|
props: {
|
|
@@ -3176,7 +3189,7 @@ function useFieldArray(arrayPath) {
|
|
|
3176
3189
|
return fieldArrayCtx;
|
|
3177
3190
|
}
|
|
3178
3191
|
|
|
3179
|
-
const FieldArrayImpl = defineComponent({
|
|
3192
|
+
const FieldArrayImpl = /** #__PURE__ */ defineComponent({
|
|
3180
3193
|
name: 'FieldArray',
|
|
3181
3194
|
inheritAttrs: false,
|
|
3182
3195
|
props: {
|
|
@@ -3218,7 +3231,7 @@ const FieldArrayImpl = defineComponent({
|
|
|
3218
3231
|
});
|
|
3219
3232
|
const FieldArray = FieldArrayImpl;
|
|
3220
3233
|
|
|
3221
|
-
const ErrorMessageImpl = defineComponent({
|
|
3234
|
+
const ErrorMessageImpl = /** #__PURE__ */ defineComponent({
|
|
3222
3235
|
name: 'ErrorMessage',
|
|
3223
3236
|
props: {
|
|
3224
3237
|
as: {
|
package/dist/vee-validate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vee-validate v4.9.
|
|
2
|
+
* vee-validate v4.9.5
|
|
3
3
|
* (c) 2023 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
@@ -1444,7 +1444,7 @@
|
|
|
1444
1444
|
return vm.props[propName];
|
|
1445
1445
|
}
|
|
1446
1446
|
|
|
1447
|
-
const FieldImpl = vue.defineComponent({
|
|
1447
|
+
const FieldImpl = /** #__PURE__ */ vue.defineComponent({
|
|
1448
1448
|
name: 'Field',
|
|
1449
1449
|
inheritAttrs: false,
|
|
1450
1450
|
props: {
|
|
@@ -1537,7 +1537,7 @@
|
|
|
1537
1537
|
handleChange(e, shouldValidate);
|
|
1538
1538
|
ctx.emit('update:modelValue', value.value);
|
|
1539
1539
|
};
|
|
1540
|
-
const
|
|
1540
|
+
const sharedProps = vue.computed(() => {
|
|
1541
1541
|
const { validateOnInput, validateOnChange, validateOnBlur, validateOnModelUpdate } = resolveValidationTriggers(props);
|
|
1542
1542
|
function baseOnBlur(e) {
|
|
1543
1543
|
handleBlur(e);
|
|
@@ -1567,6 +1567,10 @@
|
|
|
1567
1567
|
onChange: baseOnChange,
|
|
1568
1568
|
};
|
|
1569
1569
|
attrs['onUpdate:modelValue'] = e => onChangeHandler(e, validateOnModelUpdate);
|
|
1570
|
+
return attrs;
|
|
1571
|
+
});
|
|
1572
|
+
const fieldProps = vue.computed(() => {
|
|
1573
|
+
const attrs = Object.assign({}, sharedProps.value);
|
|
1570
1574
|
if (hasCheckedAttr(ctx.attrs.type) && checked) {
|
|
1571
1575
|
attrs.checked = checked.value;
|
|
1572
1576
|
}
|
|
@@ -1576,9 +1580,13 @@
|
|
|
1576
1580
|
}
|
|
1577
1581
|
return attrs;
|
|
1578
1582
|
});
|
|
1583
|
+
const componentProps = vue.computed(() => {
|
|
1584
|
+
return Object.assign(Object.assign({}, sharedProps.value), { modelValue: value.value });
|
|
1585
|
+
});
|
|
1579
1586
|
function slotProps() {
|
|
1580
1587
|
return {
|
|
1581
1588
|
field: fieldProps.value,
|
|
1589
|
+
componentField: componentProps.value,
|
|
1582
1590
|
value: value.value,
|
|
1583
1591
|
meta,
|
|
1584
1592
|
errors: errors.value,
|
|
@@ -1670,10 +1678,13 @@
|
|
|
1670
1678
|
function setFieldError(field, message) {
|
|
1671
1679
|
const state = findPathState(field);
|
|
1672
1680
|
if (!state) {
|
|
1673
|
-
|
|
1681
|
+
if (typeof field === 'string') {
|
|
1682
|
+
extraErrorsBag.value[field] = normalizeErrorItem(message);
|
|
1683
|
+
}
|
|
1674
1684
|
return;
|
|
1675
1685
|
}
|
|
1676
1686
|
state.errors = normalizeErrorItem(message);
|
|
1687
|
+
state.valid = !state.errors.length;
|
|
1677
1688
|
}
|
|
1678
1689
|
/**
|
|
1679
1690
|
* Sets errors for the fields specified in the object
|
|
@@ -2369,7 +2380,9 @@
|
|
|
2369
2380
|
}
|
|
2370
2381
|
if (vue.isRef(providedValues)) {
|
|
2371
2382
|
vue.watch(providedValues, value => {
|
|
2372
|
-
|
|
2383
|
+
if (value) {
|
|
2384
|
+
setInitialValues(value, true);
|
|
2385
|
+
}
|
|
2373
2386
|
}, {
|
|
2374
2387
|
deep: true,
|
|
2375
2388
|
});
|
|
@@ -2381,7 +2394,7 @@
|
|
|
2381
2394
|
};
|
|
2382
2395
|
}
|
|
2383
2396
|
|
|
2384
|
-
const FormImpl = vue.defineComponent({
|
|
2397
|
+
const FormImpl = /** #__PURE__ */ vue.defineComponent({
|
|
2385
2398
|
name: 'Form',
|
|
2386
2399
|
inheritAttrs: false,
|
|
2387
2400
|
props: {
|
|
@@ -2750,7 +2763,7 @@
|
|
|
2750
2763
|
return fieldArrayCtx;
|
|
2751
2764
|
}
|
|
2752
2765
|
|
|
2753
|
-
const FieldArrayImpl = vue.defineComponent({
|
|
2766
|
+
const FieldArrayImpl = /** #__PURE__ */ vue.defineComponent({
|
|
2754
2767
|
name: 'FieldArray',
|
|
2755
2768
|
inheritAttrs: false,
|
|
2756
2769
|
props: {
|
|
@@ -2792,7 +2805,7 @@
|
|
|
2792
2805
|
});
|
|
2793
2806
|
const FieldArray = FieldArrayImpl;
|
|
2794
2807
|
|
|
2795
|
-
const ErrorMessageImpl = vue.defineComponent({
|
|
2808
|
+
const ErrorMessageImpl = /** #__PURE__ */ vue.defineComponent({
|
|
2796
2809
|
name: 'ErrorMessage',
|
|
2797
2810
|
props: {
|
|
2798
2811
|
as: {
|
package/dist/vee-validate.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vee-validate v4.9.
|
|
2
|
+
* vee-validate v4.9.5
|
|
3
3
|
* (c) 2023 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidate={},e.Vue)}(this,(function(e,t){"use strict";function n(e){return"function"==typeof e}function r(e){return null==e}const a=e=>null!==e&&!!e&&"object"==typeof e&&!Array.isArray(e);function i(e){return Number(e)>=0}function l(e,t){return Object.keys(t).forEach((n=>{if(a(t[n]))return e[n]||(e[n]={}),void l(e[n],t[n]);e[n]=t[n]})),e}const u={};const o=Symbol("vee-validate-form"),s=Symbol("vee-validate-field-instance"),d=Symbol("Default empty value"),c="undefined"!=typeof window;function v(e){return n(e)&&!!e.__locatorRef}function f(e){return!!e&&n(e.parse)&&"VVTypedSchema"===e.__type}function p(e){return!!e&&n(e.validate)}function m(e){return"checkbox"===e||"radio"===e}function h(e){return/^\[.+\]$/i.test(e)}function y(e){return"SELECT"===e.tagName}function g(e,t){return!function(e,t){const n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return"select"===e&&"multiple"in t&&n}(e,t)&&"file"!==t.type&&!m(t.type)}function b(e){return V(e)&&e.target&&"submit"in e.target}function V(e){return!!e&&(!!("undefined"!=typeof Event&&n(Event)&&e instanceof Event)||!(!e||!e.srcElement))}function O(e,t){return t in e&&e[t]!==d}function F(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!F(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!F(r[1],t.get(r[0])))return!1;return!0}if(A(e)&&A(t))return e.size===t.size&&(e.name===t.name&&(e.lastModified===t.lastModified&&e.type===t.type));if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){var i=a[r];if(!F(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function A(e){return!!c&&e instanceof File}function j(e,t,n){"object"==typeof n.value&&(n.value=w(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function w(e){if("object"!=typeof e)return e;var t,n,r,a=0,i=Object.prototype.toString.call(e);if("[object Object]"===i?r=Object.create(e.__proto__||null):"[object Array]"===i?r=Array(e.length):"[object Set]"===i?(r=new Set,e.forEach((function(e){r.add(w(e))}))):"[object Map]"===i?(r=new Map,e.forEach((function(e,t){r.set(w(t),w(e))}))):"[object Date]"===i?r=new Date(+e):"[object RegExp]"===i?r=new RegExp(e.source,e.flags):"[object DataView]"===i?r=new e.constructor(w(e.buffer)):"[object ArrayBuffer]"===i?r=e.slice(0):"Array]"===i.slice(-6)&&(r=new e.constructor(e)),r){for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)j(r,n[a],Object.getOwnPropertyDescriptor(e,n[a]));for(a=0,n=Object.getOwnPropertyNames(e);a<n.length;a++)Object.hasOwnProperty.call(r,t=n[a])&&r[t]===e[t]||j(r,t,Object.getOwnPropertyDescriptor(e,t))}return r||e}function S(e){return h(e)?e.replace(/\[|\]/gi,""):e}function E(e,t,n){if(!e)return n;if(h(t))return e[S(t)];return(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce(((e,t)=>{return(a(r=e)||Array.isArray(r))&&t in e?e[t]:n;var r}),e)}function k(e,t,n){if(h(t))return void(e[S(t)]=n);const a=t.split(/\.|\[(\d+)\]/).filter(Boolean);let l=e;for(let e=0;e<a.length;e++){if(e===a.length-1)return void(l[a[e]]=n);a[e]in l&&!r(l[a[e]])||(l[a[e]]=i(a[e+1])?[]:{}),l=l[a[e]]}}function I(e,t){Array.isArray(e)&&i(t)?e.splice(Number(t),1):a(e)&&delete e[t]}function C(e,t){if(h(t))return void delete e[S(t)];const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let i=e;for(let e=0;e<n.length;e++){if(e===n.length-1){I(i,n[e]);break}if(!(n[e]in i)||r(i[n[e]]))break;i=i[n[e]]}const l=n.map(((t,r)=>E(e,n.slice(0,r).join("."))));for(let t=l.length-1;t>=0;t--)u=l[t],(Array.isArray(u)?0===u.length:a(u)&&0===Object.keys(u).length)&&(0!==t?I(l[t-1],n[t-1]):I(e,n[0]));var u}function M(e){return Object.keys(e)}function B(e,n=void 0){const r=t.getCurrentInstance();return(null==r?void 0:r.provides[e])||t.inject(e,n)}function _(e){t.warn(`[vee-validate]: ${e}`)}function T(e,t,n){if(Array.isArray(e)){const n=[...e],r=n.findIndex((e=>F(e,t)));return r>=0?n.splice(r,1):n.push(t),n}return F(e,t)?n:t}function U(e,t=0){let n=null,r=[];return function(...a){return n&&window.clearTimeout(n),n=window.setTimeout((()=>{const t=e(...a);r.forEach((e=>e(t))),r=[]}),t),new Promise((e=>r.push(e)))}}function P(e,t){return a(t)&&t.number?function(e){const t=parseFloat(e);return isNaN(t)?e:t}(e):e}function R(e,t){let n;return async function(...r){const a=e(...r);n=a;const i=await a;return a!==n||(n=void 0,t(i,r)),i}}function x({get:e,set:n}){const r=t.ref(w(e()));return t.watch(e,(e=>{F(e,r.value)||(r.value=w(e))}),{deep:!0}),t.watch(r,(t=>{F(t,e())||n(w(t))}),{deep:!0}),r}function N(e){return n(e)?e():t.unref(e)}function $(e){return Array.isArray(e)?e:e?[e]:[]}function D(e){const n=B(o),r=e?t.computed((()=>null==n?void 0:n.getPathState(t.unref(e)))):void 0,a=e?void 0:t.inject(s);return a||(null==r?void 0:r.value)||_(`field with name ${t.unref(e)} was not found`),r||a}function z(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}const q=(e,t,n)=>t.slots.default?"string"!=typeof e&&e?{default:()=>{var e,r;return null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e,n())}}:t.slots.default(n()):t.slots.default;function L(e){if(K(e))return e._value}function K(e){return"_value"in e}function W(e){if(!V(e))return e;const t=e.target;if(m(t.type)&&K(t))return L(t);if("file"===t.type&&t.files){const e=Array.from(t.files);return t.multiple?e:e[0]}if(y(n=t)&&n.multiple)return Array.from(t.options).filter((e=>e.selected&&!e.disabled)).map(L);var n;if(y(t)){const e=Array.from(t.options).find((e=>e.selected));return e?L(e):t.value}return t.value}function G(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?a(e)&&e._$$isNormalized?e:a(e)?Object.keys(e).reduce(((t,n)=>{const r=function(e){if(!0===e)return[];if(Array.isArray(e))return e;if(a(e))return e;return[e]}(e[n]);return!1!==e[n]&&(t[n]=X(r)),t}),t):"string"!=typeof e?t:e.split("|").reduce(((e,t)=>{const n=H(t);return n.name?(e[n.name]=X(n.params),e):e}),t):t}function X(e){const t=e=>"string"==typeof e&&"@"===e[0]?function(e){const t=t=>E(t,e)||t[e];return t.__locatorRef=e,t}(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce(((n,r)=>(n[r]=t(e[r]),n)),{})}const H=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};let J=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const Q=()=>J,Y=e=>{J=Object.assign(Object.assign({},J),e)};async function Z(e,t,r={}){const a=null==r?void 0:r.bails,i={name:(null==r?void 0:r.name)||"{field}",rules:t,label:null==r?void 0:r.label,bails:null==a||a,formData:(null==r?void 0:r.values)||{}},l=await async function(e,t){if(f(e.rules)||p(e.rules))return async function(e,t){const n=f(t)?t:ee(t),r=await n.parse(e),a=[];for(const e of r.errors)e.errors.length&&a.push(...e.errors);return{errors:a}}(t,e.rules);if(n(e.rules)||Array.isArray(e.rules)){const n={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},r=Array.isArray(e.rules)?e.rules:[e.rules],a=r.length,i=[];for(let l=0;l<a;l++){const a=r[l],u=await a(t,n);if("string"!=typeof u&&u)continue;const o="string"==typeof u?u:ne(n);if(i.push(o),e.bails)return{errors:i}}return{errors:i}}const r=Object.assign(Object.assign({},e),{rules:G(e.rules)}),a=[],i=Object.keys(r.rules),l=i.length;for(let n=0;n<l;n++){const l=i[n],u=await te(r,t,{name:l,params:r.rules[l]});if(u.error&&(a.push(u.error),e.bails))return{errors:a}}return{errors:a}}(i,e),u=l.errors;return{errors:u,valid:!u.length}}function ee(e){return{__type:"VVTypedSchema",async parse(t){var n;try{return{output:await e.validate(t,{abortEarly:!1}),errors:[]}}catch(e){if(!function(e){return!!e&&"ValidationError"===e.name}(e))throw e;if(!(null===(n=e.inner)||void 0===n?void 0:n.length)&&e.errors.length)return{errors:[{path:e.path,errors:e.errors}]};const t=e.inner.reduce(((e,t)=>{const n=t.path||"";return e[n]||(e[n]={errors:[],path:n}),e[n].errors.push(...t.errors),e}),{});return{errors:Object.values(t)}}}}}async function te(e,t,n){const r=(a=n.name,u[a]);var a;if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=function(e,t){const n=e=>v(e)?e(t):e;if(Array.isArray(e))return e.map(n);return Object.keys(e).reduce(((t,r)=>(t[r]=n(e[r]),t)),{})}(n.params,e.formData),l={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:i})},o=await r(t,i,l);return"string"==typeof o?{error:o}:{error:o?void 0:ne(l)}}function ne(e){const t=Q().generateMessage;return t?t(e):"Field is invalid"}async function re(e,t,n){const r=M(e).map((async r=>{var a,i,l;const u=null===(a=null==n?void 0:n.names)||void 0===a?void 0:a[r],o=await Z(E(t,r),e[r],{name:(null==u?void 0:u.name)||r,label:null==u?void 0:u.label,values:t,bails:null===(l=null===(i=null==n?void 0:n.bailsMap)||void 0===i?void 0:i[r])||void 0===l||l});return Object.assign(Object.assign({},o),{path:r})}));let a=!0;const i=await Promise.all(r),l={},u={};for(const e of i)l[e.path]={valid:e.valid,errors:e.errors},e.valid||(a=!1,u[e.path]=e.errors[0]);return{valid:a,results:l,errors:u}}let ae=0;function ie(e,n){const{value:r,initialValue:a,setInitialValue:i}=function(e,n,r){const a=t.ref(t.unref(n));function i(){return r?E(r.initialValues.value,t.unref(e),t.unref(a)):t.unref(a)}function l(n){r?r.stageInitialValue(t.unref(e),n,!0):a.value=n}const u=t.computed(i);if(!r){return{value:t.ref(i()),initialValue:u,setInitialValue:l}}const o=function(e,n,r,a){if(t.isRef(e))return t.unref(e);if(void 0!==e)return e;return E(n.values,t.unref(a),t.unref(r))}(n,r,u,e);r.stageInitialValue(t.unref(e),o,!0);const s=t.computed({get:()=>E(r.values,t.unref(e)),set(n){r.setFieldValue(t.unref(e),n)}});return{value:s,initialValue:u,setInitialValue:l}}(e,n.modelValue,n.form);if(!n.form){const{errors:o,setErrors:s}=function(){const e=t.ref([]);return{errors:e,setErrors:t=>{e.value=$(t)}}}(),d=ae>=Number.MAX_SAFE_INTEGER?0:++ae,c=function(e,n,r){const a=t.reactive({touched:!1,pending:!1,valid:!0,validated:!!t.unref(r).length,initialValue:t.computed((()=>t.unref(n))),dirty:t.computed((()=>!F(t.unref(e),t.unref(n))))});return t.watch(r,(e=>{a.valid=!e.length}),{immediate:!0,flush:"sync"}),a}(r,a,o);function v(e){var t;"value"in e&&(r.value=e.value),"errors"in e&&s(e.errors),"touched"in e&&(c.touched=null!==(t=e.touched)&&void 0!==t?t:c.touched),"initialValue"in e&&i(e.initialValue)}return{id:d,path:e,value:r,initialValue:a,meta:c,flags:{pendingUnmount:{[d]:!1}},errors:o,setState:v}}const l=n.form.createPathState(e,{bails:n.bails,label:n.label,type:n.type,validate:n.validate}),u=t.computed((()=>l.errors));return{id:Array.isArray(l.id)?l.id[l.id.length-1]:l.id,path:e,value:r,errors:u,meta:l,initialValue:a,flags:l.__flags,setState:function(a){var l,u,o;"value"in a&&(r.value=a.value),"errors"in a&&(null===(l=n.form)||void 0===l||l.setFieldError(t.unref(e),a.errors)),"touched"in a&&(null===(u=n.form)||void 0===u||u.setFieldTouched(t.unref(e),null!==(o=a.touched)&&void 0!==o&&o)),"initialValue"in a&&i(a.initialValue)}}}function le(e,n,r){return m(null==r?void 0:r.type)?function(e,n,r){const a=(null==r?void 0:r.standalone)?void 0:B(o),i=null==r?void 0:r.checkedValue,l=null==r?void 0:r.uncheckedValue;function u(n){const r=n.handleChange,u=t.computed((()=>{const e=t.unref(n.value),r=t.unref(i);return Array.isArray(e)?e.findIndex((e=>F(e,r)))>=0:F(r,e)}));function o(o,s=!0){var d;if(u.value===(null===(d=null==o?void 0:o.target)||void 0===d?void 0:d.checked))return void(s&&n.validate());const c=N(e),v=null==a?void 0:a.getPathState(c),f=W(o);let p;p=a&&(null==v?void 0:v.multiple)&&"checkbox"===v.type?T(E(a.values,c)||[],f,void 0):T(t.unref(n.value),t.unref(i),t.unref(l)),r(p,s)}return Object.assign(Object.assign({},n),{checked:u,checkedValue:i,uncheckedValue:l,handleChange:o})}return u(ue(e,n,r))}(e,n,r):ue(e,n,r)}function ue(e,r,a){const{initialValue:i,validateOnMount:l,bails:u,type:c,checkedValue:m,label:h,validateOnValueUpdate:y,uncheckedValue:g,controlled:b,keepValueOnUnmount:V,modelPropName:O,syncVModel:A,form:j}=function(e){var n;const r=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,modelPropName:"modelValue",syncVModel:!0,controlled:!0}),a=null===(n=null==e?void 0:e.syncVModel)||void 0===n||n,i=a&&!("initialValue"in(e||{}))?oe(t.getCurrentInstance(),(null==e?void 0:e.modelPropName)||"modelValue"):null==e?void 0:e.initialValue;if(!e)return Object.assign(Object.assign({},r()),{initialValue:i});const l="valueProp"in e?e.valueProp:e.checkedValue,u="standalone"in e?!e.standalone:e.controlled;return Object.assign(Object.assign(Object.assign({},r()),e||{}),{initialValue:i,controlled:null==u||u,checkedValue:l})}(a),S=b?B(o):void 0,k=j||S,I=function(e){return t.computed((()=>N(e)))}(e),C=t.computed((()=>{if(t.unref(null==k?void 0:k.schema))return;const e=t.unref(r);return p(e)||f(e)||n(e)||Array.isArray(e)?e:G(e)})),{id:_,value:T,initialValue:U,meta:x,setState:$,errors:D,flags:z}=ie(I,{modelValue:i,form:k,bails:u,label:h,type:c,validate:C.value?H:void 0}),q=t.computed((()=>D.value[0]));A&&function({prop:e,value:n,handleChange:r}){const a=t.getCurrentInstance();if(!a)return;const i=e||"modelValue",l=`update:${i}`;if(!(i in a.props))return;t.watch(n,(e=>{F(e,oe(a,i))||a.emit(l,e)})),t.watch((()=>oe(a,i)),(e=>{if(e===d&&void 0===n.value)return;const t=e===d?void 0:e;F(t,P(n.value,a.props.modelModifiers))||r(t)}))}({value:T,prop:O,handleChange:J});async function L(e){var n,r;return(null==k?void 0:k.validateSchema)?null!==(n=(await k.validateSchema(e)).results[t.unref(I)])&&void 0!==n?n:{valid:!0,errors:[]}:C.value?Z(T.value,C.value,{name:t.unref(I),label:t.unref(h),values:null!==(r=null==k?void 0:k.values)&&void 0!==r?r:{},bails:u}):{valid:!0,errors:[]}}const K=R((async()=>(x.pending=!0,x.validated=!0,L("validated-only"))),(e=>{if(!z.pendingUnmount[te.id])return $({errors:e.errors}),x.pending=!1,x.valid=e.valid,e})),X=R((async()=>L("silent")),(e=>(x.valid=e.valid,e)));function H(e){return"silent"===(null==e?void 0:e.mode)?X():K()}function J(e,t=!0){Y(W(e),t)}function Q(e){var t;const n=e&&"value"in e?e.value:U.value;$({value:w(n),initialValue:w(n),touched:null!==(t=null==e?void 0:e.touched)&&void 0!==t&&t,errors:(null==e?void 0:e.errors)||[]}),x.pending=!1,x.validated=!1,X()}function Y(e,t=!0){if(T.value=e,!t)return void X();(t?K:X)()}t.onMounted((()=>{if(l)return K();k&&k.validateSchema||X()}));const ee=t.computed({get:()=>T.value,set(e){Y(e,y)}}),te={id:_,name:I,label:h,value:ee,meta:x,errors:D,errorMessage:q,type:c,checkedValue:m,uncheckedValue:g,bails:u,keepValueOnUnmount:V,resetField:Q,handleReset:()=>Q(),validate:H,handleChange:J,handleBlur:()=>{x.touched=!0},setState:$,setTouched:function(e){x.touched=e},setErrors:function(e){$({errors:Array.isArray(e)?e:[e]})},setValue:Y};if(t.provide(s,te),t.isRef(r)&&"function"!=typeof t.unref(r)&&t.watch(r,((e,t)=>{F(e,t)||(x.validated?K():X())}),{deep:!0}),!k)return te;const ne=t.computed((()=>{const e=C.value;return!e||n(e)||p(e)||f(e)||Array.isArray(e)?{}:Object.keys(e).reduce(((t,n)=>{const r=(a=e[n],Array.isArray(a)?a.filter(v):M(a).filter((e=>v(a[e]))).map((e=>a[e]))).map((e=>e.__locatorRef)).reduce(((e,t)=>{const n=E(k.values,t)||k.values[t];return void 0!==n&&(e[t]=n),e}),{});var a;return Object.assign(t,r),t}),{})}));return t.watch(ne,((e,t)=>{if(!Object.keys(e).length)return;!F(e,t)&&(x.validated?K():X())})),t.onBeforeUnmount((()=>{var e;const n=null!==(e=t.unref(te.keepValueOnUnmount))&&void 0!==e?e:t.unref(k.keepValuesOnUnmount),r=N(I);if(n||!k||z.pendingUnmount[te.id])return void(null==k||k.removePathState(r,_));z.pendingUnmount[te.id]=!0;const a=k.getPathState(r);if(Array.isArray(null==a?void 0:a.id)&&(null==a?void 0:a.multiple)?null==a?void 0:a.id.includes(te.id):(null==a?void 0:a.id)===te.id){if((null==a?void 0:a.multiple)&&Array.isArray(a.value)){const e=a.value.findIndex((e=>F(e,t.unref(te.checkedValue))));if(e>-1){const t=[...a.value];t.splice(e,1),k.setFieldValue(r,t)}Array.isArray(a.id)&&a.id.splice(a.id.indexOf(te.id),1)}else k.unsetPathValue(N(I));k.removePathState(r,_)}})),te}function oe(e,t){if(e)return e.props[t]}function se(e,t){let n=e.as||"";return e.as||t.slots.default||(n="input"),n}function de(e,t){return m(t.attrs.type)?O(e,"modelValue")?e.modelValue:void 0:O(e,"modelValue")?e.modelValue:t.attrs.value}const ce=t.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>Q().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:d},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(e,r){const a=t.toRef(e,"rules"),i=t.toRef(e,"name"),l=t.toRef(e,"label"),u=t.toRef(e,"uncheckedValue"),o=t.toRef(e,"keepValue"),{errors:s,value:d,errorMessage:c,validate:v,handleChange:f,handleBlur:p,setTouched:h,resetField:y,handleReset:b,meta:V,checked:O,setErrors:F}=le(i,a,{validateOnMount:e.validateOnMount,bails:e.bails,standalone:e.standalone,type:r.attrs.type,initialValue:de(e,r),checkedValue:r.attrs.value,uncheckedValue:u,label:l,validateOnValueUpdate:!1,keepValueOnUnmount:o}),A=function(e,t=!0){f(e,t),r.emit("update:modelValue",d.value)},j=t.computed((()=>{const{validateOnInput:t,validateOnChange:a,validateOnBlur:i,validateOnModelUpdate:l}=function(e){var t,n,r,a;const{validateOnInput:i,validateOnChange:l,validateOnBlur:u,validateOnModelUpdate:o}=Q();return{validateOnInput:null!==(t=e.validateOnInput)&&void 0!==t?t:i,validateOnChange:null!==(n=e.validateOnChange)&&void 0!==n?n:l,validateOnBlur:null!==(r=e.validateOnBlur)&&void 0!==r?r:u,validateOnModelUpdate:null!==(a=e.validateOnModelUpdate)&&void 0!==a?a:o}}(e);const u={name:e.name,onBlur:function(e){p(e),n(r.attrs.onBlur)&&r.attrs.onBlur(e),i&&v()},onInput:function(e){A(e,t),n(r.attrs.onInput)&&r.attrs.onInput(e)},onChange:function(e){A(e,a),n(r.attrs.onChange)&&r.attrs.onChange(e)},"onUpdate:modelValue":e=>A(e,l)};m(r.attrs.type)&&O&&(u.checked=O.value);return g(se(e,r),r.attrs)&&(u.value=d.value),u}));function w(){return{field:j.value,value:d.value,meta:V,errors:s.value,errorMessage:c.value,validate:v,resetField:y,handleChange:A,handleInput:e=>A(e,!1),handleReset:b,handleBlur:p,setTouched:h,setErrors:F}}return r.expose({setErrors:F,setTouched:h,reset:y,validate:v,handleChange:f}),()=>{const n=t.resolveDynamicComponent(se(e,r)),a=q(n,r,w);return n?t.h(n,Object.assign(Object.assign({},r.attrs),j.value),a):a}}});let ve=0;const fe=["bails","fieldsCount","id","multiple","type","validate"];function pe(e){const r=t.unref(null==e?void 0:e.initialValues)||{},a=t.unref(null==e?void 0:e.validationSchema);return a&&f(a)&&n(a.cast)?w(a.cast(r)||{}):w(r)}function me(e){var r;const a=ve++;let i=0;const u=t.ref(!1),s=t.ref(!1),d=t.ref(0),c=[],v=t.reactive(pe(e)),m=t.ref([]),h=t.ref({});function y(e,t){const n=H(e);n?n.errors=$(t):h.value[e]=$(t)}function g(e){M(e).forEach((t=>{y(t,e[t])}))}(null==e?void 0:e.initialErrors)&&g(e.initialErrors);const V=t.computed((()=>{const e=m.value.reduce(((e,t)=>(t.errors.length&&(e[t.path]=t.errors),e)),{});return Object.assign(Object.assign({},h.value),e)})),O=t.computed((()=>M(V.value).reduce(((e,t)=>{const n=V.value[t];return(null==n?void 0:n.length)&&(e[t]=n[0]),e}),{}))),A=t.computed((()=>m.value.reduce(((e,t)=>(e[t.path]={name:t.path||"",label:t.label||""},e)),{}))),j=t.computed((()=>m.value.reduce(((e,t)=>{var n;return e[t.path]=null===(n=t.bails)||void 0===n||n,e}),{}))),S=Object.assign({},(null==e?void 0:e.initialErrors)||{}),I=null!==(r=null==e?void 0:e.keepValuesOnUnmount)&&void 0!==r&&r,{initialValues:B,originalInitialValues:_,setInitialValues:T}=function(e,n,r){const a=pe(r),i=null==r?void 0:r.initialValues,l=t.ref(a),u=t.ref(w(a));function o(t,r=!1){l.value=w(t),u.value=w(t),r&&e.value.forEach((e=>{if(e.touched)return;const t=E(l.value,e.path);k(n,e.path,w(t))}))}t.isRef(i)&&t.watch(i,(e=>{o(e,!0)}),{deep:!0});return{initialValues:l,originalInitialValues:u,setInitialValues:o}}(m,v,e),P=function(e,n,r,a){const i={touched:"some",pending:"some",valid:"every"},l=t.computed((()=>!F(n,t.unref(r))));function u(){const t=e.value;return M(i).reduce(((e,n)=>{const r=i[n];return e[n]=t[r]((e=>e[n])),e}),{})}const o=t.reactive(u());return t.watchEffect((()=>{const e=u();o.touched=e.touched,o.valid=e.valid,o.pending=e.pending})),t.computed((()=>Object.assign(Object.assign({initialValues:t.unref(r)},o),{valid:o.valid&&!M(a.value).length,dirty:l.value})))}(m,v,_,O),x=t.computed((()=>m.value.reduce(((e,t)=>{const n=E(v,t.path);return k(e,t.path,n),e}),{}))),D=null==e?void 0:e.validationSchema;function q(e,n){var r,a;const l=t.computed((()=>E(B.value,N(e)))),u=m.value.find((n=>n.path===t.unref(e)));if(u){"checkbox"!==(null==n?void 0:n.type)&&"radio"!==(null==n?void 0:n.type)||(u.multiple=!0);const e=i++;return Array.isArray(u.id)?u.id.push(e):u.id=[u.id,e],u.fieldsCount++,u.__flags.pendingUnmount[e]=!1,u}const o=t.computed((()=>E(v,N(e)))),s=N(e),d=i++,c=t.reactive({id:d,path:e,touched:!1,pending:!1,valid:!0,validated:!!(null===(r=S[s])||void 0===r?void 0:r.length),initialValue:l,errors:t.shallowRef([]),bails:null!==(a=null==n?void 0:n.bails)&&void 0!==a&&a,label:null==n?void 0:n.label,type:(null==n?void 0:n.type)||"default",value:o,multiple:!1,__flags:{pendingUnmount:{[d]:!1}},fieldsCount:1,validate:null==n?void 0:n.validate,dirty:t.computed((()=>!F(t.unref(o),t.unref(l))))});return m.value.push(c),O.value[s]&&!S[s]&&t.nextTick((()=>{me(s)})),t.isRef(e)&&t.watch(e,(e=>{const n=w(o.value);t.nextTick((()=>{k(v,e,n)}))})),c}const L=U(ge,5),K=U(ge,5),G=R((async e=>"silent"===await e?L():K()),((e,[t])=>{const n=M(ne.errorBag.value);return[...new Set([...M(e.results),...m.value.map((e=>e.path)),...n])].sort().reduce(((n,r)=>{const a=r,i=H(a)||function(e){const t=m.value.filter((t=>e.startsWith(t.path)));return t.reduce(((e,t)=>e?t.path.length>e.path.length?t:e:t),void 0)}(a),l=(e.results[a]||{errors:[]}).errors,u={errors:l,valid:!l.length};return n.results[a]=u,u.valid||(n.errors[a]=u.errors[0]),i&&h.value[a]&&delete h.value[a],i?(i.valid=u.valid,"silent"===t?n:"validated-only"!==t||i.validated?(y(i,u.errors),n):n):(y(a,l),n)}),{valid:e.valid,results:{},errors:{}})}));function X(e){m.value.forEach(e)}function H(e){return"string"==typeof e?m.value.find((t=>t.path===e)):e}let J,Y=[];function Z(e){return function(t,n){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),X((e=>e.touched=!0)),u.value=!0,d.value++,ce().then((a=>{const i=w(v);if(a.valid&&"function"==typeof t){const n=w(x.value);let l=e?n:i;return a.values&&(l=a.values),t(l,{evt:r,controlledValues:n,setErrors:g,setFieldError:y,setTouched:oe,setFieldTouched:ue,setValues:ie,setFieldValue:ae,resetForm:de,resetField:se})}a.valid||"function"!=typeof n||n({values:i,evt:r,errors:a.errors,results:a.results})})).then((e=>(u.value=!1,e)),(e=>{throw u.value=!1,e}))}}}const te=Z(!1);te.withControlled=Z(!0);const ne={formId:a,values:v,controlledValues:x,errorBag:V,errors:O,schema:D,submitCount:d,meta:P,isSubmitting:u,isValidating:s,fieldArrays:c,keepValuesOnUnmount:I,validateSchema:t.unref(D)?G:void 0,validate:ce,setFieldError:y,validateField:me,setFieldValue:ae,setValues:ie,setErrors:g,setFieldTouched:ue,setTouched:oe,resetForm:de,resetField:se,handleSubmit:te,stageInitialValue:function(t,n,r=!1){ye(t,n),k(v,t,n),r&&!(null==e?void 0:e.initialValues)&&k(_.value,t,w(n))},unsetInitialValue:he,setFieldInitialValue:ye,useFieldModel:function(e){if(!Array.isArray(e))return le(e);return e.map(le)},createPathState:q,getPathState:H,unsetPathValue:function(e){return Y.push(e),J||(J=t.nextTick((()=>{[...Y].sort().reverse().forEach((e=>{C(v,e)})),Y=[],J=null}))),J},removePathState:function(e,t){const n=m.value.findIndex((t=>t.path===e)),r=m.value[n];if(-1!==n&&r){if(r.multiple&&r.fieldsCount&&r.fieldsCount--,Array.isArray(r.id)){const e=r.id.indexOf(t);e>=0&&r.id.splice(e,1),delete r.__flags.pendingUnmount[t]}(!r.multiple||r.fieldsCount<=0)&&(m.value.splice(n,1),he(e))}},initialValues:B,getAllPathStates:()=>m.value,markForUnmount:function(e){return X((t=>{t.path.startsWith(e)&&M(t.__flags.pendingUnmount).forEach((e=>{t.__flags.pendingUnmount[e]=!0}))}))}};function ae(e,t){const n=w(t),r="string"==typeof e?e:e.path;H(r)||q(r),k(v,r,n)}function ie(e){l(v,e),c.forEach((e=>e&&e.reset()))}function le(e){const n=H(t.unref(e))||q(e);return t.computed({get:()=>n.value,set(r){const a=t.unref(e);ae(a,r),n.validated=!0,n.pending=!0,me(a).then((()=>{n.pending=!1}))}})}function ue(e,t){const n=H(e);n&&(n.touched=t)}function oe(e){M(e).forEach((t=>{ue(t,!!e[t])}))}function se(e,t){var n;const r=t&&"value"in t?t.value:E(B.value,e);ye(e,w(r)),ae(e,r),ue(e,null!==(n=null==t?void 0:t.touched)&&void 0!==n&&n),y(e,(null==t?void 0:t.errors)||[])}function de(e){const n=(null==e?void 0:e.values)?e.values:_.value;T(n),ie(n),X((t=>{var r;t.validated=!1,t.touched=(null===(r=null==e?void 0:e.touched)||void 0===r?void 0:r[t.path])||!1,ae(t.path,E(n,t.path)),y(t.path,void 0)})),g((null==e?void 0:e.errors)||{}),d.value=(null==e?void 0:e.submitCount)||0,t.nextTick((()=>{ce({mode:"silent"})}))}async function ce(e){const t=(null==e?void 0:e.mode)||"force";if("force"===t&&X((e=>e.validated=!0)),ne.validateSchema)return ne.validateSchema(t);s.value=!0;const n=await Promise.all(m.value.map((t=>t.validate?t.validate(e).then((e=>({key:t.path,valid:e.valid,errors:e.errors}))):Promise.resolve({key:t.path,valid:!0,errors:[]}))));s.value=!1;const r={},a={};for(const e of n)r[e.key]={valid:e.valid,errors:e.errors},e.errors.length&&(a[e.key]=e.errors[0]);return{valid:n.every((e=>e.valid)),results:r,errors:a}}async function me(e){const n=H(e);if(n&&(n.validated=!0),D){const{results:t}=await G("validated-only");return t[e]||{errors:[],valid:!0}}return(null==n?void 0:n.validate)?n.validate():(n||t.warn(`field with path ${e} was not found`),Promise.resolve({errors:[],valid:!0}))}function he(e){C(B.value,e)}function ye(e,t){k(B.value,e,w(t))}async function ge(){const e=t.unref(D);if(!e)return{valid:!0,results:{},errors:{}};s.value=!0;const n=p(e)||f(e)?await async function(e,t){const n=f(e)?e:ee(e),r=await n.parse(t),a={},i={};for(const e of r.errors){const t=e.errors,n=(e.path||"").replace(/\["(\d+)"\]/g,((e,t)=>`[${t}]`));a[n]={valid:!t.length,errors:t},t.length&&(i[n]=t[0])}return{valid:!r.errors.length,results:a,errors:i,values:r.value}}(e,v):await re(e,v,{names:A.value,bailsMap:j.value});return s.value=!1,n}const be=te(((e,{evt:t})=>{b(t)&&t.target.submit()}));return t.onMounted((()=>{(null==e?void 0:e.initialErrors)&&g(e.initialErrors),(null==e?void 0:e.initialTouched)&&oe(e.initialTouched),(null==e?void 0:e.validateOnMount)?ce():ne.validateSchema&&ne.validateSchema("silent")})),t.isRef(D)&&t.watch(D,(()=>{var e;null===(e=ne.validateSchema)||void 0===e||e.call(ne,"validated-only")})),t.provide(o,ne),Object.assign(Object.assign({},ne),{handleReset:()=>de(),submitForm:be,defineComponentBinds:function(e,r){const a=H(N(e))||q(e),i=()=>n(r)?r(z(a,fe)):r||{};function l(){var e;a.touched=!0;(null!==(e=i().validateOnBlur)&&void 0!==e?e:Q().validateOnBlur)&&me(a.path)}function u(e){var t;ae(a.path,e);(null!==(t=i().validateOnModelUpdate)&&void 0!==t?t:Q().validateOnModelUpdate)&&me(a.path)}return t.computed((()=>{const e={modelValue:a.value,"onUpdate:modelValue":u,onBlur:l};return n(r)?Object.assign(Object.assign({},e),r(a).props||{}):(null==r?void 0:r.mapProps)?Object.assign(Object.assign({},e),r.mapProps(z(a,fe))):e}))},defineInputBinds:function(e,r){const a=H(N(e))||q(e),i=()=>n(r)?r(z(a,fe)):r||{};function l(){var e;a.touched=!0;(null!==(e=i().validateOnBlur)&&void 0!==e?e:Q().validateOnBlur)&&me(a.path)}function u(e){var t;const n=W(e);ae(a.path,n);(null!==(t=i().validateOnInput)&&void 0!==t?t:Q().validateOnInput)&&me(a.path)}function o(e){var t;const n=W(e);ae(a.path,n);(null!==(t=i().validateOnChange)&&void 0!==t?t:Q().validateOnChange)&&me(a.path)}return t.computed((()=>{const e={value:a.value,onChange:o,onInput:u,onBlur:l};return n(r)?Object.assign(Object.assign({},e),r(z(a,fe)).attrs||{}):(null==r?void 0:r.mapAttrs)?Object.assign(Object.assign({},e),r.mapAttrs(z(a,fe))):e}))}})}const he=t.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:String,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(e,n){const r=t.toRef(e,"initialValues"),a=t.toRef(e,"validationSchema"),i=t.toRef(e,"keepValues"),{errors:l,errorBag:u,values:o,meta:s,isSubmitting:d,isValidating:c,submitCount:v,controlledValues:f,validate:p,validateField:m,handleReset:h,resetForm:y,handleSubmit:g,setErrors:O,setFieldError:F,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetField:k}=me({validationSchema:a.value?a:void 0,initialValues:r,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:i}),I=g(((e,{evt:t})=>{b(t)&&t.target.submit()}),e.onInvalidSubmit),C=e.onSubmit?g(e.onSubmit,e.onInvalidSubmit):I;function M(e){V(e)&&e.preventDefault(),h(),"function"==typeof n.attrs.onReset&&n.attrs.onReset()}function B(t,n){return g("function"!=typeof t||n?n:t,e.onInvalidSubmit)(t)}function _(){return w(o)}function T(){return w(s.value)}function U(){return w(l.value)}function P(){return{meta:s.value,errors:l.value,errorBag:u.value,values:o,isSubmitting:d.value,isValidating:c.value,submitCount:v.value,controlledValues:f.value,validate:p,validateField:m,handleSubmit:B,handleReset:h,submitForm:I,setErrors:O,setFieldError:F,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetForm:y,resetField:k,getValues:_,getMeta:T,getErrors:U}}return n.expose({setFieldError:F,setErrors:O,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetForm:y,validate:p,validateField:m,resetField:k,getValues:_,getMeta:T,getErrors:U}),function(){const r="form"===e.as?e.as:t.resolveDynamicComponent(e.as),a=q(r,n,P);if(!e.as)return a;const i="form"===e.as?{novalidate:!0}:{};return t.h(r,Object.assign(Object.assign(Object.assign({},i),n.attrs),{onSubmit:C,onReset:M}),a)}}}),ye=he;function ge(e){const n=B(o,void 0),a=t.ref([]),i=()=>{},l={fields:a,remove:i,push:i,swap:i,insert:i,update:i,replace:i,prepend:i,move:i};if(!n)return _("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"),l;if(!t.unref(e))return _("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"),l;const u=n.fieldArrays.find((n=>t.unref(n.path)===t.unref(e)));if(u)return u;let s=0;function d(){return E(null==n?void 0:n.values,t.unref(e),[])||[]}function c(){const e=d();Array.isArray(e)&&(a.value=e.map(((e,t)=>f(e,t,a.value))),v())}function v(){const e=a.value.length;for(let t=0;t<e;t++){const n=a.value[t];n.isFirst=0===t,n.isLast=t===e-1}}function f(i,l,u){if(u&&!r(l)&&u[l])return u[l];const o=s++,d={key:o,value:x({get(){const r=E(null==n?void 0:n.values,t.unref(e),[])||[],l=a.value.findIndex((e=>e.key===o));return-1===l?i:r[l]},set(e){const t=a.value.findIndex((e=>e.key===o));-1!==t?m(t,e):_("Attempting to update a non-existent array item")}}),isFirst:!1,isLast:!1};return d}function p(){v(),null==n||n.validate({mode:"silent"})}function m(r,a){const i=t.unref(e),l=E(null==n?void 0:n.values,i);!Array.isArray(l)||l.length-1<r||(k(n.values,`${i}[${r}]`,a),null==n||n.validate({mode:"validated-only"}))}c();const h={fields:a,remove:function(r){const i=t.unref(e),l=E(null==n?void 0:n.values,i);if(!l||!Array.isArray(l))return;const u=[...l];u.splice(r,1);const o=i+`[${r}]`;n.markForUnmount(o),n.unsetInitialValue(o),k(n.values,i,u),a.value.splice(r,1),p()},push:function(i){const l=t.unref(e),u=E(null==n?void 0:n.values,l),o=r(u)?[]:u;if(!Array.isArray(o))return;const s=[...o];s.push(i),n.stageInitialValue(l+`[${s.length-1}]`,i),k(n.values,l,s),a.value.push(f(i)),p()},swap:function(r,i){const l=t.unref(e),u=E(null==n?void 0:n.values,l);if(!Array.isArray(u)||!(r in u)||!(i in u))return;const o=[...u],s=[...a.value],d=o[r];o[r]=o[i],o[i]=d;const c=s[r];s[r]=s[i],s[i]=c,k(n.values,l,o),a.value=s,v()},insert:function(r,i){const l=t.unref(e),u=E(null==n?void 0:n.values,l);if(!Array.isArray(u)||u.length<r)return;const o=[...u],s=[...a.value];o.splice(r,0,i),s.splice(r,0,f(i)),k(n.values,l,o),a.value=s,p()},update:m,replace:function(r){const a=t.unref(e);n.stageInitialValue(a,r),k(n.values,a,r),c(),p()},prepend:function(i){const l=t.unref(e),u=E(null==n?void 0:n.values,l),o=r(u)?[]:u;if(!Array.isArray(o))return;const s=[i,...o];n.stageInitialValue(l+`[${s.length-1}]`,i),k(n.values,l,s),a.value.unshift(f(i)),p()},move:function(i,l){const u=t.unref(e),o=E(null==n?void 0:n.values,u),s=r(o)?[]:[...o];if(!Array.isArray(o)||!(i in o)||!(l in o))return;const d=[...a.value],c=d[i];d.splice(i,1),d.splice(l,0,c);const v=s[i];s.splice(i,1),s.splice(l,0,v),k(n.values,u,s),a.value=d,p()}};return n.fieldArrays.push(Object.assign({path:e,reset:c},h)),t.onBeforeUnmount((()=>{const r=n.fieldArrays.findIndex((n=>t.unref(n.path)===t.unref(e)));r>=0&&n.fieldArrays.splice(r,1)})),t.watch(d,(e=>{F(e,a.value.map((e=>e.value)))||c()})),h}const be=t.defineComponent({name:"FieldArray",inheritAttrs:!1,props:{name:{type:String,required:!0}},setup(e,n){const{push:r,remove:a,swap:i,insert:l,replace:u,update:o,prepend:s,move:d,fields:c}=ge(t.toRef(e,"name"));function v(){return{fields:c.value,push:r,remove:a,swap:i,insert:l,update:o,replace:u,prepend:s,move:d}}return n.expose({push:r,remove:a,swap:i,insert:l,update:o,replace:u,prepend:s,move:d}),()=>q(void 0,n,v)}}),Ve=t.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,n){const r=t.inject(o,void 0),a=t.computed((()=>null==r?void 0:r.errors.value[e.name]));function i(){return{message:a.value}}return()=>{if(!a.value)return;const r=e.as?t.resolveDynamicComponent(e.as):e.as,l=q(r,n,i),u=Object.assign({role:"alert"},n.attrs);return r||!Array.isArray(l)&&l||!(null==l?void 0:l.length)?!Array.isArray(l)&&l||(null==l?void 0:l.length)?t.h(r,u,l):t.h(r||"span",u,a.value):l}}});e.ErrorMessage=Ve,e.Field=ce,e.FieldArray=be,e.FieldContextKey=s,e.Form=ye,e.FormContextKey=o,e.IS_ABSENT=d,e.configure=Y,e.defineRule=function(e,t){!function(e,t){if(n(t))return;throw new Error(`Extension Error: The validator '${e}' must be a function.`)}(e,t),u[e]=t},e.useField=le,e.useFieldArray=ge,e.useFieldError=function(e){const n=B(o),r=e?void 0:t.inject(s);return t.computed((()=>e?null==n?void 0:n.errors.value[t.unref(e)]:null==r?void 0:r.errorMessage.value))},e.useFieldValue=function(e){const n=B(o),r=e?void 0:t.inject(s);return t.computed((()=>e?E(null==n?void 0:n.values,t.unref(e)):t.unref(null==r?void 0:r.value)))},e.useForm=me,e.useFormErrors=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.errors.value)||{}))},e.useFormValues=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.values)||{}))},e.useIsFieldDirty=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.dirty:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.dirty)&&void 0!==t&&t)}))},e.useIsFieldTouched=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.touched:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.touched)&&void 0!==t&&t)}))},e.useIsFieldValid=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.valid:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.valid)&&void 0!==t&&t)}))},e.useIsFormDirty=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.dirty)&&void 0!==t&&t}))},e.useIsFormTouched=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.touched)&&void 0!==t&&t}))},e.useIsFormValid=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.valid)&&void 0!==t&&t}))},e.useIsSubmitting=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isSubmitting.value)&&void 0!==t&&t}))},e.useIsValidating=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isValidating.value)&&void 0!==t&&t}))},e.useResetForm=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(t){if(e)return e.resetForm(t)}},e.useSubmitCount=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.submitCount.value)&&void 0!==t?t:0}))},e.useSubmitForm=function(e){const t=B(o);t||_("No vee-validate <Form /> or `useForm` was detected in the component tree");const n=t?t.handleSubmit(e):void 0;return function(e){if(n)return n(e)}},e.useValidateField=function(e){const n=B(o),r=e?void 0:t.inject(s);return function(){return r?r.validate():n&&e?null==n?void 0:n.validateField(t.unref(e)):(_(`field with name ${t.unref(e)} was not found`),Promise.resolve({errors:[],valid:!0}))}},e.useValidateForm=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(){return e?e.validate():Promise.resolve({results:{},errors:{},valid:!0})}},e.validate=Z,e.validateObject=re}));
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VeeValidate={},e.Vue)}(this,(function(e,t){"use strict";function n(e){return"function"==typeof e}function r(e){return null==e}const a=e=>null!==e&&!!e&&"object"==typeof e&&!Array.isArray(e);function i(e){return Number(e)>=0}function l(e,t){return Object.keys(t).forEach((n=>{if(a(t[n]))return e[n]||(e[n]={}),void l(e[n],t[n]);e[n]=t[n]})),e}const u={};const o=Symbol("vee-validate-form"),s=Symbol("vee-validate-field-instance"),d=Symbol("Default empty value"),c="undefined"!=typeof window;function v(e){return n(e)&&!!e.__locatorRef}function f(e){return!!e&&n(e.parse)&&"VVTypedSchema"===e.__type}function p(e){return!!e&&n(e.validate)}function m(e){return"checkbox"===e||"radio"===e}function h(e){return/^\[.+\]$/i.test(e)}function y(e){return"SELECT"===e.tagName}function g(e,t){return!function(e,t){const n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return"select"===e&&"multiple"in t&&n}(e,t)&&"file"!==t.type&&!m(t.type)}function b(e){return O(e)&&e.target&&"submit"in e.target}function O(e){return!!e&&(!!("undefined"!=typeof Event&&n(Event)&&e instanceof Event)||!(!e||!e.srcElement))}function V(e,t){return t in e&&e[t]!==d}function F(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!F(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!F(r[1],t.get(r[0])))return!1;return!0}if(A(e)&&A(t))return e.size===t.size&&(e.name===t.name&&(e.lastModified===t.lastModified&&e.type===t.type));if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(a=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){var i=a[r];if(!F(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function A(e){return!!c&&e instanceof File}function j(e,t,n){"object"==typeof n.value&&(n.value=w(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function w(e){if("object"!=typeof e)return e;var t,n,r,a=0,i=Object.prototype.toString.call(e);if("[object Object]"===i?r=Object.create(e.__proto__||null):"[object Array]"===i?r=Array(e.length):"[object Set]"===i?(r=new Set,e.forEach((function(e){r.add(w(e))}))):"[object Map]"===i?(r=new Map,e.forEach((function(e,t){r.set(w(t),w(e))}))):"[object Date]"===i?r=new Date(+e):"[object RegExp]"===i?r=new RegExp(e.source,e.flags):"[object DataView]"===i?r=new e.constructor(w(e.buffer)):"[object ArrayBuffer]"===i?r=e.slice(0):"Array]"===i.slice(-6)&&(r=new e.constructor(e)),r){for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)j(r,n[a],Object.getOwnPropertyDescriptor(e,n[a]));for(a=0,n=Object.getOwnPropertyNames(e);a<n.length;a++)Object.hasOwnProperty.call(r,t=n[a])&&r[t]===e[t]||j(r,t,Object.getOwnPropertyDescriptor(e,t))}return r||e}function S(e){return h(e)?e.replace(/\[|\]/gi,""):e}function E(e,t,n){if(!e)return n;if(h(t))return e[S(t)];return(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce(((e,t)=>{return(a(r=e)||Array.isArray(r))&&t in e?e[t]:n;var r}),e)}function k(e,t,n){if(h(t))return void(e[S(t)]=n);const a=t.split(/\.|\[(\d+)\]/).filter(Boolean);let l=e;for(let e=0;e<a.length;e++){if(e===a.length-1)return void(l[a[e]]=n);a[e]in l&&!r(l[a[e]])||(l[a[e]]=i(a[e+1])?[]:{}),l=l[a[e]]}}function I(e,t){Array.isArray(e)&&i(t)?e.splice(Number(t),1):a(e)&&delete e[t]}function C(e,t){if(h(t))return void delete e[S(t)];const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let i=e;for(let e=0;e<n.length;e++){if(e===n.length-1){I(i,n[e]);break}if(!(n[e]in i)||r(i[n[e]]))break;i=i[n[e]]}const l=n.map(((t,r)=>E(e,n.slice(0,r).join("."))));for(let t=l.length-1;t>=0;t--)u=l[t],(Array.isArray(u)?0===u.length:a(u)&&0===Object.keys(u).length)&&(0!==t?I(l[t-1],n[t-1]):I(e,n[0]));var u}function M(e){return Object.keys(e)}function B(e,n=void 0){const r=t.getCurrentInstance();return(null==r?void 0:r.provides[e])||t.inject(e,n)}function _(e){t.warn(`[vee-validate]: ${e}`)}function T(e,t,n){if(Array.isArray(e)){const n=[...e],r=n.findIndex((e=>F(e,t)));return r>=0?n.splice(r,1):n.push(t),n}return F(e,t)?n:t}function U(e,t=0){let n=null,r=[];return function(...a){return n&&window.clearTimeout(n),n=window.setTimeout((()=>{const t=e(...a);r.forEach((e=>e(t))),r=[]}),t),new Promise((e=>r.push(e)))}}function P(e,t){return a(t)&&t.number?function(e){const t=parseFloat(e);return isNaN(t)?e:t}(e):e}function R(e,t){let n;return async function(...r){const a=e(...r);n=a;const i=await a;return a!==n||(n=void 0,t(i,r)),i}}function x({get:e,set:n}){const r=t.ref(w(e()));return t.watch(e,(e=>{F(e,r.value)||(r.value=w(e))}),{deep:!0}),t.watch(r,(t=>{F(t,e())||n(w(t))}),{deep:!0}),r}function N(e){return n(e)?e():t.unref(e)}function $(e){return Array.isArray(e)?e:e?[e]:[]}function D(e){const n=B(o),r=e?t.computed((()=>null==n?void 0:n.getPathState(t.unref(e)))):void 0,a=e?void 0:t.inject(s);return a||(null==r?void 0:r.value)||_(`field with name ${t.unref(e)} was not found`),r||a}function z(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}const q=(e,t,n)=>t.slots.default?"string"!=typeof e&&e?{default:()=>{var e,r;return null===(r=(e=t.slots).default)||void 0===r?void 0:r.call(e,n())}}:t.slots.default(n()):t.slots.default;function L(e){if(K(e))return e._value}function K(e){return"_value"in e}function W(e){if(!O(e))return e;const t=e.target;if(m(t.type)&&K(t))return L(t);if("file"===t.type&&t.files){const e=Array.from(t.files);return t.multiple?e:e[0]}if(y(n=t)&&n.multiple)return Array.from(t.options).filter((e=>e.selected&&!e.disabled)).map(L);var n;if(y(t)){const e=Array.from(t.options).find((e=>e.selected));return e?L(e):t.value}return t.value}function G(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?a(e)&&e._$$isNormalized?e:a(e)?Object.keys(e).reduce(((t,n)=>{const r=function(e){if(!0===e)return[];if(Array.isArray(e))return e;if(a(e))return e;return[e]}(e[n]);return!1!==e[n]&&(t[n]=X(r)),t}),t):"string"!=typeof e?t:e.split("|").reduce(((e,t)=>{const n=H(t);return n.name?(e[n.name]=X(n.params),e):e}),t):t}function X(e){const t=e=>"string"==typeof e&&"@"===e[0]?function(e){const t=t=>E(t,e)||t[e];return t.__locatorRef=e,t}(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce(((n,r)=>(n[r]=t(e[r]),n)),{})}const H=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};let J=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const Q=()=>J,Y=e=>{J=Object.assign(Object.assign({},J),e)};async function Z(e,t,r={}){const a=null==r?void 0:r.bails,i={name:(null==r?void 0:r.name)||"{field}",rules:t,label:null==r?void 0:r.label,bails:null==a||a,formData:(null==r?void 0:r.values)||{}},l=await async function(e,t){if(f(e.rules)||p(e.rules))return async function(e,t){const n=f(t)?t:ee(t),r=await n.parse(e),a=[];for(const e of r.errors)e.errors.length&&a.push(...e.errors);return{errors:a}}(t,e.rules);if(n(e.rules)||Array.isArray(e.rules)){const n={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},r=Array.isArray(e.rules)?e.rules:[e.rules],a=r.length,i=[];for(let l=0;l<a;l++){const a=r[l],u=await a(t,n);if("string"!=typeof u&&u)continue;const o="string"==typeof u?u:ne(n);if(i.push(o),e.bails)return{errors:i}}return{errors:i}}const r=Object.assign(Object.assign({},e),{rules:G(e.rules)}),a=[],i=Object.keys(r.rules),l=i.length;for(let n=0;n<l;n++){const l=i[n],u=await te(r,t,{name:l,params:r.rules[l]});if(u.error&&(a.push(u.error),e.bails))return{errors:a}}return{errors:a}}(i,e),u=l.errors;return{errors:u,valid:!u.length}}function ee(e){return{__type:"VVTypedSchema",async parse(t){var n;try{return{output:await e.validate(t,{abortEarly:!1}),errors:[]}}catch(e){if(!function(e){return!!e&&"ValidationError"===e.name}(e))throw e;if(!(null===(n=e.inner)||void 0===n?void 0:n.length)&&e.errors.length)return{errors:[{path:e.path,errors:e.errors}]};const t=e.inner.reduce(((e,t)=>{const n=t.path||"";return e[n]||(e[n]={errors:[],path:n}),e[n].errors.push(...t.errors),e}),{});return{errors:Object.values(t)}}}}}async function te(e,t,n){const r=(a=n.name,u[a]);var a;if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=function(e,t){const n=e=>v(e)?e(t):e;if(Array.isArray(e))return e.map(n);return Object.keys(e).reduce(((t,r)=>(t[r]=n(e[r]),t)),{})}(n.params,e.formData),l={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:i})},o=await r(t,i,l);return"string"==typeof o?{error:o}:{error:o?void 0:ne(l)}}function ne(e){const t=Q().generateMessage;return t?t(e):"Field is invalid"}async function re(e,t,n){const r=M(e).map((async r=>{var a,i,l;const u=null===(a=null==n?void 0:n.names)||void 0===a?void 0:a[r],o=await Z(E(t,r),e[r],{name:(null==u?void 0:u.name)||r,label:null==u?void 0:u.label,values:t,bails:null===(l=null===(i=null==n?void 0:n.bailsMap)||void 0===i?void 0:i[r])||void 0===l||l});return Object.assign(Object.assign({},o),{path:r})}));let a=!0;const i=await Promise.all(r),l={},u={};for(const e of i)l[e.path]={valid:e.valid,errors:e.errors},e.valid||(a=!1,u[e.path]=e.errors[0]);return{valid:a,results:l,errors:u}}let ae=0;function ie(e,n){const{value:r,initialValue:a,setInitialValue:i}=function(e,n,r){const a=t.ref(t.unref(n));function i(){return r?E(r.initialValues.value,t.unref(e),t.unref(a)):t.unref(a)}function l(n){r?r.stageInitialValue(t.unref(e),n,!0):a.value=n}const u=t.computed(i);if(!r){return{value:t.ref(i()),initialValue:u,setInitialValue:l}}const o=function(e,n,r,a){if(t.isRef(e))return t.unref(e);if(void 0!==e)return e;return E(n.values,t.unref(a),t.unref(r))}(n,r,u,e);r.stageInitialValue(t.unref(e),o,!0);const s=t.computed({get:()=>E(r.values,t.unref(e)),set(n){r.setFieldValue(t.unref(e),n)}});return{value:s,initialValue:u,setInitialValue:l}}(e,n.modelValue,n.form);if(!n.form){const{errors:o,setErrors:s}=function(){const e=t.ref([]);return{errors:e,setErrors:t=>{e.value=$(t)}}}(),d=ae>=Number.MAX_SAFE_INTEGER?0:++ae,c=function(e,n,r){const a=t.reactive({touched:!1,pending:!1,valid:!0,validated:!!t.unref(r).length,initialValue:t.computed((()=>t.unref(n))),dirty:t.computed((()=>!F(t.unref(e),t.unref(n))))});return t.watch(r,(e=>{a.valid=!e.length}),{immediate:!0,flush:"sync"}),a}(r,a,o);function v(e){var t;"value"in e&&(r.value=e.value),"errors"in e&&s(e.errors),"touched"in e&&(c.touched=null!==(t=e.touched)&&void 0!==t?t:c.touched),"initialValue"in e&&i(e.initialValue)}return{id:d,path:e,value:r,initialValue:a,meta:c,flags:{pendingUnmount:{[d]:!1}},errors:o,setState:v}}const l=n.form.createPathState(e,{bails:n.bails,label:n.label,type:n.type,validate:n.validate}),u=t.computed((()=>l.errors));return{id:Array.isArray(l.id)?l.id[l.id.length-1]:l.id,path:e,value:r,errors:u,meta:l,initialValue:a,flags:l.__flags,setState:function(a){var l,u,o;"value"in a&&(r.value=a.value),"errors"in a&&(null===(l=n.form)||void 0===l||l.setFieldError(t.unref(e),a.errors)),"touched"in a&&(null===(u=n.form)||void 0===u||u.setFieldTouched(t.unref(e),null!==(o=a.touched)&&void 0!==o&&o)),"initialValue"in a&&i(a.initialValue)}}}function le(e,n,r){return m(null==r?void 0:r.type)?function(e,n,r){const a=(null==r?void 0:r.standalone)?void 0:B(o),i=null==r?void 0:r.checkedValue,l=null==r?void 0:r.uncheckedValue;function u(n){const r=n.handleChange,u=t.computed((()=>{const e=t.unref(n.value),r=t.unref(i);return Array.isArray(e)?e.findIndex((e=>F(e,r)))>=0:F(r,e)}));function o(o,s=!0){var d;if(u.value===(null===(d=null==o?void 0:o.target)||void 0===d?void 0:d.checked))return void(s&&n.validate());const c=N(e),v=null==a?void 0:a.getPathState(c),f=W(o);let p;p=a&&(null==v?void 0:v.multiple)&&"checkbox"===v.type?T(E(a.values,c)||[],f,void 0):T(t.unref(n.value),t.unref(i),t.unref(l)),r(p,s)}return Object.assign(Object.assign({},n),{checked:u,checkedValue:i,uncheckedValue:l,handleChange:o})}return u(ue(e,n,r))}(e,n,r):ue(e,n,r)}function ue(e,r,a){const{initialValue:i,validateOnMount:l,bails:u,type:c,checkedValue:m,label:h,validateOnValueUpdate:y,uncheckedValue:g,controlled:b,keepValueOnUnmount:O,modelPropName:V,syncVModel:A,form:j}=function(e){var n;const r=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,modelPropName:"modelValue",syncVModel:!0,controlled:!0}),a=null===(n=null==e?void 0:e.syncVModel)||void 0===n||n,i=a&&!("initialValue"in(e||{}))?oe(t.getCurrentInstance(),(null==e?void 0:e.modelPropName)||"modelValue"):null==e?void 0:e.initialValue;if(!e)return Object.assign(Object.assign({},r()),{initialValue:i});const l="valueProp"in e?e.valueProp:e.checkedValue,u="standalone"in e?!e.standalone:e.controlled;return Object.assign(Object.assign(Object.assign({},r()),e||{}),{initialValue:i,controlled:null==u||u,checkedValue:l})}(a),S=b?B(o):void 0,k=j||S,I=function(e){return t.computed((()=>N(e)))}(e),C=t.computed((()=>{if(t.unref(null==k?void 0:k.schema))return;const e=t.unref(r);return p(e)||f(e)||n(e)||Array.isArray(e)?e:G(e)})),{id:_,value:T,initialValue:U,meta:x,setState:$,errors:D,flags:z}=ie(I,{modelValue:i,form:k,bails:u,label:h,type:c,validate:C.value?H:void 0}),q=t.computed((()=>D.value[0]));A&&function({prop:e,value:n,handleChange:r}){const a=t.getCurrentInstance();if(!a)return;const i=e||"modelValue",l=`update:${i}`;if(!(i in a.props))return;t.watch(n,(e=>{F(e,oe(a,i))||a.emit(l,e)})),t.watch((()=>oe(a,i)),(e=>{if(e===d&&void 0===n.value)return;const t=e===d?void 0:e;F(t,P(n.value,a.props.modelModifiers))||r(t)}))}({value:T,prop:V,handleChange:J});async function L(e){var n,r;return(null==k?void 0:k.validateSchema)?null!==(n=(await k.validateSchema(e)).results[t.unref(I)])&&void 0!==n?n:{valid:!0,errors:[]}:C.value?Z(T.value,C.value,{name:t.unref(I),label:t.unref(h),values:null!==(r=null==k?void 0:k.values)&&void 0!==r?r:{},bails:u}):{valid:!0,errors:[]}}const K=R((async()=>(x.pending=!0,x.validated=!0,L("validated-only"))),(e=>{if(!z.pendingUnmount[te.id])return $({errors:e.errors}),x.pending=!1,x.valid=e.valid,e})),X=R((async()=>L("silent")),(e=>(x.valid=e.valid,e)));function H(e){return"silent"===(null==e?void 0:e.mode)?X():K()}function J(e,t=!0){Y(W(e),t)}function Q(e){var t;const n=e&&"value"in e?e.value:U.value;$({value:w(n),initialValue:w(n),touched:null!==(t=null==e?void 0:e.touched)&&void 0!==t&&t,errors:(null==e?void 0:e.errors)||[]}),x.pending=!1,x.validated=!1,X()}function Y(e,t=!0){if(T.value=e,!t)return void X();(t?K:X)()}t.onMounted((()=>{if(l)return K();k&&k.validateSchema||X()}));const ee=t.computed({get:()=>T.value,set(e){Y(e,y)}}),te={id:_,name:I,label:h,value:ee,meta:x,errors:D,errorMessage:q,type:c,checkedValue:m,uncheckedValue:g,bails:u,keepValueOnUnmount:O,resetField:Q,handleReset:()=>Q(),validate:H,handleChange:J,handleBlur:()=>{x.touched=!0},setState:$,setTouched:function(e){x.touched=e},setErrors:function(e){$({errors:Array.isArray(e)?e:[e]})},setValue:Y};if(t.provide(s,te),t.isRef(r)&&"function"!=typeof t.unref(r)&&t.watch(r,((e,t)=>{F(e,t)||(x.validated?K():X())}),{deep:!0}),!k)return te;const ne=t.computed((()=>{const e=C.value;return!e||n(e)||p(e)||f(e)||Array.isArray(e)?{}:Object.keys(e).reduce(((t,n)=>{const r=(a=e[n],Array.isArray(a)?a.filter(v):M(a).filter((e=>v(a[e]))).map((e=>a[e]))).map((e=>e.__locatorRef)).reduce(((e,t)=>{const n=E(k.values,t)||k.values[t];return void 0!==n&&(e[t]=n),e}),{});var a;return Object.assign(t,r),t}),{})}));return t.watch(ne,((e,t)=>{if(!Object.keys(e).length)return;!F(e,t)&&(x.validated?K():X())})),t.onBeforeUnmount((()=>{var e;const n=null!==(e=t.unref(te.keepValueOnUnmount))&&void 0!==e?e:t.unref(k.keepValuesOnUnmount),r=N(I);if(n||!k||z.pendingUnmount[te.id])return void(null==k||k.removePathState(r,_));z.pendingUnmount[te.id]=!0;const a=k.getPathState(r);if(Array.isArray(null==a?void 0:a.id)&&(null==a?void 0:a.multiple)?null==a?void 0:a.id.includes(te.id):(null==a?void 0:a.id)===te.id){if((null==a?void 0:a.multiple)&&Array.isArray(a.value)){const e=a.value.findIndex((e=>F(e,t.unref(te.checkedValue))));if(e>-1){const t=[...a.value];t.splice(e,1),k.setFieldValue(r,t)}Array.isArray(a.id)&&a.id.splice(a.id.indexOf(te.id),1)}else k.unsetPathValue(N(I));k.removePathState(r,_)}})),te}function oe(e,t){if(e)return e.props[t]}function se(e,t){let n=e.as||"";return e.as||t.slots.default||(n="input"),n}function de(e,t){return m(t.attrs.type)?V(e,"modelValue")?e.modelValue:void 0:V(e,"modelValue")?e.modelValue:t.attrs.value}const ce=t.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>Q().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:d},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(e,r){const a=t.toRef(e,"rules"),i=t.toRef(e,"name"),l=t.toRef(e,"label"),u=t.toRef(e,"uncheckedValue"),o=t.toRef(e,"keepValue"),{errors:s,value:d,errorMessage:c,validate:v,handleChange:f,handleBlur:p,setTouched:h,resetField:y,handleReset:b,meta:O,checked:V,setErrors:F}=le(i,a,{validateOnMount:e.validateOnMount,bails:e.bails,standalone:e.standalone,type:r.attrs.type,initialValue:de(e,r),checkedValue:r.attrs.value,uncheckedValue:u,label:l,validateOnValueUpdate:!1,keepValueOnUnmount:o}),A=function(e,t=!0){f(e,t),r.emit("update:modelValue",d.value)},j=t.computed((()=>{const{validateOnInput:t,validateOnChange:a,validateOnBlur:i,validateOnModelUpdate:l}=function(e){var t,n,r,a;const{validateOnInput:i,validateOnChange:l,validateOnBlur:u,validateOnModelUpdate:o}=Q();return{validateOnInput:null!==(t=e.validateOnInput)&&void 0!==t?t:i,validateOnChange:null!==(n=e.validateOnChange)&&void 0!==n?n:l,validateOnBlur:null!==(r=e.validateOnBlur)&&void 0!==r?r:u,validateOnModelUpdate:null!==(a=e.validateOnModelUpdate)&&void 0!==a?a:o}}(e);const u={name:e.name,onBlur:function(e){p(e),n(r.attrs.onBlur)&&r.attrs.onBlur(e),i&&v()},onInput:function(e){A(e,t),n(r.attrs.onInput)&&r.attrs.onInput(e)},onChange:function(e){A(e,a),n(r.attrs.onChange)&&r.attrs.onChange(e)},"onUpdate:modelValue":e=>A(e,l)};return u})),w=t.computed((()=>{const t=Object.assign({},j.value);m(r.attrs.type)&&V&&(t.checked=V.value);return g(se(e,r),r.attrs)&&(t.value=d.value),t})),S=t.computed((()=>Object.assign(Object.assign({},j.value),{modelValue:d.value})));function E(){return{field:w.value,componentField:S.value,value:d.value,meta:O,errors:s.value,errorMessage:c.value,validate:v,resetField:y,handleChange:A,handleInput:e=>A(e,!1),handleReset:b,handleBlur:p,setTouched:h,setErrors:F}}return r.expose({setErrors:F,setTouched:h,reset:y,validate:v,handleChange:f}),()=>{const n=t.resolveDynamicComponent(se(e,r)),a=q(n,r,E);return n?t.h(n,Object.assign(Object.assign({},r.attrs),w.value),a):a}}});let ve=0;const fe=["bails","fieldsCount","id","multiple","type","validate"];function pe(e){const r=t.unref(null==e?void 0:e.initialValues)||{},a=t.unref(null==e?void 0:e.validationSchema);return a&&f(a)&&n(a.cast)?w(a.cast(r)||{}):w(r)}function me(e){var r;const a=ve++;let i=0;const u=t.ref(!1),s=t.ref(!1),d=t.ref(0),c=[],v=t.reactive(pe(e)),m=t.ref([]),h=t.ref({});function y(e,t){const n=H(e);n?(n.errors=$(t),n.valid=!n.errors.length):"string"==typeof e&&(h.value[e]=$(t))}function g(e){M(e).forEach((t=>{y(t,e[t])}))}(null==e?void 0:e.initialErrors)&&g(e.initialErrors);const O=t.computed((()=>{const e=m.value.reduce(((e,t)=>(t.errors.length&&(e[t.path]=t.errors),e)),{});return Object.assign(Object.assign({},h.value),e)})),V=t.computed((()=>M(O.value).reduce(((e,t)=>{const n=O.value[t];return(null==n?void 0:n.length)&&(e[t]=n[0]),e}),{}))),A=t.computed((()=>m.value.reduce(((e,t)=>(e[t.path]={name:t.path||"",label:t.label||""},e)),{}))),j=t.computed((()=>m.value.reduce(((e,t)=>{var n;return e[t.path]=null===(n=t.bails)||void 0===n||n,e}),{}))),S=Object.assign({},(null==e?void 0:e.initialErrors)||{}),I=null!==(r=null==e?void 0:e.keepValuesOnUnmount)&&void 0!==r&&r,{initialValues:B,originalInitialValues:_,setInitialValues:T}=function(e,n,r){const a=pe(r),i=null==r?void 0:r.initialValues,l=t.ref(a),u=t.ref(w(a));function o(t,r=!1){l.value=w(t),u.value=w(t),r&&e.value.forEach((e=>{if(e.touched)return;const t=E(l.value,e.path);k(n,e.path,w(t))}))}t.isRef(i)&&t.watch(i,(e=>{e&&o(e,!0)}),{deep:!0});return{initialValues:l,originalInitialValues:u,setInitialValues:o}}(m,v,e),P=function(e,n,r,a){const i={touched:"some",pending:"some",valid:"every"},l=t.computed((()=>!F(n,t.unref(r))));function u(){const t=e.value;return M(i).reduce(((e,n)=>{const r=i[n];return e[n]=t[r]((e=>e[n])),e}),{})}const o=t.reactive(u());return t.watchEffect((()=>{const e=u();o.touched=e.touched,o.valid=e.valid,o.pending=e.pending})),t.computed((()=>Object.assign(Object.assign({initialValues:t.unref(r)},o),{valid:o.valid&&!M(a.value).length,dirty:l.value})))}(m,v,_,V),x=t.computed((()=>m.value.reduce(((e,t)=>{const n=E(v,t.path);return k(e,t.path,n),e}),{}))),D=null==e?void 0:e.validationSchema;function q(e,n){var r,a;const l=t.computed((()=>E(B.value,N(e)))),u=m.value.find((n=>n.path===t.unref(e)));if(u){"checkbox"!==(null==n?void 0:n.type)&&"radio"!==(null==n?void 0:n.type)||(u.multiple=!0);const e=i++;return Array.isArray(u.id)?u.id.push(e):u.id=[u.id,e],u.fieldsCount++,u.__flags.pendingUnmount[e]=!1,u}const o=t.computed((()=>E(v,N(e)))),s=N(e),d=i++,c=t.reactive({id:d,path:e,touched:!1,pending:!1,valid:!0,validated:!!(null===(r=S[s])||void 0===r?void 0:r.length),initialValue:l,errors:t.shallowRef([]),bails:null!==(a=null==n?void 0:n.bails)&&void 0!==a&&a,label:null==n?void 0:n.label,type:(null==n?void 0:n.type)||"default",value:o,multiple:!1,__flags:{pendingUnmount:{[d]:!1}},fieldsCount:1,validate:null==n?void 0:n.validate,dirty:t.computed((()=>!F(t.unref(o),t.unref(l))))});return m.value.push(c),V.value[s]&&!S[s]&&t.nextTick((()=>{me(s)})),t.isRef(e)&&t.watch(e,(e=>{const n=w(o.value);t.nextTick((()=>{k(v,e,n)}))})),c}const L=U(ge,5),K=U(ge,5),G=R((async e=>"silent"===await e?L():K()),((e,[t])=>{const n=M(ne.errorBag.value);return[...new Set([...M(e.results),...m.value.map((e=>e.path)),...n])].sort().reduce(((n,r)=>{const a=r,i=H(a)||function(e){const t=m.value.filter((t=>e.startsWith(t.path)));return t.reduce(((e,t)=>e?t.path.length>e.path.length?t:e:t),void 0)}(a),l=(e.results[a]||{errors:[]}).errors,u={errors:l,valid:!l.length};return n.results[a]=u,u.valid||(n.errors[a]=u.errors[0]),i&&h.value[a]&&delete h.value[a],i?(i.valid=u.valid,"silent"===t?n:"validated-only"!==t||i.validated?(y(i,u.errors),n):n):(y(a,l),n)}),{valid:e.valid,results:{},errors:{}})}));function X(e){m.value.forEach(e)}function H(e){return"string"==typeof e?m.value.find((t=>t.path===e)):e}let J,Y=[];function Z(e){return function(t,n){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),X((e=>e.touched=!0)),u.value=!0,d.value++,ce().then((a=>{const i=w(v);if(a.valid&&"function"==typeof t){const n=w(x.value);let l=e?n:i;return a.values&&(l=a.values),t(l,{evt:r,controlledValues:n,setErrors:g,setFieldError:y,setTouched:oe,setFieldTouched:ue,setValues:ie,setFieldValue:ae,resetForm:de,resetField:se})}a.valid||"function"!=typeof n||n({values:i,evt:r,errors:a.errors,results:a.results})})).then((e=>(u.value=!1,e)),(e=>{throw u.value=!1,e}))}}}const te=Z(!1);te.withControlled=Z(!0);const ne={formId:a,values:v,controlledValues:x,errorBag:O,errors:V,schema:D,submitCount:d,meta:P,isSubmitting:u,isValidating:s,fieldArrays:c,keepValuesOnUnmount:I,validateSchema:t.unref(D)?G:void 0,validate:ce,setFieldError:y,validateField:me,setFieldValue:ae,setValues:ie,setErrors:g,setFieldTouched:ue,setTouched:oe,resetForm:de,resetField:se,handleSubmit:te,stageInitialValue:function(t,n,r=!1){ye(t,n),k(v,t,n),r&&!(null==e?void 0:e.initialValues)&&k(_.value,t,w(n))},unsetInitialValue:he,setFieldInitialValue:ye,useFieldModel:function(e){if(!Array.isArray(e))return le(e);return e.map(le)},createPathState:q,getPathState:H,unsetPathValue:function(e){return Y.push(e),J||(J=t.nextTick((()=>{[...Y].sort().reverse().forEach((e=>{C(v,e)})),Y=[],J=null}))),J},removePathState:function(e,t){const n=m.value.findIndex((t=>t.path===e)),r=m.value[n];if(-1!==n&&r){if(r.multiple&&r.fieldsCount&&r.fieldsCount--,Array.isArray(r.id)){const e=r.id.indexOf(t);e>=0&&r.id.splice(e,1),delete r.__flags.pendingUnmount[t]}(!r.multiple||r.fieldsCount<=0)&&(m.value.splice(n,1),he(e))}},initialValues:B,getAllPathStates:()=>m.value,markForUnmount:function(e){return X((t=>{t.path.startsWith(e)&&M(t.__flags.pendingUnmount).forEach((e=>{t.__flags.pendingUnmount[e]=!0}))}))}};function ae(e,t){const n=w(t),r="string"==typeof e?e:e.path;H(r)||q(r),k(v,r,n)}function ie(e){l(v,e),c.forEach((e=>e&&e.reset()))}function le(e){const n=H(t.unref(e))||q(e);return t.computed({get:()=>n.value,set(r){const a=t.unref(e);ae(a,r),n.validated=!0,n.pending=!0,me(a).then((()=>{n.pending=!1}))}})}function ue(e,t){const n=H(e);n&&(n.touched=t)}function oe(e){M(e).forEach((t=>{ue(t,!!e[t])}))}function se(e,t){var n;const r=t&&"value"in t?t.value:E(B.value,e);ye(e,w(r)),ae(e,r),ue(e,null!==(n=null==t?void 0:t.touched)&&void 0!==n&&n),y(e,(null==t?void 0:t.errors)||[])}function de(e){const n=(null==e?void 0:e.values)?e.values:_.value;T(n),ie(n),X((t=>{var r;t.validated=!1,t.touched=(null===(r=null==e?void 0:e.touched)||void 0===r?void 0:r[t.path])||!1,ae(t.path,E(n,t.path)),y(t.path,void 0)})),g((null==e?void 0:e.errors)||{}),d.value=(null==e?void 0:e.submitCount)||0,t.nextTick((()=>{ce({mode:"silent"})}))}async function ce(e){const t=(null==e?void 0:e.mode)||"force";if("force"===t&&X((e=>e.validated=!0)),ne.validateSchema)return ne.validateSchema(t);s.value=!0;const n=await Promise.all(m.value.map((t=>t.validate?t.validate(e).then((e=>({key:t.path,valid:e.valid,errors:e.errors}))):Promise.resolve({key:t.path,valid:!0,errors:[]}))));s.value=!1;const r={},a={};for(const e of n)r[e.key]={valid:e.valid,errors:e.errors},e.errors.length&&(a[e.key]=e.errors[0]);return{valid:n.every((e=>e.valid)),results:r,errors:a}}async function me(e){const n=H(e);if(n&&(n.validated=!0),D){const{results:t}=await G("validated-only");return t[e]||{errors:[],valid:!0}}return(null==n?void 0:n.validate)?n.validate():(n||t.warn(`field with path ${e} was not found`),Promise.resolve({errors:[],valid:!0}))}function he(e){C(B.value,e)}function ye(e,t){k(B.value,e,w(t))}async function ge(){const e=t.unref(D);if(!e)return{valid:!0,results:{},errors:{}};s.value=!0;const n=p(e)||f(e)?await async function(e,t){const n=f(e)?e:ee(e),r=await n.parse(t),a={},i={};for(const e of r.errors){const t=e.errors,n=(e.path||"").replace(/\["(\d+)"\]/g,((e,t)=>`[${t}]`));a[n]={valid:!t.length,errors:t},t.length&&(i[n]=t[0])}return{valid:!r.errors.length,results:a,errors:i,values:r.value}}(e,v):await re(e,v,{names:A.value,bailsMap:j.value});return s.value=!1,n}const be=te(((e,{evt:t})=>{b(t)&&t.target.submit()}));return t.onMounted((()=>{(null==e?void 0:e.initialErrors)&&g(e.initialErrors),(null==e?void 0:e.initialTouched)&&oe(e.initialTouched),(null==e?void 0:e.validateOnMount)?ce():ne.validateSchema&&ne.validateSchema("silent")})),t.isRef(D)&&t.watch(D,(()=>{var e;null===(e=ne.validateSchema)||void 0===e||e.call(ne,"validated-only")})),t.provide(o,ne),Object.assign(Object.assign({},ne),{handleReset:()=>de(),submitForm:be,defineComponentBinds:function(e,r){const a=H(N(e))||q(e),i=()=>n(r)?r(z(a,fe)):r||{};function l(){var e;a.touched=!0;(null!==(e=i().validateOnBlur)&&void 0!==e?e:Q().validateOnBlur)&&me(a.path)}function u(e){var t;ae(a.path,e);(null!==(t=i().validateOnModelUpdate)&&void 0!==t?t:Q().validateOnModelUpdate)&&me(a.path)}return t.computed((()=>{const e={modelValue:a.value,"onUpdate:modelValue":u,onBlur:l};return n(r)?Object.assign(Object.assign({},e),r(a).props||{}):(null==r?void 0:r.mapProps)?Object.assign(Object.assign({},e),r.mapProps(z(a,fe))):e}))},defineInputBinds:function(e,r){const a=H(N(e))||q(e),i=()=>n(r)?r(z(a,fe)):r||{};function l(){var e;a.touched=!0;(null!==(e=i().validateOnBlur)&&void 0!==e?e:Q().validateOnBlur)&&me(a.path)}function u(e){var t;const n=W(e);ae(a.path,n);(null!==(t=i().validateOnInput)&&void 0!==t?t:Q().validateOnInput)&&me(a.path)}function o(e){var t;const n=W(e);ae(a.path,n);(null!==(t=i().validateOnChange)&&void 0!==t?t:Q().validateOnChange)&&me(a.path)}return t.computed((()=>{const e={value:a.value,onChange:o,onInput:u,onBlur:l};return n(r)?Object.assign(Object.assign({},e),r(z(a,fe)).attrs||{}):(null==r?void 0:r.mapAttrs)?Object.assign(Object.assign({},e),r.mapAttrs(z(a,fe))):e}))}})}const he=t.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:String,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(e,n){const r=t.toRef(e,"initialValues"),a=t.toRef(e,"validationSchema"),i=t.toRef(e,"keepValues"),{errors:l,errorBag:u,values:o,meta:s,isSubmitting:d,isValidating:c,submitCount:v,controlledValues:f,validate:p,validateField:m,handleReset:h,resetForm:y,handleSubmit:g,setErrors:V,setFieldError:F,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetField:k}=me({validationSchema:a.value?a:void 0,initialValues:r,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:i}),I=g(((e,{evt:t})=>{b(t)&&t.target.submit()}),e.onInvalidSubmit),C=e.onSubmit?g(e.onSubmit,e.onInvalidSubmit):I;function M(e){O(e)&&e.preventDefault(),h(),"function"==typeof n.attrs.onReset&&n.attrs.onReset()}function B(t,n){return g("function"!=typeof t||n?n:t,e.onInvalidSubmit)(t)}function _(){return w(o)}function T(){return w(s.value)}function U(){return w(l.value)}function P(){return{meta:s.value,errors:l.value,errorBag:u.value,values:o,isSubmitting:d.value,isValidating:c.value,submitCount:v.value,controlledValues:f.value,validate:p,validateField:m,handleSubmit:B,handleReset:h,submitForm:I,setErrors:V,setFieldError:F,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetForm:y,resetField:k,getValues:_,getMeta:T,getErrors:U}}return n.expose({setFieldError:F,setErrors:V,setFieldValue:A,setValues:j,setFieldTouched:S,setTouched:E,resetForm:y,validate:p,validateField:m,resetField:k,getValues:_,getMeta:T,getErrors:U}),function(){const r="form"===e.as?e.as:t.resolveDynamicComponent(e.as),a=q(r,n,P);if(!e.as)return a;const i="form"===e.as?{novalidate:!0}:{};return t.h(r,Object.assign(Object.assign(Object.assign({},i),n.attrs),{onSubmit:C,onReset:M}),a)}}}),ye=he;function ge(e){const n=B(o,void 0),a=t.ref([]),i=()=>{},l={fields:a,remove:i,push:i,swap:i,insert:i,update:i,replace:i,prepend:i,move:i};if(!n)return _("FieldArray requires being a child of `<Form/>` or `useForm` being called before it. Array fields may not work correctly"),l;if(!t.unref(e))return _("FieldArray requires a field path to be provided, did you forget to pass the `name` prop?"),l;const u=n.fieldArrays.find((n=>t.unref(n.path)===t.unref(e)));if(u)return u;let s=0;function d(){return E(null==n?void 0:n.values,t.unref(e),[])||[]}function c(){const e=d();Array.isArray(e)&&(a.value=e.map(((e,t)=>f(e,t,a.value))),v())}function v(){const e=a.value.length;for(let t=0;t<e;t++){const n=a.value[t];n.isFirst=0===t,n.isLast=t===e-1}}function f(i,l,u){if(u&&!r(l)&&u[l])return u[l];const o=s++,d={key:o,value:x({get(){const r=E(null==n?void 0:n.values,t.unref(e),[])||[],l=a.value.findIndex((e=>e.key===o));return-1===l?i:r[l]},set(e){const t=a.value.findIndex((e=>e.key===o));-1!==t?m(t,e):_("Attempting to update a non-existent array item")}}),isFirst:!1,isLast:!1};return d}function p(){v(),null==n||n.validate({mode:"silent"})}function m(r,a){const i=t.unref(e),l=E(null==n?void 0:n.values,i);!Array.isArray(l)||l.length-1<r||(k(n.values,`${i}[${r}]`,a),null==n||n.validate({mode:"validated-only"}))}c();const h={fields:a,remove:function(r){const i=t.unref(e),l=E(null==n?void 0:n.values,i);if(!l||!Array.isArray(l))return;const u=[...l];u.splice(r,1);const o=i+`[${r}]`;n.markForUnmount(o),n.unsetInitialValue(o),k(n.values,i,u),a.value.splice(r,1),p()},push:function(i){const l=t.unref(e),u=E(null==n?void 0:n.values,l),o=r(u)?[]:u;if(!Array.isArray(o))return;const s=[...o];s.push(i),n.stageInitialValue(l+`[${s.length-1}]`,i),k(n.values,l,s),a.value.push(f(i)),p()},swap:function(r,i){const l=t.unref(e),u=E(null==n?void 0:n.values,l);if(!Array.isArray(u)||!(r in u)||!(i in u))return;const o=[...u],s=[...a.value],d=o[r];o[r]=o[i],o[i]=d;const c=s[r];s[r]=s[i],s[i]=c,k(n.values,l,o),a.value=s,v()},insert:function(r,i){const l=t.unref(e),u=E(null==n?void 0:n.values,l);if(!Array.isArray(u)||u.length<r)return;const o=[...u],s=[...a.value];o.splice(r,0,i),s.splice(r,0,f(i)),k(n.values,l,o),a.value=s,p()},update:m,replace:function(r){const a=t.unref(e);n.stageInitialValue(a,r),k(n.values,a,r),c(),p()},prepend:function(i){const l=t.unref(e),u=E(null==n?void 0:n.values,l),o=r(u)?[]:u;if(!Array.isArray(o))return;const s=[i,...o];n.stageInitialValue(l+`[${s.length-1}]`,i),k(n.values,l,s),a.value.unshift(f(i)),p()},move:function(i,l){const u=t.unref(e),o=E(null==n?void 0:n.values,u),s=r(o)?[]:[...o];if(!Array.isArray(o)||!(i in o)||!(l in o))return;const d=[...a.value],c=d[i];d.splice(i,1),d.splice(l,0,c);const v=s[i];s.splice(i,1),s.splice(l,0,v),k(n.values,u,s),a.value=d,p()}};return n.fieldArrays.push(Object.assign({path:e,reset:c},h)),t.onBeforeUnmount((()=>{const r=n.fieldArrays.findIndex((n=>t.unref(n.path)===t.unref(e)));r>=0&&n.fieldArrays.splice(r,1)})),t.watch(d,(e=>{F(e,a.value.map((e=>e.value)))||c()})),h}const be=t.defineComponent({name:"FieldArray",inheritAttrs:!1,props:{name:{type:String,required:!0}},setup(e,n){const{push:r,remove:a,swap:i,insert:l,replace:u,update:o,prepend:s,move:d,fields:c}=ge(t.toRef(e,"name"));function v(){return{fields:c.value,push:r,remove:a,swap:i,insert:l,update:o,replace:u,prepend:s,move:d}}return n.expose({push:r,remove:a,swap:i,insert:l,update:o,replace:u,prepend:s,move:d}),()=>q(void 0,n,v)}}),Oe=t.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,n){const r=t.inject(o,void 0),a=t.computed((()=>null==r?void 0:r.errors.value[e.name]));function i(){return{message:a.value}}return()=>{if(!a.value)return;const r=e.as?t.resolveDynamicComponent(e.as):e.as,l=q(r,n,i),u=Object.assign({role:"alert"},n.attrs);return r||!Array.isArray(l)&&l||!(null==l?void 0:l.length)?!Array.isArray(l)&&l||(null==l?void 0:l.length)?t.h(r,u,l):t.h(r||"span",u,a.value):l}}});e.ErrorMessage=Oe,e.Field=ce,e.FieldArray=be,e.FieldContextKey=s,e.Form=ye,e.FormContextKey=o,e.IS_ABSENT=d,e.configure=Y,e.defineRule=function(e,t){!function(e,t){if(n(t))return;throw new Error(`Extension Error: The validator '${e}' must be a function.`)}(e,t),u[e]=t},e.useField=le,e.useFieldArray=ge,e.useFieldError=function(e){const n=B(o),r=e?void 0:t.inject(s);return t.computed((()=>e?null==n?void 0:n.errors.value[t.unref(e)]:null==r?void 0:r.errorMessage.value))},e.useFieldValue=function(e){const n=B(o),r=e?void 0:t.inject(s);return t.computed((()=>e?E(null==n?void 0:n.values,t.unref(e)):t.unref(null==r?void 0:r.value)))},e.useForm=me,e.useFormErrors=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.errors.value)||{}))},e.useFormValues=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>(null==e?void 0:e.values)||{}))},e.useIsFieldDirty=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.dirty:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.dirty)&&void 0!==t&&t)}))},e.useIsFieldTouched=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.touched:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.touched)&&void 0!==t&&t)}))},e.useIsFieldValid=function(e){const n=D(e);return t.computed((()=>{var e,t;return!!n&&(null!==(t="meta"in n?n.meta.valid:null===(e=null==n?void 0:n.value)||void 0===e?void 0:e.valid)&&void 0!==t&&t)}))},e.useIsFormDirty=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.dirty)&&void 0!==t&&t}))},e.useIsFormTouched=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.touched)&&void 0!==t&&t}))},e.useIsFormValid=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.meta.value.valid)&&void 0!==t&&t}))},e.useIsSubmitting=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isSubmitting.value)&&void 0!==t&&t}))},e.useIsValidating=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.isValidating.value)&&void 0!==t&&t}))},e.useResetForm=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(t){if(e)return e.resetForm(t)}},e.useSubmitCount=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),t.computed((()=>{var t;return null!==(t=null==e?void 0:e.submitCount.value)&&void 0!==t?t:0}))},e.useSubmitForm=function(e){const t=B(o);t||_("No vee-validate <Form /> or `useForm` was detected in the component tree");const n=t?t.handleSubmit(e):void 0;return function(e){if(n)return n(e)}},e.useValidateField=function(e){const n=B(o),r=e?void 0:t.inject(s);return function(){return r?r.validate():n&&e?null==n?void 0:n.validateField(t.unref(e)):(_(`field with name ${t.unref(e)} was not found`),Promise.resolve({errors:[],valid:!0}))}},e.useValidateForm=function(){const e=B(o);return e||_("No vee-validate <Form /> or `useForm` was detected in the component tree"),function(){return e?e.validate():Promise.resolve({results:{},errors:{},valid:!0})}},e.validate=Z,e.validateObject=re}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vee-validate",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.5",
|
|
4
4
|
"description": "Form Validation for Vue.js",
|
|
5
5
|
"author": "Abdelrahman Awad <logaretm1@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dist/*.d.ts"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"vue": "^3.
|
|
31
|
+
"vue": "^3.3.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@vue/devtools-api": "^6.5.0",
|