@worktile/gantt 20.0.0-next.0 → 20.0.0-next.1
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.
|
@@ -4200,7 +4200,7 @@ class GanttPrintService {
|
|
|
4200
4200
|
this.root = root.nativeElement;
|
|
4201
4201
|
this.mainContainer = this.root.getElementsByClassName('gantt-main-container')[0];
|
|
4202
4202
|
}
|
|
4203
|
-
async
|
|
4203
|
+
async html2canvas(ignoreElementClass) {
|
|
4204
4204
|
const root = this.root;
|
|
4205
4205
|
const mainContainer = this.mainContainer;
|
|
4206
4206
|
// set print width
|
|
@@ -4208,7 +4208,7 @@ class GanttPrintService {
|
|
|
4208
4208
|
// set print height
|
|
4209
4209
|
const printHeight = root.offsetHeight - mainContainer.offsetHeight + mainContainer.scrollHeight;
|
|
4210
4210
|
const html2canvas = (await import(/* webpackChunkName: 'html2canvas' */ 'html2canvas')).default;
|
|
4211
|
-
html2canvas(root, {
|
|
4211
|
+
return html2canvas(root, {
|
|
4212
4212
|
logging: false,
|
|
4213
4213
|
allowTaint: true,
|
|
4214
4214
|
useCORS: true,
|
|
@@ -4242,7 +4242,10 @@ class GanttPrintService {
|
|
|
4242
4242
|
// setInlineStyles for svg
|
|
4243
4243
|
this.setInlineStyles(cloneGanttDom);
|
|
4244
4244
|
}
|
|
4245
|
-
})
|
|
4245
|
+
});
|
|
4246
|
+
}
|
|
4247
|
+
async print(name = 'download', ignoreElementClass) {
|
|
4248
|
+
this.html2canvas(ignoreElementClass).then((canvas) => {
|
|
4246
4249
|
const link = document.createElement('a');
|
|
4247
4250
|
const dataUrl = canvas.toDataURL('image/png');
|
|
4248
4251
|
link.download = `${name}.png`;
|