taxtank-core 2.0.64 → 2.0.65
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/fesm2022/taxtank-core.mjs +16 -25
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/package.json +1 -1
|
@@ -41,7 +41,6 @@ import mixpanel from 'mixpanel-browser';
|
|
|
41
41
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
42
42
|
import { jsPDF } from 'jspdf';
|
|
43
43
|
import { applyPlugin } from 'jspdf-autotable';
|
|
44
|
-
import html2pdf from 'html2pdf.js';
|
|
45
44
|
import * as xlsx from '@e965/xlsx';
|
|
46
45
|
import * as FileSaver from 'file-saver';
|
|
47
46
|
import * as i1$2 from '@angular/platform-browser';
|
|
@@ -20618,13 +20617,18 @@ class JsPdf extends jsPDF {
|
|
|
20618
20617
|
const FILE_SETTINGS$1 = {
|
|
20619
20618
|
margin: 10,
|
|
20620
20619
|
filename: 'export.pdf',
|
|
20620
|
+
image: { type: 'jpeg', quality: 0.8 },
|
|
20621
20621
|
html2canvas: {
|
|
20622
20622
|
scale: 2,
|
|
20623
|
+
windowWidth: 1000,
|
|
20624
|
+
windowHeight: 800,
|
|
20625
|
+
foreignObjectRendering: false,
|
|
20626
|
+
letterRendering: false,
|
|
20623
20627
|
useCORS: true,
|
|
20624
|
-
logging: true
|
|
20628
|
+
logging: true,
|
|
20625
20629
|
},
|
|
20626
20630
|
pagebreak: {
|
|
20627
|
-
mode: '
|
|
20631
|
+
mode: ''
|
|
20628
20632
|
},
|
|
20629
20633
|
jsPDF: {
|
|
20630
20634
|
unit: 'mm',
|
|
@@ -20643,44 +20647,31 @@ const FILE_SETTINGS$1 = {
|
|
|
20643
20647
|
*/
|
|
20644
20648
|
class PdfFromDomElementService {
|
|
20645
20649
|
init(elements, fileSettings) {
|
|
20646
|
-
const options = FILE_SETTINGS$1;
|
|
20650
|
+
const options = { ...FILE_SETTINGS$1 };
|
|
20647
20651
|
if (fileSettings) {
|
|
20648
20652
|
merge(options, fileSettings);
|
|
20649
20653
|
}
|
|
20650
20654
|
// HTML container in which the exported DOM elements will be placed
|
|
20651
|
-
const htmlWrapper = document.createElement('div');
|
|
20652
|
-
|
|
20655
|
+
// const htmlWrapper: HTMLElement = document.createElement('div');
|
|
20656
|
+
const iframe = document.getElementById('iframe-pdf-export');
|
|
20657
|
+
const idoc = iframe.contentDocument;
|
|
20658
|
+
const htmlWrapper = idoc.getElementById('pdf-export');
|
|
20659
|
+
htmlWrapper.innerHTML = '';
|
|
20653
20660
|
elements.forEach((element) => {
|
|
20654
20661
|
htmlWrapper.append(element.cloneNode(true));
|
|
20655
20662
|
});
|
|
20663
|
+
idoc.body.offsetHeight;
|
|
20656
20664
|
// Set PDF options, save file and return result as Observable
|
|
20657
|
-
return html2pdf().from(htmlWrapper).set(options);
|
|
20665
|
+
return iframe.contentWindow.html2pdf().from(htmlWrapper).set(options);
|
|
20658
20666
|
}
|
|
20659
20667
|
download(elements, fileSettings) {
|
|
20660
|
-
return from(this.init(elements, fileSettings)
|
|
20661
|
-
.save());
|
|
20668
|
+
return from(this.init(elements, fileSettings).save());
|
|
20662
20669
|
}
|
|
20663
20670
|
export(elements, filename = FILE_SETTINGS$1.filename) {
|
|
20664
20671
|
return from(this.init(elements)
|
|
20665
20672
|
.outputPdf('blob')
|
|
20666
20673
|
.then((blob) => new File([blob], filename, { type: 'application/pdf' })));
|
|
20667
20674
|
}
|
|
20668
|
-
// fix html2canvas-pro problem with vertical alignment: https://github.com/yorickshan/html2canvas-pro/issues/92
|
|
20669
|
-
injectExportStyles(element) {
|
|
20670
|
-
element.classList.add('pdf-export');
|
|
20671
|
-
if (!document.getElementById('pdf-export-style')) {
|
|
20672
|
-
const style = document.createElement('style');
|
|
20673
|
-
style.id = 'pdf-export-style';
|
|
20674
|
-
style.textContent = `
|
|
20675
|
-
.pdf-export input.mat-mdc-input-element {
|
|
20676
|
-
height: 30px !important;
|
|
20677
|
-
margin-top: 20px;
|
|
20678
|
-
padding: 0 15px !important;
|
|
20679
|
-
}
|
|
20680
|
-
`;
|
|
20681
|
-
document.head.appendChild(style);
|
|
20682
|
-
}
|
|
20683
|
-
}
|
|
20684
20675
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PdfFromDomElementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
20685
20676
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: PdfFromDomElementService, providedIn: 'root' }); }
|
|
20686
20677
|
}
|