@rsuci/shared-form-components 1.0.10 → 1.0.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RosterPanel.d.ts","sourceRoot":"","sources":["../../../src/components/roster/RosterPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"RosterPanel.d.ts","sourceRoot":"","sources":["../../../src/components/roster/RosterPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAyH3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -18,11 +18,29 @@ const RosterPanel = ({ option, rosterVariables, value, onChange, disabled, showC
|
|
|
18
18
|
const uniqueCode = `${option.code}_${rosterVar.code}`;
|
|
19
19
|
// Récupérer les options (format: "01#Option1|02#Option2|...")
|
|
20
20
|
const optionsValue = rosterVar.valeurDefaut || rosterVar.valeur;
|
|
21
|
+
// Déterminer le type de la variable avec fallback intelligent
|
|
22
|
+
// Si typeCode est absent mais qu'on a des options au format "##|##", c'est probablement un RADIO
|
|
23
|
+
let effectiveTypeCode = rosterVar.typeCode;
|
|
24
|
+
if (!effectiveTypeCode && optionsValue && typeof optionsValue === 'string') {
|
|
25
|
+
// Vérifier si c'est un format d'options : "01#Label1|02#Label2"
|
|
26
|
+
if (optionsValue.includes('#') && optionsValue.includes('|')) {
|
|
27
|
+
// Si peu d'options (2-3), probablement RADIO, sinon LISTE
|
|
28
|
+
const optionsCount = optionsValue.split('|').length;
|
|
29
|
+
effectiveTypeCode = optionsCount <= 4 ? 'RADIO' : 'LISTE';
|
|
30
|
+
console.log(`[RosterPanel] Fallback typeCode pour ${rosterVar.code}: ${effectiveTypeCode} (${optionsCount} options)`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
effectiveTypeCode = 'STRING';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (!effectiveTypeCode) {
|
|
37
|
+
effectiveTypeCode = 'STRING';
|
|
38
|
+
}
|
|
21
39
|
const variable = {
|
|
22
40
|
id: 0, // Pas d'ID propre pour les variables roster
|
|
23
41
|
code: uniqueCode, // Code unique par panel
|
|
24
42
|
designation: rosterVar.designation || rosterVar.code,
|
|
25
|
-
typeCode:
|
|
43
|
+
typeCode: effectiveTypeCode, // Utiliser le type effectif (du backend ou fallback)
|
|
26
44
|
groupeCode: '',
|
|
27
45
|
ordre: rosterVar.ordre,
|
|
28
46
|
estObligatoire: rosterVar.estObligatoire || false,
|
package/package.json
CHANGED