iptdevs-design-system 3.1.936 → 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 = [];
@@ -4789,6 +4791,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
4789
4791
  this.startLocalStorageWork();
4790
4792
  this.validateErrors();
4791
4793
  this.getParameters();
4794
+ this.trackStudentIdCardChanges();
4792
4795
  if (changes['initialData']) {
4793
4796
  if (this.initialData != null) {
4794
4797
  if (this.initialData.student != null) {
@@ -4800,6 +4803,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
4800
4803
  }
4801
4804
  }
4802
4805
  }
4806
+ ngOnDestroy() {
4807
+ this.destroy$.next();
4808
+ this.destroy$.complete();
4809
+ }
4803
4810
  setDataFromUserHistory() {
4804
4811
  this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
4805
4812
  this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
@@ -4924,7 +4931,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
4924
4931
  });
4925
4932
  }
4926
4933
  getParameters() {
4927
- this.idTypes = this.parametersAll?.TypeIdCardByCountryCol;
4934
+ // this.idTypes =this.parametersAll?.TypeIdCardByCountryCol;
4928
4935
  this.indicatives = this.parametersAll?.indicatives;
4929
4936
  this.countries = this.parametersAll?.country;
4930
4937
  this.stratums = this.parametersAll?.stratum;
@@ -5048,6 +5055,35 @@ class CodFormStepTwoComponent extends CodFormSteps {
5048
5055
  this.codFormStepTwo.controls['civil_status'].setValue(null);
5049
5056
  }
5050
5057
  }
5058
+ trackStudentIdCardChanges() {
5059
+ this.codFormStepTwo.controls['student_id_card'].valueChanges.pipe(takeUntil(this.destroy$)).subscribe(value => {
5060
+ console.log('student_id_card value:', value); // Depuración
5061
+ if (value && /[a-zA-Z]/.test(value)) {
5062
+ console.log('Contains letters, filtering idTypes'); // Depuración
5063
+ this.filterIdTypes([0, 1, 2, 7]);
5064
+ }
5065
+ else {
5066
+ console.log('No letters, restoring idTypes'); // Depuración
5067
+ this.idTypes = this.parametersAll?.TypeIdCardByCountryCol || [];
5068
+ }
5069
+ console.log('Current idTypes:', this.idTypes); // Depuración
5070
+ });
5071
+ }
5072
+ filterIdTypes(positionsToRemove) {
5073
+ if (this.idTypes && Array.isArray(this.idTypes)) {
5074
+ // Crear una copia de idTypes para evitar mutar el original directamente
5075
+ let filteredIdTypes = [...this.idTypes];
5076
+ // Ordenar las posiciones de mayor a menor para evitar problemas al eliminar
5077
+ const sortedPositions = positionsToRemove.sort((a, b) => b - a);
5078
+ // Eliminar registros en las posiciones especificadas
5079
+ sortedPositions.forEach(position => {
5080
+ if (position >= 0 && position < filteredIdTypes.length) {
5081
+ filteredIdTypes.splice(position, 1);
5082
+ }
5083
+ });
5084
+ this.idTypes = filteredIdTypes;
5085
+ }
5086
+ }
5051
5087
  }
5052
5088
  CodFormStepTwoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodFormStepTwoComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
5053
5089
  CodFormStepTwoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodFormStepTwoComponent, selector: "app-cod-form-step-two", inputs: { initialData: "initialData", isEditCod: "isEditCod", parametersAll: "parametersAll" }, outputs: { changeStepEvent: "changeStepEvent" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<form autocomplete=\"off\" [formGroup]=\"codFormStepTwo\" class=\"grid\">\n\n <div class=\"col\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Nombres'\"\n [control]=\"codFormStepTwo.controls['student_name']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['student_id_card_type'].value\"\n [control]=\"codFormStepTwo.controls['student_id_card_type']\"\n [selectCode]=\"codFormStepTwo.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codFormStepTwo.controls['student_id_card_type'].value\"\n [isRequired]=\"true\"\n [data]=\"idTypes\"\n (eventSelect)=\"selectIdType($event)\"\n [defaultText]=\"'Tipo de documento'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['country'].value\"\n [control]=\"codFormStepTwo.controls['country']\"\n [selectCode]=\"codFormStepTwo.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codFormStepTwo.controls['country'].value\"\n (eventSelect)=\"selectCountry($event)\"\n [data]=\"countries\"\n [defaultText]=\"'Pa\u00EDs de residencia'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['city'].value\"\n [control]=\"codFormStepTwo.controls['city']\"\n [selectCode]=\"codFormStepTwo.controls['city'].value === null ? 'Ciudad de residencia' : codFormStepTwo.controls['city'].value\"\n (eventSelect)=\"selectCity($event)\"\n [data]=\"cities\"\n [defaultText]=\"'Ciudad de residencia'\"\n ></ipt-select>\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codFormStepTwo.controls['birthdate']\"\n [placeHolder]=\"'Fecha de nacimiento'\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['gender'].value\"\n [control]=\"codFormStepTwo.controls['gender']\"\n [data]=\"genders\"\n (eventSelect)=\"selectGender($event)\"\n [defaultText]=\"'G\u00E9nero'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['stratum'].value\"\n [control]=\"codFormStepTwo.controls['stratum']\"\n [data]=\"stratums\"\n (eventSelect)=\"selectStratum($event)\"\n [defaultText]=\"'Estrato'\"\n ></ipt-select>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Grado'\"\n [control]=\"codFormStepTwo.controls['grade']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['student_phone_indicative'].value\"\n [control]=\"codFormStepTwo.controls['student_phone_indicative']\"\n [data]=\"indicatives\"\n (eventSelect)=\"selectIndicatives($event)\"\n [defaultText]=\"'Indicativo'\"\n ></ipt-select>\n <ipt-input\n [inputType]=\"'email'\"\n [placeHolder]=\"'Correo electr\u00F3nico'\"\n [control]=\"codFormStepTwo.controls['student_email']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'password'\"\n [placeHolder]=\"'Repetir contrase\u00F1a'\"\n [control]=\"codFormStepTwo.controls['re_password']\"\n ></ipt-input>\n </div>\n\n <div class=\"col\">\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Apellidos'\"\n [control]=\"codFormStepTwo.controls['student_last_name']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'N\u00FAmero de documento'\"\n [control]=\"codFormStepTwo.controls['student_id_card']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['state'].value\"\n [control]=\"codFormStepTwo.controls['state']\"\n [selectCode]=\"codFormStepTwo.controls['state'].value === null ? 'Departamento o estado' : codFormStepTwo.controls['state'].value\"\n [isRequired]=\"true\"\n (eventSelect)=\"selectState($event)\"\n [data]=\"states\"\n [defaultText]=\"'Departamento o estado'\"\n ></ipt-select>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Direcci\u00F3n'\"\n [control]=\"codFormStepTwo.controls['student_address']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'number'\"\n [placeHolder]=\"'Edad'\"\n [control]=\"codFormStepTwo.controls['age']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Nickname'\"\n [control]=\"codFormStepTwo.controls['nickname']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Ocupaci\u00F3n'\"\n [control]=\"codFormStepTwo.controls['student_occupation']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codFormStepTwo.controls['civil_status'].value\"\n [control]=\"codFormStepTwo.controls['civil_status']\"\n [data]=\"civilStatus\"\n (eventSelect)=\"selectCivilStatus($event)\"\n [defaultText]=\"'Estado civil'\"\n ></ipt-select>\n <ipt-input\n [inputType]=\"'number'\"\n [placeHolder]=\"'N\u00FAmero de tel\u00E9fono'\"\n [control]=\"codFormStepTwo.controls['student_phone_number']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'password'\"\n [placeHolder]=\"'Contrase\u00F1a'\"\n [control]=\"codFormStepTwo.controls['password']\"\n ></ipt-input>\n </div>\n\n <div class=\"col-12\"></div>\n\n</form>\n\n<div class=\"flex mt-3 align-items-center gap-3\">\n <span *ngIf=\"codFormStepTwo.invalid && codFormStepTwo.touched\" class=\"text-red-500 font-bold text-center mt-1 py-2 bg-red-100 w-full border-round-xl\">{{ errorMessage }}</span>\n <button type=\"submit\" [class]=\"isEditCod ? 'ml-auto yellow-300 p-button-sm' : 'ml-auto p-button-sm'\" (click)=\"sendForm()\" pButton label=\"Siguiente\" icon=\"pi pi-arrow-right\"></button>\n</div>\n", styles: [".yellow-300{background-color:var(--yellow-500)!important;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal", "disabledSel"], outputs: ["dateSelected"] }, { kind: "component", type: SelectComponent, selector: "ipt-select", inputs: ["isRequired", "data", "defaultText", "selectCode", "disabledSel", "initialValue", "label", "control"], outputs: ["eventSelect"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i6$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });