@overmap-ai/forms 1.0.32-react-flow-david-fixes.18 → 1.0.32-react-flow-david-fixes.19
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/forms.js +3 -2
- package/dist/forms.umd.cjs +3 -2
- package/package.json +1 -1
package/dist/forms.js
CHANGED
|
@@ -34621,7 +34621,6 @@ const deserializeConditions = (serializedConditions, fields) => {
|
|
|
34621
34621
|
);
|
|
34622
34622
|
};
|
|
34623
34623
|
const applyConditions = (conditions, values) => {
|
|
34624
|
-
console.debug("apply conditions", values);
|
|
34625
34624
|
return conditions.length > 0 ? conditions.every((condition) => {
|
|
34626
34625
|
return condition.apply(values[condition.field.identifier]);
|
|
34627
34626
|
}) : true;
|
|
@@ -34741,6 +34740,7 @@ const FieldSectionLayout = memo((props) => {
|
|
|
34741
34740
|
}, [fieldSections, section.identifier]);
|
|
34742
34741
|
const conditionMet = useMemo(() => {
|
|
34743
34742
|
if (conditionalSections.length === 0) return true;
|
|
34743
|
+
console.debug("apply conditions section layout", values);
|
|
34744
34744
|
return conditionalSections.some(
|
|
34745
34745
|
(conditionalSection) => applyConditions(conditionalSection.getConditions(section.identifier), values)
|
|
34746
34746
|
);
|
|
@@ -36139,6 +36139,7 @@ const validateFields = (fields, values) => {
|
|
|
36139
36139
|
for (const field of fields) {
|
|
36140
36140
|
if (field instanceof FieldSection) {
|
|
36141
36141
|
const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
|
|
36142
|
+
console.debug("apply conditions validate fields", values);
|
|
36142
36143
|
const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
|
|
36143
36144
|
(conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
|
|
36144
36145
|
) : true;
|
|
@@ -36277,7 +36278,7 @@ const FormRenderer = memo(
|
|
|
36277
36278
|
const formik = useFormik({
|
|
36278
36279
|
initialValues,
|
|
36279
36280
|
onSubmit: handleSubmit,
|
|
36280
|
-
validate: (
|
|
36281
|
+
validate: (values2) => validateFields(schema.fields, values2),
|
|
36281
36282
|
// only validate the entire form on submit
|
|
36282
36283
|
validateOnBlur: false,
|
|
36283
36284
|
validateOnChange: false,
|
package/dist/forms.umd.cjs
CHANGED
|
@@ -34623,7 +34623,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
34623
34623
|
);
|
|
34624
34624
|
};
|
|
34625
34625
|
const applyConditions = (conditions, values) => {
|
|
34626
|
-
console.debug("apply conditions", values);
|
|
34627
34626
|
return conditions.length > 0 ? conditions.every((condition) => {
|
|
34628
34627
|
return condition.apply(values[condition.field.identifier]);
|
|
34629
34628
|
}) : true;
|
|
@@ -34743,6 +34742,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
34743
34742
|
}, [fieldSections, section.identifier]);
|
|
34744
34743
|
const conditionMet = React.useMemo(() => {
|
|
34745
34744
|
if (conditionalSections.length === 0) return true;
|
|
34745
|
+
console.debug("apply conditions section layout", values);
|
|
34746
34746
|
return conditionalSections.some(
|
|
34747
34747
|
(conditionalSection) => applyConditions(conditionalSection.getConditions(section.identifier), values)
|
|
34748
34748
|
);
|
|
@@ -36141,6 +36141,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
36141
36141
|
for (const field of fields) {
|
|
36142
36142
|
if (field instanceof FieldSection) {
|
|
36143
36143
|
const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
|
|
36144
|
+
console.debug("apply conditions validate fields", values);
|
|
36144
36145
|
const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
|
|
36145
36146
|
(conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
|
|
36146
36147
|
) : true;
|
|
@@ -36279,7 +36280,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
|
|
|
36279
36280
|
const formik$1 = formik.useFormik({
|
|
36280
36281
|
initialValues,
|
|
36281
36282
|
onSubmit: handleSubmit,
|
|
36282
|
-
validate: (
|
|
36283
|
+
validate: (values2) => validateFields(schema.fields, values2),
|
|
36283
36284
|
// only validate the entire form on submit
|
|
36284
36285
|
validateOnBlur: false,
|
|
36285
36286
|
validateOnChange: false,
|