@omniumretail/component-library 1.3.50 → 1.3.52
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) {
|
|
@@ -25264,25 +25266,26 @@ const ResponsiveTable = (props) => {
|
|
|
25264
25266
|
return null;
|
|
25265
25267
|
}
|
|
25266
25268
|
if (templateEditMode) {
|
|
25267
|
-
const
|
|
25269
|
+
const isRuleType = (type) => type !== "S" && type !== "D" && type !== "F";
|
|
25270
|
+
if (originalCellContent?.type === "F" || originalCellContent?.type === "S" || originalCellContent?.type === "D") {
|
|
25271
|
+
return /* @__PURE__ */ jsx(
|
|
25272
|
+
Tag,
|
|
25273
|
+
{
|
|
25274
|
+
color: originalCellContent.color,
|
|
25275
|
+
style: { margin: -4, cursor: "pointer" },
|
|
25276
|
+
children: originalCellContent.type
|
|
25277
|
+
}
|
|
25278
|
+
);
|
|
25279
|
+
}
|
|
25280
|
+
const wasRemoved = isSelected && selectedCells[cellIndex]?.value?.type === null && originalCellContent?.type && isRuleType(originalCellContent.type);
|
|
25268
25281
|
if (wasRemoved) {
|
|
25269
|
-
if (originalCellContent?.type === "S" || originalCellContent?.type === "D" || originalCellContent?.type === "F") {
|
|
25270
|
-
return /* @__PURE__ */ jsx(
|
|
25271
|
-
Tag,
|
|
25272
|
-
{
|
|
25273
|
-
color: originalCellContent.color,
|
|
25274
|
-
style: { margin: -4, cursor: "pointer" },
|
|
25275
|
-
children: originalCellContent.type
|
|
25276
|
-
}
|
|
25277
|
-
);
|
|
25278
|
-
}
|
|
25279
25282
|
return null;
|
|
25280
25283
|
}
|
|
25281
|
-
if (isSelected &&
|
|
25284
|
+
if (isSelected && selectedCells[cellIndex]?.value?.type && isRuleType(selectedCells[cellIndex].value.type)) {
|
|
25282
25285
|
const selectedCell = selectedCells[cellIndex];
|
|
25283
25286
|
return /* @__PURE__ */ jsx(Tag, { color: selectedCell.value.color, style: { margin: -4, cursor: "pointer" }, children: selectedCell.value.type });
|
|
25284
25287
|
}
|
|
25285
|
-
if (originalCellContent?.type) {
|
|
25288
|
+
if (originalCellContent?.type && isRuleType(originalCellContent.type)) {
|
|
25286
25289
|
return /* @__PURE__ */ jsx(
|
|
25287
25290
|
Tag,
|
|
25288
25291
|
{
|