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