frontend-plus-react 0.1.10 → 0.1.12

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
@@ -1258,8 +1258,10 @@ var allColumnsCellRenderer = (props) => {
1258
1258
  switch (column.customType) {
1259
1259
  case "default": {
1260
1260
  const defaultColumn = column;
1261
- const { fieldDef, tableDefinition, primaryKey, cellFeedback, fixedFields, localCellChanges } = defaultColumn;
1261
+ const { fieldDef, tableDefinition, primaryKey, cellFeedbackMap, fixedFields, localCellChanges } = defaultColumn;
1262
1262
  const rowId = getPrimaryKeyValues(row, primaryKey);
1263
+ const cellKey = `${rowId}-${props.column.key}`;
1264
+ const currentCellFeedback = cellFeedbackMap.get ? cellFeedbackMap.get(cellKey) : cellFeedbackMap[cellKey];
1263
1265
  if (fieldDef?.clientSide) {
1264
1266
  const ClientSideComponent = clientSides[fieldDef.clientSide];
1265
1267
  if (ClientSideComponent) {
@@ -1268,8 +1270,8 @@ var allColumnsCellRenderer = (props) => {
1268
1270
  return /* @__PURE__ */ jsx8(FallbackClientSideRenderer_default, { ...props, fieldDefinition: fieldDef, tableDefinition, primaryKey });
1269
1271
  }
1270
1272
  let cellBackgroundColor = "transparent";
1271
- if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key) {
1272
- cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
1273
+ if (currentCellFeedback) {
1274
+ cellBackgroundColor = currentCellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
1273
1275
  } else {
1274
1276
  const isNewRowLocalCheck = row[NEW_ROW_INDICATOR];
1275
1277
  const isMandatory = tableDefinition.primaryKey.includes(props.column.key) || tableDefinition.fields.find((f) => f.name === props.column.key)?.nullable === false;
@@ -1282,7 +1284,7 @@ var allColumnsCellRenderer = (props) => {
1282
1284
  }
1283
1285
  }
1284
1286
  const value = row[props.column.key];
1285
- return /* @__PURE__ */ jsx8(Tooltip3, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx8(Box5, { sx: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", backgroundColor: cellBackgroundColor, transition: "background-color 0.3s ease-in-out", display: "flex", alignItems: "center", paddingLeft: "8px", boxSizing: "border-box" }, children: /* @__PURE__ */ jsx8(Typography4, { variant: "body2", sx: { fontSize: "0.875rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", width: "100%" }, children: value === null || value === void 0 ? "" : String(value) }) }) });
1287
+ return /* @__PURE__ */ jsx8(Tooltip3, { title: currentCellFeedback?.message || "", children: /* @__PURE__ */ jsx8(Box5, { sx: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", backgroundColor: cellBackgroundColor, transition: "background-color 0.3s ease-in-out", display: "flex", alignItems: "center", paddingLeft: "8px", boxSizing: "border-box" }, children: /* @__PURE__ */ jsx8(Typography4, { variant: "body2", sx: { fontSize: "0.875rem", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", width: "100%" }, children: value === null || value === void 0 ? "" : String(value) }) }) });
1286
1288
  }
1287
1289
  case "detail": {
1288
1290
  const detailColumn = column;
@@ -1366,10 +1368,10 @@ import { useCallback as useCallback3, useMemo, useState as useState3 } from "rea
1366
1368
  import InputBase2 from "@mui/material/InputBase";
1367
1369
  import { useTheme as useTheme2 } from "@mui/material";
1368
1370
  import { jsx as jsx9 } from "react/jsx-runtime";
1369
- function findChangedValues(oldRowData, newRowData) {
1371
+ function findChangedValues(oldRowData, newRowData, isNewRow) {
1370
1372
  let changes = [];
1371
1373
  for (const key in newRowData) {
1372
- if (Object.prototype.hasOwnProperty.call(oldRowData, key) && oldRowData[key] !== newRowData[key]) {
1374
+ if (Object.prototype.hasOwnProperty.call(oldRowData, key) && oldRowData[key] !== newRowData[key] || isNewRow) {
1373
1375
  changes.push(key);
1374
1376
  }
1375
1377
  }
@@ -1382,8 +1384,10 @@ function InputRenderer({
1382
1384
  tableDefinition,
1383
1385
  onRowChange,
1384
1386
  onClose,
1385
- cellFeedback,
1386
- setCellFeedback,
1387
+ cellFeedbackMap,
1388
+ // Tipo: CellFeedbackMap
1389
+ setCellFeedbackMap,
1390
+ // Tipo: Dispatch<SetStateAction<CellFeedbackMap>>
1387
1391
  onKeyPress,
1388
1392
  setTableData,
1389
1393
  setLocalCellChanges,
@@ -1394,10 +1398,11 @@ function InputRenderer({
1394
1398
  const [editingValue, setEditingValue] = useState3(row[column.key]);
1395
1399
  const theme = useTheme2();
1396
1400
  const { showSuccess, showError } = useSnackbar();
1397
- const rowId = getPrimaryKeyValues(row, primaryKey);
1401
+ const cellKey = getCellKey(row, column.key, primaryKey);
1402
+ const currentCellFeedback = cellFeedbackMap.get(cellKey);
1398
1403
  let cellBackgroundColor;
1399
- if (cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === column.key) {
1400
- cellBackgroundColor = cellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
1404
+ if (currentCellFeedback) {
1405
+ cellBackgroundColor = currentCellFeedback.type === "error" ? theme.palette.error.light : theme.palette.success.light;
1401
1406
  }
1402
1407
  const initialRowId = useMemo(() => getPrimaryKeyValues(row, primaryKey), [row, primaryKey]);
1403
1408
  const { callApi } = useApiCall();
@@ -1496,7 +1501,6 @@ function InputRenderer({
1496
1501
  if (rowIndex !== -1) {
1497
1502
  newData[rowIndex] = persistedRowData;
1498
1503
  } else {
1499
- console.warn("Fila no encontrada para actualizar despu\xE9s de la inserci\xF3n. Podr\xEDa haber un problema de sincronizaci\xF3n.");
1500
1504
  const newPrimaryKeyId = getPrimaryKeyValues(persistedRowData, tableDefinition.primaryKey);
1501
1505
  const newRowIndex = newData.findIndex((r) => getPrimaryKeyValues(r, tableDefinition.primaryKey) === newPrimaryKeyId);
1502
1506
  if (newRowIndex !== -1) {
@@ -1512,12 +1516,28 @@ function InputRenderer({
1512
1516
  finalRowIdForFeedback = isPrimaryKeyColumn ? getPrimaryKeyValues(potentialUpdatedRow, tableDefinition.primaryKey) : currentRowIdBeforeUpdate;
1513
1517
  onRowChange({ ...response.row }, true);
1514
1518
  }
1515
- findChangedValues(oldRowData, response.row).forEach(
1516
- (key) => setCellFeedback({ rowId: finalRowIdForFeedback, columnKey: key, type: "success" })
1517
- );
1519
+ const changes = findChangedValues(oldRowData, response.row, isNewRow);
1520
+ setCellFeedbackMap((prevFeedback) => {
1521
+ const newFeedback = new Map(prevFeedback);
1522
+ changes.forEach((key) => {
1523
+ const keyForMap = `${finalRowIdForFeedback}-${key}`;
1524
+ newFeedback.set(keyForMap, { rowId: finalRowIdForFeedback, columnKey: key, type: "success" });
1525
+ });
1526
+ return newFeedback;
1527
+ });
1518
1528
  } catch (err) {
1519
1529
  console.error("Error al guardar el registro:", err);
1520
- setCellFeedback({ rowId: currentRowIdBeforeUpdate, columnKey: column.key, type: "error", message: err.message });
1530
+ const keyForMap = `${currentRowIdBeforeUpdate}-${column.key}`;
1531
+ setCellFeedbackMap((prevFeedback) => {
1532
+ const newFeedback = new Map(prevFeedback);
1533
+ newFeedback.set(keyForMap, {
1534
+ rowId: currentRowIdBeforeUpdate,
1535
+ columnKey: column.key,
1536
+ type: "error",
1537
+ message: err.message
1538
+ });
1539
+ return newFeedback;
1540
+ });
1521
1541
  }
1522
1542
  }, [
1523
1543
  column,
@@ -1528,18 +1548,18 @@ function InputRenderer({
1528
1548
  tableDefinition.fields,
1529
1549
  showSuccess,
1530
1550
  showError,
1531
- setCellFeedback,
1551
+ setCellFeedbackMap,
1532
1552
  onClose,
1533
1553
  setTableData,
1534
1554
  setLocalCellChanges,
1535
1555
  localCellChanges,
1536
1556
  initialRowId
1537
1557
  ]);
1538
- const handleKeyDown = useCallback3((event) => {
1539
- if (["Enter", "Tab", "ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft"].includes(event.key)) {
1540
- handleCommit(editingValue, true, true);
1558
+ const handleKeyDown = useCallback3(async (event) => {
1559
+ if (["Enter", "Tab", "ArrowDown", "ArrowUp", "ArrowRight", "ArrowLeft", "F4"].includes(event.key)) {
1560
+ await handleCommit(editingValue, true, true);
1541
1561
  if (onKeyPress) {
1542
- onKeyPress(rowIdx, column.key, event);
1562
+ onKeyPress(rowIdx, column.key, event, handleCommit);
1543
1563
  }
1544
1564
  }
1545
1565
  }, [handleCommit, editingValue, column.key, rowIdx, onKeyPress]);
@@ -1587,8 +1607,10 @@ var allColumnsEditCellRenderer = (props, allColumns) => {
1587
1607
  fixedFields,
1588
1608
  primaryKey,
1589
1609
  setTableData,
1590
- cellFeedback,
1591
- setCellFeedback,
1610
+ cellFeedbackMap,
1611
+ // <--- CAMBIADO
1612
+ setCellFeedbackMap,
1613
+ // <--- CAMBIADO
1592
1614
  handleKeyPressInEditor,
1593
1615
  localCellChanges,
1594
1616
  setLocalCellChanges
@@ -1601,20 +1623,25 @@ var allColumnsEditCellRenderer = (props, allColumns) => {
1601
1623
  return void 0;
1602
1624
  }
1603
1625
  const rowId = getPrimaryKeyValues(props.row, primaryKey);
1604
- return /* @__PURE__ */ jsx10(Tooltip4, { title: cellFeedback && cellFeedback.rowId === rowId && cellFeedback.columnKey === props.column.key ? cellFeedback?.message : "", children: /* @__PURE__ */ jsx10(Box6, { children: /* @__PURE__ */ jsx10(
1605
- InputRenderer_default,
1606
- {
1607
- ...props,
1608
- tableDefinition,
1609
- setCellFeedback,
1610
- cellFeedback,
1611
- onKeyPress: (rowIndex, columnKey, event) => handleKeyPressInEditor(rowIndex, columnKey, event, allColumns),
1612
- setTableData,
1613
- setLocalCellChanges,
1614
- localCellChanges,
1615
- primaryKey
1616
- }
1617
- ) }) });
1626
+ const cellKey = `${rowId}-${props.column.key}`;
1627
+ const currentCellFeedback = cellFeedbackMap.get ? cellFeedbackMap.get(cellKey) : cellFeedbackMap[cellKey];
1628
+ return (
1629
+ // --- TOOLTIP ADAPTADO: Lee el mensaje de error desde el Mapa ---
1630
+ /* @__PURE__ */ jsx10(Tooltip4, { title: currentCellFeedback?.message || "", children: /* @__PURE__ */ jsx10(Box6, { children: /* @__PURE__ */ jsx10(
1631
+ InputRenderer_default,
1632
+ {
1633
+ ...props,
1634
+ tableDefinition,
1635
+ setCellFeedbackMap,
1636
+ cellFeedbackMap,
1637
+ onKeyPress: (rowIndex, columnKey, event, handleCommit) => handleKeyPressInEditor(rowIndex, columnKey, event, allColumns, handleCommit),
1638
+ setTableData,
1639
+ setLocalCellChanges,
1640
+ localCellChanges,
1641
+ primaryKey
1642
+ }
1643
+ ) }) })
1644
+ );
1618
1645
  }
1619
1646
  return void 0;
1620
1647
  }
@@ -1652,16 +1679,20 @@ function EmptyRowsRenderer() {
1652
1679
 
1653
1680
  // src/components/grid/GenericDataGrid.tsx
1654
1681
  import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
1682
+ var NEW_ROW_INDICATOR = "$new";
1683
+ var DETAIL_ROW_INDICATOR = "$detail";
1655
1684
  var getPrimaryKeyValues = (row, primaryKey) => {
1685
+ let keys = [...primaryKey];
1656
1686
  if (row[DETAIL_ROW_INDICATOR]) {
1657
- primaryKey = primaryKey.concat(DETAIL_ROW_INDICATOR);
1687
+ keys = keys.concat(DETAIL_ROW_INDICATOR);
1658
1688
  }
1659
- return primaryKey.map((key) => {
1689
+ return keys.map((key) => {
1660
1690
  return row[key] !== void 0 && row[key] !== null ? String(row[key]) : "NULL_OR_UNDEFINED";
1661
1691
  }).join("|");
1662
1692
  };
1663
- var NEW_ROW_INDICATOR = "$new";
1664
- var DETAIL_ROW_INDICATOR = "$detail";
1693
+ var getCellKey = (row, columnKey, primaryKey) => {
1694
+ return `${getPrimaryKeyValues(row, primaryKey)}|${columnKey}`;
1695
+ };
1665
1696
  var GenericDataGrid = ({
1666
1697
  tableName,
1667
1698
  fixedFields,
@@ -1674,7 +1705,7 @@ var GenericDataGrid = ({
1674
1705
  const [filters, setFilters] = useState4({});
1675
1706
  const [selectedRows, setSelectedRows] = useState4(() => /* @__PURE__ */ new Set());
1676
1707
  const [selectedCell, setSelectedCell] = useState4(void 0);
1677
- const [cellFeedback, setCellFeedback] = useState4(null);
1708
+ const [cellFeedbackMap, setCellFeedbackMap] = useState4(/* @__PURE__ */ new Map());
1678
1709
  const [localCellChanges, setLocalCellChanges] = useState4(/* @__PURE__ */ new Map());
1679
1710
  const theme = useTheme3();
1680
1711
  const [openConfirmDialog, setOpenConfirmDialog] = useState4(false);
@@ -1692,7 +1723,7 @@ var GenericDataGrid = ({
1692
1723
  setSelectedRows(/* @__PURE__ */ new Set());
1693
1724
  setTableDefinition(null);
1694
1725
  setTableData([]);
1695
- setCellFeedback(null);
1726
+ setCellFeedbackMap(/* @__PURE__ */ new Map());
1696
1727
  setLocalCellChanges(/* @__PURE__ */ new Map());
1697
1728
  setOpenConfirmDialog(false);
1698
1729
  setRowToDelete(null);
@@ -1719,20 +1750,26 @@ var GenericDataGrid = ({
1719
1750
  }
1720
1751
  };
1721
1752
  fetchDataAndDefinition();
1722
- }, [
1723
- tableName,
1724
- /*fixedFields,*/
1725
- showError
1726
- ]);
1753
+ }, [tableName, fixedFields, showError]);
1727
1754
  useEffect(() => {
1728
- if (cellFeedback) {
1755
+ if (cellFeedbackMap.size > 0) {
1729
1756
  if (feedbackTimerRef.current) {
1730
1757
  clearTimeout(feedbackTimerRef.current);
1731
1758
  }
1732
1759
  const timerDuration = 3e3;
1733
1760
  feedbackTimerRef.current = setTimeout(() => {
1734
- if (cellFeedback.type == "success")
1735
- setCellFeedback(null);
1761
+ setCellFeedbackMap((prevMap) => {
1762
+ const newMap = new Map(prevMap);
1763
+ let mapChanged = false;
1764
+ for (const [cellId, feedback] of prevMap.entries()) {
1765
+ if (feedback.type === "success") {
1766
+ newMap.delete(cellId);
1767
+ mapChanged = true;
1768
+ }
1769
+ }
1770
+ return mapChanged ? newMap : prevMap;
1771
+ });
1772
+ feedbackTimerRef.current = null;
1736
1773
  }, timerDuration);
1737
1774
  }
1738
1775
  return () => {
@@ -1740,7 +1777,7 @@ var GenericDataGrid = ({
1740
1777
  clearTimeout(feedbackTimerRef.current);
1741
1778
  }
1742
1779
  };
1743
- }, [cellFeedback]);
1780
+ }, [cellFeedbackMap]);
1744
1781
  const primaryKey = useMemo2(() => {
1745
1782
  if (!tableDefinition) return ["id"];
1746
1783
  return tableDefinition.primaryKey && tableDefinition.primaryKey.length > 0 ? tableDefinition.primaryKey : ["id"];
@@ -1881,19 +1918,20 @@ var GenericDataGrid = ({
1881
1918
  }
1882
1919
  return rows;
1883
1920
  }, [tableData, filters, isFilterRowVisible]);
1884
- const handleKeyPressInEditor = useCallback4((rowIndex, columnKey, event, currentColumns) => {
1921
+ const handleKeyPressInEditor = useCallback4((rowIndex, columnKey, event, currentColumns, handleCommit) => {
1885
1922
  if (dataGridRef.current && tableDefinition) {
1886
1923
  const currentColumnIndex = currentColumns.findIndex((col) => col.key === columnKey);
1887
1924
  const editableColumns = currentColumns.filter((col) => {
1888
1925
  const fieldDefinition = tableDefinition.fields.find((f) => f.name === col.key);
1889
1926
  return col.key !== "actionsColumn" && col.customType != "detail" && (fieldDefinition?.editable !== false && !fieldDefinition?.clientSide);
1890
1927
  });
1891
- const { key, currentTarget } = event;
1892
- const input = currentTarget;
1928
+ const { key, target } = event;
1929
+ const input = target;
1893
1930
  if (currentColumnIndex !== -1 && editableColumns.length > 0) {
1894
1931
  const editableColumnKeys = editableColumns.map((col) => col.key);
1895
1932
  let currentEditableColumnIndex = editableColumnKeys.indexOf(columnKey);
1896
- const calcularColumnaSiguienteYHacerFoco = () => {
1933
+ const hacerFoco = ({ rowIdx, idx }) => setTimeout(() => dataGridRef.current?.selectCell({ rowIdx, idx }, { enableEditor: true, shouldFocusCell: true }), 10);
1934
+ const calcularColumnaSiguiente = () => {
1897
1935
  let nextEditableColumnIndex = currentEditableColumnIndex + 1;
1898
1936
  let nextRowIndex = rowIndex;
1899
1937
  if (nextEditableColumnIndex >= editableColumns.length) {
@@ -1908,9 +1946,9 @@ var GenericDataGrid = ({
1908
1946
  }
1909
1947
  const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
1910
1948
  const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
1911
- dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1949
+ return { rowIdx: nextRowIndex, idx: nextColumnIndex };
1912
1950
  };
1913
- const calcularColumnaAnteriorYHacerFoco = () => {
1951
+ const calcularColumnaAnterior = () => {
1914
1952
  let nextEditableColumnIndex = currentEditableColumnIndex - 1;
1915
1953
  let nextRowIndex = rowIndex;
1916
1954
  if (nextEditableColumnIndex <= 0) {
@@ -1918,57 +1956,65 @@ var GenericDataGrid = ({
1918
1956
  }
1919
1957
  const nextColumnKey = editableColumnKeys[nextEditableColumnIndex];
1920
1958
  const nextColumnIndex = currentColumns.findIndex((col) => col.key === nextColumnKey);
1921
- dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: nextColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1959
+ return { rowIdx: nextRowIndex, idx: nextColumnIndex };
1922
1960
  };
1923
- const calcularFilaSiguienteYHacerFoco = () => {
1961
+ const calcularFilaSiguiente = () => {
1924
1962
  let nextRowIndex = rowIndex;
1925
1963
  nextRowIndex++;
1926
1964
  while (filteredRows[nextRowIndex] && filteredRows[nextRowIndex][DETAIL_ROW_INDICATOR]) {
1927
1965
  nextRowIndex++;
1928
1966
  }
1929
1967
  if (nextRowIndex >= filteredRows.length) {
1930
- return;
1968
+ return { rowIdx: rowIndex, idx: currentColumnIndex };
1931
1969
  }
1932
- dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: currentColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1970
+ return { rowIdx: nextRowIndex, idx: currentColumnIndex };
1933
1971
  };
1934
- const calcularFilaAnteriorYHacerFoco = () => {
1972
+ const calcularFilaAnterior = () => {
1935
1973
  let nextRowIndex = rowIndex;
1936
1974
  nextRowIndex--;
1937
1975
  while (filteredRows[nextRowIndex] && filteredRows[nextRowIndex][DETAIL_ROW_INDICATOR]) {
1938
1976
  nextRowIndex--;
1939
1977
  }
1940
1978
  if (nextRowIndex < 0) {
1941
- return;
1979
+ return { rowIdx: rowIndex, idx: currentColumnIndex };
1942
1980
  }
1943
- dataGridRef.current?.selectCell({ rowIdx: nextRowIndex, idx: currentColumnIndex }, { enableEditor: true, shouldFocusCell: true });
1981
+ return { rowIdx: nextRowIndex, idx: currentColumnIndex };
1944
1982
  };
1945
1983
  if (currentEditableColumnIndex !== -1) {
1946
1984
  switch (true) {
1947
1985
  case ["Enter", "Tab"].includes(key): {
1948
- calcularColumnaSiguienteYHacerFoco();
1986
+ hacerFoco(calcularColumnaSiguiente());
1949
1987
  break;
1950
1988
  }
1951
1989
  case key == "ArrowRight": {
1952
1990
  const cursorPosition = input.selectionStart;
1953
1991
  const inputValueLength = input.value.length;
1954
1992
  if (cursorPosition === inputValueLength) {
1955
- calcularColumnaSiguienteYHacerFoco();
1993
+ hacerFoco(calcularColumnaSiguiente());
1956
1994
  }
1957
1995
  break;
1958
1996
  }
1959
1997
  case key == "ArrowLeft": {
1960
1998
  const cursorPosition = input.selectionStart;
1961
1999
  if (cursorPosition === 0) {
1962
- calcularColumnaAnteriorYHacerFoco();
2000
+ hacerFoco(calcularColumnaAnterior());
1963
2001
  }
1964
2002
  break;
1965
2003
  }
1966
2004
  case key == "ArrowUp": {
1967
- calcularFilaAnteriorYHacerFoco();
2005
+ hacerFoco(calcularFilaAnterior());
1968
2006
  break;
1969
2007
  }
1970
2008
  case key == "ArrowDown": {
1971
- calcularFilaSiguienteYHacerFoco();
2009
+ hacerFoco(calcularFilaSiguiente());
2010
+ break;
2011
+ }
2012
+ case key == "F4": {
2013
+ const { rowIdx, idx } = calcularFilaSiguiente();
2014
+ const previousRow = tableData[rowIndex - 1];
2015
+ if (previousRow && !previousRow[DETAIL_ROW_INDICATOR]) {
2016
+ handleCommit(previousRow[columnKey], true, true).then(() => hacerFoco({ rowIdx, idx }));
2017
+ }
1972
2018
  break;
1973
2019
  }
1974
2020
  default:
@@ -1977,7 +2023,7 @@ var GenericDataGrid = ({
1977
2023
  }
1978
2024
  }
1979
2025
  }
1980
- }, [filteredRows, tableDefinition]);
2026
+ }, [filteredRows, tableDefinition, tableData]);
1981
2027
  const handleSelectedCellChange = useCallback4((args) => {
1982
2028
  setSelectedCell(args);
1983
2029
  }, []);
@@ -1995,13 +2041,14 @@ var GenericDataGrid = ({
1995
2041
  customType: "default",
1996
2042
  tableDefinition,
1997
2043
  fieldDef,
1998
- cellFeedback,
2044
+ // 💥 MULTI-CELL: Se inyecta el mapa y su setter
2045
+ cellFeedbackMap,
2046
+ setCellFeedbackMap,
1999
2047
  primaryKey,
2000
2048
  fixedFields,
2001
2049
  localCellChanges,
2002
2050
  setLocalCellChanges,
2003
2051
  setTableData,
2004
- setCellFeedback,
2005
2052
  name: fieldDef.label || cambiarGuionesBajosPorEspacios(fieldDef.name),
2006
2053
  resizable: true,
2007
2054
  sortable: true,
@@ -2083,7 +2130,8 @@ var GenericDataGrid = ({
2083
2130
  isFilterRowVisible,
2084
2131
  filters,
2085
2132
  toggleFilterVisibility,
2086
- cellFeedback,
2133
+ // 💥 MULTI-CELL: Se usa el mapa en lugar de la variable simple
2134
+ cellFeedbackMap,
2087
2135
  primaryKey,
2088
2136
  theme.palette.success.light,
2089
2137
  theme.palette.error.light,