@skalfa/skalfa-component 1.0.17 → 1.0.19

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.
@@ -92,7 +92,7 @@ function TableSupervisionComponent({ title, id, fetchControl, columnControl, for
92
92
  } }, key));
93
93
  }
94
94
  if (typeof action == "object") {
95
- if (action.on && !action.on?.(item || {}))
95
+ if (action.on !== undefined && (typeof action.on === 'function' ? !action.on(item || {}) : !action.on))
96
96
  return;
97
97
  return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(__1.ButtonComponent, { label: action?.button?.label || action?.label, variant: action?.button?.variant || "outline", paint: action?.button?.paint || "primary", size: action?.button?.size || options?.size || "xs", rounded: action?.button?.rounded || true, className: action?.button?.className, onClick: () => {
98
98
  if (action?.button?.onClick) {
@@ -283,6 +283,7 @@ function TableSupervisionComponent({ title, id, fetchControl, columnControl, for
283
283
  ? { path: `${submitControl?.path}/${selected?.id || ""}` }
284
284
  : { url: `${submitControl?.url}/${selected?.id || ""}` }),
285
285
  method: submitControl?.method || "POST",
286
+ payload: submitControl?.payload,
286
287
  },
287
288
  onSuccess: () => {
288
289
  reset();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalfa/skalfa-component",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Reusable UI components for Skalfa App.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -226,7 +226,7 @@ export function TableSupervisionComponent({
226
226
  }
227
227
 
228
228
  if(typeof action == "object") {
229
- if (action.on && !action.on?.(item || {})) return
229
+ if (action.on !== undefined && (typeof action.on === 'function' ? !action.on(item || {}) : !action.on)) return
230
230
 
231
231
  return (
232
232
  <Fragment key={`action-object-${key}`}>
@@ -648,6 +648,7 @@ export function TableSupervisionComponent({
648
648
  : {url: `${submitControl?.url}/${(selected as { id: number })?.id || ""}`}
649
649
  ),
650
650
  method: submitControl?.method || "POST",
651
+ payload: submitControl?.payload,
651
652
  },
652
653
  onSuccess: () => {
653
654
  reset();