tw-react-components 0.0.176 → 0.0.178

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/index.esm.js CHANGED
@@ -1617,7 +1617,7 @@ function DataTable({ className, columns, rows, sorting, pagination, actions = []
1617
1617
  .map((action, actionIndex) => {
1618
1618
  var _a;
1619
1619
  const notification = (_a = action.hasNotification) === null || _a === void 0 ? void 0 : _a.call(action, item, rowIndex);
1620
- return (jsxs("div", { className: "relative", children: [jsx(Button, { size: "small", prefixIcon: action.icon, color: action.color, onClick: handleActionClicked(action, item, rowIndex), children: action.label, dataTestId: `${dataTestId}-action-button-${rowIndex}-${actionIndex}` }), notification &&
1620
+ return (jsxs("div", { className: "relative", children: [jsx(Button, { size: "small", prefixIcon: action.icon, color: action.color, loading: action.loading, onClick: handleActionClicked(action, item, rowIndex), children: action.label, dataTestId: `${dataTestId}-action-button-${rowIndex}-${actionIndex}` }), notification &&
1621
1621
  (notification === true ? (jsx(Hint.Dot, {})) : notification.type === 'dot' ? (jsx(Hint.Dot, Object.assign({}, notification.props))) : (jsx(Hint.Badge, Object.assign({}, notification.props))))] }, actionIndex));
1622
1622
  }) }) }))] }, rowIndex),
1623
1623
  rowExtraContent && expandedRows[rowExtraContent.idGetter(item)] && (jsx(Table.Row, { dataTestId: `${dataTestId}-expanded-row-${rowIndex}`, children: jsx(Table.Cell, { className: "p-0", colSpan: columnsLength, dataTestId: `${dataTestId}-expanded-cell-${rowIndex}`, children: jsx(rowExtraContent.component, { item: item, rowIndex: rowIndex }) }) }, `${rowIndex}-expanded`)),
@@ -1686,7 +1686,7 @@ const ConfirmDialog = ({ open, title, children, yesLabel, noLabel, onConfirm, on
1686
1686
  try {
1687
1687
  yield onConfirm();
1688
1688
  }
1689
- catch (_a) {
1689
+ finally {
1690
1690
  setLoading(false);
1691
1691
  }
1692
1692
  onClose();
@@ -1796,7 +1796,7 @@ function ListSorterDialog({ className, open, title, items, idResolver, renderer,
1796
1796
  try {
1797
1797
  yield onSubmit(sortedItems);
1798
1798
  }
1799
- catch (_a) {
1799
+ finally {
1800
1800
  setLoading(false);
1801
1801
  }
1802
1802
  onClose();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tw-react-components",
3
3
  "description": "A set of React components build with TailwindCSS to make a nice dashboard.",
4
- "version": "0.0.176",
4
+ "version": "0.0.178",
5
5
  "license": "MIT",
6
6
  "homepage": "https://bacali95.github.io/tw-react-components",
7
7
  "type": "module",
@@ -43,6 +43,7 @@ export type DataTableAction<T> = {
43
43
  } | boolean;
44
44
  color?: Color;
45
45
  hide?: boolean | ((item: T) => boolean);
46
+ loading?: boolean;
46
47
  onClick: (item: T, rowIndex: number) => void;
47
48
  };
48
49
  export type DataTableProps<T> = {