react-f0rm 0.5.1 → 0.6.1
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/README.md +41 -0
- package/dist/devtools/index.cjs.js +1 -743
- package/dist/devtools/index.cjs.js.map +1 -1
- package/dist/devtools/index.mjs +1 -723
- package/dist/devtools/index.mjs.map +1 -1
- package/dist/form-CGRvih_c.cjs.js +2 -0
- package/dist/form-CGRvih_c.cjs.js.map +1 -0
- package/dist/form-CfBBPz6p.mjs +2 -0
- package/dist/form-CfBBPz6p.mjs.map +1 -0
- package/dist/{form-rTlcIiWH.d.ts → form-D9COEt0-.d.ts} +2 -2
- package/dist/index.cjs.js +1 -1804
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +23 -4
- package/dist/index.mjs +1 -1711
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +22 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +2 -2
- package/dist/index.umd.min.js.map +1 -1
- package/dist/resolvers/standard-schema.cjs.js +1 -89
- package/dist/resolvers/standard-schema.cjs.js.map +1 -1
- package/dist/resolvers/standard-schema.mjs +1 -85
- package/dist/resolvers/standard-schema.mjs.map +1 -1
- package/dist/resolvers/yup.cjs.js +1 -22
- package/dist/resolvers/yup.cjs.js.map +1 -1
- package/dist/resolvers/yup.d.ts +1 -1
- package/dist/resolvers/yup.mjs +1 -20
- package/dist/resolvers/yup.mjs.map +1 -1
- package/dist/resolvers/zod.cjs.js +1 -22
- package/dist/resolvers/zod.cjs.js.map +1 -1
- package/dist/resolvers/zod.d.ts +1 -1
- package/dist/resolvers/zod.mjs +1 -20
- package/dist/resolvers/zod.mjs.map +1 -1
- package/dist/{validate-CQX7BJOD.d.ts → validate-Cu43SqhV.d.ts} +1 -1
- package/package.json +6 -1
- package/dist/form-CXF5HwQG.mjs +0 -349
- package/dist/form-CXF5HwQG.mjs.map +0 -1
- package/dist/form-DbnzAKSM.cjs.js +0 -358
- package/dist/form-DbnzAKSM.cjs.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as FieldPath, N as Name, F as Form$1, P as PathValueOf, b as FieldError, c as Path, O as Options } from './form-
|
|
2
|
-
export { d as FieldErrorEntry, e as FieldState, H as HandleSubmitOptions, f as PathValue, R as ReValidateMode, g as ResetFieldOptions, h as ResetOptions, S as SetFieldOptions, i as SetFocusOptions, j as SetServerErrorsOptions,
|
|
3
|
-
import { V as Validator } from './validate-
|
|
1
|
+
import { a as FieldPath, N as Name, F as Form$1, V as ValidationMode, P as PathValueOf, b as FieldError, c as Path, O as Options } from './form-D9COEt0-.js';
|
|
2
|
+
export { d as FieldErrorEntry, e as FieldState, H as HandleSubmitOptions, f as PathValue, R as ReValidateMode, g as ResetFieldOptions, h as ResetOptions, S as SetFieldOptions, i as SetFocusOptions, j as SetServerErrorsOptions, k as VALIDATION_OUTCOME, l as ValidateResult, m as ValidationOutcome, n as clearErrors, o as createForm, p as ensureValidate, q as getDirtyFields, r as getError, s as getErrorByPath, t as getErrors, u as getFieldErrors, v as getFieldErrorsByPath, w as getFieldState, x as getFirstError, y as getTouchedFields, z as getValue, A as getValueByPath, B as getValues, C as handleSubmit, D as hasErrors, E as hasTouched, G as hasTouchedByPath, I as incrementSubmitCount, J as isDirty, K as isTouched, L as removeField, M as removeFieldByPath, Q as reset, T as resetField, U as setDisabled, W as setError, X as setErrorByPath, Y as setFocus, Z as setInitialValues, _ as setIsSubmitting, $ as setServerErrors, a0 as setSubmitSuccessful, a1 as setTouched, a2 as setTouchedByPath, a3 as setValidatingByPath, a4 as setValue, a5 as setValueByPath, a6 as trigger, a7 as unsetValidatingByPath, a8 as validate } from './form-D9COEt0-.js';
|
|
3
|
+
import { V as Validator } from './validate-Cu43SqhV.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import { EventEmitter } from '@for-fun/event-emitter';
|
|
@@ -78,6 +78,17 @@ interface UseFieldOptions$1<TValues extends Record<string, any> = any, TPath ext
|
|
|
78
78
|
* `disabled`. A field cannot opt out of a disabled form.
|
|
79
79
|
*/
|
|
80
80
|
disabled?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Field-level validation mode override: when given, this field validates
|
|
83
|
+
* on its own schedule instead of `form.mode` — every other field keeps
|
|
84
|
+
* the form-level timing (e.g. a form that defaults to `'onSubmit'` with
|
|
85
|
+
* one field declared `'onBlur'` shows that field's error on blur while
|
|
86
|
+
* the rest wait for submit). `reValidateMode` stays form-level: once any
|
|
87
|
+
* field has an error (after a failed submit, say), re-validation follows
|
|
88
|
+
* the form's `reValidateMode` for every field, overriding this one too.
|
|
89
|
+
* See {@link ValidationMode}.
|
|
90
|
+
*/
|
|
91
|
+
mode?: ValidationMode;
|
|
81
92
|
}
|
|
82
93
|
/**
|
|
83
94
|
* The result of {@link useField}. Deliberately a closed shape: no index
|
|
@@ -421,6 +432,14 @@ interface UseFieldOptions<TValues extends Record<string, any> = any, TPath exten
|
|
|
421
432
|
* changes apply immediately. Passed through to useField.
|
|
422
433
|
*/
|
|
423
434
|
delayError?: number;
|
|
435
|
+
/**
|
|
436
|
+
* Field-level validation mode override: this field validates on its own
|
|
437
|
+
* schedule instead of the form's `mode` (other fields are unaffected);
|
|
438
|
+
* the form's `reValidateMode` still governs re-validation once the
|
|
439
|
+
* field has an error. Passed through to useField, never spread onto
|
|
440
|
+
* the DOM element.
|
|
441
|
+
*/
|
|
442
|
+
mode?: ValidationMode;
|
|
424
443
|
[key: string]: any;
|
|
425
444
|
}
|
|
426
445
|
interface FieldProps<TValues extends Record<string, any> = any, TPath extends FieldPath<TValues> | Name = Name> extends UseFieldOptions<TValues, TPath> {
|
|
@@ -484,5 +503,5 @@ interface SelectComponent {
|
|
|
484
503
|
}
|
|
485
504
|
declare const Select: SelectComponent;
|
|
486
505
|
|
|
487
|
-
export { Checkbox, CheckboxGroupContext, CheckboxGroupProvider, Field, FieldError, FieldPath, Form, FormContext, Form$1 as FormInstance, FormProvider, Name, Options, Path, PathValueOf, Select, Validator, createFormContext, fieldErrorId, subscribe, useCheckboxGroupContext, useDirtyFields, useError, useErrorByPath, useField, useFieldArray, useFieldErrors, useFieldErrorsByPath, useForm, useFormContext, useHasErrors, useIsDirty, useIsSubmitting, useSubmitCount, useTouched, useTouchedByPath, useTouchedFields, useValue, useValueByPath, useWatch };
|
|
506
|
+
export { Checkbox, CheckboxGroupContext, CheckboxGroupProvider, Field, FieldError, FieldPath, Form, FormContext, Form$1 as FormInstance, FormProvider, Name, Options, Path, PathValueOf, Select, ValidationMode, Validator, createFormContext, fieldErrorId, subscribe, useCheckboxGroupContext, useDirtyFields, useError, useErrorByPath, useField, useFieldArray, useFieldErrors, useFieldErrorsByPath, useForm, useFormContext, useHasErrors, useIsDirty, useIsSubmitting, useSubmitCount, useTouched, useTouchedByPath, useTouchedFields, useValue, useValueByPath, useWatch };
|
|
488
507
|
export type { FieldRules, SubscribeEvent, SubscribeOptions, WatchScope };
|