@omniumretail/component-library 1.3.35 → 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,41 +24893,9 @@ const ResponsiveTable = (props) => {
|
|
|
24893
24893
|
if (!enableCellSelection || !selectableColumns?.includes(columnKey)) return;
|
|
24894
24894
|
if (disableCellSelection) return;
|
|
24895
24895
|
const rowKey = record[rowKeyValue];
|
|
24896
|
-
|
|
24897
|
-
if (
|
|
24898
|
-
|
|
24899
|
-
}
|
|
24900
|
-
if (useOrderedCellSelection) {
|
|
24901
|
-
const isAlreadySelected = selectedCells.some(
|
|
24902
|
-
(cell) => cell.rowKey === rowKey && cell.columnKey === columnKey
|
|
24903
|
-
);
|
|
24904
|
-
let newSelectedCells;
|
|
24905
|
-
if (isAlreadySelected) {
|
|
24906
|
-
newSelectedCells = selectedCells.filter(
|
|
24907
|
-
(cell) => !(cell.rowKey === rowKey && cell.columnKey === columnKey)
|
|
24908
|
-
);
|
|
24909
|
-
} else {
|
|
24910
|
-
const cellData = {
|
|
24911
|
-
rowKey,
|
|
24912
|
-
columnKey,
|
|
24913
|
-
value: {
|
|
24914
|
-
type: "X",
|
|
24915
|
-
color: selectedCellColor || "grey"
|
|
24916
|
-
},
|
|
24917
|
-
rowData: record
|
|
24918
|
-
};
|
|
24919
|
-
const maxSelection = maxCellSelection || 2;
|
|
24920
|
-
if (cellSelectionMode === "single") {
|
|
24921
|
-
newSelectedCells = [cellData];
|
|
24922
|
-
} else if (selectedCells.length >= maxSelection) {
|
|
24923
|
-
newSelectedCells = [...selectedCells.slice(1), cellData];
|
|
24924
|
-
} else {
|
|
24925
|
-
newSelectedCells = [...selectedCells, cellData];
|
|
24926
|
-
}
|
|
24927
|
-
}
|
|
24928
|
-
setSelectedCells(newSelectedCells);
|
|
24929
|
-
onCellsSelected?.(newSelectedCells);
|
|
24930
|
-
} else {
|
|
24896
|
+
record[columnKey];
|
|
24897
|
+
if (useOrderedCellSelection) ;
|
|
24898
|
+
else {
|
|
24931
24899
|
const cellIndex = selectedCells.findIndex(
|
|
24932
24900
|
(cell) => cell.rowKey === rowKey && cell.columnKey === columnKey
|
|
24933
24901
|
);
|
|
@@ -25082,27 +25050,21 @@ const ResponsiveTable = (props) => {
|
|
|
25082
25050
|
const originalCellContent2 = record[key];
|
|
25083
25051
|
const isDisabled = originalCellContent2?.disabled === true;
|
|
25084
25052
|
const isReadonly = originalCellContent2?.readonly === true;
|
|
25085
|
-
const isFixedTemplate = templateEditMode && originalCellContent2?.type && (originalCellContent2.type === "S" || originalCellContent2.type === "D");
|
|
25086
25053
|
const cellIndex2 = selectedCells.findIndex(
|
|
25087
25054
|
(cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === key
|
|
25088
25055
|
);
|
|
25089
25056
|
const isSelected2 = cellIndex2 !== -1;
|
|
25090
|
-
const
|
|
25091
|
-
if (
|
|
25092
|
-
|
|
25093
|
-
const cellType = selectedCell?.value?.type;
|
|
25094
|
-
if (cellType === "F" || cellType === "S" || cellType === "D") {
|
|
25095
|
-
return selectedCell?.value?.color;
|
|
25096
|
-
}
|
|
25097
|
-
return void 0;
|
|
25098
|
-
}
|
|
25099
|
-
if (templateEditMode && !isSelected2) {
|
|
25100
|
-
return void 0;
|
|
25057
|
+
const getDisplayContent = () => {
|
|
25058
|
+
if (isSelected2) {
|
|
25059
|
+
return selectedCells[cellIndex2];
|
|
25101
25060
|
}
|
|
25102
|
-
|
|
25103
|
-
|
|
25104
|
-
|
|
25105
|
-
|
|
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;
|
|
25106
25068
|
}
|
|
25107
25069
|
return void 0;
|
|
25108
25070
|
};
|
|
@@ -25127,21 +25089,14 @@ const ResponsiveTable = (props) => {
|
|
|
25127
25089
|
);
|
|
25128
25090
|
}
|
|
25129
25091
|
}
|
|
25130
|
-
if (isFixedTemplate) {
|
|
25131
|
-
return /* @__PURE__ */ jsx(
|
|
25132
|
-
"div",
|
|
25133
|
-
{
|
|
25134
|
-
style: {
|
|
25135
|
-
backgroundColor: cellBackgroundColor,
|
|
25136
|
-
padding: "4px",
|
|
25137
|
-
textAlign: "center"
|
|
25138
|
-
},
|
|
25139
|
-
children: /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4, cursor: "not-allowed" }, children: originalCellContent2.type })
|
|
25140
|
-
}
|
|
25141
|
-
);
|
|
25142
|
-
}
|
|
25143
25092
|
if (isSelectable2) {
|
|
25144
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
|
+
}
|
|
25145
25100
|
if (isSelected2) {
|
|
25146
25101
|
const selectedCell = selectedCells[cellIndex2];
|
|
25147
25102
|
const cellColor = selectedCell?.value?.color || selectedCellColor;
|
|
@@ -25152,14 +25107,11 @@ const ResponsiveTable = (props) => {
|
|
|
25152
25107
|
Tag,
|
|
25153
25108
|
{
|
|
25154
25109
|
color: cellColor,
|
|
25155
|
-
style: { margin: -4, cursor:
|
|
25110
|
+
style: { margin: -4, cursor: isLicenseType || isReadonlyCell ? "not-allowed" : "pointer" },
|
|
25156
25111
|
children: cellType
|
|
25157
25112
|
}
|
|
25158
25113
|
);
|
|
25159
25114
|
}
|
|
25160
|
-
if (templateEditMode) {
|
|
25161
|
-
return null;
|
|
25162
|
-
}
|
|
25163
25115
|
if (originalCellContent2) {
|
|
25164
25116
|
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4 }, children: originalCellContent2.type });
|
|
25165
25117
|
}
|
|
@@ -25184,6 +25136,7 @@ const ResponsiveTable = (props) => {
|
|
|
25184
25136
|
style: {
|
|
25185
25137
|
cursor: disableCellSelection ? "not-allowed" : void 0,
|
|
25186
25138
|
backgroundColor: cellBackgroundColor,
|
|
25139
|
+
// ⚡ Background do que está visível
|
|
25187
25140
|
padding: cellBackgroundColor ? "4px" : void 0
|
|
25188
25141
|
},
|
|
25189
25142
|
children: cellContent
|