@ereo/forms 0.1.23 → 0.1.24
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/components.d.ts +5 -5
- package/dist/components.d.ts.map +1 -1
- package/dist/hooks.d.ts +7 -3
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +781 -487
- package/dist/proxy.d.ts.map +1 -1
- package/dist/schema.d.ts +21 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/store.d.ts +32 -4
- package/dist/store.d.ts.map +1 -1
- package/dist/types.d.ts +41 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/validation-engine.d.ts +7 -1
- package/dist/validation-engine.d.ts.map +1 -1
- package/dist/validators.d.ts.map +1 -1
- package/dist/wizard.d.ts +2 -2
- package/dist/wizard.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
import type { FieldComponentProps, TextareaFieldProps, SelectFieldProps, FieldArrayComponentProps } from './types';
|
|
3
|
-
export declare function Field<T extends Record<string, any>, K extends
|
|
4
|
-
export declare function TextareaField<T extends Record<string, any>, K extends
|
|
5
|
-
export declare function SelectField<T extends Record<string, any>, K extends
|
|
6
|
-
export declare function FieldArrayComponent<T extends Record<string, any>, K extends
|
|
2
|
+
import type { FormPath, FieldComponentProps, TextareaFieldProps, SelectFieldProps, FieldArrayComponentProps } from './types';
|
|
3
|
+
export declare function Field<T extends Record<string, any>, K extends FormPath<T> = FormPath<T>>(props: FieldComponentProps<T, K>): ReactElement | null;
|
|
4
|
+
export declare function TextareaField<T extends Record<string, any>, K extends FormPath<T> = FormPath<T>>(props: TextareaFieldProps<T, K>): ReactElement | null;
|
|
5
|
+
export declare function SelectField<T extends Record<string, any>, K extends FormPath<T> = FormPath<T>>(props: SelectFieldProps<T, K>): ReactElement | null;
|
|
6
|
+
export declare function FieldArrayComponent<T extends Record<string, any>, K extends FormPath<T> = FormPath<T>>(props: FieldArrayComponentProps<T, K>): ReactElement | null;
|
|
7
7
|
export { FieldArrayComponent as FieldArray };
|
|
8
8
|
//# sourceMappingURL=components.d.ts.map
|
package/dist/components.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAEV,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AA+BjB,wBAAgB,KAAK,CACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAEV,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AA+BjB,wBAAgB,KAAK,CACnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAqDvD;AAID,wBAAgB,aAAa,CAC3B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CA2CtD;AAID,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAoDpD;AAID,wBAAgB,mBAAmB,CACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAQ5D;AAGD,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { FormStore } from './store';
|
|
2
|
-
import type { FormConfig, FormStoreInterface, FieldHandle, FieldOptions, ArrayFieldHelpers, FormSubmitState } from './types';
|
|
2
|
+
import type { FormConfig, FormStoreInterface, FormPath, PathValue, FieldHandle, FieldOptions, ArrayFieldHelpers, FormSubmitState } from './types';
|
|
3
3
|
export declare function useForm<T extends Record<string, any>>(config: FormConfig<T>): FormStore<T>;
|
|
4
|
-
export declare function useField<T extends Record<string, any>,
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function useField<T extends Record<string, any>, P extends FormPath<T> = FormPath<T>>(form: FormStoreInterface<T>, name: P, opts?: FieldOptions<PathValue<T, P>>): FieldHandle<PathValue<T, P>>;
|
|
5
|
+
export declare function useField<T extends Record<string, any>>(form: FormStoreInterface<T>, name: string, opts?: FieldOptions<any>): FieldHandle<any>;
|
|
6
|
+
export declare function useFieldArray<T extends Record<string, any>, P extends FormPath<T> = FormPath<T>>(form: FormStoreInterface<T>, name: P): ArrayFieldHelpers<PathValue<T, P> extends (infer U)[] ? U : unknown>;
|
|
7
|
+
export declare function useFieldArray<T extends Record<string, any>>(form: FormStoreInterface<T>, name: string): ArrayFieldHelpers<any>;
|
|
8
|
+
export declare function useWatch<T extends Record<string, any>, P extends FormPath<T>>(form: FormStoreInterface<T>, path: P): PathValue<T, P>;
|
|
9
|
+
export declare function useWatch<T extends Record<string, any>, P extends FormPath<T>>(form: FormStoreInterface<T>, paths: P[]): unknown[];
|
|
6
10
|
export declare function useFormStatus(form: FormStoreInterface<any>): {
|
|
7
11
|
isSubmitting: boolean;
|
|
8
12
|
submitState: FormSubmitState;
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,iBAAiB,EAEjB,eAAe,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACZ,iBAAiB,EAEjB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAKjB,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnD,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GACpB,SAAS,CAAC,CAAC,CAAC,CAcd;AAID,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAA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AAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAC3E,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,CAAC,EAAE,GACT,OAAO,EAAE,CAAC;AA8Cb,wBAAgB,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAC5D,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,eAAe,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAQA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { FormStore, createFormStore } from './store';
|
|
2
2
|
export { createValuesProxy } from './proxy';
|
|
3
3
|
export { getPath, setPath, deepClone, deepEqual, parsePath, flattenToPaths } from './utils';
|
|
4
|
-
export { useForm, useField, useFieldArray, useFormStatus } from './hooks';
|
|
4
|
+
export { useForm, useField, useFieldArray, useWatch, useFormStatus } from './hooks';
|
|
5
5
|
export { FormProvider, useFormContext } from './context';
|
|
6
6
|
export { Field, TextareaField, SelectField, FieldArray } from './components';
|
|
7
7
|
export { required, email, url, date, phone, minLength, maxLength, min, max, pattern, number, integer, positive, custom, async, matches, oneOf, notOneOf, fileSize, fileType, compose, when, v, } from './validators';
|
|
8
8
|
export { ValidationEngine } from './validation-engine';
|
|
9
|
-
export { zodAdapter, valibotAdapter, createSchemaValidator, ereoSchema, isEreoSchema, formDataToObject, } from './schema';
|
|
9
|
+
export { zodAdapter, valibotAdapter, createSchemaValidator, ereoSchema, isEreoSchema, formDataToObject, isStandardSchema, standardSchemaAdapter, } from './schema';
|
|
10
10
|
export { createFormAction, ActionForm, useFormAction, parseActionResult, } from './action';
|
|
11
11
|
export { createWizard, useWizard, WizardProvider, useWizardContext, WizardStep, WizardProgress, WizardNavigation, } from './wizard';
|
|
12
12
|
export type { WizardHelpers } from './wizard';
|
|
13
13
|
export { mergeFormConfigs, composeSchemas } from './composition';
|
|
14
14
|
export { generateA11yId, getFieldA11y, getErrorA11y, getLabelA11y, getDescriptionA11y, getFieldsetA11y, getFieldWrapperA11y, getFormA11y, getErrorSummaryA11y, focusFirstError, focusField, trapFocus, announce, announceErrors, announceSubmitStatus, prefersReducedMotion, isScreenReaderActive, cleanupLiveRegion, } from './a11y';
|
|
15
|
-
export type { DeepPartial, PathsOf, PathValue, FormPath, ValidateOn, ValidatorFunction, ValidationRule, ValidationResult, ValidationSchema, CrossFieldValidationContext, FieldState, FieldInputProps, FieldRegistration, FieldHandle, FieldOptions, ArrayFieldItem, ArrayFieldHelpers, FormSubmitState, SubmitContext, SubmitHandler, FormConfig, FormState, FormStoreInterface, WatchCallback, ActionResult, FormActionConfig, WizardStepConfig, WizardConfig, WizardState, FieldComponentProps, TextareaFieldProps, SelectFieldProps, FieldArrayComponentProps, } from './types';
|
|
15
|
+
export type { DeepPartial, PathsOf, PathValue, FormPath, ValidateOn, ValidatorFunction, ValidationRule, ValidationResult, ValidationSchema, CrossFieldValidationContext, ErrorSource, FormError, FieldState, FieldInputProps, FieldRegistration, FieldHandle, FieldOptions, ArrayFieldItem, ArrayFieldHelpers, FormSubmitState, SubmitContext, SubmitHandler, FormConfig, FormState, FormStoreInterface, WatchCallback, ActionResult, FormActionConfig, WizardStepConfig, WizardConfig, WizardState, FieldComponentProps, TextareaFieldProps, SelectFieldProps, FieldArrayComponentProps, } from './types';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC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