@omniumretail/component-library 1.3.35 → 1.3.36

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.
@@ -24894,43 +24894,15 @@ const ResponsiveTable = (props) => {
24894
24894
  if (disableCellSelection) return;
24895
24895
  const rowKey = record[rowKeyValue];
24896
24896
  const originalCellContent = record[columnKey];
24897
- if (templateEditMode && originalCellContent?.type && (originalCellContent.type === "S" || originalCellContent.type === "D")) {
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")) {
24898
24902
  return;
24899
24903
  }
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 {
24931
- const cellIndex = selectedCells.findIndex(
24932
- (cell) => cell.rowKey === rowKey && cell.columnKey === columnKey
24933
- );
24904
+ if (useOrderedCellSelection) ;
24905
+ else {
24934
24906
  let newSelectedCells;
24935
24907
  if (cellIndex >= 0) {
24936
24908
  newSelectedCells = selectedCells.filter((_, index) => index !== cellIndex);
@@ -25082,11 +25054,11 @@ const ResponsiveTable = (props) => {
25082
25054
  const originalCellContent2 = record[key];
25083
25055
  const isDisabled = originalCellContent2?.disabled === true;
25084
25056
  const isReadonly = originalCellContent2?.readonly === true;
25085
- const isFixedTemplate = templateEditMode && originalCellContent2?.type && (originalCellContent2.type === "S" || originalCellContent2.type === "D");
25086
25057
  const cellIndex2 = selectedCells.findIndex(
25087
25058
  (cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === key
25088
25059
  );
25089
25060
  const isSelected2 = cellIndex2 !== -1;
25061
+ const isFixedTemplate = templateEditMode && originalCellContent2?.type && (originalCellContent2.type === "S" || originalCellContent2.type === "D") && !isSelected2;
25090
25062
  const getBackgroundColor = () => {
25091
25063
  if (templateEditMode && isSelected2) {
25092
25064
  const selectedCell = selectedCells[cellIndex2];
@@ -25096,8 +25068,10 @@ const ResponsiveTable = (props) => {
25096
25068
  }
25097
25069
  return void 0;
25098
25070
  }
25099
- if (templateEditMode && !isSelected2) {
25100
- return void 0;
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;
25101
25075
  }
25102
25076
  if (!templateEditMode && originalCellContent2?.type) {
25103
25077
  if (originalCellContent2.type === "F") return originalCellContent2.color;