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 +18 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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((
|
|
6275
|
-
|
|
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
|
-
//
|
|
6315
|
-
|
|
6316
|
-
|
|
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
|
-
//
|
|
6322
|
-
|
|
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) => {
|