@omniumretail/component-library 1.3.3 → 1.3.4
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.
|
@@ -25022,12 +25022,15 @@ const ResponsiveTable = (props) => {
|
|
|
25022
25022
|
);
|
|
25023
25023
|
const isSelected = cellIndex !== -1;
|
|
25024
25024
|
const originalCellContent = record[key];
|
|
25025
|
+
const cellData = originalCellContent?.data ? originalCellContent : { display: originalCellContent, data: null };
|
|
25026
|
+
const displayContent = cellData.display;
|
|
25027
|
+
const hasExistingData = cellData.data?.hasExistingData || false;
|
|
25025
25028
|
if (isSelectable) {
|
|
25026
25029
|
if (renderSelectedCell && isSelected) {
|
|
25027
|
-
const
|
|
25030
|
+
const cellDataForCallback = {
|
|
25028
25031
|
rowKey: record[rowKeyValue],
|
|
25029
25032
|
columnKey: key,
|
|
25030
|
-
value,
|
|
25033
|
+
value: cellData,
|
|
25031
25034
|
rowData: record
|
|
25032
25035
|
};
|
|
25033
25036
|
return /* @__PURE__ */ jsx(
|
|
@@ -25035,21 +25038,28 @@ const ResponsiveTable = (props) => {
|
|
|
25035
25038
|
{
|
|
25036
25039
|
onClick: (e) => {
|
|
25037
25040
|
e.stopPropagation();
|
|
25038
|
-
handleCellClick(record, key,
|
|
25041
|
+
handleCellClick(record, key, cellData);
|
|
25039
25042
|
},
|
|
25040
25043
|
className: classNames(styles$7.selectableCell, styles$7.selected),
|
|
25041
|
-
children: renderSelectedCell(
|
|
25044
|
+
children: renderSelectedCell(cellDataForCallback, cellIndex, selectedCells.length)
|
|
25042
25045
|
}
|
|
25043
25046
|
);
|
|
25044
25047
|
}
|
|
25045
25048
|
if (!useOrderedCellSelection) {
|
|
25046
|
-
|
|
25049
|
+
let cellContent;
|
|
25050
|
+
if (isSelected) {
|
|
25051
|
+
cellContent = /* @__PURE__ */ jsx(Tag, { color: "grey", style: { margin: -4 }, children: "X" });
|
|
25052
|
+
} else if (hasExistingData) {
|
|
25053
|
+
cellContent = displayContent;
|
|
25054
|
+
} else {
|
|
25055
|
+
cellContent = displayContent || "";
|
|
25056
|
+
}
|
|
25047
25057
|
return /* @__PURE__ */ jsx(
|
|
25048
25058
|
"div",
|
|
25049
25059
|
{
|
|
25050
25060
|
onClick: (e) => {
|
|
25051
25061
|
e.stopPropagation();
|
|
25052
|
-
handleCellClick(record, key,
|
|
25062
|
+
handleCellClick(record, key, cellData);
|
|
25053
25063
|
},
|
|
25054
25064
|
className: classNames(
|
|
25055
25065
|
styles$7.selectableCell,
|
|
@@ -25103,14 +25113,14 @@ const ResponsiveTable = (props) => {
|
|
|
25103
25113
|
{
|
|
25104
25114
|
onClick: (e) => {
|
|
25105
25115
|
e.stopPropagation();
|
|
25106
|
-
handleCellClick(record, key,
|
|
25116
|
+
handleCellClick(record, key, cellData);
|
|
25107
25117
|
},
|
|
25108
25118
|
className: styles$7.selectableCell,
|
|
25109
|
-
children:
|
|
25119
|
+
children: displayContent || ""
|
|
25110
25120
|
}
|
|
25111
25121
|
);
|
|
25112
25122
|
}
|
|
25113
|
-
return value;
|
|
25123
|
+
return displayContent !== void 0 ? displayContent : value;
|
|
25114
25124
|
}
|
|
25115
25125
|
};
|
|
25116
25126
|
return column;
|