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.esm.js CHANGED
@@ -11395,6 +11395,10 @@ function TableInner({
11395
11395
  showCancel: true,
11396
11396
  showConfirm: true
11397
11397
  }, /*#__PURE__*/React__default.createElement("p", null, translate("areYouSureYouWantToDelete"), " ", /*#__PURE__*/React__default.createElement("strong", null, pendingDelete ? pendingDelete[deleteLabelKey] ?? pendingDelete.name ?? pendingDelete.id : ""), "?")));
11398
+ const getContextActionLabel = (action, row, index) => {
11399
+ const label = typeof action?.label === "function" ? action.label(row, action) : action?.label;
11400
+ return label || action?.text || `Action ${index + 1}`;
11401
+ };
11398
11402
  const contextMenuMarkup = contextMenu.visible && rightClickActions.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
11399
11403
  style: {
11400
11404
  position: "fixed",
@@ -11421,7 +11425,7 @@ function TableInner({
11421
11425
  onMouseEnter: () => setHoveredActionIndex(i),
11422
11426
  onMouseLeave: () => setHoveredActionIndex(null),
11423
11427
  onClick: () => performContextMenuAction(action, contextMenu.row)
11424
- }, action.label || action.text || `Action ${i + 1}`))) : null;
11428
+ }, getContextActionLabel(action, contextMenu.row, i)))) : null;
11425
11429
  const contextMenuModalMarkup = contextMenuModal.visible && contextMenuModal.component ? /*#__PURE__*/React__default.createElement(Modal, {
11426
11430
  isOpen: true,
11427
11431
  title: contextMenuModal.title || "",