@tanstack/react-form 0.19.4 → 0.19.5

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,7 @@
1
1
  import { Field, useField } from './useField.cjs';
2
- import type { ValidateFormData } from './validateFormData.cjs';
3
- import type { FormApi, FormOptions, Validator } from '@tanstack/form-core';
2
+ import { ValidateFormData } from './validateFormData.cjs';
3
+ import { FormApi, FormOptions, Validator } from '@tanstack/form-core';
4
+
4
5
  export type FormFactory<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined> = {
5
6
  useForm: (opts?: FormOptions<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>;
6
7
  useField: typeof useField;
@@ -1,4 +1,5 @@
1
- import type { DeepKeys, DeepValue, FieldApiOptions, Validator } from '@tanstack/form-core';
1
+ import { DeepKeys, DeepValue, FieldApiOptions, Validator } from '@tanstack/form-core';
2
+
2
3
  export type UseFieldOptions<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FieldApiOptions<TParentData, TName, TFieldValidator, TFormValidator, TData> & {
3
4
  mode?: 'value' | 'array';
4
5
  };
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import React from 'rehackt';
3
- import { FieldApi } from '@tanstack/form-core';
4
- import type { UseFieldOptions } from './types.cjs';
5
- import type { DeepKeys, DeepValue, Validator } from '@tanstack/form-core';
1
+ import { default as React } from 'rehackt';
2
+ import { FieldApi, DeepKeys, DeepValue, Validator } from '@tanstack/form-core';
3
+ import { UseFieldOptions } from './types.cjs';
4
+
6
5
  declare module '@tanstack/form-core' {
7
6
  interface FieldApi<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> {
8
7
  Field: FieldComponent<TParentData, TFormValidator>;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
- import { FormApi } from '@tanstack/form-core';
3
- import { type ReactNode } from 'rehackt';
4
- import { type FieldComponent, type UseField } from './useField.cjs';
5
- import type { NoInfer } from '@tanstack/react-store';
6
- import type { FormOptions, FormState, Validator } from '@tanstack/form-core';
1
+ import { FormApi, FormOptions, FormState, Validator } from '@tanstack/form-core';
2
+ import { ReactNode } from 'rehackt';
3
+ import { FieldComponent, UseField } from './useField.cjs';
4
+ import { NoInfer } from '@tanstack/react-store';
5
+
7
6
  declare module '@tanstack/form-core' {
8
7
  interface FormApi<TFormData, TFormValidator> {
9
8
  Field: FieldComponent<TFormData, TFormValidator>;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { useLayoutEffect } from 'rehackt';
2
+
3
3
  export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
@@ -1,4 +1,5 @@
1
- import type { FormApi, Validator } from '@tanstack/form-core';
1
+ import { FormApi, Validator } from '@tanstack/form-core';
2
+
2
3
  export declare function useTransform<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined>(fn: (formBase: FormApi<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>, deps: unknown[]): {
3
4
  fn: (formBase: FormApi<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>;
4
5
  deps: unknown[];
@@ -1,5 +1,6 @@
1
1
  import { decode } from 'decode-formdata';
2
- import type { FormApi, FormOptions, ValidationError, Validator } from '@tanstack/form-core';
2
+ import { FormApi, FormOptions, ValidationError, Validator } from '@tanstack/form-core';
3
+
3
4
  type OnServerValidateFn<TFormData> = (props: {
4
5
  value: TFormData;
5
6
  }) => ValidationError;
@@ -1,6 +1,7 @@
1
1
  import { Field, useField } from './useField.js';
2
- import type { ValidateFormData } from './validateFormData.js';
3
- import type { FormApi, FormOptions, Validator } from '@tanstack/form-core';
2
+ import { ValidateFormData } from './validateFormData.js';
3
+ import { FormApi, FormOptions, Validator } from '@tanstack/form-core';
4
+
4
5
  export type FormFactory<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined> = {
5
6
  useForm: (opts?: FormOptions<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>;
6
7
  useField: typeof useField;
@@ -1,4 +1,5 @@
1
- import type { DeepKeys, DeepValue, FieldApiOptions, Validator } from '@tanstack/form-core';
1
+ import { DeepKeys, DeepValue, FieldApiOptions, Validator } from '@tanstack/form-core';
2
+
2
3
  export type UseFieldOptions<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> = FieldApiOptions<TParentData, TName, TFieldValidator, TFormValidator, TData> & {
3
4
  mode?: 'value' | 'array';
4
5
  };
@@ -1,8 +1,7 @@
1
- /// <reference types="react" />
2
- import React from 'rehackt';
3
- import { FieldApi } from '@tanstack/form-core';
4
- import type { UseFieldOptions } from './types.js';
5
- import type { DeepKeys, DeepValue, Validator } from '@tanstack/form-core';
1
+ import { default as React } from 'rehackt';
2
+ import { FieldApi, DeepKeys, DeepValue, Validator } from '@tanstack/form-core';
3
+ import { UseFieldOptions } from './types.js';
4
+
6
5
  declare module '@tanstack/form-core' {
7
6
  interface FieldApi<TParentData, TName extends DeepKeys<TParentData>, TFieldValidator extends Validator<DeepValue<TParentData, TName>, unknown> | undefined = undefined, TFormValidator extends Validator<TParentData, unknown> | undefined = undefined, TData extends DeepValue<TParentData, TName> = DeepValue<TParentData, TName>> {
8
7
  Field: FieldComponent<TParentData, TFormValidator>;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
- import { FormApi } from '@tanstack/form-core';
3
- import { type ReactNode } from 'rehackt';
4
- import { type FieldComponent, type UseField } from './useField.js';
5
- import type { NoInfer } from '@tanstack/react-store';
6
- import type { FormOptions, FormState, Validator } from '@tanstack/form-core';
1
+ import { FormApi, FormOptions, FormState, Validator } from '@tanstack/form-core';
2
+ import { ReactNode } from 'rehackt';
3
+ import { FieldComponent, UseField } from './useField.js';
4
+ import { NoInfer } from '@tanstack/react-store';
5
+
7
6
  declare module '@tanstack/form-core' {
8
7
  interface FormApi<TFormData, TFormValidator> {
9
8
  Field: FieldComponent<TFormData, TFormValidator>;
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { useLayoutEffect } from 'rehackt';
2
+
3
3
  export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
@@ -1,4 +1,5 @@
1
- import type { FormApi, Validator } from '@tanstack/form-core';
1
+ import { FormApi, Validator } from '@tanstack/form-core';
2
+
2
3
  export declare function useTransform<TFormData, TFormValidator extends Validator<TFormData, unknown> | undefined = undefined>(fn: (formBase: FormApi<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>, deps: unknown[]): {
3
4
  fn: (formBase: FormApi<TFormData, TFormValidator>) => FormApi<TFormData, TFormValidator>;
4
5
  deps: unknown[];
@@ -1,5 +1,6 @@
1
1
  import { decode } from 'decode-formdata';
2
- import type { FormApi, FormOptions, ValidationError, Validator } from '@tanstack/form-core';
2
+ import { FormApi, FormOptions, ValidationError, Validator } from '@tanstack/form-core';
3
+
3
4
  type OnServerValidateFn<TFormData> = (props: {
4
5
  value: TFormData;
5
6
  }) => ValidationError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-form",
3
- "version": "0.19.4",
3
+ "version": "0.19.5",
4
4
  "description": "Powerful, type-safe forms for React.",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -37,28 +37,17 @@
37
37
  "@types/react-dom": "^18.2.19",
38
38
  "@vitejs/plugin-react": "^4.2.1",
39
39
  "react": "^18.2.0",
40
- "react-dom": "^18.2.0"
40
+ "react-dom": "^18.2.0",
41
+ "vite": "^5.0.10"
41
42
  },
42
43
  "dependencies": {
43
44
  "@tanstack/react-store": "^0.3.1",
44
45
  "decode-formdata": "^0.4.0",
45
46
  "rehackt": "^0.0.3",
46
- "@tanstack/form-core": "0.19.4"
47
+ "@tanstack/form-core": "0.19.5"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "react": "^17.0.0 || ^18.0.0"
50
51
  },
51
- "scripts": {
52
- "clean": "rimraf ./dist && rimraf ./coverage",
53
- "test:eslint": "eslint --ext .ts,.tsx ./src",
54
- "test:types:versions49": "node ../../node_modules/typescript49/lib/tsc.js --project tsconfig.legacy.json",
55
- "test:types:versions50": "node ../../node_modules/typescript50/lib/tsc.js --project tsconfig.50.json",
56
- "test:types:versions51": "node ../../node_modules/typescript51/lib/tsc.js",
57
- "test:types:versions52": "tsc",
58
- "test:types": "pnpm run \"/^test:types:versions.*/\"",
59
- "test:lib": "vitest",
60
- "test:lib:dev": "pnpm run test:lib --watch",
61
- "test:build": "publint --strict",
62
- "build": "vite build"
63
- }
52
+ "scripts": {}
64
53
  }