next-recomponents 2.0.6 → 2.0.7

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
@@ -35842,12 +35842,12 @@ function useColumns(rows, options) {
35842
35842
  return import_react4.default.cloneElement(buttons[key], {
35843
35843
  className: `${(_a2 = params == null ? void 0 : params.className) != null ? _a2 : ""} m-auto text-xs`,
35844
35844
  children: (_b = params == null ? void 0 : params.row) == null ? void 0 : _b[key],
35845
- onClick: (e) => {
35845
+ onClick: async (e) => {
35846
35846
  var _a3, _b2;
35847
35847
  e.row = params == null ? void 0 : params.row;
35848
35848
  if ((_b2 = (_a3 = buttons[key]) == null ? void 0 : _a3.props) == null ? void 0 : _b2.onClick) {
35849
- const newVal = buttons[key].props.onClick(e);
35850
- if (newVal) handleRowUpdate(newVal);
35849
+ const newVal = await buttons[key].props.onClick(e);
35850
+ if (newVal) handleRowUpdate({ ...e.row, newVal });
35851
35851
  }
35852
35852
  }
35853
35853
  });
package/dist/index.mjs CHANGED
@@ -35822,12 +35822,12 @@ function useColumns(rows, options) {
35822
35822
  return React3.cloneElement(buttons[key], {
35823
35823
  className: `${(_a2 = params == null ? void 0 : params.className) != null ? _a2 : ""} m-auto text-xs`,
35824
35824
  children: (_b = params == null ? void 0 : params.row) == null ? void 0 : _b[key],
35825
- onClick: (e) => {
35825
+ onClick: async (e) => {
35826
35826
  var _a3, _b2;
35827
35827
  e.row = params == null ? void 0 : params.row;
35828
35828
  if ((_b2 = (_a3 = buttons[key]) == null ? void 0 : _a3.props) == null ? void 0 : _b2.onClick) {
35829
- const newVal = buttons[key].props.onClick(e);
35830
- if (newVal) handleRowUpdate(newVal);
35829
+ const newVal = await buttons[key].props.onClick(e);
35830
+ if (newVal) handleRowUpdate({ ...e.row, newVal });
35831
35831
  }
35832
35832
  }
35833
35833
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-recomponents",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "description nueva",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -275,11 +275,12 @@ function useColumns(
275
275
  React.cloneElement(buttons[key], {
276
276
  className: `${params?.className ?? ""} m-auto text-xs`,
277
277
  children: params?.row?.[key],
278
- onClick: (e: any) => {
278
+ onClick: async (e: TableButtonProps) => {
279
279
  e.row = params?.row;
280
280
  if (buttons[key]?.props?.onClick) {
281
- const newVal = buttons[key].props.onClick(e);
282
- if (newVal) handleRowUpdate(newVal);
281
+ const newVal = await buttons[key].props.onClick(e);
282
+
283
+ if (newVal) handleRowUpdate({ ...e.row, newVal });
283
284
  }
284
285
  },
285
286
  })