react-f0rm 0.3.0 → 0.4.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.
- package/README.md +48 -2
- package/dist/devtools/index.cjs.js.map +1 -1
- package/dist/devtools/index.mjs.map +1 -1
- package/dist/index.cjs.js +10 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +68 -12
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +10 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +2 -2
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1443,7 +1443,13 @@
|
|
|
1443
1443
|
function useFieldArray(options) {
|
|
1444
1444
|
return useFieldArrayCore(options, Context);
|
|
1445
1445
|
}
|
|
1446
|
-
return {
|
|
1446
|
+
return {
|
|
1447
|
+
context: Context,
|
|
1448
|
+
FormProvider: FormProvider2,
|
|
1449
|
+
useFormContext: useFormContext2,
|
|
1450
|
+
useField,
|
|
1451
|
+
useFieldArray
|
|
1452
|
+
};
|
|
1447
1453
|
}
|
|
1448
1454
|
const CheckboxGroupContext = React.createContext(null);
|
|
1449
1455
|
const CheckboxGroupProvider = CheckboxGroupContext.Provider;
|
|
@@ -1455,6 +1461,7 @@
|
|
|
1455
1461
|
|
|
1456
1462
|
function Form({
|
|
1457
1463
|
form: f1,
|
|
1464
|
+
context,
|
|
1458
1465
|
initialValues,
|
|
1459
1466
|
values,
|
|
1460
1467
|
onSubmit,
|
|
@@ -1471,7 +1478,8 @@
|
|
|
1471
1478
|
onInvalidSubmit,
|
|
1472
1479
|
shouldFocusError
|
|
1473
1480
|
});
|
|
1474
|
-
|
|
1481
|
+
const { Provider } = context ?? FormContext;
|
|
1482
|
+
return /* @__PURE__ */ React__namespace.createElement(Provider, { value: form }, /* @__PURE__ */ React__namespace.createElement("form", { ...props, noValidate: true, onSubmit: submit }));
|
|
1475
1483
|
}
|
|
1476
1484
|
|
|
1477
1485
|
function setRef(ref, value) {
|