@overmap-ai/forms 1.0.9-handle-patchform-errors.0 → 1.0.9
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/fields/index.d.ts +1 -1
- package/dist/forms.js +8 -9
- package/dist/forms.js.map +1 -1
- package/dist/forms.umd.cjs +7 -8
- package/dist/forms.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/forms.umd.cjs
CHANGED
|
@@ -1828,7 +1828,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1828
1828
|
const PatchFormProvider = React.memo(
|
|
1829
1829
|
React.forwardRef((props, ref) => {
|
|
1830
1830
|
const { children, schema, values, onPatch, onError, ...rest } = props;
|
|
1831
|
-
const { showError } = blocks.useToast();
|
|
1832
1831
|
const initialValues2 = React.useMemo(() => initialFormValues(schema.fields, values), [schema.fields, values]);
|
|
1833
1832
|
const handlePatch = React.useCallback(
|
|
1834
1833
|
(values2) => {
|
|
@@ -1841,7 +1840,6 @@ var __publicField = (obj, key, value) => {
|
|
|
1841
1840
|
}
|
|
1842
1841
|
if (!hasKeys(diff))
|
|
1843
1842
|
return;
|
|
1844
|
-
console.log("onpatch runs", diff);
|
|
1845
1843
|
onPatch(diff);
|
|
1846
1844
|
},
|
|
1847
1845
|
[initialValues2, onPatch]
|
|
@@ -1867,13 +1865,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1867
1865
|
const { errors, resetForm } = formik$1;
|
|
1868
1866
|
React.useEffect(() => {
|
|
1869
1867
|
if (hasKeys(errors)) {
|
|
1870
|
-
|
|
1871
|
-
showError({
|
|
1872
|
-
title: "test title",
|
|
1873
|
-
description: "Sections with conditions must be below the fields they reference."
|
|
1874
|
-
});
|
|
1868
|
+
resetForm({ values: initialValues2, errors: {} });
|
|
1875
1869
|
}
|
|
1876
|
-
}, [
|
|
1870
|
+
}, [errors, initialValues2, resetForm]);
|
|
1877
1871
|
return /* @__PURE__ */ jsxRuntime.jsx(formik.FormikProvider, { value: formik$1, children: /* @__PURE__ */ jsxRuntime.jsx("form", { ...rest, ref, onSubmit: formik$1.handleSubmit, children }) });
|
|
1878
1872
|
})
|
|
1879
1873
|
);
|
|
@@ -2668,6 +2662,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2668
2662
|
] }) });
|
|
2669
2663
|
})
|
|
2670
2664
|
);
|
|
2665
|
+
exports2.BaseField = BaseField;
|
|
2666
|
+
exports2.BaseFormElement = BaseFormElement;
|
|
2671
2667
|
exports2.BooleanField = BooleanField;
|
|
2672
2668
|
exports2.BooleanInput = BooleanInput;
|
|
2673
2669
|
exports2.DateField = DateField;
|
|
@@ -2678,6 +2674,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2678
2674
|
exports2.FormRenderer = FormRenderer;
|
|
2679
2675
|
exports2.FormSubmissionBrowser = FormSubmissionBrowser;
|
|
2680
2676
|
exports2.FormSubmissionViewer = FormSubmissionViewer;
|
|
2677
|
+
exports2.InputWithLabel = InputWithLabel;
|
|
2678
|
+
exports2.InputWithLabelAndHelpText = InputWithLabelAndHelpText;
|
|
2681
2679
|
exports2.MultiSelectField = MultiSelectField;
|
|
2682
2680
|
exports2.MultiSelectInput = MultiSelectInput;
|
|
2683
2681
|
exports2.MultiStringField = MultiStringField;
|
|
@@ -2698,6 +2696,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2698
2696
|
exports2.isConditionMet = isConditionMet;
|
|
2699
2697
|
exports2.useFieldInput = useFieldInput;
|
|
2700
2698
|
exports2.useFieldInputs = useFieldInputs;
|
|
2699
|
+
exports2.useFormikInput = useFormikInput;
|
|
2701
2700
|
exports2.valueIsFile = valueIsFile;
|
|
2702
2701
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
2703
2702
|
});
|