@kaufmann-lab/ui 0.1.16 → 0.1.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaufmann-lab/ui",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Shared Angular component library for the Kaufmann frontends",
5
5
  "license": "MIT",
6
6
  "author": "Kaufmann Lab",
@@ -1,6 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { AfterContentInit, TemplateRef, Signal, ElementRef, AfterViewInit, InjectionToken, Provider } from '@angular/core';
3
3
  import { ControlValueAccessor } from '@angular/forms';
4
+ import { SafeResourceUrl } from '@angular/platform-browser';
4
5
 
5
6
  /**
6
7
  * Nombre de cada ícono del design system. Página 5 del PDF fija un set de
@@ -817,10 +818,10 @@ declare class ContentState {
817
818
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentState, "kf-content-state", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "load": { "alias": "load"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[actions]"], true, never>;
818
819
  }
819
820
 
820
- type ContentViewerType = 'image' | 'video';
821
+ type ContentViewerType = 'image' | 'video' | 'pdf';
821
822
  /**
822
- * Visor a pantalla completa para ampliar una pieza de contenido — hoy
823
- * imagen, con `video` ya soportado para cuando haya contenido de ese tipo.
823
+ * Visor a pantalla completa para ampliar una pieza de contenido: imagen,
824
+ * video o PDF (`type="pdf"`, renderizado por el visor nativo del navegador).
824
825
  * Mismo mecanismo que `kf-modal` (el `<dialog>` nativo resuelve backdrop,
825
826
  * atrapado de foco, top-layer y `Escape`), pero sin panel/título/footer:
826
827
  * el contenido ocupa toda la pantalla sobre un backdrop oscuro.
@@ -828,10 +829,17 @@ type ContentViewerType = 'image' | 'video';
828
829
  * `src` acepta lo que venga del backend sin que el consumidor tenga que
829
830
  * normalizarlo primero: una URL (`http(s)://`), un data URI ya armado
830
831
  * (`data:...`), o base64 crudo (se le antepone el prefijo `data:` según
831
- * `type`, asumiendo JPEG para imagen y MP4 para video).
832
+ * `type`, asumiendo JPEG para imagen, MP4 para video y PDF para pdf). Un PDF
833
+ * solo acepta contenido local (`blob:`, data URI o base64), nunca una URL remota.
834
+ *
835
+ * Lo proyectado con el atributo `actions` (p. ej. un botón de descarga) va en
836
+ * la barra superior, junto al título.
832
837
  *
833
838
  * <kf-content-viewer [(open)]="viewerOpen" [src]="viewerSrc()" alt="Foto del vehículo" />
834
839
  * <kf-content-viewer [(open)]="viewerOpen" type="video" [src]="viewerSrc()" title="Inspección" />
840
+ * <kf-content-viewer [(open)]="viewerOpen" type="pdf" [src]="blobUrl()" title="Contrato">
841
+ * <kf-button actions variant="surface" icon="download" (click)="save()">Descargar</kf-button>
842
+ * </kf-content-viewer>
835
843
  */
836
844
  declare class ContentViewer {
837
845
  readonly type: _angular_core.InputSignal<ContentViewerType>;
@@ -849,8 +857,11 @@ declare class ContentViewer {
849
857
  * base64 crudo y le antepone el prefijo `data:` correspondiente a `type`
850
858
  * — el backend a veces manda una cosa, a veces la otra. */
851
859
  protected readonly resolvedSrc: _angular_core.Signal<string | null>;
860
+ protected readonly pdfSrc: _angular_core.Signal<SafeResourceUrl | null>;
861
+ protected readonly fallbackLabel: _angular_core.Signal<string>;
852
862
  private readonly dialog;
853
863
  private readonly document;
864
+ private readonly sanitizer;
854
865
  constructor();
855
866
  /** `Escape` dispara `cancel`; cancelarlo lo deja abierto. */
856
867
  protected onCancel(event: Event): void;
@@ -861,7 +872,7 @@ declare class ContentViewer {
861
872
  */
862
873
  protected onHostClick(event: MouseEvent): void;
863
874
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentViewer, never>;
864
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentViewer, "kf-content-viewer", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, never, true, never>;
875
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentViewer, "kf-content-viewer", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[actions]"], true, never>;
865
876
  }
866
877
 
867
878
  /**