@tanstack/vue-form 2.0.0-alpha.1 → 2.0.0-alpha.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,6 +1,9 @@
1
- import { AnyVueFormComponentMap } from "./componentMap.public.js";
2
- import { AppFormHookResult } from "./createFormHookTypes.public.js";
1
+ import { AppFormHookResult, CreateFormHookOptions } from "./createFormHookTypes.public.js";
2
+ import { Component } from "vue";
3
3
  //#region src/AppForm/createFormHook.public.d.ts
4
- declare function createFormHook<const TComponents extends AnyVueFormComponentMap>(createOptions: TComponents): AppFormHookResult<TComponents>;
4
+ declare function createFormHook<const TFormComponents extends Record<string, Component>, const TFieldComponents extends Record<string, Component>>(createOptions: CreateFormHookOptions<TFormComponents, TFieldComponents>): AppFormHookResult<{
5
+ formComponents: TFormComponents;
6
+ fieldComponents: TFieldComponents;
7
+ }>;
5
8
  //#endregion
6
9
  export { createFormHook };
@@ -2,11 +2,9 @@ import { useInternalForm } from "../VueForm/VueFormApi.lib.js";
2
2
  import { defineFieldGroup } from "../FieldGroup/withFields.public.js";
3
3
  import { useFormContext } from "./contexts.lib.js";
4
4
  import { createAppFormInitializer } from "./initializeAppForm.lib.js";
5
+ import { formOptions } from "@tanstack/form-core";
5
6
 
6
7
  //#region src/AppForm/createFormHook.public.ts
7
- const appFormOptions = ((opts) => opts);
8
- appFormOptions.strictSchema = (opts) => opts;
9
- appFormOptions.looseSchema = (opts) => opts;
10
8
  function createFormHook(createOptions) {
11
9
  const initializeAppForm = createAppFormInitializer(createOptions);
12
10
  function useExtendedForm(options) {
@@ -14,7 +12,7 @@ function createFormHook(createOptions) {
14
12
  }
15
13
  return {
16
14
  useFormContext,
17
- appFormOptions,
15
+ appFormOptions: formOptions,
18
16
  defineAppFieldGroup: defineFieldGroup,
19
17
  useAppForm: useExtendedForm
20
18
  };
@@ -1,15 +1,91 @@
1
- import { AnyVueFormComponentMap } from "./componentMap.public.js";
2
- import { AppFormOptionsApi } from "./appFormOptions.public.js";
1
+ import { AnyVueFormComponentMap, VueFormComponentMap } from "./componentMap.public.js";
3
2
  import { DefineFieldGroupFn } from "../FieldGroup/withFields.public.js";
4
3
  import { VueAppFormApi } from "./VueAppFormApi.public.js";
5
- import { FormOptions, FormValidators, ToFormErrorTypes } from "@tanstack/form-core";
4
+ import { DefaultFieldOptions, DefaultFormGroupOptions, DefaultFormOptions, FormOptions, FormOptionsApi, FormValidators, ToFormErrorTypes } from "@tanstack/form-core";
5
+ import { Component } from "vue";
6
6
  //#region src/AppForm/createFormHookTypes.public.d.ts
7
- type UseAppFormHook<TComponents extends AnyVueFormComponentMap> = <TFormData, const TFormValidators extends FormValidators<TFormData>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn>) => VueAppFormApi<TFormData, ToFormErrorTypes<TFormValidators, TSubmitReturn>, TComponents>;
7
+ /**
8
+ * Configures the components and reusable defaults returned by
9
+ * `createFormHook`.
10
+ *
11
+ * Form core resolves each default object before the corresponding usage-site
12
+ * options. Non-listener properties passed at the usage site take precedence,
13
+ * including when explicitly set to `undefined`. Listener arrays follow the
14
+ * configured `listenersMerge` strategy.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const { useAppForm } = createFormHook({
19
+ * formComponents: {},
20
+ * fieldComponents: {
21
+ * TextField,
22
+ * },
23
+ * defaultFormOptions: {
24
+ * errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
25
+ * },
26
+ * defaultFieldOptions: {
27
+ * errorBoundary: true,
28
+ * },
29
+ * })
30
+ * ```
31
+ *
32
+ * @typeParam TFormComponents - Library-managed. Do not specify explicitly.
33
+ * @typeParam TFieldComponents - Library-managed. Do not specify explicitly.
34
+ */
35
+ interface CreateFormHookOptions<TFormComponents extends Record<string, Component>, TFieldComponents extends Record<string, Component>> extends VueFormComponentMap<TFormComponents, TFieldComponents> {
36
+ /**
37
+ * Defaults for every form created by `useAppForm`.
38
+ *
39
+ * Non-listener options passed to `useAppForm` override these defaults,
40
+ * including when explicitly set to `undefined`. Listener arrays follow
41
+ * `listenersMerge`.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * defaultFormOptions: {
46
+ * errorVisibility: ({ state }) => state.submissionAttempts > 0,
47
+ * },
48
+ * ```
49
+ */
50
+ defaultFormOptions?: DefaultFormOptions;
51
+ /**
52
+ * Defaults for every field and array-field component owned by the form.
53
+ *
54
+ * Non-listener options passed to the component override these defaults,
55
+ * including when explicitly set to `undefined`. Listener arrays follow
56
+ * `listenersMerge`. This includes `group.Field` and `group.ArrayField`.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * defaultFieldOptions: {
61
+ * errorVisibility: ({ fieldState }) => fieldState.meta.isBlurred,
62
+ * },
63
+ * ```
64
+ */
65
+ defaultFieldOptions?: DefaultFieldOptions;
66
+ /**
67
+ * Defaults for every `form.FormGroup` component.
68
+ *
69
+ * Options passed to the component override these defaults, including when
70
+ * an option is explicitly `undefined`.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * defaultFormGroupOptions: {
75
+ * onSubmitInvalid: ({ groupApi }) => {
76
+ * console.error('Invalid group', groupApi.name)
77
+ * },
78
+ * },
79
+ * ```
80
+ */
81
+ defaultFormGroupOptions?: DefaultFormGroupOptions;
82
+ }
83
+ type UseAppFormHook<TComponents extends AnyVueFormComponentMap> = <TFormData, const TFormValidators extends FormValidators<TFormData>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn, unknown>) => VueAppFormApi<TFormData, ToFormErrorTypes<TFormValidators, TSubmitReturn>, TComponents>;
8
84
  interface AppFormHookResult<TComponents extends AnyVueFormComponentMap> {
9
- appFormOptions: AppFormOptionsApi<TComponents>;
85
+ appFormOptions: FormOptionsApi<TComponents>;
10
86
  defineAppFieldGroup: DefineFieldGroupFn<TComponents['fieldComponents']>;
11
87
  useAppForm: UseAppFormHook<TComponents>;
12
88
  useFormContext: () => VueAppFormApi<any, any, TComponents>;
13
89
  }
14
90
  //#endregion
15
- export { AppFormHookResult, UseAppFormHook };
91
+ export { AppFormHookResult, CreateFormHookOptions, UseAppFormHook };
@@ -3,7 +3,12 @@ import { InternalFormApi } from "@tanstack/form-core/internals";
3
3
 
4
4
  //#region src/AppForm/initializeAppForm.lib.ts
5
5
  function createAppFormInitializer(createOptions) {
6
- return (options) => attachVueAppFormComponents(new InternalFormApi(options), createOptions.formComponents, createOptions.fieldComponents);
6
+ const defaultOptions = createOptions.defaultFormOptions || createOptions.defaultFieldOptions || createOptions.defaultFormGroupOptions ? {
7
+ form: createOptions.defaultFormOptions,
8
+ field: createOptions.defaultFieldOptions,
9
+ formGroup: createOptions.defaultFormGroupOptions
10
+ } : void 0;
11
+ return (options) => attachVueAppFormComponents(new InternalFormApi(options, defaultOptions), createOptions.formComponents, createOptions.fieldComponents);
7
12
  }
8
13
 
9
14
  //#endregion
@@ -15,7 +15,7 @@ type FieldGroupArrayFieldComponent<in out TFieldData, in out TFieldComponents ex
15
15
  };
16
16
  }>;
17
17
  type FieldGroupSubscribeProps<TSelected> = VueFormSubscribeProps<unknown, FormErrorTypes, TSelected>;
18
- type FieldGroupSubscribeComponent = new <TSelected>(props: FieldGroupSubscribeProps<TSelected> & PublicProps) => VueComponentInstance<FieldGroupSubscribeProps<TSelected>, {
18
+ type FieldGroupSubscribeComponent = new <const TSelected>(props: FieldGroupSubscribeProps<TSelected> & PublicProps) => VueComponentInstance<FieldGroupSubscribeProps<TSelected>, {
19
19
  default: NoInfer<TSelected>;
20
20
  }>;
21
21
  interface FieldGroupApi<in out TFieldData, in out TFieldComponents extends Record<string, Component> = Record<never, never>> extends FormApiFieldMethods<TFieldData>, FormApiArrayMethods<TFieldData> {
@@ -18,7 +18,7 @@ interface VueSubscribeProps<in out TSourceData, in out TSelected> {
18
18
  when?: (selected: NoInfer<TSelected>) => boolean;
19
19
  }
20
20
  type VueFormSubscribeProps<TFormData, TFormErrorTypes extends FormErrorTypes, TSelected> = VueSubscribeProps<FormState<TFormData, TFormErrorTypes>, TSelected>;
21
- type VueFormSubscribeComponent<in out TFormData, in out TFormErrorTypes extends FormErrorTypes> = new <TSelected>(props: VueFormSubscribeProps<TFormData, TFormErrorTypes, TSelected> & PublicProps) => VueComponentInstance<VueFormSubscribeProps<TFormData, TFormErrorTypes, TSelected>, {
21
+ type VueFormSubscribeComponent<in out TFormData, in out TFormErrorTypes extends FormErrorTypes> = new <const TSelected>(props: VueFormSubscribeProps<TFormData, TFormErrorTypes, TSelected> & PublicProps) => VueComponentInstance<VueFormSubscribeProps<TFormData, TFormErrorTypes, TSelected>, {
22
22
  default: NoInfer<TSelected>;
23
23
  }>;
24
24
  interface VueFormFieldProps<in out TFieldData, in out TFieldName, in out TFieldValue, in out TFieldValidators extends FieldValidators<TFieldData, TFieldName, TFieldValue>, in out TGroupFieldError, in out TFormData, in out TFormErrorTypes extends FormErrorTypes, in out TFieldComponents extends Record<string, Component>> extends FieldApiOptions<TFieldData, TFieldName, TFieldValue, TFieldValidators, TGroupFieldError, TFormData, TFormErrorTypes> {
@@ -35,7 +35,7 @@ type VueFormArrayFieldComponent<in out TFormData, in out TFormErrorTypes extends
35
35
  };
36
36
  }>;
37
37
  type VueFormGroupSubscribeProps<TGroupValue, TGroupErrorTypes extends FormErrorTypes, TSelected> = VueSubscribeProps<FormGroupState<TGroupValue, TGroupErrorTypes>, TSelected>;
38
- type VueFormGroupSubscribeComponent<in out TGroupValue, in out TGroupErrorTypes extends FormErrorTypes> = new <TSelected>(props: VueFormGroupSubscribeProps<TGroupValue, TGroupErrorTypes, TSelected> & PublicProps) => VueComponentInstance<VueFormGroupSubscribeProps<TGroupValue, TGroupErrorTypes, TSelected>, {
38
+ type VueFormGroupSubscribeComponent<in out TGroupValue, in out TGroupErrorTypes extends FormErrorTypes> = new <const TSelected>(props: VueFormGroupSubscribeProps<TGroupValue, TGroupErrorTypes, TSelected> & PublicProps) => VueComponentInstance<VueFormGroupSubscribeProps<TGroupValue, TGroupErrorTypes, TSelected>, {
39
39
  default: NoInfer<TSelected>;
40
40
  }>;
41
41
  type VueFormGroupFieldComponent<in out TFormData, in out TGroupValue, in out TGroupErrorTypes extends FormErrorTypes, in out TFormErrorTypes extends FormErrorTypes, in out TFieldComponents extends Record<string, Component>> = new <TFieldName extends DeepKeys<TGroupValue>, const TFieldValidators extends FieldValidators<TGroupValue, TFieldName, DeepValue<TGroupValue, TFieldName>>>(props: VueFormFieldProps<TGroupValue, TFieldName, DeepValue<TGroupValue, TFieldName>, TFieldValidators, TGroupErrorTypes['fieldError'], TFormData, TFormErrorTypes, TFieldComponents> & PublicProps) => VueComponentInstance<VueFormFieldProps<TGroupValue, TFieldName, DeepValue<TGroupValue, TFieldName>, TFieldValidators, TGroupErrorTypes['fieldError'], TFormData, TFormErrorTypes, TFieldComponents>, {
@@ -1,6 +1,5 @@
1
1
  import { AnyVueFormComponentMap, DefaultVueFormComponentMap } from "../AppForm/componentMap.public.js";
2
2
  import { VueFormApi } from "./formApiTypes.public.js";
3
- import { AppFormOptions } from "../AppForm/appFormOptions.public.js";
4
3
  import { AnyFormOptions, FormOptions, FormValidators, ToFormErrorTypes } from "@tanstack/form-core";
5
4
  //#region src/VueForm/formType.public.d.ts
6
5
  type VueFormTypeErrorTypes<TFormValidators extends FormValidators<any>, TSubmitReturn> = unknown extends TSubmitReturn ? any : ToFormErrorTypes<TFormValidators, TSubmitReturn>;
@@ -27,6 +26,6 @@ type VueFormTypeErrorTypes<TFormValidators extends FormValidators<any>, TSubmitR
27
26
  *
28
27
  * @typeParam TOptions - The reusable form or app-form options from which the API derives its form data, error, and registered-component types.
29
28
  */
30
- type VueFormType<TOptions extends AnyFormOptions | AppFormOptions<any, any, any, AnyVueFormComponentMap>> = TOptions extends AppFormOptions<infer TFormData, infer TFormValidators, infer TSubmitReturn, infer TComponents> ? VueFormApi<TFormData, VueFormTypeErrorTypes<TFormValidators, TSubmitReturn>, TComponents> : TOptions extends FormOptions<infer TFormData, infer TFormValidators, infer TSubmitReturn> ? VueFormApi<TFormData, VueFormTypeErrorTypes<TFormValidators, TSubmitReturn>, DefaultVueFormComponentMap> : never;
29
+ type VueFormType<TOptions extends AnyFormOptions> = TOptions extends FormOptions<infer TFormData, infer TFormValidators, infer TSubmitReturn, infer TComponents> ? VueFormApi<TFormData, VueFormTypeErrorTypes<TFormValidators, TSubmitReturn>, TComponents extends AnyVueFormComponentMap ? TComponents : DefaultVueFormComponentMap> : never;
31
30
  //#endregion
32
31
  export { VueFormType };
@@ -10,7 +10,7 @@ function useField(options, fieldComponents) {
10
10
  const field = current.form._getOrCreateFieldApi({
11
11
  ...current,
12
12
  name: current.name
13
- });
13
+ }, "field");
14
14
  if (fieldComponents !== null) Object.assign(field, fieldComponents);
15
15
  return field;
16
16
  };
@@ -23,7 +23,7 @@ function useField(options, fieldComponents) {
23
23
  fieldApi.value = createField();
24
24
  }, { flush: "sync" });
25
25
  watchEffect(() => {
26
- fieldApi.value._update(options());
26
+ fieldApi.value._update(options(), "field");
27
27
  });
28
28
  let mounted = false;
29
29
  let unregister;
@@ -2,7 +2,29 @@ import { AnyVueFormComponentMap, DefaultVueFormComponentMap } from "../AppForm/c
2
2
  import { VueFormApi } from "./formApiTypes.public.js";
3
3
  import { FormOptions, FormValidators, ToFormErrorTypes } from "@tanstack/form-core";
4
4
  //#region src/VueForm/useForm.public.d.ts
5
- type UseFormHook<in out TComponents extends AnyVueFormComponentMap> = <TFormData, const TFormValidators extends FormValidators<TFormData>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn>) => VueFormApi<TFormData, ToFormErrorTypes<TFormValidators, TSubmitReturn>, TComponents>;
5
+ type UseFormHook<in out TComponents extends AnyVueFormComponentMap> = <TFormData, const TFormValidators extends FormValidators<TFormData>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn, unknown>) => VueFormApi<TFormData, ToFormErrorTypes<TFormValidators, TSubmitReturn>, TComponents>;
6
+ /**
7
+ * Creates a Vue form whose instance and lifecycle are owned by the current
8
+ * component.
9
+ *
10
+ * `defaultValues` establish the initial state and inferred form value type. To
11
+ * update the existing form after creation, pass a reactive options object;
12
+ * tracked changes are applied without replacing the form instance.
13
+ *
14
+ * Call this during the component's setup phase. The form mounts with the
15
+ * component and is cleaned up when the component unmounts.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const form = useForm({
20
+ * defaultValues: { name: '' },
21
+ * onSubmit: ({ value }) => saveProfile(value),
22
+ * })
23
+ * ```
24
+ *
25
+ * @returns The Vue form API with typed field, subscription, and form-group
26
+ * components attached.
27
+ */
6
28
  declare const useForm: UseFormHook<DefaultVueFormComponentMap>;
7
29
  //#endregion
8
30
  export { UseFormHook, useForm };
@@ -4,6 +4,28 @@ import { initializeForm, useInternalForm } from "./VueFormApi.lib.js";
4
4
  function useFormHook(options) {
5
5
  return useInternalForm(options, initializeForm);
6
6
  }
7
+ /**
8
+ * Creates a Vue form whose instance and lifecycle are owned by the current
9
+ * component.
10
+ *
11
+ * `defaultValues` establish the initial state and inferred form value type. To
12
+ * update the existing form after creation, pass a reactive options object;
13
+ * tracked changes are applied without replacing the form instance.
14
+ *
15
+ * Call this during the component's setup phase. The form mounts with the
16
+ * component and is cleaned up when the component unmounts.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const form = useForm({
21
+ * defaultValues: { name: '' },
22
+ * onSubmit: ({ value }) => saveProfile(value),
23
+ * })
24
+ * ```
25
+ *
26
+ * @returns The Vue form API with typed field, subscription, and form-group
27
+ * components attached.
28
+ */
7
29
  const useForm = useFormHook;
8
30
 
9
31
  //#endregion
package/dist/index.d.ts CHANGED
@@ -2,15 +2,14 @@ import { AnyVueFormComponentMap, DefaultVueFormComponentMap, VueFormComponentMap
2
2
  import { VueFieldApi, VueFormArrayFieldComponent, VueFormFieldComponent, VueFormFieldProps, VueFormGroupApi, VueFormGroupArrayFieldComponent, VueFormGroupComponent, VueFormGroupFieldComponent, VueFormGroupProps, VueFormGroupSubscribeComponent, VueFormGroupSubscribeProps, VueFormSubscribeComponent, VueFormSubscribeProps, VueTanStackFormComponents } from "./VueForm/Components.public.js";
3
3
  import { AnyVueFormApi, VueFormApi } from "./VueForm/formApiTypes.public.js";
4
4
  import { UseFormHook, useForm } from "./VueForm/useForm.public.js";
5
- import { AppFormOptions, AppFormOptionsApi } from "./AppForm/appFormOptions.public.js";
6
5
  import { VueFormType } from "./VueForm/formType.public.js";
7
6
  import { Subscribe, SubscribeComponent, SubscribeProps, SubscribeSource } from "./Subscribe.public.js";
8
7
  import { AnyFieldGroupApi, FieldGroupApi, FieldGroupArrayFieldComponent, FieldGroupFieldComponent, FieldGroupFormState, FieldGroupSubscribeComponent, FieldGroupSubscribeProps } from "./FieldGroup/FieldGroupApi.public.js";
9
8
  import { AnyFieldGroupFieldSlot, DefineFieldGroupFn, FieldGroupDefinition, FieldGroupFieldBindingForSlot, FieldGroupFieldBindings, FieldGroupFieldBindingsOf, FieldGroupFieldComponentsOf, FieldGroupFieldData, FieldGroupFieldNameForSlot, FieldGroupFieldNames, FieldGroupFieldSlot, FieldGroupFieldSlotAllows, FieldGroupFieldSlotMode, FieldGroupFieldSlotModeOf, FieldGroupFieldSlotValue, FieldGroupFields, FieldGroupFieldsOf, FieldGroupFieldsPropName, FieldGroupForm, FieldGroupHelper, FieldGroupWithFieldsFn, LooseFieldGroupFieldSlot, StrictFieldGroupFieldSlot, VueFieldGroup, defineFieldGroup } from "./FieldGroup/withFields.public.js";
10
9
  import { AppFormComponent, VueAppFormApi } from "./AppForm/VueAppFormApi.public.js";
11
- import { AppFormHookResult, UseAppFormHook } from "./AppForm/createFormHookTypes.public.js";
10
+ import { AppFormHookResult, CreateFormHookOptions, UseAppFormHook } from "./AppForm/createFormHookTypes.public.js";
12
11
  import { createFormHook } from "./AppForm/createFormHook.public.js";
13
12
  import { FormHookHelpers, getFormHookHelpers } from "./AppForm/getFormHookHelpers.public.js";
14
13
  export * from "@tanstack/form-core";
15
14
  export * from "@tanstack/vue-store";
16
- export { AnyFieldGroupApi, AnyFieldGroupFieldSlot, AnyVueFormApi, AnyVueFormComponentMap, AppFormComponent, AppFormHookResult, AppFormOptions, AppFormOptionsApi, DefaultVueFormComponentMap, DefineFieldGroupFn, FieldGroupApi, FieldGroupArrayFieldComponent, FieldGroupDefinition, FieldGroupFieldBindingForSlot, FieldGroupFieldBindings, FieldGroupFieldBindingsOf, FieldGroupFieldComponent, FieldGroupFieldComponentsOf, FieldGroupFieldData, FieldGroupFieldNameForSlot, FieldGroupFieldNames, FieldGroupFieldSlot, FieldGroupFieldSlotAllows, FieldGroupFieldSlotMode, FieldGroupFieldSlotModeOf, FieldGroupFieldSlotValue, FieldGroupFields, FieldGroupFieldsOf, FieldGroupFieldsPropName, FieldGroupForm, FieldGroupFormState, FieldGroupHelper, FieldGroupSubscribeComponent, FieldGroupSubscribeProps, FieldGroupWithFieldsFn, FormHookHelpers, LooseFieldGroupFieldSlot, StrictFieldGroupFieldSlot, Subscribe, SubscribeComponent, SubscribeProps, SubscribeSource, UseAppFormHook, UseFormHook, VueAppFormApi, VueFieldApi, VueFieldGroup, VueFormApi, VueFormArrayFieldComponent, VueFormComponentMap, VueFormFieldComponent, VueFormFieldProps, VueFormGroupApi, VueFormGroupArrayFieldComponent, VueFormGroupComponent, VueFormGroupFieldComponent, VueFormGroupProps, VueFormGroupSubscribeComponent, VueFormGroupSubscribeProps, VueFormSubscribeComponent, VueFormSubscribeProps, VueFormType, VueTanStackFormComponents, createFormHook, defineFieldGroup, getFormHookHelpers, useForm };
15
+ export { AnyFieldGroupApi, AnyFieldGroupFieldSlot, AnyVueFormApi, AnyVueFormComponentMap, AppFormComponent, AppFormHookResult, CreateFormHookOptions, DefaultVueFormComponentMap, DefineFieldGroupFn, FieldGroupApi, FieldGroupArrayFieldComponent, FieldGroupDefinition, FieldGroupFieldBindingForSlot, FieldGroupFieldBindings, FieldGroupFieldBindingsOf, FieldGroupFieldComponent, FieldGroupFieldComponentsOf, FieldGroupFieldData, FieldGroupFieldNameForSlot, FieldGroupFieldNames, FieldGroupFieldSlot, FieldGroupFieldSlotAllows, FieldGroupFieldSlotMode, FieldGroupFieldSlotModeOf, FieldGroupFieldSlotValue, FieldGroupFields, FieldGroupFieldsOf, FieldGroupFieldsPropName, FieldGroupForm, FieldGroupFormState, FieldGroupHelper, FieldGroupSubscribeComponent, FieldGroupSubscribeProps, FieldGroupWithFieldsFn, FormHookHelpers, LooseFieldGroupFieldSlot, StrictFieldGroupFieldSlot, Subscribe, SubscribeComponent, SubscribeProps, SubscribeSource, UseAppFormHook, UseFormHook, VueAppFormApi, VueFieldApi, VueFieldGroup, VueFormApi, VueFormArrayFieldComponent, VueFormComponentMap, VueFormFieldComponent, VueFormFieldProps, VueFormGroupApi, VueFormGroupArrayFieldComponent, VueFormGroupComponent, VueFormGroupFieldComponent, VueFormGroupProps, VueFormGroupSubscribeComponent, VueFormGroupSubscribeProps, VueFormSubscribeComponent, VueFormSubscribeProps, VueFormType, VueTanStackFormComponents, createFormHook, defineFieldGroup, getFormHookHelpers, useForm };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/vue-form",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "Powerful, type-safe forms for Vue.",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanstack/vue-store": "^0.11.1",
29
- "@tanstack/form-core": "2.0.0-alpha.1"
29
+ "@tanstack/form-core": "2.0.0-alpha.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@testing-library/vue": "^8.1.0",
@@ -1,14 +0,0 @@
1
- import { AnyVueFormComponentMap } from "./componentMap.public.js";
2
- import { FormOptions, FormValidatorData, FormValidators, InferUnion, NullableSchemaData } from "@tanstack/form-core";
3
- //#region src/AppForm/appFormOptions.public.d.ts
4
- declare const componentsSymbol: unique symbol;
5
- interface AppFormOptions<TFormData, TFormValidators extends FormValidators<TFormData>, TSubmitReturn, TComponents extends AnyVueFormComponentMap> extends FormOptions<TFormData, TFormValidators, TSubmitReturn> {
6
- [componentsSymbol]: TComponents;
7
- }
8
- interface AppFormOptionsApi<TComponents extends AnyVueFormComponentMap> {
9
- <TFormData, const TFormValidators extends FormValidators<TFormData>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn>): AppFormOptions<TFormData, TFormValidators, TSubmitReturn, TComponents>;
10
- strictSchema: <const TFormValidators extends FormValidators<any>, TFormData extends FormValidatorData<TFormValidators>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn>) => AppFormOptions<FormValidatorData<TFormValidators>, TFormValidators, TSubmitReturn, TComponents>;
11
- looseSchema: <const TFormValidators extends FormValidators<any>, const TFormData extends NullableSchemaData<TFormValidators>, TSubmitReturn>(options: FormOptions<TFormData, TFormValidators, TSubmitReturn>) => AppFormOptions<InferUnion<TFormData, FormValidatorData<TFormValidators>>, TFormValidators, TSubmitReturn, TComponents>;
12
- }
13
- //#endregion
14
- export { AppFormOptions, AppFormOptionsApi };