@visns-studio/visns-components 4.10.20 → 4.10.21
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/package.json
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
77
77
|
},
|
|
78
78
|
"name": "@visns-studio/visns-components",
|
|
79
|
-
"version": "4.10.
|
|
79
|
+
"version": "4.10.21",
|
|
80
80
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
81
81
|
"main": "src/index.js",
|
|
82
82
|
"files": [
|
|
@@ -629,53 +629,34 @@ const GenericDynamic = ({
|
|
|
629
629
|
};
|
|
630
630
|
|
|
631
631
|
useEffect(() => {
|
|
632
|
-
if (data[type]
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
if (lastForm && typeof lastForm === 'object') {
|
|
638
|
-
Object.entries(lastForm).forEach(([key, field]) => {
|
|
639
|
-
if (field && field.required) {
|
|
640
|
-
if (
|
|
641
|
-
field.required === 'yes' ||
|
|
642
|
-
field.required === 'no'
|
|
643
|
-
) {
|
|
644
|
-
lastForm[key].required =
|
|
645
|
-
field.required === 'yes';
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
setActiveForm(lastForm);
|
|
651
|
-
setActiveFormKey(data[type].length - 1);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
} else {
|
|
655
|
-
let formData = data[type][0] ? data[type][0] : data[type];
|
|
632
|
+
if (!data[type] || data[type].length === 0) {
|
|
633
|
+
setActiveForm({});
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
656
636
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
637
|
+
const formData = multiple
|
|
638
|
+
? data[type][data[type].length - 1]
|
|
639
|
+
: data[type].hasOwnProperty('created_at')
|
|
640
|
+
? data[type][0] || data[type]
|
|
641
|
+
: data[type];
|
|
642
|
+
|
|
643
|
+
if (
|
|
644
|
+
multiple &&
|
|
645
|
+
templateStatus &&
|
|
646
|
+
formData &&
|
|
647
|
+
typeof formData === 'object'
|
|
648
|
+
) {
|
|
649
|
+
// Process the last form for required fields
|
|
650
|
+
Object.entries(formData).forEach(([key, field]) => {
|
|
651
|
+
if (field?.required) {
|
|
652
|
+
field.required = field.required === 'yes';
|
|
673
653
|
}
|
|
674
|
-
}
|
|
675
|
-
} else {
|
|
676
|
-
setActiveForm({});
|
|
654
|
+
});
|
|
677
655
|
}
|
|
678
|
-
|
|
656
|
+
|
|
657
|
+
setActiveForm(formData);
|
|
658
|
+
setActiveFormKey(0);
|
|
659
|
+
}, [data, type, multiple, templateStatus]);
|
|
679
660
|
|
|
680
661
|
useEffect(() => {
|
|
681
662
|
if (data[type] && data[type].length > 0) {
|