@rsuci/shared-form-components 1.0.97 → 1.0.98
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.
|
@@ -286,7 +286,7 @@ const FormRendererInner = () => {
|
|
|
286
286
|
const responseKey = currentGroup.estMultiple && currentInstance?.numeroInstance
|
|
287
287
|
? `${variable.code}_${currentInstance.numeroInstance}`
|
|
288
288
|
: variable.code;
|
|
289
|
-
const response = responses[responseKey];
|
|
289
|
+
const response = responses[responseKey] || (!currentGroup.estMultiple ? responsesByVariableCode.get(variable.code) : undefined);
|
|
290
290
|
const optionsSource = (variable.proprietes?.valeur || variable.valeurDefaut);
|
|
291
291
|
const hasValue = response && VariableValueConverter.hasRequiredValue(variable.typeCode, response.valeur, optionsSource);
|
|
292
292
|
if (!hasValue) {
|
|
@@ -294,7 +294,7 @@ const FormRendererInner = () => {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
return true;
|
|
297
|
-
}, [currentGroup, currentInstance, responses, isVariableVisible, isVariableFilteredByMode, validateGroupForInstance, mode]);
|
|
297
|
+
}, [currentGroup, currentInstance, responses, isVariableVisible, isVariableFilteredByMode, validateGroupForInstance, responsesByVariableCode, mode]);
|
|
298
298
|
// Mode consultation (pas de validation, navigation libre)
|
|
299
299
|
const isConsultationMode = features?.consultationMode || false;
|
|
300
300
|
// En mode consultation, navigation libre sans validation des champs obligatoires
|
|
@@ -325,7 +325,7 @@ const FormRendererInner = () => {
|
|
|
325
325
|
continue;
|
|
326
326
|
if (!visibleCodes.has(variable.code))
|
|
327
327
|
continue;
|
|
328
|
-
const response = responses[variable.code];
|
|
328
|
+
const response = responses[variable.code] || responsesByVariableCode.get(variable.code);
|
|
329
329
|
const optionsSource = (variable.proprietes?.valeur || variable.valeurDefaut);
|
|
330
330
|
const hasValue = response && VariableValueConverter.hasRequiredValue(variable.typeCode, response.valeur, optionsSource);
|
|
331
331
|
if (!hasValue)
|
|
@@ -333,7 +333,7 @@ const FormRendererInner = () => {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
return true;
|
|
336
|
-
}, [groupes, responses, getVisibleVariables, validateGroupForInstance, isVariableFilteredByMode]);
|
|
336
|
+
}, [groupes, responses, getVisibleVariables, validateGroupForInstance, isVariableFilteredByMode, responsesByVariableCode]);
|
|
337
337
|
const handleNext = () => {
|
|
338
338
|
// En mode consultation, navigation libre
|
|
339
339
|
if (isConsultationMode) {
|
|
@@ -406,7 +406,7 @@ const FormRendererInner = () => {
|
|
|
406
406
|
continue;
|
|
407
407
|
if (!visibleCodes.has(variable.code))
|
|
408
408
|
continue;
|
|
409
|
-
const response = responses[variable.code];
|
|
409
|
+
const response = responses[variable.code] || responsesByVariableCode.get(variable.code);
|
|
410
410
|
const optionsSource = (variable.proprietes?.valeur || variable.valeurDefaut);
|
|
411
411
|
const hasValue = response && VariableValueConverter.hasRequiredValue(variable.typeCode, response.valeur, optionsSource);
|
|
412
412
|
if (!hasValue) {
|
package/package.json
CHANGED