ngx-dsxlibrary 2.21.18 → 2.21.20

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.
@@ -559,8 +559,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
559
559
  args: [{ selector: 'app-pdf-preview', imports: [DialogModule], template: "<p-dialog\r\n header=\"Vista previa del documento de soporte\"\r\n [(visible)]=\"visible\"\r\n [style]=\"{ width: '80vw', height: '90vh' }\"\r\n [closable]=\"true\"\r\n [maximizable]=\"true\"\r\n>\r\n @if (pdfUrl) {\r\n <iframe\r\n [src]=\"pdfUrl\"\r\n width=\"100%\"\r\n height=\"100%\"\r\n style=\"border: none\"\r\n ></iframe>\r\n }\r\n</p-dialog>\r\n" }]
560
560
  }], ctorParameters: () => [{ type: i1$3.DomSanitizer }], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], blob: [{ type: i0.Input, args: [{ isSignal: true, alias: "blob", required: false }] }] } });
561
561
 
562
- /** SVG de warning_amber como fallback cuando no se encuentra un icono */
563
- const WARNING_AMBER_SVG = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M80-160v-80h800v80H80Zm40-120 360-560 360 560H120Zm178-80h364L480-660 298-360Zm182 0Z"/></svg>`;
562
+ /** SVG del icono help como fallback de emergencia */
563
+ const HELP_SVG = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-200h80v-80h-80v80Zm40-400q-33 0-56.5 18.5T390-530l70 30q5-17 15-26.5t25-9.5q17 0 28.5 11.5T540-495q0 12-7.5 22T510-450q-35 24-52.5 44T440-340h80q0-22 12.5-39.5T570-412q30-21 40-41t10-42q0-51-35-88t-105-37q-60 0-94.5 29.5T340-510l70 30q8-25 23.5-37.5T480-530Zm0 500q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>`;
564
+ /**
565
+ * Servicio de carga de iconos SVG para `icon-dsx`.
566
+ *
567
+ * Flujo de resolución:
568
+ * 1) Intenta cargar el recurso solicitado en `mdio/{name}.svg`.
569
+ * 2) Si falla, registra un `console.warn` para depuración.
570
+ * 3) Usa `mdio/help.svg` como fallback visual para mantener buena UX.
571
+ * 4) Si también falla ese recurso, usa un SVG inline de `help` como último respaldo.
572
+ *
573
+ * Nota de mantenimiento:
574
+ * Los recursos SVG deben mantenerse actualizados en la carpeta de assets (`mdio`),
575
+ * de lo contrario se activará el fallback y el warning de ícono no encontrado.
576
+ */
564
577
  class IconDsxService {
565
578
  http;
566
579
  sanitizer;
@@ -569,14 +582,25 @@ class IconDsxService {
569
582
  this.http = http;
570
583
  this.sanitizer = sanitizer;
571
584
  }
572
- /** Carga SVG desde assets/dsxResource/material-design-icons/outlined */
585
+ /**
586
+ * Carga un SVG por nombre desde `mdio/{name}.svg` y retorna contenido seguro para renderizar.
587
+ */
573
588
  getIcon(name) {
574
589
  if (this.cache.has(name)) {
575
590
  return this.cache.get(name);
576
591
  }
577
592
  const iconPath = `mdio/${name}.svg`;
578
- const request$ = this.http.get(iconPath, { responseType: 'text' }).pipe(map((svg) => this.sanitizer.bypassSecurityTrustHtml(svg)), catchError(() => {
579
- return of(this.sanitizer.bypassSecurityTrustHtml(WARNING_AMBER_SVG));
593
+ const helpIconPath = 'mdio/help.svg';
594
+ const request$ = this.http.get(iconPath, { responseType: 'text' }).pipe(map((svg) => this.sanitizer.bypassSecurityTrustHtml(svg)), catchError((error) => {
595
+ console.warn('[IconDsxService] Icono no encontrado, usando fallback', {
596
+ name,
597
+ path: iconPath,
598
+ status: error?.status,
599
+ message: error?.message,
600
+ });
601
+ return this.http.get(helpIconPath, { responseType: 'text' }).pipe(map((svg) => this.sanitizer.bypassSecurityTrustHtml(svg)), catchError(() => {
602
+ return of(this.sanitizer.bypassSecurityTrustHtml(HELP_SVG));
603
+ }));
580
604
  }), shareReplay(1));
581
605
  this.cache.set(name, request$);
582
606
  return request$;
@@ -2155,11 +2179,15 @@ class AuthorizeService {
2155
2179
  // La revocación en el servidor se hace en segundo plano para no bloquear la navegación.
2156
2180
  this.clearSessionData();
2157
2181
  // 5️⃣ Intentar revocar el token en el servidor (fire-and-forget)
2158
- console.info('[AuthorizeService] Revocando refresh token en el servidor (en segundo plano)...');
2182
+ // console.info(
2183
+ // '[AuthorizeService] Revocando refresh token en el servidor (en segundo plano)...',
2184
+ // );
2159
2185
  this._securityService.tokenRevok(refreshToken).subscribe({
2160
2186
  next: (success) => {
2161
2187
  if (success) {
2162
- console.info('[AuthorizeService] Refresh token revocado exitosamente en el servidor');
2188
+ // console.info(
2189
+ // '[AuthorizeService] Refresh token revocado exitosamente en el servidor',
2190
+ // );
2163
2191
  }
2164
2192
  else {
2165
2193
  console.warn('[AuthorizeService] El servidor no pudo revocar el token.');
@@ -2174,7 +2202,7 @@ class AuthorizeService {
2174
2202
  });
2175
2203
  },
2176
2204
  complete: () => {
2177
- console.info('[AuthorizeService] Proceso de logout completado');
2205
+ //console.info('[AuthorizeService] Proceso de logout completado');
2178
2206
  },
2179
2207
  });
2180
2208
  }
@@ -2217,7 +2245,9 @@ class AuthorizeService {
2217
2245
  */
2218
2246
  clearSessionData() {
2219
2247
  try {
2220
- console.info('[AuthorizeService] Iniciando limpieza de datos de sesión...');
2248
+ // console.info(
2249
+ // '[AuthorizeService] Iniciando limpieza de datos de sesión...',
2250
+ // );
2221
2251
  // 1️⃣ Eliminar cookies con path explícito
2222
2252
  const cookiesToDelete = [
2223
2253
  this.environment.tokenName,
@@ -2238,7 +2268,7 @@ class AuthorizeService {
2238
2268
  this._cookieService.delete(cookieName, '/', domain);
2239
2269
  });
2240
2270
  }
2241
- console.debug(`[AuthorizeService] Cookie eliminada: ${cookieName}`);
2271
+ //console.debug(`[AuthorizeService] Cookie eliminada: ${cookieName}`);
2242
2272
  }
2243
2273
  catch (error) {
2244
2274
  console.error(`[AuthorizeService] Error al eliminar cookie ${cookieName}:`, error);
@@ -2247,13 +2277,13 @@ class AuthorizeService {
2247
2277
  // 2️⃣ Limpiar localStorage
2248
2278
  try {
2249
2279
  localStorage.clear();
2250
- console.debug('[AuthorizeService] localStorage limpiado');
2280
+ //console.debug('[AuthorizeService] localStorage limpiado');
2251
2281
  }
2252
2282
  catch (error) {
2253
2283
  console.error('[AuthorizeService] Error al limpiar localStorage:', error);
2254
2284
  }
2255
2285
  // 3️⃣ Redirigir al login
2256
- console.info('[AuthorizeService] Redirigiendo a página de login...');
2286
+ //console.info('[AuthorizeService] Redirigiendo a página de login...');
2257
2287
  this._router.navigate(['/login']).then(() => console.info('[AuthorizeService] Redirección exitosa a /login'), (error) => console.error('[AuthorizeService] Error en la redirección:', error));
2258
2288
  }
2259
2289
  catch (error) {