@progress/kendo-react-pdf 12.0.2-develop.1 → 12.0.2-develop.3

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.
@@ -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:"12.0.2-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"PDFExport"}),this.licenseMessage=i.getLicenseMessage(f)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children,this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e){new u(s.drawDOM,s.exportPDF,o.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:m(this.props)})}};y.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let b=y;function k(e,t={},r){new u(s.drawDOM,s.exportPDF,o.saveAs,e,t).savePDF(r)}const w={},O=e=>String(e).trim().split(" "),T=e=>t=>((e,t)=>{const r=O(t);return!!O(e.className).find((e=>r.indexOf(e)>=0))})(t,e),v=e=>(w[e]||(w[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),w[e]),P=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=P(e,t);if(r)return r}e=e.nextSibling}}},D="k-grid-header",x="k-grid-footer",E=v("TABLE"),L=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=P(e,T("k-grid-container"))}content(e){return P(this.list,T("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||P(this.element,T(D)),P(this.headerWrap,T(`${D}-${L(e)}`))}footer(e){return this.footerWrap=this.footerWrap||P(this.element,T(x)),P(this.footerWrap,T(`${x}-${L(e)}`))}table(){return P(this.element,E)}}const C="k-first",N=(e,t)=>{const r=t.length;for(let s=0;s<r;s++)e.appendChild(t[s].cloneNode(!0))},R=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},S=e=>{const t=e.length,r=e[0].cloneNode(!0),s=r.rows.length;if(t>1)for(let o=0;o<s;o++)for(let s=1;s<t;s++)N(r.rows[o],e[s].rows[o].cells);return r},W=(e,t,r,s)=>{const o=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)N(n,e[t].querySelectorAll("col"));const i=S(t),a=S(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const s=t[0].rows[r].cells.length,o=e.rows[r].cells[s];-1===String(o.className).indexOf(C)&&(o.className+=` ${C}`)}})(i,t),o.appendChild(n),o.appendChild(i),o.appendChild(a),s.length){const e=S(s);e.className="k-grid-footer",o.appendChild(e)}return R(o)},j=e=>{const t=new F(e),r=t.content();let s;if(r){const e=[r.querySelector("colgroup")],o=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];s=W(e,o,n,a)}else s=R(t.table().cloneNode(!0));return s},M=A(k);function A(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-grid-pdf-export-element";const e=j(t);return o.appendChild(e),document.body.appendChild(o),e}n()}(e,t,r,s)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"GridPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveGridPDF=A(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return k}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},s={scrollable:"none"===this.grid.props?"none":"scrollable"},o=Object.assign({},t,r,s);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,o,this.columns.concat(e))}return l.cloneElement(this.grid,o)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};q.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let G=q;const K="k-grid-header",U="k-grid-footer",z=v("TABLE");class I{constructor(e){this.element=e,this.list=P(e,T("k-grid"))}content(){return P(this.list,T("k-grid"))}header(){return this.headerWrap=this.headerWrap||P(this.element,T(K)),P(this.headerWrap,T(`${K}`))}footer(){return this.footerWrap=this.footerWrap||P(this.element,T(U)),P(this.footerWrap,T(`${U}`))}table(){return P(this.element,z)}}const $=e=>{const t=new I(e),r=t.content();let s;const o=t.header();if(o.childNodes.length>1&&o.removeChild(o.childNodes[1]),o.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[o],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];s=W(e,n,i,p)}else s=R(t.table().cloneNode(!0));return s};function B(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-treelist-pdf-export-element";const e=$(t);return o.appendChild(e),document.body.appendChild(o),o}n()}(e,t,r,s)}const H=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"TreeListPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveTreeListPDF=B(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return k}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};H.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let V=H;e.GridPDFExport=G,e.KendoDrawingAdapter=u,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=V,e.getPageMargin=m,e.saveGridPDF=M,e.savePDF=k}));
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:"12.0.2-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 w={},O=e=>String(e).trim().split(" "),T=e=>t=>((e,t)=>{const r=O(t);return!!O(e.className).find((e=>r.indexOf(e)>=0))})(t,e),v=e=>(w[e]||(w[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),w[e]),P=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=P(e,t);if(r)return r}e=e.nextSibling}}},D="k-grid-header",x="k-grid-footer",E=v("TABLE"),L=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=P(e,T("k-grid-container"))}content(e){return P(this.list,T("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||P(this.element,T(D)),P(this.headerWrap,T(`${D}-${L(e)}`))}footer(e){return this.footerWrap=this.footerWrap||P(this.element,T(x)),P(this.footerWrap,T(`${x}-${L(e)}`))}table(){return P(this.element,E)}}const C="k-first",N=(e,t)=>{const r=t.length;for(let s=0;s<r;s++)e.appendChild(t[s].cloneNode(!0))},R=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},S=e=>{const t=e.length,r=e[0].cloneNode(!0),s=r.rows.length;if(t>1)for(let o=0;o<s;o++)for(let s=1;s<t;s++)N(r.rows[o],e[s].rows[o].cells);return r},W=(e,t,r,s)=>{const o=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)N(n,e[t].querySelectorAll("col"));const i=S(t),a=S(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const s=t[0].rows[r].cells.length,o=e.rows[r].cells[s];-1===String(o.className).indexOf(C)&&(o.className+=` ${C}`)}})(i,t),o.appendChild(n),o.appendChild(i),o.appendChild(a),s.length){const e=S(s);e.className="k-grid-footer",o.appendChild(e)}return R(o)},j=e=>{const t=new F(e),r=t.content();let s;if(r){const e=[r.querySelector("colgroup")],o=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];s=W(e,o,n,a)}else s=R(t.table().cloneNode(!0));return s},M=A(k);function A(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-grid-pdf-export-element";const e=j(t);return o.appendChild(e),document.body.appendChild(o),e}n()}(e,t,r,s)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"GridPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveGridPDF=A(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return k}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},s={scrollable:"none"===this.grid.props?"none":"scrollable"},o=Object.assign({},t,r,s);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,o,this.columns.concat(e))}return l.cloneElement(this.grid,o)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};q.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let G=q;const K="k-grid-header",U="k-grid-footer",z=v("TABLE");class I{constructor(e){this.element=e,this.list=P(e,T("k-grid"))}content(){return P(this.list,T("k-grid"))}header(){return this.headerWrap=this.headerWrap||P(this.element,T(K)),P(this.headerWrap,T(`${K}`))}footer(){return this.footerWrap=this.footerWrap||P(this.element,T(U)),P(this.footerWrap,T(`${U}`))}table(){return P(this.element,z)}}const $=e=>{const t=new I(e),r=t.content();let s;const o=t.header();if(o.childNodes.length>1&&o.removeChild(o.childNodes[1]),o.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[o],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];s=W(e,n,i,p)}else s=R(t.table().cloneNode(!0));return s};function B(e){return(t,r={},s)=>function(e,t,r={},s){let o;function n(){e(a(),r,i)}function i(){document.body.removeChild(o),o=void 0,s&&s()}function a(){o=document.createElement("div"),o.className="k-treelist-pdf-export-element";const e=$(t);return o.appendChild(e),document.body.appendChild(o),o}n()}(e,t,r,s)}const H=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.showLicenseWatermark=!1,this.showLicenseWatermark=!i.validatePackage(f,{component:"TreeListPDFExport"}),this.licenseMessage=i.getLicenseMessage(f),this.saveTreeListPDF=B(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:m(this.props)}),this.callback)}render(){return l.createElement(l.Fragment,null,this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body),this.showLicenseWatermark&&l.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return k}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};H.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let V=H;e.GridPDFExport=G,e.KendoDrawingAdapter=u,e.PDFExport=b,e.PDFMargin=d,e.TreeListPDFExport=V,e.getPageMargin=m,e.saveGridPDF=M,e.savePDF=k}));
package/index.d.mts CHANGED
@@ -229,7 +229,7 @@ export declare interface PDFExportProps {
229
229
  */
230
230
  author?: string;
231
231
  /**
232
- * A flag that indicates whether to produce actual hyperlinks in the exported PDF file.
232
+ * Sets whether to produce actual hyperlinks in the exported PDF file.
233
233
  * It is also possible to set a CSS selector. All matching links will be ignored.
234
234
  *
235
235
  * @example
@@ -240,7 +240,7 @@ export declare interface PDFExportProps {
240
240
  */
241
241
  avoidLinks?: boolean | string;
242
242
  /**
243
- * An optional CSS selector that specifies the elements which cause the page breaks.
243
+ * Sets a CSS selector that determines the elements which cause the page breaks.
244
244
  *
245
245
  * @example
246
246
  * ```jsx
@@ -249,7 +249,7 @@ export declare interface PDFExportProps {
249
249
  */
250
250
  forcePageBreak?: string;
251
251
  /**
252
- * An optional CSS selector that specifies the elements which should not be split across the pages.
252
+ * Sets a CSS selector that determines the elements which should not be split across the pages.
253
253
  *
254
254
  * @example
255
255
  * ```jsx
@@ -258,11 +258,15 @@ export declare interface PDFExportProps {
258
258
  */
259
259
  keepTogether?: string;
260
260
  /**
261
- * The creator of the PDF document. Defaults to `KendoReact PDF Generator`.
261
+ * Sets the creator of the PDF document.
262
+ *
263
+ * @default "KendoReact PDF Generator"
262
264
  */
263
265
  creator?: string;
264
266
  /**
265
- * The date when the PDF document is created. Defaults to `new Date()`.
267
+ * Sets the date when the PDF document is created.
268
+ *
269
+ * @default new Date()
266
270
  */
267
271
  date?: Date;
268
272
  /**
@@ -270,7 +274,9 @@ export declare interface PDFExportProps {
270
274
  */
271
275
  imageResolution?: number;
272
276
  /**
273
- * Specifies the name of the exported PDF file. Defaults to `"export.pdf"`.
277
+ * Sets the name of the exported PDF file.
278
+ *
279
+ * @default "export.pdf"
274
280
  *
275
281
  * @example
276
282
  * ```jsx
@@ -287,11 +293,13 @@ export declare interface PDFExportProps {
287
293
  */
288
294
  keywords?: string;
289
295
  /**
290
- * A flag that indicates if the page will be in a landscape orientation. By default, the page is in a portrait orientation. Defaults to `false`.
296
+ * Indicates if the page is in a landscape orientation. By default, the page is in a portrait orientation.
297
+ *
298
+ * @default false
291
299
  */
292
300
  landscape?: boolean;
293
301
  /**
294
- * Specifies the margins of the page.
302
+ * Sets the margins of the page.
295
303
  *
296
304
  * The supported units are:
297
305
  * * `"mm"`
@@ -307,7 +315,7 @@ export declare interface PDFExportProps {
307
315
  */
308
316
  pageTemplate?: any;
309
317
  /**
310
- * Specifies the paper size of the PDF document. Defaults to `"auto"`.
318
+ * Sets the paper size of the PDF document.
311
319
  *
312
320
  * If set, the content will be split across multiple pages. This enables the `repeatHeaders` and `scale` options, and allows you to specify a template.
313
321
  *
@@ -316,6 +324,8 @@ export declare interface PDFExportProps {
316
324
  * * An array of two numbers which specify the width and height in points (1pt = 1/72in).
317
325
  * * An array of two strings which specify the width and height in units. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"`.
318
326
  *
327
+ * @default "auto"
328
+ *
319
329
  * @example
320
330
  * ```jsx
321
331
  * <PDFExport paperSize="A4" />
@@ -323,7 +333,7 @@ export declare interface PDFExportProps {
323
333
  */
324
334
  paperSize?: PaperSize;
325
335
  /**
326
- * Specifies if the `<thead>` elements of the tables will be repeated on each page.
336
+ * Sets if the `<thead>` elements of the tables are repeated on each page.
327
337
  *
328
338
  * @example
329
339
  * ```jsx
@@ -332,7 +342,9 @@ export declare interface PDFExportProps {
332
342
  */
333
343
  repeatHeaders?: boolean;
334
344
  /**
335
- * A scale factor for the PDF content. Defaults to `1`.
345
+ * Sets a scale factor for the PDF content.
346
+ *
347
+ * @default 1
336
348
  *
337
349
  * @example
338
350
  * ```jsx
@@ -341,7 +353,7 @@ export declare interface PDFExportProps {
341
353
  */
342
354
  scale?: number;
343
355
  /**
344
- * A key/value dictionary of form values which will be sent to the proxy. Can be used to submit Anti-Forgery tokens and other metadata.
356
+ * Sets a key/value dictionary of form values for the proxy. You can use it to submit Anti-Forgery tokens and other metadata.
345
357
  */
346
358
  proxyData?: {
347
359
  [key: string]: string;
@@ -359,7 +371,9 @@ export declare interface PDFExportProps {
359
371
  */
360
372
  proxyURL?: string;
361
373
  /**
362
- * A name or keyword which indicates where to display the document that is returned from the proxy. To display the document in a new window or iframe, the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`. Defaults to `_self`.
374
+ * Sets a name or keyword which indicates where to display the document that is returned from the proxy. To display the document in a new window or iframe, the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`.
375
+ *
376
+ * @default "_self"
363
377
  */
364
378
  proxyTarget?: string;
365
379
  /**
package/index.d.ts CHANGED
@@ -229,7 +229,7 @@ export declare interface PDFExportProps {
229
229
  */
230
230
  author?: string;
231
231
  /**
232
- * A flag that indicates whether to produce actual hyperlinks in the exported PDF file.
232
+ * Sets whether to produce actual hyperlinks in the exported PDF file.
233
233
  * It is also possible to set a CSS selector. All matching links will be ignored.
234
234
  *
235
235
  * @example
@@ -240,7 +240,7 @@ export declare interface PDFExportProps {
240
240
  */
241
241
  avoidLinks?: boolean | string;
242
242
  /**
243
- * An optional CSS selector that specifies the elements which cause the page breaks.
243
+ * Sets a CSS selector that determines the elements which cause the page breaks.
244
244
  *
245
245
  * @example
246
246
  * ```jsx
@@ -249,7 +249,7 @@ export declare interface PDFExportProps {
249
249
  */
250
250
  forcePageBreak?: string;
251
251
  /**
252
- * An optional CSS selector that specifies the elements which should not be split across the pages.
252
+ * Sets a CSS selector that determines the elements which should not be split across the pages.
253
253
  *
254
254
  * @example
255
255
  * ```jsx
@@ -258,11 +258,15 @@ export declare interface PDFExportProps {
258
258
  */
259
259
  keepTogether?: string;
260
260
  /**
261
- * The creator of the PDF document. Defaults to `KendoReact PDF Generator`.
261
+ * Sets the creator of the PDF document.
262
+ *
263
+ * @default "KendoReact PDF Generator"
262
264
  */
263
265
  creator?: string;
264
266
  /**
265
- * The date when the PDF document is created. Defaults to `new Date()`.
267
+ * Sets the date when the PDF document is created.
268
+ *
269
+ * @default new Date()
266
270
  */
267
271
  date?: Date;
268
272
  /**
@@ -270,7 +274,9 @@ export declare interface PDFExportProps {
270
274
  */
271
275
  imageResolution?: number;
272
276
  /**
273
- * Specifies the name of the exported PDF file. Defaults to `"export.pdf"`.
277
+ * Sets the name of the exported PDF file.
278
+ *
279
+ * @default "export.pdf"
274
280
  *
275
281
  * @example
276
282
  * ```jsx
@@ -287,11 +293,13 @@ export declare interface PDFExportProps {
287
293
  */
288
294
  keywords?: string;
289
295
  /**
290
- * A flag that indicates if the page will be in a landscape orientation. By default, the page is in a portrait orientation. Defaults to `false`.
296
+ * Indicates if the page is in a landscape orientation. By default, the page is in a portrait orientation.
297
+ *
298
+ * @default false
291
299
  */
292
300
  landscape?: boolean;
293
301
  /**
294
- * Specifies the margins of the page.
302
+ * Sets the margins of the page.
295
303
  *
296
304
  * The supported units are:
297
305
  * * `"mm"`
@@ -307,7 +315,7 @@ export declare interface PDFExportProps {
307
315
  */
308
316
  pageTemplate?: any;
309
317
  /**
310
- * Specifies the paper size of the PDF document. Defaults to `"auto"`.
318
+ * Sets the paper size of the PDF document.
311
319
  *
312
320
  * If set, the content will be split across multiple pages. This enables the `repeatHeaders` and `scale` options, and allows you to specify a template.
313
321
  *
@@ -316,6 +324,8 @@ export declare interface PDFExportProps {
316
324
  * * An array of two numbers which specify the width and height in points (1pt = 1/72in).
317
325
  * * An array of two strings which specify the width and height in units. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"`.
318
326
  *
327
+ * @default "auto"
328
+ *
319
329
  * @example
320
330
  * ```jsx
321
331
  * <PDFExport paperSize="A4" />
@@ -323,7 +333,7 @@ export declare interface PDFExportProps {
323
333
  */
324
334
  paperSize?: PaperSize;
325
335
  /**
326
- * Specifies if the `<thead>` elements of the tables will be repeated on each page.
336
+ * Sets if the `<thead>` elements of the tables are repeated on each page.
327
337
  *
328
338
  * @example
329
339
  * ```jsx
@@ -332,7 +342,9 @@ export declare interface PDFExportProps {
332
342
  */
333
343
  repeatHeaders?: boolean;
334
344
  /**
335
- * A scale factor for the PDF content. Defaults to `1`.
345
+ * Sets a scale factor for the PDF content.
346
+ *
347
+ * @default 1
336
348
  *
337
349
  * @example
338
350
  * ```jsx
@@ -341,7 +353,7 @@ export declare interface PDFExportProps {
341
353
  */
342
354
  scale?: number;
343
355
  /**
344
- * A key/value dictionary of form values which will be sent to the proxy. Can be used to submit Anti-Forgery tokens and other metadata.
356
+ * Sets a key/value dictionary of form values for the proxy. You can use it to submit Anti-Forgery tokens and other metadata.
345
357
  */
346
358
  proxyData?: {
347
359
  [key: string]: string;
@@ -359,7 +371,9 @@ export declare interface PDFExportProps {
359
371
  */
360
372
  proxyURL?: string;
361
373
  /**
362
- * A name or keyword which indicates where to display the document that is returned from the proxy. To display the document in a new window or iframe, the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`. Defaults to `_self`.
374
+ * Sets a name or keyword which indicates where to display the document that is returned from the proxy. To display the document in a new window or iframe, the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`.
375
+ *
376
+ * @default "_self"
363
377
  */
364
378
  proxyTarget?: string;
365
379
  /**
@@ -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: 1756967178,version:"12.0.2-develop.1",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: 1757419687,version:"12.0.2-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = Object.freeze({
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1756967178,
14
- version: "12.0.2-develop.1",
13
+ publishDate: 1757419687,
14
+ version: "12.0.2-develop.3",
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": "12.0.2-develop.1",
3
+ "version": "12.0.2-develop.3",
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.7.0",
31
- "@progress/kendo-react-common": "12.0.2-develop.1",
31
+ "@progress/kendo-react-common": "12.0.2-develop.3",
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": 1756967178,
57
+ "publishDate": 1757419687,
58
58
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
59
59
  }
60
60
  },