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