@omniumretail/component-library 1.3.14 → 1.3.15
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.
|
@@ -24810,12 +24810,10 @@ const TableExportButton = (props) => {
|
|
|
24810
24810
|
const tableWrapper = "_tableWrapper_v6yec_1";
|
|
24811
24811
|
const selectableCell = "_selectableCell_v6yec_167";
|
|
24812
24812
|
const selected = "_selected_v6yec_182";
|
|
24813
|
-
const disabledCell = "_disabledCell_v6yec_189";
|
|
24814
24813
|
const styles$7 = {
|
|
24815
24814
|
tableWrapper,
|
|
24816
24815
|
selectableCell,
|
|
24817
|
-
selected
|
|
24818
|
-
disabledCell
|
|
24816
|
+
selected
|
|
24819
24817
|
};
|
|
24820
24818
|
var sortByOption = /* @__PURE__ */ ((sortByOption2) => {
|
|
24821
24819
|
sortByOption2["asc"] = "asc";
|
|
@@ -24862,8 +24860,7 @@ const ResponsiveTable = (props) => {
|
|
|
24862
24860
|
renderSelectedCell,
|
|
24863
24861
|
useOrderedCellSelection = true,
|
|
24864
24862
|
initialSelectedCells,
|
|
24865
|
-
selectedCellColor
|
|
24866
|
-
disabledColumns
|
|
24863
|
+
selectedCellColor
|
|
24867
24864
|
} = props;
|
|
24868
24865
|
const [customFilters, setCustomFilters] = useState([]);
|
|
24869
24866
|
const [customColumns, setCustomColumns] = useState([]);
|
|
@@ -25046,39 +25043,58 @@ const ResponsiveTable = (props) => {
|
|
|
25046
25043
|
);
|
|
25047
25044
|
}
|
|
25048
25045
|
if (!useOrderedCellSelection) {
|
|
25049
|
-
const
|
|
25050
|
-
const
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
|
|
25054
|
-
}
|
|
25055
|
-
if (originalCellContent) {
|
|
25056
|
-
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent.color, style: { margin: -4 }, children: originalCellContent.type });
|
|
25057
|
-
}
|
|
25058
|
-
return null;
|
|
25059
|
-
})();
|
|
25060
|
-
return /* @__PURE__ */ jsx(
|
|
25061
|
-
"div",
|
|
25062
|
-
{
|
|
25063
|
-
onClick: (e) => {
|
|
25064
|
-
e.stopPropagation();
|
|
25065
|
-
if (!isDisabled) {
|
|
25066
|
-
handleCellClick(record, key, originalCellContent);
|
|
25067
|
-
}
|
|
25068
|
-
},
|
|
25069
|
-
className: classNames(
|
|
25070
|
-
styles$7.selectableCell,
|
|
25071
|
-
isSelected && styles$7.selected,
|
|
25072
|
-
isSelected && styles$7.uniformSelection,
|
|
25073
|
-
isDisabled && styles$7.disabledCell
|
|
25074
|
-
),
|
|
25075
|
-
style: {
|
|
25076
|
-
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
25077
|
-
opacity: isDisabled ? 0.3 : 1
|
|
25078
|
-
},
|
|
25079
|
-
children: cellContent
|
|
25080
|
-
}
|
|
25046
|
+
const isSelectable2 = enableCellSelection && selectableColumns?.includes(key);
|
|
25047
|
+
const originalCellContent2 = record[key];
|
|
25048
|
+
const isDisabled = originalCellContent2?.disabled === true;
|
|
25049
|
+
const cellIndex2 = selectedCells.findIndex(
|
|
25050
|
+
(cell) => cell.rowKey === record[rowKeyValue] && cell.columnKey === key
|
|
25081
25051
|
);
|
|
25052
|
+
const isSelected2 = cellIndex2 !== -1;
|
|
25053
|
+
if (isDisabled) {
|
|
25054
|
+
return /* @__PURE__ */ jsx(
|
|
25055
|
+
"div",
|
|
25056
|
+
{
|
|
25057
|
+
style: {
|
|
25058
|
+
backgroundColor: "#e8e8e8",
|
|
25059
|
+
cursor: "not-allowed",
|
|
25060
|
+
textAlign: "center",
|
|
25061
|
+
color: "#999",
|
|
25062
|
+
padding: "8px",
|
|
25063
|
+
border: "1px solid #d9d9d9"
|
|
25064
|
+
},
|
|
25065
|
+
children: "-"
|
|
25066
|
+
}
|
|
25067
|
+
);
|
|
25068
|
+
}
|
|
25069
|
+
if (isSelectable2) {
|
|
25070
|
+
const cellContent = (() => {
|
|
25071
|
+
if (isSelected2) {
|
|
25072
|
+
const selectedCell = selectedCells[cellIndex2];
|
|
25073
|
+
const cellColor = selectedCell?.value?.color || selectedCellColor;
|
|
25074
|
+
return /* @__PURE__ */ jsx(Tag, { color: cellColor, style: { margin: -4 }, children: "X" });
|
|
25075
|
+
}
|
|
25076
|
+
if (originalCellContent2) {
|
|
25077
|
+
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4 }, children: originalCellContent2.type });
|
|
25078
|
+
}
|
|
25079
|
+
return null;
|
|
25080
|
+
})();
|
|
25081
|
+
return /* @__PURE__ */ jsx(
|
|
25082
|
+
"div",
|
|
25083
|
+
{
|
|
25084
|
+
onClick: (e) => {
|
|
25085
|
+
e.stopPropagation();
|
|
25086
|
+
handleCellClick(record, key, originalCellContent2);
|
|
25087
|
+
},
|
|
25088
|
+
className: classNames(
|
|
25089
|
+
styles$7.selectableCell,
|
|
25090
|
+
isSelected2 && styles$7.selected,
|
|
25091
|
+
isSelected2 && styles$7.uniformSelection
|
|
25092
|
+
),
|
|
25093
|
+
children: cellContent
|
|
25094
|
+
}
|
|
25095
|
+
);
|
|
25096
|
+
}
|
|
25097
|
+
return value;
|
|
25082
25098
|
}
|
|
25083
25099
|
if (useOrderedCellSelection) {
|
|
25084
25100
|
const isFirstCell = cellIndex === 0;
|