@suntelecoms/ngx-dynamic-form 1.16.2 → 1.16.3

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/README.md CHANGED
@@ -2571,6 +2571,9 @@ export type { StepGuard } // { url, method?, withFormValues?, resultKey?, e
2571
2571
 
2572
2572
  ## Changelog
2573
2573
 
2574
+ ### v1.16.3
2575
+ - **`questionnaire` masqué par `showWhen`** : désactivé comme une liste répétable — ses questions obligatoires ne bloquent plus l'étape, et la valeur envoyée est `null` (plus de réponses périmées). Permet plusieurs questionnaires dans une étape, un par cas (ex. selon le risque).
2576
+
2574
2577
  ### v1.16.2
2575
2578
  - **`calcul`** : une valeur seule entourée d'espaces (`" {{assureCapital}} "`) garde son type (nombre…) au lieu de partir en texte.
2576
2579
  - **Form Builder — Aperçu** : zone « Valeurs de test des champs cachés » pour simuler les valeurs remplies par l'application (ex. `risque`) et voir les champs affichés par `showWhen` ; jamais enregistrées.
@@ -5323,7 +5323,7 @@ class DynamicFormComponent {
5323
5323
  }
5324
5324
  /**
5325
5325
  * Règles de saisie (valueWhen / disabledWhen / entrée rules) : valeurs imposées (seulement si elles
5326
- * diffèrent : pas de boucle), verrouillage ; listes répétables masquées désactivées (non validées).
5326
+ * diffèrent : pas de boucle), verrouillage ; listes répétables et questionnaires masqués désactivés (non validés).
5327
5327
  */
5328
5328
  applyRules() {
5329
5329
  if (this.applyingRules || !this.form)
@@ -5351,7 +5351,8 @@ class DynamicFormComponent {
5351
5351
  }
5352
5352
  this.locked = verrous;
5353
5353
  for (const field of this.fields) {
5354
- if (field.type !== 'repeater' || field.disabled || verrous.has(field.key))
5354
+ // Listes répétables et questionnaires masqués : désactivés (leurs validateurs ne bloquent pas l'envoi).
5355
+ if (!['repeater', 'questionnaire'].includes(field.type) || field.disabled || verrous.has(field.key))
5355
5356
  continue;
5356
5357
  const c = this.form.get(field.key);
5357
5358
  const visible = this.isVisible(field);
@@ -5374,6 +5375,8 @@ class DynamicFormComponent {
5374
5375
  for (const field of this.fields) {
5375
5376
  if (field.type === 'repeater' && !this.isVisible(field))
5376
5377
  v[field.key] = [];
5378
+ if (field.type === 'questionnaire' && !this.isVisible(field))
5379
+ v[field.key] = null;
5377
5380
  }
5378
5381
  const out = prepareSubmit(this.fields, v, { excluded: this.excludeFromSubmit, locked });
5379
5382
  return this.transformOut ? this.transformOut(out) : out;
@@ -5675,7 +5678,7 @@ class StepperFormComponent {
5675
5678
  this.locked = verrous;
5676
5679
  this.steps.forEach((step, i) => {
5677
5680
  for (const field of step.fields) {
5678
- if (field.type !== 'repeater' || field.disabled || verrous.has(field.key))
5681
+ if (!['repeater', 'questionnaire'].includes(field.type) || field.disabled || verrous.has(field.key))
5679
5682
  continue;
5680
5683
  const c = this.stepForms[i].get(field.key);
5681
5684
  const visible = this.isVisible(field, this.stepForms[i]);
@@ -5700,6 +5703,8 @@ class StepperFormComponent {
5700
5703
  for (const field of step.fields) {
5701
5704
  if (field.type === 'repeater' && !this.isVisible(field, this.stepForms[i]))
5702
5705
  v[field.key] = [];
5706
+ if (field.type === 'questionnaire' && !this.isVisible(field, this.stepForms[i]))
5707
+ v[field.key] = null;
5703
5708
  }
5704
5709
  });
5705
5710
  const out = prepareSubmit(this.allFields(), v, { excluded: this.excludeFromSubmit, locked });