df-ae-forms-package 1.0.79 → 1.0.80
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 +21 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -6146,19 +6146,25 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
|
|
|
6146
6146
|
validatedComponent.children = getValidatedComponents(validatedComponent.children);
|
|
6147
6147
|
}
|
|
6148
6148
|
if (validatedComponent.cells && Array.isArray(validatedComponent.cells)) {
|
|
6149
|
-
validatedComponent.cells = validatedComponent.cells.map((
|
|
6150
|
-
if (Array.isArray(
|
|
6151
|
-
|
|
6149
|
+
validatedComponent.cells = validatedComponent.cells.map((rowOrCell) => {
|
|
6150
|
+
if (Array.isArray(rowOrCell)) {
|
|
6151
|
+
// Standard 2D: rowOrCell is an array of cells
|
|
6152
|
+
return rowOrCell.map((cell) => {
|
|
6152
6153
|
if (cell && cell.components && Array.isArray(cell.components)) {
|
|
6153
|
-
return {
|
|
6154
|
-
...cell,
|
|
6155
|
-
components: getValidatedComponents(cell.components)
|
|
6156
|
-
};
|
|
6154
|
+
return { ...cell, components: getValidatedComponents(cell.components) };
|
|
6157
6155
|
}
|
|
6158
6156
|
return cell;
|
|
6159
6157
|
});
|
|
6160
6158
|
}
|
|
6161
|
-
|
|
6159
|
+
else if (typeof rowOrCell === 'object' && rowOrCell !== null) {
|
|
6160
|
+
// Flat 1D: rowOrCell IS the cell object
|
|
6161
|
+
const cell = rowOrCell;
|
|
6162
|
+
if (cell.components && Array.isArray(cell.components)) {
|
|
6163
|
+
return { ...cell, components: getValidatedComponents(cell.components) };
|
|
6164
|
+
}
|
|
6165
|
+
return cell;
|
|
6166
|
+
}
|
|
6167
|
+
return rowOrCell;
|
|
6162
6168
|
});
|
|
6163
6169
|
}
|
|
6164
6170
|
if (validatedComponent.entries && Array.isArray(validatedComponent.entries)) {
|
|
@@ -7655,15 +7661,22 @@ const DfFormTable = ({ id, properties, mode = 'edit', formData = {}, validationE
|
|
|
7655
7661
|
const raw = properties.cells;
|
|
7656
7662
|
if (!raw || !Array.isArray(raw) || raw.length === 0)
|
|
7657
7663
|
return [];
|
|
7664
|
+
// DEBUG: Log cell structure to understand API format
|
|
7665
|
+
console.log('[DfFormTable] raw cells (first item):', JSON.stringify(raw[0], null, 2));
|
|
7666
|
+
console.log('[DfFormTable] is first item array?', Array.isArray(raw[0]));
|
|
7667
|
+
console.log('[DfFormTable] total cells:', raw.length);
|
|
7658
7668
|
// Check if it's already a 2D array (first element is an array)
|
|
7659
7669
|
if (Array.isArray(raw[0])) {
|
|
7670
|
+
console.log('[DfFormTable] Using 2D array format');
|
|
7660
7671
|
return raw;
|
|
7661
7672
|
}
|
|
7662
7673
|
// It's a flat 1D array — reconstruct 2D using each cell's row/column
|
|
7674
|
+
console.log('[DfFormTable] Using 1D flat format, reconstructing 2D grid');
|
|
7663
7675
|
const grid = [];
|
|
7664
7676
|
raw.forEach((cell) => {
|
|
7665
7677
|
const r = typeof cell.row === 'number' ? cell.row : 0;
|
|
7666
7678
|
const c = typeof cell.column === 'number' ? cell.column : 0;
|
|
7679
|
+
console.log(`[DfFormTable] Cell at row=${r} col=${c}, components count:`, cell.components?.length ?? 0);
|
|
7667
7680
|
if (!grid[r])
|
|
7668
7681
|
grid[r] = [];
|
|
7669
7682
|
grid[r][c] = cell;
|