@ereo/forms 0.1.23
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/a11y.d.ts +52 -0
- package/dist/a11y.d.ts.map +1 -0
- package/dist/accessibility.d.ts +152 -0
- package/dist/accessibility.d.ts.map +1 -0
- package/dist/action-integration.d.ts +104 -0
- package/dist/action-integration.d.ts.map +1 -0
- package/dist/action.d.ts +33 -0
- package/dist/action.d.ts.map +1 -0
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.d.ts.map +1 -0
- package/dist/array-field.d.ts +49 -0
- package/dist/array-field.d.ts.map +1 -0
- package/dist/components.d.ts +8 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/composition.d.ts +4 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/context.d.ts +9 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/field.d.ts +88 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/form.d.ts +59 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/hooks.d.ts +13 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2945 -0
- package/dist/proxy.d.ts +3 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/schema.d.ts +31 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/store.d.ts +69 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/types.d.ts +243 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/validation-engine.d.ts +33 -0
- package/dist/validation-engine.d.ts.map +1 -0
- package/dist/validation.d.ts +241 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validators.d.ts +51 -0
- package/dist/validators.d.ts.map +1 -0
- package/dist/wizard.d.ts +52 -0
- package/dist/wizard.d.ts.map +1 -0
- package/package.json +60 -0
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormStore } from './store';
|
|
2
|
+
import type { FormConfig, FormStoreInterface, FieldHandle, FieldOptions, ArrayFieldHelpers, FormSubmitState } from './types';
|
|
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>, V = unknown>(form: FormStoreInterface<T>, name: string, opts?: FieldOptions<V>): FieldHandle<V>;
|
|
5
|
+
export declare function useFieldArray<T extends Record<string, any>, Item = unknown>(form: FormStoreInterface<T>, name: string): ArrayFieldHelpers<Item>;
|
|
6
|
+
export declare function useFormStatus(form: FormStoreInterface<any>): {
|
|
7
|
+
isSubmitting: boolean;
|
|
8
|
+
submitState: FormSubmitState;
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
isDirty: boolean;
|
|
11
|
+
submitCount: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +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,EAChB,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,GAAG,OAAO,EACjE,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GACrB,WAAW,CAAC,CAAC,CAAC,CA2IhB;AAID,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,EACzE,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,MAAM,GACX,iBAAiB,CAAC,IAAI,CAAC,CAkJzB;AAID,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
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { FormStore, createFormStore } from './store';
|
|
2
|
+
export { createValuesProxy } from './proxy';
|
|
3
|
+
export { getPath, setPath, deepClone, deepEqual, parsePath, flattenToPaths } from './utils';
|
|
4
|
+
export { useForm, useField, useFieldArray, useFormStatus } from './hooks';
|
|
5
|
+
export { FormProvider, useFormContext } from './context';
|
|
6
|
+
export { Field, TextareaField, SelectField, FieldArray } from './components';
|
|
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
|
+
export { ValidationEngine } from './validation-engine';
|
|
9
|
+
export { zodAdapter, valibotAdapter, createSchemaValidator, ereoSchema, isEreoSchema, formDataToObject, } from './schema';
|
|
10
|
+
export { createFormAction, ActionForm, useFormAction, parseActionResult, } from './action';
|
|
11
|
+
export { createWizard, useWizard, WizardProvider, useWizardContext, WizardStep, WizardProgress, WizardNavigation, } from './wizard';
|
|
12
|
+
export type { WizardHelpers } from './wizard';
|
|
13
|
+
export { mergeFormConfigs, composeSchemas } from './composition';
|
|
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';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG5F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG7E,OAAO,EACL,QAAQ,EACR,KAAK,EACL,GAAG,EACH,IAAI,EACJ,KAAK,EACL,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,OAAO,EACP,MAAM,EACN,OA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