import { Options } from 'vue-class-component' ; import { ComponentBase , EJComponentDecorator , getProps , allVue , gh } from '@syncfusion/ej2-vue-base' ; import { isNullOrUndefined , getValue } from '@syncfusion/ej2-base' ; import { PdfViewer } from '@syncfusion/ej2-pdfviewer' ; export const properties = [ 'isLazyUpdate' , 'DropdownFieldSettings' , 'ajaxRequestSettings' , 'annotationSelectorSettings' , 'annotationSettings' , 'annotations' , 'areaSettings' , 'arrowSettings' , 'checkBoxFieldSettings' , 'circleSettings' , 'contextMenuOption' , 'contextMenuSettings' , 'currentPageNumber' , 'customStamp' , 'customStampSettings' , 'dateTimeFormat' , 'designerMode' , 'disableContextMenuItems' , 'distanceSettings' , 'documentPath' , 'downloadFileName' , 'drawingObject' , 'enableAnnotation' , 'enableAnnotationToolbar' , 'enableAutoComplete' , 'enableBookmark' , 'enableBookmarkStyles' , 'enableCommentPanel' , 'enableDesktopMode' , 'enableDownload' , 'enableFormDesigner' , 'enableFormDesignerToolbar' , 'enableFormFields' , 'enableFormFieldsValidation' , 'enableFreeText' , 'enableHandwrittenSignature' , 'enableHyperlink' , 'enableImportAnnotationMeasurement' , 'enableInkAnnotation' , 'enableMagnification' , 'enableMeasureAnnotation' , 'enableMultiLineOverlap' , 'enableMultiPageAnnotation' , 'enableNavigation' , 'enableNavigationToolbar' , 'enablePersistence' , 'enablePinchZoom' , 'enablePrint' , 'enablePrintRotation' , 'enableRtl' , 'enableShapeAnnotation' , 'enableShapeLabel' , 'enableStampAnnotations' , 'enableStickyNotesAnnotation' , 'enableTextMarkupAnnotation' , 'enableTextMarkupResizer' , 'enableTextSearch' , 'enableTextSelection' , 'enableThumbnail' , 'enableToolbar' , 'enableZoomOptimization' , 'exportAnnotationFileName' , 'formFieldCollections' , 'formFields' , 'freeTextSettings' , 'handWrittenSignatureSettings' , 'height' , 'hideSaveSignature' , 'highlightSettings' , 'hyperlinkOpenState' , 'initialDialogSettings' , 'initialFieldSettings' , 'inkAnnotationSettings' , 'interactionMode' , 'isAnnotationToolbarOpen' , 'isAnnotationToolbarVisible' , 'isBookmarkPanelOpen' , 'isCommandPanelOpen' , 'isDocumentEdited' , 'isExtractText' , 'isFormDesignerToolbarVisible' , 'isFormFieldDocument' , 'isInitialFieldToolbarSelection' , 'isMaintainSelection' , 'isSignatureEditable' , 'isThumbnailViewOpen' , 'isValidFreeText' , 'lineSettings' , 'listBoxFieldSettings' , 'locale' , 'measurementSettings' , 'pageCount' , 'passwordFieldSettings' , 'perimeterSettings' , 'polygonSettings' , 'printMode' , 'radioButtonFieldSettings' , 'radiusSettings' , 'rectangleSettings' , 'restrictZoomRequest' , 'retryCount' , 'scrollSettings' , 'selectedItems' , 'serverActionSettings' , 'serviceUrl' , 'shapeLabelSettings' , 'showNotificationDialog' , 'signatureDialogSettings' , 'signatureFieldSettings' , 'signatureFitMode' , 'stampSettings' , 'stickyNotesSettings' , 'strikethroughSettings' , 'textFieldSettings' , 'textSearchColorSettings' , 'tileRenderingSettings' , 'toolbarSettings' , 'underlineSettings' , 'volumeSettings' , 'width' , 'zoomMode' , 'zoomValue' , 'addSignature' , 'ajaxRequestFailed' , 'ajaxRequestInitiate' , 'ajaxRequestSuccess' , 'annotationAdd' , 'annotationDoubleClick' , 'annotationMouseLeave' , 'annotationMouseover' , 'annotationMove' , 'annotationMoving' , 'annotationPropertiesChange' , 'annotationRemove' , 'annotationResize' , 'annotationSelect' , 'annotationUnSelect' , 'beforeAddFreeText' , 'bookmarkClick' , 'buttonFieldClick' , 'commentAdd' , 'commentDelete' , 'commentEdit' , 'commentSelect' , 'commentStatusChanged' , 'created' , 'documentLoad' , 'documentLoadFailed' , 'documentUnload' , 'downloadEnd' , 'downloadStart' , 'exportFailed' , 'exportStart' , 'exportSuccess' , 'extractTextCompleted' , 'formFieldAdd' , 'formFieldClick' , 'formFieldDoubleClick' , 'formFieldFocusOut' , 'formFieldMouseLeave' , 'formFieldMouseover' , 'formFieldMove' , 'formFieldPropertiesChange' , 'formFieldRemove' , 'formFieldResize' , 'formFieldSelect' , 'formFieldUnselect' , 'hyperlinkClick' , 'hyperlinkMouseOver' , 'importFailed' , 'importStart' , 'importSuccess' , 'moveSignature' , 'pageChange' , 'pageClick' , 'pageMouseover' , 'printEnd' , 'printStart' , 'removeSignature' , 'resizeSignature' , 'signaturePropertiesChange' , 'signatureSelect' , 'textSearchComplete' , 'textSearchHighlight' , 'textSearchStart' , 'textSelectionEnd' , 'textSelectionStart' , 'thumbnailClick' , 'validateFormFields' , 'zoomChange' ] ; export const modelProps = [ ] ; export const testProp = getProps ( { props : properties } ) ; export const props = testProp [ 0 ] ; export const watch = testProp [ 1 ] ; export const emitProbs = Object . keys ( watch ) ; emitProbs . push ( 'modelchanged' ) ; for ( let props of modelProps ) { emitProbs . push ( 'update:' + props ) ; } export const isExecute = gh ? false : true ; /**
 * `ejs-pdfviewer` represents the VueJS PdfViewer Component.
 * ```vue
 * <ejs-pdfviewer></ejs-pdfviewer>
 * ```
 */ @ EJComponentDecorator ( { props : properties } , isExecute ) export class PdfViewerComponent extends ComponentBase { public ej2Instances : any ; public propKeys : string [ ] = properties ; public models : string [ ] = modelProps ; public hasChildDirective : boolean = false ; protected hasInjectedModules : boolean = true ; public tagMapper : { [ key ] : Object ; } = { } ; public tagNameMapper : Object = { } ; public isVue3 : boolean ; public templateCollection : any ; constructor ( ) { super ( arguments ) ; this . isVue3 = ! isExecute ; this . ej2Instances = new PdfViewer ( { } ) ; this . bindProperties ( ) ; this . ej2Instances . _setProperties = this . ej2Instances . setProperties ; this . ej2Instances . setProperties = this . setProperties ; this . ej2Instances . clearTemplate = this . clearTemplate ; } public clearTemplate ( templateNames ? ) { if ( ! templateNames ) { templateNames = Object . keys ( this . templateCollection || { } ) ; } if ( templateNames . length && this . templateCollection ) { for ( let tempName of templateNames ) { let elementCollection = this . templateCollection [ tempName ] ; if ( elementCollection && elementCollection . length ) { for ( let ele of elementCollection ) { let destroy = getValue ( '__vue__.$destroy' , ele ) ; if ( destroy ) { ele . __vue__ . $destroy ( ) ; } if ( ele . innerHTML ) { ele . innerHTML = '' ; } } delete this . templateCollection [ tempName ] ; } } } } public setProperties ( prop , muteOnChange ) { if ( this . isVue3 ) { this . models = ! this . models ? this . ej2Instances . referModels : this . models ; } if ( this . ej2Instances && this . ej2Instances . _setProperties ) { this . ej2Instances . _setProperties ( prop , muteOnChange ) ; } if ( prop && this . models && this . models . length ) { Object . keys ( prop ) . map ( ( key ) : void => { this . models . map ( ( model ) : void => { if ( ( key === model ) && ! ( /datasource/i . test ( key ) ) ) { if ( this . isVue3 ) { this . ej2Instances . vueInstance . $emit ( 'update:' + key , prop [ key ] ) ; } else { ( this as any ) . $emit ( 'update:' + key , prop [ key ] ) ; ( this as any ) . $emit ( 'modelchanged' , prop [ key ] ) ; } } } ) ; } ) ; } } public render ( createElement ) { let h = gh || createElement ; let slots = null ; if ( ! isNullOrUndefined ( ( this as any ) . $slots . default ) ) { slots = gh ? ( this as any ) . $slots . default ( ) : ( this as any ) . $slots . default ; } return h ( 'div' , slots ) ; } public addAnnotation ( annotation ) { return this . ej2Instances . addAnnotation ( annotation ) ; } public clearFormFields ( formField ? ) { return this . ej2Instances . clearFormFields ( formField ) ; } public deleteAnnotations ( ) { return this . ej2Instances . deleteAnnotations ( ) ; } public download ( ) { return this . ej2Instances . download ( ) ; } public exportAnnotation ( annotationDataFormat ? ) { return this . ej2Instances . exportAnnotation ( annotationDataFormat ) ; } public exportAnnotationsAsObject ( ) { return this . ej2Instances . exportAnnotationsAsObject ( ) ; } public exportFormFields ( path ? ) { return this . ej2Instances . exportFormFields ( path ) ; } public exportFormFieldsAsObject ( ) { return this . ej2Instances . exportFormFieldsAsObject ( ) ; } public importAnnotation ( importData , annotationDataFormat ? ) { return this . ej2Instances . importAnnotation ( importData , annotationDataFormat ) ; } public importFormFields ( formFields ) { return this . ej2Instances . importFormFields ( formFields ) ; } public load ( document , password ) { return this . ej2Instances . load ( document , password ) ; } public redo ( ) { return this . ej2Instances . redo ( ) ; } public requiredModules ( ) { return this . ej2Instances . requiredModules ( ) ; } public resetFormFields ( ) { return this . ej2Instances . resetFormFields ( ) ; } public retrieveFormFields ( ) { return this . ej2Instances . retrieveFormFields ( ) ; } public saveAsBlob ( ) { return this . ej2Instances . saveAsBlob ( ) ; } public setJsonData ( jsonData ) { return this . ej2Instances . setJsonData ( jsonData ) ; } public showNotificationPopup ( errorString ) { return this . ej2Instances . showNotificationPopup ( errorString ) ; } public undo ( ) { return this . ej2Instances . undo ( ) ; } public unload ( ) { return this . ej2Instances . unload ( ) ; } public updateFormFields ( formFields ) { return this . ej2Instances . updateFormFields ( formFields ) ; } public updateFormFieldsValue ( fieldValue ) { return this . ej2Instances . updateFormFieldsValue ( fieldValue ) ; } public updateViewerContainer ( ) { return this . ej2Instances . updateViewerContainer ( ) ; } } export const PdfViewerPlugin = { name : 'ejs-pdfviewer' , install ( Vue ) { Vue . component ( PdfViewerPlugin . name , PdfViewerComponent ) ; } } ;