@fuentis/phoenix-ui 0.0.9-alpha.525 → 0.0.9-alpha.526

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.
@@ -3903,11 +3903,8 @@ class MetaFormAbstract {
3903
3903
  if (changes['metaFormControls'] ||
3904
3904
  changes['metaFormValues'] ||
3905
3905
  changes['disableForm']) {
3906
- if (!this.metaForm) {
3907
- // Fallback: if caller forgets to pass metaForm, create one.
3908
- this.metaForm = this.fb.group({});
3909
- this.rewireFormSubscription();
3910
- }
3906
+ if (!this.metaForm)
3907
+ return;
3911
3908
  this.syncForm();
3912
3909
  }
3913
3910
  }
@@ -3919,8 +3916,7 @@ class MetaFormAbstract {
3919
3916
  if (controls)
3920
3917
  this.metaFormControls = controls;
3921
3918
  if (!this.metaForm) {
3922
- this.metaForm = this.fb.group({});
3923
- this.rewireFormSubscription();
3919
+ throw new Error('[MetaFormAbstract] metaForm input is required. Parent must pass [metaForm].');
3924
3920
  }
3925
3921
  this.syncForm();
3926
3922
  }
@@ -3951,6 +3947,10 @@ class MetaFormAbstract {
3951
3947
  this.bindDependenciesIfNeeded(flatControls);
3952
3948
  // 5) Notify that the form is ready
3953
3949
  this.metaService.setFormBuildCompletition(true);
3950
+ // 6) Emit one stable status update AFTER the current CD cycle
3951
+ queueMicrotask(() => {
3952
+ this.metaForm.updateValueAndValidity({ emitEvent: true });
3953
+ });
3954
3954
  }
3955
3955
  /**
3956
3956
  * Supports both:
@@ -4064,7 +4064,9 @@ class MetaFormAbstract {
4064
4064
  emitEvent: false,
4065
4065
  });
4066
4066
  // Recompute the parent form validity so UI can enable Save immediately.
4067
- this.metaForm.updateValueAndValidity({ emitEvent: false });
4067
+ queueMicrotask(() => {
4068
+ this.metaForm.updateValueAndValidity({ emitEvent: true });
4069
+ });
4068
4070
  });
4069
4071
  this.clearServerErrorSubs.set(key, sub);
4070
4072
  }