iptdevs-design-system 2.7.163 → 2.7.165

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.
@@ -2225,12 +2225,6 @@ class CodDocumentsSectionComponent {
2225
2225
  this.idPdf = [];
2226
2226
  this.numDoc = -1;
2227
2227
  this.value = false;
2228
- this.documentState = {
2229
- doc_student: this.value,
2230
- doc_agreement: this.value,
2231
- doc_parent: this.value,
2232
- doc_confanorte: this.value,
2233
- };
2234
2228
  this.documentsForm = this.fb.group({
2235
2229
  doc_student: ['', [Validators.required], []],
2236
2230
  doc_agreement: [''],
@@ -2242,22 +2236,9 @@ class CodDocumentsSectionComponent {
2242
2236
  showIdDocument() {
2243
2237
  console.log('abrir modal de cargar pdf');
2244
2238
  }
2245
- catchDocument(event, typeDoc) {
2239
+ catchDocument(event, visible) {
2246
2240
  this.numDoc++;
2247
- // switch (visible) {
2248
- // case 1: this.docStudent = true;
2249
- // break;
2250
- // case 2: this.docAgreement = true;
2251
- // break;
2252
- // case 3: this.docParent = true;
2253
- // break;
2254
- // case 4: this.docConfanorte = true;
2255
- // break;
2256
- // default:
2257
- // break;
2258
- // }
2259
- this.value = true;
2260
- this.documentState[typeDoc] = true;
2241
+ this.validateVisibility(visible, true);
2261
2242
  const fileCatched = event.target.files[0];
2262
2243
  let reader = new FileReader();
2263
2244
  reader.onload = (e) => {
@@ -2277,28 +2258,32 @@ class CodDocumentsSectionComponent {
2277
2258
  this.documentsForm.controls['doc_agreement'].setValue(null);
2278
2259
  this.documentsForm.controls['doc_parent'].setValue(null);
2279
2260
  this.documentsForm.controls['doc_confanorte'].setValue(null);
2261
+ this.docStudent = false;
2262
+ this.docAgreement = false;
2263
+ this.docParent = false;
2264
+ this.docConfanorte = false;
2280
2265
  }
2281
- // clearDocStudent(typeDoc: any) {
2282
- // this.documentsForm.controls[typeDoc].setValue(null);
2283
- // this.docStudent = false;
2284
- // switch (typeDoc) {
2285
- // case 'doc_student': this.docStudent = false;
2286
- // break;
2287
- // case 'doc_agreement': this.docAgreement = false;
2288
- // break;
2289
- // case 'doc_parent': this.docParent = false;
2290
- // break;
2291
- // case 'doc_confanorte': this.docConfanorte = false;
2292
- // break;
2293
- // default:
2294
- // break;
2295
- // }
2296
- // }
2297
2266
  clearDocStudent(typeDoc) {
2298
- const control = this.documentsForm.controls[typeDoc];
2299
- control.setValue(null);
2300
- this.value = false;
2301
- this.documentState[typeDoc] = false;
2267
+ this.documentsForm.controls[typeDoc].setValue(null);
2268
+ this.validateVisibility(typeDoc, false);
2269
+ }
2270
+ validateVisibility(compVisivility, value) {
2271
+ switch (compVisivility) {
2272
+ case 'doc_student':
2273
+ this.docStudent = value;
2274
+ break;
2275
+ case 'doc_agreement':
2276
+ this.docAgreement = value;
2277
+ break;
2278
+ case 'doc_parent':
2279
+ this.docParent = value;
2280
+ break;
2281
+ case 'doc_confanorte':
2282
+ this.docConfanorte = value;
2283
+ break;
2284
+ default:
2285
+ break;
2286
+ }
2302
2287
  }
2303
2288
  }
2304
2289
  CodDocumentsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodDocumentsSectionComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });