@omniumretail/component-library 1.3.49 → 1.3.51
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.
|
@@ -24863,7 +24863,8 @@ const ResponsiveTable = (props) => {
|
|
|
24863
24863
|
templateEditMode,
|
|
24864
24864
|
currentTemplateType,
|
|
24865
24865
|
currentTemplateColor,
|
|
24866
|
-
calendarMode
|
|
24866
|
+
calendarMode,
|
|
24867
|
+
rulesTypesList = []
|
|
24867
24868
|
} = props;
|
|
24868
24869
|
const [customFilters, setCustomFilters] = useState([]);
|
|
24869
24870
|
const [customColumns, setCustomColumns] = useState([]);
|
|
@@ -24970,23 +24971,24 @@ const ResponsiveTable = (props) => {
|
|
|
24970
24971
|
console.log("➡️ Added F background (calendar)");
|
|
24971
24972
|
}
|
|
24972
24973
|
} else if (templateEditMode) {
|
|
24974
|
+
const isRuleType = (type) => type !== "S" && type !== "D" && type !== "F";
|
|
24973
24975
|
if (isSelected) {
|
|
24974
24976
|
const selectedCell = selectedCells[cellIndex];
|
|
24975
|
-
if (selectedCell?.value?.type
|
|
24976
|
-
if (originalCellContent?.type
|
|
24977
|
+
if (selectedCell?.value?.type && isRuleType(selectedCell.value.type)) {
|
|
24978
|
+
if (originalCellContent?.type && isRuleType(originalCellContent.type)) {
|
|
24977
24979
|
newSelectedCells = selectedCells.map(
|
|
24978
24980
|
(cell, idx) => idx === cellIndex ? { ...cell, value: { type: null, color: null } } : cell
|
|
24979
24981
|
);
|
|
24980
|
-
console.log("➡️ Marked
|
|
24982
|
+
console.log("➡️ Marked rule as removed (backend rule)");
|
|
24981
24983
|
} else {
|
|
24982
24984
|
newSelectedCells = selectedCells.filter((_, index) => index !== cellIndex);
|
|
24983
|
-
console.log("➡️ Removed
|
|
24985
|
+
console.log("➡️ Removed rule (rules)");
|
|
24984
24986
|
}
|
|
24985
24987
|
} else if (selectedCell?.value?.type === null) {
|
|
24986
24988
|
newSelectedCells = selectedCells.map(
|
|
24987
24989
|
(cell, idx) => idx === cellIndex ? { ...cell, value: { type: currentTemplateType, color: currentTemplateColor } } : cell
|
|
24988
24990
|
);
|
|
24989
|
-
console.log("➡️ Re-added
|
|
24991
|
+
console.log("➡️ Re-added rule after removal");
|
|
24990
24992
|
}
|
|
24991
24993
|
} else {
|
|
24992
24994
|
const newCell = {
|
|
@@ -24996,7 +24998,7 @@ const ResponsiveTable = (props) => {
|
|
|
24996
24998
|
rowData: record
|
|
24997
24999
|
};
|
|
24998
25000
|
newSelectedCells = [...selectedCells, newCell];
|
|
24999
|
-
console.log("➡️ Added
|
|
25001
|
+
console.log("➡️ Added rule (rules)");
|
|
25000
25002
|
}
|
|
25001
25003
|
} else {
|
|
25002
25004
|
if (isSelected) {
|
|
@@ -25242,9 +25244,6 @@ const ResponsiveTable = (props) => {
|
|
|
25242
25244
|
return null;
|
|
25243
25245
|
}
|
|
25244
25246
|
if (isSelected && selectedCells[cellIndex]?.value?.type === "F") {
|
|
25245
|
-
if (originalCellContent?.type === "S" || originalCellContent?.type === "D") {
|
|
25246
|
-
return null;
|
|
25247
|
-
}
|
|
25248
25247
|
return /* @__PURE__ */ jsx(
|
|
25249
25248
|
Tag,
|
|
25250
25249
|
{
|
|
@@ -25267,25 +25266,16 @@ const ResponsiveTable = (props) => {
|
|
|
25267
25266
|
return null;
|
|
25268
25267
|
}
|
|
25269
25268
|
if (templateEditMode) {
|
|
25270
|
-
const
|
|
25269
|
+
const isRuleType = (type) => type !== "S" && type !== "D" && type !== "F";
|
|
25270
|
+
const wasRemoved = isSelected && selectedCells[cellIndex]?.value?.type === null && originalCellContent?.type && isRuleType(originalCellContent.type);
|
|
25271
25271
|
if (wasRemoved) {
|
|
25272
|
-
if (originalCellContent?.type === "S" || originalCellContent?.type === "D" || originalCellContent?.type === "F") {
|
|
25273
|
-
return /* @__PURE__ */ jsx(
|
|
25274
|
-
Tag,
|
|
25275
|
-
{
|
|
25276
|
-
color: originalCellContent.color,
|
|
25277
|
-
style: { margin: -4, cursor: "pointer" },
|
|
25278
|
-
children: originalCellContent.type
|
|
25279
|
-
}
|
|
25280
|
-
);
|
|
25281
|
-
}
|
|
25282
25272
|
return null;
|
|
25283
25273
|
}
|
|
25284
|
-
if (isSelected &&
|
|
25274
|
+
if (isSelected && selectedCells[cellIndex]?.value?.type && isRuleType(selectedCells[cellIndex].value.type)) {
|
|
25285
25275
|
const selectedCell = selectedCells[cellIndex];
|
|
25286
25276
|
return /* @__PURE__ */ jsx(Tag, { color: selectedCell.value.color, style: { margin: -4, cursor: "pointer" }, children: selectedCell.value.type });
|
|
25287
25277
|
}
|
|
25288
|
-
if (originalCellContent?.type) {
|
|
25278
|
+
if (originalCellContent?.type && isRuleType(originalCellContent.type)) {
|
|
25289
25279
|
return /* @__PURE__ */ jsx(
|
|
25290
25280
|
Tag,
|
|
25291
25281
|
{
|