@formique/semantq 1.0.10 → 1.0.12
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/astToFormique.js +16 -5
- package/package.json +1 -1
package/astToFormique.js
CHANGED
|
@@ -771,14 +771,25 @@ buildDynamicSingleSelect(node, rawFieldName) {
|
|
|
771
771
|
|
|
772
772
|
// Handle special case for 'sendTo' which might use a structure like OptionList
|
|
773
773
|
if (key === 'sendTo') {
|
|
774
|
-
|
|
774
|
+
let result;
|
|
775
|
+
|
|
776
|
+
// 1. Handle Array/OptionList (Preferred path)
|
|
775
777
|
if (node.value && Array.isArray(node.value.values)) {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
+
// Map the array of option objects to an array of email strings
|
|
779
|
+
result = node.value.values.map(option => option.value);
|
|
778
780
|
} else {
|
|
779
|
-
// Fallback
|
|
780
|
-
|
|
781
|
+
// 2. Handle Fallback (Single string or null)
|
|
782
|
+
// Ensure 'val' is treated as a single-element array if it exists.
|
|
783
|
+
if (val) {
|
|
784
|
+
// SUEGICAL FIX: Wrap the single email string in an array.
|
|
785
|
+
result = [val];
|
|
786
|
+
} else {
|
|
787
|
+
result = []; // Use an empty array if no value is present
|
|
788
|
+
}
|
|
781
789
|
}
|
|
790
|
+
|
|
791
|
+
// 3. Assign the final array result
|
|
792
|
+
this.formSettings[key] = result;
|
|
782
793
|
} else
|
|
783
794
|
{
|
|
784
795
|
// All other custom form settings
|