@progress/kendo-react-pdf 7.0.3-develop.4 → 7.0.3-develop.7
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/KendoDrawingAdapter.d.ts +1 -1
- package/LICENSE.md +1 -1
- package/NOTICE.txt +1 -1
- package/PDFExport.d.ts +1 -1
- package/PDFExportProps.d.ts +1 -1
- package/PDFMargin.d.ts +1 -1
- package/PageTemplateProps.d.ts +1 -1
- package/README.md +1 -1
- package/common/dom-queries.d.ts +1 -1
- package/common/table-query.d.ts +1 -1
- package/common/utils.d.ts +1 -1
- package/dist/cdn/js/kendo-react-pdf.js +1 -1
- package/getPageMargin.d.ts +1 -1
- package/grid/GridPDFExport.d.ts +1 -1
- package/grid/export-element.d.ts +1 -1
- package/grid/grid-query.d.ts +1 -1
- package/grid/provideSaveGridPDF.d.ts +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.mjs +2 -2
- package/package-metadata.d.ts +1 -1
- package/package.json +2 -2
- package/savePDF.d.ts +1 -1
- package/treelist/TreeListPDFExport.d.ts +1 -1
- package/treelist/export-element.d.ts +1 -1
- package/treelist/provideSaveTreeListPDF.d.ts +1 -1
package/KendoDrawingAdapter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { DrawOptions, Group } from '@progress/kendo-drawing';
|
package/LICENSE.md
CHANGED
|
@@ -8,4 +8,4 @@ This is commercial software. To use it, you need to agree to the [**End User Lic
|
|
|
8
8
|
|
|
9
9
|
All available KendoReact commercial licenses may be obtained at the [KendoReact website](https://www.telerik.com/kendo-react-ui/pricing).
|
|
10
10
|
|
|
11
|
-
*Copyright ©
|
|
11
|
+
*Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
package/NOTICE.txt
CHANGED
package/PDFExport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
package/PDFExportProps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PaperSize, PageMargin } from '@progress/kendo-drawing/pdf';
|
package/PDFMargin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
package/PageTemplateProps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/README.md
CHANGED
|
@@ -57,6 +57,6 @@ High-level component overview pages
|
|
|
57
57
|
|
|
58
58
|
* [React PDF Generator Component](https://www.telerik.com/kendo-react-ui/pdfprocessing)
|
|
59
59
|
|
|
60
|
-
*Copyright ©
|
|
60
|
+
*Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
|
61
61
|
|
|
62
62
|
*Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|
package/common/dom-queries.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/common/table-query.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/common/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
(function(l,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("prop-types"),require("@progress/kendo-drawing"),require("@progress/kendo-file-saver"),require("react-dom/server"),require("@progress/kendo-react-common"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-drawing","@progress/kendo-file-saver","react-dom/server","@progress/kendo-react-common","react-dom"],f):(l=typeof globalThis<"u"?globalThis:l||self,f(l.KendoReactPdf={},l.React,l.PropTypes,l.KendoDrawing,l.KendoFileSaver,l.ReactDOMServer,l.KendoReactCommon,l.ReactDOM))})(this,function(l,f,e,C,G,J,Y,Z){"use strict";"use client";function D(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const g=D(f),y=D(J),M=D(Z);class v extends g.Component{render(){return null}}v.propTypes={left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])};const j=["bottom","left","right","top"];function O(n){const t=g.Children.toArray(n.children).find(r=>r&&r.type===v);return t?T(t):n.margin}function T(n){const t={};for(let r=0;r<j.length;r++){const o=j[r],i=n.props[o];i!==void 0&&(t[o]=i)}return t}const P="export.pdf",ee="KendoReact PDF Generator";class E{constructor(t,r,o,i,s={}){this.drawDOM=t,this.exportPDF=r,this.saveAs=o,this.domElement=i,this.options=s,this.convertPageTemplateToHtml=c=>`<span>${y.renderToStaticMarkup(g.createElement(this.options.pageTemplate,{pageNum:c.pageNum,totalPages:c.totalPages}))}</span>`}savePDF(t){const r=this.drawDOM(this.domElement,this.getDrawOptions()).then(o=>this.exportPDF(o,this.getPDFOptions())).then(o=>this.saveAs(o,this.options.fileName||P,this.getSaveOptions()));t&&r.then(t,t)}getDrawOptions(){return{avoidLinks:this.options.avoidLinks,forcePageBreak:this.options.forcePageBreak,keepTogether:this.options.keepTogether,margin:this.options.margin,paperSize:this.options.paperSize,landscape:this.options.landscape,repeatHeaders:this.options.repeatHeaders,scale:this.options.scale,template:this.options.pageTemplate&&this.convertPageTemplateToHtml}}getPDFOptions(){return{author:this.options.author,creator:this.options.creator||ee,date:this.options.date,imgDPI:this.options.imageResolution,keywords:this.options.keywords,landscape:this.options.landscape,margin:this.options.margin,multiPage:!0,paperSize:this.options.paperSize,producer:this.options.producer,subject:this.options.subject,title:this.options.title}}getSaveOptions(){return{forceProxy:this.options.forceProxy,proxyData:this.options.proxyData,proxyTarget:this.options.proxyTarget,proxyURL:this.options.proxyURL}}}const te={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class $ extends g.Component{constructor(t){super(t),this.rootElForPDF=null,Y.validatePackage(te)}render(){return g.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children)}save(t){new E(C.drawDOM,C.exportPDF,G.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:O(this.props)})}}$.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};function x(n,t={},r){new E(C.drawDOM,C.exportPDF,G.saveAs,n,t).savePDF(r)}const S={},q=n=>String(n).trim().split(" "),ne=(n,t)=>{const r=q(t);return!!q(n.className).find(o=>r.indexOf(o)>=0)},h=n=>t=>ne(t,n),W=n=>(S[n]||(S[n]=t=>String(t.nodeName).toLowerCase()===n.toLowerCase()),S[n]),u=(n,t,r=!0)=>{if(n){if(r&&t(n))return n;for(n=n.firstChild;n;){if(n.nodeType===1){const o=u(n,t);if(o)return o}n=n.nextSibling}}},_="k-grid-header",K="k-grid-footer",re=W("TABLE"),B=n=>n?"locked":"wrap";let oe=class{constructor(t){this.element=t,this.list=u(t,h("k-grid-container"))}content(t){return u(this.list,h(`k-grid-content${t?"-locked":""}`))}header(t){return this.headerWrap=this.headerWrap||u(this.element,h(_)),u(this.headerWrap,h(`${_}-${B(t)}`))}footer(t){return this.footerWrap=this.footerWrap||u(this.element,h(K)),u(this.footerWrap,h(`${K}-${B(t)}`))}table(){return u(this.element,re)}};const I="k-first",ie="k-grid-header",se="k-grid-footer",U=(n,t)=>{const r=t.length;for(let o=0;o<r;o++)n.appendChild(t[o].cloneNode(!0))},F=n=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(n),t},k=n=>{const t=n.length,r=n[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let i=0;i<o;i++)for(let s=1;s<t;s++)U(r.rows[i],n[s].rows[i].cells);return r},ae=(n,t)=>{if(t.length>1&&n.rows.length>1)for(let r=1;r<n.rows.length;r++){const o=t[0].rows[r].cells.length,i=n.rows[r].cells[o];String(i.className).indexOf(I)===-1&&(i.className+=` ${I}`)}},H=(n,t,r,o)=>{const i=document.createElement("table"),s=n[0].cloneNode(!0);for(let a=1;a<n.length;a++)U(s,n[a].querySelectorAll("col"));const c=k(t),d=k(r);if(c.className=ie,ae(c,t),i.appendChild(s),i.appendChild(c),i.appendChild(d),o.length){const a=k(o);a.className=se,i.appendChild(a)}return F(i)},ce=n=>{const t=new oe(n),r=t.content();let o;if(r){const i=[r.querySelector("colgroup")],s=[t.header().querySelector("thead")],c=[r.querySelector("tbody")],d=t.footer(),a=d?[d.querySelector("tfoot")]:[];o=H(i,s,c,a)}else o=F(t.table().cloneNode(!0));return o};function le(n){return(t,r={},o,i,s)=>de(n,t,r,o,i,s)}function de(n,t,r={},o,i,s){let c,d,a;b();function b(){c=document.createElement("div"),c.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),d=document.createElement("div"),c.appendChild(d),document.body.appendChild(c),M.render(A(),d,w)}function w(){n(N(),r,L)}function L(){document.body.removeChild(c),document.body.removeChild(a),c=a=void 0,o&&o()}function N(){a=document.createElement("div"),a.className="k-grid-pdf-export-element";const m=ce(d);return a.appendChild(m),document.body.appendChild(a),m}function A(){const m=i&&{data:i,total:i.length,pageSize:i.length,skip:0},R={style:Object.assign({},t.props.style,{width:"1000px"})},p=Object.assign({},m,R);if(s&&s.length>0){const pe=ue(t);return g.cloneElement(t,p,s.concat(pe))}else return g.cloneElement(t,p)}}function ue(n){return g.Children.toArray(n.props.children).filter(t=>t&&t.type&&t.type.displayName!=="KendoReactGridColumn")}class z extends g.Component{constructor(t){super(t),this.saveGridPDF=le(this.getSavePDF())}render(){return null}save(t,r){this.saveGridPDF(this.getGrid(),Object.assign({},this.props,{margin:O(this.props)}),r,t,this.getCustomColumns())}getSavePDF(){return x}getGrid(){return g.Children.toArray(this.props.children).find(t=>t&&t.type.displayName==="KendoReactGrid")}getCustomColumns(){return g.Children.toArray(this.props.children).filter(t=>t&&t.type.displayName==="KendoReactGridColumn")}}z.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};const Q="k-grid-header",V="k-grid-footer",ge=W("TABLE");class he{constructor(t){this.element=t,this.list=u(t,h("k-grid"))}content(){return u(this.list,h("k-grid"))}header(){return this.headerWrap=this.headerWrap||u(this.element,h(Q)),u(this.headerWrap,h(`${Q}`))}footer(){return this.footerWrap=this.footerWrap||u(this.element,h(V)),u(this.footerWrap,h(`${V}`))}table(){return u(this.element,ge)}}const me=n=>{const t=new he(n),r=t.content();let o,i=t.header();if(i.childNodes.length>1&&i.removeChild(i.childNodes[1]),i.childNodes[0].childNodes.forEach(s=>s.style.top=0),r){const s=[r.querySelector("colgroup")],c=[i],d=[r.querySelector("tbody")],a=t.footer(),b=a?[a.querySelector("tfoot")]:[];o=H(s,c,d,b)}else o=F(t.table().cloneNode(!0));return o};function fe(n){return(t,r={},o,i,s)=>be(n,t,r,o,i,s)}function be(n,t,r={},o,i,s){let c,d,a;b();function b(){c=document.createElement("div"),c.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),d=document.createElement("div"),c.appendChild(d),document.body.appendChild(c),M.render(A(),d,w)}function w(){n(N(),r,L)}function L(){document.body.removeChild(c),document.body.removeChild(a),c=a=void 0,o&&o()}function N(){a=document.createElement("div"),a.className="k-treelist-pdf-export-element";const m=me(d);return a.appendChild(m),document.body.appendChild(a),a}function A(){const m=r.allPages&&i?{data:i,take:Number.MAX_VALUE,skip:0}:{},R={style:Object.assign({},t.props.style,{width:"1000px"})},p=Object.assign({},m,R);return s&&s.length>0?g.cloneElement(t,Object.assign({},p,{columns:s})):g.cloneElement(t,p)}}class X extends g.Component{constructor(t){super(t),this.saveTreeListPDF=fe(this.getSavePDF())}render(){return null}save(t,r,o){this.saveTreeListPDF(this.getTreeList(),Object.assign({},this.props,{margin:O(this.props)}),o,t,r||[])}getSavePDF(){return x}getTreeList(){const t=this.props.children;if(t&&t.props.data&&t.props.columns)return this.props.children}}X.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string,allPages:e.bool},l.GridPDFExport=z,l.KendoDrawingAdapter=E,l.PDFExport=$,l.PDFMargin=v,l.TreeListPDFExport=X,l.getPageMargin=O,l.savePDF=x,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/getPageMargin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/grid/GridPDFExport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
package/grid/export-element.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/grid/grid-query.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PDFExportProps } from '../PDFExportProps';
|
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
export * from './index';
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PDFExport } from './PDFExport';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),e=require("prop-types"),f=require("@progress/kendo-drawing"),q=require("@progress/kendo-file-saver"),Q=require("react-dom/server"),V=require("@progress/kendo-react-common"),X=require("react-dom");function x(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const d=x(K),J=x(Q),W=x(X);class E extends d.Component{render(){return null}}E.propTypes={left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])};const w=["bottom","left","right","top"];function y(r){const t=d.Children.toArray(r.children).find(n=>n&&n.type===E);return t?Y(t):r.margin}function Y(r){const t={};for(let n=0;n<w.length;n++){const o=w[n],s=r.props[o];s!==void 0&&(t[o]=s)}return t}const Z="export.pdf",ee="KendoReact PDF Generator";class S{constructor(t,n,o,s,i={}){this.drawDOM=t,this.exportPDF=n,this.saveAs=o,this.domElement=s,this.options=i,this.convertPageTemplateToHtml=p=>`<span>${J.renderToStaticMarkup(d.createElement(this.options.pageTemplate,{pageNum:p.pageNum,totalPages:p.totalPages}))}</span>`}savePDF(t){const n=this.drawDOM(this.domElement,this.getDrawOptions()).then(o=>this.exportPDF(o,this.getPDFOptions())).then(o=>this.saveAs(o,this.options.fileName||Z,this.getSaveOptions()));t&&n.then(t,t)}getDrawOptions(){return{avoidLinks:this.options.avoidLinks,forcePageBreak:this.options.forcePageBreak,keepTogether:this.options.keepTogether,margin:this.options.margin,paperSize:this.options.paperSize,landscape:this.options.landscape,repeatHeaders:this.options.repeatHeaders,scale:this.options.scale,template:this.options.pageTemplate&&this.convertPageTemplateToHtml}}getPDFOptions(){return{author:this.options.author,creator:this.options.creator||ee,date:this.options.date,imgDPI:this.options.imageResolution,keywords:this.options.keywords,landscape:this.options.landscape,margin:this.options.margin,multiPage:!0,paperSize:this.options.paperSize,producer:this.options.producer,subject:this.options.subject,title:this.options.title}}getSaveOptions(){return{forceProxy:this.options.forceProxy,proxyData:this.options.proxyData,proxyTarget:this.options.proxyTarget,proxyURL:this.options.proxyURL}}}const te={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};class _ extends d.Component{constructor(t){super(t),this.rootElForPDF=null,V.validatePackage(te)}render(){return d.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children)}save(t){new S(f.drawDOM,f.exportPDF,q.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:y(this.props)})}}_.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};function F(r,t={},n){new S(f.drawDOM,f.exportPDF,q.saveAs,r,t).savePDF(n)}const O={},L=r=>String(r).trim().split(" "),re=(r,t)=>{const n=L(t);return!!L(r.className).find(o=>n.indexOf(o)>=0)},u=r=>t=>re(t,r),$=r=>(O[r]||(O[r]=t=>String(t.nodeName).toLowerCase()===r.toLowerCase()),O[r]),c=(r,t,n=!0)=>{if(r){if(n&&t(r))return r;for(r=r.firstChild;r;){if(r.nodeType===1){const o=c(r,t);if(o)return o}r=r.nextSibling}}},N="k-grid-header",A="k-grid-footer",ne="TABLE",oe=$(ne),R=r=>r?"locked":"wrap";let se=class{constructor(t){this.element=t,this.list=c(t,u("k-grid-container"))}content(t){return c(this.list,u(`k-grid-content${t?"-locked":""}`))}header(t){return this.headerWrap=this.headerWrap||c(this.element,u(N)),c(this.headerWrap,u(`${N}-${R(t)}`))}footer(t){return this.footerWrap=this.footerWrap||c(this.element,u(A)),c(this.footerWrap,u(`${A}-${R(t)}`))}table(){return c(this.element,oe)}};const G="k-first",ie="k-grid-header",ae="k-grid-footer",I=(r,t)=>{const n=t.length;for(let o=0;o<n;o++)r.appendChild(t[o].cloneNode(!0))},k=r=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(r),t},v=r=>{const t=r.length,n=r[0].cloneNode(!0),o=n.rows.length;if(t>1)for(let s=0;s<o;s++)for(let i=1;i<t;i++)I(n.rows[s],r[i].rows[s].cells);return n},pe=(r,t)=>{if(t.length>1&&r.rows.length>1)for(let n=1;n<r.rows.length;n++){const o=t[0].rows[n].cells.length,s=r.rows[n].cells[o];String(s.className).indexOf(G)===-1&&(s.className+=` ${G}`)}},U=(r,t,n,o)=>{const s=document.createElement("table"),i=r[0].cloneNode(!0);for(let a=1;a<r.length;a++)I(i,r[a].querySelectorAll("col"));const p=v(t),l=v(n);if(p.className=ie,pe(p,t),s.appendChild(i),s.appendChild(p),s.appendChild(l),o.length){const a=v(o);a.className=ae,s.appendChild(a)}return k(s)},le=r=>{const t=new se(r),n=t.content();let o;if(n){const s=[n.querySelector("colgroup")],i=[t.header().querySelector("thead")],p=[n.querySelector("tbody")],l=t.footer(),a=l?[l.querySelector("tfoot")]:[];o=U(s,i,p,a)}else o=k(t.table().cloneNode(!0));return o};function ce(r){return(t,n={},o,s,i)=>de(r,t,n,o,s,i)}function de(r,t,n={},o,s,i){let p,l,a;h();function h(){p=document.createElement("div"),p.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),l=document.createElement("div"),p.appendChild(l),document.body.appendChild(p),W.render(P(),l,b)}function b(){r(D(),n,T)}function T(){document.body.removeChild(p),document.body.removeChild(a),p=a=void 0,o&&o()}function D(){a=document.createElement("div"),a.className="k-grid-pdf-export-element";const g=le(l);return a.appendChild(g),document.body.appendChild(a),g}function P(){const g=s&&{data:s,total:s.length,pageSize:s.length,skip:0},C={style:Object.assign({},t.props.style,{width:"1000px"})},m=Object.assign({},g,C);if(i&&i.length>0){const z=ue(t);return d.cloneElement(t,m,i.concat(z))}else return d.cloneElement(t,m)}}function ue(r){return d.Children.toArray(r.props.children).filter(t=>t&&t.type&&t.type.displayName!=="KendoReactGridColumn")}class B extends d.Component{constructor(t){super(t),this.saveGridPDF=ce(this.getSavePDF())}render(){return null}save(t,n){this.saveGridPDF(this.getGrid(),Object.assign({},this.props,{margin:y(this.props)}),n,t,this.getCustomColumns())}getSavePDF(){return F}getGrid(){return d.Children.toArray(this.props.children).find(t=>t&&t.type.displayName==="KendoReactGrid")}getCustomColumns(){return d.Children.toArray(this.props.children).filter(t=>t&&t.type.displayName==="KendoReactGridColumn")}}B.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};const M="k-grid-header",j="k-grid-footer",ge="TABLE",he=$(ge);class me{constructor(t){this.element=t,this.list=c(t,u("k-grid"))}content(){return c(this.list,u("k-grid"))}header(){return this.headerWrap=this.headerWrap||c(this.element,u(M)),c(this.headerWrap,u(`${M}`))}footer(){return this.footerWrap=this.footerWrap||c(this.element,u(j)),c(this.footerWrap,u(`${j}`))}table(){return c(this.element,he)}}const fe=r=>{const t=new me(r),n=t.content();let o,s=t.header();if(s.childNodes.length>1&&s.removeChild(s.childNodes[1]),s.childNodes[0].childNodes.forEach(i=>i.style.top=0),n){const i=[n.querySelector("colgroup")],p=[s],l=[n.querySelector("tbody")],a=t.footer(),h=a?[a.querySelector("tfoot")]:[];o=U(i,p,l,h)}else o=k(t.table().cloneNode(!0));return o};function ye(r){return(t,n={},o,s,i)=>be(r,t,n,o,s,i)}function be(r,t,n={},o,s,i){let p,l,a;h();function h(){p=document.createElement("div"),p.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),l=document.createElement("div"),p.appendChild(l),document.body.appendChild(p),W.render(P(),l,b)}function b(){r(D(),n,T)}function T(){document.body.removeChild(p),document.body.removeChild(a),p=a=void 0,o&&o()}function D(){a=document.createElement("div"),a.className="k-treelist-pdf-export-element";const g=fe(l);return a.appendChild(g),document.body.appendChild(a),a}function P(){const g=n.allPages&&s?{data:s,take:Number.MAX_VALUE,skip:0}:{},C={style:Object.assign({},t.props.style,{width:"1000px"})},m=Object.assign({},g,C);return i&&i.length>0?d.cloneElement(t,Object.assign({},m,{columns:i})):d.cloneElement(t,m)}}class H extends d.Component{constructor(t){super(t),this.saveTreeListPDF=ye(this.getSavePDF())}render(){return null}save(t,n,o){this.saveTreeListPDF(this.getTreeList(),Object.assign({},this.props,{margin:y(this.props)}),o,t,n||[])}getSavePDF(){return F}getTreeList(){const t=this.props.children;if(t&&t.props.data&&t.props.columns)return this.props.children}}H.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string,allPages:e.bool};exports.GridPDFExport=B;exports.KendoDrawingAdapter=S;exports.PDFExport=_;exports.PDFMargin=E;exports.TreeListPDFExport=H;exports.getPageMargin=y;exports.savePDF=F;
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
"use client";
|
|
@@ -90,7 +90,7 @@ const V = {
|
|
|
90
90
|
name: "@progress/kendo-react-pdf",
|
|
91
91
|
productName: "KendoReact",
|
|
92
92
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
93
|
-
publishDate:
|
|
93
|
+
publishDate: 1704376989,
|
|
94
94
|
version: "",
|
|
95
95
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
96
96
|
};
|
package/package-metadata.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PackageMetadata } from '@progress/kendo-licensing';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pdf",
|
|
3
|
-
"version": "7.0.3-develop.
|
|
3
|
+
"version": "7.0.3-develop.7",
|
|
4
4
|
"description": "React PDF Processing enables you to export single- and multi-page content in PDF. KendoReact PDF Processing package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-file-saver": "^1.0.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-common": "7.0.3-develop.
|
|
28
|
+
"@progress/kendo-react-common": "7.0.3-develop.7",
|
|
29
29
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
30
30
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
31
31
|
},
|
package/savePDF.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PDFExportProps } from './PDFExportProps';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { TreeListPDFExportProps } from './TreeListPDFExport';
|