@skalfa/skalfa-component 1.0.31 → 1.0.32

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.
@@ -191,9 +191,19 @@ function TableSupervisionComponent({ title, id, fetchControl, columnControl, for
191
191
  return ((0, jsx_runtime_1.jsx)(__1.FormSupervisionComponent, { submitControl: fetchControl.path ? {
192
192
  path: `${fetchControl.path}/${selected?.id || ""}`,
193
193
  method: !selected?.id ? "POST" : "PUT",
194
+ bearer: fetchControl.bearer,
195
+ headers: {
196
+ ...fetchControl.headers,
197
+ ...(formControl?.contentType ? { "Content-Type": formControl.contentType } : {}),
198
+ },
194
199
  } : fetchControl.url ? {
195
200
  url: `${fetchControl.url}/${selected?.id || ""}`,
196
201
  method: !selected?.id ? "POST" : "PUT",
202
+ bearer: fetchControl.bearer,
203
+ headers: {
204
+ ...fetchControl.headers,
205
+ ...(formControl?.contentType ? { "Content-Type": formControl.contentType } : {}),
206
+ },
197
207
  } : { idb: fetchControl?.idb }, fields: fields?.filter((f) => f.visibility ? !selected?.id ? ["*", "create"]?.includes(f.visibility) : ["*", "update"]?.includes(f.visibility) : true), defaultValue: formControl?.defaultValue ? await formControl?.defaultValue(selected || null) : selected, payload: formControl?.payload, onSuccess: () => {
198
208
  reset();
199
209
  setTimeout(() => { setToggle(`MODAL_FORM_${toggleKey}`, false); }, 900);
@@ -71,7 +71,7 @@ function ControlBarComponent({ id = "", options, className, search, onSearch, se
71
71
  }
72
72
  };
73
73
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("control-bar", className), children: (isSm ? [
74
- ...(options?.filter((op) => op == "SEARCH" || op == "REFRESH") || []),
74
+ ...(options?.filter((op) => op == "SEARCH") || []),
75
75
  ...(options && options?.length > 1 ? ['MOBILE_OPTION'] : [])
76
76
  ] : options)?.map((option, key) => {
77
77
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalfa/skalfa-component",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "Reusable UI components for Skalfa App.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -379,9 +379,19 @@ export function TableSupervisionComponent({
379
379
  submitControl={(fetchControl as ApiType).path ? {
380
380
  path : `${(fetchControl as ApiType).path}/${(selected as { id: number })?.id || "" }`,
381
381
  method : !(selected as { id: number })?.id ? "POST" : "PUT",
382
+ bearer : (fetchControl as ApiType).bearer,
383
+ headers : {
384
+ ...(fetchControl as ApiType).headers,
385
+ ...(formControl?.contentType ? { "Content-Type": formControl.contentType } : {}),
386
+ },
382
387
  } : (fetchControl as ApiType).url ? {
383
388
  url : `${(fetchControl as ApiType).url}/${(selected as { id: number })?.id || ""}`,
384
389
  method : !(selected as { id: number })?.id ? "POST" : "PUT",
390
+ bearer : (fetchControl as ApiType).bearer,
391
+ headers : {
392
+ ...(fetchControl as ApiType).headers,
393
+ ...(formControl?.contentType ? { "Content-Type": formControl.contentType } : {}),
394
+ },
385
395
  } : { idb: (fetchControl as ({ idb: UseResourceIdb }))?.idb }
386
396
  }
387
397
  fields={fields?.filter((f: any) => f.visibility ? !(selected as { id: number })?.id ? ["*", "create"]?.includes(f.visibility) : ["*", "update"]?.includes(f.visibility) : true) as FormType[]}
@@ -123,7 +123,7 @@ export function ControlBarComponent({
123
123
  <>
124
124
  <div className={cn("control-bar", className)}>
125
125
  {(isSm ? [
126
- ...(options?.filter((op) => op == "SEARCH" || op == "REFRESH") || []),
126
+ ...(options?.filter((op) => op == "SEARCH") || []),
127
127
  ...(options && options?.length > 1 ? ['MOBILE_OPTION'] : [])
128
128
  ] : options)?.map((option: ControlBarOptionType, key: number) => {
129
129
  {