@progress/kendo-react-pdf 11.4.0-develop.6 → 11.4.0-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/PDFExport.js +1 -1
- package/PDFExport.mjs +12 -12
- package/dist/cdn/js/kendo-react-pdf.js +1 -1
- package/grid/GridPDFExport.js +1 -1
- package/grid/GridPDFExport.mjs +19 -19
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
- package/treelist/TreeListPDFExport.js +1 -1
- package/treelist/TreeListPDFExport.mjs +13 -13
package/PDFExport.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),e=require("prop-types"),g=require("@progress/kendo-drawing"),u=require("@progress/kendo-file-saver"),m=require("./getPageMargin.js"),d=require("./KendoDrawingAdapter.js"),a=require("@progress/kendo-react-common"),p=require("./package-metadata.js");function f(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const s=f(l),i=class i extends s.Component{constructor(t){super(t),this.rootElForPDF=null,this.showLicenseWatermark=!1,this.showLicenseWatermark=!a.validatePackage(p.packageMetadata,{component:"PDFExport"}),this.licenseMessage=a.getLicenseMessage(p.packageMetadata)}render(){return s.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children,this.showLicenseWatermark&&s.createElement(a.WatermarkOverlay,{message:this.licenseMessage}))}save(t){new d(g.drawDOM,g.exportPDF,u.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:m.getPageMargin(this.props)})}};i.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};let o=i;exports.PDFExport=o;
|
package/PDFExport.mjs
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { drawDOM as
|
|
11
|
-
import { saveAs as
|
|
12
|
-
import { getPageMargin as
|
|
10
|
+
import { drawDOM as a, exportPDF as i } from "@progress/kendo-drawing";
|
|
11
|
+
import { saveAs as p } from "@progress/kendo-file-saver";
|
|
12
|
+
import { getPageMargin as g } from "./getPageMargin.mjs";
|
|
13
13
|
import m from "./KendoDrawingAdapter.mjs";
|
|
14
|
-
import { validatePackage as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
const
|
|
14
|
+
import { validatePackage as c, getLicenseMessage as l, WatermarkOverlay as f } from "@progress/kendo-react-common";
|
|
15
|
+
import { packageMetadata as o } from "./package-metadata.mjs";
|
|
16
|
+
const s = class s extends t.Component {
|
|
17
17
|
constructor(r) {
|
|
18
|
-
super(r), this.rootElForPDF = null, this.showLicenseWatermark = !1, this.showLicenseWatermark = !
|
|
18
|
+
super(r), this.rootElForPDF = null, this.showLicenseWatermark = !1, this.showLicenseWatermark = !c(o, { component: "PDFExport" }), this.licenseMessage = l(o);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @hidden
|
|
@@ -29,7 +29,7 @@ const o = class o extends t.Component {
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
this.props.children,
|
|
32
|
-
this.showLicenseWatermark && /* @__PURE__ */ t.createElement(
|
|
32
|
+
this.showLicenseWatermark && /* @__PURE__ */ t.createElement(f, { message: this.licenseMessage })
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -38,13 +38,13 @@ const o = class o extends t.Component {
|
|
|
38
38
|
* @param callback - The callback to be executed after the PDF is saved.
|
|
39
39
|
*/
|
|
40
40
|
save(r) {
|
|
41
|
-
new m(
|
|
41
|
+
new m(a, i, p, this.rootElForPDF, this.getOptions()).savePDF(r);
|
|
42
42
|
}
|
|
43
43
|
getOptions() {
|
|
44
|
-
return Object.assign({}, this.props, { margin:
|
|
44
|
+
return Object.assign({}, this.props, { margin: g(this.props) });
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
s.propTypes = {
|
|
48
48
|
author: e.string,
|
|
49
49
|
avoidLinks: e.oneOfType([e.bool, e.string]),
|
|
50
50
|
forcePageBreak: e.string,
|
|
@@ -77,7 +77,7 @@ o.propTypes = {
|
|
|
77
77
|
subject: e.string,
|
|
78
78
|
title: e.string
|
|
79
79
|
};
|
|
80
|
-
let n =
|
|
80
|
+
let n = s;
|
|
81
81
|
export {
|
|
82
82
|
n as PDFExport
|
|
83
83
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(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")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-drawing","@progress/kendo-file-saver","react-dom/server","@progress/kendo-react-common","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPdf={},e.React,e.PropTypes,e.KendoDrawing,e.KendoFileSaver,e.ReactDOMServer,e.KendoReactCommon,e.ReactDOM)}(this,(function(e,t,r,o,s,n,i,a){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=p(t),c=p(n);const h=class extends l.Component{render(){return null}};h.propTypes={left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])};let d=h;const g=["bottom","left","right","top"];function u(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===d));return t?function(e){const t={};for(let r=0;r<g.length;r++){const o=g[r],s=e.props[o];void 0!==s&&(t[o]=s)}return t}(t):e.margin}let m=class{constructor(e,t,r,o,s={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=o,this.options=s,this.convertPageTemplateToHtml=e=>`<span>${c.renderToStaticMarkup(l.createElement(this.options.pageTemplate,{pageNum:e.pageNum,totalPages:e.totalPages}))}</span>`}savePDF(e){const t=this.drawDOM(this.domElement,this.getDrawOptions()).then((e=>this.exportPDF(e,this.getPDFOptions()))).then((e=>this.saveAs(e,this.options.fileName||"export.pdf",this.getSaveOptions())));e&&t.then(e,e)}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||"KendoReact PDF Generator",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 f={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.6",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"PDFExport"})}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children,this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,null))}save(e){new m(o.drawDOM,o.exportPDF,s.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:u(this.props)})}};y.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let b=y;function k(e,t={},r){new m(o.drawDOM,o.exportPDF,s.saveAs,e,t).savePDF(r)}const w={},T=e=>String(e).trim().split(" "),O=e=>t=>((e,t)=>{const r=T(t);return!!T(e.className).find((e=>r.indexOf(e)>=0))})(t,e),v=e=>(w[e]||(w[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),w[e]),P=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=P(e,t);if(r)return r}e=e.nextSibling}}},D="k-grid-header",x="k-grid-footer",E=v("TABLE"),F=e=>e?"locked":"wrap";class C{constructor(e){this.element=e,this.list=P(e,O("k-grid-container"))}content(e){return P(this.list,O("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||P(this.element,O(D)),P(this.headerWrap,O(`${D}-${F(e)}`))}footer(e){return this.footerWrap=this.footerWrap||P(this.element,O(x)),P(this.footerWrap,O(`${x}-${F(e)}`))}table(){return P(this.element,E)}}const L="k-first",N=(e,t)=>{const r=t.length;for(let o=0;o<r;o++)e.appendChild(t[o].cloneNode(!0))},R=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},S=e=>{const t=e.length,r=e[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let s=0;s<o;s++)for(let o=1;o<t;o++)N(r.rows[s],e[o].rows[s].cells);return r},W=(e,t,r,o)=>{const s=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)N(n,e[t].querySelectorAll("col"));const i=S(t),a=S(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const o=t[0].rows[r].cells.length,s=e.rows[r].cells[o];-1===String(s.className).indexOf(L)&&(s.className+=` ${L}`)}})(i,t),s.appendChild(n),s.appendChild(i),s.appendChild(a),o.length){const e=S(o);e.className="k-grid-footer",s.appendChild(e)}return R(s)},j=e=>{const t=new C(e),r=t.content();let o;if(r){const e=[r.querySelector("colgroup")],s=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];o=W(e,s,n,a)}else o=R(t.table().cloneNode(!0));return o},A=q(k);function q(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-grid-pdf-export-element";const e=j(t);return s.appendChild(e),document.body.appendChild(s),e}n()}(e,t,r,o)}const G=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"GridPDFExport"}),this.saveGridPDF=q(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,null))}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return k}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},o={scrollable:"none"===this.grid.props?"none":"scrollable"},s=Object.assign({},t,r,o);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,s,this.columns.concat(e))}return l.cloneElement(this.grid,s)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};G.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let K=G;const U="k-grid-header",I="k-grid-footer",M=v("TABLE");class z{constructor(e){this.element=e,this.list=P(e,O("k-grid"))}content(){return P(this.list,O("k-grid"))}header(){return this.headerWrap=this.headerWrap||P(this.element,O(U)),P(this.headerWrap,O(`${U}`))}footer(){return this.footerWrap=this.footerWrap||P(this.element,O(I)),P(this.footerWrap,O(`${I}`))}table(){return P(this.element,M)}}const $=e=>{const t=new z(e),r=t.content();let o;const s=t.header();if(s.childNodes.length>1&&s.removeChild(s.childNodes[1]),s.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[s],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];o=W(e,n,i,p)}else o=R(t.table().cloneNode(!0));return o};function B(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-treelist-pdf-export-element";const e=$(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const H=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"TreeListPDFExport"}),this.saveTreeListPDF=B(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,null))}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return k}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};H.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let V=H;e.GridPDFExport=K,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=V,e.getPageMargin=u,e.saveGridPDF=A,e.savePDF=k}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(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")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-drawing","@progress/kendo-file-saver","react-dom/server","@progress/kendo-react-common","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPdf={},e.React,e.PropTypes,e.KendoDrawing,e.KendoFileSaver,e.ReactDOMServer,e.KendoReactCommon,e.ReactDOM)}(this,(function(e,t,r,s,o,n,i,a){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=p(t),c=p(n);const h=class extends l.Component{render(){return null}};h.propTypes={left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])};let d=h;const g=["bottom","left","right","top"];function m(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===d));return t?function(e){const t={};for(let r=0;r<g.length;r++){const s=g[r],o=e.props[s];void 0!==o&&(t[s]=o)}return t}(t):e.margin}let u=class{constructor(e,t,r,s,o={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=s,this.options=o,this.convertPageTemplateToHtml=e=>`<span>${c.renderToStaticMarkup(l.createElement(this.options.pageTemplate,{pageNum:e.pageNum,totalPages:e.totalPages}))}</span>`}savePDF(e){const t=this.drawDOM(this.domElement,this.getDrawOptions()).then((e=>this.exportPDF(e,this.getPDFOptions()))).then((e=>this.saveAs(e,this.options.fileName||"export.pdf",this.getSaveOptions())));e&&t.then(e,e)}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||"KendoReact PDF Generator",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 f={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"PDFExport"}),this.licenseMessage=i.getLicenseMessage(f)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children,this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e){new u(s.drawDOM,s.exportPDF,o.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:m(this.props)})}};y.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let b=y;function k(e,t={},r){new u(s.drawDOM,s.exportPDF,o.saveAs,e,t).savePDF(r)}const w={},T=e=>String(e).trim().split(" "),O=e=>t=>((e,t)=>{const r=T(t);return!!T(e.className).find((e=>r.indexOf(e)>=0))})(t,e),v=e=>(w[e]||(w[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),w[e]),P=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=P(e,t);if(r)return r}e=e.nextSibling}}},D="k-grid-header",x="k-grid-footer",E=v("TABLE"),L=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=P(e,O("k-grid-container"))}content(e){return P(this.list,O("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||P(this.element,O(D)),P(this.headerWrap,O(`${D}-${L(e)}`))}footer(e){return this.footerWrap=this.footerWrap||P(this.element,O(x)),P(this.footerWrap,O(`${x}-${L(e)}`))}table(){return P(this.element,E)}}const C="k-first",N=(e,t)=>{const r=t.length;for(let s=0;s<r;s++)e.appendChild(t[s].cloneNode(!0))},R=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},S=e=>{const t=e.length,r=e[0].cloneNode(!0),s=r.rows.length;if(t>1)for(let o=0;o<s;o++)for(let s=1;s<t;s++)N(r.rows[o],e[s].rows[o].cells);return r},W=(e,t,r,s)=>{const o=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)N(n,e[t].querySelectorAll("col"));const i=S(t),a=S(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const s=t[0].rows[r].cells.length,o=e.rows[r].cells[s];-1===String(o.className).indexOf(C)&&(o.className+=` ${C}`)}})(i,t),o.appendChild(n),o.appendChild(i),o.appendChild(a),s.length){const e=S(s);e.className="k-grid-footer",o.appendChild(e)}return R(o)},j=e=>{const t=new F(e),r=t.content();let s;if(r){const e=[r.querySelector("colgroup")],o=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];s=W(e,o,n,a)}else s=R(t.table().cloneNode(!0));return s},M=A(k);function A(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-grid-pdf-export-element";const e=j(t);return o.appendChild(e),document.body.appendChild(o),e}n()}(e,t,r,s)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"GridPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveGridPDF=A(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return k}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},s={scrollable:"none"===this.grid.props?"none":"scrollable"},o=Object.assign({},t,r,s);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,o,this.columns.concat(e))}return l.cloneElement(this.grid,o)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};q.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let G=q;const K="k-grid-header",U="k-grid-footer",I=v("TABLE");class z{constructor(e){this.element=e,this.list=P(e,O("k-grid"))}content(){return P(this.list,O("k-grid"))}header(){return this.headerWrap=this.headerWrap||P(this.element,O(K)),P(this.headerWrap,O(`${K}`))}footer(){return this.footerWrap=this.footerWrap||P(this.element,O(U)),P(this.footerWrap,O(`${U}`))}table(){return P(this.element,I)}}const $=e=>{const t=new z(e),r=t.content();let s;const o=t.header();if(o.childNodes.length>1&&o.removeChild(o.childNodes[1]),o.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[o],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];s=W(e,n,i,p)}else s=R(t.table().cloneNode(!0));return s};function B(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-treelist-pdf-export-element";const e=$(t);return o.appendChild(e),document.body.appendChild(o),o}n()}(e,t,r,s)}const H=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"TreeListPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveTreeListPDF=B(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return k}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};H.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let V=H;e.GridPDFExport=G,e.KendoDrawingAdapter=u,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=V,e.getPageMargin=m,e.saveGridPDF=M,e.savePDF=k}));
|
package/grid/GridPDFExport.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),e=require("prop-types"),u=require("../getPageMargin.js"),m=require("../savePDF.js"),y=require("./provideSaveGridPDF.js"),f=require("react-dom"),o=require("@progress/kendo-react-common"),l=require("../package-metadata.js");function b(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const s=b(d),p=class p extends s.Component{constructor(t){super(t),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!o.validatePackage(l.packageMetadata,{component:"GridPDFExport"}),this.licenseMessage=o.getLicenseMessage(l.packageMetadata),this.saveGridPDF=y.provideSaveGridPDF(this.getSavePDF()),this.gridInnerWrapperRef=s.createRef()}componentDidUpdate(t,r){this.state.show&&this.state.show!==r.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:u.getPageMargin(this.props)}),this.callback)}render(){return s.createElement(s.Fragment,null,this.state.show&&f.createPortal(s.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},s.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body),this.showLicenseWatermark&&s.createElement(o.WatermarkOverlay,{message:this.licenseMessage}))}save(t,r){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=t,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return m.savePDF}getGrid(){return s.Children.toArray(this.props.children).find(t=>t&&t.type.displayName==="KendoReactGrid")}getCustomColumns(){return s.Children.toArray(this.props.children).filter(t=>t&&t.type.displayName==="KendoReactGridColumn")}prepareRawGridForExport(t){const r=t&&{data:t,total:t.length,pageSize:t.length,skip:0},i={style:Object.assign({},this.grid.props.style,{width:"1000px"})},g={scrollable:this.grid.props==="none"?"none":"scrollable"},c=Object.assign({},r,i,g);if(this.columns&&this.columns.length>0){const h=this.getGridNotColumnChildren(this.grid);return s.cloneElement(this.grid,c,this.columns.concat(h))}return s.cloneElement(this.grid,c)}getGridNotColumnChildren(t){return s.Children.toArray(t.props.children).filter(r=>r&&r.type&&r.type.displayName!=="KendoReactGridColumn")}};p.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};let a=p;exports.GridPDFExport=a;
|
package/grid/GridPDFExport.mjs
CHANGED
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as r from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { getPageMargin as
|
|
11
|
-
import { savePDF as
|
|
12
|
-
import { provideSaveGridPDF as
|
|
13
|
-
import { createPortal as
|
|
14
|
-
import { validatePackage as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
const
|
|
10
|
+
import { getPageMargin as h } from "../getPageMargin.mjs";
|
|
11
|
+
import { savePDF as g } from "../savePDF.mjs";
|
|
12
|
+
import { provideSaveGridPDF as c } from "./provideSaveGridPDF.mjs";
|
|
13
|
+
import { createPortal as d } from "react-dom";
|
|
14
|
+
import { validatePackage as u, getLicenseMessage as f, WatermarkOverlay as y } from "@progress/kendo-react-common";
|
|
15
|
+
import { packageMetadata as n } from "../package-metadata.mjs";
|
|
16
|
+
const i = class i extends r.Component {
|
|
17
17
|
constructor(t) {
|
|
18
18
|
super(t), this.state = {
|
|
19
19
|
show: !1
|
|
20
|
-
}, this.showLicenseWatermark = !1, this.showLicenseWatermark = !
|
|
20
|
+
}, this.showLicenseWatermark = !1, this.showLicenseWatermark = !u(n, { component: "GridPDFExport" }), this.licenseMessage = f(n), this.saveGridPDF = c(this.getSavePDF()), this.gridInnerWrapperRef = r.createRef();
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -25,7 +25,7 @@ const o = class o extends r.Component {
|
|
|
25
25
|
componentDidUpdate(t, s) {
|
|
26
26
|
this.state.show && this.state.show !== s.show && this.saveGridPDF(
|
|
27
27
|
this.gridInnerWrapperRef.current,
|
|
28
|
-
Object.assign({}, this.props, { margin:
|
|
28
|
+
Object.assign({}, this.props, { margin: h(this.props) }),
|
|
29
29
|
this.callback
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -33,7 +33,7 @@ const o = class o extends r.Component {
|
|
|
33
33
|
* @hidden
|
|
34
34
|
*/
|
|
35
35
|
render() {
|
|
36
|
-
return /* @__PURE__ */ r.createElement(r.Fragment, null, this.state.show &&
|
|
36
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, this.state.show && d(
|
|
37
37
|
/* @__PURE__ */ r.createElement(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
@@ -46,7 +46,7 @@ const o = class o extends r.Component {
|
|
|
46
46
|
/* @__PURE__ */ r.createElement("div", { ref: this.gridInnerWrapperRef }, this.prepareRawGridForExport(this.data))
|
|
47
47
|
),
|
|
48
48
|
document.body
|
|
49
|
-
), this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
49
|
+
), this.showLicenseWatermark && /* @__PURE__ */ r.createElement(y, { message: this.licenseMessage }));
|
|
50
50
|
}
|
|
51
51
|
/* eslint-disable max-len */
|
|
52
52
|
/**
|
|
@@ -62,7 +62,7 @@ const o = class o extends r.Component {
|
|
|
62
62
|
}, this.setState({ show: !0 });
|
|
63
63
|
}
|
|
64
64
|
getSavePDF() {
|
|
65
|
-
return
|
|
65
|
+
return g;
|
|
66
66
|
}
|
|
67
67
|
getGrid() {
|
|
68
68
|
return r.Children.toArray(this.props.children).find(
|
|
@@ -80,12 +80,12 @@ const o = class o extends r.Component {
|
|
|
80
80
|
total: t.length,
|
|
81
81
|
pageSize: t.length,
|
|
82
82
|
skip: 0
|
|
83
|
-
},
|
|
83
|
+
}, p = { style: Object.assign({}, this.grid.props.style, { width: "1000px" }) }, l = { scrollable: this.grid.props === "none" ? "none" : "scrollable" }, o = Object.assign({}, s, p, l);
|
|
84
84
|
if (this.columns && this.columns.length > 0) {
|
|
85
|
-
const
|
|
86
|
-
return r.cloneElement(this.grid,
|
|
85
|
+
const m = this.getGridNotColumnChildren(this.grid);
|
|
86
|
+
return r.cloneElement(this.grid, o, this.columns.concat(m));
|
|
87
87
|
}
|
|
88
|
-
return r.cloneElement(this.grid,
|
|
88
|
+
return r.cloneElement(this.grid, o);
|
|
89
89
|
}
|
|
90
90
|
getGridNotColumnChildren(t) {
|
|
91
91
|
return r.Children.toArray(t.props.children).filter(
|
|
@@ -93,7 +93,7 @@ const o = class o extends r.Component {
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
|
|
96
|
+
i.propTypes = {
|
|
97
97
|
author: e.string,
|
|
98
98
|
avoidLinks: e.oneOfType([e.bool, e.string]),
|
|
99
99
|
forcePageBreak: e.string,
|
|
@@ -126,7 +126,7 @@ o.propTypes = {
|
|
|
126
126
|
subject: e.string,
|
|
127
127
|
title: e.string
|
|
128
128
|
};
|
|
129
|
-
let
|
|
129
|
+
let a = i;
|
|
130
130
|
export {
|
|
131
|
-
|
|
131
|
+
a as GridPDFExport
|
|
132
132
|
};
|
package/index.d.mts
CHANGED
|
@@ -89,6 +89,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
|
|
|
89
89
|
show: boolean;
|
|
90
90
|
};
|
|
91
91
|
private readonly showLicenseWatermark;
|
|
92
|
+
private readonly licenseMessage?;
|
|
92
93
|
constructor(props: any);
|
|
93
94
|
/**
|
|
94
95
|
* @hidden
|
|
@@ -195,6 +196,7 @@ export declare class PDFExport extends React_2.Component<PDFExportProps, {}> {
|
|
|
195
196
|
};
|
|
196
197
|
private rootElForPDF;
|
|
197
198
|
private readonly showLicenseWatermark;
|
|
199
|
+
private readonly licenseMessage?;
|
|
198
200
|
constructor(props: PDFExportProps);
|
|
199
201
|
/**
|
|
200
202
|
* @hidden
|
|
@@ -524,6 +526,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
|
|
|
524
526
|
show: boolean;
|
|
525
527
|
};
|
|
526
528
|
private readonly showLicenseWatermark;
|
|
529
|
+
private readonly licenseMessage?;
|
|
527
530
|
constructor(props: any);
|
|
528
531
|
/**
|
|
529
532
|
* @hidden
|
package/index.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
|
|
|
89
89
|
show: boolean;
|
|
90
90
|
};
|
|
91
91
|
private readonly showLicenseWatermark;
|
|
92
|
+
private readonly licenseMessage?;
|
|
92
93
|
constructor(props: any);
|
|
93
94
|
/**
|
|
94
95
|
* @hidden
|
|
@@ -195,6 +196,7 @@ export declare class PDFExport extends React_2.Component<PDFExportProps, {}> {
|
|
|
195
196
|
};
|
|
196
197
|
private rootElForPDF;
|
|
197
198
|
private readonly showLicenseWatermark;
|
|
199
|
+
private readonly licenseMessage?;
|
|
198
200
|
constructor(props: PDFExportProps);
|
|
199
201
|
/**
|
|
200
202
|
* @hidden
|
|
@@ -524,6 +526,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
|
|
|
524
526
|
show: boolean;
|
|
525
527
|
};
|
|
526
528
|
private readonly showLicenseWatermark;
|
|
529
|
+
private readonly licenseMessage?;
|
|
527
530
|
constructor(props: any);
|
|
528
531
|
/**
|
|
529
532
|
* @hidden
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1754569190,version:"11.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "11.4.0-develop.
|
|
13
|
+
publishDate: 1754569190,
|
|
14
|
+
version: "11.4.0-develop.7",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pdf",
|
|
3
|
-
"version": "11.4.0-develop.
|
|
3
|
+
"version": "11.4.0-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",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-drawing": "^1.21.2",
|
|
29
29
|
"@progress/kendo-file-saver": "^1.0.1",
|
|
30
|
-
"@progress/kendo-licensing": "^1.
|
|
31
|
-
"@progress/kendo-react-common": "11.4.0-develop.
|
|
30
|
+
"@progress/kendo-licensing": "^1.7.0",
|
|
31
|
+
"@progress/kendo-react-common": "11.4.0-develop.7",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
34
34
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"package": {
|
|
55
55
|
"productName": "KendoReact",
|
|
56
56
|
"productCode": "KENDOUIREACT",
|
|
57
|
-
"publishDate":
|
|
57
|
+
"publishDate": 1754569190,
|
|
58
58
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),e=require("prop-types"),g=require("../getPageMargin.js"),h=require("../savePDF.js"),u=require("./provideSaveTreeListPDF.js"),m=require("react-dom"),p=require("../package-metadata.js"),n=require("@progress/kendo-react-common");function d(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const s in i)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>i[s]})}}return t.default=i,Object.freeze(t)}const r=d(l),c=class c extends r.Component{constructor(t){super(t),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!n.validatePackage(p.packageMetadata,{component:"TreeListPDFExport"}),this.licenseMessage=n.getLicenseMessage(p.packageMetadata),this.saveTreeListPDF=u.provideSaveTreeListPDF(this.getSavePDF()),this.treeListInnerWrapperRef=r.createRef()}componentDidUpdate(t,s){this.state.show&&this.state.show!==s.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:g.getPageMargin(this.props)}),this.callback)}render(){return r.createElement(r.Fragment,null,this.state.show&&m.createPortal(r.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},r.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&r.createElement(n.WatermarkOverlay,{message:this.licenseMessage}))}save(t,s,a){this.treeList=this.getTreeList(),this.columns=s||[],this.data=t,this.callback=()=>{this.setState({show:!1}),a&&a()},this.setState({show:!0})}getSavePDF(){return h.savePDF}getTreeList(){const t=this.props.children;if(t&&t.props.data&&t.props.columns)return this.props.children}prepareRawTreeListForExport(){const t=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},s={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},a=Object.assign({},t,s);return this.columns&&this.columns.length>0?r.cloneElement(this.treeList,Object.assign({},a,{columns:this.columns})):r.cloneElement(this.treeList,a)}};c.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};let o=c;exports.TreeListPDFExport=o;
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as s from "react";
|
|
9
9
|
import e from "prop-types";
|
|
10
|
-
import { getPageMargin as
|
|
11
|
-
import { savePDF as
|
|
12
|
-
import { provideSaveTreeListPDF as
|
|
10
|
+
import { getPageMargin as p } from "../getPageMargin.mjs";
|
|
11
|
+
import { savePDF as h } from "../savePDF.mjs";
|
|
12
|
+
import { provideSaveTreeListPDF as c } from "./provideSaveTreeListPDF.mjs";
|
|
13
13
|
import { createPortal as m } from "react-dom";
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import { validatePackage as
|
|
16
|
-
const
|
|
14
|
+
import { packageMetadata as o } from "../package-metadata.mjs";
|
|
15
|
+
import { validatePackage as l, getLicenseMessage as g, WatermarkOverlay as u } from "@progress/kendo-react-common";
|
|
16
|
+
const a = class a extends s.Component {
|
|
17
17
|
constructor(t) {
|
|
18
18
|
super(t), this.state = {
|
|
19
19
|
show: !1
|
|
20
|
-
}, this.showLicenseWatermark = !1, this.showLicenseWatermark = !
|
|
20
|
+
}, this.showLicenseWatermark = !1, this.showLicenseWatermark = !l(o, { component: "TreeListPDFExport" }), this.licenseMessage = g(o), this.saveTreeListPDF = c(this.getSavePDF()), this.treeListInnerWrapperRef = s.createRef();
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @hidden
|
|
@@ -25,7 +25,7 @@ const o = class o extends s.Component {
|
|
|
25
25
|
componentDidUpdate(t, r) {
|
|
26
26
|
this.state.show && this.state.show !== r.show && this.saveTreeListPDF(
|
|
27
27
|
this.treeListInnerWrapperRef.current,
|
|
28
|
-
Object.assign({}, this.props, { margin:
|
|
28
|
+
Object.assign({}, this.props, { margin: p(this.props) }),
|
|
29
29
|
this.callback
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -46,7 +46,7 @@ const o = class o extends s.Component {
|
|
|
46
46
|
/* @__PURE__ */ s.createElement("div", { ref: this.treeListInnerWrapperRef }, this.prepareRawTreeListForExport())
|
|
47
47
|
),
|
|
48
48
|
document.body
|
|
49
|
-
), this.showLicenseWatermark && /* @__PURE__ */ s.createElement(
|
|
49
|
+
), this.showLicenseWatermark && /* @__PURE__ */ s.createElement(u, { message: this.licenseMessage }));
|
|
50
50
|
}
|
|
51
51
|
/* eslint-disable max-len */
|
|
52
52
|
/**
|
|
@@ -63,7 +63,7 @@ const o = class o extends s.Component {
|
|
|
63
63
|
}, this.setState({ show: !0 });
|
|
64
64
|
}
|
|
65
65
|
getSavePDF() {
|
|
66
|
-
return
|
|
66
|
+
return h;
|
|
67
67
|
}
|
|
68
68
|
getTreeList() {
|
|
69
69
|
const t = this.props.children;
|
|
@@ -75,7 +75,7 @@ const o = class o extends s.Component {
|
|
|
75
75
|
return this.columns && this.columns.length > 0 ? s.cloneElement(this.treeList, Object.assign({}, i, { columns: this.columns })) : s.cloneElement(this.treeList, i);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
|
|
78
|
+
a.propTypes = {
|
|
79
79
|
author: e.string,
|
|
80
80
|
avoidLinks: e.oneOfType([e.bool, e.string]),
|
|
81
81
|
forcePageBreak: e.string,
|
|
@@ -109,7 +109,7 @@ o.propTypes = {
|
|
|
109
109
|
title: e.string,
|
|
110
110
|
allPages: e.bool
|
|
111
111
|
};
|
|
112
|
-
let
|
|
112
|
+
let n = a;
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
n as TreeListPDFExport
|
|
115
115
|
};
|