@omniumretail/component-library 1.3.14 → 1.3.16
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,70 @@ const ResponsiveTable = (props) => {
|
|
|
25046
25043
|
);
|
|
25047
25044
|
}
|
|
25048
25045
|
if (!useOrderedCellSelection) {
|
|
25049
|
-
const
|
|
25050
|
-
const
|
|
25051
|
-
|
|
25052
|
-
|
|
25053
|
-
|
|
25054
|
-
|
|
25055
|
-
|
|
25056
|
-
|
|
25057
|
-
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
|
|
25061
|
-
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25065
|
-
if (!isDisabled) {
|
|
25066
|
-
handleCellClick(record, key, originalCellContent);
|
|
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
|
|
25051
|
+
);
|
|
25052
|
+
const isSelected2 = cellIndex2 !== -1;
|
|
25053
|
+
if (isDisabled) {
|
|
25054
|
+
if (originalCellContent2?.type === "I") {
|
|
25055
|
+
return /* @__PURE__ */ jsx(
|
|
25056
|
+
"div",
|
|
25057
|
+
{
|
|
25058
|
+
style: {
|
|
25059
|
+
cursor: "not-allowed"
|
|
25060
|
+
},
|
|
25061
|
+
children: "I"
|
|
25067
25062
|
}
|
|
25068
|
-
|
|
25069
|
-
|
|
25070
|
-
|
|
25071
|
-
|
|
25072
|
-
|
|
25073
|
-
|
|
25074
|
-
|
|
25075
|
-
|
|
25076
|
-
|
|
25077
|
-
|
|
25078
|
-
|
|
25079
|
-
|
|
25063
|
+
);
|
|
25064
|
+
} else {
|
|
25065
|
+
return /* @__PURE__ */ jsx(
|
|
25066
|
+
"div",
|
|
25067
|
+
{
|
|
25068
|
+
style: {
|
|
25069
|
+
backgroundColor: "#e8e8e8",
|
|
25070
|
+
cursor: "not-allowed",
|
|
25071
|
+
textAlign: "center",
|
|
25072
|
+
color: "#999",
|
|
25073
|
+
padding: "8px",
|
|
25074
|
+
border: "1px solid #d9d9d9"
|
|
25075
|
+
},
|
|
25076
|
+
children: "-"
|
|
25077
|
+
}
|
|
25078
|
+
);
|
|
25080
25079
|
}
|
|
25081
|
-
|
|
25080
|
+
}
|
|
25081
|
+
if (isSelectable2) {
|
|
25082
|
+
const cellContent = (() => {
|
|
25083
|
+
if (isSelected2) {
|
|
25084
|
+
const selectedCell = selectedCells[cellIndex2];
|
|
25085
|
+
const cellColor = selectedCell?.value?.color || selectedCellColor;
|
|
25086
|
+
return /* @__PURE__ */ jsx(Tag, { color: cellColor, style: { margin: -4 }, children: "X" });
|
|
25087
|
+
}
|
|
25088
|
+
if (originalCellContent2) {
|
|
25089
|
+
return /* @__PURE__ */ jsx(Tag, { color: originalCellContent2.color, style: { margin: -4 }, children: originalCellContent2.type });
|
|
25090
|
+
}
|
|
25091
|
+
return null;
|
|
25092
|
+
})();
|
|
25093
|
+
return /* @__PURE__ */ jsx(
|
|
25094
|
+
"div",
|
|
25095
|
+
{
|
|
25096
|
+
onClick: (e) => {
|
|
25097
|
+
e.stopPropagation();
|
|
25098
|
+
handleCellClick(record, key, originalCellContent2);
|
|
25099
|
+
},
|
|
25100
|
+
className: classNames(
|
|
25101
|
+
styles$7.selectableCell,
|
|
25102
|
+
isSelected2 && styles$7.selected,
|
|
25103
|
+
isSelected2 && styles$7.uniformSelection
|
|
25104
|
+
),
|
|
25105
|
+
children: cellContent
|
|
25106
|
+
}
|
|
25107
|
+
);
|
|
25108
|
+
}
|
|
25109
|
+
return value;
|
|
25082
25110
|
}
|
|
25083
25111
|
if (useOrderedCellSelection) {
|
|
25084
25112
|
const isFirstCell = cellIndex === 0;
|