iptdevs-design-system 3.1.937 → 3.1.938

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.
@@ -28,7 +28,8 @@ import * as i4 from 'primeng/skeleton';
28
28
  import { SkeletonModule } from 'primeng/skeleton';
29
29
  import * as i6$1 from 'primeng/button';
30
30
  import { ButtonModule } from 'primeng/button';
31
- import { BehaviorSubject, finalize, map } from 'rxjs';
31
+ import { BehaviorSubject, finalize, Subject, map } from 'rxjs';
32
+ import { takeUntil } from 'rxjs/operators';
32
33
  import * as i11 from 'primeng/table';
33
34
  import { TableModule } from 'primeng/table';
34
35
  import * as i5$1 from '@angular/material/checkbox';
@@ -4778,6 +4779,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
4778
4779
  super();
4779
4780
  this.fb = fb;
4780
4781
  this.changeStepEvent = new EventEmitter();
4782
+ this.destroy$ = new Subject();
4781
4783
  this.errorMessage = 'Faltan campos por llenar.';
4782
4784
  this.hasErrors = false;
4783
4785
  this.genders = [];
@@ -4801,6 +4803,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
4801
4803
  }
4802
4804
  }
4803
4805
  }
4806
+ ngOnDestroy() {
4807
+ this.destroy$.next();
4808
+ this.destroy$.complete();
4809
+ }
4804
4810
  setDataFromUserHistory() {
4805
4811
  this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
4806
4812
  this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
@@ -4925,7 +4931,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
4925
4931
  });
4926
4932
  }
4927
4933
  getParameters() {
4928
- this.idTypes = this.parametersAll?.TypeIdCardByCountryCol;
4934
+ // this.idTypes =this.parametersAll?.TypeIdCardByCountryCol;
4929
4935
  this.indicatives = this.parametersAll?.indicatives;
4930
4936
  this.countries = this.parametersAll?.country;
4931
4937
  this.stratums = this.parametersAll?.stratum;
@@ -5050,18 +5056,19 @@ class CodFormStepTwoComponent extends CodFormSteps {
5050
5056
  }
5051
5057
  }
5052
5058
  trackStudentIdCardChanges() {
5053
- this.codFormStepTwo.controls['student_id_card'].valueChanges.subscribe(value => {
5059
+ this.codFormStepTwo.controls['student_id_card'].valueChanges.pipe(takeUntil(this.destroy$)).subscribe(value => {
5060
+ console.log('student_id_card value:', value); // Depuración
5054
5061
  if (value && /[a-zA-Z]/.test(value)) {
5055
- // El valor contiene letras, eliminar registros de idTypes en las posiciones especificadas
5056
- this.filterIdTypes([0, 1, 2, 7]); // Cambia [0, 2] por las posiciones que desees
5062
+ console.log('Contains letters, filtering idTypes'); // Depuración
5063
+ this.filterIdTypes([0, 1, 2, 7]);
5057
5064
  }
5058
5065
  else {
5059
- // El valor contiene solo números o está vacío, restaurar idTypes original
5066
+ console.log('No letters, restoring idTypes'); // Depuración
5060
5067
  this.idTypes = this.parametersAll?.TypeIdCardByCountryCol || [];
5061
5068
  }
5069
+ console.log('Current idTypes:', this.idTypes); // Depuración
5062
5070
  });
5063
5071
  }
5064
- // Método para filtrar idTypes eliminando registros en las posiciones especificadas
5065
5072
  filterIdTypes(positionsToRemove) {
5066
5073
  if (this.idTypes && Array.isArray(this.idTypes)) {
5067
5074
  // Crear una copia de idTypes para evitar mutar el original directamente