df-ae-forms-package 1.0.71 → 1.0.72

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/index.esm.js CHANGED
@@ -6269,12 +6269,22 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
6269
6269
  }
6270
6270
  // Handle nested components in table cells
6271
6271
  if (component.cells && Array.isArray(component.cells)) {
6272
- component.cells.forEach((row) => {
6273
- row.forEach((cell) => {
6272
+ component.cells.forEach((rowOrCell) => {
6273
+ // Handle 2D array (standard)
6274
+ if (Array.isArray(rowOrCell)) {
6275
+ rowOrCell.forEach((cell) => {
6276
+ if (cell.components && Array.isArray(cell.components)) {
6277
+ evaluateComponentConditionalLogic(cell.components, visibility, currentFormValues, fullSchema);
6278
+ }
6279
+ });
6280
+ }
6281
+ // Handle 1D array (flat)
6282
+ else if (typeof rowOrCell === 'object' && rowOrCell !== null) {
6283
+ const cell = rowOrCell;
6274
6284
  if (cell.components && Array.isArray(cell.components)) {
6275
6285
  evaluateComponentConditionalLogic(cell.components, visibility, currentFormValues, fullSchema);
6276
6286
  }
6277
- });
6287
+ }
6278
6288
  });
6279
6289
  }
6280
6290
  // Handle nested components in datagrid entries
@@ -6309,19 +6319,12 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
6309
6319
  }, [formComponents, formValues]);
6310
6320
  // Check if a component should be visible based on conditional logic
6311
6321
  const shouldShowComponent = useCallback((componentId) => {
6312
- // Recursive find to get the component to check its type and alternate ID
6313
- // We need this because formComponents might only be top-level
6314
- const component = conditionalLogicService.findComponent(formComponents, componentId);
6315
- // Table and datagrid components are always visible at the root level (their contents handle logic)
6316
- if (component && (component.name === 'table' || component.name === 'datagrid')) {
6317
- return true;
6322
+ // Check the visibility map first
6323
+ if (componentVisibility.hasOwnProperty(componentId)) {
6324
+ return componentVisibility[componentId] === true;
6318
6325
  }
6319
- // Default to visible if not explicitly hidden
6320
- // Check both id and _id for maximum resilience
6321
- const isVisible = (componentVisibility[componentId] !== false) &&
6322
- (!component?._id || componentVisibility[component._id] !== false) &&
6323
- (!component?.id || componentVisibility[component.id] !== false);
6324
- return isVisible;
6326
+ // If not in visibility map, component should be visible by default
6327
+ return true;
6325
6328
  }, [componentVisibility, formComponents]);
6326
6329
  // Handle form value changes and re-evaluate conditional logic
6327
6330
  const onFormValueChange = useCallback((change) => {