@skalfa/skalfa-component 1.0.12 → 1.0.13
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,15 +92,15 @@ function TableSupervisionComponent({ title, id, fetchControl, columnControl, for
|
|
|
92
92
|
} }, key));
|
|
93
93
|
}
|
|
94
94
|
if (typeof action == "object") {
|
|
95
|
-
(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, onClick: () => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_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: () => {
|
|
96
|
+
if (action?.button?.onClick) {
|
|
97
|
+
action?.button?.onClick(item);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
setToggle(`MODAL_${_utils_1.conversion.strSnake(action?.label).toUpperCase()}_${toggleKey}`);
|
|
101
|
+
item && setSelected?.(item);
|
|
102
|
+
}
|
|
103
|
+
} }, `action-object-${key}`), ...action.button] }));
|
|
104
104
|
}
|
|
105
105
|
if (typeof action == "function") {
|
|
106
106
|
return ((0, jsx_runtime_1.jsx)("span", { children: action(item || {}, (type) => {
|
|
@@ -275,7 +275,7 @@ function TableSupervisionComponent({ title, id, fetchControl, columnControl, for
|
|
|
275
275
|
},
|
|
276
276
|
} }), actionControl && Array.isArray(actionControl) && actionControl.filter((ac) => typeof ac == "object")?.map((ac, acKey) => {
|
|
277
277
|
const submitControl = ac.modal?.submitControl?.onSubmit;
|
|
278
|
-
return ((0, jsx_runtime_1.jsx)(__1.ModalConfirmComponent, { show: !!toggle[`MODAL_${_utils_1.conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`], onClose: () => setToggle(`MODAL_${_utils_1.conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`, false), title: ac?.modal?.title || ac.label, submitControl: {
|
|
278
|
+
return ((0, jsx_runtime_1.jsx)(__1.ModalConfirmComponent, { show: !!toggle[`MODAL_${_utils_1.conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`], onClose: () => setToggle(`MODAL_${_utils_1.conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`, false), title: ac?.modal?.title || ac.label, className: ac?.modal?.className, submitControl: {
|
|
279
279
|
onSubmit: {
|
|
280
280
|
...(submitControl?.path
|
|
281
281
|
? { path: `${submitControl?.path}/${selected?.id || ""}` }
|
package/package.json
CHANGED
|
@@ -222,23 +222,28 @@ export function TableSupervisionComponent({
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
if(typeof action == "object") {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
action?.button?.
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
225
|
+
return (
|
|
226
|
+
<>
|
|
227
|
+
<ButtonComponent
|
|
228
|
+
key={`action-object-${key}`}
|
|
229
|
+
label={action?.button?.label || action?.label}
|
|
230
|
+
variant={action?.button?.variant || "outline"}
|
|
231
|
+
paint={action?.button?.paint || "primary"}
|
|
232
|
+
size={action?.button?.size || options?.size || "xs"}
|
|
233
|
+
rounded={action?.button?.rounded || true}
|
|
234
|
+
className={action?.button?.className}
|
|
235
|
+
onClick={() => {
|
|
236
|
+
if (action?.button?.onClick) {
|
|
237
|
+
action?.button?.onClick(item)
|
|
238
|
+
} else {
|
|
239
|
+
setToggle(`MODAL_${conversion.strSnake(action?.label).toUpperCase()}_${toggleKey}`);
|
|
240
|
+
item && setSelected?.(item);
|
|
241
|
+
}
|
|
242
|
+
}}
|
|
243
|
+
/>
|
|
244
|
+
{...action.button}
|
|
245
|
+
</>
|
|
246
|
+
)
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
if(typeof action == "function") {
|
|
@@ -629,6 +634,7 @@ export function TableSupervisionComponent({
|
|
|
629
634
|
show={!!toggle[`MODAL_${conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`]}
|
|
630
635
|
onClose={() => setToggle(`MODAL_${conversion.strSnake(ac.label).toUpperCase()}_${toggleKey}`, false)}
|
|
631
636
|
title={ac?.modal?.title || ac.label}
|
|
637
|
+
className={ac?.modal?.className}
|
|
632
638
|
submitControl={{
|
|
633
639
|
onSubmit: {
|
|
634
640
|
...(submitControl?.path
|