@ngx-smz/core 21.0.1 → 21.0.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.
|
@@ -6261,7 +6261,8 @@ 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
|
-
|
|
6264
|
+
let isStatusChangesEmitted = false;
|
|
6265
|
+
// Esse if garante a execução do custom behaviour na primeira inicialização, já que com o adiamento feito no status changes abaixo,
|
|
6265
6266
|
// ele não passa mais por la
|
|
6266
6267
|
if (runCustomFunctionsOnLoad) {
|
|
6267
6268
|
this.checkCustomFunctions();
|
|
@@ -6269,9 +6270,20 @@ class FormGroupComponent {
|
|
|
6269
6270
|
}
|
|
6270
6271
|
else {
|
|
6271
6272
|
if (!this.config.behaviors?.skipEmitChangesOnLoad) {
|
|
6273
|
+
isStatusChangesEmitted = true;
|
|
6272
6274
|
this.statusChanges.emit(this.getData());
|
|
6273
6275
|
}
|
|
6274
6276
|
}
|
|
6277
|
+
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);
|
|
6286
|
+
}
|
|
6275
6287
|
this.callVisibilityFunctions();
|
|
6276
6288
|
this.callWarningFunctions();
|
|
6277
6289
|
// Esse timeout garante um adiamento no subscribe de status change do form para não ser executado na primeira inicialização
|
|
@@ -26953,6 +26965,10 @@ class SmzFormBuilder {
|
|
|
26953
26965
|
this.formState.behaviors.runCustomFunctionsOnLoad = true;
|
|
26954
26966
|
return this;
|
|
26955
26967
|
}
|
|
26968
|
+
emitAllOutputsOnLoad() {
|
|
26969
|
+
this.formState.behaviors.emitAllOutputsOnLoad = true;
|
|
26970
|
+
return this;
|
|
26971
|
+
}
|
|
26956
26972
|
setCustomBehavior(callback) {
|
|
26957
26973
|
this.formState.functions.customBehavior = callback;
|
|
26958
26974
|
return this;
|