@ttoss/forms 0.14.1 → 0.14.3

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/esm/index.js CHANGED
@@ -181,7 +181,7 @@ var FormFieldRadio = ({
181
181
  onChange,
182
182
  onBlur,
183
183
  value: option.value,
184
- defaultChecked: value === option.value,
184
+ checked: value === option.value,
185
185
  name,
186
186
  id,
187
187
  ...radioProps
package/dist/index.d.ts CHANGED
@@ -15,20 +15,20 @@ declare const Form: <TFieldValues extends FieldValues = FieldValues>({ children,
15
15
  children: React.ReactNode | React.ReactNode[];
16
16
  } & react_hook_form.UseFormReturn<TFieldValues, any>) => JSX.Element;
17
17
 
18
- declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>> = react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>>({ label, id: idProp, name, defaultValue, render, }: {
18
+ declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<TFieldValues> = react_hook_form.Path<TFieldValues>>({ label, id: idProp, name, defaultValue, render, }: {
19
19
  label?: string | undefined;
20
20
  id?: string | undefined;
21
21
  name: TName;
22
- defaultValue?: react_hook_form.PathValue<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>, TName> | undefined;
22
+ defaultValue?: react_hook_form.PathValue<TFieldValues, TName> | undefined;
23
23
  render: (props: UseControllerReturn<TFieldValues, TName>) => React.ReactElement;
24
24
  }) => JSX.Element;
25
25
 
26
26
  declare const FormFieldCheckbox: <TFieldValues extends FieldValues = FieldValues>({ label, name, ...checkboxProps }: {
27
27
  label?: string | undefined;
28
- name: react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>;
28
+ name: react_hook_form.Path<TFieldValues>;
29
29
  } & CheckboxProps) => JSX.Element;
30
30
 
31
- declare const FormFieldInput: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>> = react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>>({ label, name, ...inputProps }: {
31
+ declare const FormFieldInput: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<TFieldValues> = react_hook_form.Path<TFieldValues>>({ label, name, ...inputProps }: {
32
32
  label?: string | undefined;
33
33
  name: TName;
34
34
  } & InputProps) => JSX.Element;
@@ -39,7 +39,7 @@ type FormRadioOption$1 = {
39
39
  };
40
40
  declare const FormFieldRadio: <TFieldValues extends FieldValues = FieldValues>({ label, name, options, ...radioProps }: {
41
41
  label?: string | undefined;
42
- name: react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>;
42
+ name: react_hook_form.Path<TFieldValues>;
43
43
  options: FormRadioOption$1[];
44
44
  } & RadioProps) => JSX.Element;
45
45
 
@@ -49,11 +49,11 @@ type FormRadioOption = {
49
49
  };
50
50
  declare const FormFieldSelect: <TFieldValues extends FieldValues = FieldValues>({ label, name, options, ...selectProps }: {
51
51
  label?: string | undefined;
52
- name: react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>;
52
+ name: react_hook_form.Path<TFieldValues>;
53
53
  options: FormRadioOption[];
54
54
  } & SelectProps) => JSX.Element;
55
55
 
56
- declare const FormFieldTextarea: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>> = react_hook_form.Path<react_hook_form.UnPackAsyncDefaultValues<TFieldValues>>>({ label, name, ...textareaProps }: {
56
+ declare const FormFieldTextarea: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<TFieldValues> = react_hook_form.Path<TFieldValues>>({ label, name, ...textareaProps }: {
57
57
  label?: string | undefined;
58
58
  name: TName;
59
59
  } & TextareaProps) => JSX.Element;
package/dist/index.js CHANGED
@@ -20,6 +20,10 @@ var __copyProps = (to, from, except, desc) => {
20
20
  };
21
21
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
22
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
27
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
28
  mod
25
29
  ));
@@ -217,7 +221,7 @@ var FormFieldRadio = ({
217
221
  onChange,
218
222
  onBlur,
219
223
  value: option.value,
220
- defaultChecked: value === option.value,
224
+ checked: value === option.value,
221
225
  name,
222
226
  id,
223
227
  ...radioProps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/forms",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "license": "UNLICENSED",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -20,26 +20,26 @@
20
20
  "typings": "dist/index.d.ts",
21
21
  "dependencies": {
22
22
  "@hookform/error-message": "^2.0.1",
23
- "@hookform/resolvers": "^2.9.10",
24
- "react-hook-form": "^7.41.2",
25
- "yup": "^0.32.11"
23
+ "@hookform/resolvers": "^2.9.11",
24
+ "react-hook-form": "^7.43.2",
25
+ "yup": "^1.0.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "@ttoss/ui": "^1.27.3",
28
+ "@ttoss/ui": "^1.30.2",
29
29
  "react": "^18.2.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@ttoss/config": "^1.28.0",
33
- "@ttoss/test-utils": "^1.20.2",
34
- "@ttoss/ui": "^1.30.1",
32
+ "@ttoss/config": "^1.28.2",
33
+ "@ttoss/test-utils": "^1.20.4",
34
+ "@ttoss/ui": "^1.30.3",
35
35
  "@types/jest": "^29.4.0",
36
- "jest": "^29.4.1",
36
+ "jest": "^29.4.3",
37
37
  "react": "^18.2.0",
38
- "react-hook-form": "^7.41.2",
39
- "yup": "^0.32.11"
38
+ "react-hook-form": "^7.43.2",
39
+ "yup": "^1.0.0"
40
40
  },
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "a0c650bebb4029e9757d2f4a606ba7f25558f7a2"
44
+ "gitHead": "8ba4361ab9cf6c0ab275ee771a371d4c2ba8cebe"
45
45
  }
@@ -38,7 +38,7 @@ export const FormFieldRadio = <TFieldValues extends FieldValues = FieldValues>({
38
38
  onChange={onChange}
39
39
  onBlur={onBlur}
40
40
  value={option.value}
41
- defaultChecked={value === option.value}
41
+ checked={value === option.value}
42
42
  name={name}
43
43
  id={id}
44
44
  {...radioProps}