vee-validate 4.12.0-alpha.0 → 4.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { MaybeRefOrGetter, Ref, MaybeRef, ComputedRef, VNode, PropType, UnwrapRef, InjectionKey } from 'vue';
2
+ import { MaybeRef, Ref, MaybeRefOrGetter, ComputedRef, PropType, VNode, UnwrapRef, InjectionKey } from 'vue';
3
3
  import { PartialDeep } from 'type-fest';
4
4
 
5
5
  type BrowserNativeObject = Date | FileList | File;
@@ -133,6 +133,9 @@ type MaybePromise<T> = T | Promise<T>;
133
133
  type FlattenAndSetPathsType<TRecord, TType> = {
134
134
  [K in Path<TRecord>]: TType;
135
135
  };
136
+ type MapValuesPathsToRefs<TValues extends GenericObject, TPaths extends readonly [...MaybeRef<Path<TValues>>[]]> = {
137
+ readonly [K in keyof TPaths]: TPaths[K] extends MaybeRef<infer TKey> ? TKey extends Path<TValues> ? Ref<PathValue<TValues, TKey>> : Ref<unknown> : Ref<unknown>;
138
+ };
136
139
 
137
140
  interface FieldValidationMetaInfo {
138
141
  field: string;
@@ -157,6 +160,10 @@ interface TypedSchemaError {
157
160
  path?: string;
158
161
  errors: string[];
159
162
  }
163
+ interface TypedSchemaPathDescription {
164
+ required: boolean;
165
+ exists: boolean;
166
+ }
160
167
  interface TypedSchema<TInput = any, TOutput = TInput> {
161
168
  __type: 'VVTypedSchema';
162
169
  parse(values: TInput): Promise<{
@@ -164,6 +171,7 @@ interface TypedSchema<TInput = any, TOutput = TInput> {
164
171
  errors: TypedSchemaError[];
165
172
  }>;
166
173
  cast?(values: Partial<TInput>): TInput;
174
+ describe?(path?: Path<TInput>): Partial<TypedSchemaPathDescription>;
167
175
  }
168
176
  type InferOutput<TSchema extends TypedSchema> = TSchema extends TypedSchema<any, infer TOutput> ? TOutput : never;
169
177
  type InferInput<TSchema extends TypedSchema> = TSchema extends TypedSchema<infer TInput, any> ? TInput : never;
@@ -179,6 +187,7 @@ interface FieldMeta<TValue> {
179
187
  dirty: boolean;
180
188
  valid: boolean;
181
189
  validated: boolean;
190
+ required: boolean;
182
191
  pending: boolean;
183
192
  initialValue?: TValue;
184
193
  }
@@ -212,6 +221,7 @@ interface PathStateConfig {
212
221
  label: MaybeRefOrGetter<string | undefined>;
213
222
  type: InputType;
214
223
  validate: FieldValidator;
224
+ schema?: TypedSchema;
215
225
  }
216
226
  interface PathState<TValue = unknown> {
217
227
  id: number | number[];
@@ -219,6 +229,7 @@ interface PathState<TValue = unknown> {
219
229
  touched: boolean;
220
230
  dirty: boolean;
221
231
  valid: boolean;
232
+ required: boolean;
222
233
  validated: boolean;
223
234
  pending: boolean;
224
235
  initialValue: TValue | undefined;
@@ -254,7 +265,7 @@ interface FieldArrayContext<TValue = unknown> {
254
265
  }
255
266
  interface PrivateFieldArrayContext<TValue = unknown> extends FieldArrayContext<TValue> {
256
267
  reset(): void;
257
- path: MaybeRef<string>;
268
+ path: MaybeRefOrGetter<string>;
258
269
  }
259
270
  interface PrivateFieldContext<TValue = unknown> {
260
271
  id: number;
@@ -324,6 +335,54 @@ type InvalidSubmissionHandler<TValues extends GenericObject = GenericObject> = (
324
335
  type RawFormSchema<TValues> = Record<Path<TValues>, string | GenericValidateFunction | GenericObject>;
325
336
  type FieldPathLookup<TValues extends GenericObject = GenericObject> = Partial<Record<Path<TValues>, PrivateFieldContext | PrivateFieldContext[]>>;
326
337
  type HandleSubmitFactory<TValues extends GenericObject, TOutput = TValues> = <TReturn = unknown>(cb: SubmissionHandler<TValues, TOutput, TReturn>, onSubmitValidationErrorCb?: InvalidSubmissionHandler<TValues>) => (e?: Event) => Promise<TReturn | undefined>;
338
+ type PublicPathState<TValue = unknown> = Omit<PathState<TValue>, 'bails' | 'label' | 'multiple' | 'fieldsCount' | 'validate' | 'id' | 'type' | '__flags'>;
339
+ interface BaseFieldProps {
340
+ onBlur: (e: Event) => void;
341
+ onChange: (e: Event) => void;
342
+ onInput: (e: Event) => void;
343
+ }
344
+ interface InputBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject> {
345
+ props: (state: PublicPathState<TValue>) => TExtraProps;
346
+ validateOnBlur: boolean;
347
+ label: MaybeRefOrGetter<string>;
348
+ validateOnChange: boolean;
349
+ validateOnInput: boolean;
350
+ validateOnModelUpdate: boolean;
351
+ }
352
+ type LazyInputBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject> = (state: PublicPathState<TValue>) => Partial<{
353
+ props: TExtraProps;
354
+ validateOnBlur: boolean;
355
+ validateOnChange: boolean;
356
+ validateOnInput: boolean;
357
+ validateOnModelUpdate: boolean;
358
+ }>;
359
+ interface ComponentBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject, TModel extends string = 'modelValue'> {
360
+ mapProps: (state: PublicPathState<TValue>) => TExtraProps;
361
+ validateOnBlur: boolean;
362
+ validateOnModelUpdate: boolean;
363
+ model: TModel;
364
+ }
365
+ type LazyComponentBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject, TModel extends string = 'modelValue'> = (state: PublicPathState<TValue>) => Partial<{
366
+ props: TExtraProps;
367
+ validateOnBlur: boolean;
368
+ validateOnModelUpdate: boolean;
369
+ model: TModel;
370
+ }>;
371
+ interface ComponentModellessBinds {
372
+ onBlur: () => void;
373
+ }
374
+ type ComponentModelBinds<TValue = any, TModel extends string = 'modelValue'> = ComponentModellessBinds & {
375
+ [TKey in `onUpdate:${TModel}`]: (value: TValue) => void;
376
+ };
377
+ type BaseComponentBinds<TValue = any, TModel extends string = 'modelValue'> = ComponentModelBinds<TValue, TModel> & {
378
+ [k in TModel]: TValue;
379
+ };
380
+ interface BaseInputBinds<TValue = unknown> {
381
+ value: TValue | undefined;
382
+ onBlur: (e: Event) => void;
383
+ onChange: (e: Event) => void;
384
+ onInput: (e: Event) => void;
385
+ }
327
386
  interface PrivateFormContext<TValues extends GenericObject = GenericObject, TOutput = TValues> extends FormActions<TValues> {
328
387
  formId: number;
329
388
  values: TValues;
@@ -352,36 +411,32 @@ interface PrivateFormContext<TValues extends GenericObject = GenericObject, TOut
352
411
  getAllPathStates(): PathState[];
353
412
  removePathState<TPath extends Path<TValues>>(path: TPath, id: number): void;
354
413
  unsetPathValue<TPath extends Path<TValues>>(path: TPath): void;
355
- markForUnmount(path: string): void;
414
+ destroyPath(path: string): void;
356
415
  isFieldTouched<TPath extends Path<TValues>>(path: TPath): boolean;
357
416
  isFieldDirty<TPath extends Path<TValues>>(path: TPath): boolean;
358
417
  isFieldValid<TPath extends Path<TValues>>(path: TPath): boolean;
418
+ defineField<TPath extends Path<TValues>, TValue = PathValue<TValues, TPath>, TExtras extends GenericObject = GenericObject>(path: MaybeRefOrGetter<TPath>, config?: Partial<InputBindsConfig<TValue, TExtras>> | LazyInputBindsConfig<TValue, TExtras>): [Ref<TValue>, Ref<BaseFieldProps & TExtras>];
419
+ /**
420
+ * @deprecated use defineField instead
421
+ */
422
+ useFieldModel<TPath extends Path<TValues>>(path: TPath): Ref<PathValue<TValues, TPath>>;
423
+ /**
424
+ * @deprecated use defineField instead
425
+ */
426
+ useFieldModel<TPaths extends readonly [...MaybeRef<Path<TValues>>[]]>(paths: TPaths): MapValuesPathsToRefs<TValues, TPaths>;
427
+ /**
428
+ * @deprecated use defineField instead
429
+ */
430
+ defineComponentBinds<TPath extends Path<TValues>, TValue = PathValue<TValues, TPath>, TModel extends string = 'modelValue', TExtras extends GenericObject = GenericObject>(path: MaybeRefOrGetter<TPath>, config?: Partial<ComponentBindsConfig<TValue, TExtras, TModel>> | LazyComponentBindsConfig<TValue, TExtras, TModel>): Ref<BaseComponentBinds<TValue, TModel> & TExtras>;
431
+ /**
432
+ * @deprecated use defineField instead
433
+ */
434
+ defineInputBinds<TPath extends Path<TValues>, TValue = PathValue<TValues, TPath>, TExtras extends GenericObject = GenericObject>(path: MaybeRefOrGetter<TPath>, config?: Partial<InputBindsConfig<TValue, TExtras>> | LazyInputBindsConfig<TValue, TExtras>): Ref<BaseInputBinds<TValue> & TExtras>;
359
435
  }
360
- type PublicPathState<TValue = unknown> = Omit<PathState<TValue>, 'bails' | 'label' | 'multiple' | 'fieldsCount' | 'validate' | 'id' | 'type' | '__flags'>;
361
- interface BaseFieldProps {
362
- onBlur: (e: Event) => void;
363
- onChange: (e: Event) => void;
364
- onInput: (e: Event) => void;
365
- }
366
- interface InputBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject> {
367
- props: (state: PublicPathState<TValue>) => TExtraProps;
368
- validateOnBlur: boolean;
369
- validateOnChange: boolean;
370
- validateOnInput: boolean;
371
- validateOnModelUpdate: boolean;
372
- }
373
- type LazyInputBindsConfig<TValue = unknown, TExtraProps extends GenericObject = GenericObject> = (state: PublicPathState<TValue>) => Partial<{
374
- props: TExtraProps;
375
- validateOnBlur: boolean;
376
- validateOnChange: boolean;
377
- validateOnInput: boolean;
378
- validateOnModelUpdate: boolean;
379
- }>;
380
436
  interface FormContext<TValues extends GenericObject = GenericObject, TOutput = TValues> extends Omit<PrivateFormContext<TValues, TOutput>, 'formId' | 'schema' | 'initialValues' | 'getPathState' | 'getAllPathStates' | 'removePathState' | 'unsetPathValue' | 'validateSchema' | 'stageInitialValue' | 'setFieldInitialValue' | 'unsetInitialValue' | 'fieldArrays' | 'markForUnmount' | 'keepValuesOnUnmount' | 'values'> {
381
437
  values: TValues;
382
438
  handleReset: () => void;
383
439
  submitForm: (e?: unknown) => Promise<void>;
384
- defineField<TPath extends Path<TValues>, TValue = PathValue<TValues, TPath>, TExtras extends GenericObject = GenericObject>(path: MaybeRefOrGetter<TPath>, config?: Partial<InputBindsConfig<TValue, TExtras>> | LazyInputBindsConfig<TValue, TExtras>): [Ref<TValue>, Ref<BaseFieldProps & TExtras>];
385
440
  }
386
441
 
387
442
  interface DevtoolsPluginFieldState {
@@ -433,6 +488,13 @@ interface VeeValidateConfig {
433
488
  }
434
489
  declare const configure: (newConf: Partial<VeeValidateConfig>) => void;
435
490
 
491
+ /**
492
+ * Checks if the path opted out of nested fields using `[fieldName]` syntax
493
+ */
494
+ declare function isNotNestedPath(path: string): boolean;
495
+
496
+ declare function cleanupNonNestedPath(path: string): string;
497
+
436
498
  /**
437
499
  * Normalizes the given rules expression.
438
500
  */
@@ -497,68 +559,105 @@ declare const Field: {
497
559
  new (...args: any[]): {
498
560
  $: vue.ComponentInternalInstance;
499
561
  $data: {};
500
- $props: {
501
- label?: string;
502
- as?: string | Record<string, any>;
503
- bails?: boolean;
504
- uncheckedValue?: any;
505
- validateOnInput?: boolean;
506
- validateOnChange?: boolean;
507
- validateOnBlur?: boolean;
508
- validateOnModelUpdate?: boolean;
509
- modelValue?: any;
510
- validateOnMount?: boolean;
511
- standalone?: boolean;
512
- modelModifiers?: any;
513
- rules?: RuleExpression<unknown>;
514
- 'onUpdate:modelValue'?: (e: any) => unknown;
515
- keepValue?: boolean;
516
- key?: string | number | symbol;
562
+ $props: Partial<{
563
+ label: string;
564
+ as: string | Record<string, any>;
565
+ bails: boolean;
566
+ uncheckedValue: any;
567
+ modelValue: any;
568
+ validateOnInput: boolean;
569
+ validateOnChange: boolean;
570
+ validateOnBlur: boolean;
571
+ validateOnModelUpdate: boolean;
572
+ rules: RuleExpression<unknown>;
573
+ validateOnMount: boolean;
574
+ modelModifiers: any;
575
+ 'onUpdate:modelValue': (e: any) => unknown;
576
+ standalone: boolean;
577
+ keepValue: boolean;
578
+ }> & Omit<{
517
579
  readonly name: string;
518
- style?: unknown;
519
- class?: unknown;
520
- ref?: vue.VNodeRef;
521
- ref_for?: boolean;
522
- ref_key?: string;
523
- onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
524
- [key: string]: any;
525
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
526
- [key: string]: any;
527
- }>) => void)[];
528
- onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
529
- [key: string]: any;
530
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
531
- [key: string]: any;
532
- }>) => void)[];
533
- onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
534
- [key: string]: any;
535
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
536
- [key: string]: any;
537
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
538
- [key: string]: any;
539
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
540
- [key: string]: any;
541
- }>) => void)[];
542
- onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
543
- [key: string]: any;
544
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
545
- [key: string]: any;
546
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
547
- [key: string]: any;
548
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
549
- [key: string]: any;
550
- }>) => void)[];
551
- onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
552
- [key: string]: any;
553
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
554
- [key: string]: any;
555
- }>) => void)[];
556
- onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
557
- [key: string]: any;
558
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
559
- [key: string]: any;
560
- }>) => void)[];
561
- };
580
+ readonly bails: boolean;
581
+ readonly modelValue: any;
582
+ readonly validateOnMount: boolean;
583
+ readonly modelModifiers: any;
584
+ readonly standalone: boolean;
585
+ readonly label?: string;
586
+ readonly as?: string | Record<string, any>;
587
+ readonly uncheckedValue?: any;
588
+ readonly validateOnInput?: boolean;
589
+ readonly validateOnChange?: boolean;
590
+ readonly validateOnBlur?: boolean;
591
+ readonly validateOnModelUpdate?: boolean;
592
+ readonly rules?: RuleExpression<unknown>;
593
+ readonly 'onUpdate:modelValue'?: (e: any) => unknown;
594
+ readonly keepValue?: boolean;
595
+ } & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & Readonly<vue.ExtractPropTypes<{
596
+ as: {
597
+ type: (ObjectConstructor | StringConstructor)[];
598
+ default: any;
599
+ };
600
+ name: {
601
+ type: StringConstructor;
602
+ required: true;
603
+ };
604
+ rules: {
605
+ type: PropType<RuleExpression<unknown>>;
606
+ default: any;
607
+ };
608
+ validateOnMount: {
609
+ type: BooleanConstructor;
610
+ default: boolean;
611
+ };
612
+ validateOnBlur: {
613
+ type: BooleanConstructor;
614
+ default: any;
615
+ };
616
+ validateOnChange: {
617
+ type: BooleanConstructor;
618
+ default: any;
619
+ };
620
+ validateOnInput: {
621
+ type: BooleanConstructor;
622
+ default: any;
623
+ };
624
+ validateOnModelUpdate: {
625
+ type: BooleanConstructor;
626
+ default: any;
627
+ };
628
+ bails: {
629
+ type: BooleanConstructor;
630
+ default: () => boolean;
631
+ };
632
+ label: {
633
+ type: StringConstructor;
634
+ default: any;
635
+ };
636
+ uncheckedValue: {
637
+ type: any;
638
+ default: any;
639
+ };
640
+ modelValue: {
641
+ type: any;
642
+ default: symbol;
643
+ };
644
+ modelModifiers: {
645
+ type: any;
646
+ default: () => {};
647
+ };
648
+ 'onUpdate:modelValue': {
649
+ type: PropType<(e: any) => unknown>;
650
+ default: any;
651
+ };
652
+ standalone: {
653
+ type: BooleanConstructor;
654
+ default: boolean;
655
+ };
656
+ keepValue: {
657
+ type: BooleanConstructor;
658
+ default: any;
659
+ };
660
+ }>>, "label" | "as" | "bails" | "uncheckedValue" | "modelValue" | "validateOnInput" | "validateOnChange" | "validateOnBlur" | "validateOnModelUpdate" | "rules" | "validateOnMount" | "modelModifiers" | "onUpdate:modelValue" | "standalone" | "keepValue">;
562
661
  $attrs: {
563
662
  [x: string]: unknown;
564
663
  };
@@ -650,16 +749,16 @@ declare const Field: {
650
749
  as: string | Record<string, any>;
651
750
  bails: boolean;
652
751
  uncheckedValue: any;
752
+ modelValue: any;
653
753
  validateOnInput: boolean;
654
754
  validateOnChange: boolean;
655
755
  validateOnBlur: boolean;
656
756
  validateOnModelUpdate: boolean;
657
- modelValue: any;
757
+ rules: RuleExpression<unknown>;
658
758
  validateOnMount: boolean;
659
- standalone: boolean;
660
759
  modelModifiers: any;
661
- rules: RuleExpression<unknown>;
662
760
  'onUpdate:modelValue': (e: any) => unknown;
761
+ standalone: boolean;
663
762
  keepValue: boolean;
664
763
  }, {}, string, {}> & {
665
764
  beforeCreate?: (() => void) | (() => void)[];
@@ -836,18 +935,22 @@ declare const Field: {
836
935
  as: string | Record<string, any>;
837
936
  bails: boolean;
838
937
  uncheckedValue: any;
938
+ modelValue: any;
839
939
  validateOnInput: boolean;
840
940
  validateOnChange: boolean;
841
941
  validateOnBlur: boolean;
842
942
  validateOnModelUpdate: boolean;
843
- modelValue: any;
943
+ rules: RuleExpression<unknown>;
844
944
  validateOnMount: boolean;
845
- standalone: boolean;
846
945
  modelModifiers: any;
847
- rules: RuleExpression<unknown>;
848
946
  'onUpdate:modelValue': (e: any) => unknown;
947
+ standalone: boolean;
849
948
  keepValue: boolean;
850
949
  }, {}, string, {}> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
950
+ value: UnwrapRef<FieldContext['value']>;
951
+ meta: UnwrapRef<FieldContext['meta']>;
952
+ errors: UnwrapRef<FieldContext['errors']>;
953
+ errorMessage: UnwrapRef<FieldContext['errorMessage']>;
851
954
  setErrors: FieldContext['setErrors'];
852
955
  setTouched: FieldContext['setTouched'];
853
956
  reset: FieldContext['resetField'];
@@ -869,61 +972,64 @@ declare const Form: {
869
972
  new (...args: any[]): {
870
973
  $: vue.ComponentInternalInstance;
871
974
  $data: {};
872
- $props: {
873
- onSubmit?: SubmissionHandler;
874
- as?: string;
875
- initialValues?: Record<string, any>;
876
- validateOnMount?: boolean;
877
- validationSchema?: Record<string, any>;
878
- initialErrors?: Record<string, any>;
879
- initialTouched?: Record<string, any>;
880
- onInvalidSubmit?: InvalidSubmissionHandler;
881
- keepValues?: boolean;
882
- key?: string | number | symbol;
883
- style?: unknown;
884
- class?: unknown;
885
- ref?: vue.VNodeRef;
886
- ref_for?: boolean;
887
- ref_key?: string;
888
- onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
889
- [key: string]: any;
890
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
891
- [key: string]: any;
892
- }>) => void)[];
893
- onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
894
- [key: string]: any;
895
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
896
- [key: string]: any;
897
- }>) => void)[];
898
- onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
899
- [key: string]: any;
900
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
901
- [key: string]: any;
902
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
903
- [key: string]: any;
904
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
905
- [key: string]: any;
906
- }>) => void)[];
907
- onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
908
- [key: string]: any;
909
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
910
- [key: string]: any;
911
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
912
- [key: string]: any;
913
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
914
- [key: string]: any;
915
- }>) => void)[];
916
- onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
917
- [key: string]: any;
918
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
919
- [key: string]: any;
920
- }>) => void)[];
921
- onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
922
- [key: string]: any;
923
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
924
- [key: string]: any;
925
- }>) => void)[];
926
- };
975
+ $props: Partial<{
976
+ onSubmit: SubmissionHandler;
977
+ as: string;
978
+ initialValues: Record<string, any>;
979
+ validateOnMount: boolean;
980
+ validationSchema: Record<string, any>;
981
+ initialErrors: Record<string, any>;
982
+ initialTouched: Record<string, any>;
983
+ onInvalidSubmit: InvalidSubmissionHandler;
984
+ keepValues: boolean;
985
+ }> & Omit<{
986
+ readonly as: string;
987
+ readonly validateOnMount: boolean;
988
+ readonly keepValues: boolean;
989
+ readonly onSubmit?: SubmissionHandler;
990
+ readonly initialValues?: Record<string, any>;
991
+ readonly validationSchema?: Record<string, any>;
992
+ readonly initialErrors?: Record<string, any>;
993
+ readonly initialTouched?: Record<string, any>;
994
+ readonly onInvalidSubmit?: InvalidSubmissionHandler;
995
+ } & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & Readonly<vue.ExtractPropTypes<{
996
+ as: {
997
+ type: PropType<string>;
998
+ default: string;
999
+ };
1000
+ validationSchema: {
1001
+ type: ObjectConstructor;
1002
+ default: any;
1003
+ };
1004
+ initialValues: {
1005
+ type: ObjectConstructor;
1006
+ default: any;
1007
+ };
1008
+ initialErrors: {
1009
+ type: ObjectConstructor;
1010
+ default: any;
1011
+ };
1012
+ initialTouched: {
1013
+ type: ObjectConstructor;
1014
+ default: any;
1015
+ };
1016
+ validateOnMount: {
1017
+ type: BooleanConstructor;
1018
+ default: boolean;
1019
+ };
1020
+ onSubmit: {
1021
+ type: PropType<SubmissionHandler>;
1022
+ default: any;
1023
+ };
1024
+ onInvalidSubmit: {
1025
+ type: PropType<InvalidSubmissionHandler>;
1026
+ default: any;
1027
+ };
1028
+ keepValues: {
1029
+ type: BooleanConstructor;
1030
+ default: boolean;
1031
+ };
1032
+ }>>, "onSubmit" | "as" | "initialValues" | "validateOnMount" | "validationSchema" | "initialErrors" | "initialTouched" | "onInvalidSubmit" | "keepValues">;
927
1033
  $attrs: {
928
1034
  [x: string]: unknown;
929
1035
  };
@@ -1139,53 +1245,14 @@ declare const FieldArray: {
1139
1245
  new (...args: any[]): {
1140
1246
  $: vue.ComponentInternalInstance;
1141
1247
  $data: {};
1142
- $props: {
1143
- key?: string | number | symbol;
1248
+ $props: Partial<{}> & Omit<{
1144
1249
  readonly name: string;
1145
- style?: unknown;
1146
- class?: unknown;
1147
- ref?: vue.VNodeRef;
1148
- ref_for?: boolean;
1149
- ref_key?: string;
1150
- onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1151
- [key: string]: any;
1152
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1153
- [key: string]: any;
1154
- }>) => void)[];
1155
- onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1156
- [key: string]: any;
1157
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1158
- [key: string]: any;
1159
- }>) => void)[];
1160
- onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1161
- [key: string]: any;
1162
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1163
- [key: string]: any;
1164
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1165
- [key: string]: any;
1166
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1167
- [key: string]: any;
1168
- }>) => void)[];
1169
- onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1170
- [key: string]: any;
1171
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1172
- [key: string]: any;
1173
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1174
- [key: string]: any;
1175
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1176
- [key: string]: any;
1177
- }>) => void)[];
1178
- onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1179
- [key: string]: any;
1180
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1181
- [key: string]: any;
1182
- }>) => void)[];
1183
- onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1184
- [key: string]: any;
1185
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1186
- [key: string]: any;
1187
- }>) => void)[];
1188
- };
1250
+ } & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & Readonly<vue.ExtractPropTypes<{
1251
+ name: {
1252
+ type: StringConstructor;
1253
+ required: true;
1254
+ };
1255
+ }>>, never>;
1189
1256
  $attrs: {
1190
1257
  [x: string]: unknown;
1191
1258
  };
@@ -1277,54 +1344,21 @@ declare const ErrorMessage: {
1277
1344
  new (...args: any[]): {
1278
1345
  $: vue.ComponentInternalInstance;
1279
1346
  $data: {};
1280
- $props: {
1281
- as?: string;
1282
- key?: string | number | symbol;
1347
+ $props: Partial<{
1348
+ as: string;
1349
+ }> & Omit<{
1283
1350
  readonly name: string;
1284
- style?: unknown;
1285
- class?: unknown;
1286
- ref?: vue.VNodeRef;
1287
- ref_for?: boolean;
1288
- ref_key?: string;
1289
- onVnodeBeforeMount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1290
- [key: string]: any;
1291
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1292
- [key: string]: any;
1293
- }>) => void)[];
1294
- onVnodeMounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1295
- [key: string]: any;
1296
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1297
- [key: string]: any;
1298
- }>) => void)[];
1299
- onVnodeBeforeUpdate?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1300
- [key: string]: any;
1301
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1302
- [key: string]: any;
1303
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1304
- [key: string]: any;
1305
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1306
- [key: string]: any;
1307
- }>) => void)[];
1308
- onVnodeUpdated?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1309
- [key: string]: any;
1310
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1311
- [key: string]: any;
1312
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1313
- [key: string]: any;
1314
- }>, oldVNode: VNode<vue.RendererNode, vue.RendererElement, {
1315
- [key: string]: any;
1316
- }>) => void)[];
1317
- onVnodeBeforeUnmount?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1318
- [key: string]: any;
1319
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1320
- [key: string]: any;
1321
- }>) => void)[];
1322
- onVnodeUnmounted?: ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1323
- [key: string]: any;
1324
- }>) => void) | ((vnode: VNode<vue.RendererNode, vue.RendererElement, {
1325
- [key: string]: any;
1326
- }>) => void)[];
1327
- };
1351
+ readonly as?: string;
1352
+ } & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & Readonly<vue.ExtractPropTypes<{
1353
+ as: {
1354
+ type: StringConstructor;
1355
+ default: any;
1356
+ };
1357
+ name: {
1358
+ type: StringConstructor;
1359
+ required: true;
1360
+ };
1361
+ }>>, "as">;
1328
1362
  $attrs: {
1329
1363
  [x: string]: unknown;
1330
1364
  };
@@ -1426,7 +1460,7 @@ declare const ErrorMessage: {
1426
1460
  type FormSchema<TValues extends Record<string, unknown>> = FlattenAndSetPathsType<TValues, GenericValidateFunction | string | GenericObject> | undefined;
1427
1461
  interface FormOptions<TValues extends GenericObject, TOutput = TValues, TSchema extends TypedSchema<TValues, TOutput> | FormSchema<TValues> = FormSchema<TValues> | TypedSchema<TValues, TOutput>> {
1428
1462
  validationSchema?: MaybeRef<TSchema extends TypedSchema ? TypedSchema<TValues, TOutput> : any>;
1429
- initialValues?: MaybeRef<PartialDeep<TValues> | undefined | null>;
1463
+ initialValues?: PartialDeep<TValues> | undefined | null;
1430
1464
  initialErrors?: FlattenAndSetPathsType<TValues, string | undefined>;
1431
1465
  initialTouched?: FlattenAndSetPathsType<TValues, boolean>;
1432
1466
  validateOnMount?: boolean;
@@ -1434,7 +1468,7 @@ interface FormOptions<TValues extends GenericObject, TOutput = TValues, TSchema
1434
1468
  }
1435
1469
  declare function useForm<TValues extends GenericObject = GenericObject, TOutput = TValues, TSchema extends FormSchema<TValues> | TypedSchema<TValues, TOutput> = FormSchema<TValues> | TypedSchema<TValues, TOutput>>(opts?: FormOptions<TValues, TOutput, TSchema>): FormContext<TValues, TOutput>;
1436
1470
 
1437
- declare function useFieldArray<TValue = unknown>(arrayPath: MaybeRef<string>): FieldArrayContext<TValue>;
1471
+ declare function useFieldArray<TValue = unknown>(arrayPath: MaybeRefOrGetter<string>): FieldArrayContext<TValue>;
1438
1472
 
1439
1473
  declare function useResetForm<TValues extends Record<string, unknown> = Record<string, unknown>>(): (state?: Partial<FormState<TValues>>) => void;
1440
1474
 
@@ -1549,4 +1583,4 @@ declare const FormContextKey: InjectionKey<PrivateFormContext>;
1549
1583
  declare const FieldContextKey: InjectionKey<PrivateFieldContext<unknown>>;
1550
1584
  declare const IS_ABSENT: unique symbol;
1551
1585
 
1552
- export { type BaseFieldProps, type DevtoolsPluginFieldState, type DevtoolsPluginFormState, ErrorMessage, Field, FieldArray, type FieldArrayContext, type FieldContext, FieldContextKey, type FieldEntry, type FieldMeta, type FieldOptions, type FieldPathLookup, type FieldState, type FieldValidator, type FlattenAndSetPathsType, Form, type FormActions, type FormContext, FormContextKey, type FormErrorBag, type FormErrors, type FormMeta, type FormOptions, type FormState, type FormValidationResult, type GenericObject, type GenericValidateFunction, IS_ABSENT, type InferInput, type InferOutput, type InputBindsConfig, type InputType, type InvalidSubmissionContext, type InvalidSubmissionHandler, type IsAny, type IsEqual, type LazyInputBindsConfig, type Locator, type MaybeArray, type MaybePromise, type Path, type PathState, type PathStateConfig, type PathValue, type PrivateFieldArrayContext, type PrivateFieldContext, type PrivateFormContext, type PublicPathState, type RawFormSchema, type ResetFormOpts, type RuleExpression, type SchemaValidationMode, type SubmissionContext, type SubmissionHandler, type TypedSchema, type TypedSchemaError, type ValidationOptions$1 as ValidationOptions, type ValidationResult, type YupSchema, configure, defineRule, normalizeRules, useField, useFieldArray, useFieldError, useFieldValue, useForm, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useIsValidating, useResetForm, useSetFieldError, useSetFieldTouched, useSetFieldValue, useSetFormErrors, useSetFormTouched, useSetFormValues, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate, validateObjectSchema as validateObject };
1586
+ export { type BaseComponentBinds, type BaseFieldProps, type BaseInputBinds, type ComponentBindsConfig, type ComponentModelBinds, type ComponentModellessBinds, type DevtoolsPluginFieldState, type DevtoolsPluginFormState, ErrorMessage, Field, FieldArray, type FieldArrayContext, type FieldContext, FieldContextKey, type FieldEntry, type FieldMeta, type FieldOptions, type FieldPathLookup, type FieldState, type FieldValidator, type FlattenAndSetPathsType, Form, type FormActions, type FormContext, FormContextKey, type FormErrorBag, type FormErrors, type FormMeta, type FormOptions, type FormState, type FormValidationResult, type GenericObject, type GenericValidateFunction, IS_ABSENT, type InferInput, type InferOutput, type InputBindsConfig, type InputType, type InvalidSubmissionContext, type InvalidSubmissionHandler, type IsAny, type IsEqual, type LazyComponentBindsConfig, type LazyInputBindsConfig, type Locator, type MapValuesPathsToRefs, type MaybeArray, type MaybePromise, type Path, type PathState, type PathStateConfig, type PathValue, type PrivateFieldArrayContext, type PrivateFieldContext, type PrivateFormContext, type PublicPathState, type RawFormSchema, type ResetFormOpts, type RuleExpression, type SchemaValidationMode, type SubmissionContext, type SubmissionHandler, type TypedSchema, type TypedSchemaError, type TypedSchemaPathDescription, type ValidationOptions$1 as ValidationOptions, type ValidationResult, type YupSchema, cleanupNonNestedPath, configure, defineRule, isNotNestedPath, normalizeRules, useField, useFieldArray, useFieldError, useFieldValue, useForm, useFormErrors, useFormValues, useIsFieldDirty, useIsFieldTouched, useIsFieldValid, useIsFormDirty, useIsFormTouched, useIsFormValid, useIsSubmitting, useIsValidating, useResetForm, useSetFieldError, useSetFieldTouched, useSetFieldValue, useSetFormErrors, useSetFormTouched, useSetFormValues, useSubmitCount, useSubmitForm, useValidateField, useValidateForm, validate, validateObjectSchema as validateObject };