@omniumretail/component-library 1.3.36 → 1.3.37
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.
|
@@ -24893,16 +24893,12 @@ const ResponsiveTable = (props) => {
|
|
|
24893
24893
|
if (!enableCellSelection || !selectableColumns?.includes(columnKey)) return;
|
|
24894
24894
|
if (disableCellSelection) return;
|
|
24895
24895
|
const rowKey = record[rowKeyValue];
|
|
24896
|
-
|
|
24897
|
-
const cellIndex = selectedCells.findIndex(
|
|
24898
|
-
(cell) => cell.rowKey === rowKey && cell.columnKey === columnKey
|
|
24899
|
-
);
|
|
24900
|
-
const hasSelectionOnTop = cellIndex >= 0;
|
|
24901
|
-
if (templateEditMode && !hasSelectionOnTop && originalCellContent?.type && (originalCellContent.type === "S" || originalCellContent.type === "D")) {
|
|
24902
|
-
return;
|
|
24903
|
-
}
|
|
24896
|
+
record[columnKey];
|
|
24904
24897
|
if (useOrderedCellSelection) ;
|
|
24905
24898
|
else {
|
|
24899
|
+
const cellIndex = selectedCells.findIndex(
|
|
24900
|
+
(cell) => cell.rowKey === rowKey && cell.columnKey === columnKey
|
|
24901
|
+
);
|
|
24906
24902
|
let newSelectedCells;
|
|
24907
24903
|
if (cellIndex >= 0) {
|
|
24908
24904
|
newSelectedCells = selectedCells.filter((_, index) => index !== cellIndex);
|
|
@@ -25058,25 +25054,17 @@ const ResponsiveTable = (props) => {
|
|
|
25058
25054
|
(cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === key
|
|
25059
25055
|
);
|
|
25060
25056
|
const isSelected2 = cellIndex2 !== -1;
|
|
25061
|
-
const
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
const selectedCell = selectedCells[cellIndex2];
|
|
25065
|
-
const cellType = selectedCell?.value?.type;
|
|
25066
|
-
if (cellType === "F" || cellType === "S" || cellType === "D") {
|
|
25067
|
-
return selectedCell?.value?.color;
|
|
25068
|
-
}
|
|
25069
|
-
return void 0;
|
|
25070
|
-
}
|
|
25071
|
-
if (templateEditMode && !isSelected2 && originalCellContent2?.type) {
|
|
25072
|
-
if (originalCellContent2.type === "F") return originalCellContent2.color;
|
|
25073
|
-
if (originalCellContent2.type === "S") return originalCellContent2.color;
|
|
25074
|
-
if (originalCellContent2.type === "D") return originalCellContent2.color;
|
|
25057
|
+
const getDisplayContent = () => {
|
|
25058
|
+
if (isSelected2) {
|
|
25059
|
+
return selectedCells[cellIndex2];
|
|
25075
25060
|
}
|
|
25076
|
-
|
|
25077
|
-
|
|
25078
|
-
|
|
25079
|
-
|
|
25061
|
+
return originalCellContent2;
|
|
25062
|
+
};
|
|
25063
|
+
const displayContent = getDisplayContent();
|
|
25064
|
+
const getBackgroundColor = () => {
|
|
25065
|
+
if (!displayContent?.type) return void 0;
|
|
25066
|
+
if (displayContent.type === "F" || displayContent.type === "S" || displayContent.type === "D") {
|
|
25067
|
+
return displayContent.color;
|
|
25080
25068
|
}
|
|
25081
25069
|
return void 0;
|
|
25082
25070
|
};
|
|
@@ -25101,21 +25089,14 @@ const ResponsiveTable = (props) => {
|
|
|
25101
25089
|
);
|
|
25102
25090
|
}
|
|
25103
25091
|
}
|
|
25104
|
-
if (isFixedTemplate) {
|
|
25105
|
-
return /* @__PURE__ */ jsx(
|
|
25106
|
-
"div",
|
|
25107
|
-
{
|
|
25108
|
-
style: {
|
|
25109
|
-
backgroundColor: cellBackgroundColor,
|
|
25110
|
-
padding: "4px",
|
|
25111
|
-
textAlign: "center"
|
|
25112
|
-
},
|
|
25113
|
-
children: /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4, cursor: "not-allowed" }, children: originalCellContent2.type })
|
|
25114
|
-
}
|
|
25115
|
-
);
|
|
25116
|
-
}
|
|
25117
25092
|
if (isSelectable2) {
|
|
25118
25093
|
const cellContent = (() => {
|
|
25094
|
+
if (templateEditMode) {
|
|
25095
|
+
if (displayContent?.type) {
|
|
25096
|
+
return /* @__PURE__ */ jsx(Tag, { color: displayContent.color, style: { margin: -4, cursor: "pointer" }, children: displayContent.type });
|
|
25097
|
+
}
|
|
25098
|
+
return null;
|
|
25099
|
+
}
|
|
25119
25100
|
if (isSelected2) {
|
|
25120
25101
|
const selectedCell = selectedCells[cellIndex2];
|
|
25121
25102
|
const cellColor = selectedCell?.value?.color || selectedCellColor;
|
|
@@ -25126,14 +25107,11 @@ const ResponsiveTable = (props) => {
|
|
|
25126
25107
|
Tag,
|
|
25127
25108
|
{
|
|
25128
25109
|
color: cellColor,
|
|
25129
|
-
style: { margin: -4, cursor:
|
|
25110
|
+
style: { margin: -4, cursor: isLicenseType || isReadonlyCell ? "not-allowed" : "pointer" },
|
|
25130
25111
|
children: cellType
|
|
25131
25112
|
}
|
|
25132
25113
|
);
|
|
25133
25114
|
}
|
|
25134
|
-
if (templateEditMode) {
|
|
25135
|
-
return null;
|
|
25136
|
-
}
|
|
25137
25115
|
if (originalCellContent2) {
|
|
25138
25116
|
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4 }, children: originalCellContent2.type });
|
|
25139
25117
|
}
|
|
@@ -25158,6 +25136,7 @@ const ResponsiveTable = (props) => {
|
|
|
25158
25136
|
style: {
|
|
25159
25137
|
cursor: disableCellSelection ? "not-allowed" : void 0,
|
|
25160
25138
|
backgroundColor: cellBackgroundColor,
|
|
25139
|
+
// ⚡ Background do que está visível
|
|
25161
25140
|
padding: cellBackgroundColor ? "4px" : void 0
|
|
25162
25141
|
},
|
|
25163
25142
|
children: cellContent
|