@progress/kendo-react-pdf 9.5.0 → 10.0.0-develop.1

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 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 c=require("react"),e=require("prop-types"),i=require("@progress/kendo-drawing"),p=require("@progress/kendo-file-saver"),u=require("./getPageMargin.js"),l=require("./KendoDrawingAdapter.js"),d=require("@progress/kendo-react-common"),b=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 s=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const g=f(c),a=class a extends g.Component{constructor(t){super(t),this.rootElForPDF=null,d.validatePackage(b.packageMetadata)}render(){return g.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children)}save(t){new l(i.drawDOM,i.exportPDF,p.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:u.getPageMargin(this.props)})}};a.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=a;exports.PDFExport=o;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),e=require("prop-types"),c=require("@progress/kendo-drawing"),l=require("@progress/kendo-file-saver"),u=require("./getPageMargin.js"),m=require("./KendoDrawingAdapter.js"),g=require("@progress/kendo-react-common"),d=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 i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const o=f(p),s=class s extends o.Component{constructor(t){super(t),this.rootElForPDF=null,this.showLicenseWatermark=!1,this.showLicenseWatermark=!g.validatePackage(d.packageMetadata,{component:"PDFExport"})}render(){return o.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children,this.showLicenseWatermark&&o.createElement(g.WatermarkOverlay,null))}save(t){new m(c.drawDOM,c.exportPDF,l.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:u.getPageMargin(this.props)})}};s.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=s;exports.PDFExport=a;
package/PDFExport.mjs CHANGED
@@ -5,30 +5,31 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as o from "react";
9
- import r from "prop-types";
10
- import { drawDOM as s, exportPDF as i } from "@progress/kendo-drawing";
11
- import { saveAs as a } from "@progress/kendo-file-saver";
8
+ import * as t from "react";
9
+ import e from "prop-types";
10
+ import { drawDOM as s, exportPDF as a } from "@progress/kendo-drawing";
11
+ import { saveAs as i } from "@progress/kendo-file-saver";
12
12
  import { getPageMargin as p } from "./getPageMargin.mjs";
13
- import g from "./KendoDrawingAdapter.mjs";
14
- import { validatePackage as m } from "@progress/kendo-react-common";
15
- import { packageMetadata as f } from "./package-metadata.mjs";
16
- const t = class t extends o.Component {
17
- constructor(e) {
18
- super(e), this.rootElForPDF = null, m(f);
13
+ import m from "./KendoDrawingAdapter.mjs";
14
+ import { validatePackage as g, WatermarkOverlay as l } from "@progress/kendo-react-common";
15
+ import { packageMetadata as c } from "./package-metadata.mjs";
16
+ const o = class o extends t.Component {
17
+ constructor(r) {
18
+ super(r), this.rootElForPDF = null, this.showLicenseWatermark = !1, this.showLicenseWatermark = !g(c, { component: "PDFExport" });
19
19
  }
20
20
  /**
21
21
  * @hidden
22
22
  */
23
23
  render() {
24
- return /* @__PURE__ */ o.createElement(
24
+ return /* @__PURE__ */ t.createElement(
25
25
  "div",
26
26
  {
27
- ref: (e) => {
28
- this.rootElForPDF = e;
27
+ ref: (r) => {
28
+ this.rootElForPDF = r;
29
29
  }
30
30
  },
31
- this.props.children
31
+ this.props.children,
32
+ this.showLicenseWatermark && /* @__PURE__ */ t.createElement(l, null)
32
33
  );
33
34
  }
34
35
  /**
@@ -36,47 +37,47 @@ const t = class t extends o.Component {
36
37
  *
37
38
  * @param callback - The callback to be executed after the PDF is saved.
38
39
  */
39
- save(e) {
40
- new g(s, i, a, this.rootElForPDF, this.getOptions()).savePDF(e);
40
+ save(r) {
41
+ new m(s, a, i, this.rootElForPDF, this.getOptions()).savePDF(r);
41
42
  }
42
43
  getOptions() {
43
44
  return Object.assign({}, this.props, { margin: p(this.props) });
44
45
  }
45
46
  };
46
- t.propTypes = {
47
- author: r.string,
48
- avoidLinks: r.oneOfType([r.bool, r.string]),
49
- forcePageBreak: r.string,
50
- keepTogether: r.string,
51
- creator: r.string,
52
- date: r.instanceOf(Date),
53
- imageResolution: r.number,
54
- fileName: r.string,
55
- forceProxy: r.bool,
56
- keywords: r.string,
57
- landscape: r.bool,
58
- margin: r.oneOfType([
59
- r.string,
60
- r.number,
61
- r.shape({
62
- left: r.oneOfType([r.number, r.string]),
63
- top: r.oneOfType([r.number, r.string]),
64
- right: r.oneOfType([r.number, r.string]),
65
- bottom: r.oneOfType([r.number, r.string])
47
+ o.propTypes = {
48
+ author: e.string,
49
+ avoidLinks: e.oneOfType([e.bool, e.string]),
50
+ forcePageBreak: e.string,
51
+ keepTogether: e.string,
52
+ creator: e.string,
53
+ date: e.instanceOf(Date),
54
+ imageResolution: e.number,
55
+ fileName: e.string,
56
+ forceProxy: e.bool,
57
+ keywords: e.string,
58
+ landscape: e.bool,
59
+ margin: e.oneOfType([
60
+ e.string,
61
+ e.number,
62
+ e.shape({
63
+ left: e.oneOfType([e.number, e.string]),
64
+ top: e.oneOfType([e.number, e.string]),
65
+ right: e.oneOfType([e.number, e.string]),
66
+ bottom: e.oneOfType([e.number, e.string])
66
67
  })
67
68
  ]),
68
- pageTemplate: r.any,
69
- paperSize: r.any,
70
- repeatHeaders: r.bool,
71
- scale: r.number,
72
- proxyData: r.any,
73
- proxyURL: r.string,
74
- proxyTarget: r.string,
75
- producer: r.string,
76
- subject: r.string,
77
- title: r.string
69
+ pageTemplate: e.any,
70
+ paperSize: e.any,
71
+ repeatHeaders: e.bool,
72
+ scale: e.number,
73
+ proxyData: e.any,
74
+ proxyURL: e.string,
75
+ proxyTarget: e.string,
76
+ producer: e.string,
77
+ subject: e.string,
78
+ title: e.string
78
79
  };
79
- let n = t;
80
+ let n = o;
80
81
  export {
81
82
  n as PDFExport
82
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 d=class extends l.Component{render(){return null}};d.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 h=d;const g=["bottom","left","right","top"];function u(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===h));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:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,i.validatePackage(f)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children)}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 T(e,t={},r){new m(o.drawDOM,o.exportPDF,s.saveAs,e,t).savePDF(r)}const O={},k=e=>String(e).trim().split(" "),v=e=>t=>((e,t)=>{const r=k(t);return!!k(e.className).find((e=>r.indexOf(e)>=0))})(t,e),w=e=>(O[e]||(O[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),O[e]),D=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=D(e,t);if(r)return r}e=e.nextSibling}}},P="k-grid-header",x="k-grid-footer",C=w("TABLE"),E=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=D(e,v("k-grid-container"))}content(e){return D(this.list,v("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||D(this.element,v(P)),D(this.headerWrap,v(`${P}-${E(e)}`))}footer(e){return this.footerWrap=this.footerWrap||D(this.element,v(x)),D(this.footerWrap,v(`${x}-${E(e)}`))}table(){return D(this.element,C)}}const N="k-first",R=(e,t)=>{const r=t.length;for(let o=0;o<r;o++)e.appendChild(t[o].cloneNode(!0))},S=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},L=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++)R(r.rows[s],e[o].rows[s].cells);return r},j=(e,t,r,o)=>{const s=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)R(n,e[t].querySelectorAll("col"));const i=L(t),a=L(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(N)&&(s.className+=` ${N}`)}})(i,t),s.appendChild(n),s.appendChild(i),s.appendChild(a),o.length){const e=L(o);e.className="k-grid-footer",s.appendChild(e)}return S(s)},W=e=>{const t=new F(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=j(e,s,n,a)}else o=S(t.table().cloneNode(!0));return o};function A(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=W(t);return s.appendChild(e),document.body.appendChild(s),e}n()}(e,t,r,o)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},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:u(this.props)}),this.callback)}render(){return 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)}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 T}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=Object.assign({},t,r);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=w("TABLE");class M{constructor(e){this.element=e,this.list=D(e,v("k-grid"))}content(){return D(this.list,v("k-grid"))}header(){return this.headerWrap=this.headerWrap||D(this.element,v(K)),D(this.headerWrap,v(`${K}`))}footer(){return this.footerWrap=this.footerWrap||D(this.element,v(U)),D(this.footerWrap,v(`${U}`))}table(){return D(this.element,I)}}const z=e=>{const t=new M(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=j(e,n,i,p)}else o=S(t.table().cloneNode(!0));return o};function $(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=z(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const B=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.saveTreeListPDF=$(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 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)}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 T}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)}};B.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 H=B;e.GridPDFExport=G,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=h,e.TreeListPDFExport=H,e.getPageMargin=u,e.savePDF=T}));
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:"$VERSION",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"),C=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}-${C(e)}`))}footer(e){return this.footerWrap=this.footerWrap||P(this.element,O(x)),P(this.footerWrap,O(`${x}-${C(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 F(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};function A(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 q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"GridPDFExport"}),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: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=Object.assign({},t,r);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 M{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 z=e=>{const t=new M(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 $(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=z(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const B=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"TreeListPDFExport"}),this.saveTreeListPDF=$(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)}};B.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 H=B;e.GridPDFExport=G,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=H,e.getPageMargin=u,e.savePDF=k}));
@@ -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 c=require("react"),e=require("prop-types"),g=require("../getPageMargin.js"),u=require("../savePDF.js"),d=require("./provideSaveGridPDF.js"),h=require("react-dom");function m(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=m(c),a=class a extends s.Component{constructor(t){super(t),this.state={show:!1},this.saveGridPDF=d.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:g.getPageMargin(this.props)}),this.callback)}render(){return this.state.show&&h.createPortal(s.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},s.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body)}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 u.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"})},p=Object.assign({},r,i);if(this.columns&&this.columns.length>0){const l=this.getGridNotColumnChildren(this.grid);return s.cloneElement(this.grid,p,this.columns.concat(l))}return s.cloneElement(this.grid,p)}getGridNotColumnChildren(t){return s.Children.toArray(t.props.children).filter(r=>r&&r.type&&r.type.displayName!=="KendoReactGridColumn")}};a.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=a;exports.GridPDFExport=o;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),e=require("prop-types"),u=require("../getPageMargin.js"),d=require("../savePDF.js"),h=require("./provideSaveGridPDF.js"),m=require("react-dom"),c=require("@progress/kendo-react-common"),y=require("../package-metadata.js");function f(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=f(g),a=class a extends s.Component{constructor(t){super(t),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!c.validatePackage(y.packageMetadata,{component:"GridPDFExport"}),this.saveGridPDF=h.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&&m.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(c.WatermarkOverlay,null))}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 d.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"})},p=Object.assign({},r,i);if(this.columns&&this.columns.length>0){const l=this.getGridNotColumnChildren(this.grid);return s.cloneElement(this.grid,p,this.columns.concat(l))}return s.cloneElement(this.grid,p)}getGridNotColumnChildren(t){return s.Children.toArray(t.props.children).filter(r=>r&&r.type&&r.type.displayName!=="KendoReactGridColumn")}};a.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=a;exports.GridPDFExport=o;
@@ -5,25 +5,27 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as s from "react";
8
+ import * as r from "react";
9
9
  import e from "prop-types";
10
- import { getPageMargin as h } from "../getPageMargin.mjs";
11
- import { savePDF as l } from "../savePDF.mjs";
12
- import { provideSaveGridPDF as g } from "./provideSaveGridPDF.mjs";
13
- import { createPortal as m } from "react-dom";
14
- const i = class i extends s.Component {
10
+ import { getPageMargin as l } from "../getPageMargin.mjs";
11
+ import { savePDF as m } from "../savePDF.mjs";
12
+ import { provideSaveGridPDF as h } from "./provideSaveGridPDF.mjs";
13
+ import { createPortal as g } from "react-dom";
14
+ import { validatePackage as c, WatermarkOverlay as d } from "@progress/kendo-react-common";
15
+ import { packageMetadata as u } from "../package-metadata.mjs";
16
+ const i = class i extends r.Component {
15
17
  constructor(t) {
16
18
  super(t), this.state = {
17
19
  show: !1
18
- }, this.saveGridPDF = g(this.getSavePDF()), this.gridInnerWrapperRef = s.createRef();
20
+ }, this.showLicenseWatermark = !1, this.showLicenseWatermark = !c(u, { component: "GridPDFExport" }), this.saveGridPDF = h(this.getSavePDF()), this.gridInnerWrapperRef = r.createRef();
19
21
  }
20
22
  /**
21
23
  * @hidden
22
24
  */
23
- componentDidUpdate(t, r) {
24
- this.state.show && this.state.show !== r.show && this.saveGridPDF(
25
+ componentDidUpdate(t, s) {
26
+ this.state.show && this.state.show !== s.show && this.saveGridPDF(
25
27
  this.gridInnerWrapperRef.current,
26
- Object.assign({}, this.props, { margin: h(this.props) }),
28
+ Object.assign({}, this.props, { margin: l(this.props) }),
27
29
  this.callback
28
30
  );
29
31
  }
@@ -31,8 +33,8 @@ const i = class i extends s.Component {
31
33
  * @hidden
32
34
  */
33
35
  render() {
34
- return this.state.show && m(
35
- /* @__PURE__ */ s.createElement(
36
+ return /* @__PURE__ */ r.createElement(r.Fragment, null, this.state.show && g(
37
+ /* @__PURE__ */ r.createElement(
36
38
  "div",
37
39
  {
38
40
  style: {
@@ -41,10 +43,10 @@ const i = class i extends s.Component {
41
43
  top: "0px"
42
44
  }
43
45
  },
44
- /* @__PURE__ */ s.createElement("div", { ref: this.gridInnerWrapperRef }, this.prepareRawGridForExport(this.data))
46
+ /* @__PURE__ */ r.createElement("div", { ref: this.gridInnerWrapperRef }, this.prepareRawGridForExport(this.data))
45
47
  ),
46
48
  document.body
47
- );
49
+ ), this.showLicenseWatermark && /* @__PURE__ */ r.createElement(d, null));
48
50
  }
49
51
  /* eslint-disable max-len */
50
52
  /**
@@ -54,35 +56,35 @@ const i = class i extends s.Component {
54
56
  * @param callback - The callback that will be executed after the PDF is saved.
55
57
  */
56
58
  // tslint:enable:max-line-length
57
- save(t, r) {
59
+ save(t, s) {
58
60
  this.grid = this.getGrid(), this.columns = this.getCustomColumns(), this.data = t, this.callback = () => {
59
- this.setState({ show: !1 }), r && r();
61
+ this.setState({ show: !1 }), s && s();
60
62
  }, this.setState({ show: !0 });
61
63
  }
62
64
  getSavePDF() {
63
- return l;
65
+ return m;
64
66
  }
65
67
  getGrid() {
66
- return s.Children.toArray(this.props.children).find(
68
+ return r.Children.toArray(this.props.children).find(
67
69
  (t) => t && t.type.displayName === "KendoReactGrid"
68
70
  );
69
71
  }
70
72
  getCustomColumns() {
71
- return s.Children.toArray(this.props.children).filter(
73
+ return r.Children.toArray(this.props.children).filter(
72
74
  (t) => t && t.type.displayName === "KendoReactGridColumn"
73
75
  );
74
76
  }
75
77
  prepareRawGridForExport(t) {
76
- const r = t && { data: t, total: t.length, pageSize: t.length, skip: 0 }, a = { style: Object.assign({}, this.grid.props.style, { width: "1000px" }) }, o = Object.assign({}, r, a);
78
+ const s = t && { data: t, total: t.length, pageSize: t.length, skip: 0 }, a = { style: Object.assign({}, this.grid.props.style, { width: "1000px" }) }, o = Object.assign({}, s, a);
77
79
  if (this.columns && this.columns.length > 0) {
78
80
  const p = this.getGridNotColumnChildren(this.grid);
79
- return s.cloneElement(this.grid, o, this.columns.concat(p));
81
+ return r.cloneElement(this.grid, o, this.columns.concat(p));
80
82
  }
81
- return s.cloneElement(this.grid, o);
83
+ return r.cloneElement(this.grid, o);
82
84
  }
83
85
  getGridNotColumnChildren(t) {
84
- return s.Children.toArray(t.props.children).filter(
85
- (r) => r && r.type && r.type.displayName !== "KendoReactGridColumn"
86
+ return r.Children.toArray(t.props.children).filter(
87
+ (s) => s && s.type && s.type.displayName !== "KendoReactGridColumn"
86
88
  );
87
89
  }
88
90
  };
package/index.d.mts CHANGED
@@ -88,6 +88,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
88
88
  readonly state: {
89
89
  show: boolean;
90
90
  };
91
+ private readonly showLicenseWatermark;
91
92
  constructor(props: any);
92
93
  /**
93
94
  * @hidden
@@ -96,7 +97,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
96
97
  /**
97
98
  * @hidden
98
99
  */
99
- render(): false | React_2.ReactPortal;
100
+ render(): JSX_2.Element;
100
101
  /**
101
102
  * Saves the content of the Grid as a PDF file.
102
103
  *
@@ -193,6 +194,7 @@ export declare class PDFExport extends React_2.Component<PDFExportProps, {}> {
193
194
  title: default_2.Requireable<string>;
194
195
  };
195
196
  private rootElForPDF;
197
+ private readonly showLicenseWatermark;
196
198
  constructor(props: PDFExportProps);
197
199
  /**
198
200
  * @hidden
@@ -473,6 +475,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
473
475
  readonly state: {
474
476
  show: boolean;
475
477
  };
478
+ private readonly showLicenseWatermark;
476
479
  constructor(props: any);
477
480
  /**
478
481
  * @hidden
@@ -481,7 +484,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
481
484
  /**
482
485
  * @hidden
483
486
  */
484
- render(): false | React_2.ReactPortal;
487
+ render(): JSX_2.Element;
485
488
  /**
486
489
  * Saves the content of the TreeList as a PDF file.
487
490
  *
package/index.d.ts CHANGED
@@ -88,6 +88,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
88
88
  readonly state: {
89
89
  show: boolean;
90
90
  };
91
+ private readonly showLicenseWatermark;
91
92
  constructor(props: any);
92
93
  /**
93
94
  * @hidden
@@ -96,7 +97,7 @@ export declare class GridPDFExport extends React_2.Component<GridPDFExportProps,
96
97
  /**
97
98
  * @hidden
98
99
  */
99
- render(): false | React_2.ReactPortal;
100
+ render(): JSX_2.Element;
100
101
  /**
101
102
  * Saves the content of the Grid as a PDF file.
102
103
  *
@@ -193,6 +194,7 @@ export declare class PDFExport extends React_2.Component<PDFExportProps, {}> {
193
194
  title: default_2.Requireable<string>;
194
195
  };
195
196
  private rootElForPDF;
197
+ private readonly showLicenseWatermark;
196
198
  constructor(props: PDFExportProps);
197
199
  /**
198
200
  * @hidden
@@ -473,6 +475,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
473
475
  readonly state: {
474
476
  show: boolean;
475
477
  };
478
+ private readonly showLicenseWatermark;
476
479
  constructor(props: any);
477
480
  /**
478
481
  * @hidden
@@ -481,7 +484,7 @@ export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExpo
481
484
  /**
482
485
  * @hidden
483
486
  */
484
- render(): false | React_2.ReactPortal;
487
+ render(): JSX_2.Element;
485
488
  /**
486
489
  * Saves the content of the TreeList as a PDF file.
487
490
  *
@@ -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: 1741090884,version:"9.5.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1741180427,version:"10.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1741090884,
14
- version: "9.5.0",
13
+ publishDate: 1741180427,
14
+ version: "10.0.0-develop.1",
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": "9.5.0",
3
+ "version": "10.0.0-develop.1",
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",
@@ -28,7 +28,7 @@
28
28
  "@progress/kendo-drawing": "^1.21.2",
29
29
  "@progress/kendo-file-saver": "^1.0.1",
30
30
  "@progress/kendo-licensing": "^1.5.0",
31
- "@progress/kendo-react-common": "9.5.0",
31
+ "@progress/kendo-react-common": "10.0.0-develop.1",
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": 1741090884,
57
+ "publishDate": 1741180427,
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 p=require("react"),e=require("prop-types"),c=require("../getPageMargin.js"),l=require("../savePDF.js"),u=require("./provideSaveTreeListPDF.js"),g=require("react-dom");function h(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const i=h(p),a=class a extends i.Component{constructor(t){super(t),this.state={show:!1},this.saveTreeListPDF=u.provideSaveTreeListPDF(this.getSavePDF()),this.treeListInnerWrapperRef=i.createRef()}componentDidUpdate(t,s){this.state.show&&this.state.show!==s.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:c.getPageMargin(this.props)}),this.callback)}render(){return this.state.show&&g.createPortal(i.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},i.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body)}save(t,s,r){this.treeList=this.getTreeList(),this.columns=s||[],this.data=t,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return l.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"})},r=Object.assign({},t,s);return this.columns&&this.columns.length>0?i.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):i.cloneElement(this.treeList,r)}};a.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=a;exports.TreeListPDFExport=o;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),e=require("prop-types"),l=require("../getPageMargin.js"),h=require("../savePDF.js"),u=require("./provideSaveTreeListPDF.js"),g=require("react-dom"),m=require("../package-metadata.js"),c=require("@progress/kendo-react-common");function d(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const r in i)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}return t.default=i,Object.freeze(t)}const s=d(p),o=class o extends s.Component{constructor(t){super(t),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!c.validatePackage(m.packageMetadata,{component:"TreeListPDFExport"}),this.saveTreeListPDF=u.provideSaveTreeListPDF(this.getSavePDF()),this.treeListInnerWrapperRef=s.createRef()}componentDidUpdate(t,r){this.state.show&&this.state.show!==r.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:l.getPageMargin(this.props)}),this.callback)}render(){return s.createElement(s.Fragment,null,this.state.show&&g.createPortal(s.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},s.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&s.createElement(c.WatermarkOverlay,null))}save(t,r,a){this.treeList=this.getTreeList(),this.columns=r||[],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}:{},r={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},a=Object.assign({},t,r);return this.columns&&this.columns.length>0?s.cloneElement(this.treeList,Object.assign({},a,{columns:this.columns})):s.cloneElement(this.treeList,a)}};o.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 n=o;exports.TreeListPDFExport=n;
@@ -7,15 +7,17 @@
7
7
  */
8
8
  import * as s from "react";
9
9
  import e from "prop-types";
10
- import { getPageMargin as a } from "../getPageMargin.mjs";
10
+ import { getPageMargin as n } from "../getPageMargin.mjs";
11
11
  import { savePDF as p } from "../savePDF.mjs";
12
12
  import { provideSaveTreeListPDF as h } from "./provideSaveTreeListPDF.mjs";
13
- import { createPortal as c } from "react-dom";
13
+ import { createPortal as m } from "react-dom";
14
+ import { packageMetadata as l } from "../package-metadata.mjs";
15
+ import { validatePackage as c, WatermarkOverlay as g } from "@progress/kendo-react-common";
14
16
  const o = class o extends s.Component {
15
17
  constructor(t) {
16
18
  super(t), this.state = {
17
19
  show: !1
18
- }, this.saveTreeListPDF = h(this.getSavePDF()), this.treeListInnerWrapperRef = s.createRef();
20
+ }, this.showLicenseWatermark = !1, this.showLicenseWatermark = !c(l, { component: "TreeListPDFExport" }), this.saveTreeListPDF = h(this.getSavePDF()), this.treeListInnerWrapperRef = s.createRef();
19
21
  }
20
22
  /**
21
23
  * @hidden
@@ -23,7 +25,7 @@ const o = class o extends s.Component {
23
25
  componentDidUpdate(t, r) {
24
26
  this.state.show && this.state.show !== r.show && this.saveTreeListPDF(
25
27
  this.treeListInnerWrapperRef.current,
26
- Object.assign({}, this.props, { margin: a(this.props) }),
28
+ Object.assign({}, this.props, { margin: n(this.props) }),
27
29
  this.callback
28
30
  );
29
31
  }
@@ -31,7 +33,7 @@ const o = class o extends s.Component {
31
33
  * @hidden
32
34
  */
33
35
  render() {
34
- return this.state.show && c(
36
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, this.state.show && m(
35
37
  /* @__PURE__ */ s.createElement(
36
38
  "div",
37
39
  {
@@ -44,7 +46,7 @@ const o = class o extends s.Component {
44
46
  /* @__PURE__ */ s.createElement("div", { ref: this.treeListInnerWrapperRef }, this.prepareRawTreeListForExport())
45
47
  ),
46
48
  document.body
47
- );
49
+ ), this.showLicenseWatermark && /* @__PURE__ */ s.createElement(g, null));
48
50
  }
49
51
  /* eslint-disable max-len */
50
52
  /**
@@ -107,7 +109,7 @@ o.propTypes = {
107
109
  title: e.string,
108
110
  allPages: e.bool
109
111
  };
110
- let n = o;
112
+ let a = o;
111
113
  export {
112
- n as TreeListPDFExport
114
+ a as TreeListPDFExport
113
115
  };