@progress/kendo-react-pdf-viewer 6.1.1 → 7.0.0-develop.10
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 +1 -1
- package/{dist/npm/PDFViewer.d.ts → PDFViewer.d.ts} +5 -2
- package/dist/cdn/js/kendo-react-pdf-viewer.js +5 -2
- package/{dist/es/main.d.ts → index.d.ts} +5 -1
- package/index.js +5 -0
- package/index.mjs +514 -0
- package/{dist/es/messages.d.ts → messages.d.ts} +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +36 -65
- package/about.md +0 -3
- package/dist/cdn/js/kendo-react-pdf-viewer.js.LICENSE.txt +0 -21
- package/dist/es/PDFViewer.d.ts +0 -208
- package/dist/es/PDFViewer.js +0 -493
- package/dist/es/main.js +0 -30
- package/dist/es/messages.js +0 -85
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/npm/PDFViewer.js +0 -496
- package/dist/npm/main.d.ts +0 -29
- package/dist/npm/main.js +0 -35
- package/dist/npm/messages.d.ts +0 -85
- package/dist/npm/messages.js +0 -88
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/systemjs/kendo-react-pdf-viewer.js +0 -10
- package/dist/systemjs/kendo-react-pdf-viewer.txt +0 -0
- package/e2e-legacy/snapshots/pdf-viewer.png +0 -0
- package/e2e-next/basic.tests.ts +0 -23
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
export { PDFViewer, type PDFViewerProps, type PDFViewerHandle, type PDFViewerTool, type LoadEvent, type ErrorEvent, type DownloadEvent, type ZoomEvent, type PageEvent } from './PDFViewer';
|
|
2
6
|
export { currentPage } from '@progress/kendo-pdfviewer-common';
|
|
3
7
|
/**
|
|
4
8
|
* Scrolls the PDFViewer document to the passed page number.
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-pdfviewer-common"),et=require("react"),tt=require("prop-types"),u=require("@progress/kendo-react-buttons"),ge=require("@progress/kendo-react-inputs"),ot=require("@progress/kendo-react-data-tools"),nt=require("@progress/kendo-react-upload"),at=require("@progress/kendo-react-dropdowns"),rt=require("@progress/kendo-react-indicators"),R=require("@progress/kendo-react-common"),ct=require("@progress/kendo-react-intl"),g=require("@progress/kendo-svg-icons");require("pdfjs-dist/build/pdf.worker.entry");function ve(o){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const w in o)if(w!=="default"){const x=Object.getOwnPropertyDescriptor(o,w);Object.defineProperty(y,w,x.get?x:{enumerable:!0,get:()=>o[w]})}}return y.default=o,Object.freeze(y)}const e=ve(et),c=ve(tt),fe={name:"@progress/kendo-react-pdf-viewer",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1673300081,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"},A="pdfviewer.zoomIn",U="pdfviewer.zoomOut",W="pdfviewer.enableSelection",K="pdfviewer.enablePanning",T="pdfviewer.search",V="pdfviewer.open",H="pdfviewer.download",G="pdfviewer.print",$="pdfviewer.close",J="pdfviewer.matchCase",Q="pdfviewer.prevMatch",X="pdfviewer.nextMatch",he="pdfviewer.actualWidth",ke="pdfviewer.fitToWidth",be="pdfviewer.fitToPage",Y="pdfviewer.popupBlocked",d={[A]:"Zoom in",[U]:"Zoom out",[W]:"Enable selection",[K]:"Enable panning",[T]:"Search",[V]:"Open",[H]:"Download",[G]:"Print",[$]:"Close",[J]:"Match case",[Q]:"Previous match",[X]:"Next match",[he]:"Actual width",[ke]:"Fit to width",[be]:"Fit to page",[Y]:"Popup is blocked."},pe=["pager","spacer","zoomInOut","zoom","selection","spacer","search","open","download","print"],C={minZoom:.5,maxZoom:4,tools:[...pe],zoomRate:.25,zoomLevels:[{id:1,priority:1,value:1,text:"Actual width",type:"ActualWidth",locationString:he},{id:2,priority:2,value:1,text:"Fit to width",type:"FitToWidth",locationString:ke},{id:3,priority:3,value:1,text:"Fit to page",type:"FitToPage",locationString:be},{id:4,priority:4,value:.5,text:"50%",type:""},{id:5,priority:5,value:.75,text:"75%",type:""},{id:6,priority:100,value:1,text:"100%",type:""},{id:7,priority:7,value:1.25,text:"125%",type:""},{id:8,priority:8,value:1.5,text:"150%",type:""},{id:9,priority:9,value:2,text:"200%",type:""},{id:10,priority:10,value:3,text:"300%",type:""},{id:11,priority:11,value:4,text:"400%",type:""}],defaultZoom:s.DEFAULT_ZOOM_LEVEL},lt=[".k-toolbar > button",".k-toolbar .k-combobox > input",".k-toolbar .k-button-group > button",".k-toolbar .k-pager > a",".k-toolbar .k-pager input"],st=(o,y)=>o.priority>y.priority?-1:o.priority<y.priority?1:0,M=e.forwardRef((o,y)=>{R.validatePackage(fe);const w=R.shouldShowValidationUI(fe),{zoom:x,zoomLevels:ee=C.zoomLevels,defaultZoom:O=C.defaultZoom,minZoom:D=C.minZoom,maxZoom:B=C.maxZoom,zoomRate:Z=C.zoomRate}=o,i=ct.useLocalization(),l=e.useRef(null),[ye,I]=e.useState(O),f=x!==void 0?x:ye,P=ee.slice().sort(st).find(n=>n.value===f)||{text:f*100+"%",value:f,id:f,locationString:""};P.locationString&&(P.text=i.toLanguageString(P.locationString,d[P.locationString]));const[v,F]=e.useState(!1),[Ce,b]=e.useState(!0),[z,te]=e.useState(0),[L,oe]=e.useState(!1),[we,ne]=e.useState(!1),[p,q]=e.useState(0),[h,E]=e.useState(0),[S,ae]=e.useState(!1),[_,re]=e.useState(""),t=e.useMemo(()=>({}),[]);t.currentZoom=f,t.props=o;const ce=e.useCallback(n=>{l.current&&l.current.style.setProperty("--scale-factor",String(n))},[]),k=e.useRef(null),N=e.useRef(null);e.useImperativeHandle(k,()=>({get element(){return N.current},props:o,get pages(){return t.pages},get document(){return t.document}}),[]),e.useImperativeHandle(y,()=>k.current);const Ee=e.useCallback(()=>{if(t.props.onLoad){const n={target:k.current};t.props.onLoad.call(void 0,n)}},[]),le=e.useCallback((n,a,r)=>{if(o.onDownload){const m={target:k.current,blob:n,fileName:a,saveOptions:r};return o.onDownload.call(void 0,m)===!1}return!1},[o.onDownload]),Se=e.useCallback(()=>{var n;t.scroller&&t.scroller.destroy(),t.scroller=new s.Scroller((n=l.current)==null?void 0:n.parentNode,{filter:".k-page",events:{}}),t.scroller.enablePanEventsTracking()},[]),xe=e.useCallback(n=>{const a=Array.from(n.querySelectorAll(".k-text-layer"));t.search=new s.SearchService({textContainers:a||[],highlightClass:"k-search-highlight",highlightMarkClass:"k-search-highlight-mark",charClass:"k-text-char"})},[]);t.done=e.useCallback(({pdfPages:n,pdfDoc:a,zoom:r})=>{t.document=a,t.pages=n,t.zoom=r,Se(),b(!1),F(!0),Ee(),l.current&&s.scrollToPage(l.current,0)},[]),t.error=e.useCallback(n=>{if(t.document=null,t.pages=[],b(!1),F(!1),o.onError){const a={error:typeof n=="string"?{message:n}:n,target:k.current};o.onError.call(void 0,a)}},[o.onError]),e.useEffect(()=>{l.current&&(o.url||o.data||o.arrayBuffer?(b(!0),s.removeChildren(l.current),s.loadPDF({url:o.url,data:o.data,arrayBuffer:o.arrayBuffer,dom:l.current,zoom:t.currentZoom,done:t.done,error:t.error}),ce(t.currentZoom)):(t.document=null,t.pages=[],F(!1),b(!1),s.removeChildren(l.current)))},[o.url,o.data,o.arrayBuffer]);const se=e.useCallback((n,a)=>{l.current&&(b(!0),s.removeChildren(l.current),s.reloadDocument({pdfDoc:n,zoom:a,dom:l.current,done:r=>{t.pages=r,t.zoom=a,b(!1)},error:t.error}))},[]);e.useEffect(()=>{ce(f),l.current&&t.document&&f!==t.zoom&&se(t.document,f)},[f,se]),e.useEffect(()=>()=>{t.scroller&&t.scroller.destroy(),t.search&&t.search.destroy(),t.document=null,t.pages=[]},[]);const Pe=e.useCallback(()=>{ne(!0),xe(l.current)},[]),Te=e.useCallback(n=>{const a=n.value,r=t.search.search({text:a,matchCase:S});E(r.length?1:0),q(r.length),re(a)},[S]),Ze=e.useCallback(()=>{const n=t.search.search({text:_,matchCase:!S});E(n.length?1:0),q(n.length),ae(!S)},[S,_]),Ie=e.useCallback(()=>{s.goToNextSearchMatch(t),E(h+1>p?1:h+1)},[h,p]),ze=e.useCallback(()=>{s.goToPreviousSearchMatch(t),E(h-1<1?p:h-1)},[h,p]),ie=e.useCallback(()=>{t.search.destroy(),E(0),q(0),ae(!1),re(""),ne(!1)},[]),Le=e.useCallback(n=>{n.key==="Enter"?(n.preventDefault(),s.goToNextSearchMatch(t),E(h+1>p?1:h+1)):n.key==="Escape"&&ie()},[h,p]),Ne=e.useCallback(n=>{if(l.current){const a=n.skip;s.scrollToPage(l.current,a);const r={page:a+1,target:k.current,syntheticEvent:n.syntheticEvent};o.onPageChange&&o.onPageChange.call(void 0,r)}te(n.skip)},[z,o.onPageChange]),Re=e.useCallback(n=>{if(N.current){const a=s.currentPage(N.current);if(a!==z){te(a);const r={page:a+1,target:k.current,syntheticEvent:n};o.onPageChange&&o.onPageChange.call(void 0,r)}}},[z,o.onPageChange]),Me=e.useCallback(n=>{const a=Math.min(t.currentZoom+Z,B);if(a!==t.currentZoom&&t.document&&(I(a),o.onZoom)){const r={zoom:a,target:k.current,syntheticEvent:n};o.onZoom.call(void 0,r)}},[Z,B,o.onZoom]),Oe=e.useCallback(n=>{const a=Math.max(t.currentZoom-Z,D);if(a!==t.currentZoom&&t.document&&(I(a),o.onZoom)){const r={zoom:a,target:k.current,syntheticEvent:n};o.onZoom.call(void 0,r)}},[Z,D,o.onZoom]),De=e.useCallback(n=>{const a=n.value===null?{text:"100%",value:1,id:100}:{...n.value};if(a.value===void 0){const m=parseFloat(a.text);typeof m=="number"&&!Number.isNaN(m)?a.value=m/100:a.value=1}let r=a?s.calculateZoomLevel(a.value,a.type,t.currentZoom,l.current):1;if(r=Math.round(r*100)/100,t.currentZoom!==r&&t.document&&(I(r),o.onZoom)){const m={zoom:r,target:k.current,syntheticEvent:n.syntheticEvent};o.onZoom.call(void 0,m)}},[o.onZoom]),Be=e.useCallback(()=>{t.scroller.disablePanEventsTracking(),oe(!0)},[]),Fe=e.useCallback(()=>{t.scroller.enablePanEventsTracking(),oe(!1)},[]),qe=e.useCallback(()=>{s.download({pdf:t.document,error:t.error},o.saveFileName,o.saveOptions,le)},[o.url,o.data,o.arrayBuffer,o.saveFileName,o.saveOptions,le]),_e=e.useCallback(()=>{b(!0);const n=r=>{t.error(typeof(r?r.message||r:null)=="string"?r.message||r:i.toLanguageString(Y,d[Y]))},a=()=>{b(!1)};s.print(t.pages,a,n)},[]),je=e.useCallback(n=>{const a=n.newState;a[0]&&a[0].getRawFile&&a[0].getRawFile().arrayBuffer().then(m=>{if(l.current){b(!0),s.removeChildren(l.current);const j=t.props.zoom===void 0?O:t.props.zoom;s.loadPDF({arrayBuffer:m,dom:l.current,zoom:j,done:t.done,error:t.error}),I(j)}})},[O]),Ae=e.useCallback(n=>{const a=n.target;if(a instanceof Element&&a.parentNode){const r=a.closest(".k-toolbar"),m=r&&r.querySelector(".k-upload input");m&&m.click()}},[]),ue=Ce&&e.createElement("div",{className:"k-loader-container k-loader-container-md k-loader-top"},e.createElement("div",{className:"k-loader-container-overlay k-overlay-light"}),e.createElement("div",{className:"k-loader-container-inner "},e.createElement(rt.Loader,{size:"large"}))),Ue=e.createElement(u.ButtonGroup,null,e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(U,d[U]),disabled:f<=D||!v,onClick:Oe,icon:"zoom-out",svgIcon:g.zoomOutIcon}),e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(A,d[A]),disabled:f>=B||!v,onClick:Me,icon:"zoom-in",svgIcon:g.zoomInIcon})),We=e.createElement(at.ComboBox,{disabled:!v,data:ee.map(n=>({...n,text:n.locationString?i.toLanguageString(n.locationString,d[n.locationString]):n.text})),dataItemKey:"id",textField:"text",value:v?P:null,allowCustom:!0,onChange:De}),Ke=e.createElement(ot.Pager,{previousNext:!0,type:"input",skip:z,take:1,total:t.pages?t.pages.length:0,info:!1,onPageChange:Ne}),Ve=e.createElement(u.ToolbarSpacer,null),He=e.createElement(u.ButtonGroup,null,e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(W,d[W]),icon:"pointer",svgIcon:g.pointerIcon,disabled:!v,togglable:!0,selected:L&&v,onClick:Be}),e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(K,d[K]),icon:"hand",svgIcon:g.handIcon,disabled:!v,togglable:!0,selected:!L&&v,onClick:Fe})),Ge=e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(T,d[T]),icon:"search",svgIcon:g.searchIcon,disabled:!v,onClick:Pe}),$e=e.createElement(e.Fragment,null,e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(V,d[V]),icon:"folder-open",svgIcon:g.folderOpenIcon,onClick:Ae}),e.createElement("div",{style:{display:"none"}},e.createElement(nt.Upload,{restrictions:{allowedExtensions:[".pdf"]},onAdd:je,autoUpload:!1,defaultFiles:[],multiple:!1,accept:".pdf,.PDF",withCredentials:!1}))),Je=e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(H,d[H]),icon:"download",svgIcon:g.downloadIcon,disabled:!v,onClick:qe}),Qe=e.createElement(u.Button,{className:"k-toolbar-button",title:i.toLanguageString(G,d[G]),icon:"print",svgIcon:g.printIcon,disabled:!v,onClick:_e}),Xe={pager:Ke,spacer:Ve,zoomInOut:Ue,zoom:We,selection:He,search:Ge,open:$e,download:Je,print:Qe},Ye=(o.tools||C.tools).map(n=>Xe[n]),de=e.createElement(u.Toolbar,{buttons:lt},...Ye),me=e.createElement("div",{className:R.classNames("k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto",{"k-enable-text-select":L,"k-enable-panning":!L}),onScroll:Re},we&&e.createElement("div",{className:"k-search-panel k-pos-sticky k-top-center"},e.createElement(ge.TextBox,{value:_,onChange:Te,placeholder:i.toLanguageString(T,d[T]),autoFocus:!0,onKeyDown:Le,suffix:()=>e.createElement(ge.InputSuffix,null,e.createElement(u.Button,{icon:"convert-lowercase",svgIcon:g.convertLowercaseIcon,title:i.toLanguageString(J,d[J]),fillMode:"flat",togglable:!0,selected:S,onClick:Ze}))}),e.createElement("span",{className:"k-search-matches"},e.createElement("span",null,h)," of ",e.createElement("span",null,p)),e.createElement(u.Button,{title:i.toLanguageString(Q,d[Q]),fillMode:"flat",icon:"arrow-up",svgIcon:g.arrowUpIcon,disabled:p===0,onClick:ze}),e.createElement(u.Button,{title:i.toLanguageString(X,d[X]),fillMode:"flat",icon:"arrow-down",svgIcon:g.arrowDownIcon,disabled:p===0,onClick:Ie}),e.createElement(u.Button,{title:i.toLanguageString($,d[$]),fillMode:"flat",icon:"x",svgIcon:g.xIcon,onClick:ie})),e.createElement("div",{ref:l,className:"k-pdf-viewer-pages"}));return e.createElement("div",{className:"k-pdf-viewer",style:o.style,ref:N},o.onRenderLoader?o.onRenderLoader.call(void 0,ue||null):ue,o.onRenderToolbar?o.onRenderToolbar.call(void 0,de):de,o.onRenderContent?o.onRenderContent.call(void 0,me):me,w&&e.createElement(R.WatermarkOverlay,null))});M.displayName="KendoReactPDFViewer";M.propTypes={url:c.string,data:c.string,arrayBuffer:c.any,typedArray:c.any,style:c.object,saveFileName:c.string,saveOptions:c.object,tools:c.arrayOf(c.oneOf(pe).isRequired),zoomLevels:c.arrayOf(c.any),zoom:c.number,defaultZoom:c.number,minZoom:c.number,maxZoom:c.number,zoomRate:c.number,onError:c.func,onLoad:c.func,onDownload:c.func,onRenderToolbar:c.func,onRenderContent:c.func,onRenderLoader:c.func,onZoom:c.func};M.defaultProps=C;const it=s.scrollToPage;Object.defineProperty(exports,"currentPage",{enumerable:!0,get:()=>s.currentPage});exports.PDFViewer=M;exports.scrollToPage=it;
|
package/index.mjs
ADDED
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Scroller as et, SearchService as tt, scrollToPage as F, removeChildren as L, loadPDF as me, reloadDocument as ot, goToNextSearchMatch as de, goToPreviousSearchMatch as nt, currentPage as at, calculateZoomLevel as rt, download as lt, print as ct, DEFAULT_ZOOM_LEVEL as st } from "@progress/kendo-pdfviewer-common";
|
|
6
|
+
import { currentPage as Jt } from "@progress/kendo-pdfviewer-common";
|
|
7
|
+
import * as e from "react";
|
|
8
|
+
import * as l from "prop-types";
|
|
9
|
+
import { ButtonGroup as ge, Button as m, Toolbar as it, ToolbarSpacer as ut } from "@progress/kendo-react-buttons";
|
|
10
|
+
import { TextBox as mt, InputSuffix as dt } from "@progress/kendo-react-inputs";
|
|
11
|
+
import { Pager as gt } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { Upload as ft } from "@progress/kendo-react-upload";
|
|
13
|
+
import { ComboBox as vt } from "@progress/kendo-react-dropdowns";
|
|
14
|
+
import { Loader as ht } from "@progress/kendo-react-indicators";
|
|
15
|
+
import { validatePackage as pt, shouldShowValidationUI as kt, classNames as bt, WatermarkOverlay as yt } from "@progress/kendo-react-common";
|
|
16
|
+
import { useLocalization as Et } from "@progress/kendo-react-intl";
|
|
17
|
+
import { zoomOutIcon as wt, zoomInIcon as Ct, pointerIcon as St, handIcon as xt, searchIcon as Zt, folderOpenIcon as Pt, downloadIcon as zt, printIcon as Lt, convertLowercaseIcon as Tt, arrowUpIcon as It, arrowDownIcon as Nt, xIcon as Mt } from "@progress/kendo-svg-icons";
|
|
18
|
+
import "pdfjs-dist/build/pdf.worker.entry";
|
|
19
|
+
const fe = {
|
|
20
|
+
name: "@progress/kendo-react-pdf-viewer",
|
|
21
|
+
productName: "KendoReact",
|
|
22
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
23
|
+
publishDate: 1701439801,
|
|
24
|
+
version: "",
|
|
25
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
26
|
+
}, B = "pdfviewer.zoomIn", A = "pdfviewer.zoomOut", U = "pdfviewer.enableSelection", W = "pdfviewer.enablePanning", w = "pdfviewer.search", K = "pdfviewer.open", V = "pdfviewer.download", _ = "pdfviewer.print", $ = "pdfviewer.close", j = "pdfviewer.matchCase", q = "pdfviewer.prevMatch", H = "pdfviewer.nextMatch", ve = "pdfviewer.actualWidth", he = "pdfviewer.fitToWidth", pe = "pdfviewer.fitToPage", G = "pdfviewer.popupBlocked", i = {
|
|
27
|
+
[B]: "Zoom in",
|
|
28
|
+
[A]: "Zoom out",
|
|
29
|
+
[U]: "Enable selection",
|
|
30
|
+
[W]: "Enable panning",
|
|
31
|
+
[w]: "Search",
|
|
32
|
+
[K]: "Open",
|
|
33
|
+
[V]: "Download",
|
|
34
|
+
[_]: "Print",
|
|
35
|
+
[$]: "Close",
|
|
36
|
+
[j]: "Match case",
|
|
37
|
+
[q]: "Previous match",
|
|
38
|
+
[H]: "Next match",
|
|
39
|
+
[ve]: "Actual width",
|
|
40
|
+
[he]: "Fit to width",
|
|
41
|
+
[pe]: "Fit to page",
|
|
42
|
+
[G]: "Popup is blocked."
|
|
43
|
+
}, ke = [
|
|
44
|
+
"pager",
|
|
45
|
+
"spacer",
|
|
46
|
+
"zoomInOut",
|
|
47
|
+
"zoom",
|
|
48
|
+
"selection",
|
|
49
|
+
"spacer",
|
|
50
|
+
"search",
|
|
51
|
+
"open",
|
|
52
|
+
"download",
|
|
53
|
+
"print"
|
|
54
|
+
], k = {
|
|
55
|
+
minZoom: 0.5,
|
|
56
|
+
maxZoom: 4,
|
|
57
|
+
tools: [...ke],
|
|
58
|
+
zoomRate: 0.25,
|
|
59
|
+
zoomLevels: [
|
|
60
|
+
{ id: 1, priority: 1, value: 1, text: "Actual width", type: "ActualWidth", locationString: ve },
|
|
61
|
+
{ id: 2, priority: 2, value: 1, text: "Fit to width", type: "FitToWidth", locationString: he },
|
|
62
|
+
{ id: 3, priority: 3, value: 1, text: "Fit to page", type: "FitToPage", locationString: pe },
|
|
63
|
+
{ id: 4, priority: 4, value: 0.5, text: "50%", type: "" },
|
|
64
|
+
{ id: 5, priority: 5, value: 0.75, text: "75%", type: "" },
|
|
65
|
+
{ id: 6, priority: 100, value: 1, text: "100%", type: "" },
|
|
66
|
+
{ id: 7, priority: 7, value: 1.25, text: "125%", type: "" },
|
|
67
|
+
{ id: 8, priority: 8, value: 1.5, text: "150%", type: "" },
|
|
68
|
+
{ id: 9, priority: 9, value: 2, text: "200%", type: "" },
|
|
69
|
+
{ id: 10, priority: 10, value: 3, text: "300%", type: "" },
|
|
70
|
+
{ id: 11, priority: 11, value: 4, text: "400%", type: "" }
|
|
71
|
+
],
|
|
72
|
+
defaultZoom: st
|
|
73
|
+
}, Rt = [
|
|
74
|
+
".k-toolbar > button",
|
|
75
|
+
".k-toolbar .k-combobox > input",
|
|
76
|
+
".k-toolbar .k-button-group > button",
|
|
77
|
+
".k-toolbar .k-pager > a",
|
|
78
|
+
".k-toolbar .k-pager input"
|
|
79
|
+
], Dt = (n, C) => n.priority > C.priority ? -1 : n.priority < C.priority ? 1 : 0, J = e.forwardRef((n, C) => {
|
|
80
|
+
pt(fe);
|
|
81
|
+
const be = kt(fe), {
|
|
82
|
+
zoom: Q,
|
|
83
|
+
zoomLevels: X = k.zoomLevels,
|
|
84
|
+
defaultZoom: T = k.defaultZoom,
|
|
85
|
+
minZoom: I = k.minZoom,
|
|
86
|
+
maxZoom: N = k.maxZoom,
|
|
87
|
+
zoomRate: S = k.zoomRate
|
|
88
|
+
} = n, s = Et(), c = e.useRef(null), [ye, x] = e.useState(T), d = Q !== void 0 ? Q : ye, E = X.slice().sort(Dt).find((o) => o.value === d) || { text: d * 100 + "%", value: d, id: d, locationString: "" };
|
|
89
|
+
E.locationString && (E.text = s.toLanguageString(E.locationString, i[E.locationString]));
|
|
90
|
+
const [g, M] = e.useState(!1), [Ee, h] = e.useState(!0), [Z, Y] = e.useState(0), [P, ee] = e.useState(!1), [we, te] = e.useState(!1), [p, R] = e.useState(0), [f, b] = e.useState(0), [y, oe] = e.useState(!1), [D, ne] = e.useState(""), t = e.useMemo(() => ({}), []);
|
|
91
|
+
t.currentZoom = d, t.props = n;
|
|
92
|
+
const ae = e.useCallback((o) => {
|
|
93
|
+
c.current && c.current.style.setProperty("--scale-factor", String(o));
|
|
94
|
+
}, []), v = e.useRef(null), z = e.useRef(null);
|
|
95
|
+
e.useImperativeHandle(v, () => ({
|
|
96
|
+
get element() {
|
|
97
|
+
return z.current;
|
|
98
|
+
},
|
|
99
|
+
props: n,
|
|
100
|
+
get pages() {
|
|
101
|
+
return t.pages;
|
|
102
|
+
},
|
|
103
|
+
get document() {
|
|
104
|
+
return t.document;
|
|
105
|
+
}
|
|
106
|
+
}), []), e.useImperativeHandle(C, () => v.current);
|
|
107
|
+
const Ce = e.useCallback(() => {
|
|
108
|
+
if (t.props.onLoad) {
|
|
109
|
+
const o = { target: v.current };
|
|
110
|
+
t.props.onLoad.call(void 0, o);
|
|
111
|
+
}
|
|
112
|
+
}, []), re = e.useCallback((o, a, r) => {
|
|
113
|
+
if (n.onDownload) {
|
|
114
|
+
const u = {
|
|
115
|
+
target: v.current,
|
|
116
|
+
blob: o,
|
|
117
|
+
fileName: a,
|
|
118
|
+
saveOptions: r
|
|
119
|
+
};
|
|
120
|
+
return n.onDownload.call(void 0, u) === !1;
|
|
121
|
+
}
|
|
122
|
+
return !1;
|
|
123
|
+
}, [n.onDownload]), Se = e.useCallback(() => {
|
|
124
|
+
var o;
|
|
125
|
+
t.scroller && t.scroller.destroy(), t.scroller = new et((o = c.current) == null ? void 0 : o.parentNode, {
|
|
126
|
+
filter: ".k-page",
|
|
127
|
+
events: {}
|
|
128
|
+
}), t.scroller.enablePanEventsTracking();
|
|
129
|
+
}, []), xe = e.useCallback((o) => {
|
|
130
|
+
const a = Array.from(o.querySelectorAll(".k-text-layer"));
|
|
131
|
+
t.search = new tt({
|
|
132
|
+
textContainers: a || [],
|
|
133
|
+
highlightClass: "k-search-highlight",
|
|
134
|
+
highlightMarkClass: "k-search-highlight-mark",
|
|
135
|
+
charClass: "k-text-char"
|
|
136
|
+
});
|
|
137
|
+
}, []);
|
|
138
|
+
t.done = e.useCallback(({ pdfPages: o, pdfDoc: a, zoom: r }) => {
|
|
139
|
+
t.document = a, t.pages = o, t.zoom = r, Se(), h(!1), M(!0), Ce(), c.current && F(c.current, 0);
|
|
140
|
+
}, []), t.error = e.useCallback((o) => {
|
|
141
|
+
if (t.document = null, t.pages = [], h(!1), M(!1), n.onError) {
|
|
142
|
+
const a = {
|
|
143
|
+
error: typeof o == "string" ? { message: o } : o,
|
|
144
|
+
target: v.current
|
|
145
|
+
};
|
|
146
|
+
n.onError.call(void 0, a);
|
|
147
|
+
}
|
|
148
|
+
}, [n.onError]), e.useEffect(() => {
|
|
149
|
+
c.current && (n.url || n.data || n.arrayBuffer ? (h(!0), L(c.current), me({
|
|
150
|
+
url: n.url,
|
|
151
|
+
data: n.data,
|
|
152
|
+
arrayBuffer: n.arrayBuffer,
|
|
153
|
+
dom: c.current,
|
|
154
|
+
zoom: t.currentZoom,
|
|
155
|
+
done: t.done,
|
|
156
|
+
error: t.error
|
|
157
|
+
}), ae(t.currentZoom)) : (t.document = null, t.pages = [], M(!1), h(!1), L(c.current)));
|
|
158
|
+
}, [n.url, n.data, n.arrayBuffer]);
|
|
159
|
+
const le = e.useCallback((o, a) => {
|
|
160
|
+
c.current && (h(!0), L(c.current), ot({
|
|
161
|
+
pdfDoc: o,
|
|
162
|
+
zoom: a,
|
|
163
|
+
dom: c.current,
|
|
164
|
+
done: (r) => {
|
|
165
|
+
t.pages = r, t.zoom = a, h(!1);
|
|
166
|
+
},
|
|
167
|
+
error: t.error
|
|
168
|
+
}));
|
|
169
|
+
}, []);
|
|
170
|
+
e.useEffect(() => {
|
|
171
|
+
ae(d), c.current && t.document && d !== t.zoom && le(t.document, d);
|
|
172
|
+
}, [d, le]), e.useEffect(() => () => {
|
|
173
|
+
t.scroller && t.scroller.destroy(), t.search && t.search.destroy(), t.document = null, t.pages = [];
|
|
174
|
+
}, []);
|
|
175
|
+
const Ze = e.useCallback(() => {
|
|
176
|
+
te(!0), xe(c.current);
|
|
177
|
+
}, []), Pe = e.useCallback((o) => {
|
|
178
|
+
const a = o.value, r = t.search.search({ text: a, matchCase: y });
|
|
179
|
+
b(r.length ? 1 : 0), R(r.length), ne(a);
|
|
180
|
+
}, [y]), ze = e.useCallback(() => {
|
|
181
|
+
const o = t.search.search({ text: D, matchCase: !y });
|
|
182
|
+
b(o.length ? 1 : 0), R(o.length), oe(!y);
|
|
183
|
+
}, [y, D]), Le = e.useCallback(() => {
|
|
184
|
+
de(t), b(f + 1 > p ? 1 : f + 1);
|
|
185
|
+
}, [f, p]), Te = e.useCallback(() => {
|
|
186
|
+
nt(t), b(f - 1 < 1 ? p : f - 1);
|
|
187
|
+
}, [f, p]), ce = e.useCallback(() => {
|
|
188
|
+
t.search.destroy(), b(0), R(0), oe(!1), ne(""), te(!1);
|
|
189
|
+
}, []), Ie = e.useCallback((o) => {
|
|
190
|
+
o.key === "Enter" ? (o.preventDefault(), de(t), b(f + 1 > p ? 1 : f + 1)) : o.key === "Escape" && ce();
|
|
191
|
+
}, [f, p]), Ne = e.useCallback((o) => {
|
|
192
|
+
if (c.current) {
|
|
193
|
+
const a = o.skip;
|
|
194
|
+
F(c.current, a);
|
|
195
|
+
const r = {
|
|
196
|
+
page: a + 1,
|
|
197
|
+
target: v.current,
|
|
198
|
+
syntheticEvent: o.syntheticEvent
|
|
199
|
+
};
|
|
200
|
+
n.onPageChange && n.onPageChange.call(void 0, r);
|
|
201
|
+
}
|
|
202
|
+
Y(o.skip);
|
|
203
|
+
}, [Z, n.onPageChange]), Me = e.useCallback((o) => {
|
|
204
|
+
if (z.current) {
|
|
205
|
+
const a = at(z.current);
|
|
206
|
+
if (a !== Z) {
|
|
207
|
+
Y(a);
|
|
208
|
+
const r = {
|
|
209
|
+
page: a + 1,
|
|
210
|
+
target: v.current,
|
|
211
|
+
syntheticEvent: o
|
|
212
|
+
};
|
|
213
|
+
n.onPageChange && n.onPageChange.call(void 0, r);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}, [Z, n.onPageChange]), Re = e.useCallback((o) => {
|
|
217
|
+
const a = Math.min(t.currentZoom + S, N);
|
|
218
|
+
if (a !== t.currentZoom && t.document && (x(a), n.onZoom)) {
|
|
219
|
+
const r = {
|
|
220
|
+
zoom: a,
|
|
221
|
+
target: v.current,
|
|
222
|
+
syntheticEvent: o
|
|
223
|
+
};
|
|
224
|
+
n.onZoom.call(void 0, r);
|
|
225
|
+
}
|
|
226
|
+
}, [S, N, n.onZoom]), De = e.useCallback((o) => {
|
|
227
|
+
const a = Math.max(t.currentZoom - S, I);
|
|
228
|
+
if (a !== t.currentZoom && t.document && (x(a), n.onZoom)) {
|
|
229
|
+
const r = {
|
|
230
|
+
zoom: a,
|
|
231
|
+
target: v.current,
|
|
232
|
+
syntheticEvent: o
|
|
233
|
+
};
|
|
234
|
+
n.onZoom.call(void 0, r);
|
|
235
|
+
}
|
|
236
|
+
}, [S, I, n.onZoom]), Oe = e.useCallback((o) => {
|
|
237
|
+
const a = o.value === null ? { text: "100%", value: 1, id: 100 } : { ...o.value };
|
|
238
|
+
if (a.value === void 0) {
|
|
239
|
+
const u = parseFloat(a.text);
|
|
240
|
+
typeof u == "number" && !Number.isNaN(u) ? a.value = u / 100 : a.value = 1;
|
|
241
|
+
}
|
|
242
|
+
let r = a ? rt(a.value, a.type, t.currentZoom, c.current) : 1;
|
|
243
|
+
if (r = Math.round(r * 100) / 100, t.currentZoom !== r && t.document && (x(r), n.onZoom)) {
|
|
244
|
+
const u = {
|
|
245
|
+
zoom: r,
|
|
246
|
+
target: v.current,
|
|
247
|
+
syntheticEvent: o.syntheticEvent
|
|
248
|
+
};
|
|
249
|
+
n.onZoom.call(void 0, u);
|
|
250
|
+
}
|
|
251
|
+
}, [n.onZoom]), Fe = e.useCallback(() => {
|
|
252
|
+
t.scroller.disablePanEventsTracking(), ee(!0);
|
|
253
|
+
}, []), Be = e.useCallback(() => {
|
|
254
|
+
t.scroller.enablePanEventsTracking(), ee(!1);
|
|
255
|
+
}, []), Ae = e.useCallback(() => {
|
|
256
|
+
lt({
|
|
257
|
+
pdf: t.document,
|
|
258
|
+
error: t.error
|
|
259
|
+
}, n.saveFileName, n.saveOptions, re);
|
|
260
|
+
}, [n.url, n.data, n.arrayBuffer, n.saveFileName, n.saveOptions, re]), Ue = e.useCallback(() => {
|
|
261
|
+
h(!0);
|
|
262
|
+
const o = (r) => {
|
|
263
|
+
t.error(typeof (r ? r.message || r : null) == "string" ? r.message || r : s.toLanguageString(G, i[G]));
|
|
264
|
+
}, a = () => {
|
|
265
|
+
h(!1);
|
|
266
|
+
};
|
|
267
|
+
ct(t.pages, a, o);
|
|
268
|
+
}, []), We = e.useCallback((o) => {
|
|
269
|
+
const a = o.newState;
|
|
270
|
+
a[0] && a[0].getRawFile && a[0].getRawFile().arrayBuffer().then((u) => {
|
|
271
|
+
if (c.current) {
|
|
272
|
+
h(!0), L(c.current);
|
|
273
|
+
const O = t.props.zoom === void 0 ? T : t.props.zoom;
|
|
274
|
+
me({
|
|
275
|
+
arrayBuffer: u,
|
|
276
|
+
dom: c.current,
|
|
277
|
+
zoom: O,
|
|
278
|
+
done: t.done,
|
|
279
|
+
error: t.error
|
|
280
|
+
}), x(O);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}, [T]), Ke = e.useCallback((o) => {
|
|
284
|
+
const a = o.target;
|
|
285
|
+
if (a instanceof Element && a.parentNode) {
|
|
286
|
+
const r = a.closest(".k-toolbar"), u = r && r.querySelector(".k-upload input");
|
|
287
|
+
u && u.click();
|
|
288
|
+
}
|
|
289
|
+
}, []), se = Ee && /* @__PURE__ */ e.createElement("div", { className: "k-loader-container k-loader-container-md k-loader-top" }, /* @__PURE__ */ e.createElement("div", { className: "k-loader-container-overlay k-overlay-light" }), /* @__PURE__ */ e.createElement("div", { className: "k-loader-container-inner " }, /* @__PURE__ */ e.createElement(ht, { size: "large" }))), Ve = /* @__PURE__ */ e.createElement(ge, null, /* @__PURE__ */ e.createElement(
|
|
290
|
+
m,
|
|
291
|
+
{
|
|
292
|
+
className: "k-toolbar-button",
|
|
293
|
+
title: s.toLanguageString(A, i[A]),
|
|
294
|
+
disabled: d <= I || !g,
|
|
295
|
+
onClick: De,
|
|
296
|
+
icon: "zoom-out",
|
|
297
|
+
svgIcon: wt
|
|
298
|
+
}
|
|
299
|
+
), /* @__PURE__ */ e.createElement(
|
|
300
|
+
m,
|
|
301
|
+
{
|
|
302
|
+
className: "k-toolbar-button",
|
|
303
|
+
title: s.toLanguageString(B, i[B]),
|
|
304
|
+
disabled: d >= N || !g,
|
|
305
|
+
onClick: Re,
|
|
306
|
+
icon: "zoom-in",
|
|
307
|
+
svgIcon: Ct
|
|
308
|
+
}
|
|
309
|
+
)), _e = /* @__PURE__ */ e.createElement(
|
|
310
|
+
vt,
|
|
311
|
+
{
|
|
312
|
+
disabled: !g,
|
|
313
|
+
data: X.map(
|
|
314
|
+
(o) => ({
|
|
315
|
+
...o,
|
|
316
|
+
text: o.locationString ? s.toLanguageString(o.locationString, i[o.locationString]) : o.text
|
|
317
|
+
})
|
|
318
|
+
),
|
|
319
|
+
dataItemKey: "id",
|
|
320
|
+
textField: "text",
|
|
321
|
+
value: g ? E : null,
|
|
322
|
+
allowCustom: !0,
|
|
323
|
+
onChange: Oe
|
|
324
|
+
}
|
|
325
|
+
), $e = /* @__PURE__ */ e.createElement(
|
|
326
|
+
gt,
|
|
327
|
+
{
|
|
328
|
+
previousNext: !0,
|
|
329
|
+
type: "input",
|
|
330
|
+
skip: Z,
|
|
331
|
+
take: 1,
|
|
332
|
+
total: t.pages ? t.pages.length : 0,
|
|
333
|
+
info: !1,
|
|
334
|
+
onPageChange: Ne
|
|
335
|
+
}
|
|
336
|
+
), je = /* @__PURE__ */ e.createElement(ut, null), qe = /* @__PURE__ */ e.createElement(ge, null, /* @__PURE__ */ e.createElement(
|
|
337
|
+
m,
|
|
338
|
+
{
|
|
339
|
+
className: "k-toolbar-button",
|
|
340
|
+
title: s.toLanguageString(U, i[U]),
|
|
341
|
+
icon: "pointer",
|
|
342
|
+
svgIcon: St,
|
|
343
|
+
disabled: !g,
|
|
344
|
+
togglable: !0,
|
|
345
|
+
selected: P && g,
|
|
346
|
+
onClick: Fe
|
|
347
|
+
}
|
|
348
|
+
), /* @__PURE__ */ e.createElement(
|
|
349
|
+
m,
|
|
350
|
+
{
|
|
351
|
+
className: "k-toolbar-button",
|
|
352
|
+
title: s.toLanguageString(W, i[W]),
|
|
353
|
+
icon: "hand",
|
|
354
|
+
svgIcon: xt,
|
|
355
|
+
disabled: !g,
|
|
356
|
+
togglable: !0,
|
|
357
|
+
selected: !P && g,
|
|
358
|
+
onClick: Be
|
|
359
|
+
}
|
|
360
|
+
)), He = /* @__PURE__ */ e.createElement(
|
|
361
|
+
m,
|
|
362
|
+
{
|
|
363
|
+
className: "k-toolbar-button",
|
|
364
|
+
title: s.toLanguageString(w, i[w]),
|
|
365
|
+
icon: "search",
|
|
366
|
+
svgIcon: Zt,
|
|
367
|
+
disabled: !g,
|
|
368
|
+
onClick: Ze
|
|
369
|
+
}
|
|
370
|
+
), Ge = /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
371
|
+
m,
|
|
372
|
+
{
|
|
373
|
+
className: "k-toolbar-button",
|
|
374
|
+
title: s.toLanguageString(K, i[K]),
|
|
375
|
+
icon: "folder-open",
|
|
376
|
+
svgIcon: Pt,
|
|
377
|
+
onClick: Ke
|
|
378
|
+
}
|
|
379
|
+
), /* @__PURE__ */ e.createElement("div", { style: { display: "none" } }, /* @__PURE__ */ e.createElement(
|
|
380
|
+
ft,
|
|
381
|
+
{
|
|
382
|
+
restrictions: { allowedExtensions: [".pdf"] },
|
|
383
|
+
onAdd: We,
|
|
384
|
+
autoUpload: !1,
|
|
385
|
+
defaultFiles: [],
|
|
386
|
+
multiple: !1,
|
|
387
|
+
accept: ".pdf,.PDF",
|
|
388
|
+
withCredentials: !1
|
|
389
|
+
}
|
|
390
|
+
))), Je = /* @__PURE__ */ e.createElement(
|
|
391
|
+
m,
|
|
392
|
+
{
|
|
393
|
+
className: "k-toolbar-button",
|
|
394
|
+
title: s.toLanguageString(V, i[V]),
|
|
395
|
+
icon: "download",
|
|
396
|
+
svgIcon: zt,
|
|
397
|
+
disabled: !g,
|
|
398
|
+
onClick: Ae
|
|
399
|
+
}
|
|
400
|
+
), Qe = /* @__PURE__ */ e.createElement(
|
|
401
|
+
m,
|
|
402
|
+
{
|
|
403
|
+
className: "k-toolbar-button",
|
|
404
|
+
title: s.toLanguageString(_, i[_]),
|
|
405
|
+
icon: "print",
|
|
406
|
+
svgIcon: Lt,
|
|
407
|
+
disabled: !g,
|
|
408
|
+
onClick: Ue
|
|
409
|
+
}
|
|
410
|
+
), Xe = {
|
|
411
|
+
pager: $e,
|
|
412
|
+
spacer: je,
|
|
413
|
+
zoomInOut: Ve,
|
|
414
|
+
zoom: _e,
|
|
415
|
+
selection: qe,
|
|
416
|
+
search: He,
|
|
417
|
+
open: Ge,
|
|
418
|
+
download: Je,
|
|
419
|
+
print: Qe
|
|
420
|
+
}, Ye = (n.tools || k.tools).map((o) => Xe[o]), ie = /* @__PURE__ */ e.createElement(it, { buttons: Rt }, ...Ye), ue = /* @__PURE__ */ e.createElement(
|
|
421
|
+
"div",
|
|
422
|
+
{
|
|
423
|
+
className: bt("k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto", {
|
|
424
|
+
"k-enable-text-select": P,
|
|
425
|
+
"k-enable-panning": !P
|
|
426
|
+
}),
|
|
427
|
+
onScroll: Me
|
|
428
|
+
},
|
|
429
|
+
we && /* @__PURE__ */ e.createElement("div", { className: "k-search-panel k-pos-sticky k-top-center" }, /* @__PURE__ */ e.createElement(
|
|
430
|
+
mt,
|
|
431
|
+
{
|
|
432
|
+
value: D,
|
|
433
|
+
onChange: Pe,
|
|
434
|
+
placeholder: s.toLanguageString(w, i[w]),
|
|
435
|
+
autoFocus: !0,
|
|
436
|
+
onKeyDown: Ie,
|
|
437
|
+
suffix: () => /* @__PURE__ */ e.createElement(dt, null, /* @__PURE__ */ e.createElement(
|
|
438
|
+
m,
|
|
439
|
+
{
|
|
440
|
+
icon: "convert-lowercase",
|
|
441
|
+
svgIcon: Tt,
|
|
442
|
+
title: s.toLanguageString(j, i[j]),
|
|
443
|
+
fillMode: "flat",
|
|
444
|
+
togglable: !0,
|
|
445
|
+
selected: y,
|
|
446
|
+
onClick: ze
|
|
447
|
+
}
|
|
448
|
+
))
|
|
449
|
+
}
|
|
450
|
+
), /* @__PURE__ */ e.createElement("span", { className: "k-search-matches" }, /* @__PURE__ */ e.createElement("span", null, f), " of ", /* @__PURE__ */ e.createElement("span", null, p)), /* @__PURE__ */ e.createElement(
|
|
451
|
+
m,
|
|
452
|
+
{
|
|
453
|
+
title: s.toLanguageString(q, i[q]),
|
|
454
|
+
fillMode: "flat",
|
|
455
|
+
icon: "arrow-up",
|
|
456
|
+
svgIcon: It,
|
|
457
|
+
disabled: p === 0,
|
|
458
|
+
onClick: Te
|
|
459
|
+
}
|
|
460
|
+
), /* @__PURE__ */ e.createElement(
|
|
461
|
+
m,
|
|
462
|
+
{
|
|
463
|
+
title: s.toLanguageString(H, i[H]),
|
|
464
|
+
fillMode: "flat",
|
|
465
|
+
icon: "arrow-down",
|
|
466
|
+
svgIcon: Nt,
|
|
467
|
+
disabled: p === 0,
|
|
468
|
+
onClick: Le
|
|
469
|
+
}
|
|
470
|
+
), /* @__PURE__ */ e.createElement(
|
|
471
|
+
m,
|
|
472
|
+
{
|
|
473
|
+
title: s.toLanguageString($, i[$]),
|
|
474
|
+
fillMode: "flat",
|
|
475
|
+
icon: "x",
|
|
476
|
+
svgIcon: Mt,
|
|
477
|
+
onClick: ce
|
|
478
|
+
}
|
|
479
|
+
)),
|
|
480
|
+
/* @__PURE__ */ e.createElement("div", { ref: c, className: "k-pdf-viewer-pages" })
|
|
481
|
+
);
|
|
482
|
+
return /* @__PURE__ */ e.createElement("div", { className: "k-pdf-viewer", style: n.style, ref: z }, n.onRenderLoader ? n.onRenderLoader.call(void 0, se || null) : se, n.onRenderToolbar ? n.onRenderToolbar.call(void 0, ie) : ie, n.onRenderContent ? n.onRenderContent.call(void 0, ue) : ue, be && /* @__PURE__ */ e.createElement(yt, null));
|
|
483
|
+
});
|
|
484
|
+
J.displayName = "KendoReactPDFViewer";
|
|
485
|
+
J.propTypes = {
|
|
486
|
+
url: l.string,
|
|
487
|
+
data: l.string,
|
|
488
|
+
arrayBuffer: l.any,
|
|
489
|
+
typedArray: l.any,
|
|
490
|
+
style: l.object,
|
|
491
|
+
saveFileName: l.string,
|
|
492
|
+
saveOptions: l.object,
|
|
493
|
+
tools: l.arrayOf(l.oneOf(ke).isRequired),
|
|
494
|
+
zoomLevels: l.arrayOf(l.any),
|
|
495
|
+
zoom: l.number,
|
|
496
|
+
defaultZoom: l.number,
|
|
497
|
+
minZoom: l.number,
|
|
498
|
+
maxZoom: l.number,
|
|
499
|
+
zoomRate: l.number,
|
|
500
|
+
onError: l.func,
|
|
501
|
+
onLoad: l.func,
|
|
502
|
+
onDownload: l.func,
|
|
503
|
+
onRenderToolbar: l.func,
|
|
504
|
+
onRenderContent: l.func,
|
|
505
|
+
onRenderLoader: l.func,
|
|
506
|
+
onZoom: l.func
|
|
507
|
+
};
|
|
508
|
+
J.defaultProps = k;
|
|
509
|
+
const qt = F;
|
|
510
|
+
export {
|
|
511
|
+
J as PDFViewer,
|
|
512
|
+
Jt as currentPage,
|
|
513
|
+
qt as scrollToPage
|
|
514
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
1
5
|
/**
|
|
2
6
|
* @hidden
|
|
3
7
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { PackageMetadata } from '@progress/kendo-licensing';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export declare const packageMetadata: PackageMetadata;
|