@progress/kendo-react-pdf 17.1.0-develop.3 → 17.1.0-develop.5

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.d.ts CHANGED
@@ -45,8 +45,6 @@ export declare class PDFExport extends React.Component<PDFExportProps, {}> {
45
45
  title: PropTypes.Requireable<string>;
46
46
  };
47
47
  private rootElForPDF;
48
- private readonly showLicenseWatermark;
49
- private readonly licenseMessage?;
50
48
  constructor(props: PDFExportProps);
51
49
  /**
52
50
  * @hidden
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 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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),e=require("prop-types"),i=require("@progress/kendo-drawing"),c=require("@progress/kendo-file-saver"),u=require("./getPageMargin.js"),l=require("./KendoDrawingAdapter.js"),d=require("@progress/kendo-react-common"),m=require("./package-metadata.js");function b(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=b(p),a=class a extends g.Component{constructor(t){super(t),this.rootElForPDF=null,d.validatePackage(m.packageMetadata,{component:"PDFExport"})}render(){return g.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children)}save(t){new l(i.drawDOM,i.exportPDF,c.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;
package/PDFExport.mjs CHANGED
@@ -5,31 +5,30 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as t from "react";
9
- import e from "prop-types";
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
- import m from "./KendoDrawingAdapter.mjs";
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
- constructor(r) {
18
- super(r), this.rootElForPDF = null, this.showLicenseWatermark = !1, this.showLicenseWatermark = !c(o, { component: "PDFExport" }), this.licenseMessage = l(o);
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";
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, { component: "PDFExport" });
19
19
  }
20
20
  /**
21
21
  * @hidden
22
22
  */
23
23
  render() {
24
- return /* @__PURE__ */ t.createElement(
24
+ return /* @__PURE__ */ o.createElement(
25
25
  "div",
26
26
  {
27
- ref: (r) => {
28
- this.rootElForPDF = r;
27
+ ref: (e) => {
28
+ this.rootElForPDF = e;
29
29
  }
30
30
  },
31
- this.props.children,
32
- this.showLicenseWatermark && /* @__PURE__ */ t.createElement(f, { message: this.licenseMessage })
31
+ this.props.children
33
32
  );
34
33
  }
35
34
  /**
@@ -37,47 +36,47 @@ const s = class s extends t.Component {
37
36
  *
38
37
  * @param callback - The callback to be executed after the PDF is saved.
39
38
  */
40
- save(r) {
41
- new m(a, i, p, this.rootElForPDF, this.getOptions()).savePDF(r);
39
+ save(e) {
40
+ new g(s, i, a, this.rootElForPDF, this.getOptions()).savePDF(e);
42
41
  }
43
42
  getOptions() {
44
- return Object.assign({}, this.props, { margin: g(this.props) });
43
+ return Object.assign({}, this.props, { margin: p(this.props) });
45
44
  }
46
45
  };
47
- s.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])
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])
67
66
  })
68
67
  ]),
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
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
79
78
  };
80
- let n = s;
79
+ let n = t;
81
80
  export {
82
81
  n as PDFExport
83
82
  };
@@ -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,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=Object.freeze({name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"17.1.0-develop.3",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 T={},w=e=>String(e).trim().split(" "),O=e=>t=>((e,t)=>{const r=w(t);return!!w(e.className).find(e=>r.indexOf(e)>=0)})(t,e),v=e=>(T[e]||(T[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),T[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))},S=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},R=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=R(t),a=R(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=R(s);e.className="k-grid-footer",o.appendChild(e)}return S(o)},j=M(k);function M(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=(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=S(t.table().cloneNode(!0));return s})(t);return o.appendChild(e),document.body.appendChild(o),e}n()}(e,t,r,s)}const A=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=M(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)}};A.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 q=A;const G="k-grid-header",K="k-grid-footer",U=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(G)),P(this.headerWrap,O(`${G}`))}footer(){return this.footerWrap=this.footerWrap||P(this.element,O(K)),P(this.footerWrap,O(`${K}`))}table(){return P(this.element,U)}}function I(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=(e=>{var t;const r=new z(e),s=r.content();let o;const n=r.header(),i="THEAD"===n.nodeName?n:n.querySelector("thead");if(i&&i.childNodes.length>1&&i.removeChild(i.childNodes[1]),i&&(null==(t=i.childNodes[0])||t.childNodes.forEach(e=>e.style.top=0)),s){const e=[s.querySelector("colgroup")],t=[i],n=[s.querySelector("tbody")],a=r.footer(),p=a?[a.querySelector("tfoot")]:[];o=W(e,t,n,p)}else o=S(r.table().cloneNode(!0));return o})(t);return o.appendChild(e),document.body.appendChild(o),o}n()}(e,t,r,s)}const $=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=I(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)}};$.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=$;e.GridPDFExport=q,e.KendoDrawingAdapter=u,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=H,e.getPageMargin=m,e.saveGridPDF=j,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,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=Object.freeze({name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"17.1.0-develop.5",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,{component:"PDFExport"})}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(" "),P=e=>t=>((e,t)=>{const r=k(t);return!!k(e.className).find(e=>r.indexOf(e)>=0)})(t,e),v=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}}},w="k-grid-header",x="k-grid-footer",E=v("TABLE"),C=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=D(e,P("k-grid-container"))}content(e){return D(this.list,P("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||D(this.element,P(w)),D(this.headerWrap,P(`${w}-${C(e)}`))}footer(e){return this.footerWrap=this.footerWrap||D(this.element,P(x)),D(this.footerWrap,P(`${x}-${C(e)}`))}table(){return D(this.element,E)}}const N="k-first",S=(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},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++)S(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++)S(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 R(s)},W=A(T);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=(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=R(t.table().cloneNode(!0));return o})(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},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 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={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)}};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",z=v("TABLE");class I{constructor(e){this.element=e,this.list=D(e,P("k-grid"))}content(){return D(this.list,P("k-grid"))}header(){return this.headerWrap=this.headerWrap||D(this.element,P(K)),D(this.headerWrap,P(`${K}`))}footer(){return this.footerWrap=this.footerWrap||D(this.element,P(U)),D(this.footerWrap,P(`${U}`))}table(){return D(this.element,z)}}function M(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=(e=>{var t;const r=new I(e),o=r.content();let s;const n=r.header(),i="THEAD"===n.nodeName?n:n.querySelector("thead");if(i&&i.childNodes.length>1&&i.removeChild(i.childNodes[1]),i&&(null==(t=i.childNodes[0])||t.childNodes.forEach(e=>e.style.top=0)),o){const e=[o.querySelector("colgroup")],t=[i],n=[o.querySelector("tbody")],a=r.footer(),p=a?[a.querySelector("tfoot")]:[];s=j(e,t,n,p)}else s=R(r.table().cloneNode(!0));return s})(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const $=class extends l.Component{constructor(e){super(e),this.state={show:!1},i.validatePackage(f,{component:"TreeListPDFExport"}),this.saveTreeListPDF=M(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)}};$.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=$;e.GridPDFExport=G,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=h,e.TreeListPDFExport=H,e.getPageMargin=u,e.saveGridPDF=W,e.savePDF=T});
@@ -87,8 +87,6 @@ export declare class GridPDFExport extends React.Component<GridPDFExportProps, G
87
87
  readonly state: {
88
88
  show: boolean;
89
89
  };
90
- private readonly showLicenseWatermark;
91
- private readonly licenseMessage?;
92
90
  constructor(props: any);
93
91
  /**
94
92
  * @hidden
@@ -97,7 +95,7 @@ export declare class GridPDFExport extends React.Component<GridPDFExportProps, G
97
95
  /**
98
96
  * @hidden
99
97
  */
100
- render(): React.JSX.Element;
98
+ render(): false | React.ReactPortal;
101
99
  /**
102
100
  * Saves the content of the Grid as a PDF file.
103
101
  *
@@ -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 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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),e=require("prop-types"),d=require("../getPageMargin.js"),u=require("../savePDF.js"),h=require("./provideSaveGridPDF.js"),m=require("react-dom"),y=require("@progress/kendo-react-common"),f=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 o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const s=b(g),a=class a extends s.Component{constructor(t){super(t),this.state={show:!1},y.validatePackage(f.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:d.getPageMargin(this.props)}),this.callback)}render(){return 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)}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},o={style:Object.assign({},this.grid.props.style,{width:"1000px"})},c={scrollable:this.grid.props==="none"?"none":"scrollable"},p=Object.assign({},r,o,c);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 i=a;exports.GridPDFExport=i;
@@ -5,27 +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 r from "react";
8
+ import * as s from "react";
9
9
  import e from "prop-types";
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 {
10
+ import { getPageMargin as m } from "../getPageMargin.mjs";
11
+ import { savePDF as h } from "../savePDF.mjs";
12
+ import { provideSaveGridPDF as g } from "./provideSaveGridPDF.mjs";
13
+ import { createPortal as c } from "react-dom";
14
+ import { validatePackage as d } from "@progress/kendo-react-common";
15
+ import { packageMetadata as u } from "../package-metadata.mjs";
16
+ const o = class o extends s.Component {
17
17
  constructor(t) {
18
18
  super(t), this.state = {
19
19
  show: !1
20
- }, this.showLicenseWatermark = !1, this.showLicenseWatermark = !u(n, { component: "GridPDFExport" }), this.licenseMessage = f(n), this.saveGridPDF = c(this.getSavePDF()), this.gridInnerWrapperRef = r.createRef();
20
+ }, d(u, { component: "GridPDFExport" }), this.saveGridPDF = g(this.getSavePDF()), this.gridInnerWrapperRef = s.createRef();
21
21
  }
22
22
  /**
23
23
  * @hidden
24
24
  */
25
- componentDidUpdate(t, s) {
26
- this.state.show && this.state.show !== s.show && this.saveGridPDF(
25
+ componentDidUpdate(t, r) {
26
+ this.state.show && this.state.show !== r.show && this.saveGridPDF(
27
27
  this.gridInnerWrapperRef.current,
28
- Object.assign({}, this.props, { margin: h(this.props) }),
28
+ Object.assign({}, this.props, { margin: m(this.props) }),
29
29
  this.callback
30
30
  );
31
31
  }
@@ -33,8 +33,8 @@ const i = class i extends r.Component {
33
33
  * @hidden
34
34
  */
35
35
  render() {
36
- return /* @__PURE__ */ r.createElement(r.Fragment, null, this.state.show && d(
37
- /* @__PURE__ */ r.createElement(
36
+ return this.state.show && c(
37
+ /* @__PURE__ */ s.createElement(
38
38
  "div",
39
39
  {
40
40
  style: {
@@ -43,10 +43,10 @@ const i = class i extends r.Component {
43
43
  top: "0px"
44
44
  }
45
45
  },
46
- /* @__PURE__ */ r.createElement("div", { ref: this.gridInnerWrapperRef }, this.prepareRawGridForExport(this.data))
46
+ /* @__PURE__ */ s.createElement("div", { ref: this.gridInnerWrapperRef }, this.prepareRawGridForExport(this.data))
47
47
  ),
48
48
  document.body
49
- ), this.showLicenseWatermark && /* @__PURE__ */ r.createElement(y, { message: this.licenseMessage }));
49
+ );
50
50
  }
51
51
  /* eslint-disable max-len */
52
52
  /**
@@ -56,44 +56,44 @@ const i = class i extends r.Component {
56
56
  * @param callback - The callback that will be executed after the PDF is saved.
57
57
  */
58
58
  // tslint:enable:max-line-length
59
- save(t, s) {
59
+ save(t, r) {
60
60
  this.grid = this.getGrid(), this.columns = this.getCustomColumns(), this.data = t, this.callback = () => {
61
- this.setState({ show: !1 }), s && s();
61
+ this.setState({ show: !1 }), r && r();
62
62
  }, this.setState({ show: !0 });
63
63
  }
64
64
  getSavePDF() {
65
- return g;
65
+ return h;
66
66
  }
67
67
  getGrid() {
68
- return r.Children.toArray(this.props.children).find(
68
+ return s.Children.toArray(this.props.children).find(
69
69
  (t) => t && t.type.displayName === "KendoReactGrid"
70
70
  );
71
71
  }
72
72
  getCustomColumns() {
73
- return r.Children.toArray(this.props.children).filter(
73
+ return s.Children.toArray(this.props.children).filter(
74
74
  (t) => t && t.type.displayName === "KendoReactGridColumn"
75
75
  );
76
76
  }
77
77
  prepareRawGridForExport(t) {
78
- const s = t && {
78
+ const r = t && {
79
79
  data: t,
80
80
  total: t.length,
81
81
  pageSize: t.length,
82
82
  skip: 0
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);
83
+ }, a = { style: Object.assign({}, this.grid.props.style, { width: "1000px" }) }, p = { scrollable: this.grid.props === "none" ? "none" : "scrollable" }, i = Object.assign({}, r, a, p);
84
84
  if (this.columns && this.columns.length > 0) {
85
- const m = this.getGridNotColumnChildren(this.grid);
86
- return r.cloneElement(this.grid, o, this.columns.concat(m));
85
+ const l = this.getGridNotColumnChildren(this.grid);
86
+ return s.cloneElement(this.grid, i, this.columns.concat(l));
87
87
  }
88
- return r.cloneElement(this.grid, o);
88
+ return s.cloneElement(this.grid, i);
89
89
  }
90
90
  getGridNotColumnChildren(t) {
91
- return r.Children.toArray(t.props.children).filter(
92
- (s) => s && s.type && s.type.displayName !== "KendoReactGridColumn"
91
+ return s.Children.toArray(t.props.children).filter(
92
+ (r) => r && r.type && r.type.displayName !== "KendoReactGridColumn"
93
93
  );
94
94
  }
95
95
  };
96
- i.propTypes = {
96
+ o.propTypes = {
97
97
  author: e.string,
98
98
  avoidLinks: e.oneOfType([e.bool, e.string]),
99
99
  forcePageBreak: e.string,
@@ -126,7 +126,7 @@ i.propTypes = {
126
126
  subject: e.string,
127
127
  title: e.string
128
128
  };
129
- let a = i;
129
+ let n = o;
130
130
  export {
131
- a as GridPDFExport
131
+ n as GridPDFExport
132
132
  };
@@ -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=Object.freeze({name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1794917144,version:"17.1.0-develop.3",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=Object.freeze({name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1795085608,version:"17.1.0-develop.5",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1794917144,
11
- version: '17.1.0-develop.3',
10
+ publishDate: 1795085608,
11
+ version: '17.1.0-develop.5',
12
12
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-pdf",
3
- "version": "17.1.0-develop.3",
3
+ "version": "17.1.0-develop.5",
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.25.5",
29
29
  "@progress/kendo-file-saver": "^1.0.1",
30
30
  "@progress/kendo-licensing": "^1.13.1",
31
- "@progress/kendo-react-common": "17.1.0-develop.3",
31
+ "@progress/kendo-react-common": "17.1.0-develop.5",
32
32
  "react": "^18.0.0 || ^19.0.0",
33
33
  "react-dom": "^18.0.0 || ^19.0.0"
34
34
  },
@@ -54,7 +54,7 @@
54
54
  "package": {
55
55
  "productName": "KendoReact",
56
56
  "productCode": "KENDOUIREACT",
57
- "publishDate": 1794917144,
57
+ "publishDate": 1795085608,
58
58
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
59
59
  }
60
60
  },
@@ -92,8 +92,6 @@ export declare class TreeListPDFExport extends React.Component<TreeListPDFExport
92
92
  readonly state: {
93
93
  show: boolean;
94
94
  };
95
- private readonly showLicenseWatermark;
96
- private readonly licenseMessage?;
97
95
  constructor(props: any);
98
96
  /**
99
97
  * @hidden
@@ -102,7 +100,7 @@ export declare class TreeListPDFExport extends React.Component<TreeListPDFExport
102
100
  /**
103
101
  * @hidden
104
102
  */
105
- render(): React.JSX.Element;
103
+ render(): false | React.ReactPortal;
106
104
  /**
107
105
  * Saves the content of the TreeList as a PDF file.
108
106
  *
@@ -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 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;
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"),h=require("../package-metadata.js"),m=require("@progress/kendo-react-common");function d(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>o[r]})}}return t.default=o,Object.freeze(t)}const i=d(p),n=class n extends i.Component{constructor(t){super(t),this.state={show:!1},m.validatePackage(h.packageMetadata,{component:"TreeListPDFExport"}),this.saveTreeListPDF=u.provideSaveTreeListPDF(this.getSavePDF()),this.treeListInnerWrapperRef=i.createRef()}componentDidUpdate(t,r){this.state.show&&this.state.show!==r.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,r,s){this.treeList=this.getTreeList(),this.columns=r||[],this.data=t,this.callback=()=>{this.setState({show:!1}),s&&s()},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}:{},r={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},s=Object.assign({},t,r);return this.columns&&this.columns.length>0?i.cloneElement(this.treeList,Object.assign({},s,{columns:this.columns})):i.cloneElement(this.treeList,s)}};n.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 a=n;exports.TreeListPDFExport=a;
@@ -7,17 +7,17 @@
7
7
  */
8
8
  import * as s from "react";
9
9
  import e from "prop-types";
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
- import { createPortal as m } from "react-dom";
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 {
10
+ import { getPageMargin as n } from "../getPageMargin.mjs";
11
+ import { savePDF as p } from "../savePDF.mjs";
12
+ import { provideSaveTreeListPDF as h } from "./provideSaveTreeListPDF.mjs";
13
+ import { createPortal as c } from "react-dom";
14
+ import { packageMetadata as m } from "../package-metadata.mjs";
15
+ import { validatePackage as l } from "@progress/kendo-react-common";
16
+ const i = class i extends s.Component {
17
17
  constructor(t) {
18
18
  super(t), this.state = {
19
19
  show: !1
20
- }, this.showLicenseWatermark = !1, this.showLicenseWatermark = !l(o, { component: "TreeListPDFExport" }), this.licenseMessage = g(o), this.saveTreeListPDF = c(this.getSavePDF()), this.treeListInnerWrapperRef = s.createRef();
20
+ }, l(m, { component: "TreeListPDFExport" }), this.saveTreeListPDF = h(this.getSavePDF()), this.treeListInnerWrapperRef = s.createRef();
21
21
  }
22
22
  /**
23
23
  * @hidden
@@ -25,7 +25,7 @@ const a = class a 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: p(this.props) }),
28
+ Object.assign({}, this.props, { margin: n(this.props) }),
29
29
  this.callback
30
30
  );
31
31
  }
@@ -33,7 +33,7 @@ const a = class a extends s.Component {
33
33
  * @hidden
34
34
  */
35
35
  render() {
36
- return /* @__PURE__ */ s.createElement(s.Fragment, null, this.state.show && m(
36
+ return this.state.show && c(
37
37
  /* @__PURE__ */ s.createElement(
38
38
  "div",
39
39
  {
@@ -46,7 +46,7 @@ const a = class a 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(u, { message: this.licenseMessage }));
49
+ );
50
50
  }
51
51
  /* eslint-disable max-len */
52
52
  /**
@@ -57,13 +57,13 @@ const a = class a extends s.Component {
57
57
  * @param callback - The callback that will be executed after the PDF is saved.
58
58
  */
59
59
  // tslint:enable:max-line-length
60
- save(t, r, i) {
60
+ save(t, r, o) {
61
61
  this.treeList = this.getTreeList(), this.columns = r || [], this.data = t, this.callback = () => {
62
- this.setState({ show: !1 }), i && i();
62
+ this.setState({ show: !1 }), o && o();
63
63
  }, this.setState({ show: !0 });
64
64
  }
65
65
  getSavePDF() {
66
- return h;
66
+ return p;
67
67
  }
68
68
  getTreeList() {
69
69
  const t = this.props.children;
@@ -71,11 +71,11 @@ const a = class a extends s.Component {
71
71
  return this.props.children;
72
72
  }
73
73
  prepareRawTreeListForExport() {
74
- 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" }) }, i = Object.assign({}, t, r);
75
- return this.columns && this.columns.length > 0 ? s.cloneElement(this.treeList, Object.assign({}, i, { columns: this.columns })) : s.cloneElement(this.treeList, i);
74
+ 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" }) }, o = Object.assign({}, t, r);
75
+ return this.columns && this.columns.length > 0 ? s.cloneElement(this.treeList, Object.assign({}, o, { columns: this.columns })) : s.cloneElement(this.treeList, o);
76
76
  }
77
77
  };
78
- a.propTypes = {
78
+ i.propTypes = {
79
79
  author: e.string,
80
80
  avoidLinks: e.oneOfType([e.bool, e.string]),
81
81
  forcePageBreak: e.string,
@@ -109,7 +109,7 @@ a.propTypes = {
109
109
  title: e.string,
110
110
  allPages: e.bool
111
111
  };
112
- let n = a;
112
+ let a = i;
113
113
  export {
114
- n as TreeListPDFExport
114
+ a as TreeListPDFExport
115
115
  };