iptdevs-design-system 3.1.393 → 3.1.395
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-self-managed/steps/cod-form-step-one/cod-self-form-step-one.component.mjs +123 -10
- package/fesm2015/iptdevs-design-system.mjs +117 -7
- package/fesm2015/iptdevs-design-system.mjs.map +1 -1
- package/fesm2020/iptdevs-design-system.mjs +117 -7
- package/fesm2020/iptdevs-design-system.mjs.map +1 -1
- package/lib/cod-self-managed/steps/cod-form-step-one/cod-self-form-step-one.component.d.ts +20 -1
- package/package.json +1 -1
|
@@ -6110,19 +6110,120 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
6110
6110
|
}] });
|
|
6111
6111
|
|
|
6112
6112
|
class CodSelfFormStepOneComponent {
|
|
6113
|
-
constructor(fb) {
|
|
6113
|
+
constructor(fb, parameterService) {
|
|
6114
6114
|
this.fb = fb;
|
|
6115
|
+
this.parameterService = parameterService;
|
|
6115
6116
|
this.completed = new EventEmitter();
|
|
6117
|
+
this.genders = [];
|
|
6116
6118
|
}
|
|
6117
6119
|
ngOnInit() {
|
|
6118
6120
|
this.initForm();
|
|
6119
6121
|
}
|
|
6120
6122
|
initForm() {
|
|
6121
6123
|
this.codSelfFormStepOne = this.fb.group({
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
+
student_name: ['', [Validators.required]],
|
|
6125
|
+
student_last_name: ['', [Validators.required]],
|
|
6126
|
+
student_id_card_type: ['', [Validators.required], []],
|
|
6127
|
+
student_id_card: [{ value: '', disabled: true }, [Validators.required, Validators.minLength(5), Validators.maxLength(20)]],
|
|
6128
|
+
student_email: ['', [Validators.required, Validators.email]],
|
|
6129
|
+
gender: ['', [Validators.required]],
|
|
6130
|
+
// age: ['', [Validators.required]],
|
|
6131
|
+
birthdate: ['', [Validators.required], []],
|
|
6132
|
+
country: ['', [Validators.required], []],
|
|
6133
|
+
state: ['', [Validators.required], []],
|
|
6134
|
+
city: ['', [Validators.required], []],
|
|
6135
|
+
// student_address: ['', [Validators.required], []],
|
|
6136
|
+
});
|
|
6137
|
+
}
|
|
6138
|
+
getParameters() {
|
|
6139
|
+
this.parameterService.getCardTypes('col').subscribe((response) => {
|
|
6140
|
+
this.idTypes = response.data;
|
|
6141
|
+
});
|
|
6142
|
+
this.parameterService.getIndicatives().subscribe((response) => {
|
|
6143
|
+
this.indicatives = response.data;
|
|
6144
|
+
});
|
|
6145
|
+
this.parameterService.getCountries().subscribe((response) => {
|
|
6146
|
+
this.countries = response.data;
|
|
6147
|
+
});
|
|
6148
|
+
this.parameterService.getStratums().subscribe((response) => {
|
|
6149
|
+
this.stratums = response.data;
|
|
6150
|
+
});
|
|
6151
|
+
this.parameterService.getCivilStatus().subscribe((response) => {
|
|
6152
|
+
this.civilStatus = response.data;
|
|
6153
|
+
});
|
|
6154
|
+
this.parameterService.getAllCities().subscribe((response) => {
|
|
6155
|
+
this.cities = response.data;
|
|
6156
|
+
});
|
|
6157
|
+
this.parameterService.getAllStates().subscribe((response) => {
|
|
6158
|
+
this.states = response.data;
|
|
6159
|
+
});
|
|
6160
|
+
this.parameterService.getGenders().pipe(map((response) => response.data)).subscribe((genders) => {
|
|
6161
|
+
genders.forEach(gender => {
|
|
6162
|
+
let genderItem = {
|
|
6163
|
+
code: gender.code,
|
|
6164
|
+
name: gender.name_spanish
|
|
6165
|
+
};
|
|
6166
|
+
this.genders.push(genderItem);
|
|
6167
|
+
});
|
|
6124
6168
|
});
|
|
6125
6169
|
}
|
|
6170
|
+
selectCountry(country) {
|
|
6171
|
+
let iso = '';
|
|
6172
|
+
if (country === '2')
|
|
6173
|
+
iso = 'col';
|
|
6174
|
+
else if (country === '3')
|
|
6175
|
+
iso = 'ven';
|
|
6176
|
+
else if (country === '4')
|
|
6177
|
+
iso = 'usa';
|
|
6178
|
+
else
|
|
6179
|
+
iso = '';
|
|
6180
|
+
if (iso != '') {
|
|
6181
|
+
this.codSelfFormStepOne.controls['country'].setValue(country);
|
|
6182
|
+
this.parameterService.getStatesByCountry(iso).subscribe((response) => {
|
|
6183
|
+
this.states = response.data;
|
|
6184
|
+
// this.selectState(this.localStorageCOD.getCodFormData(2, 'state'));
|
|
6185
|
+
});
|
|
6186
|
+
}
|
|
6187
|
+
else {
|
|
6188
|
+
this.codSelfFormStepOne.controls['country'].setValue(null);
|
|
6189
|
+
}
|
|
6190
|
+
this.countrySelected = country;
|
|
6191
|
+
}
|
|
6192
|
+
selectState(state) {
|
|
6193
|
+
if (state !== 'Departamento o estado') {
|
|
6194
|
+
this.codSelfFormStepOne.controls['state'].setValue(state);
|
|
6195
|
+
this.getState(state);
|
|
6196
|
+
}
|
|
6197
|
+
else {
|
|
6198
|
+
this.codSelfFormStepOne.controls['state'].setValue(null);
|
|
6199
|
+
this.codSelfFormStepOne.controls['city'].setValue(null);
|
|
6200
|
+
this.cities = [];
|
|
6201
|
+
}
|
|
6202
|
+
}
|
|
6203
|
+
selectCity(city) {
|
|
6204
|
+
if (city !== 'Ciudad de residencia') {
|
|
6205
|
+
this.codSelfFormStepOne.controls['city'].setValue(city);
|
|
6206
|
+
}
|
|
6207
|
+
else {
|
|
6208
|
+
this.codSelfFormStepOne.controls['city'].setValue(null);
|
|
6209
|
+
}
|
|
6210
|
+
}
|
|
6211
|
+
selectIdType(idType) {
|
|
6212
|
+
if (idType !== 'Tipo de documento') {
|
|
6213
|
+
this.codSelfFormStepOne.controls['student_id_card_type'].setValue(idType);
|
|
6214
|
+
}
|
|
6215
|
+
else {
|
|
6216
|
+
this.codSelfFormStepOne.controls['student_id_card_type'].setValue(null);
|
|
6217
|
+
}
|
|
6218
|
+
}
|
|
6219
|
+
selectGender(gender) {
|
|
6220
|
+
if (gender !== 'Género') {
|
|
6221
|
+
this.codSelfFormStepOne.controls['gender'].setValue(gender);
|
|
6222
|
+
}
|
|
6223
|
+
else {
|
|
6224
|
+
this.codSelfFormStepOne.controls['gender'].setValue(null);
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6126
6227
|
sendForm() {
|
|
6127
6228
|
this.codSelfFormStepOne.markAllAsTouched();
|
|
6128
6229
|
if (this.codSelfFormStepOne.invalid)
|
|
@@ -6130,13 +6231,22 @@ class CodSelfFormStepOneComponent {
|
|
|
6130
6231
|
// Movernos al paso 1
|
|
6131
6232
|
this.completed.emit(1);
|
|
6132
6233
|
}
|
|
6234
|
+
getState(state) {
|
|
6235
|
+
this.getCity(state);
|
|
6236
|
+
}
|
|
6237
|
+
getCity(state) {
|
|
6238
|
+
this.parameterService.getCitiesByState(state).subscribe((response) => {
|
|
6239
|
+
this.cities = response.data;
|
|
6240
|
+
// this.selectCity(this.localStorageCOD.getCodFormData(2, 'city'));
|
|
6241
|
+
});
|
|
6242
|
+
}
|
|
6133
6243
|
}
|
|
6134
|
-
CodSelfFormStepOneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepOneComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
6135
|
-
CodSelfFormStepOneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodSelfFormStepOneComponent, selector: "app-cod-self-form-step-one", outputs: { completed: "completed" }, ngImport: i0, template: "<div>\n <h2>Paso 1: Datos Personales</h2>\n
|
|
6244
|
+
CodSelfFormStepOneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepOneComponent, deps: [{ token: i1$1.FormBuilder }, { token: ParameterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
6245
|
+
CodSelfFormStepOneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodSelfFormStepOneComponent, selector: "app-cod-self-form-step-one", outputs: { completed: "completed" }, ngImport: i0, template: "<div class=\"container-main\">\n <div>\n <h2>Paso 1: Datos Personales</h2>\n <form [formGroup]=\"codSelfFormStepOne\">\n\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Nombres'\"\n [control]=\"codSelfFormStepOne.controls['name']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Apellidos'\"\n [control]=\"codSelfFormStepOne.controls['student_last_name']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['student_id_card_type'].value\"\n [control]=\"codSelfFormStepOne.controls['student_id_card_type']\"\n [selectCode]=\"codSelfFormStepOne.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codSelfFormStepOne.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\n <ipt-input\n [inputType]=\"'number'\"\n [placeHolder]=\"'N\u00FAmero de documento'\"\n [control]=\"codSelfFormStepOne.controls['student_id_card']\"\n ></ipt-input>\n\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['gender'].value\"\n [control]=\"codSelfFormStepOne.controls['gender']\"\n [data]=\"genders\"\n (eventSelect)=\"selectGender($event)\"\n [defaultText]=\"'G\u00E9nero'\"\n ></ipt-select>\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codSelfFormStepOne.controls['birthdate']\"\n [placeHolder]=\"'Fecha de nacimiento'\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['country'].value\"\n [control]=\"codSelfFormStepOne.controls['country']\"\n [selectCode]=\"codSelfFormStepOne.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codSelfFormStepOne.controls['country'].value\"\n (eventSelect)=\"selectCountry($event)\"\n [data]=\"countries\"\n [defaultText]=\"'Pa\u00EDs de residencia'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['state'].value\"\n [control]=\"codSelfFormStepOne.controls['state']\"\n [selectCode]=\"codSelfFormStepOne.controls['state'].value === null ? 'Departamento o estado' : codSelfFormStepOne.controls['state'].value\"\n [isRequired]=\"true\"\n (eventSelect)=\"selectState($event)\"\n [data]=\"states\"\n [defaultText]=\"'Departamento o estado'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['city'].value\"\n [control]=\"codSelfFormStepOne.controls['city']\"\n [selectCode]=\"codSelfFormStepOne.controls['city'].value === null ? 'Ciudad de residencia' : codSelfFormStepOne.controls['city'].value\"\n (eventSelect)=\"selectCity($event)\"\n [data]=\"cities\"\n [defaultText]=\"'Ciudad de residencia'\"\n ></ipt-select>\n\n </form>\n\n </div>\n <div class=\"flex mt-3 align-items-center gap-3\">\n <!-- <span *ngIf=\"codSelfFormStepOne.invalid && codSelfFormStepOne.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\n pButton\n label=\"Siguiente\"\n icon=\"pi pi-arrow-right\"\n type=\"submit\"\n [disabled]=\"!codSelfFormStepOne.valid\"\n (click)=\"sendForm()\"\n ></button>\n </div>\n\n</div>\n", styles: [".container-main{margin:1%}\n"], dependencies: [{ 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", "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: i7$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
|
|
6136
6246
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodSelfFormStepOneComponent, decorators: [{
|
|
6137
6247
|
type: Component,
|
|
6138
|
-
args: [{ selector: 'app-cod-self-form-step-one', template: "<div>\n <h2>Paso 1: Datos Personales</h2>\n
|
|
6139
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { completed: [{
|
|
6248
|
+
args: [{ selector: 'app-cod-self-form-step-one', template: "<div class=\"container-main\">\n <div>\n <h2>Paso 1: Datos Personales</h2>\n <form [formGroup]=\"codSelfFormStepOne\">\n\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Nombres'\"\n [control]=\"codSelfFormStepOne.controls['name']\"\n ></ipt-input>\n <ipt-input\n [inputType]=\"'text'\"\n [placeHolder]=\"'Apellidos'\"\n [control]=\"codSelfFormStepOne.controls['student_last_name']\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['student_id_card_type'].value\"\n [control]=\"codSelfFormStepOne.controls['student_id_card_type']\"\n [selectCode]=\"codSelfFormStepOne.controls['student_id_card_type'].value === null ? 'Tipo de documento' : codSelfFormStepOne.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\n <ipt-input\n [inputType]=\"'number'\"\n [placeHolder]=\"'N\u00FAmero de documento'\"\n [control]=\"codSelfFormStepOne.controls['student_id_card']\"\n ></ipt-input>\n\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['gender'].value\"\n [control]=\"codSelfFormStepOne.controls['gender']\"\n [data]=\"genders\"\n (eventSelect)=\"selectGender($event)\"\n [defaultText]=\"'G\u00E9nero'\"\n ></ipt-select>\n <ipt-input\n onfocus=\"(this.type='date')\"\n [inputType]=\"'date'\"\n [control]=\"codSelfFormStepOne.controls['birthdate']\"\n [placeHolder]=\"'Fecha de nacimiento'\"\n ></ipt-input>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['country'].value\"\n [control]=\"codSelfFormStepOne.controls['country']\"\n [selectCode]=\"codSelfFormStepOne.controls['country'].value === null ? 'Pa\u00EDs de residencia' : codSelfFormStepOne.controls['country'].value\"\n (eventSelect)=\"selectCountry($event)\"\n [data]=\"countries\"\n [defaultText]=\"'Pa\u00EDs de residencia'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['state'].value\"\n [control]=\"codSelfFormStepOne.controls['state']\"\n [selectCode]=\"codSelfFormStepOne.controls['state'].value === null ? 'Departamento o estado' : codSelfFormStepOne.controls['state'].value\"\n [isRequired]=\"true\"\n (eventSelect)=\"selectState($event)\"\n [data]=\"states\"\n [defaultText]=\"'Departamento o estado'\"\n ></ipt-select>\n <ipt-select\n [initialValue]=\"codSelfFormStepOne.controls['city'].value\"\n [control]=\"codSelfFormStepOne.controls['city']\"\n [selectCode]=\"codSelfFormStepOne.controls['city'].value === null ? 'Ciudad de residencia' : codSelfFormStepOne.controls['city'].value\"\n (eventSelect)=\"selectCity($event)\"\n [data]=\"cities\"\n [defaultText]=\"'Ciudad de residencia'\"\n ></ipt-select>\n\n </form>\n\n </div>\n <div class=\"flex mt-3 align-items-center gap-3\">\n <!-- <span *ngIf=\"codSelfFormStepOne.invalid && codSelfFormStepOne.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\n pButton\n label=\"Siguiente\"\n icon=\"pi pi-arrow-right\"\n type=\"submit\"\n [disabled]=\"!codSelfFormStepOne.valid\"\n (click)=\"sendForm()\"\n ></button>\n </div>\n\n</div>\n", styles: [".container-main{margin:1%}\n"] }]
|
|
6249
|
+
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: ParameterService }]; }, propDecorators: { completed: [{
|
|
6140
6250
|
type: Output
|
|
6141
6251
|
}] } });
|
|
6142
6252
|
|