@overmap-ai/forms 1.0.32-react-flow-david-fixes.22 → 1.0.32-react-flow-david-fixes.24

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 CHANGED
@@ -33020,7 +33020,6 @@ class BaseCondition extends Observable {
33020
33020
  const conditionValue = this.getConditionValue();
33021
33021
  if (conditionValue === void 0 || !modifier.isConditionValueValid(conditionValue)) return true;
33022
33022
  if (!modifier.isValueValid(value)) return false;
33023
- console.debug(this, value);
33024
33023
  return modifier.modifier.modifierFn(value, conditionValue);
33025
33024
  });
33026
33025
  this.id = id;
@@ -34740,7 +34739,6 @@ const FieldSectionLayout = memo((props) => {
34740
34739
  }, [fieldSections, section.identifier]);
34741
34740
  const conditionMet = useMemo(() => {
34742
34741
  if (conditionalSections.length === 0) return true;
34743
- console.debug("apply conditions section layout", values);
34744
34742
  return conditionalSections.some(
34745
34743
  (conditionalSection) => applyConditions(conditionalSection.getConditions(section.identifier), values)
34746
34744
  );
@@ -36139,7 +36137,6 @@ const validateFields = (fields, values) => {
36139
36137
  for (const field of fields) {
36140
36138
  if (field instanceof FieldSection) {
36141
36139
  const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
36142
- console.debug("apply conditions validate fields", values);
36143
36140
  const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
36144
36141
  (conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
36145
36142
  ) : true;
@@ -36244,7 +36241,7 @@ async function awaitPromisesFromFieldValues(values) {
36244
36241
  const FormRenderer = memo(
36245
36242
  forwardRef((props, ref) => {
36246
36243
  const {
36247
- schema: schemaFromProps,
36244
+ schema,
36248
36245
  values = {},
36249
36246
  onValuesChange,
36250
36247
  onSubmit,
@@ -36254,22 +36251,18 @@ const FormRenderer = memo(
36254
36251
  onDirty,
36255
36252
  onDirtyChange,
36256
36253
  // if the title isn't provided, hide it by default
36257
- hideTitle = !schemaFromProps.title,
36254
+ hideTitle = !schema.title,
36258
36255
  hideDescription,
36259
36256
  className,
36260
36257
  buttonProps,
36261
36258
  enableReinitialize = false,
36262
36259
  excludeUnchangedFields = false
36263
36260
  } = props;
36264
- const [schema, setSchema] = useState(schemaFromProps);
36265
- useLayoutEffect(() => {
36266
- setSchema(schemaFromProps);
36267
- }, [schemaFromProps]);
36268
36261
  const { readonly } = schema.meta;
36269
36262
  const formId2 = useId$1();
36270
36263
  const initialValues = useMemo(() => {
36271
- return initializeFieldValues(flattenFields(schemaFromProps.fields), values);
36272
- }, [schemaFromProps.fields, values]);
36264
+ return initializeFieldValues(flattenFields(schema.fields), values);
36265
+ }, [schema.fields, values]);
36273
36266
  const handleSubmit = useCallback(
36274
36267
  (values2) => {
36275
36268
  onSubmit == null ? void 0 : onSubmit(
@@ -33022,7 +33022,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
33022
33022
  const conditionValue = this.getConditionValue();
33023
33023
  if (conditionValue === void 0 || !modifier.isConditionValueValid(conditionValue)) return true;
33024
33024
  if (!modifier.isValueValid(value)) return false;
33025
- console.debug(this, value);
33026
33025
  return modifier.modifier.modifierFn(value, conditionValue);
33027
33026
  });
33028
33027
  this.id = id;
@@ -34742,7 +34741,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
34742
34741
  }, [fieldSections, section.identifier]);
34743
34742
  const conditionMet = React.useMemo(() => {
34744
34743
  if (conditionalSections.length === 0) return true;
34745
- console.debug("apply conditions section layout", values);
34746
34744
  return conditionalSections.some(
34747
34745
  (conditionalSection) => applyConditions(conditionalSection.getConditions(section.identifier), values)
34748
34746
  );
@@ -36141,7 +36139,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
36141
36139
  for (const field of fields) {
36142
36140
  if (field instanceof FieldSection) {
36143
36141
  const conditionalSections = sectionElements.filter((section) => field.identifier in section.conditions);
36144
- console.debug("apply conditions validate fields", values);
36145
36142
  const conditionMet = conditionalSections.length > 0 ? conditionalSections.some(
36146
36143
  (conditionalSection) => applyConditions(conditionalSection.getConditions(field.identifier), values)
36147
36144
  ) : true;
@@ -36246,7 +36243,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
36246
36243
  const FormRenderer = React.memo(
36247
36244
  React.forwardRef((props, ref) => {
36248
36245
  const {
36249
- schema: schemaFromProps,
36246
+ schema,
36250
36247
  values = {},
36251
36248
  onValuesChange,
36252
36249
  onSubmit,
@@ -36256,22 +36253,18 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
36256
36253
  onDirty,
36257
36254
  onDirtyChange,
36258
36255
  // if the title isn't provided, hide it by default
36259
- hideTitle = !schemaFromProps.title,
36256
+ hideTitle = !schema.title,
36260
36257
  hideDescription,
36261
36258
  className,
36262
36259
  buttonProps,
36263
36260
  enableReinitialize = false,
36264
36261
  excludeUnchangedFields = false
36265
36262
  } = props;
36266
- const [schema, setSchema] = React.useState(schemaFromProps);
36267
- React.useLayoutEffect(() => {
36268
- setSchema(schemaFromProps);
36269
- }, [schemaFromProps]);
36270
36263
  const { readonly } = schema.meta;
36271
36264
  const formId2 = React.useId();
36272
36265
  const initialValues = React.useMemo(() => {
36273
- return initializeFieldValues(flattenFields(schemaFromProps.fields), values);
36274
- }, [schemaFromProps.fields, values]);
36266
+ return initializeFieldValues(flattenFields(schema.fields), values);
36267
+ }, [schema.fields, values]);
36275
36268
  const handleSubmit = React.useCallback(
36276
36269
  (values2) => {
36277
36270
  onSubmit == null ? void 0 : onSubmit(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overmap-ai/forms",
3
- "version": "1.0.32-react-flow-david-fixes.22",
3
+ "version": "1.0.32-react-flow-david-fixes.24",
4
4
  "license": "UNLICENSED",
5
5
  "main": "dist/forms.umd.cjs",
6
6
  "module": "dist/forms.js",