@omniumretail/component-library 1.3.7 → 1.3.9
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.
|
@@ -24894,12 +24894,9 @@ const ResponsiveTable = (props) => {
|
|
|
24894
24894
|
value,
|
|
24895
24895
|
rowData: record
|
|
24896
24896
|
};
|
|
24897
|
-
console.log("Célula clicada:", cellData);
|
|
24898
|
-
console.log("SelectedCells antes:", selectedCells);
|
|
24899
24897
|
const isAlreadySelected = selectedCells.some(
|
|
24900
24898
|
(cell) => cell.rowKey === cellData.rowKey && cell.columnKey === cellData.columnKey
|
|
24901
24899
|
);
|
|
24902
|
-
console.log("isAlreadySelected:", isAlreadySelected);
|
|
24903
24900
|
let newSelectedCells;
|
|
24904
24901
|
if (isAlreadySelected) {
|
|
24905
24902
|
newSelectedCells = selectedCells.filter(
|
|
@@ -24915,7 +24912,6 @@ const ResponsiveTable = (props) => {
|
|
|
24915
24912
|
newSelectedCells = [...selectedCells, cellData];
|
|
24916
24913
|
}
|
|
24917
24914
|
}
|
|
24918
|
-
console.log("SelectedCells depois:", newSelectedCells);
|
|
24919
24915
|
setSelectedCells(newSelectedCells);
|
|
24920
24916
|
onCellsSelected?.(newSelectedCells);
|
|
24921
24917
|
};
|
|
@@ -25015,17 +25011,17 @@ const ResponsiveTable = (props) => {
|
|
|
25015
25011
|
sorter: isColumnSortable,
|
|
25016
25012
|
render: (value, record) => {
|
|
25017
25013
|
const isSelectable = enableCellSelection && selectableColumns?.includes(key);
|
|
25014
|
+
const originalCellContent = record[key];
|
|
25018
25015
|
const cellIndex = selectedCells.findIndex(
|
|
25019
25016
|
(cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === key
|
|
25020
25017
|
);
|
|
25021
25018
|
const isSelected = cellIndex !== -1;
|
|
25022
|
-
const originalCellContent = record[key];
|
|
25023
25019
|
if (isSelectable) {
|
|
25024
25020
|
if (renderSelectedCell && isSelected) {
|
|
25025
25021
|
const cellData = {
|
|
25026
25022
|
rowKey: record[rowKeyValue],
|
|
25027
25023
|
columnKey: key,
|
|
25028
|
-
value,
|
|
25024
|
+
value: originalCellContent,
|
|
25029
25025
|
rowData: record
|
|
25030
25026
|
};
|
|
25031
25027
|
return /* @__PURE__ */ jsx(
|
|
@@ -25033,7 +25029,7 @@ const ResponsiveTable = (props) => {
|
|
|
25033
25029
|
{
|
|
25034
25030
|
onClick: (e) => {
|
|
25035
25031
|
e.stopPropagation();
|
|
25036
|
-
handleCellClick(record, key,
|
|
25032
|
+
handleCellClick(record, key, originalCellContent);
|
|
25037
25033
|
},
|
|
25038
25034
|
className: classNames(styles$7.selectableCell, styles$7.selected),
|
|
25039
25035
|
children: renderSelectedCell(cellData, cellIndex, selectedCells.length)
|
|
@@ -25041,7 +25037,15 @@ const ResponsiveTable = (props) => {
|
|
|
25041
25037
|
);
|
|
25042
25038
|
}
|
|
25043
25039
|
if (!useOrderedCellSelection) {
|
|
25044
|
-
const cellContent =
|
|
25040
|
+
const cellContent = (() => {
|
|
25041
|
+
if (isSelected) {
|
|
25042
|
+
return /* @__PURE__ */ jsx(Tag, { color: "grey", style: { margin: -4 }, children: "X" });
|
|
25043
|
+
}
|
|
25044
|
+
if (originalCellContent) {
|
|
25045
|
+
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent.color, style: { margin: -4 }, children: originalCellContent.type });
|
|
25046
|
+
}
|
|
25047
|
+
return null;
|
|
25048
|
+
})();
|
|
25045
25049
|
return /* @__PURE__ */ jsx(
|
|
25046
25050
|
"div",
|
|
25047
25051
|
{
|