@progress/kendo-angular-pdf-export 3.0.3 → 4.0.0-next.202203101659

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.
Files changed (47) hide show
  1. package/bundles/kendo-angular-pdf-export.umd.js +5 -0
  2. package/{dist/es2015/compile-template.d.ts → compile-template.d.ts} +0 -0
  3. package/{dist/es2015 → esm2015}/compile-template.js +0 -0
  4. package/{dist/es/index.js → esm2015/kendo-angular-pdf-export.js} +0 -0
  5. package/{dist/es → esm2015}/main.js +0 -0
  6. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  7. package/esm2015/pdf-export-margin.component.js +43 -0
  8. package/esm2015/pdf-export-template.directive.js +21 -0
  9. package/{dist/es2015 → esm2015}/pdf-export.component.js +63 -108
  10. package/esm2015/pdf-export.module.js +33 -0
  11. package/fesm2015/kendo-angular-pdf-export.js +318 -0
  12. package/{dist/es2015/index.js → kendo-angular-pdf-export.d.ts} +1 -0
  13. package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
  14. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  15. package/package.json +32 -100
  16. package/{dist/es2015/pdf-export-margin.component.d.ts → pdf-export-margin.component.d.ts} +4 -1
  17. package/{dist/es2015/pdf-export-template.directive.d.ts → pdf-export-template.directive.d.ts} +3 -0
  18. package/{dist/es2015/pdf-export.component.d.ts → pdf-export.component.d.ts} +4 -1
  19. package/pdf-export.module.d.ts +16 -0
  20. package/schematics/ngAdd/index.js +5 -2
  21. package/schematics/ngAdd/index.js.map +1 -1
  22. package/dist/cdn/js/kendo-angular-pdf-export.js +0 -20
  23. package/dist/cdn/main.js +0 -5
  24. package/dist/es/compile-template.js +0 -25
  25. package/dist/es/package-metadata.js +0 -15
  26. package/dist/es/pdf-export-margin.component.js +0 -56
  27. package/dist/es/pdf-export-template.directive.js +0 -20
  28. package/dist/es/pdf-export.component.js +0 -253
  29. package/dist/es/pdf-export.module.js +0 -29
  30. package/dist/es2015/index.d.ts +0 -8
  31. package/dist/es2015/index.metadata.json +0 -1
  32. package/dist/es2015/main.js +0 -9
  33. package/dist/es2015/pdf-export-margin.component.js +0 -49
  34. package/dist/es2015/pdf-export-template.directive.js +0 -19
  35. package/dist/es2015/pdf-export.module.d.ts +0 -9
  36. package/dist/es2015/pdf-export.module.js +0 -26
  37. package/dist/fesm2015/index.js +0 -355
  38. package/dist/fesm5/index.js +0 -373
  39. package/dist/npm/compile-template.js +0 -27
  40. package/dist/npm/index.js +0 -11
  41. package/dist/npm/main.js +0 -16
  42. package/dist/npm/package-metadata.js +0 -17
  43. package/dist/npm/pdf-export-margin.component.js +0 -58
  44. package/dist/npm/pdf-export-template.directive.js +0 -22
  45. package/dist/npm/pdf-export.component.js +0 -255
  46. package/dist/npm/pdf-export.module.js +0 -31
  47. package/dist/systemjs/kendo-angular-pdf-export.js +0 -5
@@ -1,373 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { __decorate, __param, __metadata } from 'tslib';
6
- import { Directive, Optional, TemplateRef, Input, Component, ContentChild, ElementRef, NgModule } from '@angular/core';
7
- import { drawDOM, exportPDF } from '@progress/kendo-drawing';
8
- import { saveAs } from '@progress/kendo-file-saver';
9
- import { validatePackage } from '@progress/kendo-licensing';
10
-
11
- /**
12
- * @hidden
13
- */
14
- var packageMetadata = {
15
- name: '@progress/kendo-angular-pdf-export',
16
- productName: 'Kendo UI for Angular',
17
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
18
- publishDate: 1642581367,
19
- version: '',
20
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
21
- };
22
-
23
- var PDFExportTemplateDirective = /** @class */ (function () {
24
- function PDFExportTemplateDirective(templateRef) {
25
- this.templateRef = templateRef;
26
- }
27
- PDFExportTemplateDirective = __decorate([
28
- Directive({
29
- selector: '[kendoPDFTemplate]'
30
- }),
31
- __param(0, Optional()),
32
- __metadata("design:paramtypes", [TemplateRef])
33
- ], PDFExportTemplateDirective);
34
- return PDFExportTemplateDirective;
35
- }());
36
-
37
- var FIELDS = ['bottom', 'left', 'right', 'top'];
38
- /**
39
- * Represents the Kendo UI PDFMargin component for Angular.
40
- */
41
- var PDFExportMarginComponent = /** @class */ (function () {
42
- function PDFExportMarginComponent() {
43
- }
44
- Object.defineProperty(PDFExportMarginComponent.prototype, "options", {
45
- /**
46
- * @hidden
47
- */
48
- get: function () {
49
- var options = {};
50
- for (var idx = 0; idx < FIELDS.length; idx++) {
51
- var field = FIELDS[idx];
52
- var value = this[field];
53
- if (typeof value !== 'undefined') {
54
- options[field] = value;
55
- }
56
- }
57
- return options;
58
- },
59
- enumerable: true,
60
- configurable: true
61
- });
62
- __decorate([
63
- Input(),
64
- __metadata("design:type", Object)
65
- ], PDFExportMarginComponent.prototype, "left", void 0);
66
- __decorate([
67
- Input(),
68
- __metadata("design:type", Object)
69
- ], PDFExportMarginComponent.prototype, "top", void 0);
70
- __decorate([
71
- Input(),
72
- __metadata("design:type", Object)
73
- ], PDFExportMarginComponent.prototype, "right", void 0);
74
- __decorate([
75
- Input(),
76
- __metadata("design:type", Object)
77
- ], PDFExportMarginComponent.prototype, "bottom", void 0);
78
- PDFExportMarginComponent = __decorate([
79
- Component({
80
- selector: 'kendo-pdf-export-margin',
81
- template: ""
82
- })
83
- ], PDFExportMarginComponent);
84
- return PDFExportMarginComponent;
85
- }());
86
-
87
- /**
88
- * @hidden
89
- */
90
- var compileTemplate = function (templateRef) {
91
- var context = {};
92
- var embeddedView = templateRef.createEmbeddedView(context);
93
- var result = function (data) {
94
- Object.assign(context, data);
95
- embeddedView.detectChanges();
96
- var templateWrap = document.createElement('span');
97
- embeddedView.rootNodes.forEach(function (rootNode) {
98
- templateWrap.appendChild(rootNode.cloneNode(true));
99
- });
100
- return templateWrap;
101
- };
102
- result.destroy = function () {
103
- embeddedView.destroy();
104
- embeddedView = null;
105
- };
106
- return result;
107
- };
108
-
109
- /**
110
- * Represents the [Kendo UI PDF Export component for Angular]({% slug overview_pdfexport %}).
111
- *
112
- * @example
113
- * ```ts-preview
114
- * _@Component({
115
- * selector: 'my-app',
116
- * template: `
117
- * <div class="example-config">
118
- * <button kendoButton (click)="pdf.saveAs('document.pdf')">
119
- * Save As PDF...
120
- * </button>
121
- * </div>
122
- *
123
- * <kendo-pdf-export #pdf paperSize="A4" margin="2cm">
124
- * Content goes here
125
- * </kendo-pdf-export>
126
- * `
127
- * })
128
- * export class AppComponent {
129
- * }
130
- * ```
131
- */
132
- var PDFExportComponent = /** @class */ (function () {
133
- function PDFExportComponent(element) {
134
- this.element = element;
135
- /**
136
- * The creator of the PDF document.
137
- * @default "Kendo UI PDF Generator"
138
- */
139
- this.creator = 'Kendo UI PDF Generator';
140
- /**
141
- * Specifies the name of the exported PDF file.
142
- * @default "Export.pdf"
143
- */
144
- this.fileName = 'export.pdf';
145
- validatePackage(packageMetadata);
146
- }
147
- Object.defineProperty(PDFExportComponent.prototype, "drawMargin", {
148
- get: function () {
149
- var marginComponent = this.marginComponent;
150
- var margin = this.margin;
151
- if (marginComponent) {
152
- margin = Object.assign(margin || {}, marginComponent.options);
153
- }
154
- return margin;
155
- },
156
- enumerable: true,
157
- configurable: true
158
- });
159
- /**
160
- * Saves the content as a PDF file with the specified name.
161
- * @param fileName - The name of the exported file.
162
- */
163
- PDFExportComponent.prototype.saveAs = function (fileName) {
164
- if (fileName === void 0) { fileName = this.fileName; }
165
- this.save(this.element.nativeElement, fileName);
166
- };
167
- /**
168
- * Exports the content as a `Group` for further processing.
169
- *
170
- * @return - The root group of the exported scene.
171
- */
172
- PDFExportComponent.prototype.export = function () {
173
- return this.exportElement(this.element.nativeElement);
174
- };
175
- PDFExportComponent.prototype.save = function (element, fileName) {
176
- var _this = this;
177
- this.exportElement(element)
178
- .then(function (group) { return _this.exportGroup(group, _this.pdfOptions()); })
179
- .then(function (dataUri) { return _this.saveDataUri(dataUri, fileName, _this.saveOptions()); });
180
- };
181
- PDFExportComponent.prototype.exportElement = function (element) {
182
- var promise = this.drawElement(element, this.drawOptions());
183
- var cleanup = this.cleanup.bind(this);
184
- promise.then(cleanup, cleanup);
185
- return promise;
186
- };
187
- PDFExportComponent.prototype.cleanup = function () {
188
- if (this.pageTemplate) {
189
- this.pageTemplate.destroy();
190
- delete this.pageTemplate;
191
- }
192
- };
193
- PDFExportComponent.prototype.drawOptions = function () {
194
- if (this.pageTemplateDirective) {
195
- this.pageTemplate = compileTemplate(this.pageTemplateDirective.templateRef);
196
- }
197
- return {
198
- avoidLinks: this.avoidLinks,
199
- forcePageBreak: this.forcePageBreak,
200
- keepTogether: this.keepTogether,
201
- margin: this.drawMargin,
202
- paperSize: this.paperSize,
203
- landscape: this.landscape,
204
- repeatHeaders: this.repeatHeaders,
205
- scale: this.scale,
206
- template: this.pageTemplate
207
- };
208
- };
209
- PDFExportComponent.prototype.pdfOptions = function () {
210
- return {
211
- autoPrint: this.autoPrint,
212
- author: this.author,
213
- creator: this.creator,
214
- date: this.date,
215
- imgDPI: this.imageResolution,
216
- keywords: this.keywords,
217
- landscape: this.landscape,
218
- margin: this.drawMargin,
219
- multiPage: true,
220
- paperSize: this.paperSize,
221
- producer: this.producer,
222
- subject: this.subject,
223
- title: this.title
224
- };
225
- };
226
- PDFExportComponent.prototype.saveOptions = function () {
227
- return {
228
- forceProxy: this.forceProxy,
229
- proxyData: this.proxyData,
230
- proxyTarget: this.proxyTarget,
231
- proxyURL: this.proxyURL
232
- };
233
- };
234
- PDFExportComponent.prototype.drawElement = function (element, options) {
235
- return drawDOM(element, options);
236
- };
237
- PDFExportComponent.prototype.exportGroup = function (group, options) {
238
- return exportPDF(group, options);
239
- };
240
- PDFExportComponent.prototype.saveDataUri = function (dataUri, fileName, options) {
241
- saveAs(dataUri, fileName, options);
242
- };
243
- __decorate([
244
- Input(),
245
- __metadata("design:type", Boolean)
246
- ], PDFExportComponent.prototype, "autoPrint", void 0);
247
- __decorate([
248
- Input(),
249
- __metadata("design:type", String)
250
- ], PDFExportComponent.prototype, "author", void 0);
251
- __decorate([
252
- Input(),
253
- __metadata("design:type", Object)
254
- ], PDFExportComponent.prototype, "avoidLinks", void 0);
255
- __decorate([
256
- Input(),
257
- __metadata("design:type", String)
258
- ], PDFExportComponent.prototype, "forcePageBreak", void 0);
259
- __decorate([
260
- Input(),
261
- __metadata("design:type", String)
262
- ], PDFExportComponent.prototype, "keepTogether", void 0);
263
- __decorate([
264
- Input(),
265
- __metadata("design:type", String)
266
- ], PDFExportComponent.prototype, "creator", void 0);
267
- __decorate([
268
- Input(),
269
- __metadata("design:type", Date)
270
- ], PDFExportComponent.prototype, "date", void 0);
271
- __decorate([
272
- Input(),
273
- __metadata("design:type", Number)
274
- ], PDFExportComponent.prototype, "imageResolution", void 0);
275
- __decorate([
276
- Input(),
277
- __metadata("design:type", String)
278
- ], PDFExportComponent.prototype, "fileName", void 0);
279
- __decorate([
280
- Input(),
281
- __metadata("design:type", Boolean)
282
- ], PDFExportComponent.prototype, "forceProxy", void 0);
283
- __decorate([
284
- Input(),
285
- __metadata("design:type", String)
286
- ], PDFExportComponent.prototype, "keywords", void 0);
287
- __decorate([
288
- Input(),
289
- __metadata("design:type", Boolean)
290
- ], PDFExportComponent.prototype, "landscape", void 0);
291
- __decorate([
292
- Input(),
293
- __metadata("design:type", Object)
294
- ], PDFExportComponent.prototype, "margin", void 0);
295
- __decorate([
296
- Input(),
297
- __metadata("design:type", Object)
298
- ], PDFExportComponent.prototype, "paperSize", void 0);
299
- __decorate([
300
- Input(),
301
- __metadata("design:type", Boolean)
302
- ], PDFExportComponent.prototype, "repeatHeaders", void 0);
303
- __decorate([
304
- Input(),
305
- __metadata("design:type", Number)
306
- ], PDFExportComponent.prototype, "scale", void 0);
307
- __decorate([
308
- Input(),
309
- __metadata("design:type", Object)
310
- ], PDFExportComponent.prototype, "proxyData", void 0);
311
- __decorate([
312
- Input(),
313
- __metadata("design:type", String)
314
- ], PDFExportComponent.prototype, "proxyURL", void 0);
315
- __decorate([
316
- Input(),
317
- __metadata("design:type", String)
318
- ], PDFExportComponent.prototype, "proxyTarget", void 0);
319
- __decorate([
320
- Input(),
321
- __metadata("design:type", String)
322
- ], PDFExportComponent.prototype, "producer", void 0);
323
- __decorate([
324
- Input(),
325
- __metadata("design:type", String)
326
- ], PDFExportComponent.prototype, "subject", void 0);
327
- __decorate([
328
- Input(),
329
- __metadata("design:type", String)
330
- ], PDFExportComponent.prototype, "title", void 0);
331
- __decorate([
332
- ContentChild(PDFExportTemplateDirective, { static: false }),
333
- __metadata("design:type", PDFExportTemplateDirective)
334
- ], PDFExportComponent.prototype, "pageTemplateDirective", void 0);
335
- __decorate([
336
- ContentChild(PDFExportMarginComponent, { static: false }),
337
- __metadata("design:type", PDFExportMarginComponent)
338
- ], PDFExportComponent.prototype, "marginComponent", void 0);
339
- PDFExportComponent = __decorate([
340
- Component({
341
- selector: 'kendo-pdf-export',
342
- template: "<div><ng-content></ng-content></div>"
343
- }),
344
- __metadata("design:paramtypes", [ElementRef])
345
- ], PDFExportComponent);
346
- return PDFExportComponent;
347
- }());
348
-
349
- var COMPONENT_DIRECTIVES = [
350
- PDFExportComponent,
351
- PDFExportMarginComponent,
352
- PDFExportTemplateDirective
353
- ];
354
- /**
355
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the PDF Export directive.
356
- */
357
- var PDFExportModule = /** @class */ (function () {
358
- function PDFExportModule() {
359
- }
360
- PDFExportModule = __decorate([
361
- NgModule({
362
- declarations: [COMPONENT_DIRECTIVES],
363
- exports: [COMPONENT_DIRECTIVES]
364
- })
365
- ], PDFExportModule);
366
- return PDFExportModule;
367
- }());
368
-
369
- /**
370
- * Generated bundle index. Do not edit.
371
- */
372
-
373
- export { PDFExportComponent, PDFExportModule, PDFExportMarginComponent, PDFExportTemplateDirective, compileTemplate };
@@ -1,27 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /**
8
- * @hidden
9
- */
10
- exports.compileTemplate = function (templateRef) {
11
- var context = {};
12
- var embeddedView = templateRef.createEmbeddedView(context);
13
- var result = function (data) {
14
- Object.assign(context, data);
15
- embeddedView.detectChanges();
16
- var templateWrap = document.createElement('span');
17
- embeddedView.rootNodes.forEach(function (rootNode) {
18
- templateWrap.appendChild(rootNode.cloneNode(true));
19
- });
20
- return templateWrap;
21
- };
22
- result.destroy = function () {
23
- embeddedView.destroy();
24
- embeddedView = null;
25
- };
26
- return result;
27
- };
package/dist/npm/index.js DELETED
@@ -1,11 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- /**
7
- * Generated bundle index. Do not edit.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- var tslib_1 = require("tslib");
11
- tslib_1.__exportStar(require("./main"), exports);
package/dist/npm/main.js DELETED
@@ -1,16 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var pdf_export_component_1 = require("./pdf-export.component");
8
- exports.PDFExportComponent = pdf_export_component_1.PDFExportComponent;
9
- var pdf_export_module_1 = require("./pdf-export.module");
10
- exports.PDFExportModule = pdf_export_module_1.PDFExportModule;
11
- var pdf_export_margin_component_1 = require("./pdf-export-margin.component");
12
- exports.PDFExportMarginComponent = pdf_export_margin_component_1.PDFExportMarginComponent;
13
- var pdf_export_template_directive_1 = require("./pdf-export-template.directive");
14
- exports.PDFExportTemplateDirective = pdf_export_template_directive_1.PDFExportTemplateDirective;
15
- var compile_template_1 = require("./compile-template");
16
- exports.compileTemplate = compile_template_1.compileTemplate;
@@ -1,17 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /**
8
- * @hidden
9
- */
10
- exports.packageMetadata = {
11
- name: '@progress/kendo-angular-pdf-export',
12
- productName: 'Kendo UI for Angular',
13
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
14
- publishDate: 1642581367,
15
- version: '',
16
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
17
- };
@@ -1,58 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var FIELDS = ['bottom', 'left', 'right', 'top'];
10
- /**
11
- * Represents the Kendo UI PDFMargin component for Angular.
12
- */
13
- var PDFExportMarginComponent = /** @class */ (function () {
14
- function PDFExportMarginComponent() {
15
- }
16
- Object.defineProperty(PDFExportMarginComponent.prototype, "options", {
17
- /**
18
- * @hidden
19
- */
20
- get: function () {
21
- var options = {};
22
- for (var idx = 0; idx < FIELDS.length; idx++) {
23
- var field = FIELDS[idx];
24
- var value = this[field];
25
- if (typeof value !== 'undefined') {
26
- options[field] = value;
27
- }
28
- }
29
- return options;
30
- },
31
- enumerable: true,
32
- configurable: true
33
- });
34
- tslib_1.__decorate([
35
- core_1.Input(),
36
- tslib_1.__metadata("design:type", Object)
37
- ], PDFExportMarginComponent.prototype, "left", void 0);
38
- tslib_1.__decorate([
39
- core_1.Input(),
40
- tslib_1.__metadata("design:type", Object)
41
- ], PDFExportMarginComponent.prototype, "top", void 0);
42
- tslib_1.__decorate([
43
- core_1.Input(),
44
- tslib_1.__metadata("design:type", Object)
45
- ], PDFExportMarginComponent.prototype, "right", void 0);
46
- tslib_1.__decorate([
47
- core_1.Input(),
48
- tslib_1.__metadata("design:type", Object)
49
- ], PDFExportMarginComponent.prototype, "bottom", void 0);
50
- PDFExportMarginComponent = tslib_1.__decorate([
51
- core_1.Component({
52
- selector: 'kendo-pdf-export-margin',
53
- template: ""
54
- })
55
- ], PDFExportMarginComponent);
56
- return PDFExportMarginComponent;
57
- }());
58
- exports.PDFExportMarginComponent = PDFExportMarginComponent;
@@ -1,22 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var PDFExportTemplateDirective = /** @class */ (function () {
10
- function PDFExportTemplateDirective(templateRef) {
11
- this.templateRef = templateRef;
12
- }
13
- PDFExportTemplateDirective = tslib_1.__decorate([
14
- core_1.Directive({
15
- selector: '[kendoPDFTemplate]'
16
- }),
17
- tslib_1.__param(0, core_1.Optional()),
18
- tslib_1.__metadata("design:paramtypes", [core_1.TemplateRef])
19
- ], PDFExportTemplateDirective);
20
- return PDFExportTemplateDirective;
21
- }());
22
- exports.PDFExportTemplateDirective = PDFExportTemplateDirective;