@progress/kendo-react-pdf 7.2.4-develop.3 → 7.2.4-develop.4
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 +8 -0
- package/KendoDrawingAdapter.mjs +65 -0
- package/PDFExport.js +8 -0
- package/PDFExport.mjs +79 -0
- package/PDFMargin.js +8 -0
- package/PDFMargin.mjs +25 -0
- package/common/dom-queries.js +8 -0
- package/common/dom-queries.mjs +31 -0
- package/common/table-query.js +8 -0
- package/common/table-query.mjs +32 -0
- package/common/utils.js +8 -0
- package/common/utils.mjs +46 -0
- package/dist/cdn/js/kendo-react-pdf.js +8 -5
- package/getPageMargin.js +8 -0
- package/getPageMargin.mjs +26 -0
- package/grid/GridPDFExport.js +8 -0
- package/grid/GridPDFExport.mjs +83 -0
- package/grid/export-element.js +8 -0
- package/grid/export-element.mjs +23 -0
- package/grid/grid-query.js +8 -0
- package/grid/grid-query.mjs +32 -0
- package/grid/provideSaveGridPDF.js +8 -0
- package/grid/provideSaveGridPDF.mjs +53 -0
- package/index.d.mts +439 -5
- package/index.d.ts +439 -14
- package/index.js +8 -5
- package/index.mjs +21 -476
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +2 -2
- package/savePDF.js +8 -0
- package/savePDF.mjs +23 -0
- package/treelist/TreeListPDFExport.js +8 -0
- package/treelist/TreeListPDFExport.mjs +84 -0
- package/treelist/export-element.js +8 -0
- package/treelist/export-element.mjs +23 -0
- package/treelist/provideSaveTreeListPDF.js +8 -0
- package/treelist/provideSaveTreeListPDF.mjs +46 -0
- package/KendoDrawingAdapter.d.ts +0 -24
- package/PDFExport.d.ts +0 -57
- package/PDFExportProps.d.ts +0 -127
- package/PDFMargin.d.ts +0 -71
- package/PageTemplateProps.d.ts +0 -17
- package/common/dom-queries.d.ts +0 -48
- package/common/table-query.d.ts +0 -26
- package/common/utils.d.ts +0 -24
- package/getPageMargin.d.ts +0 -10
- package/grid/GridPDFExport.d.ts +0 -70
- package/grid/export-element.d.ts +0 -8
- package/grid/grid-query.d.ts +0 -26
- package/grid/provideSaveGridPDF.d.ts +0 -9
- package/package-metadata.d.ts +0 -9
- package/savePDF.d.ts +0 -13
- package/treelist/TreeListPDFExport.d.ts +0 -75
- package/treelist/export-element.d.ts +0 -8
- package/treelist/provideSaveTreeListPDF.d.ts +0 -9
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as E from "react-dom";
|
|
10
|
+
import * as a from "react";
|
|
11
|
+
import { exportElement as b } from "./export-element.mjs";
|
|
12
|
+
function F(o) {
|
|
13
|
+
return (e, c = {}, p, t, i) => x(
|
|
14
|
+
o,
|
|
15
|
+
e,
|
|
16
|
+
c,
|
|
17
|
+
p,
|
|
18
|
+
t,
|
|
19
|
+
i
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function x(o, e, c = {}, p, t, i) {
|
|
23
|
+
let n, d, r;
|
|
24
|
+
u();
|
|
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
|
+
}
|
|
31
|
+
function f() {
|
|
32
|
+
document.body.removeChild(n), document.body.removeChild(r), n = r = void 0, p && p();
|
|
33
|
+
}
|
|
34
|
+
function C() {
|
|
35
|
+
r = document.createElement("div"), r.className = "k-grid-pdf-export-element";
|
|
36
|
+
const l = b(d);
|
|
37
|
+
return r.appendChild(l), document.body.appendChild(r), l;
|
|
38
|
+
}
|
|
39
|
+
function h() {
|
|
40
|
+
const l = t && { data: t, total: t.length, pageSize: t.length, skip: 0 }, y = { style: Object.assign({}, e.props.style, { width: "1000px" }) }, s = Object.assign({}, l, y);
|
|
41
|
+
if (i && i.length > 0) {
|
|
42
|
+
const v = g(e);
|
|
43
|
+
return a.cloneElement(e, s, i.concat(v));
|
|
44
|
+
} else
|
|
45
|
+
return a.cloneElement(e, s);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function g(o) {
|
|
49
|
+
return a.Children.toArray(o.props.children).filter((e) => e && e.type && e.type.displayName !== "KendoReactGridColumn");
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
F as provideSaveGridPDF
|
|
53
|
+
};
|
package/index.d.mts
CHANGED
|
@@ -1,5 +1,439 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { DrawOptions } from '@progress/kendo-drawing';
|
|
9
|
+
import { Group } from '@progress/kendo-drawing';
|
|
10
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
|
+
import { PageMargin } from '@progress/kendo-drawing/pdf';
|
|
12
|
+
import { PaperSize } from '@progress/kendo-drawing/pdf';
|
|
13
|
+
import { PDFOptions } from '@progress/kendo-drawing/pdf';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
import * as React_2 from 'react';
|
|
16
|
+
import { SaveOptions } from '@progress/kendo-file-saver';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
* Returns the margin options by reading the props of he component and the `PDFMargin` child.
|
|
21
|
+
* The props of the `PDFMargin` child are with greater priority.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPageMargin(props: any): any;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A React component which facilitates the PDF export of the Grid.
|
|
27
|
+
*/
|
|
28
|
+
export declare class GridPDFExport extends React_2.Component<GridPDFExportProps, {}> {
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
static propTypes: {
|
|
33
|
+
author: PropTypes.Requireable<string>;
|
|
34
|
+
avoidLinks: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
35
|
+
forcePageBreak: PropTypes.Requireable<string>;
|
|
36
|
+
keepTogether: PropTypes.Requireable<string>;
|
|
37
|
+
creator: PropTypes.Requireable<string>;
|
|
38
|
+
date: PropTypes.Requireable<Date>;
|
|
39
|
+
imageResolution: PropTypes.Requireable<number>;
|
|
40
|
+
fileName: PropTypes.Requireable<string>;
|
|
41
|
+
forceProxy: PropTypes.Requireable<boolean>;
|
|
42
|
+
keywords: PropTypes.Requireable<string>;
|
|
43
|
+
landscape: PropTypes.Requireable<boolean>;
|
|
44
|
+
margin: PropTypes.Requireable<NonNullable<string | number | PropTypes.InferProps<{
|
|
45
|
+
left: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
46
|
+
top: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
47
|
+
right: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
48
|
+
bottom: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
49
|
+
}> | null | undefined>>;
|
|
50
|
+
pageTemplate: PropTypes.Requireable<any>;
|
|
51
|
+
paperSize: PropTypes.Requireable<any>;
|
|
52
|
+
repeatHeaders: PropTypes.Requireable<boolean>;
|
|
53
|
+
scale: PropTypes.Requireable<number>;
|
|
54
|
+
proxyData: PropTypes.Requireable<any>;
|
|
55
|
+
proxyURL: PropTypes.Requireable<string>;
|
|
56
|
+
proxyTarget: PropTypes.Requireable<string>;
|
|
57
|
+
producer: PropTypes.Requireable<string>;
|
|
58
|
+
subject: PropTypes.Requireable<string>;
|
|
59
|
+
title: PropTypes.Requireable<string>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
saveGridPDF: any;
|
|
65
|
+
constructor(props: any);
|
|
66
|
+
/**
|
|
67
|
+
* @hidden
|
|
68
|
+
*/
|
|
69
|
+
render(): null;
|
|
70
|
+
/**
|
|
71
|
+
* Saves the content of the Grid as a PDF file.
|
|
72
|
+
*
|
|
73
|
+
* @param data - The data can be different from the currently displayed data in the Grid. Can be used to export all Grid pages.
|
|
74
|
+
* @param callback - The callback that will be executed after the PDF is saved.
|
|
75
|
+
*/
|
|
76
|
+
save(data?: any[], callback?: () => void): void;
|
|
77
|
+
protected getSavePDF(): typeof savePDF;
|
|
78
|
+
private getGrid;
|
|
79
|
+
private getCustomColumns;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The props of the GridPDFExport component
|
|
84
|
+
* ([more information and examples in the documentation on PDF export]({% slug overview_pdfexport_grid %})).
|
|
85
|
+
*/
|
|
86
|
+
export declare interface GridPDFExportProps extends PDFExportProps {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @hidden
|
|
91
|
+
*/
|
|
92
|
+
export declare class KendoDrawingAdapter {
|
|
93
|
+
private drawDOM;
|
|
94
|
+
private exportPDF;
|
|
95
|
+
private saveAs;
|
|
96
|
+
private domElement;
|
|
97
|
+
private options;
|
|
98
|
+
constructor(drawDOM: (element: HTMLElement, options: DrawOptions) => Promise<Group>, exportPDF: (group: Group, options: PDFOptions) => Promise<string>, saveAs: (dataUri: string, fileName: string, options: SaveOptions) => void, domElement: HTMLElement, options?: PDFExportProps);
|
|
99
|
+
savePDF(callback?: () => void): void;
|
|
100
|
+
private getDrawOptions;
|
|
101
|
+
private getPDFOptions;
|
|
102
|
+
private getSaveOptions;
|
|
103
|
+
private convertPageTemplateToHtml;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Represents the props of a page template component that can be added to the PDFExport component.
|
|
108
|
+
*/
|
|
109
|
+
export declare interface PageTemplateProps {
|
|
110
|
+
/**
|
|
111
|
+
* The number of the current page.
|
|
112
|
+
*/
|
|
113
|
+
pageNum: number;
|
|
114
|
+
/**
|
|
115
|
+
* The total number of pages.
|
|
116
|
+
*/
|
|
117
|
+
totalPages: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Represents the KendoReact PDFExport component.
|
|
122
|
+
*/
|
|
123
|
+
export declare class PDFExport extends React_2.Component<PDFExportProps, {}> {
|
|
124
|
+
/**
|
|
125
|
+
* @hidden
|
|
126
|
+
*/
|
|
127
|
+
static propTypes: {
|
|
128
|
+
author: PropTypes.Requireable<string>;
|
|
129
|
+
avoidLinks: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
130
|
+
forcePageBreak: PropTypes.Requireable<string>;
|
|
131
|
+
keepTogether: PropTypes.Requireable<string>;
|
|
132
|
+
creator: PropTypes.Requireable<string>;
|
|
133
|
+
date: PropTypes.Requireable<Date>;
|
|
134
|
+
imageResolution: PropTypes.Requireable<number>;
|
|
135
|
+
fileName: PropTypes.Requireable<string>;
|
|
136
|
+
forceProxy: PropTypes.Requireable<boolean>;
|
|
137
|
+
keywords: PropTypes.Requireable<string>;
|
|
138
|
+
landscape: PropTypes.Requireable<boolean>;
|
|
139
|
+
margin: PropTypes.Requireable<NonNullable<string | number | PropTypes.InferProps<{
|
|
140
|
+
left: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
141
|
+
top: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
142
|
+
right: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
143
|
+
bottom: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
144
|
+
}> | null | undefined>>;
|
|
145
|
+
pageTemplate: PropTypes.Requireable<any>;
|
|
146
|
+
paperSize: PropTypes.Requireable<any>;
|
|
147
|
+
repeatHeaders: PropTypes.Requireable<boolean>;
|
|
148
|
+
scale: PropTypes.Requireable<number>;
|
|
149
|
+
proxyData: PropTypes.Requireable<any>;
|
|
150
|
+
proxyURL: PropTypes.Requireable<string>;
|
|
151
|
+
proxyTarget: PropTypes.Requireable<string>;
|
|
152
|
+
producer: PropTypes.Requireable<string>;
|
|
153
|
+
subject: PropTypes.Requireable<string>;
|
|
154
|
+
title: PropTypes.Requireable<string>;
|
|
155
|
+
};
|
|
156
|
+
private rootElForPDF;
|
|
157
|
+
constructor(props: PDFExportProps);
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
161
|
+
render(): JSX_2.Element;
|
|
162
|
+
/**
|
|
163
|
+
* Saves the content as a PDF file.
|
|
164
|
+
*
|
|
165
|
+
* @param callback - The callback to be executed after the PDF is saved.
|
|
166
|
+
*/
|
|
167
|
+
save(callback?: () => void): void;
|
|
168
|
+
private getOptions;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Represents the props of the KendoReact PDFExport component.
|
|
173
|
+
*/
|
|
174
|
+
export declare interface PDFExportProps {
|
|
175
|
+
/**
|
|
176
|
+
* @hidden
|
|
177
|
+
*/
|
|
178
|
+
children?: React.ReactNode;
|
|
179
|
+
/**
|
|
180
|
+
* The author (metadata) of the PDF document.
|
|
181
|
+
*/
|
|
182
|
+
author?: string;
|
|
183
|
+
/**
|
|
184
|
+
* A flag that indicates whether to produce actual hyperlinks in the exported PDF file. It is also possible to set a CSS selector. All matching links will be ignored.
|
|
185
|
+
*/
|
|
186
|
+
avoidLinks?: boolean | string;
|
|
187
|
+
/**
|
|
188
|
+
* An optional CSS selector that specifies the elements which cause the page breaks.
|
|
189
|
+
*/
|
|
190
|
+
forcePageBreak?: string;
|
|
191
|
+
/**
|
|
192
|
+
* An optional CSS selector that specifies the elements which should not be split across the pages.
|
|
193
|
+
*/
|
|
194
|
+
keepTogether?: string;
|
|
195
|
+
/**
|
|
196
|
+
* The creator of the PDF document. Defaults to `KendoReact PDF Generator`.
|
|
197
|
+
*/
|
|
198
|
+
creator?: string;
|
|
199
|
+
/**
|
|
200
|
+
* The date when the PDF document is created. Defaults to `new Date()`.
|
|
201
|
+
*/
|
|
202
|
+
date?: Date;
|
|
203
|
+
/**
|
|
204
|
+
* The forced resolution of the images in the exported PDF document. By default, the images are exported at their full resolution.
|
|
205
|
+
*/
|
|
206
|
+
imageResolution?: number;
|
|
207
|
+
/**
|
|
208
|
+
* Specifies the name of the exported PDF file. Defaults to `export.pdf`.
|
|
209
|
+
*/
|
|
210
|
+
fileName?: string;
|
|
211
|
+
/**
|
|
212
|
+
* If set to `true`, the content is forwarded to `proxyURL` even if the browser supports local saving of files.
|
|
213
|
+
*/
|
|
214
|
+
forceProxy?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* The keywords (metadata) of the PDF document.
|
|
217
|
+
*/
|
|
218
|
+
keywords?: string;
|
|
219
|
+
/**
|
|
220
|
+
* A flag that indicates if the page will be in a landscape orientation. By default, the page is in a portrait orientation. Defaults to `false`.
|
|
221
|
+
*/
|
|
222
|
+
landscape?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Specifies the margins of the page.
|
|
225
|
+
*
|
|
226
|
+
* The supported units are:
|
|
227
|
+
* * `"mm"`
|
|
228
|
+
* * `"cm"`
|
|
229
|
+
* * `"in"`
|
|
230
|
+
* * `"pt"` (default).
|
|
231
|
+
*
|
|
232
|
+
* > Numbers are considered to be points (`"pt"`).
|
|
233
|
+
*/
|
|
234
|
+
margin?: string | number | PageMargin;
|
|
235
|
+
/**
|
|
236
|
+
* A React functional or class component which is used as a template that is inserted into each page of the PDF document. The number of the current page (`pageNum`) and the total number of pages (`totalPages`) are passed to the component as properties.
|
|
237
|
+
*/
|
|
238
|
+
pageTemplate?: any;
|
|
239
|
+
/**
|
|
240
|
+
* Specifies the paper size of the PDF document. Defaults to `"auto"` which means that the paper size is determined by the content. The size of the content in pixels matches the size of the output in points (1 pixel = 1/72 inch).
|
|
241
|
+
*
|
|
242
|
+
* If set, the content will be split across multiple pages. This enables the `repeatHeaders` and `scale` options, and allows you to specify a template.
|
|
243
|
+
*
|
|
244
|
+
* The supported values are:
|
|
245
|
+
* * A predefined size. The supported paper sizes are: `A0-A10`, `B0-B10`, `C0-C10`, `Executive`, `Folio`, `Legal`, `Letter`, `Tabloid`.
|
|
246
|
+
* * An array of two numbers which specify the width and height in points (1pt = 1/72in).
|
|
247
|
+
* * An array of two strings which specify the width and height in units. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"`.
|
|
248
|
+
*/
|
|
249
|
+
paperSize?: PaperSize;
|
|
250
|
+
/**
|
|
251
|
+
* Specifies if the `<thead>` elements of the tables will be repeated on each page.
|
|
252
|
+
*/
|
|
253
|
+
repeatHeaders?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* A scale factor. The text size on the screen might be too big for printing. To scale down the output in PDF, use this option. Defaults to `1`.
|
|
256
|
+
*/
|
|
257
|
+
scale?: number;
|
|
258
|
+
/**
|
|
259
|
+
* A key/value dictionary of form values which will be sent to the proxy. Can be used to submit Anti-Forgery tokens and other metadata.
|
|
260
|
+
*/
|
|
261
|
+
proxyData?: {
|
|
262
|
+
[key: string]: string;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* The URL of the server-side proxy which streams the file to the end user. You need to use a proxy if the browser is not capable of saving files locally—for example, Internet Explorer 9 and Safari. It is your responsibility to implement the server-side proxy.
|
|
266
|
+
*
|
|
267
|
+
* In the request body, the proxy receives a `POST` request with the following parameters:
|
|
268
|
+
* - `"contentType"`—The MIME type of the file.
|
|
269
|
+
* - `"base64"`—The base-64 encoded file content.
|
|
270
|
+
* - `"fileName"`—The file name, as requested by the caller.
|
|
271
|
+
*
|
|
272
|
+
* The proxy returns the decoded file with the `"Content-Disposition"` header set to `attachment;
|
|
273
|
+
* filename="<fileName.pdf>"`.
|
|
274
|
+
*/
|
|
275
|
+
proxyURL?: string;
|
|
276
|
+
/**
|
|
277
|
+
* A name or keyword which indicates where to display the document that is returned from the proxy. To display the document in a new window or iframe, the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`. Defaults to `_self`.
|
|
278
|
+
*/
|
|
279
|
+
proxyTarget?: string;
|
|
280
|
+
/**
|
|
281
|
+
* The producer (metadata) of the PDF document.
|
|
282
|
+
*/
|
|
283
|
+
producer?: string;
|
|
284
|
+
/**
|
|
285
|
+
* The subject (metadata) of the PDF document.
|
|
286
|
+
*/
|
|
287
|
+
subject?: string;
|
|
288
|
+
/**
|
|
289
|
+
* The title (metadata) of the PDF document.
|
|
290
|
+
*/
|
|
291
|
+
title?: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @hidden
|
|
296
|
+
*/
|
|
297
|
+
export declare class PDFMargin extends React_2.Component<PDFMarginProps, {}> {
|
|
298
|
+
static propTypes: {
|
|
299
|
+
left: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
300
|
+
top: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
301
|
+
right: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
302
|
+
bottom: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
303
|
+
};
|
|
304
|
+
render(): null;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Represents the props of the KendoReact PDFMargin component.
|
|
309
|
+
*/
|
|
310
|
+
export declare interface PDFMarginProps {
|
|
311
|
+
/**
|
|
312
|
+
* The bottom margin.
|
|
313
|
+
*
|
|
314
|
+
* The supported units are:
|
|
315
|
+
* * `"mm"`
|
|
316
|
+
* * `"cm"`
|
|
317
|
+
* * `"in"`
|
|
318
|
+
* * `"pt"` (default).
|
|
319
|
+
*
|
|
320
|
+
* > Numbers are considered to be points (`"pt"`).
|
|
321
|
+
*/
|
|
322
|
+
left?: number | string;
|
|
323
|
+
/**
|
|
324
|
+
* The top margin.
|
|
325
|
+
*
|
|
326
|
+
* The supported units are:
|
|
327
|
+
* * `"mm"`
|
|
328
|
+
* * `"cm"`
|
|
329
|
+
* * `"in"`
|
|
330
|
+
* * `"pt"` (default).
|
|
331
|
+
*
|
|
332
|
+
* > Numbers are considered to be points (`"pt"`).
|
|
333
|
+
*/
|
|
334
|
+
top?: number | string;
|
|
335
|
+
/**
|
|
336
|
+
* The right margin.
|
|
337
|
+
*
|
|
338
|
+
* The supported units are:
|
|
339
|
+
* * `"mm"`
|
|
340
|
+
* * `"cm"`
|
|
341
|
+
* * `"in"`
|
|
342
|
+
* * `"pt"` (default).
|
|
343
|
+
*
|
|
344
|
+
* > Numbers are considered to be points (`"pt"`).
|
|
345
|
+
*/
|
|
346
|
+
right?: number | string;
|
|
347
|
+
/**
|
|
348
|
+
* The bottom margin.
|
|
349
|
+
*
|
|
350
|
+
* The supported units are:
|
|
351
|
+
* * `"mm"`
|
|
352
|
+
* * `"cm"`
|
|
353
|
+
* * `"in"`
|
|
354
|
+
* * `"pt"` (default).
|
|
355
|
+
*
|
|
356
|
+
* > Numbers are considered to be points (`"pt"`).
|
|
357
|
+
*/
|
|
358
|
+
bottom?: number | string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Saves the content of a DOM element to a PDF file.
|
|
363
|
+
*
|
|
364
|
+
* @param domElement - The root DOM element to save to a PDF file.
|
|
365
|
+
* @param options - The export options.
|
|
366
|
+
* @param callback - The callback to be executed after the PDF is saved.
|
|
367
|
+
*/
|
|
368
|
+
export declare function savePDF(domElement: HTMLElement, options?: PDFExportProps, callback?: () => void): void;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* A React component which facilitates the PDF export of the TreeList.
|
|
372
|
+
*/
|
|
373
|
+
export declare class TreeListPDFExport extends React_2.Component<TreeListPDFExportProps, {}> {
|
|
374
|
+
/**
|
|
375
|
+
* @hidden
|
|
376
|
+
*/
|
|
377
|
+
static propTypes: {
|
|
378
|
+
author: PropTypes.Requireable<string>;
|
|
379
|
+
avoidLinks: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
380
|
+
forcePageBreak: PropTypes.Requireable<string>;
|
|
381
|
+
keepTogether: PropTypes.Requireable<string>;
|
|
382
|
+
creator: PropTypes.Requireable<string>;
|
|
383
|
+
date: PropTypes.Requireable<Date>;
|
|
384
|
+
imageResolution: PropTypes.Requireable<number>;
|
|
385
|
+
fileName: PropTypes.Requireable<string>;
|
|
386
|
+
forceProxy: PropTypes.Requireable<boolean>;
|
|
387
|
+
keywords: PropTypes.Requireable<string>;
|
|
388
|
+
landscape: PropTypes.Requireable<boolean>;
|
|
389
|
+
margin: PropTypes.Requireable<NonNullable<string | number | PropTypes.InferProps<{
|
|
390
|
+
left: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
391
|
+
top: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
392
|
+
right: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
393
|
+
bottom: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
394
|
+
}> | null | undefined>>;
|
|
395
|
+
pageTemplate: PropTypes.Requireable<any>;
|
|
396
|
+
paperSize: PropTypes.Requireable<any>;
|
|
397
|
+
repeatHeaders: PropTypes.Requireable<boolean>;
|
|
398
|
+
scale: PropTypes.Requireable<number>;
|
|
399
|
+
proxyData: PropTypes.Requireable<any>;
|
|
400
|
+
proxyURL: PropTypes.Requireable<string>;
|
|
401
|
+
proxyTarget: PropTypes.Requireable<string>;
|
|
402
|
+
producer: PropTypes.Requireable<string>;
|
|
403
|
+
subject: PropTypes.Requireable<string>;
|
|
404
|
+
title: PropTypes.Requireable<string>;
|
|
405
|
+
allPages: PropTypes.Requireable<boolean>;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* @hidden
|
|
409
|
+
*/
|
|
410
|
+
saveTreeListPDF: any;
|
|
411
|
+
constructor(props: any);
|
|
412
|
+
/**
|
|
413
|
+
* @hidden
|
|
414
|
+
*/
|
|
415
|
+
render(): null;
|
|
416
|
+
/**
|
|
417
|
+
* Saves the content of the TreeList as a PDF file.
|
|
418
|
+
*
|
|
419
|
+
* @param data - The data that will be exported to the PDF. The data can be different from the currently displayed data in the TreeList.
|
|
420
|
+
* @param columns - The columns that will be exported to the PDF. The columns collection can be different from the currently displayed in the TreeList.
|
|
421
|
+
* @param callback - The callback that will be executed after the PDF is saved.
|
|
422
|
+
*/
|
|
423
|
+
save(data?: any[], columns?: any[], callback?: () => void): void;
|
|
424
|
+
protected getSavePDF(): typeof savePDF;
|
|
425
|
+
private getTreeList;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* The props of the TreeListPDFExport component
|
|
430
|
+
* ([more information and examples in the documentation on PDF export]({% slug overview_pdfexport_treelist %})).
|
|
431
|
+
*/
|
|
432
|
+
export declare interface TreeListPDFExportProps extends PDFExportProps {
|
|
433
|
+
/**
|
|
434
|
+
* If set to true it will export all pages of the TreeList data. By default allPages is set to `false`.
|
|
435
|
+
*/
|
|
436
|
+
allPages?: boolean;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export { }
|