epochs-pdf 0.1.3 → 0.1.5
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/dist/epochs-pdf.cjs +33 -32
- package/dist/epochs-pdf.cjs.map +1 -1
- package/dist/epochs-pdf.css +1 -1
- package/dist/epochs-pdf.js +2292 -2006
- package/dist/epochs-pdf.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export declare function pdf(element: ReactElement): Uint8Array;
|
|
|
141
141
|
|
|
142
142
|
export declare type PdfSource = string | ArrayBuffer | Uint8Array | Blob;
|
|
143
143
|
|
|
144
|
-
declare function PdfViewer({ file, fileUrl, baseUrl, fetchOptions, height, title, initialScale, withThumbnails, thumbnailWidth, maxThumbnails, className, workerSrc, enableToolbar, enableThumbnails, enableNavigation, enableZoom, enableRotate, enableReload, enablePrint, enableOpen, enableDownload, enableMarkup, enableHighlight, enableUnderline, enableSignature, enableText, enableErase, enableClear, signatureFields, textFields, onSignatureComplete, onFieldValueComplete, openSignaturePad: externalOpenSignaturePad, onSignaturePadClose, onSubmit, submitLabel, }: PdfViewerProps): JSX.Element;
|
|
144
|
+
declare function PdfViewer({ file, fileUrl, baseUrl, fetchOptions, height, title, initialScale, withThumbnails, thumbnailWidth, maxThumbnails, className, workerSrc, enableToolbar, enableThumbnails, enableNavigation, enableZoom, enableRotate, enableReload, enablePrint, enableOpen, enableDownload, enableMarkup, enableHighlight, enableUnderline, enableSignature, enableText, enableErase, enableClear, signatureFields: signatureFieldsProp, textFields, onSignatureComplete, onSignatureFieldsChange, applySignatureToSameTag, onFieldValueComplete, openSignaturePad: externalOpenSignaturePad, onSignaturePadClose, onSubmit, submitLabel, submitLoading, }: PdfViewerProps): JSX.Element;
|
|
145
145
|
export { PdfViewer }
|
|
146
146
|
export default PdfViewer;
|
|
147
147
|
|
|
@@ -209,6 +209,16 @@ export declare interface PdfViewerProps {
|
|
|
209
209
|
textFields?: TextField[];
|
|
210
210
|
/** Called when a signature is placed (both fixed-field and free placement). */
|
|
211
211
|
onSignatureComplete?: (fieldId: string | undefined, signature: SignatureAnnotation) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Called when signatureFields are updated inside the viewer
|
|
214
|
+
* (e.g. after signing — fields include `signatureDataUrl`).
|
|
215
|
+
*/
|
|
216
|
+
onSignatureFieldsChange?: (fields: SignatureField[]) => void;
|
|
217
|
+
/**
|
|
218
|
+
* When true, a drawn/typed signature is applied to every field that shares
|
|
219
|
+
* the same `signature_tag`, and the pad does not auto-open for the next field.
|
|
220
|
+
*/
|
|
221
|
+
applySignatureToSameTag?: boolean;
|
|
212
222
|
/** Called when a date/text fixed field value changes. */
|
|
213
223
|
onFieldValueComplete?: (fieldId: string, value: string) => void;
|
|
214
224
|
/** Externally trigger the signature pad to open. Toggle to `true` to open. */
|
|
@@ -222,6 +232,8 @@ export declare interface PdfViewerProps {
|
|
|
222
232
|
onSubmit?: () => void;
|
|
223
233
|
/** Label for the footer submit button. Default "Submit". */
|
|
224
234
|
submitLabel?: string;
|
|
235
|
+
/** When true, shows a spinner on the submit button and disables it. */
|
|
236
|
+
submitLoading?: boolean;
|
|
225
237
|
}
|
|
226
238
|
|
|
227
239
|
/** Print (includes markup). */
|
|
@@ -273,6 +285,15 @@ export declare interface SignatureField {
|
|
|
273
285
|
type?: SignatureFieldType;
|
|
274
286
|
/** Placeholder text for "text" type fields. */
|
|
275
287
|
placeholder?: string;
|
|
288
|
+
/**
|
|
289
|
+
* Optional group key. When `applySignatureToSameTag` is enabled on the viewer,
|
|
290
|
+
* one signature fills every field that shares this tag.
|
|
291
|
+
*/
|
|
292
|
+
signature_tag?: string;
|
|
293
|
+
/** Filled signature image (data URL) after the user signs this field. */
|
|
294
|
+
signatureDataUrl?: string;
|
|
295
|
+
/** Plain text / date string when `type` is `"text"` or `"date"`. */
|
|
296
|
+
value?: string;
|
|
276
297
|
}
|
|
277
298
|
|
|
278
299
|
declare type SignatureFieldType = "sign" | "date" | "text";
|