@pdftools/four-heights-pdf-web-viewer 4.3.6
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/LICENSE.md +446 -0
- package/README.md +145 -0
- package/css/pdf-web-viewer.css +2407 -0
- package/doc/PdfWebViewer.pdf +0 -0
- package/es6/common/Checkbox.d.ts +9 -0
- package/es6/common/Checkbox.js +8 -0
- package/es6/common/Color.d.ts +23 -0
- package/es6/common/Color.js +118 -0
- package/es6/common/ColorPicker.d.ts +15 -0
- package/es6/common/ColorPicker.js +46 -0
- package/es6/common/Contextbar.d.ts +6 -0
- package/es6/common/Contextbar.js +19 -0
- package/es6/common/DragMoveHandler.d.ts +51 -0
- package/es6/common/DragMoveHandler.js +175 -0
- package/es6/common/Dropdown.d.ts +36 -0
- package/es6/common/Dropdown.js +76 -0
- package/es6/common/DropdownMenu.d.ts +9 -0
- package/es6/common/DropdownMenu.js +10 -0
- package/es6/common/DropdownSeparator.d.ts +3 -0
- package/es6/common/DropdownSeparator.js +6 -0
- package/es6/common/Icon.d.ts +13 -0
- package/es6/common/Icon.js +8 -0
- package/es6/common/Loader.d.ts +3 -0
- package/es6/common/Loader.js +6 -0
- package/es6/common/RangeSlider.d.ts +17 -0
- package/es6/common/RangeSlider.js +42 -0
- package/es6/common/StrokeStylePicker.d.ts +11 -0
- package/es6/common/StrokeStylePicker.js +20 -0
- package/es6/common/StrokeWidthPicker.d.ts +11 -0
- package/es6/common/StrokeWidthPicker.js +20 -0
- package/es6/common/Toolbar.d.ts +10 -0
- package/es6/common/Toolbar.js +6 -0
- package/es6/common/ToolbarButton.d.ts +14 -0
- package/es6/common/ToolbarButton.js +21 -0
- package/es6/common/ToolbarFileButton.d.ts +15 -0
- package/es6/common/ToolbarFileButton.js +27 -0
- package/es6/common/ToolbarItemGroup.d.ts +8 -0
- package/es6/common/ToolbarItemGroup.js +12 -0
- package/es6/common/ToolbarSeparator.d.ts +3 -0
- package/es6/common/ToolbarSeparator.js +6 -0
- package/es6/common/Tools.d.ts +10 -0
- package/es6/common/Tools.js +89 -0
- package/es6/common/TooltipManager.d.ts +12 -0
- package/es6/common/TooltipManager.js +54 -0
- package/es6/common/TranslationManager.d.ts +11 -0
- package/es6/common/TranslationManager.js +61 -0
- package/es6/common/classNames.d.ts +2 -0
- package/es6/common/classNames.js +18 -0
- package/es6/common/formatDate.d.ts +1 -0
- package/es6/common/formatDate.js +1 -0
- package/es6/common/icons.d.ts +13 -0
- package/es6/common/icons.js +412 -0
- package/es6/common/utils.d.ts +2 -0
- package/es6/common/utils.js +19 -0
- package/es6/custom/history.d.ts +2 -0
- package/es6/custom/history.js +59 -0
- package/es6/index.d.ts +5 -0
- package/es6/index.js +5 -0
- package/es6/lib/hyperapp/index.d.ts +108 -0
- package/es6/lib/hyperapp/index.js +327 -0
- package/es6/modules/CanvasLayer.d.ts +32 -0
- package/es6/modules/CanvasLayer.js +83 -0
- package/es6/modules/CanvasModule.d.ts +59 -0
- package/es6/modules/CanvasModule.js +98 -0
- package/es6/modules/eraser/EraserLayer.d.ts +13 -0
- package/es6/modules/eraser/EraserLayer.js +141 -0
- package/es6/modules/eraser/EraserModule.d.ts +19 -0
- package/es6/modules/eraser/EraserModule.js +34 -0
- package/es6/modules/eraser/EraserToolbar.d.ts +10 -0
- package/es6/modules/eraser/EraserToolbar.js +30 -0
- package/es6/modules/form-fields/CheckBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/CheckBoxWidget.js +45 -0
- package/es6/modules/form-fields/ComboBoxWidget.d.ts +22 -0
- package/es6/modules/form-fields/ComboBoxWidget.js +152 -0
- package/es6/modules/form-fields/EditFormFieldLayer.d.ts +17 -0
- package/es6/modules/form-fields/EditFormFieldLayer.js +238 -0
- package/es6/modules/form-fields/FormFieldModule.d.ts +15 -0
- package/es6/modules/form-fields/FormFieldModule.js +27 -0
- package/es6/modules/form-fields/ListBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/ListBoxWidget.js +73 -0
- package/es6/modules/form-fields/RadioButtonWidget.d.ts +9 -0
- package/es6/modules/form-fields/RadioButtonWidget.js +45 -0
- package/es6/modules/form-fields/SelectListWidget.d.ts +9 -0
- package/es6/modules/form-fields/SelectListWidget.js +45 -0
- package/es6/modules/form-fields/TextBoxWidget.d.ts +9 -0
- package/es6/modules/form-fields/TextBoxWidget.js +53 -0
- package/es6/modules/form-fields/WidgetBase.d.ts +23 -0
- package/es6/modules/form-fields/WidgetBase.js +29 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.d.ts +19 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationLayer.js +181 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.d.ts +21 -0
- package/es6/modules/freetext-annotation/AddFreetextAnnotationToolbar.js +37 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.d.ts +20 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationLayer.js +211 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.d.ts +50 -0
- package/es6/modules/freetext-annotation/EditFreetextAnnotationToolbar.js +118 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.d.ts +28 -0
- package/es6/modules/freetext-annotation/FreetextAnnotationModule.js +58 -0
- package/es6/modules/freetext-annotation/RichTextEditor.d.ts +31 -0
- package/es6/modules/freetext-annotation/RichTextEditor.js +223 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.d.ts +31 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationLayer.js +289 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.d.ts +20 -0
- package/es6/modules/highlight-annotation/AddHighlightAnnotationToolbar.js +52 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationLayer.js +104 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.d.ts +15 -0
- package/es6/modules/highlight-annotation/EditHighlightAnnotationToolbar.js +28 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.d.ts +27 -0
- package/es6/modules/highlight-annotation/HighlightAnnotationModule.js +54 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.d.ts +23 -0
- package/es6/modules/image-annotations/ImageAnnotationModule.js +169 -0
- package/es6/modules/index.d.ts +13 -0
- package/es6/modules/index.js +13 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.d.ts +40 -0
- package/es6/modules/ink-annotation/AddInkAnnotationLayer.js +503 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.d.ts +30 -0
- package/es6/modules/ink-annotation/AddInkAnnotationToolbar.js +53 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.d.ts +20 -0
- package/es6/modules/ink-annotation/EditInkAnnotationLayer.js +137 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.d.ts +25 -0
- package/es6/modules/ink-annotation/EditInkAnnotationToolbar.js +47 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.d.ts +27 -0
- package/es6/modules/ink-annotation/InkAnnotationModule.js +50 -0
- package/es6/modules/popup/Popup.d.ts +64 -0
- package/es6/modules/popup/Popup.js +360 -0
- package/es6/modules/popup/PopupLayer.d.ts +31 -0
- package/es6/modules/popup/PopupLayer.js +509 -0
- package/es6/modules/popup/PopupModule.d.ts +16 -0
- package/es6/modules/popup/PopupModule.js +25 -0
- package/es6/modules/print-service/PrintServiceDialog.d.ts +30 -0
- package/es6/modules/print-service/PrintServiceDialog.js +134 -0
- package/es6/modules/print-service/PrintServiceLayer.d.ts +24 -0
- package/es6/modules/print-service/PrintServiceLayer.js +310 -0
- package/es6/modules/print-service/PrintServiceModule.d.ts +18 -0
- package/es6/modules/print-service/PrintServiceModule.js +30 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.d.ts +24 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationLayer.js +210 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.d.ts +26 -0
- package/es6/modules/shape-annotations/AddShapeAnnotationToolbar.js +69 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.d.ts +19 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationLayer.js +148 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.d.ts +24 -0
- package/es6/modules/shape-annotations/EditShapeAnnotationToolbar.js +57 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.d.ts +28 -0
- package/es6/modules/shape-annotations/ShapeAnnotationModule.js +50 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.d.ts +19 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationLayer.js +257 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.d.ts +17 -0
- package/es6/modules/stamp-annotation/AddStampAnnotationToolbar.js +68 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.d.ts +20 -0
- package/es6/modules/stamp-annotation/StampAnnotationModule.js +35 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.d.ts +14 -0
- package/es6/modules/text-annotation/AddTextAnnotationLayer.js +132 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.d.ts +15 -0
- package/es6/modules/text-annotation/AddTextAnnotationToolbar.js +27 -0
- package/es6/modules/text-annotation/TextAnnotationModule.d.ts +19 -0
- package/es6/modules/text-annotation/TextAnnotationModule.js +34 -0
- package/es6/pdf-viewer-api/ImageContainer.d.ts +10 -0
- package/es6/pdf-viewer-api/ImageContainer.js +43 -0
- package/es6/pdf-viewer-api/PdfViewerApi.d.ts +463 -0
- package/es6/pdf-viewer-api/PdfViewerApi.js +732 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.d.ts +178 -0
- package/es6/pdf-viewer-api/PdfViewingWrapper.js +2037 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.d.ts +3 -0
- package/es6/pdf-viewer-api/annotationDefaultBehaviors.js +30 -0
- package/es6/pdf-viewer-api/enums.d.ts +100 -0
- package/es6/pdf-viewer-api/enums.js +113 -0
- package/es6/pdf-viewer-api/index.d.ts +3 -0
- package/es6/pdf-viewer-api/index.js +3 -0
- package/es6/pdf-viewer-api/types.d.ts +284 -0
- package/es6/pdf-viewer-api/types.js +6 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.d.ts +76 -0
- package/es6/pdf-viewer-canvas/CanvasEvents.js +345 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.d.ts +175 -0
- package/es6/pdf-viewer-canvas/PdfViewerCanvas.js +1226 -0
- package/es6/pdf-viewer-canvas/state/annotations.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/annotations.js +157 -0
- package/es6/pdf-viewer-canvas/state/appState.d.ts +10 -0
- package/es6/pdf-viewer-canvas/state/appState.js +60 -0
- package/es6/pdf-viewer-canvas/state/canvas.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/canvas.js +41 -0
- package/es6/pdf-viewer-canvas/state/document.d.ts +50 -0
- package/es6/pdf-viewer-canvas/state/document.js +99 -0
- package/es6/pdf-viewer-canvas/state/pointer.d.ts +31 -0
- package/es6/pdf-viewer-canvas/state/pointer.js +31 -0
- package/es6/pdf-viewer-canvas/state/scroll.d.ts +22 -0
- package/es6/pdf-viewer-canvas/state/scroll.js +25 -0
- package/es6/pdf-viewer-canvas/state/search.d.ts +36 -0
- package/es6/pdf-viewer-canvas/state/search.js +27 -0
- package/es6/pdf-viewer-canvas/state/store.d.ts +39 -0
- package/es6/pdf-viewer-canvas/state/store.js +52 -0
- package/es6/pdf-viewer-canvas/state/viewer.d.ts +91 -0
- package/es6/pdf-viewer-canvas/state/viewer.js +175 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.d.ts +28 -0
- package/es6/pdf-viewer-canvas/view-layers/AnnotationSelectionLayer.js +452 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.d.ts +9 -0
- package/es6/pdf-viewer-canvas/view-layers/BusyStateLayer.js +25 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.d.ts +10 -0
- package/es6/pdf-viewer-canvas/view-layers/PdfDocumentLayer.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.d.ts +48 -0
- package/es6/pdf-viewer-canvas/view-layers/ScrollLayer.js +308 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.d.ts +19 -0
- package/es6/pdf-viewer-canvas/view-layers/TextSelectionLayer.js +289 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.d.ts +31 -0
- package/es6/pdf-viewer-canvas/view-layers/ViewLayerBase.js +106 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.d.ts +11 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasShapes.js +149 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.d.ts +3 -0
- package/es6/pdf-viewer-canvas/view-layers/canvasUtlis.js +10 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.d.ts +52 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationBorder.js +377 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.d.ts +47 -0
- package/es6/pdf-viewer-canvas/view-layers/views/AnnotationContextBar.js +102 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.d.ts +14 -0
- package/es6/pdf-viewer-canvas/view-layers/views/TextSelectionContextBar.js +36 -0
- package/es6/pdf-viewing/PdfViewing.d.ts +4865 -0
- package/es6/pdf-viewing/PdfViewing.js +9611 -0
- package/es6/pdf-web-viewer/PdfWebViewer.d.ts +372 -0
- package/es6/pdf-web-viewer/PdfWebViewer.js +1386 -0
- package/es6/pdf-web-viewer/UserSettings.d.ts +8 -0
- package/es6/pdf-web-viewer/UserSettings.js +40 -0
- package/es6/pdf-web-viewer/WebViewerOptions.d.ts +387 -0
- package/es6/pdf-web-viewer/WebViewerOptions.js +582 -0
- package/es6/pdf-web-viewer/state/index.d.ts +80 -0
- package/es6/pdf-web-viewer/state/index.js +98 -0
- package/es6/pdf-web-viewer/state/layout.d.ts +24 -0
- package/es6/pdf-web-viewer/state/layout.js +21 -0
- package/es6/pdf-web-viewer/state/mobile.d.ts +16 -0
- package/es6/pdf-web-viewer/state/mobile.js +11 -0
- package/es6/pdf-web-viewer/state/navigationPanel.d.ts +61 -0
- package/es6/pdf-web-viewer/state/navigationPanel.js +84 -0
- package/es6/pdf-web-viewer/state/passwordForm.d.ts +18 -0
- package/es6/pdf-web-viewer/state/passwordForm.js +21 -0
- package/es6/pdf-web-viewer/state/pdfDocument.d.ts +31 -0
- package/es6/pdf-web-viewer/state/pdfDocument.js +41 -0
- package/es6/pdf-web-viewer/state/search.d.ts +29 -0
- package/es6/pdf-web-viewer/state/search.js +23 -0
- package/es6/pdf-web-viewer/views/App.d.ts +4 -0
- package/es6/pdf-web-viewer/views/App.js +19 -0
- package/es6/pdf-web-viewer/views/CustomButtons.d.ts +9 -0
- package/es6/pdf-web-viewer/views/CustomButtons.js +18 -0
- package/es6/pdf-web-viewer/views/DropZone.d.ts +9 -0
- package/es6/pdf-web-viewer/views/DropZone.js +53 -0
- package/es6/pdf-web-viewer/views/Layout.d.ts +4 -0
- package/es6/pdf-web-viewer/views/Layout.js +22 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/annotationbar/Annotationbar.js +21 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AddonsToolbar.js +35 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AnnotationsMenu.js +22 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/AppBar.js +26 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/DocumentBar.js +36 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/Menu.js +80 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/NavigationBar.js +74 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/SearchBar.js +83 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.d.ts +10 -0
- package/es6/pdf-web-viewer/views/appbar/SearchOptions.js +55 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ViewBar.js +52 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.d.ts +4 -0
- package/es6/pdf-web-viewer/views/appbar/ZoomBar.js +18 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/ApplicationError.js +25 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadApplication.js +6 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.d.ts +3 -0
- package/es6/pdf-web-viewer/views/modal/LoadFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/Modal.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/Modal.js +39 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFile.js +30 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/OpenFileError.js +13 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/PasswordForm.js +54 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/SaveFile.js +10 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.d.ts +4 -0
- package/es6/pdf-web-viewer/views/modal/UnsavedChanges.js +32 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationList.js +26 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.d.ts +8 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationListItem.js +158 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/AnnotationNavigation.js +11 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/NavigationPanel.js +50 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.d.ts +12 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineList.js +19 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.d.ts +4 -0
- package/es6/pdf-web-viewer/views/navigation/OutlineNavigation.js +10 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.d.ts +16 -0
- package/es6/pdf-web-viewer/views/navigation/ThumbnailNavigation.js +32 -0
- package/package.json +24 -0
- package/pdfwebviewer/PdfViewing.data +0 -0
- package/pdfwebviewer/PdfViewing_Main.js +1 -0
- package/pdfwebviewer/PdfViewing_Main.wasm +0 -0
- package/pdfwebviewer/PdfViewing_Worker.js +1 -0
- package/pdfwebviewer/PdfViewing_Worker.wasm +0 -0
- package/pdfwebviewer/pdf-web-viewer.css +2407 -0
- package/pdfwebviewer/pdf-web-viewer.development.js +25955 -0
- package/pdfwebviewer/pdf-web-viewer.min.js +1 -0
- package/pdfwebviewer/translations.de.json +151 -0
- package/pdfwebviewer/translations.en.json +151 -0
- package/pdfwebviewer/translations.fr.json +151 -0
- package/pdfwebviewer/translations.it.json +151 -0
- package/scss/common/_breakpoints.scss +44 -0
- package/scss/common/_buttons.scss +42 -0
- package/scss/common/_colorpicker.scss +89 -0
- package/scss/common/_common.scss +21 -0
- package/scss/common/_contextbar.scss +44 -0
- package/scss/common/_dropdown.scss +176 -0
- package/scss/common/_icon.scss +9 -0
- package/scss/common/_index.scss +19 -0
- package/scss/common/_loader.scss +30 -0
- package/scss/common/_rangeslider.scss +24 -0
- package/scss/common/_scrollbars.scss +64 -0
- package/scss/common/_stroke-style-picker.scss +64 -0
- package/scss/common/_stroke-width-picker.scss +23 -0
- package/scss/common/_toolbar.scss +117 -0
- package/scss/common/_tooltip.scss +39 -0
- package/scss/modules/_eraser.scss +28 -0
- package/scss/modules/_forms.scss +56 -0
- package/scss/modules/_highlightannotation.scss +12 -0
- package/scss/modules/_index.scss +5 -0
- package/scss/modules/_inkannotation.scss +41 -0
- package/scss/modules/_stampannotation.scss +19 -0
- package/scss/pdf-viewer-canvas/_annotationborder.scss +107 -0
- package/scss/pdf-viewer-canvas/_busy-loader.scss +53 -0
- package/scss/pdf-viewer-canvas/_freetexteditor.scss +28 -0
- package/scss/pdf-viewer-canvas/_index.scss +7 -0
- package/scss/pdf-viewer-canvas/_layout.scss +52 -0
- package/scss/pdf-viewer-canvas/_popup.scss +217 -0
- package/scss/pdf-viewer-canvas/_printservice.scss +171 -0
- package/scss/pdf-viewer-canvas/_textselection.scss +17 -0
- package/scss/pdf-web-viewer/_annotationbar.scss +47 -0
- package/scss/pdf-web-viewer/_index.scss +8 -0
- package/scss/pdf-web-viewer/_layout.scss +63 -0
- package/scss/pdf-web-viewer/_modal.scss +186 -0
- package/scss/pdf-web-viewer/_navigationpanel.scss +398 -0
- package/scss/pdf-web-viewer/_searchbar.scss +47 -0
- package/scss/pdf-web-viewer/_toolbar.scss +134 -0
- package/scss/pdf-web-viewer/_viewer.scss +54 -0
- package/scss/pdf-web-viewer.scss +1 -0
- package/scss/themes/default/_light.scss +32 -0
- package/scss/themes/default/_mixins.scss +129 -0
- package/scss/themes/default/_theme.scss +161 -0
- package/scss/themes/pdf-web-viewer.scss +1 -0
- package/umd/pdf-web-viewer.development.js +25955 -0
- package/umd/pdf-web-viewer.development.js.map +1 -0
- package/umd/pdf-web-viewer.min.js +1 -0
- package/wasm/PdfViewing.data +0 -0
- package/wasm/PdfViewing_Main.js +1 -0
- package/wasm/PdfViewing_Main.wasm +0 -0
- package/wasm/PdfViewing_Worker.js +1 -0
- package/wasm/PdfViewing_Worker.wasm +0 -0
- package/wasm/translations.de.json +151 -0
- package/wasm/translations.en.json +151 -0
- package/wasm/translations.fr.json +151 -0
- package/wasm/translations.it.json +151 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { PdfItemType, WidgetType } from '../../pdf-viewer-api';
|
|
3
|
+
import { CheckBoxWidget } from './CheckBoxWidget';
|
|
4
|
+
import { ComboBoxWidget } from './ComboBoxWidget';
|
|
5
|
+
import { SelectListWidget } from './SelectListWidget';
|
|
6
|
+
import { ListBoxWidget } from './ListBoxWidget';
|
|
7
|
+
import { RadioButtonWidget } from './RadioButtonWidget';
|
|
8
|
+
import { TextBoxWidget } from './TextBoxWidget';
|
|
9
|
+
const moduleLayerName = 'EditFormField';
|
|
10
|
+
const stopPropagation = (e) => {
|
|
11
|
+
e.stopPropagation();
|
|
12
|
+
};
|
|
13
|
+
export class EditFormFieldLayer extends CanvasLayer {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.widgetAnnotation = null;
|
|
17
|
+
this.formFieldElement = null;
|
|
18
|
+
this.hasFocus = false;
|
|
19
|
+
this.widgetEditor = null;
|
|
20
|
+
}
|
|
21
|
+
onCreate(args) {
|
|
22
|
+
const { annotationId, action } = args;
|
|
23
|
+
this.store.viewer.beginModule(moduleLayerName);
|
|
24
|
+
this.widgetAnnotation = this.pdfApi.getItem(annotationId);
|
|
25
|
+
this.selectNextFormField = this.selectNextFormField.bind(this);
|
|
26
|
+
this.blur = this.blur.bind(this);
|
|
27
|
+
this.formFieldElement = this.createHtmlLayer();
|
|
28
|
+
this.formFieldElement.classList.add('pwv-formField');
|
|
29
|
+
this.formFieldElement.addEventListener('mousedown', stopPropagation, false);
|
|
30
|
+
this.formFieldElement.addEventListener('mousemove', stopPropagation, false);
|
|
31
|
+
this.formFieldElement.addEventListener('mouseup', stopPropagation, false);
|
|
32
|
+
this.formFieldElement.addEventListener('touchstart', stopPropagation, { passive: false });
|
|
33
|
+
this.formFieldElement.addEventListener('touchmove', stopPropagation, { passive: true });
|
|
34
|
+
this.formFieldElement.addEventListener('touchend', stopPropagation, { passive: true });
|
|
35
|
+
this.updateFormFieldElementPosition();
|
|
36
|
+
const widget = this.widgetAnnotation.widget;
|
|
37
|
+
const widgetType = this.widgetAnnotation.widgetType;
|
|
38
|
+
if (action === 'click' &&
|
|
39
|
+
(widgetType === WidgetType.CHECK_BOX || widgetType === WidgetType.RADIO_BUTTON)) {
|
|
40
|
+
widget.push();
|
|
41
|
+
this.widgetAnnotation.pdfDocument.editAnnotation(widget);
|
|
42
|
+
}
|
|
43
|
+
const bb = widget.boundingBox;
|
|
44
|
+
const paddingX = 4;
|
|
45
|
+
const paddingY = 6;
|
|
46
|
+
this.pdfApi.goToRectangle({
|
|
47
|
+
page: bb.pageNumber,
|
|
48
|
+
pdfX: bb.x - paddingX,
|
|
49
|
+
pdfY: bb.y - paddingY,
|
|
50
|
+
pdfW: bb.width + 2 * paddingX,
|
|
51
|
+
pdfH: bb.height + 2 * paddingY,
|
|
52
|
+
});
|
|
53
|
+
const options = {
|
|
54
|
+
widget: widget,
|
|
55
|
+
widgetType: widgetType,
|
|
56
|
+
pdfDocument: this.widgetAnnotation.pdfDocument,
|
|
57
|
+
onTab: (shiftKey) => {
|
|
58
|
+
this.selectNextFormField(shiftKey);
|
|
59
|
+
},
|
|
60
|
+
onBlur: () => {
|
|
61
|
+
if (this.hasFocus) {
|
|
62
|
+
this.blur();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
switch (options.widgetType) {
|
|
67
|
+
case WidgetType.CHECK_BOX:
|
|
68
|
+
this.widgetEditor = new CheckBoxWidget(this.formFieldElement, options);
|
|
69
|
+
break;
|
|
70
|
+
case WidgetType.RADIO_BUTTON:
|
|
71
|
+
this.widgetEditor = new RadioButtonWidget(this.formFieldElement, options);
|
|
72
|
+
break;
|
|
73
|
+
case WidgetType.TEXT_BOX:
|
|
74
|
+
this.widgetEditor = new TextBoxWidget(this.formFieldElement, options);
|
|
75
|
+
break;
|
|
76
|
+
case WidgetType.COMBO_BOX:
|
|
77
|
+
{
|
|
78
|
+
if (widget.customEntryAllowed) {
|
|
79
|
+
this.widgetEditor = new ComboBoxWidget(this.formFieldElement, options);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.widgetEditor = new SelectListWidget(this.formFieldElement, options);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case WidgetType.LIST_BOX:
|
|
87
|
+
this.widgetEditor = new ListBoxWidget(this.formFieldElement, options);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
this.hasFocus = true;
|
|
91
|
+
}
|
|
92
|
+
cancel() {
|
|
93
|
+
this.remove();
|
|
94
|
+
}
|
|
95
|
+
onSave() {
|
|
96
|
+
const promise = new Promise((resolve, reject) => {
|
|
97
|
+
resolve();
|
|
98
|
+
});
|
|
99
|
+
return promise;
|
|
100
|
+
}
|
|
101
|
+
close() {
|
|
102
|
+
this.remove();
|
|
103
|
+
}
|
|
104
|
+
onRemove() {
|
|
105
|
+
var _a;
|
|
106
|
+
this.hasFocus = false;
|
|
107
|
+
(_a = this.widgetEditor) === null || _a === void 0 ? void 0 : _a.onRemove();
|
|
108
|
+
this.removeHtmlElements();
|
|
109
|
+
this.formFieldElement = null;
|
|
110
|
+
this.store.viewer.endModule(moduleLayerName);
|
|
111
|
+
}
|
|
112
|
+
render(timestamp, state) {
|
|
113
|
+
var _a;
|
|
114
|
+
if (state.viewer.modeChanged && state.viewer.selectedModuleName !== moduleLayerName) {
|
|
115
|
+
this.remove();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (this.formFieldElement) {
|
|
119
|
+
// update position
|
|
120
|
+
if (state.canvas.canvasInvalidated || state.viewer.modeChanged) {
|
|
121
|
+
this.updateFormFieldElementPosition();
|
|
122
|
+
}
|
|
123
|
+
// handle click events
|
|
124
|
+
if (state.pointer.action === 'click') {
|
|
125
|
+
const pointerCssPos = {
|
|
126
|
+
x: state.pointer.x.cssPixels,
|
|
127
|
+
y: state.pointer.y.cssPixels,
|
|
128
|
+
};
|
|
129
|
+
const insideHorizontal = pointerCssPos.x > this.formFieldElement.offsetLeft &&
|
|
130
|
+
pointerCssPos.x < this.formFieldElement.offsetLeft + this.formFieldElement.offsetWidth;
|
|
131
|
+
const insideVertical = pointerCssPos.y > this.formFieldElement.offsetTop &&
|
|
132
|
+
pointerCssPos.y < this.formFieldElement.offsetTop + this.formFieldElement.offsetHeight;
|
|
133
|
+
if (!insideHorizontal || !insideVertical) {
|
|
134
|
+
this.blur();
|
|
135
|
+
const annotationsOnPoint = this.pdfApi.getAnnotationsOnPoint({
|
|
136
|
+
x: state.pointer.x.devicePixels,
|
|
137
|
+
y: state.pointer.y.devicePixels,
|
|
138
|
+
});
|
|
139
|
+
if (annotationsOnPoint && annotationsOnPoint.length) {
|
|
140
|
+
for (let i = 0; i < annotationsOnPoint.length; i++) {
|
|
141
|
+
const annotationOnPoint = annotationsOnPoint[i];
|
|
142
|
+
if (annotationOnPoint.itemType === PdfItemType.WIDGET &&
|
|
143
|
+
!annotationOnPoint.widget.readOnly) {
|
|
144
|
+
this.pdfViewerCanvas.activateModule('FormFieldModule', {
|
|
145
|
+
annotationId: annotationOnPoint.id,
|
|
146
|
+
action: 'click',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (state.document.zoomChanged || state.viewer.modeChanged) {
|
|
156
|
+
(_a = this.widgetEditor) === null || _a === void 0 ? void 0 : _a.setZoom(state.document.zoom);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
updateFormFieldElementPosition() {
|
|
160
|
+
if (this.widgetAnnotation && this.formFieldElement) {
|
|
161
|
+
const screenRect = this.pdfApi.transformPdfPageRectToScreenRect(this.widgetAnnotation.pdfRect);
|
|
162
|
+
this.formFieldElement.style.left = `${screenRect.x / devicePixelRatio - 2}px`;
|
|
163
|
+
this.formFieldElement.style.top = `${screenRect.y / devicePixelRatio - 2}px`;
|
|
164
|
+
this.formFieldElement.style.width = `${screenRect.w / devicePixelRatio + 1}px`;
|
|
165
|
+
this.formFieldElement.style.height = `${screenRect.h / devicePixelRatio + 1}px`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
selectNextFormField(reverse) {
|
|
169
|
+
if (this.widgetAnnotation) {
|
|
170
|
+
const { annotations, document } = this.store.getState();
|
|
171
|
+
const pageCount = this.pdfApi.getPageCount();
|
|
172
|
+
const getNextFormFieldOnPage = (pageNumber, index) => {
|
|
173
|
+
const list = annotations.byPage[pageNumber];
|
|
174
|
+
for (let i = index; i < list.length; i++) {
|
|
175
|
+
const annotId = list[i];
|
|
176
|
+
const annotation = annotations.all[annotId];
|
|
177
|
+
if (annotation.itemType === PdfItemType.WIDGET &&
|
|
178
|
+
!annotation.widget.readOnly) {
|
|
179
|
+
return annotation;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (pageCount === 1 && index === 0) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
const nextPage = pageCount > pageNumber ? pageNumber + 1 : 1;
|
|
186
|
+
return getNextFormFieldOnPage(nextPage, 0);
|
|
187
|
+
};
|
|
188
|
+
const getPreviewsFormFieldOnPage = (pageNumber, index) => {
|
|
189
|
+
const list = annotations.byPage[pageNumber];
|
|
190
|
+
const start = index < 0 ? list.length - 1 : index;
|
|
191
|
+
for (let i = start; i >= 0; i--) {
|
|
192
|
+
const annotId = list[i];
|
|
193
|
+
const annotation = annotations.all[annotId];
|
|
194
|
+
if (annotation.itemType === PdfItemType.WIDGET &&
|
|
195
|
+
!annotation.widget.readOnly) {
|
|
196
|
+
return annotation;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (pageNumber === 1) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
return getPreviewsFormFieldOnPage(pageNumber - 1, -1);
|
|
203
|
+
};
|
|
204
|
+
const currentWidgetIndex = annotations.byPage[this.widgetAnnotation.page].findIndex((a) => { var _a; return a === ((_a = this.widgetAnnotation) === null || _a === void 0 ? void 0 : _a.id); });
|
|
205
|
+
let currentPage = this.widgetAnnotation.page;
|
|
206
|
+
let nextFormField = null;
|
|
207
|
+
if (reverse) {
|
|
208
|
+
if (currentWidgetIndex === 0) {
|
|
209
|
+
if (currentPage === 1) {
|
|
210
|
+
nextFormField = this.widgetAnnotation;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
nextFormField = getPreviewsFormFieldOnPage(this.widgetAnnotation.page - 1, -1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
nextFormField = getPreviewsFormFieldOnPage(this.widgetAnnotation.page, currentWidgetIndex - 1);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
nextFormField = getNextFormFieldOnPage(this.widgetAnnotation.page, currentWidgetIndex + 1);
|
|
222
|
+
}
|
|
223
|
+
if (nextFormField) {
|
|
224
|
+
this.blur();
|
|
225
|
+
this.pdfViewerCanvas.activateModule('FormFieldModule', {
|
|
226
|
+
annotationId: nextFormField.id,
|
|
227
|
+
action: 'select',
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
blur() {
|
|
233
|
+
if (this.hasFocus) {
|
|
234
|
+
this.hasFocus = false;
|
|
235
|
+
this.remove();
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
export declare class FormFieldModule extends CanvasModule {
|
|
3
|
+
static moduleInfo: {
|
|
4
|
+
name: string;
|
|
5
|
+
moduleType: CanvasModuleType;
|
|
6
|
+
requiredFeatures: {
|
|
7
|
+
annotate: boolean;
|
|
8
|
+
fillFormFields: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
constructor();
|
|
12
|
+
onRegister(): {};
|
|
13
|
+
activate(args: any): void;
|
|
14
|
+
onEdit(args: any): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CanvasModule, CanvasModuleType } from '../CanvasModule';
|
|
2
|
+
import { EditFormFieldLayer } from './EditFormFieldLayer';
|
|
3
|
+
export class FormFieldModule extends CanvasModule {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.name = FormFieldModule.moduleInfo.name;
|
|
7
|
+
}
|
|
8
|
+
onRegister() {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
activate(args) {
|
|
12
|
+
if (!this.canvasLayers['edit']) {
|
|
13
|
+
this.onEdit(args);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
onEdit(args) {
|
|
17
|
+
this.createCanvasLayer('edit', EditFormFieldLayer, args);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
FormFieldModule.moduleInfo = {
|
|
21
|
+
name: 'FormFieldModule',
|
|
22
|
+
moduleType: CanvasModuleType.Layer,
|
|
23
|
+
requiredFeatures: {
|
|
24
|
+
annotate: false,
|
|
25
|
+
fillFormFields: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export class ListBoxWidget extends WidgetBase {
|
|
3
|
+
createFormField() {
|
|
4
|
+
const formField = document.createElement('select');
|
|
5
|
+
formField.setAttribute('required', 'true');
|
|
6
|
+
if (this.widget.multiSelectAllowed) {
|
|
7
|
+
formField.setAttribute('multiple', 'true');
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
formField.setAttribute('size', `${this.widget.options.size}`);
|
|
11
|
+
}
|
|
12
|
+
formField.classList.add('pwv-formField__ListBox');
|
|
13
|
+
const values = Array.from(this.widget.chosen.values());
|
|
14
|
+
for (let i = 0; i < this.widget.options.size; i++) {
|
|
15
|
+
const value = this.widget.options.get(i);
|
|
16
|
+
const item = document.createElement('option');
|
|
17
|
+
item.value = i.toString();
|
|
18
|
+
item.textContent = value;
|
|
19
|
+
formField.appendChild(item);
|
|
20
|
+
item.selected = values.includes(i);
|
|
21
|
+
}
|
|
22
|
+
this.handleOnChange = this.handleOnChange.bind(this);
|
|
23
|
+
this.handleOnKeyDown = this.handleOnKeyDown.bind(this);
|
|
24
|
+
this.handleOnBlur = this.handleOnBlur.bind(this);
|
|
25
|
+
formField.addEventListener('change', this.handleOnChange);
|
|
26
|
+
formField.addEventListener('keydown', this.handleOnKeyDown);
|
|
27
|
+
formField.addEventListener('blur', this.handleOnBlur);
|
|
28
|
+
formField.addEventListener('wheel', (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
});
|
|
31
|
+
return formField;
|
|
32
|
+
}
|
|
33
|
+
onRemove() {
|
|
34
|
+
this.editorElement.removeEventListener('change', this.handleOnChange);
|
|
35
|
+
this.editorElement.removeEventListener('keydown', this.handleOnKeyDown);
|
|
36
|
+
this.editorElement.removeEventListener('blur', this.handleOnBlur);
|
|
37
|
+
}
|
|
38
|
+
setFocus() {
|
|
39
|
+
this.editorElement.focus();
|
|
40
|
+
}
|
|
41
|
+
handleOnKeyDown(e) {
|
|
42
|
+
if (e.code === 'Tab') {
|
|
43
|
+
this.onTab(e.shiftKey);
|
|
44
|
+
}
|
|
45
|
+
else if (e.code === 'Escape') {
|
|
46
|
+
this.onBlur();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
handleOnBlur(e) {
|
|
50
|
+
this.onBlur();
|
|
51
|
+
}
|
|
52
|
+
handleOnChange(e) {
|
|
53
|
+
let selectedOptions = [];
|
|
54
|
+
if (!e.target.value) {
|
|
55
|
+
const value = Array.from(this.widget.chosen.values()).shift();
|
|
56
|
+
selectedOptions = [value];
|
|
57
|
+
e.target.value = value;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
selectedOptions = [...e.target.options]
|
|
61
|
+
.filter((o) => o.selected)
|
|
62
|
+
.map((o) => parseInt(o.value));
|
|
63
|
+
if (!this.widget.multiSelectAllowed) {
|
|
64
|
+
const value = selectedOptions[0];
|
|
65
|
+
selectedOptions = [value];
|
|
66
|
+
e.target.value = value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
this.widget.chosen.clear();
|
|
70
|
+
selectedOptions.forEach((o) => this.widget.chosen.add(o));
|
|
71
|
+
this.saveWidget();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export declare class RadioButtonWidget extends WidgetBase {
|
|
3
|
+
createFormField(): HTMLLabelElement;
|
|
4
|
+
onRemove(): void;
|
|
5
|
+
setFocus(): void;
|
|
6
|
+
private handleOnKeyDown;
|
|
7
|
+
private handleOnBlur;
|
|
8
|
+
private handleOnChange;
|
|
9
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export class RadioButtonWidget extends WidgetBase {
|
|
3
|
+
createFormField() {
|
|
4
|
+
const formField = document.createElement('label');
|
|
5
|
+
formField.classList.add('pwv-formField__RadioButton');
|
|
6
|
+
formField.style.overflow = 'hidden';
|
|
7
|
+
const radio = document.createElement('input');
|
|
8
|
+
radio.type = 'radio';
|
|
9
|
+
radio.checked = this.widget.selected;
|
|
10
|
+
radio.style.position = 'absolute';
|
|
11
|
+
radio.style.top = '-20px';
|
|
12
|
+
radio.style.left = '-20px';
|
|
13
|
+
formField.appendChild(radio);
|
|
14
|
+
this.handleOnChange = this.handleOnChange.bind(this);
|
|
15
|
+
this.handleOnKeyDown = this.handleOnKeyDown.bind(this);
|
|
16
|
+
this.handleOnBlur = this.handleOnBlur.bind(this);
|
|
17
|
+
formField.addEventListener('change', this.handleOnChange);
|
|
18
|
+
formField.addEventListener('keydown', this.handleOnKeyDown);
|
|
19
|
+
formField.addEventListener('blur', this.handleOnBlur);
|
|
20
|
+
return formField;
|
|
21
|
+
}
|
|
22
|
+
onRemove() {
|
|
23
|
+
this.editorElement.removeEventListener('change', this.handleOnChange);
|
|
24
|
+
this.editorElement.removeEventListener('keydown', this.handleOnKeyDown);
|
|
25
|
+
this.editorElement.removeEventListener('blur', this.handleOnBlur);
|
|
26
|
+
}
|
|
27
|
+
setFocus() {
|
|
28
|
+
this.editorElement.focus();
|
|
29
|
+
}
|
|
30
|
+
handleOnKeyDown(e) {
|
|
31
|
+
if (e.code === 'Tab') {
|
|
32
|
+
this.onTab(e.shiftKey);
|
|
33
|
+
}
|
|
34
|
+
else if (e.code === 'Escape') {
|
|
35
|
+
this.onBlur();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
handleOnBlur(e) {
|
|
39
|
+
this.onBlur();
|
|
40
|
+
}
|
|
41
|
+
handleOnChange(e) {
|
|
42
|
+
this.widget.push();
|
|
43
|
+
this.saveWidget();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export declare class SelectListWidget extends WidgetBase {
|
|
3
|
+
createFormField(): HTMLSelectElement;
|
|
4
|
+
onRemove(): void;
|
|
5
|
+
setFocus(): void;
|
|
6
|
+
private handleOnKeyDown;
|
|
7
|
+
private handleOnBlur;
|
|
8
|
+
private handleOnChange;
|
|
9
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export class SelectListWidget extends WidgetBase {
|
|
3
|
+
createFormField() {
|
|
4
|
+
const formField = document.createElement('select');
|
|
5
|
+
formField.classList.add('pwv-formField__SelectList');
|
|
6
|
+
for (let i = 0; i < this.widget.options.size; i++) {
|
|
7
|
+
const value = this.widget.options.get(i);
|
|
8
|
+
const item = document.createElement('option');
|
|
9
|
+
item.value = i.toString();
|
|
10
|
+
item.textContent = value;
|
|
11
|
+
formField.appendChild(item);
|
|
12
|
+
}
|
|
13
|
+
formField.value = this.widget.chosen;
|
|
14
|
+
this.handleOnChange = this.handleOnChange.bind(this);
|
|
15
|
+
this.handleOnKeyDown = this.handleOnKeyDown.bind(this);
|
|
16
|
+
this.handleOnBlur = this.handleOnBlur.bind(this);
|
|
17
|
+
formField.addEventListener('change', this.handleOnChange);
|
|
18
|
+
formField.addEventListener('keydown', this.handleOnKeyDown);
|
|
19
|
+
formField.addEventListener('blur', this.handleOnBlur);
|
|
20
|
+
return formField;
|
|
21
|
+
}
|
|
22
|
+
onRemove() {
|
|
23
|
+
// this.editorElement.removeEventListener('change', this.handleOnChange)
|
|
24
|
+
// this.editorElement.removeEventListener('keydown', this.handleOnKeyDown)
|
|
25
|
+
// this.editorElement.removeEventListener('blur', this.handleOnBlur)
|
|
26
|
+
}
|
|
27
|
+
setFocus() {
|
|
28
|
+
this.editorElement.focus();
|
|
29
|
+
}
|
|
30
|
+
handleOnKeyDown(e) {
|
|
31
|
+
if (e.code === 'Tab') {
|
|
32
|
+
this.onTab(e.shiftKey);
|
|
33
|
+
}
|
|
34
|
+
else if (e.code === 'Escape') {
|
|
35
|
+
this.onBlur();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
handleOnBlur(e) {
|
|
39
|
+
this.onBlur();
|
|
40
|
+
}
|
|
41
|
+
handleOnChange(e) {
|
|
42
|
+
this.widget.chosen = parseInt(e.target.value);
|
|
43
|
+
this.saveWidget();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export declare class TextBoxWidget extends WidgetBase {
|
|
3
|
+
createFormField(): HTMLInputElement | HTMLTextAreaElement;
|
|
4
|
+
onRemove(): void;
|
|
5
|
+
setFocus(): void;
|
|
6
|
+
private handleOnKeyDown;
|
|
7
|
+
private handleOnBlur;
|
|
8
|
+
private handleOnChange;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { WidgetBase } from './WidgetBase';
|
|
2
|
+
export class TextBoxWidget extends WidgetBase {
|
|
3
|
+
createFormField() {
|
|
4
|
+
const formField = this.widget.multilineAllowed
|
|
5
|
+
? document.createElement('textarea')
|
|
6
|
+
: document.createElement('input');
|
|
7
|
+
formField.classList.add('pwv-formField__TextBox');
|
|
8
|
+
if (this.widget.text) {
|
|
9
|
+
formField.value = this.widget.text;
|
|
10
|
+
}
|
|
11
|
+
if (this.widget.maxLength && this.widget.maxLength >= 0) {
|
|
12
|
+
formField.maxLength = this.widget.maxLength;
|
|
13
|
+
}
|
|
14
|
+
if (this.widget.comb) {
|
|
15
|
+
formField.style.letterSpacing = '1em';
|
|
16
|
+
}
|
|
17
|
+
this.handleOnChange = this.handleOnChange.bind(this);
|
|
18
|
+
this.handleOnKeyDown = this.handleOnKeyDown.bind(this);
|
|
19
|
+
this.handleOnBlur = this.handleOnBlur.bind(this);
|
|
20
|
+
formField.addEventListener('input', this.handleOnChange);
|
|
21
|
+
formField.addEventListener('keydown', this.handleOnKeyDown);
|
|
22
|
+
formField.addEventListener('blur', this.handleOnBlur);
|
|
23
|
+
return formField;
|
|
24
|
+
}
|
|
25
|
+
onRemove() {
|
|
26
|
+
// this.editorElement.removeEventListener('change', this.handleOnChange)
|
|
27
|
+
// this.editorElement.removeEventListener('keydown', this.handleOnKeyDown)
|
|
28
|
+
// this.editorElement.removeEventListener('blur', this.handleOnBlur)
|
|
29
|
+
}
|
|
30
|
+
setFocus() {
|
|
31
|
+
this.editorElement.focus();
|
|
32
|
+
}
|
|
33
|
+
handleOnKeyDown(e) {
|
|
34
|
+
if (e.code === 'Tab') {
|
|
35
|
+
this.onTab(e.shiftKey);
|
|
36
|
+
}
|
|
37
|
+
else if (e.code === 'Escape') {
|
|
38
|
+
this.onBlur();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleOnBlur(e) {
|
|
42
|
+
this.onBlur();
|
|
43
|
+
}
|
|
44
|
+
handleOnChange(e) {
|
|
45
|
+
try {
|
|
46
|
+
this.widget.text = e.target.value;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
console.warn(err);
|
|
50
|
+
}
|
|
51
|
+
this.saveWidget();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WidgetType } from '../../pdf-viewer-api/enums';
|
|
2
|
+
export interface WidgetBaseOptions {
|
|
3
|
+
widgetType: WidgetType;
|
|
4
|
+
widget: any;
|
|
5
|
+
pdfDocument: any;
|
|
6
|
+
onTab: (shiftKey: boolean) => void;
|
|
7
|
+
onBlur: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class WidgetBase {
|
|
10
|
+
protected element: HTMLElement;
|
|
11
|
+
protected widgetType: WidgetType;
|
|
12
|
+
protected widget: any;
|
|
13
|
+
protected pdfDocument: any;
|
|
14
|
+
protected editorElement: HTMLElement;
|
|
15
|
+
protected onTab: (shiftKey: boolean) => void;
|
|
16
|
+
protected onBlur: () => void;
|
|
17
|
+
constructor(element: HTMLElement, options: WidgetBaseOptions);
|
|
18
|
+
protected abstract createFormField(): HTMLElement;
|
|
19
|
+
protected saveWidget(): void;
|
|
20
|
+
abstract setFocus(): void;
|
|
21
|
+
abstract onRemove(): void;
|
|
22
|
+
setZoom(zoom: number): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class WidgetBase {
|
|
2
|
+
constructor(element, options) {
|
|
3
|
+
this.element = element;
|
|
4
|
+
this.widgetType = options.widgetType;
|
|
5
|
+
this.widget = options.widget;
|
|
6
|
+
this.pdfDocument = options.pdfDocument;
|
|
7
|
+
this.onTab = options.onTab;
|
|
8
|
+
this.onBlur = options.onBlur;
|
|
9
|
+
this.editorElement = this.createFormField();
|
|
10
|
+
this.editorElement.classList.add('pwv-formField__Element');
|
|
11
|
+
this.element.appendChild(this.editorElement);
|
|
12
|
+
window.setTimeout(() => {
|
|
13
|
+
this.setFocus();
|
|
14
|
+
}, 1);
|
|
15
|
+
}
|
|
16
|
+
saveWidget() {
|
|
17
|
+
this.pdfDocument
|
|
18
|
+
.editAnnotation(this.widget)
|
|
19
|
+
.then(() => { })
|
|
20
|
+
.catch((err) => {
|
|
21
|
+
console.warn(err);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
setZoom(zoom) {
|
|
25
|
+
this.editorElement.style.transform = `scale(${zoom})`;
|
|
26
|
+
this.editorElement.style.width = this.element.clientWidth / zoom + 'px';
|
|
27
|
+
this.editorElement.style.height = this.element.clientHeight / zoom + 'px';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CanvasLayer } from '../CanvasLayer';
|
|
2
|
+
import { ViewerCanvasState } from '../../pdf-viewer-canvas/state/store';
|
|
3
|
+
export declare class AddFreetextAnnotationLayer extends CanvasLayer {
|
|
4
|
+
private context;
|
|
5
|
+
private colors;
|
|
6
|
+
private selectedColor;
|
|
7
|
+
private borderWidths;
|
|
8
|
+
private pointerDown;
|
|
9
|
+
private startPoint;
|
|
10
|
+
private page;
|
|
11
|
+
onCreate(): void;
|
|
12
|
+
onSave(): Promise<void>;
|
|
13
|
+
onRemove(): void;
|
|
14
|
+
render(timestamp: number, state: ViewerCanvasState): void;
|
|
15
|
+
private setColor;
|
|
16
|
+
private setBorderWidth;
|
|
17
|
+
private close;
|
|
18
|
+
private createFreeTextAnnotation;
|
|
19
|
+
}
|