@apia/execution 4.0.41 → 4.0.42
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/index.js +30 -7
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1062,10 +1062,16 @@ const setAjaxFormResponse = async (execution, response) => {
|
|
|
1062
1062
|
)) {
|
|
1063
1063
|
apiField.setProperty(
|
|
1064
1064
|
"possibleValue",
|
|
1065
|
-
items.map((current) =>
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1065
|
+
items.map((current) => {
|
|
1066
|
+
const v = current.v;
|
|
1067
|
+
const l = current.text;
|
|
1068
|
+
const value = typeof v === "boolean" ? String(v) : v;
|
|
1069
|
+
const label = typeof l === "boolean" ? String(l) : l;
|
|
1070
|
+
return {
|
|
1071
|
+
value,
|
|
1072
|
+
label
|
|
1073
|
+
};
|
|
1074
|
+
})
|
|
1069
1075
|
);
|
|
1070
1076
|
}
|
|
1071
1077
|
}
|
|
@@ -1125,7 +1131,15 @@ const setAjaxFormResponse = async (execution, response) => {
|
|
|
1125
1131
|
const prop = arrayOrArray(ajaxProps[c]?.f);
|
|
1126
1132
|
for (let p = 0; p < prop.length; p += 1) {
|
|
1127
1133
|
if (prop[p]?.i) {
|
|
1128
|
-
|
|
1134
|
+
if (prop[p]?.i) {
|
|
1135
|
+
if (prop[p]?.v.toLowerCase() === "f") {
|
|
1136
|
+
apiField.setProperty(prop[p]?.i, false);
|
|
1137
|
+
} else if (prop[p]?.v.toLowerCase() === "t") {
|
|
1138
|
+
apiField.setProperty(prop[p]?.i, true);
|
|
1139
|
+
} else {
|
|
1140
|
+
apiField.setProperty(prop[p]?.i, prop[p]?.v);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1129
1143
|
}
|
|
1130
1144
|
}
|
|
1131
1145
|
}
|
|
@@ -1627,7 +1641,13 @@ class FieldWithAttribute extends Field {
|
|
|
1627
1641
|
async getInitialValue({
|
|
1628
1642
|
value
|
|
1629
1643
|
}) {
|
|
1630
|
-
|
|
1644
|
+
if (value === void 0 || value === null) {
|
|
1645
|
+
return this.state.value = "";
|
|
1646
|
+
} else if (typeof value === "boolean") {
|
|
1647
|
+
return this.state.value = String(value);
|
|
1648
|
+
} else {
|
|
1649
|
+
return this.state.value = value;
|
|
1650
|
+
}
|
|
1631
1651
|
}
|
|
1632
1652
|
getValidationState() {
|
|
1633
1653
|
return this.state.validation;
|
|
@@ -1758,7 +1778,7 @@ class FieldWithAttribute extends Field {
|
|
|
1758
1778
|
valueType: this.attribute.valueType,
|
|
1759
1779
|
value: this.state.value
|
|
1760
1780
|
});
|
|
1761
|
-
this.state.value = initialValue
|
|
1781
|
+
this.state.value = initialValue ?? "";
|
|
1762
1782
|
}
|
|
1763
1783
|
}
|
|
1764
1784
|
_lastOnChangeValue = new WeakMap();
|
|
@@ -8616,6 +8636,9 @@ function buildPathSelection(execution, status, form) {
|
|
|
8616
8636
|
})
|
|
8617
8637
|
);
|
|
8618
8638
|
return { ...status, step: void 0, finishedWithError: true };
|
|
8639
|
+
} else if (parsedRes.load?.canClose) {
|
|
8640
|
+
execution.state.executionState = ExecutionState.FINISHED;
|
|
8641
|
+
return buildConfirmMessage(status, parsedRes.load?.text?.content ?? "");
|
|
8619
8642
|
}
|
|
8620
8643
|
return { ...status, step: void 0, finishedWithError: true };
|
|
8621
8644
|
} else {
|