ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
53 lines (52 loc) • 2.78 kB
TypeScript
import { AfterViewInit, OnDestroy } from '@angular/core';
import { ResponsiveVisibility } from '../../responsive-visibility';
import * as i0 from "@angular/core";
/**
* Digital signature properties panel (pdf.js 6.2).
*
* PDF.js looks the elements up by id in `getViewerConfiguration()` and
* `digital_signature_properties_manager.js` fills them at runtime: it unhides
* the button when the document contains signatures, writes the summary into
* `#signaturePropertiesBanner` and one card per signature into
* `#signaturePropertiesList`. So the template only has to render the markup
* with the exact ids.
*
* Two things PDF.js cannot do for us, because it only knows the single button
* of its own viewer:
*
* 1. The doorhanger's position. PDF.js opens the panel from its own click
* handler and leaves the placement to CSS, which puts it past the right
* edge of the window. Every other ngx doorhanger is positioned by
* `PositioningService`, so hook the same call onto the button's click.
* 2. The copy of the button in the secondary menu. `<pdf-shy-button>` renders
* a second, independent button there so the toolbar can collapse on narrow
* screens. PDF.js neither hides it, nor gives it a verification state, nor
* listens for its clicks - this component bridges all three.
*/
export declare class PdfSignaturePropertiesComponent implements AfterViewInit, OnDestroy {
show: import("@angular/core").InputSignal<ResponsiveVisibility>;
/** The verification states PDF.js puts on the button (see `#updateButtonState()`). */
private static readonly STATE_CLASSES;
private readonly elementRef;
private button;
/** The `<pdf-shy-button>` host - what PDF.js addresses as `button.parentElement`. */
private host;
private observer;
ngAfterViewInit(): void;
ngOnDestroy(): void;
/**
* Copies the state PDF.js maintains on the primary button over to the copy
* in the secondary menu, which PDF.js does not know about. Without this the
* overflow menu would offer "Signature properties" for every document, and
* would never show whether the signatures check out.
*/
private mirrorToSecondaryMenu;
/**
* Runs before PDF.js's own click handler has unhidden the panel;
* positionPopupBelowItsButton() defers into a setTimeout, so by the time it
* measures, the panel is visible.
*/
onClick: (_event?: Event, isSecondaryMenu?: boolean) => void;
static ɵfac: i0.ɵɵFactoryDeclaration<PdfSignaturePropertiesComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<PdfSignaturePropertiesComponent, "pdf-signature-properties", never, { "show": { "alias": "show"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
}