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