@progress/kendo-angular-pdfviewer 19.0.0-develop.2 → 19.0.0-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.
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
13
|
-
publishDate:
|
14
|
-
version: '19.0.0-develop.
|
13
|
+
publishDate: 1745572380,
|
14
|
+
version: '19.0.0-develop.4',
|
15
15
|
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',
|
16
16
|
};
|
@@ -275,7 +275,7 @@ export class PDFViewerComponent {
|
|
275
275
|
* @hidden
|
276
276
|
*/
|
277
277
|
onPageChange(e) {
|
278
|
-
this.scrollToPage(e.skip + 1);
|
278
|
+
this.ngZone.runOutsideAngular(() => this.scrollToPage(e.skip + 1));
|
279
279
|
}
|
280
280
|
/**
|
281
281
|
* @hidden
|
@@ -313,7 +313,6 @@ export class PDFViewerComponent {
|
|
313
313
|
currentZoomLevel: newZoom
|
314
314
|
});
|
315
315
|
this.zoom = this.pdfContext.zoom = newZoom;
|
316
|
-
this.setZoomLevel(newZoom);
|
317
316
|
}
|
318
317
|
}
|
319
318
|
/**
|
@@ -327,7 +326,6 @@ export class PDFViewerComponent {
|
|
327
326
|
currentZoomLevel: newZoom
|
328
327
|
});
|
329
328
|
this.zoom = this.pdfContext.zoom = newZoom;
|
330
|
-
this.setZoomLevel(newZoom);
|
331
329
|
}
|
332
330
|
}
|
333
331
|
/**
|
@@ -346,7 +344,7 @@ export class PDFViewerComponent {
|
|
346
344
|
zoomLevelType: zoomLevel.type,
|
347
345
|
currentZoom: this.zoom
|
348
346
|
}) : Math.min(Math.max(zoomLevel.value, this.minZoom), this.maxZoom);
|
349
|
-
newZoom = Math.
|
347
|
+
newZoom = Math.round((newZoom + Number.EPSILON) * 100) / 100;
|
350
348
|
const sameZoom = this.zoom === newZoom;
|
351
349
|
if (!sameZoom) {
|
352
350
|
emit && this.zoneAwareEmitter('zoomLevelChange', {
|
@@ -355,7 +353,9 @@ export class PDFViewerComponent {
|
|
355
353
|
});
|
356
354
|
this.zoom = this.pdfContext.zoom = newZoom;
|
357
355
|
}
|
358
|
-
|
356
|
+
else {
|
357
|
+
this.setZoomLevel(newZoom, zoomLevel.type);
|
358
|
+
}
|
359
359
|
}
|
360
360
|
/**
|
361
361
|
* @hidden
|
@@ -406,9 +406,9 @@ export class PDFViewerComponent {
|
|
406
406
|
this.pdfViewerWidget?.destroy();
|
407
407
|
this.loading = true;
|
408
408
|
this.emitLoad = true;
|
409
|
-
this.ngZone.runOutsideAngular(() =>
|
409
|
+
this.ngZone.runOutsideAngular(() => {
|
410
410
|
// try to destroy if new dynamic data source
|
411
|
-
removeChildren(this.pagesContainer.nativeElement);
|
411
|
+
this.pagesContainer && removeChildren(this.pagesContainer.nativeElement);
|
412
412
|
const file = dataType === 'url' || dataType === 'data' ? { [dataType]: data } : { data };
|
413
413
|
this.pdfViewerWidget = new PdfViewer(this.host.nativeElement, {
|
414
414
|
loadOnDemand: this.loadOnDemand,
|
@@ -429,7 +429,7 @@ export class PDFViewerComponent {
|
|
429
429
|
error: this.errorHandler
|
430
430
|
}
|
431
431
|
});
|
432
|
-
})
|
432
|
+
});
|
433
433
|
}
|
434
434
|
assignPageIds() {
|
435
435
|
this.pagesContainer.nativeElement.querySelectorAll('.k-page').forEach((pageElement, index) => {
|
@@ -444,8 +444,7 @@ export class PDFViewerComponent {
|
|
444
444
|
displayValue: `${Math.round(zoom * 100)}%`,
|
445
445
|
text: `${Math.round(zoom * 100)}%`
|
446
446
|
};
|
447
|
-
this.pdfViewerWidget?.
|
448
|
-
this.pdfViewerWidget?.reloadFile(this.pdfContext.pdfDoc);
|
447
|
+
this.pdfViewerWidget?.zoom({ zoomLevel: zoom, zoomLevelType: type });
|
449
448
|
}
|
450
449
|
verifySettings(changes) {
|
451
450
|
const sourceTypes = ['url', 'arrayBuffer', 'data', 'typedArray'];
|
@@ -476,32 +475,28 @@ export class PDFViewerComponent {
|
|
476
475
|
this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
|
477
476
|
}
|
478
477
|
if (!this._zoomToFit) {
|
479
|
-
this.
|
480
|
-
|
481
|
-
this.
|
482
|
-
|
483
|
-
|
484
|
-
this.emitLoad = false;
|
485
|
-
}
|
486
|
-
});
|
478
|
+
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement, zoom: e.sender.state.zoomLevel };
|
479
|
+
if (this.emitLoad) {
|
480
|
+
this.zoneAwareEmitter('load', { context: this.pdfContext });
|
481
|
+
this.emitLoad = false;
|
482
|
+
}
|
487
483
|
}
|
488
484
|
else {
|
489
485
|
const zoomLevelOption = this.zoomOptionsData.find(item => item.type === this._fitType);
|
490
486
|
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
|
491
487
|
this.onZoomLevelChange(zoomLevelOption, false);
|
492
|
-
this.pdfViewerWidget.reloadFile(this.pdfContext.pdfDoc);
|
493
488
|
}
|
494
489
|
this.cdr.markForCheck();
|
495
490
|
this.assignPageIds();
|
491
|
+
this.ngZone.run(() => this.loading = false);
|
496
492
|
};
|
497
493
|
zoomEndHandler = (e) => {
|
498
|
-
const zoom = Math.min(Math.max(e.zoomLevel, this.minZoom), this.maxZoom);
|
494
|
+
const zoom = Math.round(Math.min(Math.max(e.zoomLevel, this.minZoom), this.maxZoom) * 100) / 100;
|
499
495
|
this.zoneAwareEmitter('zoomLevelChange', {
|
500
496
|
currentZoomLevel: zoom,
|
501
497
|
previousZoomLevel: this.zoom
|
502
498
|
});
|
503
499
|
this.zoom = zoom;
|
504
|
-
this.setZoomLevel(zoom);
|
505
500
|
};
|
506
501
|
errorHandler = (e) => {
|
507
502
|
this.ngZone.run(() => this.loading = false);
|
@@ -228,8 +228,8 @@ const packageMetadata = {
|
|
228
228
|
productName: 'Kendo UI for Angular',
|
229
229
|
productCode: 'KENDOUIANGULAR',
|
230
230
|
productCodes: ['KENDOUIANGULAR'],
|
231
|
-
publishDate:
|
232
|
-
version: '19.0.0-develop.
|
231
|
+
publishDate: 1745572380,
|
232
|
+
version: '19.0.0-develop.4',
|
233
233
|
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',
|
234
234
|
};
|
235
235
|
|
@@ -1585,7 +1585,7 @@ class PDFViewerComponent {
|
|
1585
1585
|
* @hidden
|
1586
1586
|
*/
|
1587
1587
|
onPageChange(e) {
|
1588
|
-
this.scrollToPage(e.skip + 1);
|
1588
|
+
this.ngZone.runOutsideAngular(() => this.scrollToPage(e.skip + 1));
|
1589
1589
|
}
|
1590
1590
|
/**
|
1591
1591
|
* @hidden
|
@@ -1623,7 +1623,6 @@ class PDFViewerComponent {
|
|
1623
1623
|
currentZoomLevel: newZoom
|
1624
1624
|
});
|
1625
1625
|
this.zoom = this.pdfContext.zoom = newZoom;
|
1626
|
-
this.setZoomLevel(newZoom);
|
1627
1626
|
}
|
1628
1627
|
}
|
1629
1628
|
/**
|
@@ -1637,7 +1636,6 @@ class PDFViewerComponent {
|
|
1637
1636
|
currentZoomLevel: newZoom
|
1638
1637
|
});
|
1639
1638
|
this.zoom = this.pdfContext.zoom = newZoom;
|
1640
|
-
this.setZoomLevel(newZoom);
|
1641
1639
|
}
|
1642
1640
|
}
|
1643
1641
|
/**
|
@@ -1656,7 +1654,7 @@ class PDFViewerComponent {
|
|
1656
1654
|
zoomLevelType: zoomLevel.type,
|
1657
1655
|
currentZoom: this.zoom
|
1658
1656
|
}) : Math.min(Math.max(zoomLevel.value, this.minZoom), this.maxZoom);
|
1659
|
-
newZoom = Math.
|
1657
|
+
newZoom = Math.round((newZoom + Number.EPSILON) * 100) / 100;
|
1660
1658
|
const sameZoom = this.zoom === newZoom;
|
1661
1659
|
if (!sameZoom) {
|
1662
1660
|
emit && this.zoneAwareEmitter('zoomLevelChange', {
|
@@ -1665,7 +1663,9 @@ class PDFViewerComponent {
|
|
1665
1663
|
});
|
1666
1664
|
this.zoom = this.pdfContext.zoom = newZoom;
|
1667
1665
|
}
|
1668
|
-
|
1666
|
+
else {
|
1667
|
+
this.setZoomLevel(newZoom, zoomLevel.type);
|
1668
|
+
}
|
1669
1669
|
}
|
1670
1670
|
/**
|
1671
1671
|
* @hidden
|
@@ -1716,9 +1716,9 @@ class PDFViewerComponent {
|
|
1716
1716
|
this.pdfViewerWidget?.destroy();
|
1717
1717
|
this.loading = true;
|
1718
1718
|
this.emitLoad = true;
|
1719
|
-
this.ngZone.runOutsideAngular(() =>
|
1719
|
+
this.ngZone.runOutsideAngular(() => {
|
1720
1720
|
// try to destroy if new dynamic data source
|
1721
|
-
removeChildren(this.pagesContainer.nativeElement);
|
1721
|
+
this.pagesContainer && removeChildren(this.pagesContainer.nativeElement);
|
1722
1722
|
const file = dataType === 'url' || dataType === 'data' ? { [dataType]: data } : { data };
|
1723
1723
|
this.pdfViewerWidget = new PdfViewer(this.host.nativeElement, {
|
1724
1724
|
loadOnDemand: this.loadOnDemand,
|
@@ -1739,7 +1739,7 @@ class PDFViewerComponent {
|
|
1739
1739
|
error: this.errorHandler
|
1740
1740
|
}
|
1741
1741
|
});
|
1742
|
-
})
|
1742
|
+
});
|
1743
1743
|
}
|
1744
1744
|
assignPageIds() {
|
1745
1745
|
this.pagesContainer.nativeElement.querySelectorAll('.k-page').forEach((pageElement, index) => {
|
@@ -1754,8 +1754,7 @@ class PDFViewerComponent {
|
|
1754
1754
|
displayValue: `${Math.round(zoom * 100)}%`,
|
1755
1755
|
text: `${Math.round(zoom * 100)}%`
|
1756
1756
|
};
|
1757
|
-
this.pdfViewerWidget?.
|
1758
|
-
this.pdfViewerWidget?.reloadFile(this.pdfContext.pdfDoc);
|
1757
|
+
this.pdfViewerWidget?.zoom({ zoomLevel: zoom, zoomLevelType: type });
|
1759
1758
|
}
|
1760
1759
|
verifySettings(changes) {
|
1761
1760
|
const sourceTypes = ['url', 'arrayBuffer', 'data', 'typedArray'];
|
@@ -1786,32 +1785,28 @@ class PDFViewerComponent {
|
|
1786
1785
|
this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
|
1787
1786
|
}
|
1788
1787
|
if (!this._zoomToFit) {
|
1789
|
-
this.
|
1790
|
-
|
1791
|
-
this.
|
1792
|
-
|
1793
|
-
|
1794
|
-
this.emitLoad = false;
|
1795
|
-
}
|
1796
|
-
});
|
1788
|
+
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement, zoom: e.sender.state.zoomLevel };
|
1789
|
+
if (this.emitLoad) {
|
1790
|
+
this.zoneAwareEmitter('load', { context: this.pdfContext });
|
1791
|
+
this.emitLoad = false;
|
1792
|
+
}
|
1797
1793
|
}
|
1798
1794
|
else {
|
1799
1795
|
const zoomLevelOption = this.zoomOptionsData.find(item => item.type === this._fitType);
|
1800
1796
|
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
|
1801
1797
|
this.onZoomLevelChange(zoomLevelOption, false);
|
1802
|
-
this.pdfViewerWidget.reloadFile(this.pdfContext.pdfDoc);
|
1803
1798
|
}
|
1804
1799
|
this.cdr.markForCheck();
|
1805
1800
|
this.assignPageIds();
|
1801
|
+
this.ngZone.run(() => this.loading = false);
|
1806
1802
|
};
|
1807
1803
|
zoomEndHandler = (e) => {
|
1808
|
-
const zoom = Math.min(Math.max(e.zoomLevel, this.minZoom), this.maxZoom);
|
1804
|
+
const zoom = Math.round(Math.min(Math.max(e.zoomLevel, this.minZoom), this.maxZoom) * 100) / 100;
|
1809
1805
|
this.zoneAwareEmitter('zoomLevelChange', {
|
1810
1806
|
currentZoomLevel: zoom,
|
1811
1807
|
previousZoomLevel: this.zoom
|
1812
1808
|
});
|
1813
1809
|
this.zoom = zoom;
|
1814
|
-
this.setZoomLevel(zoom);
|
1815
1810
|
};
|
1816
1811
|
errorHandler = (e) => {
|
1817
1812
|
this.ngZone.run(() => this.loading = false);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@progress/kendo-angular-pdfviewer",
|
3
|
-
"version": "19.0.0-develop.
|
3
|
+
"version": "19.0.0-develop.4",
|
4
4
|
"description": "Kendo UI PDFViewer for Angular",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
6
6
|
"author": "Progress",
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"package": {
|
20
20
|
"productName": "Kendo UI for Angular",
|
21
21
|
"productCode": "KENDOUIANGULAR",
|
22
|
-
"publishDate":
|
22
|
+
"publishDate": 1745572380,
|
23
23
|
"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"
|
24
24
|
}
|
25
25
|
},
|
@@ -29,21 +29,21 @@
|
|
29
29
|
"@angular/core": "16 - 19",
|
30
30
|
"@angular/platform-browser": "16 - 19",
|
31
31
|
"@progress/kendo-licensing": "^1.5.0",
|
32
|
-
"@progress/kendo-angular-buttons": "19.0.0-develop.
|
33
|
-
"@progress/kendo-angular-common": "19.0.0-develop.
|
34
|
-
"@progress/kendo-angular-dropdowns": "19.0.0-develop.
|
35
|
-
"@progress/kendo-angular-inputs": "19.0.0-develop.
|
36
|
-
"@progress/kendo-angular-intl": "19.0.0-develop.
|
37
|
-
"@progress/kendo-angular-l10n": "19.0.0-develop.
|
38
|
-
"@progress/kendo-angular-icons": "19.0.0-develop.
|
39
|
-
"@progress/kendo-angular-indicators": "19.0.0-develop.
|
40
|
-
"@progress/kendo-angular-pager": "19.0.0-develop.
|
41
|
-
"@progress/kendo-angular-popup": "19.0.0-develop.
|
32
|
+
"@progress/kendo-angular-buttons": "19.0.0-develop.4",
|
33
|
+
"@progress/kendo-angular-common": "19.0.0-develop.4",
|
34
|
+
"@progress/kendo-angular-dropdowns": "19.0.0-develop.4",
|
35
|
+
"@progress/kendo-angular-inputs": "19.0.0-develop.4",
|
36
|
+
"@progress/kendo-angular-intl": "19.0.0-develop.4",
|
37
|
+
"@progress/kendo-angular-l10n": "19.0.0-develop.4",
|
38
|
+
"@progress/kendo-angular-icons": "19.0.0-develop.4",
|
39
|
+
"@progress/kendo-angular-indicators": "19.0.0-develop.4",
|
40
|
+
"@progress/kendo-angular-pager": "19.0.0-develop.4",
|
41
|
+
"@progress/kendo-angular-popup": "19.0.0-develop.4",
|
42
42
|
"rxjs": "^6.5.3 || ^7.0.0"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
45
|
"tslib": "^2.3.1",
|
46
|
-
"@progress/kendo-angular-schematics": "19.0.0-develop.
|
46
|
+
"@progress/kendo-angular-schematics": "19.0.0-develop.4",
|
47
47
|
"@progress/kendo-file-saver": "^1.0.1",
|
48
48
|
"@progress/kendo-pdfviewer-common": "0.4.1"
|
49
49
|
},
|
@@ -4,8 +4,8 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
4
4
|
function default_1(options) {
|
5
5
|
const finalOptions = Object.assign(Object.assign({}, options), { mainNgModule: 'PDFViewerModule', package: 'pdfviewer', peerDependencies: {
|
6
6
|
// peers of the dropdowns
|
7
|
-
'@progress/kendo-angular-navigation': '19.0.0-develop.
|
8
|
-
'@progress/kendo-angular-treeview': '19.0.0-develop.
|
7
|
+
'@progress/kendo-angular-navigation': '19.0.0-develop.4',
|
8
|
+
'@progress/kendo-angular-treeview': '19.0.0-develop.4'
|
9
9
|
} });
|
10
10
|
return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
|
11
11
|
}
|