@ngx-smz/core 21.0.3 → 21.0.5

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.
@@ -6262,6 +6262,7 @@ class FormGroupComponent {
6262
6262
  // this.viewdata.isValid = this.viewdata.form.valid;
6263
6263
  const runCustomFunctionsOnLoad = this.config.behaviors?.runCustomFunctionsOnLoad ?? false;
6264
6264
  let isStatusChangesEmitted = false;
6265
+ let data = null;
6265
6266
  // Esse if garante a execução do custom behaviour na primeira inicialização, já que com o adiamento feito no status changes abaixo,
6266
6267
  // ele não passa mais por la
6267
6268
  if (runCustomFunctionsOnLoad) {
@@ -6271,18 +6272,19 @@ class FormGroupComponent {
6271
6272
  else {
6272
6273
  if (!this.config.behaviors?.skipEmitChangesOnLoad) {
6273
6274
  isStatusChangesEmitted = true;
6274
- this.statusChanges.emit(this.getData());
6275
+ data = this.getData();
6276
+ this.statusChanges.emit(data);
6275
6277
  }
6276
6278
  }
6277
6279
  if (this.config.behaviors?.emitAllOutputsOnLoad) {
6278
- setTimeout(() => {
6279
- const data = this.getData();
6280
- this.initialStateChanged.emit(data);
6281
- this.previousStateChanged.emit(data);
6282
- if (!isStatusChangesEmitted) {
6283
- this.statusChanges.emit(data);
6284
- }
6285
- }, 0);
6280
+ if (data == null) {
6281
+ data = this.getData();
6282
+ }
6283
+ this.initialStateChanged.emit(data);
6284
+ this.previousStateChanged.emit(data);
6285
+ if (!isStatusChangesEmitted) {
6286
+ this.statusChanges.emit(data);
6287
+ }
6286
6288
  }
6287
6289
  this.callVisibilityFunctions();
6288
6290
  this.callWarningFunctions();