df-ae-forms-package 1.0.78 → 1.0.79

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
@@ -5144,7 +5144,7 @@ formTemplateId, onThresholdActionCompletion, onThresholdIssueRaised, onNotesChan
5144
5144
  whiteSpace: 'nowrap',
5145
5145
  overflow: 'hidden',
5146
5146
  textOverflow: 'ellipsis'
5147
- }, children: component.basic?.label || `Column ${index + 1}` }, `header-${component.id}`))) })), dataEntries.length > 0 ? (dataEntries.map((entry, entryIndex) => (jsxs("div", { className: "table-row", style: {
5147
+ }, children: component.basic?.label || `Column ${index + 1}` }, `header-${component.id || index}`))) })), dataEntries.length > 0 ? (dataEntries.map((entry, entryIndex) => (jsxs("div", { className: "table-row", style: {
5148
5148
  // Use flex column for column view, grid for row view
5149
5149
  display: columnView ? 'flex' : 'grid',
5150
5150
  flexDirection: columnView ? 'column' : 'row',
@@ -6990,13 +6990,25 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
6990
6990
  updatedComponent.children = updateComponentValues(updatedComponent.children);
6991
6991
  }
6992
6992
  if (updatedComponent.name === 'table' && updatedComponent.cells) {
6993
- updatedComponent.cells = updatedComponent.cells.map((row) => row.map((cell) => {
6994
- const updatedCell = { ...cell };
6995
- if (updatedCell.components) {
6996
- updatedCell.components = updateComponentValues(updatedCell.components);
6993
+ updatedComponent.cells = updatedComponent.cells.map((rowOrCell) => {
6994
+ if (Array.isArray(rowOrCell)) {
6995
+ return rowOrCell.map((cell) => {
6996
+ const updatedCell = { ...cell };
6997
+ if (updatedCell.components) {
6998
+ updatedCell.components = updateComponentValues(updatedCell.components);
6999
+ }
7000
+ return updatedCell;
7001
+ });
7002
+ }
7003
+ else {
7004
+ // 1D flat cell
7005
+ const updatedCell = { ...rowOrCell };
7006
+ if (updatedCell.components) {
7007
+ updatedCell.components = updateComponentValues(updatedCell.components);
7008
+ }
7009
+ return updatedCell;
6997
7010
  }
6998
- return updatedCell;
6999
- }));
7011
+ });
7000
7012
  }
7001
7013
  if (updatedComponent.name === 'datagrid' && updatedComponent.entries) {
7002
7014
  updatedComponent.entries = updatedComponent.entries.map((entry) => {
@@ -7177,24 +7189,35 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
7177
7189
  // Handle notes change for table cell components
7178
7190
  const updatedComponents = formComponents.map(comp => {
7179
7191
  if (comp.id === component.id && comp.cells) {
7180
- const updatedCells = comp.cells.map((row) => row.map((cell) => {
7181
- if (cell.components) {
7182
- const updatedCellComponents = cell.components.map((cellComp) => {
7183
- if (cellComp.id === componentId) {
7184
- return {
7185
- ...cellComp,
7186
- basic: {
7187
- ...cellComp.basic,
7188
- notes
7192
+ const updatedCells = comp.cells.map((rowOrCell) => {
7193
+ if (Array.isArray(rowOrCell)) {
7194
+ return rowOrCell.map((cell) => {
7195
+ if (cell.components) {
7196
+ const updatedCellComponents = cell.components.map((cellComp) => {
7197
+ if (cellComp.id === componentId) {
7198
+ return { ...cellComp, basic: { ...cellComp.basic, notes } };
7189
7199
  }
7190
- };
7200
+ return cellComp;
7201
+ });
7202
+ return { ...cell, components: updatedCellComponents };
7191
7203
  }
7192
- return cellComp;
7204
+ return cell;
7193
7205
  });
7194
- return { ...cell, components: updatedCellComponents };
7195
7206
  }
7196
- return cell;
7197
- }));
7207
+ else {
7208
+ const cell = rowOrCell;
7209
+ if (cell.components) {
7210
+ const updatedCellComponents = cell.components.map((cellComp) => {
7211
+ if (cellComp.id === componentId) {
7212
+ return { ...cellComp, basic: { ...cellComp.basic, notes } };
7213
+ }
7214
+ return cellComp;
7215
+ });
7216
+ return { ...cell, components: updatedCellComponents };
7217
+ }
7218
+ return cell;
7219
+ }
7220
+ });
7198
7221
  return { ...comp, cells: updatedCells };
7199
7222
  }
7200
7223
  return comp;
@@ -7204,24 +7227,35 @@ onComponentSelect, onComponentDelete, onComponentEdit, onComponentUpdate, select
7204
7227
  // Handle attachment change for table cell components
7205
7228
  const updatedComponents = formComponents.map(comp => {
7206
7229
  if (comp.id === component.id && comp.cells) {
7207
- const updatedCells = comp.cells.map((row) => row.map((cell) => {
7208
- if (cell.components) {
7209
- const updatedCellComponents = cell.components.map((cellComp) => {
7210
- if (cellComp.id === componentId) {
7211
- return {
7212
- ...cellComp,
7213
- basic: {
7214
- ...cellComp.basic,
7215
- attachments: attachments || []
7230
+ const updatedCells = comp.cells.map((rowOrCell) => {
7231
+ if (Array.isArray(rowOrCell)) {
7232
+ return rowOrCell.map((cell) => {
7233
+ if (cell.components) {
7234
+ const updatedCellComponents = cell.components.map((cellComp) => {
7235
+ if (cellComp.id === componentId) {
7236
+ return { ...cellComp, basic: { ...cellComp.basic, attachments: attachments || [] } };
7216
7237
  }
7217
- };
7238
+ return cellComp;
7239
+ });
7240
+ return { ...cell, components: updatedCellComponents };
7218
7241
  }
7219
- return cellComp;
7242
+ return cell;
7220
7243
  });
7221
- return { ...cell, components: updatedCellComponents };
7222
7244
  }
7223
- return cell;
7224
- }));
7245
+ else {
7246
+ const cell = rowOrCell;
7247
+ if (cell.components) {
7248
+ const updatedCellComponents = cell.components.map((cellComp) => {
7249
+ if (cellComp.id === componentId) {
7250
+ return { ...cellComp, basic: { ...cellComp.basic, attachments: attachments || [] } };
7251
+ }
7252
+ return cellComp;
7253
+ });
7254
+ return { ...cell, components: updatedCellComponents };
7255
+ }
7256
+ return cell;
7257
+ }
7258
+ });
7225
7259
  return { ...comp, cells: updatedCells };
7226
7260
  }
7227
7261
  return comp;
@@ -7834,7 +7868,7 @@ const DfFormTable = ({ id, properties, mode = 'edit', formData = {}, validationE
7834
7868
  fontSize: '14px',
7835
7869
  textAlign: 'center'
7836
7870
  }, children: columnName }, `header-${colIndex}`));
7837
- }) }) })), jsx("tbody", { children: cellsWithIds.map((row, rowIndex) => (jsx("tr", { className: "table-row", children: row.map((cell) => (jsx(TableCellComponent, { cell: cell, mode: mode, onComponentSelect: onComponentSelect || (() => { }), onComponentDelete: handleComponentDelete, onComponentEdit: onComponentEdit, selectedComponent: selectedComponent || null, renderFormComponent: renderComponent, formData: formData, formTemplateId: formTemplateId, onThresholdActionCompletion: onThresholdActionCompletion, onThresholdIssueRaised: onThresholdIssueRaised, tableId: id, onNotesChange: onNotesChange, onAttachmentChange: onAttachmentChange, workOrderNumber: workOrderNumber, assetNumber: assetNumber, user: user, onCreateIssue: onCreateIssue, onUpdateIssue: onUpdateIssue }, cell.id))) }, rowIndex))) })] })] }))] }));
7871
+ }) }) })), jsx("tbody", { children: cellsWithIds.filter(row => Array.isArray(row) && row.length > 0).map((row, rowIndex) => (jsx("tr", { className: "table-row", children: row.filter(cell => cell != null).map((cell) => (jsx(TableCellComponent, { cell: cell, mode: mode, onComponentSelect: onComponentSelect || (() => { }), onComponentDelete: handleComponentDelete, onComponentEdit: onComponentEdit, selectedComponent: selectedComponent || null, renderFormComponent: renderComponent, formData: formData, formTemplateId: formTemplateId, onThresholdActionCompletion: onThresholdActionCompletion, onThresholdIssueRaised: onThresholdIssueRaised, tableId: id, onNotesChange: onNotesChange, onAttachmentChange: onAttachmentChange, workOrderNumber: workOrderNumber, assetNumber: assetNumber, user: user, onCreateIssue: onCreateIssue, onUpdateIssue: onUpdateIssue }, cell.id))) }, rowIndex))) })] })] }))] }));
7838
7872
  };
7839
7873
 
7840
7874
  var dfFormTable = /*#__PURE__*/Object.freeze({