@visns-studio/visns-components 4.0.5 → 4.0.7
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.
|
@@ -138,7 +138,6 @@ function TableFilter({
|
|
|
138
138
|
</li>
|
|
139
139
|
);
|
|
140
140
|
} else {
|
|
141
|
-
console.info(d.class);
|
|
142
141
|
return (
|
|
143
142
|
<li>
|
|
144
143
|
<a
|
|
@@ -161,7 +160,6 @@ function TableFilter({
|
|
|
161
160
|
>
|
|
162
161
|
{d.children.map((child, key) => (
|
|
163
162
|
<li key={`table-filter-child-${d.id}-${key}`}>
|
|
164
|
-
{console.info(child.class)}
|
|
165
163
|
<a
|
|
166
164
|
className={childClass(child)}
|
|
167
165
|
data-id={child.id}
|
|
@@ -34,16 +34,13 @@ const updateField = (fields, name, value) => {
|
|
|
34
34
|
const renderValue = (field, data) => {
|
|
35
35
|
switch (field.type) {
|
|
36
36
|
case 'datetime':
|
|
37
|
-
return field.value && moment(field.value).isValid()
|
|
38
|
-
? moment(field.value).toDate()
|
|
39
|
-
: '';
|
|
40
37
|
case 'date':
|
|
41
38
|
return field.value && moment(field.value).isValid()
|
|
42
39
|
? moment(field.value).toDate()
|
|
43
40
|
: '';
|
|
41
|
+
|
|
44
42
|
case 'dynamicdata':
|
|
45
43
|
if (field.dynamicfield && typeof field.dynamicfield === 'string') {
|
|
46
|
-
// Split the dynamicfield string into table and key parts using the "::" delimiter
|
|
47
44
|
const [table, key] = field.dynamicfield.split('::');
|
|
48
45
|
|
|
49
46
|
if (table && key) {
|
|
@@ -51,6 +48,9 @@ const renderValue = (field, data) => {
|
|
|
51
48
|
case 'opportunities':
|
|
52
49
|
return data[table][key];
|
|
53
50
|
default:
|
|
51
|
+
if (key === 'surname' && !data[key]) {
|
|
52
|
+
return data['lastname'] || '';
|
|
53
|
+
}
|
|
54
54
|
return data[key];
|
|
55
55
|
}
|
|
56
56
|
} else {
|
|
@@ -67,21 +67,12 @@ const renderValue = (field, data) => {
|
|
|
67
67
|
return field.value && moment(field.value).isValid()
|
|
68
68
|
? moment(field.value).toDate()
|
|
69
69
|
: '';
|
|
70
|
+
|
|
70
71
|
default:
|
|
71
72
|
return field.value || '';
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
|
|
75
|
-
const slugify = (text) => {
|
|
76
|
-
return text
|
|
77
|
-
.toString()
|
|
78
|
-
.toLowerCase()
|
|
79
|
-
.trim()
|
|
80
|
-
.replace(/\s+/g, '-') // Replace spaces with -
|
|
81
|
-
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
|
82
|
-
.replace(/\-\-+/g, '-'); // Replace multiple - with single -
|
|
83
|
-
};
|
|
84
|
-
|
|
85
76
|
const GenericDynamic = ({
|
|
86
77
|
data,
|
|
87
78
|
fetchData,
|
package/package.json
CHANGED