@ixo/editor 3.4.3 → 3.6.0
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.
|
@@ -25606,15 +25606,19 @@ var ClaimFlowDetail = ({
|
|
|
25606
25606
|
const [profilesByDid, setProfilesByDid] = useState101({});
|
|
25607
25607
|
const [isServiceAgentAuthorized, setIsServiceAgentAuthorized] = useState101(false);
|
|
25608
25608
|
const [authChecking, setAuthChecking] = useState101(true);
|
|
25609
|
+
const [surveyComplete, setSurveyComplete] = useState101(false);
|
|
25610
|
+
const checkSurveyCompleteness = useCallback79((model) => {
|
|
25611
|
+
const allRequired = model.getAllQuestions(true).filter((q) => q.isRequired);
|
|
25612
|
+
const isComplete = allRequired.length === 0 || allRequired.every((q) => !q.isEmpty());
|
|
25613
|
+
setSurveyComplete(isComplete);
|
|
25614
|
+
}, []);
|
|
25609
25615
|
const surveyModel = useMemo96(() => {
|
|
25610
25616
|
if (!surveyJson) return null;
|
|
25611
25617
|
const model = new SurveyModel10(surveyJson);
|
|
25612
25618
|
model.applyTheme(surveyTheme);
|
|
25613
25619
|
model.showQuestionNumbers = "off";
|
|
25614
|
-
model.questionsOnPageMode = "singlePage";
|
|
25615
25620
|
if (provideSigningHandler) {
|
|
25616
25621
|
model.showCompleteButton = false;
|
|
25617
|
-
model.showNavigationButtons = "none";
|
|
25618
25622
|
model.showCompletedPage = false;
|
|
25619
25623
|
const reviewEl = model.getQuestionByName("reviewAndSubmit") || model.getPanelByName("reviewAndSubmit");
|
|
25620
25624
|
if (reviewEl) reviewEl.visible = false;
|
|
@@ -25629,8 +25633,22 @@ var ClaimFlowDetail = ({
|
|
|
25629
25633
|
}, [registerRuntimeInputs, adminAddress, surveyJson]);
|
|
25630
25634
|
useEffect82(() => {
|
|
25631
25635
|
if (!unlockSigning) return;
|
|
25632
|
-
unlockSigning(isServiceAgentAuthorized && !!surveyModel && !!adminAddress);
|
|
25633
|
-
}, [unlockSigning, isServiceAgentAuthorized, surveyModel, adminAddress]);
|
|
25636
|
+
unlockSigning(isServiceAgentAuthorized && !!surveyModel && !!adminAddress && surveyComplete);
|
|
25637
|
+
}, [unlockSigning, isServiceAgentAuthorized, surveyModel, adminAddress, surveyComplete]);
|
|
25638
|
+
useEffect82(() => {
|
|
25639
|
+
if (!surveyModel) {
|
|
25640
|
+
setSurveyComplete(false);
|
|
25641
|
+
return;
|
|
25642
|
+
}
|
|
25643
|
+
const handler = () => checkSurveyCompleteness(surveyModel);
|
|
25644
|
+
surveyModel.onValueChanged.add(handler);
|
|
25645
|
+
surveyModel.onCurrentPageChanged.add(handler);
|
|
25646
|
+
checkSurveyCompleteness(surveyModel);
|
|
25647
|
+
return () => {
|
|
25648
|
+
surveyModel.onValueChanged.remove(handler);
|
|
25649
|
+
surveyModel.onCurrentPageChanged.remove(handler);
|
|
25650
|
+
};
|
|
25651
|
+
}, [surveyModel, checkSurveyCompleteness]);
|
|
25634
25652
|
useEffect82(() => {
|
|
25635
25653
|
if (!provideSigningHandler || !surveyModel) return;
|
|
25636
25654
|
provideSigningHandler(async () => {
|
|
@@ -34508,4 +34526,4 @@ export {
|
|
|
34508
34526
|
getExtraSlashMenuItems,
|
|
34509
34527
|
useCreateIxoEditor
|
|
34510
34528
|
};
|
|
34511
|
-
//# sourceMappingURL=chunk-
|
|
34529
|
+
//# sourceMappingURL=chunk-NPYGDBVY.mjs.map
|