iptdevs-design-system 3.1.949 → 3.1.951
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.
- package/esm2020/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.mjs +27 -18
- package/fesm2015/iptdevs-design-system.mjs +38 -28
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +26 -17
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod/steps/cod-form-step-two/cod-form-step-two.component.d.ts +1 -1
- package/package.json +1 -1
|
@@ -4795,11 +4795,13 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4795
4795
|
this.changeStepEvent = new EventEmitter();
|
|
4796
4796
|
this.errorMessage = 'Faltan campos por llenar.';
|
|
4797
4797
|
this.hasErrors = false;
|
|
4798
|
+
this.idTypes = [];
|
|
4798
4799
|
this.genders = [];
|
|
4799
4800
|
// Controls del formulario
|
|
4800
4801
|
this.controls = new CodFormControls().controls[1];
|
|
4801
4802
|
}
|
|
4802
4803
|
ngOnChanges(changes) {
|
|
4804
|
+
console.log('ngOnChanges called, parametersAll:', this.parametersAll, 'initialData:', this.initialData);
|
|
4803
4805
|
this.initForm();
|
|
4804
4806
|
this.startLocalStorageWork();
|
|
4805
4807
|
this.validateErrors();
|
|
@@ -4817,6 +4819,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4817
4819
|
}
|
|
4818
4820
|
}
|
|
4819
4821
|
setDataFromUserHistory() {
|
|
4822
|
+
console.log('setDataFromUserHistory called, id_card:', this.initialData?.id_card);
|
|
4820
4823
|
this.codFormStepTwo.controls['student_name'].setValue(this.initialData.name);
|
|
4821
4824
|
this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.last_name);
|
|
4822
4825
|
this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.id_card_type);
|
|
@@ -4832,9 +4835,13 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4832
4835
|
this.codFormStepTwo.controls['student_email'].setValue(this.initialData.email);
|
|
4833
4836
|
this.codFormStepTwo.controls['password'].setValue(this.initialData.id_card);
|
|
4834
4837
|
this.codFormStepTwo.controls['re_password'].setValue(this.initialData.id_card);
|
|
4835
|
-
this.
|
|
4838
|
+
this.codFormStepTwo.patchValue({
|
|
4839
|
+
student_id_card: this.initialData.student.id_card
|
|
4840
|
+
});
|
|
4841
|
+
this.updateIdTypes(this.initialData?.id_card || '');
|
|
4836
4842
|
}
|
|
4837
4843
|
setDataFromPreviusCod() {
|
|
4844
|
+
console.log('setDataFromPreviusCod called, id_card:', this.initialData?.student?.id_card); // Depuración
|
|
4838
4845
|
this.codFormStepTwo.controls['student_name'].setValue(this.initialData.student.name);
|
|
4839
4846
|
this.codFormStepTwo.controls['student_last_name'].setValue(this.initialData.student.last_name);
|
|
4840
4847
|
this.codFormStepTwo.controls['student_id_card_type'].setValue(this.initialData.student.id_card_type);
|
|
@@ -4855,7 +4862,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4855
4862
|
this.codFormStepTwo.controls['student_email'].setValue(this.initialData.student.email);
|
|
4856
4863
|
this.codFormStepTwo.controls['password'].setValue(this.initialData.student.id_card);
|
|
4857
4864
|
this.codFormStepTwo.controls['re_password'].setValue(this.initialData.student.id_card);
|
|
4858
|
-
this.
|
|
4865
|
+
this.codFormStepTwo.patchValue({
|
|
4866
|
+
student_id_card: this.initialData.student.id_card
|
|
4867
|
+
});
|
|
4868
|
+
this.updateIdTypes(this.initialData?.student?.id_card || '');
|
|
4859
4869
|
}
|
|
4860
4870
|
cleanComponent() {
|
|
4861
4871
|
this.resetLocalStorage(this.controls);
|
|
@@ -4932,9 +4942,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4932
4942
|
}
|
|
4933
4943
|
if (age < 3) {
|
|
4934
4944
|
this.errorMessage = 'Fecha de nacimiento no válida';
|
|
4935
|
-
this.codFormStepTwo.controls['birthdate'].setErrors({
|
|
4936
|
-
invalidAge: true
|
|
4937
|
-
});
|
|
4945
|
+
this.codFormStepTwo.controls['birthdate'].setErrors({ invalidAge: true });
|
|
4938
4946
|
}
|
|
4939
4947
|
else {
|
|
4940
4948
|
this.codFormStepTwo.controls['birthdate'].setErrors(null);
|
|
@@ -4944,18 +4952,22 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
4944
4952
|
});
|
|
4945
4953
|
}
|
|
4946
4954
|
getParameters() {
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4955
|
+
if (this.parametersAll?.TypeIdCardByCountryCol) {
|
|
4956
|
+
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
4957
|
+
console.log('Initial idTypes:', this.idTypes); // Depuración
|
|
4958
|
+
}
|
|
4959
|
+
else {
|
|
4960
|
+
this.idTypes = [];
|
|
4961
|
+
console.log('TypeIdCardByCountryCol is undefined'); // Depuración
|
|
4962
|
+
}
|
|
4963
|
+
console.log('Initial idTypes:', this.idTypes); // Depuración
|
|
4950
4964
|
this.indicatives = this.parametersAll?.indicatives;
|
|
4951
4965
|
this.countries = this.parametersAll?.country;
|
|
4952
4966
|
this.stratums = this.parametersAll?.stratum;
|
|
4953
4967
|
this.civilStatus = this.parametersAll?.civilStatus;
|
|
4954
4968
|
this.cities = this.parametersAll?.city;
|
|
4955
4969
|
this.states = this.parametersAll?.State;
|
|
4956
|
-
// this.genders =this.parametersAll?.gender;
|
|
4957
4970
|
if (this.parametersAll && this.parametersAll.gender) {
|
|
4958
|
-
// Transformar gender en un arreglo de { code, name }
|
|
4959
4971
|
this.genders = this.parametersAll.gender.map((gender) => ({
|
|
4960
4972
|
code: gender.code,
|
|
4961
4973
|
name: gender.name_spanish
|
|
@@ -5073,13 +5085,10 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
5073
5085
|
trackStudentIdCardChanges() {
|
|
5074
5086
|
console.log('trackStudentIdCardChanges called'); // Depuración
|
|
5075
5087
|
const control = this.codFormStepTwo.get('student_id_card');
|
|
5076
|
-
control?.valueChanges.subscribe((
|
|
5077
|
-
|
|
5088
|
+
control?.valueChanges.subscribe((value) => {
|
|
5089
|
+
console.log('student_id_card value:', value); // Depuración
|
|
5090
|
+
this.updateIdTypes(value);
|
|
5078
5091
|
});
|
|
5079
|
-
// this.codFormStepTwo.controls['student_id_card'].valueChanges.subscribe(value => {
|
|
5080
|
-
// console.log('student_id_card value:', value); // Depuración
|
|
5081
|
-
// this.updateIdTypes(value);
|
|
5082
|
-
// });
|
|
5083
5092
|
}
|
|
5084
5093
|
updateIdTypes(value) {
|
|
5085
5094
|
console.log('updateIdTypes called with value:', value); // Depuración
|
|
@@ -5090,7 +5099,7 @@ class CodFormStepTwoComponent extends CodFormSteps {
|
|
|
5090
5099
|
}
|
|
5091
5100
|
else {
|
|
5092
5101
|
console.log('No letters, restoring idTypes'); // Depuración
|
|
5093
|
-
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
5102
|
+
this.idTypes = [...this.parametersAll.TypeIdCardByCountryCol];
|
|
5094
5103
|
}
|
|
5095
5104
|
console.log('Current idTypes:', this.idTypes); // Depuración
|
|
5096
5105
|
}
|