@progress/kendo-angular-pdf-export 3.0.3 → 4.0.0-dev.202204131901

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 +33 -101
  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
@@ -0,0 +1,5 @@
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
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@progress/kendo-drawing"),require("@progress/kendo-file-saver"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define("KendoAngularPdfExport",["exports","@angular/core","@progress/kendo-drawing","@progress/kendo-file-saver","@progress/kendo-licensing"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoAngularPdfExport={},e.ng.core,e.KendoDrawing,e.KendoFileSaver,e.KendoLicensing)}(this,function(e,t,r,n,o){"use strict";function a(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var p=a(t),i={name:"@progress/kendo-angular-pdf-export",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1649876476,version:"",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"},s=function(e){this.templateRef=e},c=(s.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:s,deps:[{token:p.TemplateRef,optional:!0}],target:p.ɵɵFactoryTarget.Directive}),s.ɵdir=p.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:s,selector:"[kendoPDFTemplate]",ngImport:p}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:s,decorators:[{type:t.Directive,args:[{selector:"[kendoPDFTemplate]"}]}],ctorParameters:function(){return[{type:p.TemplateRef,decorators:[{type:t.Optional}]}]}}),["bottom","left","right","top"]),u=(Object.defineProperty(l.prototype,"options",{get:function(){for(var e={},t=0;t<c.length;t++){var r=c[t],n=this[r];void 0!==n&&(e[r]=n)}return e},enumerable:!1,configurable:!0}),l);function l(){}u.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:u,deps:[],target:p.ɵɵFactoryTarget.Component}),u.ɵcmp=p.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:u,selector:"kendo-pdf-export-margin",inputs:{left:"left",top:"top",right:"right",bottom:"bottom"},ngImport:p,template:"",isInline:!0}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:u,decorators:[{type:t.Component,args:[{selector:"kendo-pdf-export-margin",template:""}]}],propDecorators:{left:[{type:t.Input}],top:[{type:t.Input}],right:[{type:t.Input}],bottom:[{type:t.Input}]}});function d(e){function t(e){Object.assign(r,e),n.detectChanges();var t=document.createElement("span");return n.rootNodes.forEach(function(e){t.appendChild(e.cloneNode(!0))}),t}var r={},n=e.createEmbeddedView(r);return t.destroy=function(){n.destroy(),n=null},t}Object.defineProperty(m.prototype,"drawMargin",{get:function(){var e=this.marginComponent,t=this.margin;return t=e?Object.assign(t||{},e.options):t},enumerable:!1,configurable:!0}),m.prototype.saveAs=function(e){void 0===e&&(e=this.fileName),this.save(this.element.nativeElement,e)},m.prototype.export=function(){return this.exportElement(this.element.nativeElement)},m.prototype.save=function(e,t){var r=this;this.exportElement(e).then(function(e){return r.exportGroup(e,r.pdfOptions())}).then(function(e){return r.saveDataUri(e,t,r.saveOptions())})},m.prototype.exportElement=function(e){var e=this.drawElement(e,this.drawOptions()),t=this.cleanup.bind(this);return e.then(t,t),e},m.prototype.cleanup=function(){this.pageTemplate&&(this.pageTemplate.destroy(),delete this.pageTemplate)},m.prototype.drawOptions=function(){return this.pageTemplateDirective&&(this.pageTemplate=d(this.pageTemplateDirective.templateRef)),{avoidLinks:this.avoidLinks,forcePageBreak:this.forcePageBreak,keepTogether:this.keepTogether,margin:this.drawMargin,paperSize:this.paperSize,landscape:this.landscape,repeatHeaders:this.repeatHeaders,scale:this.scale,template:this.pageTemplate}},m.prototype.pdfOptions=function(){return{autoPrint:this.autoPrint,author:this.author,creator:this.creator,date:this.date,imgDPI:this.imageResolution,keywords:this.keywords,landscape:this.landscape,margin:this.drawMargin,multiPage:!0,paperSize:this.paperSize,producer:this.producer,subject:this.subject,title:this.title}},m.prototype.saveOptions=function(){return{forceProxy:this.forceProxy,proxyData:this.proxyData,proxyTarget:this.proxyTarget,proxyURL:this.proxyURL}},m.prototype.drawElement=function(e,t){return r.drawDOM(e,t)},m.prototype.exportGroup=function(e,t){return r.exportPDF(e,t)},m.prototype.saveDataUri=function(e,t,r){n.saveAs(e,t,r)};var g=m;function m(e){this.element=e,this.creator="Kendo UI PDF Generator",this.fileName="export.pdf",o.validatePackage(i)}g.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:g,deps:[{token:p.ElementRef}],target:p.ɵɵFactoryTarget.Component}),g.ɵcmp=p.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:g,selector:"kendo-pdf-export",inputs:{autoPrint:"autoPrint",author:"author",avoidLinks:"avoidLinks",forcePageBreak:"forcePageBreak",keepTogether:"keepTogether",creator:"creator",date:"date",imageResolution:"imageResolution",fileName:"fileName",forceProxy:"forceProxy",keywords:"keywords",landscape:"landscape",margin:"margin",paperSize:"paperSize",repeatHeaders:"repeatHeaders",scale:"scale",proxyData:"proxyData",proxyURL:"proxyURL",proxyTarget:"proxyTarget",producer:"producer",subject:"subject",title:"title"},queries:[{propertyName:"pageTemplateDirective",first:!0,predicate:s,descendants:!0},{propertyName:"marginComponent",first:!0,predicate:u,descendants:!0}],ngImport:p,template:"<div><ng-content></ng-content></div>",isInline:!0}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:g,decorators:[{type:t.Component,args:[{selector:"kendo-pdf-export",template:"<div><ng-content></ng-content></div>"}]}],ctorParameters:function(){return[{type:p.ElementRef}]},propDecorators:{autoPrint:[{type:t.Input}],author:[{type:t.Input}],avoidLinks:[{type:t.Input}],forcePageBreak:[{type:t.Input}],keepTogether:[{type:t.Input}],creator:[{type:t.Input}],date:[{type:t.Input}],imageResolution:[{type:t.Input}],fileName:[{type:t.Input}],forceProxy:[{type:t.Input}],keywords:[{type:t.Input}],landscape:[{type:t.Input}],margin:[{type:t.Input}],paperSize:[{type:t.Input}],repeatHeaders:[{type:t.Input}],scale:[{type:t.Input}],proxyData:[{type:t.Input}],proxyURL:[{type:t.Input}],proxyTarget:[{type:t.Input}],producer:[{type:t.Input}],subject:[{type:t.Input}],title:[{type:t.Input}],pageTemplateDirective:[{type:t.ContentChild,args:[s,{static:!1}]}],marginComponent:[{type:t.ContentChild,args:[u,{static:!1}]}]}});var y=[g,u,s],f=function(){};f.ɵfac=p.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:f,deps:[],target:p.ɵɵFactoryTarget.NgModule}),f.ɵmod=p.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:f,declarations:[g,u,s],exports:[g,u,s]}),f.ɵinj=p.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:f}),p.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:p,type:f,decorators:[{type:t.NgModule,args:[{declarations:[y],exports:[y]}]}]}),e.PDFExportComponent=g,e.PDFExportMarginComponent=u,e.PDFExportModule=f,e.PDFExportTemplateDirective=s,e.compileTemplate=d,Object.defineProperty(e,"__esModule",{value:!0})});
File without changes
File without changes
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-pdf-export',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1642581367,
12
+ publishDate: 1649876476,
13
13
  version: '',
14
14
  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'
15
15
  };
@@ -0,0 +1,43 @@
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 { Component, Input } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ const FIELDS = ['bottom', 'left', 'right', 'top'];
8
+ /**
9
+ * Represents the Kendo UI PDFMargin component for Angular.
10
+ */
11
+ export class PDFExportMarginComponent {
12
+ /**
13
+ * @hidden
14
+ */
15
+ get options() {
16
+ const options = {};
17
+ for (let idx = 0; idx < FIELDS.length; idx++) {
18
+ const field = FIELDS[idx];
19
+ const value = this[field];
20
+ if (typeof value !== 'undefined') {
21
+ options[field] = value;
22
+ }
23
+ }
24
+ return options;
25
+ }
26
+ }
27
+ PDFExportMarginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportMarginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28
+ PDFExportMarginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportMarginComponent, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
30
+ type: Component,
31
+ args: [{
32
+ selector: 'kendo-pdf-export-margin',
33
+ template: ``
34
+ }]
35
+ }], propDecorators: { left: [{
36
+ type: Input
37
+ }], top: [{
38
+ type: Input
39
+ }], right: [{
40
+ type: Input
41
+ }], bottom: [{
42
+ type: Input
43
+ }] } });
@@ -0,0 +1,21 @@
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 { Directive, Optional } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ export class PDFExportTemplateDirective {
8
+ constructor(templateRef) {
9
+ this.templateRef = templateRef;
10
+ }
11
+ }
12
+ PDFExportTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
13
+ PDFExportTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportTemplateDirective, selector: "[kendoPDFTemplate]", ngImport: i0 });
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
15
+ type: Directive,
16
+ args: [{
17
+ selector: '[kendoPDFTemplate]'
18
+ }]
19
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
20
+ type: Optional
21
+ }] }]; } });
@@ -2,8 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Component, ContentChild, ElementRef, Input } from '@angular/core';
5
+ import { Component, ContentChild, Input } from '@angular/core';
7
6
  import { drawDOM, exportPDF } from '@progress/kendo-drawing';
8
7
  import { saveAs } from '@progress/kendo-file-saver';
9
8
  import { validatePackage } from '@progress/kendo-licensing';
@@ -11,6 +10,7 @@ import { packageMetadata } from './package-metadata';
11
10
  import { PDFExportTemplateDirective } from './pdf-export-template.directive';
12
11
  import { PDFExportMarginComponent } from './pdf-export-margin.component';
13
12
  import { compileTemplate } from './compile-template';
13
+ import * as i0 from "@angular/core";
14
14
  /**
15
15
  * Represents the [Kendo UI PDF Export component for Angular]({% slug overview_pdfexport %}).
16
16
  *
@@ -34,7 +34,7 @@ import { compileTemplate } from './compile-template';
34
34
  * }
35
35
  * ```
36
36
  */
37
- let PDFExportComponent = class PDFExportComponent {
37
+ export class PDFExportComponent {
38
38
  constructor(element) {
39
39
  this.element = element;
40
40
  /**
@@ -139,108 +139,63 @@ let PDFExportComponent = class PDFExportComponent {
139
139
  saveDataUri(dataUri, fileName, options) {
140
140
  saveAs(dataUri, fileName, options);
141
141
  }
142
- };
143
- tslib_1.__decorate([
144
- Input(),
145
- tslib_1.__metadata("design:type", Boolean)
146
- ], PDFExportComponent.prototype, "autoPrint", void 0);
147
- tslib_1.__decorate([
148
- Input(),
149
- tslib_1.__metadata("design:type", String)
150
- ], PDFExportComponent.prototype, "author", void 0);
151
- tslib_1.__decorate([
152
- Input(),
153
- tslib_1.__metadata("design:type", Object)
154
- ], PDFExportComponent.prototype, "avoidLinks", void 0);
155
- tslib_1.__decorate([
156
- Input(),
157
- tslib_1.__metadata("design:type", String)
158
- ], PDFExportComponent.prototype, "forcePageBreak", void 0);
159
- tslib_1.__decorate([
160
- Input(),
161
- tslib_1.__metadata("design:type", String)
162
- ], PDFExportComponent.prototype, "keepTogether", void 0);
163
- tslib_1.__decorate([
164
- Input(),
165
- tslib_1.__metadata("design:type", String)
166
- ], PDFExportComponent.prototype, "creator", void 0);
167
- tslib_1.__decorate([
168
- Input(),
169
- tslib_1.__metadata("design:type", Date)
170
- ], PDFExportComponent.prototype, "date", void 0);
171
- tslib_1.__decorate([
172
- Input(),
173
- tslib_1.__metadata("design:type", Number)
174
- ], PDFExportComponent.prototype, "imageResolution", void 0);
175
- tslib_1.__decorate([
176
- Input(),
177
- tslib_1.__metadata("design:type", String)
178
- ], PDFExportComponent.prototype, "fileName", void 0);
179
- tslib_1.__decorate([
180
- Input(),
181
- tslib_1.__metadata("design:type", Boolean)
182
- ], PDFExportComponent.prototype, "forceProxy", void 0);
183
- tslib_1.__decorate([
184
- Input(),
185
- tslib_1.__metadata("design:type", String)
186
- ], PDFExportComponent.prototype, "keywords", void 0);
187
- tslib_1.__decorate([
188
- Input(),
189
- tslib_1.__metadata("design:type", Boolean)
190
- ], PDFExportComponent.prototype, "landscape", void 0);
191
- tslib_1.__decorate([
192
- Input(),
193
- tslib_1.__metadata("design:type", Object)
194
- ], PDFExportComponent.prototype, "margin", void 0);
195
- tslib_1.__decorate([
196
- Input(),
197
- tslib_1.__metadata("design:type", Object)
198
- ], PDFExportComponent.prototype, "paperSize", void 0);
199
- tslib_1.__decorate([
200
- Input(),
201
- tslib_1.__metadata("design:type", Boolean)
202
- ], PDFExportComponent.prototype, "repeatHeaders", void 0);
203
- tslib_1.__decorate([
204
- Input(),
205
- tslib_1.__metadata("design:type", Number)
206
- ], PDFExportComponent.prototype, "scale", void 0);
207
- tslib_1.__decorate([
208
- Input(),
209
- tslib_1.__metadata("design:type", Object)
210
- ], PDFExportComponent.prototype, "proxyData", void 0);
211
- tslib_1.__decorate([
212
- Input(),
213
- tslib_1.__metadata("design:type", String)
214
- ], PDFExportComponent.prototype, "proxyURL", void 0);
215
- tslib_1.__decorate([
216
- Input(),
217
- tslib_1.__metadata("design:type", String)
218
- ], PDFExportComponent.prototype, "proxyTarget", void 0);
219
- tslib_1.__decorate([
220
- Input(),
221
- tslib_1.__metadata("design:type", String)
222
- ], PDFExportComponent.prototype, "producer", void 0);
223
- tslib_1.__decorate([
224
- Input(),
225
- tslib_1.__metadata("design:type", String)
226
- ], PDFExportComponent.prototype, "subject", void 0);
227
- tslib_1.__decorate([
228
- Input(),
229
- tslib_1.__metadata("design:type", String)
230
- ], PDFExportComponent.prototype, "title", void 0);
231
- tslib_1.__decorate([
232
- ContentChild(PDFExportTemplateDirective, { static: false }),
233
- tslib_1.__metadata("design:type", PDFExportTemplateDirective)
234
- ], PDFExportComponent.prototype, "pageTemplateDirective", void 0);
235
- tslib_1.__decorate([
236
- ContentChild(PDFExportMarginComponent, { static: false }),
237
- tslib_1.__metadata("design:type", PDFExportMarginComponent)
238
- ], PDFExportComponent.prototype, "marginComponent", void 0);
239
- PDFExportComponent = tslib_1.__decorate([
240
- Component({
241
- selector: 'kendo-pdf-export',
242
- template: `<div><ng-content></ng-content></div>`
243
- }),
244
- tslib_1.__metadata("design:paramtypes", [ElementRef])
245
- ], PDFExportComponent);
246
- export { PDFExportComponent };
142
+ }
143
+ PDFExportComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
144
+ PDFExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportComponent, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportComponent, decorators: [{
146
+ type: Component,
147
+ args: [{
148
+ selector: 'kendo-pdf-export',
149
+ template: `<div><ng-content></ng-content></div>`
150
+ }]
151
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { autoPrint: [{
152
+ type: Input
153
+ }], author: [{
154
+ type: Input
155
+ }], avoidLinks: [{
156
+ type: Input
157
+ }], forcePageBreak: [{
158
+ type: Input
159
+ }], keepTogether: [{
160
+ type: Input
161
+ }], creator: [{
162
+ type: Input
163
+ }], date: [{
164
+ type: Input
165
+ }], imageResolution: [{
166
+ type: Input
167
+ }], fileName: [{
168
+ type: Input
169
+ }], forceProxy: [{
170
+ type: Input
171
+ }], keywords: [{
172
+ type: Input
173
+ }], landscape: [{
174
+ type: Input
175
+ }], margin: [{
176
+ type: Input
177
+ }], paperSize: [{
178
+ type: Input
179
+ }], repeatHeaders: [{
180
+ type: Input
181
+ }], scale: [{
182
+ type: Input
183
+ }], proxyData: [{
184
+ type: Input
185
+ }], proxyURL: [{
186
+ type: Input
187
+ }], proxyTarget: [{
188
+ type: Input
189
+ }], producer: [{
190
+ type: Input
191
+ }], subject: [{
192
+ type: Input
193
+ }], title: [{
194
+ type: Input
195
+ }], pageTemplateDirective: [{
196
+ type: ContentChild,
197
+ args: [PDFExportTemplateDirective, { static: false }]
198
+ }], marginComponent: [{
199
+ type: ContentChild,
200
+ args: [PDFExportMarginComponent, { static: false }]
201
+ }] } });
@@ -0,0 +1,33 @@
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 { NgModule } from '@angular/core';
6
+ import { PDFExportComponent } from './pdf-export.component';
7
+ import { PDFExportMarginComponent } from './pdf-export-margin.component';
8
+ import { PDFExportTemplateDirective } from './pdf-export-template.directive';
9
+ import * as i0 from "@angular/core";
10
+ const COMPONENT_DIRECTIVES = [
11
+ PDFExportComponent,
12
+ PDFExportMarginComponent,
13
+ PDFExportTemplateDirective
14
+ ];
15
+ /**
16
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the PDF Export directive.
17
+ */
18
+ export class PDFExportModule {
19
+ }
20
+ PDFExportModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
21
+ PDFExportModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, declarations: [PDFExportComponent,
22
+ PDFExportMarginComponent,
23
+ PDFExportTemplateDirective], exports: [PDFExportComponent,
24
+ PDFExportMarginComponent,
25
+ PDFExportTemplateDirective] });
26
+ PDFExportModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule });
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, decorators: [{
28
+ type: NgModule,
29
+ args: [{
30
+ declarations: [COMPONENT_DIRECTIVES],
31
+ exports: [COMPONENT_DIRECTIVES]
32
+ }]
33
+ }] });
@@ -0,0 +1,318 @@
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 * as i0 from '@angular/core';
6
+ import { Directive, Optional, Component, Input, ContentChild, 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
+ const packageMetadata = {
15
+ name: '@progress/kendo-angular-pdf-export',
16
+ productName: 'Kendo UI for Angular',
17
+ productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
18
+ publishDate: 1649876476,
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
+ class PDFExportTemplateDirective {
24
+ constructor(templateRef) {
25
+ this.templateRef = templateRef;
26
+ }
27
+ }
28
+ PDFExportTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
29
+ PDFExportTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportTemplateDirective, selector: "[kendoPDFTemplate]", ngImport: i0 });
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: '[kendoPDFTemplate]'
34
+ }]
35
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
36
+ type: Optional
37
+ }] }]; } });
38
+
39
+ const FIELDS = ['bottom', 'left', 'right', 'top'];
40
+ /**
41
+ * Represents the Kendo UI PDFMargin component for Angular.
42
+ */
43
+ class PDFExportMarginComponent {
44
+ /**
45
+ * @hidden
46
+ */
47
+ get options() {
48
+ const options = {};
49
+ for (let idx = 0; idx < FIELDS.length; idx++) {
50
+ const field = FIELDS[idx];
51
+ const value = this[field];
52
+ if (typeof value !== 'undefined') {
53
+ options[field] = value;
54
+ }
55
+ }
56
+ return options;
57
+ }
58
+ }
59
+ PDFExportMarginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportMarginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
60
+ PDFExportMarginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportMarginComponent, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
62
+ type: Component,
63
+ args: [{
64
+ selector: 'kendo-pdf-export-margin',
65
+ template: ``
66
+ }]
67
+ }], propDecorators: { left: [{
68
+ type: Input
69
+ }], top: [{
70
+ type: Input
71
+ }], right: [{
72
+ type: Input
73
+ }], bottom: [{
74
+ type: Input
75
+ }] } });
76
+
77
+ /**
78
+ * @hidden
79
+ */
80
+ const compileTemplate = (templateRef) => {
81
+ const context = {};
82
+ let embeddedView = templateRef.createEmbeddedView(context);
83
+ const result = (data) => {
84
+ Object.assign(context, data);
85
+ embeddedView.detectChanges();
86
+ const templateWrap = document.createElement('span');
87
+ embeddedView.rootNodes.forEach((rootNode) => {
88
+ templateWrap.appendChild(rootNode.cloneNode(true));
89
+ });
90
+ return templateWrap;
91
+ };
92
+ result.destroy = () => {
93
+ embeddedView.destroy();
94
+ embeddedView = null;
95
+ };
96
+ return result;
97
+ };
98
+
99
+ /**
100
+ * Represents the [Kendo UI PDF Export component for Angular]({% slug overview_pdfexport %}).
101
+ *
102
+ * @example
103
+ * ```ts-preview
104
+ * _@Component({
105
+ * selector: 'my-app',
106
+ * template: `
107
+ * <div class="example-config">
108
+ * <button kendoButton (click)="pdf.saveAs('document.pdf')">
109
+ * Save As PDF...
110
+ * </button>
111
+ * </div>
112
+ *
113
+ * <kendo-pdf-export #pdf paperSize="A4" margin="2cm">
114
+ * Content goes here
115
+ * </kendo-pdf-export>
116
+ * `
117
+ * })
118
+ * export class AppComponent {
119
+ * }
120
+ * ```
121
+ */
122
+ class PDFExportComponent {
123
+ constructor(element) {
124
+ this.element = element;
125
+ /**
126
+ * The creator of the PDF document.
127
+ * @default "Kendo UI PDF Generator"
128
+ */
129
+ this.creator = 'Kendo UI PDF Generator';
130
+ /**
131
+ * Specifies the name of the exported PDF file.
132
+ * @default "Export.pdf"
133
+ */
134
+ this.fileName = 'export.pdf';
135
+ validatePackage(packageMetadata);
136
+ }
137
+ get drawMargin() {
138
+ const marginComponent = this.marginComponent;
139
+ let margin = this.margin;
140
+ if (marginComponent) {
141
+ margin = Object.assign(margin || {}, marginComponent.options);
142
+ }
143
+ return margin;
144
+ }
145
+ /**
146
+ * Saves the content as a PDF file with the specified name.
147
+ * @param fileName - The name of the exported file.
148
+ */
149
+ saveAs(fileName = this.fileName) {
150
+ this.save(this.element.nativeElement, fileName);
151
+ }
152
+ /**
153
+ * Exports the content as a `Group` for further processing.
154
+ *
155
+ * @return - The root group of the exported scene.
156
+ */
157
+ export() {
158
+ return this.exportElement(this.element.nativeElement);
159
+ }
160
+ save(element, fileName) {
161
+ this.exportElement(element)
162
+ .then(group => this.exportGroup(group, this.pdfOptions()))
163
+ .then(dataUri => this.saveDataUri(dataUri, fileName, this.saveOptions()));
164
+ }
165
+ exportElement(element) {
166
+ const promise = this.drawElement(element, this.drawOptions());
167
+ const cleanup = this.cleanup.bind(this);
168
+ promise.then(cleanup, cleanup);
169
+ return promise;
170
+ }
171
+ cleanup() {
172
+ if (this.pageTemplate) {
173
+ this.pageTemplate.destroy();
174
+ delete this.pageTemplate;
175
+ }
176
+ }
177
+ drawOptions() {
178
+ if (this.pageTemplateDirective) {
179
+ this.pageTemplate = compileTemplate(this.pageTemplateDirective.templateRef);
180
+ }
181
+ return {
182
+ avoidLinks: this.avoidLinks,
183
+ forcePageBreak: this.forcePageBreak,
184
+ keepTogether: this.keepTogether,
185
+ margin: this.drawMargin,
186
+ paperSize: this.paperSize,
187
+ landscape: this.landscape,
188
+ repeatHeaders: this.repeatHeaders,
189
+ scale: this.scale,
190
+ template: this.pageTemplate
191
+ };
192
+ }
193
+ pdfOptions() {
194
+ return {
195
+ autoPrint: this.autoPrint,
196
+ author: this.author,
197
+ creator: this.creator,
198
+ date: this.date,
199
+ imgDPI: this.imageResolution,
200
+ keywords: this.keywords,
201
+ landscape: this.landscape,
202
+ margin: this.drawMargin,
203
+ multiPage: true,
204
+ paperSize: this.paperSize,
205
+ producer: this.producer,
206
+ subject: this.subject,
207
+ title: this.title
208
+ };
209
+ }
210
+ saveOptions() {
211
+ return {
212
+ forceProxy: this.forceProxy,
213
+ proxyData: this.proxyData,
214
+ proxyTarget: this.proxyTarget,
215
+ proxyURL: this.proxyURL
216
+ };
217
+ }
218
+ drawElement(element, options) {
219
+ return drawDOM(element, options);
220
+ }
221
+ exportGroup(group, options) {
222
+ return exportPDF(group, options);
223
+ }
224
+ saveDataUri(dataUri, fileName, options) {
225
+ saveAs(dataUri, fileName, options);
226
+ }
227
+ }
228
+ PDFExportComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
229
+ PDFExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PDFExportComponent, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
230
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportComponent, decorators: [{
231
+ type: Component,
232
+ args: [{
233
+ selector: 'kendo-pdf-export',
234
+ template: `<div><ng-content></ng-content></div>`
235
+ }]
236
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { autoPrint: [{
237
+ type: Input
238
+ }], author: [{
239
+ type: Input
240
+ }], avoidLinks: [{
241
+ type: Input
242
+ }], forcePageBreak: [{
243
+ type: Input
244
+ }], keepTogether: [{
245
+ type: Input
246
+ }], creator: [{
247
+ type: Input
248
+ }], date: [{
249
+ type: Input
250
+ }], imageResolution: [{
251
+ type: Input
252
+ }], fileName: [{
253
+ type: Input
254
+ }], forceProxy: [{
255
+ type: Input
256
+ }], keywords: [{
257
+ type: Input
258
+ }], landscape: [{
259
+ type: Input
260
+ }], margin: [{
261
+ type: Input
262
+ }], paperSize: [{
263
+ type: Input
264
+ }], repeatHeaders: [{
265
+ type: Input
266
+ }], scale: [{
267
+ type: Input
268
+ }], proxyData: [{
269
+ type: Input
270
+ }], proxyURL: [{
271
+ type: Input
272
+ }], proxyTarget: [{
273
+ type: Input
274
+ }], producer: [{
275
+ type: Input
276
+ }], subject: [{
277
+ type: Input
278
+ }], title: [{
279
+ type: Input
280
+ }], pageTemplateDirective: [{
281
+ type: ContentChild,
282
+ args: [PDFExportTemplateDirective, { static: false }]
283
+ }], marginComponent: [{
284
+ type: ContentChild,
285
+ args: [PDFExportMarginComponent, { static: false }]
286
+ }] } });
287
+
288
+ const COMPONENT_DIRECTIVES = [
289
+ PDFExportComponent,
290
+ PDFExportMarginComponent,
291
+ PDFExportTemplateDirective
292
+ ];
293
+ /**
294
+ * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the PDF Export directive.
295
+ */
296
+ class PDFExportModule {
297
+ }
298
+ PDFExportModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
299
+ PDFExportModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, declarations: [PDFExportComponent,
300
+ PDFExportMarginComponent,
301
+ PDFExportTemplateDirective], exports: [PDFExportComponent,
302
+ PDFExportMarginComponent,
303
+ PDFExportTemplateDirective] });
304
+ PDFExportModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule });
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PDFExportModule, decorators: [{
306
+ type: NgModule,
307
+ args: [{
308
+ declarations: [COMPONENT_DIRECTIVES],
309
+ exports: [COMPONENT_DIRECTIVES]
310
+ }]
311
+ }] });
312
+
313
+ /**
314
+ * Generated bundle index. Do not edit.
315
+ */
316
+
317
+ export { PDFExportComponent, PDFExportMarginComponent, PDFExportModule, PDFExportTemplateDirective, compileTemplate };
318
+