mn-angular-lib 2.0.51 → 2.0.52

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.
@@ -5,6 +5,7 @@ import { CommonModule } from "@angular/common";
5
5
  import { ActionStyle, BackdropMode, CloseMode, ConfirmationTone, FieldKind, KeyboardMode, MN_HAPTICS, MN_MODAL_ACTION_ICONS, MODAL_ACTION_ICON_SIZE, ModalCloseReason, ModalKind, ModalSize, NavigationDirection, SubmitMode, WizardFlowMode, defaultIconForStyle } from "mn-angular-lib/modal-core";
6
6
  import * as i2 from "@angular/forms";
7
7
  import { FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from "@angular/forms";
8
+ import { merge } from "rxjs";
8
9
  import { MnButton } from "mn-angular-lib/button";
9
10
  import { MnCheckbox, MnDatetime, MnFileInput, MnInputField, MnMultiSelect, MnSelect, MnTextarea } from "mn-angular-lib/forms";
10
11
  import { MN_IN_MODAL, MnLanguageService, lucideIcons } from "mn-angular-lib/core";
@@ -1161,7 +1162,7 @@ var MnWizardBodyComponent = class MnWizardBodyComponent {
1161
1162
  if (!this.canNavigateToStep(step)) return;
1162
1163
  if (step.id === this.currentStepId) return;
1163
1164
  const formBody = this.getCurrentFormBody();
1164
- if (formBody && formBody.form.invalid) {
1165
+ if (formBody && (formBody.form.invalid || formBody.hasFormErrors)) {
1165
1166
  formBody.form.markAllAsTouched();
1166
1167
  return;
1167
1168
  }
@@ -1244,7 +1245,7 @@ var MnWizardBodyComponent = class MnWizardBodyComponent {
1244
1245
  if (!this.canGoNext) return;
1245
1246
  const currentStep = this.currentStep;
1246
1247
  const formBody = this.getCurrentFormBody();
1247
- if (formBody && formBody.form.invalid) {
1248
+ if (formBody && (formBody.form.invalid || formBody.hasFormErrors)) {
1248
1249
  formBody.form.markAllAsTouched();
1249
1250
  return;
1250
1251
  }
@@ -1276,9 +1277,10 @@ var MnWizardBodyComponent = class MnWizardBodyComponent {
1276
1277
  this.statusSubscription = void 0;
1277
1278
  const formBody = this.getCurrentFormBody();
1278
1279
  if (formBody && formBody.form) {
1279
- this.isCurrentStepValid = formBody.form.valid;
1280
- this.statusSubscription = formBody.form.statusChanges.subscribe(() => {
1281
- this.isCurrentStepValid = formBody.form.valid;
1280
+ const isValid = () => formBody.form.valid && !formBody.hasFormErrors;
1281
+ this.isCurrentStepValid = isValid();
1282
+ this.statusSubscription = merge(formBody.form.statusChanges, formBody.form.valueChanges).subscribe(() => {
1283
+ this.isCurrentStepValid = isValid();
1282
1284
  this.cdr.detectChanges();
1283
1285
  });
1284
1286
  } else this.isCurrentStepValid = true;
@@ -1306,7 +1308,7 @@ var MnWizardBodyComponent = class MnWizardBodyComponent {
1306
1308
  if (this.isCompleting) return;
1307
1309
  const currentStep = this.currentStep;
1308
1310
  const formBody = this.getCurrentFormBody();
1309
- if (formBody && formBody.form.invalid) {
1311
+ if (formBody && (formBody.form.invalid || formBody.hasFormErrors)) {
1310
1312
  formBody.form.markAllAsTouched();
1311
1313
  return;
1312
1314
  }