@ngx-smz/core 21.0.1 → 21.0.2

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.
@@ -6261,7 +6261,9 @@ class FormGroupComponent {
6261
6261
  this.viewdata.updateFormValues();
6262
6262
  // this.viewdata.isValid = this.viewdata.form.valid;
6263
6263
  const runCustomFunctionsOnLoad = this.config.behaviors?.runCustomFunctionsOnLoad ?? false;
6264
- // Esse if garante a execução do custom behaviour na primiera inicialização, já que com o adiamento feito no status changes abaixo,
6264
+ let isStatusChangesEmitted = false;
6265
+ let data = null;
6266
+ // Esse if garante a execução do custom behaviour na primeira inicialização, já que com o adiamento feito no status changes abaixo,
6265
6267
  // ele não passa mais por la
6266
6268
  if (runCustomFunctionsOnLoad) {
6267
6269
  this.checkCustomFunctions();
@@ -6269,7 +6271,19 @@ class FormGroupComponent {
6269
6271
  }
6270
6272
  else {
6271
6273
  if (!this.config.behaviors?.skipEmitChangesOnLoad) {
6272
- this.statusChanges.emit(this.getData());
6274
+ isStatusChangesEmitted = true;
6275
+ data = this.getData();
6276
+ this.statusChanges.emit(data);
6277
+ }
6278
+ }
6279
+ if (this.config.behaviors?.emitAllOutputsOnLoad) {
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);
6273
6287
  }
6274
6288
  }
6275
6289
  this.callVisibilityFunctions();
@@ -26953,6 +26967,10 @@ class SmzFormBuilder {
26953
26967
  this.formState.behaviors.runCustomFunctionsOnLoad = true;
26954
26968
  return this;
26955
26969
  }
26970
+ emitAllOutputsOnLoad() {
26971
+ this.formState.behaviors.emitAllOutputsOnLoad = true;
26972
+ return this;
26973
+ }
26956
26974
  setCustomBehavior(callback) {
26957
26975
  this.formState.functions.customBehavior = callback;
26958
26976
  return this;