@ilokesto/form 1.0.0 → 1.0.2

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 type { Form, FormError, FormState } from '../core/index.js';
2
- import type { DomValue, RegisterOptions } from '../adapters/dom.js';
2
+ import type { DomValue, RegisterOptions, SubmitHandler, SubmitInvalidHandler, SubmitValidHandler } from '../adapters/dom.js';
3
3
  export type { RegisterOptions } from '../adapters/dom.js';
4
4
  type VueBindingHandlers<TElement extends HTMLElement> = {
5
5
  onInput: (event: Event & {
@@ -56,6 +56,8 @@ export type VueFormStateReturn<TValues> = {
56
56
  readonly isDirty: boolean;
57
57
  readonly isValid: boolean;
58
58
  readonly isSubmitting: boolean;
59
+ readonly isSubmitted: boolean;
60
+ readonly isSubmitSuccessful: boolean;
59
61
  readonly submitCount: number;
60
62
  };
61
63
  export type VueForm<TValues> = {
@@ -65,4 +67,5 @@ export type VueForm<TValues> = {
65
67
  useRegister<TElement extends VueRegisterElement = HTMLInputElement, TOptions extends readonly RegisterOptions[] = readonly RegisterOptions[]>(...options: TOptions): VueRegisterPropsList<TElement, TOptions>;
66
68
  useField<TElement extends VueRegisterElement = HTMLInputElement>(options: RegisterOptions): VueFieldReturn<VueRegisterPropsForElement<TElement>>;
67
69
  useFormState(): VueFormStateReturn<TValues>;
70
+ handleSubmit<TResult>(onValid: SubmitValidHandler<TValues, TResult>, onInvalid?: SubmitInvalidHandler): SubmitHandler<Event, TResult>;
68
71
  };
@@ -1,3 +1,4 @@
1
- import type { Form } from '../core/index.js';
1
+ import type { CreateFormOptions, Form } from '../core/index.js';
2
2
  import type { VueForm } from './types.js';
3
3
  export declare function useForm<TValues>(form: Form<TValues>): VueForm<TValues>;
4
+ export declare function useForm<TValues>(options: CreateFormOptions<TValues>): VueForm<TValues>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilokesto/form",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",