@progress/kendo-react-pdf 7.3.0-develop.3 → 7.3.0
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.
|
@@ -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
|
-
!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,n,s,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(s),d=p(a);const g=class extends l.Component{render(){return null}};g.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 u=g;const h=["bottom","left","right","top"];function m(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===u));return t?function(e){const t={};for(let r=0;r<h.length;r++){const o=h[r],n=e.props[o];void 0!==n&&(t[o]=n)}return t}(t):e.margin}let f=class{constructor(e,t,r,o,n={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=o,this.options=n,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 y={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},b=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,i.validatePackage(y)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children)}save(e){new f(o.drawDOM,o.exportPDF,n.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:m(this.props)})}};b.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let T=b;function O(e,t={},r){new f(o.drawDOM,o.exportPDF,n.saveAs,e,t).savePDF(r)}const v={},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),D=e=>(v[e]||(v[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),v[e]),x=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=x(e,t);if(r)return r}e=e.nextSibling}}},C="k-grid-header",w="k-grid-footer",E=D("TABLE"),N=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=x(e,P("k-grid-container"))}content(e){return x(this.list,P("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||x(this.element,P(C)),x(this.headerWrap,P(`${C}-${N(e)}`))}footer(e){return this.footerWrap=this.footerWrap||x(this.element,P(w)),x(this.footerWrap,P(`${w}-${N(e)}`))}table(){return x(this.element,E)}}const S="k-first",L=(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},j=e=>{const t=e.length,r=e[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let n=0;n<o;n++)for(let o=1;o<t;o++)L(r.rows[n],e[o].rows[n].cells);return r},A=(e,t,r,o)=>{const n=document.createElement("table"),s=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)L(s,e[t].querySelectorAll("col"));const i=j(t),a=j(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,n=e.rows[r].cells[o];-1===String(n.className).indexOf(S)&&(n.className+=` ${S}`)}})(i,t),n.appendChild(s),n.appendChild(i),n.appendChild(a),o.length){const e=j(o);e.className="k-grid-footer",n.appendChild(e)}return R(n)},q=e=>{const t=new F(e),r=t.content();let o;if(r){const e=[r.querySelector("colgroup")],n=[t.header().querySelector("thead")],s=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];o=A(e,n,s,a)}else o=R(t.table().cloneNode(!0));return o};function K(e){return(t,r={},o,n,s)=>function(e,t,r={},o,n,s){let i,a,p;function c(){i=document.createElement("div"),i.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),a=document.createElement("div"),i.appendChild(a),document.body.appendChild(i),d.render(m(),a,g)}function g(){e(h(),r,u)}function u(){document.body.removeChild(i),document.body.removeChild(p),i=p=void 0,o&&o()}function h(){p=document.createElement("div"),p.className="k-grid-pdf-export-element";const e=q(a);return p.appendChild(e),document.body.appendChild(p),e}function m(){const e=n&&{data:n,total:n.length,pageSize:n.length,skip:0},r={style:Object.assign({},t.props.style,{width:"1000px"})},o=Object.assign({},e,r);if(s&&s.length>0){const e=function(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}(t);return l.cloneElement(t,o,s.concat(e))}return l.cloneElement(t,o)}c()}(e,t,r,o,n,s)}const W=class extends l.Component{constructor(e){super(e),this.saveGridPDF=K(this.getSavePDF())}render(){return null}save(e,t){this.saveGridPDF(this.getGrid(),Object.assign({},this.props,{margin:m(this.props)}),t,e,this.getCustomColumns())}getSavePDF(){return O}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))}};W.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 M=W;const z="k-grid-header",G="k-grid-footer",U=D("TABLE");class ${constructor(e){this.element=e,this.list=x(e,P("k-grid"))}content(){return x(this.list,P("k-grid"))}header(){return this.headerWrap=this.headerWrap||x(this.element,P(z)),x(this.headerWrap,P(`${z}`))}footer(){return this.footerWrap=this.footerWrap||x(this.element,P(G)),x(this.footerWrap,P(`${G}`))}table(){return x(this.element,U)}}const B=e=>{const t=new $(e),r=t.content();let o,n=t.header();if(n.childNodes.length>1&&n.removeChild(n.childNodes[1]),n.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],s=[n],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];o=A(e,s,i,p)}else o=R(t.table().cloneNode(!0));return o};function H(e){return(t,r={},o,n,s)=>function(e,t,r={},o,n,s){let i,a,p;function c(){i=document.createElement("div"),i.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),a=document.createElement("div"),i.appendChild(a),document.body.appendChild(i),d.render(m(),a,g)}function g(){e(h(),r,u)}function u(){document.body.removeChild(i),document.body.removeChild(p),i=p=void 0,o&&o()}function h(){p=document.createElement("div"),p.className="k-treelist-pdf-export-element";const e=B(a);return p.appendChild(e),document.body.appendChild(p),p}function m(){const e=r.allPages&&n?{data:n,take:Number.MAX_VALUE,skip:0}:{},o={style:Object.assign({},t.props.style,{width:"1000px"})},i=Object.assign({},e,o);return s&&s.length>0?l.cloneElement(t,Object.assign({},i,{columns:s})):l.cloneElement(t,i)}c()}(e,t,r,o,n,s)}const I=class extends l.Component{constructor(e){super(e),this.saveTreeListPDF=H(this.getSavePDF())}render(){return null}save(e,t,r){this.saveTreeListPDF(this.getTreeList(),Object.assign({},this.props,{margin:m(this.props)}),r,e,t||[])}getSavePDF(){return O}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}};I.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=I;e.GridPDFExport=M,e.KendoDrawingAdapter=f,e.PDFExport=T,e.PDFMargin=u,e.TreeListPDFExport=V,e.getPageMargin=m,e.savePDF=O}));
|
|
8
|
+
!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"),require("react-dom/client")):"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","react-dom/client"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPdf={},e.React,e.PropTypes,e.KendoDrawing,e.KendoFileSaver,e.ReactDOMServer,e.KendoReactCommon,e.ReactDOM,e.ReactDOMClient)}(this,(function(e,t,r,o,n,s,i,a,p){"use strict";function l(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 c=l(t),d=l(s),u=l(a),g=l(p);const h=class extends c.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 m=h;const f=["bottom","left","right","top"];function y(e){const t=c.Children.toArray(e.children).find((e=>e&&e.type===m));return t?function(e){const t={};for(let r=0;r<f.length;r++){const o=f[r],n=e.props[o];void 0!==n&&(t[o]=n)}return t}(t):e.margin}let b=class{constructor(e,t,r,o,n={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=o,this.options=n,this.convertPageTemplateToHtml=e=>`<span>${d.renderToStaticMarkup(c.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 T={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},O=class extends c.Component{constructor(e){super(e),this.rootElForPDF=null,i.validatePackage(T)}render(){return c.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children)}save(e){new b(o.drawDOM,o.exportPDF,n.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:y(this.props)})}};O.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 v=O;function k(e,t={},r){new b(o.drawDOM,o.exportPDF,n.saveAs,e,t).savePDF(r)}const D={},P=e=>String(e).trim().split(" "),x=e=>t=>((e,t)=>{const r=P(t);return!!P(e.className).find((e=>r.indexOf(e)>=0))})(t,e),C=e=>(D[e]||(D[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),D[e]),w=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=w(e,t);if(r)return r}e=e.nextSibling}}},N="k-grid-header",E="k-grid-footer",F=C("TABLE"),S=e=>e?"locked":"wrap";class R{constructor(e){this.element=e,this.list=w(e,x("k-grid-container"))}content(e){return w(this.list,x("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||w(this.element,x(N)),w(this.headerWrap,x(`${N}-${S(e)}`))}footer(e){return this.footerWrap=this.footerWrap||w(this.element,x(E)),w(this.footerWrap,x(`${E}-${S(e)}`))}table(){return w(this.element,F)}}const L="k-first",j=(e,t)=>{const r=t.length;for(let o=0;o<r;o++)e.appendChild(t[o].cloneNode(!0))},A=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},q=e=>{const t=e.length,r=e[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let n=0;n<o;n++)for(let o=1;o<t;o++)j(r.rows[n],e[o].rows[n].cells);return r},K=(e,t,r,o)=>{const n=document.createElement("table"),s=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)j(s,e[t].querySelectorAll("col"));const i=q(t),a=q(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,n=e.rows[r].cells[o];-1===String(n.className).indexOf(L)&&(n.className+=` ${L}`)}})(i,t),n.appendChild(s),n.appendChild(i),n.appendChild(a),o.length){const e=q(o);e.className="k-grid-footer",n.appendChild(e)}return A(n)},M=e=>{const t=new R(e),r=t.content();let o;if(r){const e=[r.querySelector("colgroup")],n=[t.header().querySelector("thead")],s=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];o=K(e,n,s,a)}else o=A(t.table().cloneNode(!0));return o};function W(e){return(t,r={},o,n,s)=>function(e,t,r={},o,n,s){let i,a,p;function l(){i=document.createElement("div"),i.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),a=document.createElement("div"),i.appendChild(a),document.body.appendChild(i),Number(c.version.slice(0,2))>=18?(g.createRoot(a).render(f()),setTimeout((()=>{d()}),0)):u.render(f(),a,d)}function d(){e(m(),r,h)}function h(){document.body.removeChild(i),document.body.removeChild(p),i=p=void 0,o&&o()}function m(){p=document.createElement("div"),p.className="k-grid-pdf-export-element";const e=M(a);return p.appendChild(e),document.body.appendChild(p),e}function f(){const e=n&&{data:n,total:n.length,pageSize:n.length,skip:0},r={style:Object.assign({},t.props.style,{width:"1000px"})},o=Object.assign({},e,r);if(s&&s.length>0){const e=function(e){return c.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}(t);return c.cloneElement(t,o,s.concat(e))}return c.cloneElement(t,o)}l()}(e,t,r,o,n,s)}const z=class extends c.Component{constructor(e){super(e),this.saveGridPDF=W(this.getSavePDF())}render(){return null}save(e,t){this.saveGridPDF(this.getGrid(),Object.assign({},this.props,{margin:y(this.props)}),t,e,this.getCustomColumns())}getSavePDF(){return k}getGrid(){return c.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return c.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}};z.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=z;const U="k-grid-header",$="k-grid-footer",B=C("TABLE");class H{constructor(e){this.element=e,this.list=w(e,x("k-grid"))}content(){return w(this.list,x("k-grid"))}header(){return this.headerWrap=this.headerWrap||w(this.element,x(U)),w(this.headerWrap,x(`${U}`))}footer(){return this.footerWrap=this.footerWrap||w(this.element,x($)),w(this.footerWrap,x(`${$}`))}table(){return w(this.element,B)}}const I=e=>{const t=new H(e),r=t.content();let o,n=t.header();if(n.childNodes.length>1&&n.removeChild(n.childNodes[1]),n.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],s=[n],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];o=K(e,s,i,p)}else o=A(t.table().cloneNode(!0));return o};function V(e){return(t,r={},o,n,s)=>function(e,t,r={},o,n,s){let i,a,p;function l(){i=document.createElement("div"),i.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),a=document.createElement("div"),i.appendChild(a),document.body.appendChild(i),Number(c.version.slice(0,2))>=18?(g.createRoot(a).render(f()),setTimeout((()=>{d()}),0)):u.render(f(),a,d)}function d(){e(m(),r,h)}function h(){document.body.removeChild(i),document.body.removeChild(p),i=p=void 0,o&&o()}function m(){p=document.createElement("div"),p.className="k-treelist-pdf-export-element";const e=I(a);return p.appendChild(e),document.body.appendChild(p),p}function f(){const e=r.allPages&&n?{data:n,take:Number.MAX_VALUE,skip:0}:{},o={style:Object.assign({},t.props.style,{width:"1000px"})},i=Object.assign({},e,o);return s&&s.length>0?c.cloneElement(t,Object.assign({},i,{columns:s})):c.cloneElement(t,i)}l()}(e,t,r,o,n,s)}const X=class extends c.Component{constructor(e){super(e),this.saveTreeListPDF=V(this.getSavePDF())}render(){return null}save(e,t,r){this.saveTreeListPDF(this.getTreeList(),Object.assign({},this.props,{margin:y(this.props)}),r,e,t||[])}getSavePDF(){return k}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}};X.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 _=X;e.GridPDFExport=G,e.KendoDrawingAdapter=b,e.PDFExport=v,e.PDFMargin=m,e.TreeListPDFExport=_,e.getPageMargin=y,e.savePDF=k}));
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react-dom"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),h=require("react-dom"),D=require("react-dom/client"),E=require("./export-element.js");function s(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const p=s(O),R=s(h),P=s(D);function x(t){return(e,n={},r,o,l)=>G(t,e,n,r,o,l)}function G(t,e,n={},r,o,l){let i,a,c;b();function b(){i=document.createElement("div"),i.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),a=document.createElement("div"),i.appendChild(a),document.body.appendChild(i),Number(p.version.slice(0,2))>=18?(P.createRoot(a).render(m()),setTimeout(()=>{u()},0)):R.render(m(),a,u)}function u(){t(C(),n,y)}function y(){document.body.removeChild(i),document.body.removeChild(c),i=c=void 0,r&&r()}function C(){c=document.createElement("div"),c.className="k-grid-pdf-export-element";const d=E.exportElement(a);return c.appendChild(d),document.body.appendChild(c),d}function m(){const d=o&&{data:o,total:o.length,pageSize:o.length,skip:0},v={style:Object.assign({},e.props.style,{width:"1000px"})},f=Object.assign({},d,v);if(l&&l.length>0){const g=S(e);return p.cloneElement(e,f,l.concat(g))}else return p.cloneElement(e,f)}}function S(t){return p.Children.toArray(t.props.children).filter(e=>e&&e.type&&e.type.displayName!=="KendoReactGridColumn")}exports.provideSaveGridPDF=x;
|
|
@@ -6,48 +6,51 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import * as c from "react";
|
|
10
|
+
import * as b from "react-dom";
|
|
11
|
+
import * as E from "react-dom/client";
|
|
12
|
+
import { exportElement as x } from "./export-element.mjs";
|
|
13
|
+
function D(o) {
|
|
14
|
+
return (e, s = {}, d, t, i) => g(
|
|
14
15
|
o,
|
|
15
16
|
e,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
s,
|
|
18
|
+
d,
|
|
18
19
|
t,
|
|
19
20
|
i
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
let n,
|
|
24
|
-
|
|
25
|
-
function u() {
|
|
26
|
-
n = document.createElement("div"), n.setAttribute("style", "position:absolute; left: -5000px; top: 0px;"), d = document.createElement("div"), n.appendChild(d), document.body.appendChild(n), E.render(h(), d, m);
|
|
27
|
-
}
|
|
28
|
-
function m() {
|
|
29
|
-
o(C(), c, f);
|
|
30
|
-
}
|
|
23
|
+
function g(o, e, s = {}, d, t, i) {
|
|
24
|
+
let n, p, r;
|
|
25
|
+
f();
|
|
31
26
|
function f() {
|
|
32
|
-
document.
|
|
27
|
+
n = document.createElement("div"), n.setAttribute("style", "position:absolute; left: -5000px; top: 0px;"), p = document.createElement("div"), n.appendChild(p), document.body.appendChild(n), Number(c.version.slice(0, 2)) >= 18 ? (E.createRoot(p).render(m()), setTimeout(() => {
|
|
28
|
+
a();
|
|
29
|
+
}, 0)) : b.render(m(), p, a);
|
|
30
|
+
}
|
|
31
|
+
function a() {
|
|
32
|
+
o(h(), s, C);
|
|
33
33
|
}
|
|
34
34
|
function C() {
|
|
35
|
+
document.body.removeChild(n), document.body.removeChild(r), n = r = void 0, d && d();
|
|
36
|
+
}
|
|
37
|
+
function h() {
|
|
35
38
|
r = document.createElement("div"), r.className = "k-grid-pdf-export-element";
|
|
36
|
-
const l =
|
|
39
|
+
const l = x(p);
|
|
37
40
|
return r.appendChild(l), document.body.appendChild(r), l;
|
|
38
41
|
}
|
|
39
|
-
function
|
|
40
|
-
const l = t && { data: t, total: t.length, pageSize: t.length, skip: 0 }, y = { style: Object.assign({}, e.props.style, { width: "1000px" }) },
|
|
42
|
+
function m() {
|
|
43
|
+
const l = t && { data: t, total: t.length, pageSize: t.length, skip: 0 }, y = { style: Object.assign({}, e.props.style, { width: "1000px" }) }, u = Object.assign({}, l, y);
|
|
41
44
|
if (i && i.length > 0) {
|
|
42
|
-
const v =
|
|
43
|
-
return
|
|
45
|
+
const v = G(e);
|
|
46
|
+
return c.cloneElement(e, u, i.concat(v));
|
|
44
47
|
} else
|
|
45
|
-
return
|
|
48
|
+
return c.cloneElement(e, u);
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
51
|
+
function G(o) {
|
|
52
|
+
return c.Children.toArray(o.props.children).filter((e) => e && e.type && e.type.displayName !== "KendoReactGridColumn");
|
|
50
53
|
}
|
|
51
54
|
export {
|
|
52
|
-
|
|
55
|
+
D as provideSaveGridPDF
|
|
53
56
|
};
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-pdf",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1710323829,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pdf",
|
|
3
|
-
"version": "7.3.0
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "React PDF Processing enables you to export single- and multi-page content in PDF. KendoReact PDF Processing package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@progress/kendo-drawing": "^1.19.0",
|
|
26
26
|
"@progress/kendo-file-saver": "^1.0.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-common": "7.3.0
|
|
28
|
+
"@progress/kendo-react-common": "7.3.0",
|
|
29
29
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
30
30
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
31
31
|
},
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),C=require("react-dom"),D=require("react-dom/client"),E=require("./export-element.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=p(g),P=p(C),R=p(D);function h(e){return(t,n={},r,a,i)=>j(e,t,n,r,a,i)}function j(e,t,n={},r,a,i){let c,s,o;b();function b(){c=document.createElement("div"),c.setAttribute("style","position:absolute; left: -5000px; top: 0px;"),s=document.createElement("div"),c.appendChild(s),document.body.appendChild(c),Number(u.version.slice(0,2))>=18?(R.createRoot(s).render(m()),setTimeout(()=>{d()},0)):P.render(m(),s,d)}function d(){e(y(),n,v)}function v(){document.body.removeChild(c),document.body.removeChild(o),c=o=void 0,r&&r()}function y(){o=document.createElement("div"),o.className="k-treelist-pdf-export-element";const l=E.exportElement(s);return o.appendChild(l),document.body.appendChild(o),o}function m(){const l=n.allPages&&a?{data:a,take:Number.MAX_VALUE,skip:0}:{},O={style:Object.assign({},t.props.style,{width:"1000px"})},f=Object.assign({},l,O);return i&&i.length>0?u.cloneElement(t,Object.assign({},f,{columns:i})):u.cloneElement(t,f)}}exports.provideSaveTreeListPDF=h;
|
|
@@ -6,41 +6,44 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import * as E from "react-dom";
|
|
11
|
+
import * as h from "react-dom/client";
|
|
11
12
|
import { exportElement as y } from "./export-element.mjs";
|
|
12
|
-
function
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
o,
|
|
13
|
+
function P(c) {
|
|
14
|
+
return (r, i = {}, s, l, n) => x(
|
|
15
|
+
c,
|
|
16
|
+
r,
|
|
17
17
|
i,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
s,
|
|
19
|
+
l,
|
|
20
|
+
n
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
let t,
|
|
24
|
-
|
|
25
|
-
function m() {
|
|
26
|
-
t = document.createElement("div"), t.setAttribute("style", "position:absolute; left: -5000px; top: 0px;"), s = document.createElement("div"), t.appendChild(s), document.body.appendChild(t), h.render(v(), s, u);
|
|
27
|
-
}
|
|
28
|
-
function u() {
|
|
29
|
-
l(b(), o, f);
|
|
30
|
-
}
|
|
23
|
+
function x(c, r, i = {}, s, l, n) {
|
|
24
|
+
let t, o, e;
|
|
25
|
+
f();
|
|
31
26
|
function f() {
|
|
32
|
-
document.
|
|
27
|
+
t = document.createElement("div"), t.setAttribute("style", "position:absolute; left: -5000px; top: 0px;"), o = document.createElement("div"), t.appendChild(o), document.body.appendChild(t), Number(a.version.slice(0, 2)) >= 18 ? (h.createRoot(o).render(m()), setTimeout(() => {
|
|
28
|
+
d();
|
|
29
|
+
}, 0)) : E.render(m(), o, d);
|
|
30
|
+
}
|
|
31
|
+
function d() {
|
|
32
|
+
c(v(), i, b);
|
|
33
33
|
}
|
|
34
34
|
function b() {
|
|
35
|
-
|
|
36
|
-
const a = y(s);
|
|
37
|
-
return e.appendChild(a), document.body.appendChild(e), e;
|
|
35
|
+
document.body.removeChild(t), document.body.removeChild(e), t = e = void 0, s && s();
|
|
38
36
|
}
|
|
39
37
|
function v() {
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
e = document.createElement("div"), e.className = "k-treelist-pdf-export-element";
|
|
39
|
+
const p = y(o);
|
|
40
|
+
return e.appendChild(p), document.body.appendChild(e), e;
|
|
41
|
+
}
|
|
42
|
+
function m() {
|
|
43
|
+
const p = i.allPages && l ? { data: l, take: Number.MAX_VALUE, skip: 0 } : {}, C = { style: Object.assign({}, r.props.style, { width: "1000px" }) }, u = Object.assign({}, p, C);
|
|
44
|
+
return n && n.length > 0 ? a.cloneElement(r, Object.assign({}, u, { columns: n })) : a.cloneElement(r, u);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
export {
|
|
45
|
-
|
|
48
|
+
P as provideSaveTreeListPDF
|
|
46
49
|
};
|