@omniumretail/component-library 1.3.18 → 1.3.20

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.
@@ -24889,21 +24889,24 @@ const ResponsiveTable = (props) => {
24889
24889
  };
24890
24890
  const handleCellClick = (record, columnKey, value) => {
24891
24891
  if (!enableCellSelection || !selectableColumns?.includes(columnKey)) return;
24892
- const cellData = {
24893
- rowKey: record[rowKeyValue],
24894
- columnKey,
24895
- value,
24896
- rowData: record
24897
- };
24898
24892
  const isAlreadySelected = selectedCells.some(
24899
- (cell) => cell.rowKey === cellData.rowKey && cell.columnKey === cellData.columnKey
24893
+ (cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === columnKey
24900
24894
  );
24901
24895
  let newSelectedCells;
24902
24896
  if (isAlreadySelected) {
24903
24897
  newSelectedCells = selectedCells.filter(
24904
- (cell) => !(cell.rowKey === cellData.rowKey && cell.columnKey === cellData.columnKey)
24898
+ (cell) => !(cell.rowKey === record[rowKeyValue] && cell.columnKey === columnKey)
24905
24899
  );
24906
24900
  } else {
24901
+ const cellData = {
24902
+ rowKey: record[rowKeyValue],
24903
+ columnKey,
24904
+ value: {
24905
+ type: "X",
24906
+ color: selectedCellColor || "grey"
24907
+ },
24908
+ rowData: record
24909
+ };
24907
24910
  const maxSelection = maxCellSelection || 2;
24908
24911
  if (cellSelectionMode === "single") {
24909
24912
  newSelectedCells = [cellData];
@@ -25035,7 +25038,7 @@ const ResponsiveTable = (props) => {
25035
25038
  {
25036
25039
  onClick: (e) => {
25037
25040
  e.stopPropagation();
25038
- handleCellClick(record, key, originalCellContent);
25041
+ handleCellClick(record, key);
25039
25042
  },
25040
25043
  className: classNames(styles$7.selectableCell, styles$7.selected),
25041
25044
  children: renderSelectedCell(cellData, cellIndex, selectedCells.length)
@@ -25075,7 +25078,8 @@ const ResponsiveTable = (props) => {
25075
25078
  if (isSelected2) {
25076
25079
  const selectedCell = selectedCells[cellIndex2];
25077
25080
  const cellColor = selectedCell?.value?.color || selectedCellColor;
25078
- return /* @__PURE__ */ jsx(Tag, { color: cellColor, style: { margin: -4 }, children: originalCellContent2.type });
25081
+ const cellType = selectedCell?.value?.type || "X";
25082
+ return /* @__PURE__ */ jsx(Tag, { color: cellColor, style: { margin: -4 }, children: cellType });
25079
25083
  }
25080
25084
  if (originalCellContent2) {
25081
25085
  return /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4 }, children: originalCellContent2.type });
@@ -25087,7 +25091,7 @@ const ResponsiveTable = (props) => {
25087
25091
  {
25088
25092
  onClick: (e) => {
25089
25093
  e.stopPropagation();
25090
- handleCellClick(record, key, originalCellContent2);
25094
+ handleCellClick(record, key);
25091
25095
  },
25092
25096
  className: classNames(
25093
25097
  styles$7.selectableCell,
@@ -25125,7 +25129,7 @@ const ResponsiveTable = (props) => {
25125
25129
  {
25126
25130
  onClick: (e) => {
25127
25131
  e.stopPropagation();
25128
- handleCellClick(record, key, value);
25132
+ handleCellClick(record, key);
25129
25133
  },
25130
25134
  className: classNames(styles$7.selectableCell, {
25131
25135
  [styles$7.selected]: isSelected
@@ -25143,7 +25147,7 @@ const ResponsiveTable = (props) => {
25143
25147
  {
25144
25148
  onClick: (e) => {
25145
25149
  e.stopPropagation();
25146
- handleCellClick(record, key, value);
25150
+ handleCellClick(record, key);
25147
25151
  },
25148
25152
  className: styles$7.selectableCell,
25149
25153
  children: originalCellContent