@skalfa/skalfa-component 1.0.31 → 1.0.33
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/supervision/TableSupervision.component.js +10 -0
- package/dist/table/ControlBar.component.js +1 -1
- package/dist/wrap/ContentWrapper.component.js +13 -5
- package/package.json +1 -1
- package/src/supervision/TableSupervision.component.tsx +10 -0
- package/src/table/ControlBar.component.tsx +1 -1
- package/src/wrap/ContentWrapper.component.tsx +13 -5
|
@@ -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"
|
|
74
|
+
...(options?.filter((op) => op == "SEARCH") || []),
|
|
75
75
|
...(options && options?.length > 1 ? ['MOBILE_OPTION'] : [])
|
|
76
76
|
] : options)?.map((option, key) => {
|
|
77
77
|
{
|
|
@@ -40,7 +40,7 @@ function parseInlineFormats(text) {
|
|
|
40
40
|
function parseContentToHtml(content) {
|
|
41
41
|
if (!content)
|
|
42
42
|
return "";
|
|
43
|
-
const lines = content.split("\n");
|
|
43
|
+
const lines = content.replace(/\r/g, "").split("\n");
|
|
44
44
|
const htmlParts = [];
|
|
45
45
|
let i = 0;
|
|
46
46
|
while (i < lines.length) {
|
|
@@ -58,27 +58,35 @@ function parseContentToHtml(content) {
|
|
|
58
58
|
}
|
|
59
59
|
if (line.match(/^\[list:bullet\]/)) {
|
|
60
60
|
const items = [];
|
|
61
|
+
let matchedAny = false;
|
|
61
62
|
while (i < lines.length) {
|
|
62
63
|
const bm = lines[i].match(/^\[list:bullet\](.*?)\[list\]$/);
|
|
63
64
|
if (!bm)
|
|
64
65
|
break;
|
|
66
|
+
matchedAny = true;
|
|
65
67
|
items.push(`<li>${parseInlineFormats(bm[1])}</li>`);
|
|
66
68
|
i++;
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
if (matchedAny) {
|
|
71
|
+
htmlParts.push(`<ul>${items.join("")}</ul>`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
if (line.match(/^\[list:number\]/)) {
|
|
72
76
|
const items = [];
|
|
77
|
+
let matchedAny = false;
|
|
73
78
|
while (i < lines.length) {
|
|
74
79
|
const nm = lines[i].match(/^\[list:number\](.*?)\[list\]$/);
|
|
75
80
|
if (!nm)
|
|
76
81
|
break;
|
|
82
|
+
matchedAny = true;
|
|
77
83
|
items.push(`<li>${parseInlineFormats(nm[1])}</li>`);
|
|
78
84
|
i++;
|
|
79
85
|
}
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
if (matchedAny) {
|
|
87
|
+
htmlParts.push(`<ol>${items.join("")}</ol>`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
82
90
|
}
|
|
83
91
|
const alignMatch = line.match(/^\[align:(left|center|right|justify)\](.*?)\[align\]$/);
|
|
84
92
|
if (alignMatch) {
|
package/package.json
CHANGED
|
@@ -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"
|
|
126
|
+
...(options?.filter((op) => op == "SEARCH") || []),
|
|
127
127
|
...(options && options?.length > 1 ? ['MOBILE_OPTION'] : [])
|
|
128
128
|
] : options)?.map((option: ControlBarOptionType, key: number) => {
|
|
129
129
|
{
|
|
@@ -44,7 +44,7 @@ export function parseInlineFormats(text: string): string {
|
|
|
44
44
|
export function parseContentToHtml(content: string): string {
|
|
45
45
|
if (!content) return "";
|
|
46
46
|
|
|
47
|
-
const lines = content.split("\n");
|
|
47
|
+
const lines = content.replace(/\r/g, "").split("\n");
|
|
48
48
|
const htmlParts: string[] = [];
|
|
49
49
|
let i = 0;
|
|
50
50
|
|
|
@@ -66,26 +66,34 @@ export function parseContentToHtml(content: string): string {
|
|
|
66
66
|
|
|
67
67
|
if (line.match(/^\[list:bullet\]/)) {
|
|
68
68
|
const items: string[] = [];
|
|
69
|
+
let matchedAny = false;
|
|
69
70
|
while (i < lines.length) {
|
|
70
71
|
const bm = lines[i].match(/^\[list:bullet\](.*?)\[list\]$/);
|
|
71
72
|
if (!bm) break;
|
|
73
|
+
matchedAny = true;
|
|
72
74
|
items.push(`<li>${parseInlineFormats(bm[1])}</li>`);
|
|
73
75
|
i++;
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
if (matchedAny) {
|
|
78
|
+
htmlParts.push(`<ul>${items.join("")}</ul>`);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
if (line.match(/^\[list:number\]/)) {
|
|
80
84
|
const items: string[] = [];
|
|
85
|
+
let matchedAny = false;
|
|
81
86
|
while (i < lines.length) {
|
|
82
87
|
const nm = lines[i].match(/^\[list:number\](.*?)\[list\]$/);
|
|
83
88
|
if (!nm) break;
|
|
89
|
+
matchedAny = true;
|
|
84
90
|
items.push(`<li>${parseInlineFormats(nm[1])}</li>`);
|
|
85
91
|
i++;
|
|
86
92
|
}
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
if (matchedAny) {
|
|
94
|
+
htmlParts.push(`<ol>${items.join("")}</ol>`);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
const alignMatch = line.match(/^\[align:(left|center|right|justify)\](.*?)\[align\]$/);
|