@bombillazo/rhf-plus 7.64.0-plus.2 → 7.67.0-plus.0

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 +1 @@
1
- {"version":3,"file":"useFieldArray.d.ts","sourceRoot":"","sources":["../src/useFieldArray.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAKV,cAAc,EAId,WAAW,EAIX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,aAAa,CAC3B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,eAAe,SACb,cAAc,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC,YAAY,CAAC,EAC7D,QAAQ,SAAS,MAAM,GAAG,IAAI,EAC9B,kBAAkB,GAAG,YAAY,EAEjC,KAAK,EAAE,kBAAkB,CACvB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,kBAAkB,CACnB,GACA,mBAAmB,CAAC,YAAY,EAAE,eAAe,EAAE,QAAQ,CAAC,CAoW9D"}
1
+ {"version":3,"file":"useFieldArray.d.ts","sourceRoot":"","sources":["../src/useFieldArray.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAKV,cAAc,EAId,WAAW,EAIX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAIjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,aAAa,CAC3B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,eAAe,SACb,cAAc,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC,YAAY,CAAC,EAC7D,QAAQ,SAAS,MAAM,GAAG,IAAI,EAC9B,kBAAkB,GAAG,YAAY,EAEjC,KAAK,EAAE,kBAAkB,CACvB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,kBAAkB,CACnB,GACA,mBAAmB,CAAC,YAAY,EAAE,eAAe,EAAE,QAAQ,CAAC,CAqW9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../src/useForm.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CACrB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EACjC,SAAS,SAAS,YAAY,GAAG,GAAG,EAEpC,KAAK,GAAE,YAAY,CACjB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,SAAS,CACL,GACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,CA2KtE"}
1
+ {"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../src/useForm.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAEZ,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CACrB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EACjC,SAAS,SAAS,YAAY,GAAG,GAAG,EAEpC,KAAK,GAAE,YAAY,CACjB,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,SAAS,CACL,GACL,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,CA8KtE"}
@@ -32,7 +32,7 @@ import type { FieldValues, FormMetadata, FormProviderProps, UseFormReturn } from
32
32
  */
33
33
  export declare const useFormContext: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues, TMetadata extends FormMetadata = any>() => UseFormReturn<TFieldValues, TContext, TTransformedValues>;
34
34
  /**
35
- * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}.
35
+ * A provider component that propagates the `useForm` methods to all children components via [React Context](https://react.dev/reference/react/useContext) API. To be used with {@link useFormContext}.
36
36
  *
37
37
  * @remarks
38
38
  * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi)
@@ -0,0 +1,39 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Control, FieldPath, FieldPathValue, FieldValues } from './types';
3
+ type GetValues<TFieldValues extends FieldValues, TFieldNames extends readonly FieldPath<TFieldValues>[] = readonly []> = TFieldNames extends readonly [
4
+ infer Name extends FieldPath<TFieldValues>,
5
+ ...infer RestFieldNames
6
+ ] ? RestFieldNames extends readonly FieldPath<TFieldValues>[] ? readonly [
7
+ FieldPathValue<TFieldValues, Name>,
8
+ ...GetValues<TFieldValues, RestFieldNames>
9
+ ] : never : TFieldNames extends readonly [infer Name extends FieldPath<TFieldValues>] ? readonly [FieldPathValue<TFieldValues, Name>] : TFieldNames extends readonly [] ? readonly [] : never;
10
+ export type WatchProps<TFieldNames extends readonly FieldPath<TFieldValues>[], TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues> = {
11
+ control: Control<TFieldValues, TContext, TTransformedValues>;
12
+ names: TFieldNames;
13
+ render: (values: GetValues<TFieldValues, TFieldNames>) => ReactNode;
14
+ };
15
+ /**
16
+ * Watch component that subscribes to form field changes and re-renders when watched fields update.
17
+ *
18
+ * @param control - The form control object from useForm
19
+ * @param names - Array of field names to watch for changes
20
+ * @param render - The function that receives watched values and returns ReactNode
21
+ * @returns The result of calling render function with watched values
22
+ *
23
+ * @example
24
+ * The `Watch` component only re-render when the values of `foo`, `bar`, and `baz.qux` change.
25
+ * The types of `foo`, `bar`, and `baz.qux` are precisely inferred.
26
+ *
27
+ * ```tsx
28
+ * const { control } = useForm();
29
+ *
30
+ * <Watch
31
+ * control={control}
32
+ * names={['foo', 'bar', 'baz.qux']}
33
+ * render={([foo, bar, baz_qux]) => <div>{foo}{bar}{baz_qux}</div>}
34
+ * />
35
+ * ```
36
+ */
37
+ export declare const Watch: <const TFieldNames extends readonly FieldPath<TFieldValues>[], TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues>({ control, names, render, }: WatchProps<TFieldNames, TFieldValues, TContext, TTransformedValues>) => ReactNode;
38
+ export {};
39
+ //# sourceMappingURL=watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../src/watch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG/E,KAAK,SAAS,CACZ,YAAY,SAAS,WAAW,EAChC,WAAW,SAAS,SAAS,SAAS,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,EAAE,IAClE,WAAW,SAAS,SAAS;IAC/B,MAAM,IAAI,SAAS,SAAS,CAAC,YAAY,CAAC;IAC1C,GAAG,MAAM,cAAc;CACxB,GACG,cAAc,SAAS,SAAS,SAAS,CAAC,YAAY,CAAC,EAAE,GACvD,SAAS;IACP,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC;IAClC,GAAG,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC;CAC3C,GACD,KAAK,GACP,WAAW,SAAS,SAAS,CAAC,MAAM,IAAI,SAAS,SAAS,CAAC,YAAY,CAAC,CAAC,GACvE,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,GAC7C,WAAW,SAAS,SAAS,EAAE,GAC7B,SAAS,EAAE,GACX,KAAK,CAAC;AAEd,MAAM,MAAM,UAAU,CACpB,WAAW,SAAS,SAAS,SAAS,CAAC,YAAY,CAAC,EAAE,EACtD,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,IAC/B;IACF,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAC7D,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,WAAW,CAAC,KAAK,SAAS,CAAC;CACrE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,KAAK,GAChB,KAAK,CAAC,WAAW,SAAS,SAAS,SAAS,CAAC,YAAY,CAAC,EAAE,EAC5D,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,EACjC,6BAIC,UAAU,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,cAGnE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bombillazo/rhf-plus",
3
3
  "description": "Enhanced functionality for React Hook Form",
4
- "version": "7.64.0-plus.2",
4
+ "version": "7.67.0-plus.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.mjs",
7
7
  "umd:main": "dist/index.umd.js",
@@ -41,22 +41,22 @@
41
41
  "author": "Hector Ayala <hran@bombillazo.com>",
42
42
  "license": "MIT",
43
43
  "devDependencies": {
44
- "@eslint/compat": "^1.4.0",
45
- "@microsoft/api-extractor": "^7.53.0",
46
- "@rollup/plugin-commonjs": "^28.0.6",
47
- "@rollup/plugin-node-resolve": "^16.0.1",
44
+ "@eslint/compat": "^1.4.1",
45
+ "@microsoft/api-extractor": "^7.53.3",
46
+ "@rollup/plugin-commonjs": "^28.0.9",
47
+ "@rollup/plugin-node-resolve": "^16.0.3",
48
48
  "@rollup/plugin-terser": "^0.4.4",
49
- "@swc/core": "^1.13.5",
49
+ "@swc/core": "^1.14.0",
50
50
  "@swc/jest": "^0.2.39",
51
51
  "@testing-library/jest-dom": "^6.9.1",
52
52
  "@testing-library/react": "^16.3.0",
53
53
  "@types/jest": "^30.0.0",
54
54
  "@types/node": "^22.1.0",
55
- "@types/react": "^19.2.0",
56
- "@types/react-dom": "^19.2.0",
55
+ "@types/react": "^19.2.2",
56
+ "@types/react-dom": "^19.2.2",
57
57
  "bundlewatch": "^0.4.1",
58
- "cypress": "^15.3.0",
59
- "eslint": "^9.37.0",
58
+ "cypress": "^15.5.0",
59
+ "eslint": "^9.39.0",
60
60
  "eslint-config-prettier": "^10.1.8",
61
61
  "eslint-plugin-cypress": "^5.2.0",
62
62
  "eslint-plugin-prettier": "^5.5.4",
@@ -68,16 +68,16 @@
68
68
  "jest-environment-jsdom": "^30.2.0",
69
69
  "jest-fixed-jsdom": "^0.0.10",
70
70
  "jest-preview": "^0.3.2",
71
- "lint-staged": "^16.2.3",
71
+ "lint-staged": "^16.2.6",
72
72
  "prettier": "^3.6.2",
73
73
  "react": "^19.2.0",
74
74
  "react-dom": "^19.2.0",
75
- "rimraf": "^6.0.1",
76
- "rollup": "^4.52.4",
75
+ "rimraf": "^6.1.0",
76
+ "rollup": "^4.52.5",
77
77
  "rollup-plugin-typescript2": "^0.36.0",
78
78
  "tsd": "^0.33.0",
79
79
  "typescript": "^5.9.3",
80
- "typescript-eslint": "^8.45.0",
80
+ "typescript-eslint": "^8.46.2",
81
81
  "whatwg-fetch": "^3.6.20",
82
82
  "zod": "^3.25.76"
83
83
  },
@@ -123,7 +123,7 @@
123
123
  "build:modern": "rollup --bundleConfigAsCjs -c ./scripts/rollup/rollup.config.js",
124
124
  "build:esm": "rollup --bundleConfigAsCjs -c ./scripts/rollup/rollup.esm.config.js",
125
125
  "prettier:fix": "prettier --config .prettierrc --write .",
126
- "lint": "eslint '**/*.{js,ts,tsx}'",
126
+ "lint": "eslint '**/*.{js,ts,tsx}' --cache",
127
127
  "lint:fix": "pnpm lint --fix",
128
128
  "type": "tsc --noEmit",
129
129
  "jest-preview": "jest-preview",