@omniumretail/component-library 1.2.98 → 1.2.99

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.
@@ -24856,7 +24856,10 @@ const ResponsiveTable = (props) => {
24856
24856
  maxCellSelection,
24857
24857
  cellSelectionMode,
24858
24858
  cleanCellSelection,
24859
- cellSelectionStyle
24859
+ cellSelectionStyle,
24860
+ renderSelectedCell,
24861
+ useOrderedCellSelection = true
24862
+ // Por padrão mantém comportamento antigo
24860
24863
  } = props;
24861
24864
  const [customFilters, setCustomFilters] = useState([]);
24862
24865
  const [customColumns, setCustomColumns] = useState([]);
@@ -25019,40 +25022,85 @@ const ResponsiveTable = (props) => {
25019
25022
  );
25020
25023
  const isSelected = cellIndex !== -1;
25021
25024
  if (isSelectable) {
25022
- const isFirstCell = cellIndex === 0;
25023
- const isSecondCell = cellIndex === 1;
25024
- let cellStyle = {};
25025
- let icon2 = null;
25026
- if (isFirstCell) {
25027
- cellStyle = {
25028
- backgroundColor: finalCellStyle.firstCell.backgroundColor,
25029
- borderColor: finalCellStyle.firstCell.borderColor,
25030
- color: finalCellStyle.firstCell.textColor
25025
+ if (renderSelectedCell && isSelected) {
25026
+ const cellData = {
25027
+ rowKey: record[rowKeyValue],
25028
+ columnKey: key,
25029
+ value,
25030
+ rowData: record
25031
25031
  };
25032
- icon2 = /* @__PURE__ */ jsx(ArrowRightOutlined, { style: { color: finalCellStyle.firstCell.iconColor, fontSize: "14px" } });
25033
- } else if (isSecondCell) {
25034
- cellStyle = {
25035
- backgroundColor: finalCellStyle.secondCell.backgroundColor,
25036
- borderColor: finalCellStyle.secondCell.borderColor,
25037
- color: finalCellStyle.secondCell.textColor
25038
- };
25039
- icon2 = /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { color: finalCellStyle.secondCell.iconColor, fontSize: "14px" } });
25032
+ return /* @__PURE__ */ jsx(
25033
+ "div",
25034
+ {
25035
+ onClick: (e) => {
25036
+ e.stopPropagation();
25037
+ handleCellClick(record, key, value);
25038
+ },
25039
+ className: classNames(styles$7.selectableCell, styles$7.selected),
25040
+ children: renderSelectedCell(cellData, cellIndex, selectedCells.length)
25041
+ }
25042
+ );
25040
25043
  }
25041
- return /* @__PURE__ */ jsxs(
25044
+ if (!useOrderedCellSelection && isSelected) {
25045
+ return /* @__PURE__ */ jsx(
25046
+ "div",
25047
+ {
25048
+ onClick: (e) => {
25049
+ e.stopPropagation();
25050
+ handleCellClick(record, key, value);
25051
+ },
25052
+ className: classNames(styles$7.selectableCell, styles$7.selected, styles$7.uniformSelection),
25053
+ children: value
25054
+ }
25055
+ );
25056
+ }
25057
+ if (useOrderedCellSelection) {
25058
+ const isFirstCell = cellIndex === 0;
25059
+ const isSecondCell = cellIndex === 1;
25060
+ let cellStyle = {};
25061
+ let icon2 = null;
25062
+ if (isFirstCell) {
25063
+ cellStyle = {
25064
+ backgroundColor: finalCellStyle.firstCell.backgroundColor,
25065
+ borderColor: finalCellStyle.firstCell.borderColor,
25066
+ color: finalCellStyle.firstCell.textColor
25067
+ };
25068
+ icon2 = /* @__PURE__ */ jsx(ArrowRightOutlined, { style: { color: finalCellStyle.firstCell.iconColor, fontSize: "14px" } });
25069
+ } else if (isSecondCell) {
25070
+ cellStyle = {
25071
+ backgroundColor: finalCellStyle.secondCell.backgroundColor,
25072
+ borderColor: finalCellStyle.secondCell.borderColor,
25073
+ color: finalCellStyle.secondCell.textColor
25074
+ };
25075
+ icon2 = /* @__PURE__ */ jsx(ArrowLeftOutlined, { style: { color: finalCellStyle.secondCell.iconColor, fontSize: "14px" } });
25076
+ }
25077
+ return /* @__PURE__ */ jsxs(
25078
+ "div",
25079
+ {
25080
+ onClick: (e) => {
25081
+ e.stopPropagation();
25082
+ handleCellClick(record, key, value);
25083
+ },
25084
+ className: classNames(styles$7.selectableCell, {
25085
+ [styles$7.selected]: isSelected
25086
+ }),
25087
+ style: isSelected ? cellStyle : {},
25088
+ children: [
25089
+ value,
25090
+ isSelected && icon2
25091
+ ]
25092
+ }
25093
+ );
25094
+ }
25095
+ return /* @__PURE__ */ jsx(
25042
25096
  "div",
25043
25097
  {
25044
25098
  onClick: (e) => {
25045
25099
  e.stopPropagation();
25046
25100
  handleCellClick(record, key, value);
25047
25101
  },
25048
- className: classNames(styles$7.selectableCell, {
25049
- [styles$7.selected]: isSelected
25050
- }),
25051
- style: isSelected ? cellStyle : {},
25052
- children: [
25053
- value,
25054
- isSelected && icon2
25055
- ]
25102
+ className: styles$7.selectableCell,
25103
+ children: value
25056
25104
  }
25057
25105
  );
25058
25106
  }