trotl-table 1.0.89 → 1.0.90

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.
package/dist/Table.cjs.js CHANGED
@@ -11417,6 +11417,10 @@ function TableInner({
11417
11417
  showCancel: true,
11418
11418
  showConfirm: true
11419
11419
  }, /*#__PURE__*/React.createElement("p", null, translate("areYouSureYouWantToDelete"), " ", /*#__PURE__*/React.createElement("strong", null, pendingDelete ? pendingDelete[deleteLabelKey] ?? pendingDelete.name ?? pendingDelete.id : ""), "?")));
11420
+ const getContextActionLabel = (action, row, index) => {
11421
+ const label = typeof action?.label === "function" ? action.label(row, action) : action?.label;
11422
+ return label || action?.text || `Action ${index + 1}`;
11423
+ };
11420
11424
  const contextMenuMarkup = contextMenu.visible && rightClickActions.length > 0 ? /*#__PURE__*/React.createElement("div", {
11421
11425
  style: {
11422
11426
  position: "fixed",
@@ -11443,7 +11447,7 @@ function TableInner({
11443
11447
  onMouseEnter: () => setHoveredActionIndex(i),
11444
11448
  onMouseLeave: () => setHoveredActionIndex(null),
11445
11449
  onClick: () => performContextMenuAction(action, contextMenu.row)
11446
- }, action.label || action.text || `Action ${i + 1}`))) : null;
11450
+ }, getContextActionLabel(action, contextMenu.row, i)))) : null;
11447
11451
  const contextMenuModalMarkup = contextMenuModal.visible && contextMenuModal.component ? /*#__PURE__*/React.createElement(Modal.default, {
11448
11452
  isOpen: true,
11449
11453
  title: contextMenuModal.title || "",