@progress/kendo-react-pdf 9.4.0-develop.1 → 9.4.0-develop.11
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/KendoDrawingAdapter.js +1 -1
- package/KendoDrawingAdapter.mjs +0 -1
- package/PDFExport.js +1 -1
- package/PDFExport.mjs +37 -38
- package/PDFMargin.js +1 -1
- package/PDFMargin.mjs +0 -1
- package/common/dom-queries.js +1 -1
- package/common/dom-queries.mjs +8 -9
- package/common/table-query.js +1 -1
- package/common/table-query.mjs +2 -3
- package/common/utils.js +1 -1
- package/common/utils.mjs +0 -1
- package/dist/cdn/js/kendo-react-pdf.js +8 -1
- package/getPageMargin.js +1 -1
- package/getPageMargin.mjs +8 -9
- package/grid/GridPDFExport.js +1 -1
- package/grid/GridPDFExport.mjs +4 -5
- package/grid/export-element.js +1 -1
- package/grid/export-element.mjs +2 -3
- package/grid/grid-query.js +1 -1
- package/grid/grid-query.mjs +4 -5
- package/grid/provideSaveGridPDF.js +1 -1
- package/grid/provideSaveGridPDF.mjs +8 -9
- package/index.js +2 -1
- package/index.mjs +6 -6
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +3 -3
- package/savePDF.js +1 -1
- package/savePDF.mjs +5 -6
- package/treelist/TreeListPDFExport.js +1 -1
- package/treelist/TreeListPDFExport.mjs +0 -1
- package/treelist/export-element.js +1 -1
- package/treelist/export-element.mjs +4 -5
- package/treelist/provideSaveTreeListPDF.js +1 -1
- package/treelist/provideSaveTreeListPDF.mjs +4 -5
package/KendoDrawingAdapter.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
|
|
8
|
+
"use strict";const p=require("react"),h=require("react-dom/server");function a(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const c=a(p),g=a(h),l="export.pdf",u="KendoReact PDF Generator";class m{constructor(t,e,o,r,n={}){this.drawDOM=t,this.exportPDF=e,this.saveAs=o,this.domElement=r,this.options=n,this.convertPageTemplateToHtml=i=>`<span>${g.renderToStaticMarkup(c.createElement(this.options.pageTemplate,{pageNum:i.pageNum,totalPages:i.totalPages}))}</span>`}savePDF(t){const e=this.drawDOM(this.domElement,this.getDrawOptions()).then(o=>this.exportPDF(o,this.getPDFOptions())).then(o=>this.saveAs(o,this.options.fileName||l,this.getSaveOptions()));t&&e.then(t,t)}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||u,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}}}module.exports=m;
|
package/KendoDrawingAdapter.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as p from "react";
|
|
10
9
|
import * as r from "react-dom/server";
|
|
11
10
|
const n = "export.pdf", h = "KendoReact PDF Generator";
|
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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),e=require("prop-types"),i=require("@progress/kendo-drawing"),p=require("@progress/kendo-file-saver"),u=require("./getPageMargin.js"),l=require("./KendoDrawingAdapter.js"),d=require("@progress/kendo-react-common"),b=require("./package-metadata.js");function f(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>r[n]})}}return t.default=r,Object.freeze(t)}const g=f(c),a=class a extends g.Component{constructor(t){super(t),this.rootElForPDF=null,d.validatePackage(b.packageMetadata)}render(){return g.createElement("div",{ref:t=>{this.rootElForPDF=t}},this.props.children)}save(t){new l(i.drawDOM,i.exportPDF,p.saveAs,this.rootElForPDF,this.getOptions()).savePDF(t)}getOptions(){return Object.assign({},this.props,{margin:u.getPageMargin(this.props)})}};a.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};let o=a;exports.PDFExport=o;
|
package/PDFExport.mjs
CHANGED
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as o from "react";
|
|
10
|
-
import
|
|
9
|
+
import r from "prop-types";
|
|
11
10
|
import { drawDOM as s, exportPDF as i } from "@progress/kendo-drawing";
|
|
12
11
|
import { saveAs as a } from "@progress/kendo-file-saver";
|
|
13
12
|
import { getPageMargin as p } from "./getPageMargin.mjs";
|
|
14
13
|
import g from "./KendoDrawingAdapter.mjs";
|
|
15
14
|
import { validatePackage as m } from "@progress/kendo-react-common";
|
|
16
|
-
import { packageMetadata as
|
|
15
|
+
import { packageMetadata as f } from "./package-metadata.mjs";
|
|
17
16
|
const t = class t extends o.Component {
|
|
18
|
-
constructor(
|
|
19
|
-
super(
|
|
17
|
+
constructor(e) {
|
|
18
|
+
super(e), this.rootElForPDF = null, m(f);
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* @hidden
|
|
@@ -25,8 +24,8 @@ const t = class t extends o.Component {
|
|
|
25
24
|
return /* @__PURE__ */ o.createElement(
|
|
26
25
|
"div",
|
|
27
26
|
{
|
|
28
|
-
ref: (
|
|
29
|
-
this.rootElForPDF =
|
|
27
|
+
ref: (e) => {
|
|
28
|
+
this.rootElForPDF = e;
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
this.props.children
|
|
@@ -37,45 +36,45 @@ const t = class t extends o.Component {
|
|
|
37
36
|
*
|
|
38
37
|
* @param callback - The callback to be executed after the PDF is saved.
|
|
39
38
|
*/
|
|
40
|
-
save(
|
|
41
|
-
new g(s, i, a, this.rootElForPDF, this.getOptions()).savePDF(
|
|
39
|
+
save(e) {
|
|
40
|
+
new g(s, i, a, this.rootElForPDF, this.getOptions()).savePDF(e);
|
|
42
41
|
}
|
|
43
42
|
getOptions() {
|
|
44
43
|
return Object.assign({}, this.props, { margin: p(this.props) });
|
|
45
44
|
}
|
|
46
45
|
};
|
|
47
46
|
t.propTypes = {
|
|
48
|
-
author:
|
|
49
|
-
avoidLinks:
|
|
50
|
-
forcePageBreak:
|
|
51
|
-
keepTogether:
|
|
52
|
-
creator:
|
|
53
|
-
date:
|
|
54
|
-
imageResolution:
|
|
55
|
-
fileName:
|
|
56
|
-
forceProxy:
|
|
57
|
-
keywords:
|
|
58
|
-
landscape:
|
|
59
|
-
margin:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
left:
|
|
64
|
-
top:
|
|
65
|
-
right:
|
|
66
|
-
bottom:
|
|
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:
|
|
70
|
-
paperSize:
|
|
71
|
-
repeatHeaders:
|
|
72
|
-
scale:
|
|
73
|
-
proxyData:
|
|
74
|
-
proxyURL:
|
|
75
|
-
proxyTarget:
|
|
76
|
-
producer:
|
|
77
|
-
subject:
|
|
78
|
-
title:
|
|
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
79
|
let n = t;
|
|
81
80
|
export {
|
package/PDFMargin.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),e=require("prop-types");function i(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,c.get?c:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const p=i(u),s=class s extends p.Component{render(){return null}};s.propTypes={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])};let o=s;exports.PDFMargin=o;
|
package/PDFMargin.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as n from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
10
|
const t = class t extends n.Component {
|
package/common/dom-queries.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={},a=s=>String(s).trim().split(" "),n=(s,t)=>{const i=a(t);return!!a(s.className).find(e=>i.indexOf(e)>=0)},c=s=>t=>n(t,s),f=s=>(r[s]||(r[s]=t=>String(t.nodeName).toLowerCase()===s.toLowerCase()),r[s]),l=(s,t,i=!0)=>{if(s){if(i&&t(s))return s;for(s=s.firstChild;s;){if(s.nodeType===1){const e=l(s,t);if(e)return e}s=s.nextSibling}}};exports.findElement=l;exports.hasClasses=n;exports.matchesClasses=c;exports.matchesNodeName=f;
|
package/common/dom-queries.mjs
CHANGED
|
@@ -5,17 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"
|
|
9
|
-
const r =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, a = (t) => (s) => l(s, t), f = (t) => (r[t] || (r[t] = (s) => String(s.nodeName).toLowerCase() === t.toLowerCase()), r[t]), c = (t, s, e = !0) => {
|
|
8
|
+
const e = {}, n = (t) => String(t).trim().split(" "), l = (t, s) => {
|
|
9
|
+
const r = n(s);
|
|
10
|
+
return !!n(t.className).find((i) => r.indexOf(i) >= 0);
|
|
11
|
+
}, c = (t) => (s) => l(s, t), f = (t) => (e[t] || (e[t] = (s) => String(s.nodeName).toLowerCase() === t.toLowerCase()), e[t]), a = (t, s, r = !0) => {
|
|
13
12
|
if (t) {
|
|
14
|
-
if (
|
|
13
|
+
if (r && s(t))
|
|
15
14
|
return t;
|
|
16
15
|
for (t = t.firstChild; t; ) {
|
|
17
16
|
if (t.nodeType === 1) {
|
|
18
|
-
const i =
|
|
17
|
+
const i = a(t, s);
|
|
19
18
|
if (i)
|
|
20
19
|
return i;
|
|
21
20
|
}
|
|
@@ -24,8 +23,8 @@ const r = {}, n = (t) => String(t).trim().split(" "), l = (t, s) => {
|
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
25
|
export {
|
|
27
|
-
|
|
26
|
+
a as findElement,
|
|
28
27
|
l as hasClasses,
|
|
29
|
-
|
|
28
|
+
c as matchesClasses,
|
|
30
29
|
f as matchesNodeName
|
|
31
30
|
};
|
package/common/table-query.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dom-queries.js"),t="k-grid-header",s="k-grid-footer",i="TABLE",a=e.matchesNodeName(i);class n{constructor(r){this.element=r,this.list=e.findElement(r,e.matchesClasses("k-grid"))}content(){return e.findElement(this.list,e.matchesClasses("k-grid"))}header(){return this.headerWrap=this.headerWrap||e.findElement(this.element,e.matchesClasses(t)),e.findElement(this.headerWrap,e.matchesClasses(`${t}`))}footer(){return this.footerWrap=this.footerWrap||e.findElement(this.element,e.matchesClasses(s)),e.findElement(this.footerWrap,e.matchesClasses(`${s}`))}table(){return e.findElement(this.element,a)}}exports.FOOTER_CLASS=s;exports.GridQuery=n;exports.HEADER_CLASS=t;
|
package/common/table-query.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { findElement as e, matchesClasses as t, matchesNodeName as o } from "./dom-queries.mjs";
|
|
10
9
|
const s = "k-grid-header", i = "k-grid-footer", h = "TABLE", a = o(h);
|
|
11
|
-
class
|
|
10
|
+
class c {
|
|
12
11
|
constructor(r) {
|
|
13
12
|
this.element = r, this.list = e(r, t("k-grid"));
|
|
14
13
|
}
|
|
@@ -27,6 +26,6 @@ class d {
|
|
|
27
26
|
}
|
|
28
27
|
export {
|
|
29
28
|
i as FOOTER_CLASS,
|
|
30
|
-
|
|
29
|
+
c as GridQuery,
|
|
31
30
|
s as HEADER_CLASS
|
|
32
31
|
};
|
package/common/utils.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i="k-first",f="k-grid-header",h="k-grid-footer",d=(e,t)=>{const n=t.length;for(let o=0;o<n;o++)e.appendChild(t[o].cloneNode(!0))},p=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},c=e=>{const t=e.length,n=e[0].cloneNode(!0),o=n.rows.length;if(t>1)for(let l=0;l<o;l++)for(let s=1;s<t;s++)d(n.rows[l],e[s].rows[l].cells);return n},g=(e,t)=>{if(t.length>1&&e.rows.length>1)for(let n=1;n<e.rows.length;n++){const o=t[0].rows[n].cells.length,l=e.rows[n].cells[o];String(l.className).indexOf(i)===-1&&(l.className+=` ${i}`)}},m=(e,t,n,o)=>{const l=document.createElement("table"),s=e[0].cloneNode(!0);for(let r=1;r<e.length;r++)d(s,e[r].querySelectorAll("col"));const a=c(t),C=c(n);if(a.className=f,g(a,t),l.appendChild(s),l.appendChild(a),l.appendChild(C),o.length){const r=c(o);r.className=h,l.appendChild(r)}return p(l)};exports.appendNodes=d;exports.createTable=m;exports.createTableElement=c;exports.setFirstCellClass=g;exports.wrapTable=p;
|
package/common/utils.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const a = "k-first", g = "k-grid-header", h = "k-grid-footer", i = (e, t) => {
|
|
10
9
|
const n = t.length;
|
|
11
10
|
for (let o = 0; o < n; o++)
|
|
@@ -5,4 +5,11 @@
|
|
|
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,s,n,i,a){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=p(t),c=p(n);const d=class extends l.Component{render(){return null}};d.propTypes={left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])};let h=d;const g=["bottom","left","right","top"];function u(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===h));return t?function(e){const t={};for(let r=0;r<g.length;r++){const o=g[r],s=e.props[o];void 0!==s&&(t[o]=s)}return t}(t):e.margin}let m=class{constructor(e,t,r,o,s={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=o,this.options=s,this.convertPageTemplateToHtml=e=>`<span>${c.renderToStaticMarkup(l.createElement(this.options.pageTemplate,{pageNum:e.pageNum,totalPages:e.totalPages}))}</span>`}savePDF(e){const t=this.drawDOM(this.domElement,this.getDrawOptions()).then((e=>this.exportPDF(e,this.getPDFOptions()))).then((e=>this.saveAs(e,this.options.fileName||"export.pdf",this.getSaveOptions())));e&&t.then(e,e)}getDrawOptions(){return{avoidLinks:this.options.avoidLinks,forcePageBreak:this.options.forcePageBreak,keepTogether:this.options.keepTogether,margin:this.options.margin,paperSize:this.options.paperSize,landscape:this.options.landscape,repeatHeaders:this.options.repeatHeaders,scale:this.options.scale,template:this.options.pageTemplate&&this.convertPageTemplateToHtml}}getPDFOptions(){return{author:this.options.author,creator:this.options.creator||"KendoReact PDF Generator",date:this.options.date,imgDPI:this.options.imageResolution,keywords:this.options.keywords,landscape:this.options.landscape,margin:this.options.margin,multiPage:!0,paperSize:this.options.paperSize,producer:this.options.producer,subject:this.options.subject,title:this.options.title}}getSaveOptions(){return{forceProxy:this.options.forceProxy,proxyData:this.options.proxyData,proxyTarget:this.options.proxyTarget,proxyURL:this.options.proxyURL}}};const f={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1737621536,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,i.validatePackage(f)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children)}save(e){new m(o.drawDOM,o.exportPDF,s.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:u(this.props)})}};y.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let b=y;function T(e,t={},r){new m(o.drawDOM,o.exportPDF,s.saveAs,e,t).savePDF(r)}const O={},k=e=>String(e).trim().split(" "),v=e=>t=>((e,t)=>{const r=k(t);return!!k(e.className).find((e=>r.indexOf(e)>=0))})(t,e),w=e=>(O[e]||(O[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),O[e]),D=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=D(e,t);if(r)return r}e=e.nextSibling}}},P="k-grid-header",x="k-grid-footer",C=w("TABLE"),E=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=D(e,v("k-grid-container"))}content(e){return D(this.list,v("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||D(this.element,v(P)),D(this.headerWrap,v(`${P}-${E(e)}`))}footer(e){return this.footerWrap=this.footerWrap||D(this.element,v(x)),D(this.footerWrap,v(`${x}-${E(e)}`))}table(){return D(this.element,C)}}const N="k-first",R=(e,t)=>{const r=t.length;for(let o=0;o<r;o++)e.appendChild(t[o].cloneNode(!0))},S=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},L=e=>{const t=e.length,r=e[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let s=0;s<o;s++)for(let o=1;o<t;o++)R(r.rows[s],e[o].rows[s].cells);return r},j=(e,t,r,o)=>{const s=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)R(n,e[t].querySelectorAll("col"));const i=L(t),a=L(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const o=t[0].rows[r].cells.length,s=e.rows[r].cells[o];-1===String(s.className).indexOf(N)&&(s.className+=` ${N}`)}})(i,t),s.appendChild(n),s.appendChild(i),s.appendChild(a),o.length){const e=L(o);e.className="k-grid-footer",s.appendChild(e)}return S(s)},W=e=>{const t=new F(e),r=t.content();let o;if(r){const e=[r.querySelector("colgroup")],s=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];o=j(e,s,n,a)}else o=S(t.table().cloneNode(!0));return o};function A(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-grid-pdf-export-element";const e=W(t);return s.appendChild(e),document.body.appendChild(s),e}n()}(e,t,r,o)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.saveGridPDF=A(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body)}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return T}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},o=Object.assign({},t,r);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,o,this.columns.concat(e))}return l.cloneElement(this.grid,o)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};q.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let G=q;const K="k-grid-header",U="k-grid-footer",I=w("TABLE");class M{constructor(e){this.element=e,this.list=D(e,v("k-grid"))}content(){return D(this.list,v("k-grid"))}header(){return this.headerWrap=this.headerWrap||D(this.element,v(K)),D(this.headerWrap,v(`${K}`))}footer(){return this.footerWrap=this.footerWrap||D(this.element,v(U)),D(this.footerWrap,v(`${U}`))}table(){return D(this.element,I)}}const z=e=>{const t=new M(e),r=t.content();let o;const s=t.header();if(s.childNodes.length>1&&s.removeChild(s.childNodes[1]),s.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[s],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];o=j(e,n,i,p)}else o=S(t.table().cloneNode(!0));return o};function $(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-treelist-pdf-export-element";const e=z(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const B=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.saveTreeListPDF=$(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body)}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return T}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};B.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let H=B;e.GridPDFExport=G,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=h,e.TreeListPDFExport=H,e.getPageMargin=u,e.savePDF=T}));
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*-------------------------------------------------------------------------------------------
|
|
11
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
12
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
|
+
*-------------------------------------------------------------------------------------------
|
|
14
|
+
*/
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-drawing"),require("@progress/kendo-file-saver"),require("react-dom/server"),require("@progress/kendo-react-common"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-drawing","@progress/kendo-file-saver","react-dom/server","@progress/kendo-react-common","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPdf={},e.React,e.PropTypes,e.KendoDrawing,e.KendoFileSaver,e.ReactDOMServer,e.KendoReactCommon,e.ReactDOM)}(this,(function(e,t,r,o,s,n,i,a){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var l=p(t),c=p(n);const d=class extends l.Component{render(){return null}};d.propTypes={left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])};let h=d;const g=["bottom","left","right","top"];function u(e){const t=l.Children.toArray(e.children).find((e=>e&&e.type===h));return t?function(e){const t={};for(let r=0;r<g.length;r++){const o=g[r],s=e.props[o];void 0!==s&&(t[o]=s)}return t}(t):e.margin}let m=class{constructor(e,t,r,o,s={}){this.drawDOM=e,this.exportPDF=t,this.saveAs=r,this.domElement=o,this.options=s,this.convertPageTemplateToHtml=e=>`<span>${c.renderToStaticMarkup(l.createElement(this.options.pageTemplate,{pageNum:e.pageNum,totalPages:e.totalPages}))}</span>`}savePDF(e){const t=this.drawDOM(this.domElement,this.getDrawOptions()).then((e=>this.exportPDF(e,this.getPDFOptions()))).then((e=>this.saveAs(e,this.options.fileName||"export.pdf",this.getSaveOptions())));e&&t.then(e,e)}getDrawOptions(){return{avoidLinks:this.options.avoidLinks,forcePageBreak:this.options.forcePageBreak,keepTogether:this.options.keepTogether,margin:this.options.margin,paperSize:this.options.paperSize,landscape:this.options.landscape,repeatHeaders:this.options.repeatHeaders,scale:this.options.scale,template:this.options.pageTemplate&&this.convertPageTemplateToHtml}}getPDFOptions(){return{author:this.options.author,creator:this.options.creator||"KendoReact PDF Generator",date:this.options.date,imgDPI:this.options.imageResolution,keywords:this.options.keywords,landscape:this.options.landscape,margin:this.options.margin,multiPage:!0,paperSize:this.options.paperSize,producer:this.options.producer,subject:this.options.subject,title:this.options.title}}getSaveOptions(){return{forceProxy:this.options.forceProxy,proxyData:this.options.proxyData,proxyTarget:this.options.proxyTarget,proxyURL:this.options.proxyURL}}};const f={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"$VERSION",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},y=class extends l.Component{constructor(e){super(e),this.rootElForPDF=null,i.validatePackage(f)}render(){return l.createElement("div",{ref:e=>{this.rootElForPDF=e}},this.props.children)}save(e){new m(o.drawDOM,o.exportPDF,s.saveAs,this.rootElForPDF,this.getOptions()).savePDF(e)}getOptions(){return Object.assign({},this.props,{margin:u(this.props)})}};y.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let b=y;function T(e,t={},r){new m(o.drawDOM,o.exportPDF,s.saveAs,e,t).savePDF(r)}const O={},k=e=>String(e).trim().split(" "),v=e=>t=>((e,t)=>{const r=k(t);return!!k(e.className).find((e=>r.indexOf(e)>=0))})(t,e),w=e=>(O[e]||(O[e]=t=>String(t.nodeName).toLowerCase()===e.toLowerCase()),O[e]),D=(e,t,r=!0)=>{if(e){if(r&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){const r=D(e,t);if(r)return r}e=e.nextSibling}}},P="k-grid-header",x="k-grid-footer",C=w("TABLE"),E=e=>e?"locked":"wrap";class F{constructor(e){this.element=e,this.list=D(e,v("k-grid-container"))}content(e){return D(this.list,v("k-grid-content"+(e?"-locked":"")))}header(e){return this.headerWrap=this.headerWrap||D(this.element,v(P)),D(this.headerWrap,v(`${P}-${E(e)}`))}footer(e){return this.footerWrap=this.footerWrap||D(this.element,v(x)),D(this.footerWrap,v(`${x}-${E(e)}`))}table(){return D(this.element,C)}}const N="k-first",R=(e,t)=>{const r=t.length;for(let o=0;o<r;o++)e.appendChild(t[o].cloneNode(!0))},S=e=>{const t=document.createElement("div");return t.className="k-grid k-grid-md",t.appendChild(e),t},L=e=>{const t=e.length,r=e[0].cloneNode(!0),o=r.rows.length;if(t>1)for(let s=0;s<o;s++)for(let o=1;o<t;o++)R(r.rows[s],e[o].rows[s].cells);return r},j=(e,t,r,o)=>{const s=document.createElement("table"),n=e[0].cloneNode(!0);for(let t=1;t<e.length;t++)R(n,e[t].querySelectorAll("col"));const i=L(t),a=L(r);if(i.className="k-grid-header",((e,t)=>{if(t.length>1&&e.rows.length>1)for(let r=1;r<e.rows.length;r++){const o=t[0].rows[r].cells.length,s=e.rows[r].cells[o];-1===String(s.className).indexOf(N)&&(s.className+=` ${N}`)}})(i,t),s.appendChild(n),s.appendChild(i),s.appendChild(a),o.length){const e=L(o);e.className="k-grid-footer",s.appendChild(e)}return S(s)},W=e=>{const t=new F(e),r=t.content();let o;if(r){const e=[r.querySelector("colgroup")],s=[t.header().querySelector("thead")],n=[r.querySelector("tbody")],i=t.footer(),a=i?[i.querySelector("tfoot")]:[];o=j(e,s,n,a)}else o=S(t.table().cloneNode(!0));return o};function A(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-grid-pdf-export-element";const e=W(t);return s.appendChild(e),document.body.appendChild(s),e}n()}(e,t,r,o)}const q=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.saveGridPDF=A(this.getSavePDF()),this.gridInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body)}save(e,t){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=e,this.callback=()=>{this.setState({show:!1}),t&&t()},this.setState({show:!0})}getSavePDF(){return T}getGrid(){return l.Children.toArray(this.props.children).find((e=>e&&"KendoReactGrid"===e.type.displayName))}getCustomColumns(){return l.Children.toArray(this.props.children).filter((e=>e&&"KendoReactGridColumn"===e.type.displayName))}prepareRawGridForExport(e){const t=e&&{data:e,total:e.length,pageSize:e.length,skip:0},r={style:Object.assign({},this.grid.props.style,{width:"1000px"})},o=Object.assign({},t,r);if(this.columns&&this.columns.length>0){const e=this.getGridNotColumnChildren(this.grid);return l.cloneElement(this.grid,o,this.columns.concat(e))}return l.cloneElement(this.grid,o)}getGridNotColumnChildren(e){return l.Children.toArray(e.props.children).filter((e=>e&&e.type&&"KendoReactGridColumn"!==e.type.displayName))}};q.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string};let G=q;const K="k-grid-header",U="k-grid-footer",I=w("TABLE");class M{constructor(e){this.element=e,this.list=D(e,v("k-grid"))}content(){return D(this.list,v("k-grid"))}header(){return this.headerWrap=this.headerWrap||D(this.element,v(K)),D(this.headerWrap,v(`${K}`))}footer(){return this.footerWrap=this.footerWrap||D(this.element,v(U)),D(this.footerWrap,v(`${U}`))}table(){return D(this.element,I)}}const z=e=>{const t=new M(e),r=t.content();let o;const s=t.header();if(s.childNodes.length>1&&s.removeChild(s.childNodes[1]),s.childNodes[0].childNodes.forEach((e=>e.style.top=0)),r){const e=[r.querySelector("colgroup")],n=[s],i=[r.querySelector("tbody")],a=t.footer(),p=a?[a.querySelector("tfoot")]:[];o=j(e,n,i,p)}else o=S(t.table().cloneNode(!0));return o};function $(e){return(t,r={},o)=>function(e,t,r={},o){let s;function n(){e(a(),r,i)}function i(){document.body.removeChild(s),s=void 0,o&&o()}function a(){s=document.createElement("div"),s.className="k-treelist-pdf-export-element";const e=z(t);return s.appendChild(e),document.body.appendChild(s),s}n()}(e,t,r,o)}const B=class extends l.Component{constructor(e){super(e),this.state={show:!1},this.saveTreeListPDF=$(this.getSavePDF()),this.treeListInnerWrapperRef=l.createRef()}componentDidUpdate(e,t){this.state.show&&this.state.show!==t.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:u(this.props)}),this.callback)}render(){return this.state.show&&a.createPortal(l.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},l.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body)}save(e,t,r){this.treeList=this.getTreeList(),this.columns=t||[],this.data=e,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return T}getTreeList(){const e=this.props.children;if(e&&e.props.data&&e.props.columns)return this.props.children}prepareRawTreeListForExport(){const e=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},t={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},e,t);return this.columns&&this.columns.length>0?l.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):l.cloneElement(this.treeList,r)}};B.propTypes={author:r.string,avoidLinks:r.oneOfType([r.bool,r.string]),forcePageBreak:r.string,keepTogether:r.string,creator:r.string,date:r.instanceOf(Date),imageResolution:r.number,fileName:r.string,forceProxy:r.bool,keywords:r.string,landscape:r.bool,margin:r.oneOfType([r.string,r.number,r.shape({left:r.oneOfType([r.number,r.string]),top:r.oneOfType([r.number,r.string]),right:r.oneOfType([r.number,r.string]),bottom:r.oneOfType([r.number,r.string])})]),pageTemplate:r.any,paperSize:r.any,repeatHeaders:r.bool,scale:r.number,proxyData:r.any,proxyURL:r.string,proxyTarget:r.string,producer:r.string,subject:r.string,title:r.string,allPages:r.bool};let H=B;e.GridPDFExport=G,e.KendoDrawingAdapter=m,e.PDFExport=b,e.PDFMargin=h,e.TreeListPDFExport=H,e.getPageMargin=u,e.savePDF=T}));
|
package/getPageMargin.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("./PDFMargin.js");function g(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const l=g(a),i=["bottom","left","right","top"];function u(t){const n=l.Children.toArray(t.children).find(e=>e&&e.type===c.PDFMargin);return n?s(n):t.margin}function s(t){const n={};for(let e=0;e<i.length;e++){const r=i[e],o=t.props[r];o!==void 0&&(n[r]=o)}return n}exports.getPageMargin=u;
|
package/getPageMargin.mjs
CHANGED
|
@@ -5,22 +5,21 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as a from "react";
|
|
10
|
-
import { PDFMargin as
|
|
9
|
+
import { PDFMargin as f } from "./PDFMargin.mjs";
|
|
11
10
|
const i = ["bottom", "left", "right", "top"];
|
|
12
|
-
function
|
|
13
|
-
const n = a.Children.toArray(
|
|
14
|
-
return n ?
|
|
11
|
+
function s(r) {
|
|
12
|
+
const n = a.Children.toArray(r.children).find((t) => t && t.type === f);
|
|
13
|
+
return n ? g(n) : r.margin;
|
|
15
14
|
}
|
|
16
|
-
function
|
|
15
|
+
function g(r) {
|
|
17
16
|
const n = {};
|
|
18
17
|
for (let t = 0; t < i.length; t++) {
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
const o = i[t], e = r.props[o];
|
|
19
|
+
e !== void 0 && (n[o] = e);
|
|
21
20
|
}
|
|
22
21
|
return n;
|
|
23
22
|
}
|
|
24
23
|
export {
|
|
25
|
-
|
|
24
|
+
s as getPageMargin
|
|
26
25
|
};
|
package/grid/GridPDFExport.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),e=require("prop-types"),g=require("../getPageMargin.js"),u=require("../savePDF.js"),d=require("./provideSaveGridPDF.js"),h=require("react-dom");function m(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>n[r]})}}return t.default=n,Object.freeze(t)}const s=m(c),a=class a extends s.Component{constructor(t){super(t),this.state={show:!1},this.saveGridPDF=d.provideSaveGridPDF(this.getSavePDF()),this.gridInnerWrapperRef=s.createRef()}componentDidUpdate(t,r){this.state.show&&this.state.show!==r.show&&this.saveGridPDF(this.gridInnerWrapperRef.current,Object.assign({},this.props,{margin:g.getPageMargin(this.props)}),this.callback)}render(){return this.state.show&&h.createPortal(s.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},s.createElement("div",{ref:this.gridInnerWrapperRef},this.prepareRawGridForExport(this.data))),document.body)}save(t,r){this.grid=this.getGrid(),this.columns=this.getCustomColumns(),this.data=t,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return u.savePDF}getGrid(){return s.Children.toArray(this.props.children).find(t=>t&&t.type.displayName==="KendoReactGrid")}getCustomColumns(){return s.Children.toArray(this.props.children).filter(t=>t&&t.type.displayName==="KendoReactGridColumn")}prepareRawGridForExport(t){const r=t&&{data:t,total:t.length,pageSize:t.length,skip:0},i={style:Object.assign({},this.grid.props.style,{width:"1000px"})},p=Object.assign({},r,i);if(this.columns&&this.columns.length>0){const l=this.getGridNotColumnChildren(this.grid);return s.cloneElement(this.grid,p,this.columns.concat(l))}return s.cloneElement(this.grid,p)}getGridNotColumnChildren(t){return s.Children.toArray(t.props.children).filter(r=>r&&r.type&&r.type.displayName!=="KendoReactGridColumn")}};a.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string};let o=a;exports.GridPDFExport=o;
|
package/grid/GridPDFExport.mjs
CHANGED
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as s from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
|
-
import { getPageMargin as
|
|
12
|
-
import { savePDF as
|
|
10
|
+
import { getPageMargin as h } from "../getPageMargin.mjs";
|
|
11
|
+
import { savePDF as l } from "../savePDF.mjs";
|
|
13
12
|
import { provideSaveGridPDF as g } from "./provideSaveGridPDF.mjs";
|
|
14
13
|
import { createPortal as m } from "react-dom";
|
|
15
14
|
const i = class i extends s.Component {
|
|
@@ -24,7 +23,7 @@ const i = class i extends s.Component {
|
|
|
24
23
|
componentDidUpdate(t, r) {
|
|
25
24
|
this.state.show && this.state.show !== r.show && this.saveGridPDF(
|
|
26
25
|
this.gridInnerWrapperRef.current,
|
|
27
|
-
Object.assign({}, this.props, { margin:
|
|
26
|
+
Object.assign({}, this.props, { margin: h(this.props) }),
|
|
28
27
|
this.callback
|
|
29
28
|
);
|
|
30
29
|
}
|
|
@@ -61,7 +60,7 @@ const i = class i extends s.Component {
|
|
|
61
60
|
}, this.setState({ show: !0 });
|
|
62
61
|
}
|
|
63
62
|
getSavePDF() {
|
|
64
|
-
return
|
|
63
|
+
return l;
|
|
65
64
|
}
|
|
66
65
|
getGrid() {
|
|
67
66
|
return s.Children.toArray(this.props.children).find(
|
package/grid/export-element.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./grid-query.js"),c=require("../common/utils.js"),i=n=>{const e=new d.GridQuery(n),t=e.content();let o;if(t){const l=[t.querySelector("colgroup")],s=[e.header().querySelector("thead")],u=[t.querySelector("tbody")],r=e.footer(),a=r?[r.querySelector("tfoot")]:[];o=c.createTable(l,s,u,a)}else o=c.wrapTable(e.table().cloneNode(!0));return o};exports.exportElement=i;
|
package/grid/export-element.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { GridQuery as a } from "./grid-query.mjs";
|
|
10
9
|
import { createTable as d, wrapTable as f } from "../common/utils.mjs";
|
|
11
|
-
const
|
|
10
|
+
const b = (c) => {
|
|
12
11
|
const e = new a(c), o = e.content();
|
|
13
12
|
let t;
|
|
14
13
|
if (o) {
|
|
@@ -19,5 +18,5 @@ const i = (c) => {
|
|
|
19
18
|
return t;
|
|
20
19
|
};
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
b as exportElement
|
|
23
22
|
};
|
package/grid/grid-query.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../common/dom-queries.js"),s="k-grid-header",r="k-grid-footer",a="TABLE",o=e.matchesNodeName(a),i=n=>n?"locked":"wrap";class l{constructor(t){this.element=t,this.list=e.findElement(t,e.matchesClasses("k-grid-container"))}content(t){return e.findElement(this.list,e.matchesClasses(`k-grid-content${t?"-locked":""}`))}header(t){return this.headerWrap=this.headerWrap||e.findElement(this.element,e.matchesClasses(s)),e.findElement(this.headerWrap,e.matchesClasses(`${s}-${i(t)}`))}footer(t){return this.footerWrap=this.footerWrap||e.findElement(this.element,e.matchesClasses(r)),e.findElement(this.footerWrap,e.matchesClasses(`${r}-${i(t)}`))}table(){return e.findElement(this.element,o)}}exports.FOOTER_CLASS=r;exports.GridQuery=l;exports.HEADER_CLASS=s;
|
package/grid/grid-query.mjs
CHANGED
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const o = "k-grid-header", i = "k-grid-footer", h = "TABLE", c = a(h), n = (s) => s ? "locked" : "wrap";
|
|
8
|
+
import { findElement as t, matchesClasses as r, matchesNodeName as n } from "../common/dom-queries.mjs";
|
|
9
|
+
const o = "k-grid-header", i = "k-grid-footer", h = "TABLE", c = n(h), a = (s) => s ? "locked" : "wrap";
|
|
11
10
|
class l {
|
|
12
11
|
constructor(e) {
|
|
13
12
|
this.element = e, this.list = t(e, r("k-grid-container"));
|
|
@@ -16,10 +15,10 @@ class l {
|
|
|
16
15
|
return t(this.list, r(`k-grid-content${e ? "-locked" : ""}`));
|
|
17
16
|
}
|
|
18
17
|
header(e) {
|
|
19
|
-
return this.headerWrap = this.headerWrap || t(this.element, r(o)), t(this.headerWrap, r(`${o}-${
|
|
18
|
+
return this.headerWrap = this.headerWrap || t(this.element, r(o)), t(this.headerWrap, r(`${o}-${a(e)}`));
|
|
20
19
|
}
|
|
21
20
|
footer(e) {
|
|
22
|
-
return this.footerWrap = this.footerWrap || t(this.element, r(i)), t(this.footerWrap, r(`${i}-${
|
|
21
|
+
return this.footerWrap = this.footerWrap || t(this.element, r(i)), t(this.footerWrap, r(`${i}-${a(e)}`));
|
|
23
22
|
}
|
|
24
23
|
table() {
|
|
25
24
|
return t(this.element, c);
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./export-element.js");function p(t){return(r,o={},n)=>c(t,r,o,n)}function c(t,r,o={},n){let e;i();function i(){t(u(),o,l)}function l(){document.body.removeChild(e),e=void 0,n&&n()}function u(){e=document.createElement("div"),e.className="k-grid-pdf-export-element";const d=a.exportElement(r);return e.appendChild(d),document.body.appendChild(e),d}}exports.provideSaveGridPDF=p;
|
|
@@ -5,23 +5,22 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return (r, o = {}, n) => a(t, r, o, n);
|
|
8
|
+
import { exportElement as a } from "./export-element.mjs";
|
|
9
|
+
function m(r) {
|
|
10
|
+
return (t, o = {}, n) => u(r, t, o, n);
|
|
12
11
|
}
|
|
13
|
-
function
|
|
12
|
+
function u(r, t, o = {}, n) {
|
|
14
13
|
let e;
|
|
15
14
|
i();
|
|
16
15
|
function i() {
|
|
17
|
-
|
|
16
|
+
r(l(), o, p);
|
|
18
17
|
}
|
|
19
|
-
function
|
|
18
|
+
function p() {
|
|
20
19
|
document.body.removeChild(e), e = void 0, n && n();
|
|
21
20
|
}
|
|
22
|
-
function
|
|
21
|
+
function l() {
|
|
23
22
|
e = document.createElement("div"), e.className = "k-grid-pdf-export-element";
|
|
24
|
-
const d =
|
|
23
|
+
const d = a(t);
|
|
25
24
|
return e.appendChild(d), document.body.appendChild(e), d;
|
|
26
25
|
}
|
|
27
26
|
}
|
package/index.js
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./PDFExport.js"),e=require("./PDFMargin.js"),t=require("./savePDF.js"),i=require("./getPageMargin.js"),o=require("./grid/GridPDFExport.js"),n=require("./treelist/TreeListPDFExport.js"),P=require("./KendoDrawingAdapter.js");exports.PDFExport=r.PDFExport;exports.PDFMargin=e.PDFMargin;exports.savePDF=t.savePDF;exports.getPageMargin=i.getPageMargin;exports.GridPDFExport=o.GridPDFExport;exports.TreeListPDFExport=n.TreeListPDFExport;exports.KendoDrawingAdapter=P;
|
package/index.mjs
CHANGED
|
@@ -10,15 +10,15 @@ import { PDFExport as e } from "./PDFExport.mjs";
|
|
|
10
10
|
import { PDFMargin as p } from "./PDFMargin.mjs";
|
|
11
11
|
import { savePDF as a } from "./savePDF.mjs";
|
|
12
12
|
import { getPageMargin as m } from "./getPageMargin.mjs";
|
|
13
|
-
import { GridPDFExport as
|
|
14
|
-
import { TreeListPDFExport as
|
|
15
|
-
import { default as
|
|
13
|
+
import { GridPDFExport as P } from "./grid/GridPDFExport.mjs";
|
|
14
|
+
import { TreeListPDFExport as i } from "./treelist/TreeListPDFExport.mjs";
|
|
15
|
+
import { default as d } from "./KendoDrawingAdapter.mjs";
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
P as GridPDFExport,
|
|
18
|
+
d as KendoDrawingAdapter,
|
|
19
19
|
e as PDFExport,
|
|
20
20
|
p as PDFMargin,
|
|
21
|
-
|
|
21
|
+
i as TreeListPDFExport,
|
|
22
22
|
m as getPageMargin,
|
|
23
23
|
a as savePDF
|
|
24
24
|
};
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-pdf",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738311446,version:"9.4.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const e = {
|
|
10
9
|
name: "@progress/kendo-react-pdf",
|
|
11
10
|
productName: "KendoReact",
|
|
12
11
|
productCode: "KENDOUIREACT",
|
|
13
12
|
productCodes: ["KENDOUIREACT"],
|
|
14
|
-
publishDate:
|
|
15
|
-
version: "9.4.0-develop.
|
|
13
|
+
publishDate: 1738311446,
|
|
14
|
+
version: "9.4.0-develop.11",
|
|
16
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
17
16
|
};
|
|
18
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-pdf",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.11",
|
|
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.3.4",
|
|
31
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
31
|
+
"@progress/kendo-react-common": "9.4.0-develop.11",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
34
34
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"package": {
|
|
55
55
|
"productName": "KendoReact",
|
|
56
56
|
"productCode": "KENDOUIREACT",
|
|
57
|
-
"publishDate":
|
|
57
|
+
"publishDate": 1738311446,
|
|
58
58
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
59
59
|
}
|
|
60
60
|
},
|
package/savePDF.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-drawing"),t=require("@progress/kendo-file-saver"),a=require("./KendoDrawingAdapter.js");function i(r,n={},o){new a(e.drawDOM,e.exportPDF,t.saveAs,r,n).savePDF(o)}exports.savePDF=i;
|
package/savePDF.mjs
CHANGED
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import { drawDOM as t, exportPDF as a } from "@progress/kendo-drawing";
|
|
10
|
-
import { saveAs as
|
|
11
|
-
import
|
|
12
|
-
function
|
|
13
|
-
new
|
|
9
|
+
import { saveAs as m } from "@progress/kendo-file-saver";
|
|
10
|
+
import p from "./KendoDrawingAdapter.mjs";
|
|
11
|
+
function f(r, o = {}, e) {
|
|
12
|
+
new p(t, a, m, r, o).savePDF(e);
|
|
14
13
|
}
|
|
15
14
|
export {
|
|
16
|
-
|
|
15
|
+
f as savePDF
|
|
17
16
|
};
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),e=require("prop-types"),c=require("../getPageMargin.js"),l=require("../savePDF.js"),u=require("./provideSaveTreeListPDF.js"),g=require("react-dom");function h(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const s in n)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>n[s]})}}return t.default=n,Object.freeze(t)}const i=h(p),a=class a extends i.Component{constructor(t){super(t),this.state={show:!1},this.saveTreeListPDF=u.provideSaveTreeListPDF(this.getSavePDF()),this.treeListInnerWrapperRef=i.createRef()}componentDidUpdate(t,s){this.state.show&&this.state.show!==s.show&&this.saveTreeListPDF(this.treeListInnerWrapperRef.current,Object.assign({},this.props,{margin:c.getPageMargin(this.props)}),this.callback)}render(){return this.state.show&&g.createPortal(i.createElement("div",{style:{position:"absolute",left:"-5000px",top:"0px"}},i.createElement("div",{ref:this.treeListInnerWrapperRef},this.prepareRawTreeListForExport())),document.body)}save(t,s,r){this.treeList=this.getTreeList(),this.columns=s||[],this.data=t,this.callback=()=>{this.setState({show:!1}),r&&r()},this.setState({show:!0})}getSavePDF(){return l.savePDF}getTreeList(){const t=this.props.children;if(t&&t.props.data&&t.props.columns)return this.props.children}prepareRawTreeListForExport(){const t=this.props.allPages&&this.data?{data:this.data,take:Number.MAX_VALUE,skip:0}:{},s={style:Object.assign({},this.treeList.props.style,{width:"1000px"})},r=Object.assign({},t,s);return this.columns&&this.columns.length>0?i.cloneElement(this.treeList,Object.assign({},r,{columns:this.columns})):i.cloneElement(this.treeList,r)}};a.propTypes={author:e.string,avoidLinks:e.oneOfType([e.bool,e.string]),forcePageBreak:e.string,keepTogether:e.string,creator:e.string,date:e.instanceOf(Date),imageResolution:e.number,fileName:e.string,forceProxy:e.bool,keywords:e.string,landscape:e.bool,margin:e.oneOfType([e.string,e.number,e.shape({left:e.oneOfType([e.number,e.string]),top:e.oneOfType([e.number,e.string]),right:e.oneOfType([e.number,e.string]),bottom:e.oneOfType([e.number,e.string])})]),pageTemplate:e.any,paperSize:e.any,repeatHeaders:e.bool,scale:e.number,proxyData:e.any,proxyURL:e.string,proxyTarget:e.string,producer:e.string,subject:e.string,title:e.string,allPages:e.bool};let o=a;exports.TreeListPDFExport=o;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as s from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
10
|
import { getPageMargin as a } from "../getPageMargin.mjs";
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../common/table-query.js"),s=require("../common/utils.js"),h=n=>{const t=new a.GridQuery(n),o=t.content();let r;const e=t.header();if(e.childNodes.length>1&&e.removeChild(e.childNodes[1]),e.childNodes[0].childNodes.forEach(c=>c.style.top=0),o){const c=[o.querySelector("colgroup")],d=[e],u=[o.querySelector("tbody")],l=t.footer(),i=l?[l.querySelector("tfoot")]:[];r=s.createTable(c,d,u,i)}else r=s.wrapTable(t.table().cloneNode(!0));return r};exports.exportElement=h;
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import { createTable as h, wrapTable as a } from "../common/utils.mjs";
|
|
8
|
+
import { GridQuery as h } from "../common/table-query.mjs";
|
|
9
|
+
import { createTable as u, wrapTable as a } from "../common/utils.mjs";
|
|
11
10
|
const y = (s) => {
|
|
12
|
-
const o = new
|
|
11
|
+
const o = new h(s), t = o.content();
|
|
13
12
|
let r;
|
|
14
13
|
const e = o.header();
|
|
15
14
|
if (e.childNodes.length > 1 && e.removeChild(e.childNodes[1]), e.childNodes[0].childNodes.forEach((c) => c.style.top = 0), t) {
|
|
16
15
|
const c = [t.querySelector("colgroup")], n = [e], d = [t.querySelector("tbody")], l = o.footer(), i = l ? [l.querySelector("tfoot")] : [];
|
|
17
|
-
r =
|
|
16
|
+
r = u(c, n, d, i);
|
|
18
17
|
} else
|
|
19
18
|
r = a(o.table().cloneNode(!0));
|
|
20
19
|
return r;
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./export-element.js");function p(n){return(r,o={},t)=>c(n,r,o,t)}function c(n,r,o={},t){let e;i();function i(){n(l(),o,d)}function d(){document.body.removeChild(e),e=void 0,t&&t()}function l(){e=document.createElement("div"),e.className="k-treelist-pdf-export-element";const u=a.exportElement(r);return e.appendChild(u),document.body.appendChild(e),e}}exports.provideSaveTreeListPDF=p;
|
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
import { exportElement as u } from "./export-element.mjs";
|
|
8
|
+
import { exportElement as a } from "./export-element.mjs";
|
|
10
9
|
function m(t) {
|
|
11
|
-
return (r, o = {}, n) =>
|
|
10
|
+
return (r, o = {}, n) => u(t, r, o, n);
|
|
12
11
|
}
|
|
13
|
-
function
|
|
12
|
+
function u(t, r, o = {}, n) {
|
|
14
13
|
let e;
|
|
15
14
|
i();
|
|
16
15
|
function i() {
|
|
@@ -21,7 +20,7 @@ function a(t, r, o = {}, n) {
|
|
|
21
20
|
}
|
|
22
21
|
function l() {
|
|
23
22
|
e = document.createElement("div"), e.className = "k-treelist-pdf-export-element";
|
|
24
|
-
const p =
|
|
23
|
+
const p = a(r);
|
|
25
24
|
return e.appendChild(p), document.body.appendChild(e), e;
|
|
26
25
|
}
|
|
27
26
|
}
|