karsten-design-system 1.2.87 → 1.2.88

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/index.js CHANGED
@@ -5085,11 +5085,14 @@ function Table({ columns, data, totalRecords, actions = [], actionsHeaderClassNa
5085
5085
  const isDisabled = typeof action.disabled === 'function'
5086
5086
  ? action.disabled(row)
5087
5087
  : action.disabled;
5088
+ const icon = typeof action.icon === 'function'
5089
+ ? action.icon(row)
5090
+ : action.icon;
5088
5091
  return (jsx("span", { className: clsx('cursor-pointer', isDisabled &&
5089
5092
  'opacity-50 pointer-events-none cursor-not-allowed'), onClick: () => {
5090
5093
  if (!isDisabled)
5091
5094
  action.onClick(row);
5092
- }, "aria-label": action?.ariaLabel || action.label, role: "button", children: jsx(Tooltip, { text: action?.label, children: action.icon }) }, idx));
5095
+ }, "aria-label": action?.ariaLabel || action.label, role: "button", children: jsx(Tooltip, { text: action?.label, children: icon }) }, idx));
5093
5096
  }) }) }))] }, `main-${index}`), isExpandable &&
5094
5097
  isExpanded &&
5095
5098
  subTableColumns &&
@@ -5111,12 +5114,16 @@ function Table({ columns, data, totalRecords, actions = [], actionsHeaderClassNa
5111
5114
  'function'
5112
5115
  ? subAction.disabled(subRow)
5113
5116
  : subAction.disabled;
5117
+ const subIcon = typeof subAction.icon ===
5118
+ 'function'
5119
+ ? subAction.icon(subRow)
5120
+ : subAction.icon;
5114
5121
  return (jsx("span", { className: clsx('cursor-pointer', isSubDisabled &&
5115
5122
  'opacity-50 pointer-events-none cursor-not-allowed'), onClick: () => {
5116
5123
  if (!isSubDisabled)
5117
5124
  subAction.onClick(subRow);
5118
5125
  }, "aria-label": subAction?.ariaLabel ||
5119
- subAction.label, role: "button", children: jsx(Tooltip, { text: subAction?.label, children: subAction.icon }) }, subIdx));
5126
+ subAction.label, role: "button", children: jsx(Tooltip, { text: subAction?.label, children: subIcon }) }, subIdx));
5120
5127
  }) }) }))] }, subIndex)))) : (jsx("tr", { children: jsxs("td", { colSpan: subTableColumns.length +
5121
5128
  (subTableActions.length > 0 ? 1 : 0), className: "p-4 text-center text-xs text-primary dark:text-light-500", children: [jsx("i", { className: "pi pi-inbox mr-2" }), lang.noResultsMessage] }) })) })] }) }) }) }, `expanded-${index}`))] }, `row-${index}`));
5122
5129
  })) : (jsx("tr", { children: jsxs("td", { colSpan: visibleColumns.length +