@ssplib/react-components 0.0.165 → 0.0.167
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.
|
@@ -42,10 +42,8 @@ const form_1 = require("../../../context/form");
|
|
|
42
42
|
const material_1 = require("@mui/material");
|
|
43
43
|
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
44
44
|
function getChildrenNames(children) {
|
|
45
|
-
console.log('ENTROU NO getChildrenNames');
|
|
46
45
|
let arr = [];
|
|
47
46
|
children.forEach((x) => {
|
|
48
|
-
console.log('ENTROU NO forEach DO getChildrenNames - VALOR DE x: ', x);
|
|
49
47
|
if (!x.props)
|
|
50
48
|
return;
|
|
51
49
|
if (x.props.children) {
|
|
@@ -74,14 +72,13 @@ function RequiredCheckBoxGroup(_a) {
|
|
|
74
72
|
if (nameValue) {
|
|
75
73
|
canContinue = true;
|
|
76
74
|
}
|
|
77
|
-
console.log(
|
|
78
|
-
console.log(
|
|
79
|
-
console.log(
|
|
80
|
-
console.log(
|
|
75
|
+
console.log('todos os value', context.formGetValues());
|
|
76
|
+
console.log('Erro validação');
|
|
77
|
+
console.log('names', names);
|
|
78
|
+
console.log('x', x);
|
|
81
79
|
console.log('i', i);
|
|
82
|
-
console.log(
|
|
80
|
+
console.log('nameValue', nameValue);
|
|
83
81
|
console.log('Erro validação');
|
|
84
|
-
console.log(`ENTROU NO forEach DO return - VALOR DE names: ${names} - VALOR ATUAL: ${x} - INDEX: ${i}`);
|
|
85
82
|
});
|
|
86
83
|
if (!canContinue)
|
|
87
84
|
return customText;
|
|
@@ -284,6 +284,14 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
284
284
|
item = normalize ? item.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : item;
|
|
285
285
|
return removeQuotes ? `${item}` : `"${item}"`;
|
|
286
286
|
}
|
|
287
|
+
else if (typeof x[k] === 'object' &&
|
|
288
|
+
!Array.isArray(x[k]) &&
|
|
289
|
+
x[k] !== null) {
|
|
290
|
+
let strItemAsObject = transformArrayObjectInString(x[k]).slice(1, -1); // k: label (Ex.: jsNaturezaEvento)
|
|
291
|
+
let item = csvUpper && !csvExcludeUpper.includes(k) ? strItemAsObject.toUpperCase() : strItemAsObject;
|
|
292
|
+
item = normalize ? item.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : item;
|
|
293
|
+
return removeQuotes ? `${item}` : `"${item}"`;
|
|
294
|
+
}
|
|
287
295
|
return x[k];
|
|
288
296
|
})
|
|
289
297
|
.join(',');
|
|
@@ -298,6 +306,27 @@ function Table({ columns, fetchFunc, emptyMsg = {
|
|
|
298
306
|
link.click();
|
|
299
307
|
}
|
|
300
308
|
}, [list]);
|
|
309
|
+
function transformArrayObjectInString(o) {
|
|
310
|
+
let arrString = [];
|
|
311
|
+
if (typeof o === 'object' &&
|
|
312
|
+
!Array.isArray(o) &&
|
|
313
|
+
o !== null) {
|
|
314
|
+
for (let [key, value] of Object.entries(o)) {
|
|
315
|
+
if (typeof value === 'object' &&
|
|
316
|
+
!Array.isArray(value) &&
|
|
317
|
+
value !== null) {
|
|
318
|
+
arrString.push(key + ": " + transformArrayObjectInString(value));
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
if (value) { // Is true
|
|
322
|
+
arrString.push(key);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return "[" + arrString.join(' - ') + "]";
|
|
328
|
+
}
|
|
329
|
+
;
|
|
301
330
|
const downloadCSVAll = (0, react_1.useCallback)((e) => {
|
|
302
331
|
e.preventDefault();
|
|
303
332
|
if (list.length <= 0)
|