@progress/kendo-angular-pdfviewer 16.8.0 → 16.9.0-develop.10

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.
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-pdfviewer',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1724742168,
13
- version: '16.8.0',
12
+ publishDate: 1724927490,
13
+ version: '16.9.0-develop.10',
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
  };
@@ -2,10 +2,10 @@
2
2
  * Copyright © 2024 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 { Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode } from '@angular/core';
5
+ import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode } from '@angular/core';
6
6
  import { validatePackage } from '@progress/kendo-licensing';
7
7
  import { packageMetadata } from './package-metadata';
8
- import { INITIAL_ZOOM_LEVEL, zoomOptionsData } from './util';
8
+ import { INITIAL_ZOOM_LEVEL, zoomOptionsData, zoomToFitOptions } from './util';
9
9
  import { scrollToPage, Scroller, SearchService, goToNextSearchMatch, goToPreviousSearchMatch, calculateZoomLevel, removeChildren, print, loadPDF, reloadDocument, currentPage } from '@progress/kendo-pdfviewer-common';
10
10
  import { hasObservers, shouldShowValidationUI, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
11
11
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
@@ -25,10 +25,11 @@ let counter = 0;
25
25
  * Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
26
26
  */
27
27
  export class PDFViewerComponent {
28
- constructor(ngZone, renderer, localizationService) {
28
+ constructor(ngZone, renderer, localizationService, cdr) {
29
29
  this.ngZone = ngZone;
30
30
  this.renderer = renderer;
31
31
  this.localizationService = localizationService;
32
+ this.cdr = cdr;
32
33
  this.hostClass = true;
33
34
  /**
34
35
  * Represents the tools collection rendered in the toolbar.
@@ -65,12 +66,6 @@ export class PDFViewerComponent {
65
66
  * @default {}
66
67
  */
67
68
  this.saveOptions = {};
68
- /**
69
- * The initial zoom level of the PDF document.
70
- *
71
- * @default 1.25
72
- */
73
- this.zoom = INITIAL_ZOOM_LEVEL;
74
69
  /**
75
70
  * Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
76
71
  * @default 0.25
@@ -118,7 +113,9 @@ export class PDFViewerComponent {
118
113
  this.zoomOptionsData = zoomOptionsData;
119
114
  this.zoomLevel = this.zoomOptionsData[5];
120
115
  this._pdfContext = null;
121
- this._enabedSelection = false;
116
+ this._enabledSelection = false;
117
+ this._zoom = INITIAL_ZOOM_LEVEL;
118
+ this._zoomToFit = false;
122
119
  this.subs = new Subscription();
123
120
  this.scrollListener = (e) => {
124
121
  const nextPage = currentPage(e.target.parentNode);
@@ -137,6 +134,26 @@ export class PDFViewerComponent {
137
134
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
138
135
  counter++;
139
136
  }
137
+ /**
138
+ * The initial zoom level of the PDF document.
139
+ *
140
+ * @default 1.25
141
+ */
142
+ set zoom(value) {
143
+ if (typeof value === 'number') {
144
+ this._zoom = value;
145
+ this._fitType = null;
146
+ this.setZoomLevel(value);
147
+ }
148
+ else {
149
+ this._zoom = 1;
150
+ this._fitType = zoomToFitOptions[value];
151
+ }
152
+ this._zoomToFit = typeof value !== 'number';
153
+ }
154
+ get zoom() {
155
+ return this._zoom;
156
+ }
140
157
  /**
141
158
  * Returns the current page number of the loaded PDF document.
142
159
  */
@@ -178,13 +195,13 @@ export class PDFViewerComponent {
178
195
  if (this.pdfScroller) {
179
196
  value ? this.pdfScroller.disablePanEventsTracking() : this.pdfScroller.enablePanEventsTracking();
180
197
  }
181
- this._enabedSelection = value;
198
+ this._enabledSelection = value;
182
199
  }
183
200
  /**
184
201
  * @hidden
185
202
  */
186
203
  get enabledSelection() {
187
- return this._enabedSelection;
204
+ return this._enabledSelection;
188
205
  }
189
206
  ngOnInit() {
190
207
  this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
@@ -216,9 +233,6 @@ export class PDFViewerComponent {
216
233
  if (newUrl || newArrayBuffer || newBase64Data || newTypedArray) {
217
234
  this.loadPdf(source, this[source]);
218
235
  }
219
- if (changes['zoom']) {
220
- this.setZoomLevel(changes['zoom'].currentValue);
221
- }
222
236
  }
223
237
  /**
224
238
  * Scrolls the PDFViewer document to the specified page number, treating 0 as the first page.
@@ -308,17 +322,18 @@ export class PDFViewerComponent {
308
322
  /**
309
323
  * @hidden
310
324
  */
311
- onZoomLevelChange(zoomLevel) {
312
- if (typeof zoomLevel === 'string') {
313
- const parsedValue = parseFloat(zoomLevel);
314
- zoomLevel = { value: Number.isNaN(parsedValue) ? 1 : parsedValue / 100 };
315
- }
325
+ onZoomLevelChange(zoomLevel, emit = true) {
316
326
  if (!zoomLevel) {
317
- zoomLevel = { value: 1 };
327
+ zoomLevel = {
328
+ value: 1,
329
+ displayValue: '100%',
330
+ text: '100%'
331
+ };
318
332
  }
319
333
  let newZoom = calculateZoomLevel(zoomLevel.value, zoomLevel.type, this.pdfContext.zoom, this.pagesContainer.nativeElement);
320
334
  newZoom = Math.round(newZoom * 100) / 100;
321
- if (hasObservers(this.zoomLevelChange)) {
335
+ const sameZoom = this.zoom === newZoom;
336
+ if (!sameZoom && emit && hasObservers(this.zoomLevelChange)) {
322
337
  this.zoomLevelChange.emit({
323
338
  previousZoomLevel: this.zoom,
324
339
  currentZoomLevel: newZoom
@@ -399,10 +414,19 @@ export class PDFViewerComponent {
399
414
  dom: this.pagesContainer.nativeElement,
400
415
  zoom: this.pdfContext?.zoom || this.zoom,
401
416
  done: (e) => {
402
- this.ngZone.run(() => {
403
- this.loading = false;
417
+ if (!this._zoomToFit) {
418
+ this.ngZone.run(() => {
419
+ this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
420
+ this.loading = false;
421
+ this.cdr.markForCheck();
422
+ });
423
+ }
424
+ else {
425
+ const zoomLevelOption = this.zoomOptionsData.find(item => item.type === this._fitType);
404
426
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
405
- });
427
+ this.onZoomLevelChange(zoomLevelOption, false);
428
+ this.cdr.markForCheck();
429
+ }
406
430
  if (this.pdfScroller) {
407
431
  this.pdfScroller.destroy();
408
432
  }
@@ -436,7 +460,10 @@ export class PDFViewerComponent {
436
460
  dom: this.pagesContainer.nativeElement,
437
461
  done: (pdfPages) => {
438
462
  this.pdfContext.pdfPages = pdfPages;
439
- this.ngZone.run(() => this.loading = false);
463
+ this.ngZone.run(() => {
464
+ this.loading = false;
465
+ this.cdr.markForCheck();
466
+ });
440
467
  this.assignPageIds();
441
468
  },
442
469
  error: (e) => {
@@ -460,7 +487,7 @@ export class PDFViewerComponent {
460
487
  }
461
488
  setZoomLevel(zoom) {
462
489
  const option = this.zoomOptionsData.find(item => !item.type && item.value === zoom);
463
- this.zoomLevel = option || {
490
+ this.zoomLevel = option ? { ...option } : {
464
491
  value: zoom,
465
492
  displayValue: `${Math.round(zoom * 100)}%`,
466
493
  text: `${Math.round(zoom * 100)}%`
@@ -480,7 +507,7 @@ export class PDFViewerComponent {
480
507
  return this[source] || (changes[source] && changes[source].currentValue);
481
508
  }
482
509
  }
483
- PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
510
+ PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
484
511
  PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFViewerComponent, isStandalone: true, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
485
512
  LocalizationService,
486
513
  {
@@ -770,7 +797,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
770
797
  standalone: true,
771
798
  imports: [LocalizedPDFViewerMessagesDirective, NgIf, LoaderComponent, ToolbarComponent, PDFViewerSearchComponent, WatermarkOverlayComponent]
772
799
  }]
773
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
800
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
774
801
  type: HostBinding,
775
802
  args: ['class.k-pdf-viewer']
776
803
  }], direction: [{
@@ -14,6 +14,7 @@ import { ButtonComponent, ButtonGroupComponent } from '@progress/kendo-angular-b
14
14
  import { ToolbarFocusableDirective } from './toolbar-focusable.directive';
15
15
  import { ToolbarInputWrapperComponent } from './input-wrapper.component';
16
16
  import { NgFor, NgSwitch, NgSwitchCase, NgIf } from '@angular/common';
17
+ import { map } from 'rxjs/operators';
17
18
  import * as i0 from "@angular/core";
18
19
  import * as i1 from "@progress/kendo-angular-l10n";
19
20
  import * as i2 from "./toolbar-navigation.service";
@@ -59,6 +60,15 @@ export class ToolbarComponent {
59
60
  this.downloadIcon = downloadIcon;
60
61
  this.printIcon = printIcon;
61
62
  this.pagerType = 'input';
63
+ this.valueNormalizer = (text) => text.pipe(map((value) => {
64
+ const parsedValue = parseFloat(value);
65
+ const newValue = Number.isNaN(parsedValue) ? 1 : parsedValue / 100;
66
+ return {
67
+ value: newValue,
68
+ displayValue: `${Math.round(newValue * 100)}%`,
69
+ text: `${Math.round(newValue * 100)}%`
70
+ };
71
+ }));
62
72
  }
63
73
  messageFor(key) {
64
74
  return this.localization.get(key);
@@ -161,6 +171,8 @@ ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versi
161
171
  valueField="id"
162
172
  [value]="zoomLevelChooserValue"
163
173
  [allowCustom]="true"
174
+ [valueNormalizer]="valueNormalizer"
175
+ [clearButton]="false"
164
176
  (valueChange)="onZoomLevelChooserValueChange($event)">
165
177
  <ng-template kendoComboBoxItemTemplate let-dataItem>
166
178
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
@@ -331,6 +343,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
331
343
  valueField="id"
332
344
  [value]="zoomLevelChooserValue"
333
345
  [allowCustom]="true"
346
+ [valueNormalizer]="valueNormalizer"
347
+ [clearButton]="false"
334
348
  (valueChange)="onZoomLevelChooserValueChange($event)">
335
349
  <ng-template kendoComboBoxItemTemplate let-dataItem>
336
350
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
package/esm2020/util.mjs CHANGED
@@ -70,3 +70,10 @@ export const zoomOptionsData = [{
70
70
  displayValue: '400%',
71
71
  value: 4
72
72
  }];
73
+ /**
74
+ * @hidden
75
+ */
76
+ export const zoomToFitOptions = {
77
+ 'fitToPage': 'FitToPage',
78
+ 'fitToWidth': 'FitToWidth'
79
+ };
@@ -17,6 +17,7 @@ import * as i1$1 from '@progress/kendo-angular-dropdowns';
17
17
  import { ComboBoxComponent, ItemTemplateDirective } from '@progress/kendo-angular-dropdowns';
18
18
  import { ButtonGroupComponent, ButtonComponent } from '@progress/kendo-angular-buttons';
19
19
  import { NgFor, NgSwitch, NgSwitchCase, NgIf } from '@angular/common';
20
+ import { map } from 'rxjs/operators';
20
21
  import { TextBoxComponent, TextBoxSuffixTemplateDirective } from '@progress/kendo-angular-inputs';
21
22
  import { LoaderComponent as LoaderComponent$1 } from '@progress/kendo-angular-indicators';
22
23
  import 'pdfjs-dist/build/pdf.worker.entry';
@@ -125,8 +126,8 @@ const packageMetadata = {
125
126
  name: '@progress/kendo-angular-pdfviewer',
126
127
  productName: 'Kendo UI for Angular',
127
128
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
128
- publishDate: 1724742168,
129
- version: '16.8.0',
129
+ publishDate: 1724927490,
130
+ version: '16.9.0-develop.10',
130
131
  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',
131
132
  };
132
133
 
@@ -198,6 +199,13 @@ const zoomOptionsData = [{
198
199
  displayValue: '400%',
199
200
  value: 4
200
201
  }];
202
+ /**
203
+ * @hidden
204
+ */
205
+ const zoomToFitOptions = {
206
+ 'fitToPage': 'FitToPage',
207
+ 'fitToWidth': 'FitToWidth'
208
+ };
201
209
 
202
210
  /**
203
211
  * Arguments for the `download` event. The event fires when the end user clicks the Download tool.
@@ -456,6 +464,15 @@ class ToolbarComponent {
456
464
  this.downloadIcon = downloadIcon;
457
465
  this.printIcon = printIcon;
458
466
  this.pagerType = 'input';
467
+ this.valueNormalizer = (text) => text.pipe(map((value) => {
468
+ const parsedValue = parseFloat(value);
469
+ const newValue = Number.isNaN(parsedValue) ? 1 : parsedValue / 100;
470
+ return {
471
+ value: newValue,
472
+ displayValue: `${Math.round(newValue * 100)}%`,
473
+ text: `${Math.round(newValue * 100)}%`
474
+ };
475
+ }));
459
476
  }
460
477
  messageFor(key) {
461
478
  return this.localization.get(key);
@@ -558,6 +575,8 @@ ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versi
558
575
  valueField="id"
559
576
  [value]="zoomLevelChooserValue"
560
577
  [allowCustom]="true"
578
+ [valueNormalizer]="valueNormalizer"
579
+ [clearButton]="false"
561
580
  (valueChange)="onZoomLevelChooserValueChange($event)">
562
581
  <ng-template kendoComboBoxItemTemplate let-dataItem>
563
582
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
@@ -728,6 +747,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
728
747
  valueField="id"
729
748
  [value]="zoomLevelChooserValue"
730
749
  [allowCustom]="true"
750
+ [valueNormalizer]="valueNormalizer"
751
+ [clearButton]="false"
731
752
  (valueChange)="onZoomLevelChooserValueChange($event)">
732
753
  <ng-template kendoComboBoxItemTemplate let-dataItem>
733
754
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
@@ -1134,10 +1155,11 @@ let counter = 0;
1134
1155
  * Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
1135
1156
  */
1136
1157
  class PDFViewerComponent {
1137
- constructor(ngZone, renderer, localizationService) {
1158
+ constructor(ngZone, renderer, localizationService, cdr) {
1138
1159
  this.ngZone = ngZone;
1139
1160
  this.renderer = renderer;
1140
1161
  this.localizationService = localizationService;
1162
+ this.cdr = cdr;
1141
1163
  this.hostClass = true;
1142
1164
  /**
1143
1165
  * Represents the tools collection rendered in the toolbar.
@@ -1174,12 +1196,6 @@ class PDFViewerComponent {
1174
1196
  * @default {}
1175
1197
  */
1176
1198
  this.saveOptions = {};
1177
- /**
1178
- * The initial zoom level of the PDF document.
1179
- *
1180
- * @default 1.25
1181
- */
1182
- this.zoom = INITIAL_ZOOM_LEVEL;
1183
1199
  /**
1184
1200
  * Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
1185
1201
  * @default 0.25
@@ -1227,7 +1243,9 @@ class PDFViewerComponent {
1227
1243
  this.zoomOptionsData = zoomOptionsData;
1228
1244
  this.zoomLevel = this.zoomOptionsData[5];
1229
1245
  this._pdfContext = null;
1230
- this._enabedSelection = false;
1246
+ this._enabledSelection = false;
1247
+ this._zoom = INITIAL_ZOOM_LEVEL;
1248
+ this._zoomToFit = false;
1231
1249
  this.subs = new Subscription();
1232
1250
  this.scrollListener = (e) => {
1233
1251
  const nextPage = currentPage(e.target.parentNode);
@@ -1246,6 +1264,26 @@ class PDFViewerComponent {
1246
1264
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
1247
1265
  counter++;
1248
1266
  }
1267
+ /**
1268
+ * The initial zoom level of the PDF document.
1269
+ *
1270
+ * @default 1.25
1271
+ */
1272
+ set zoom(value) {
1273
+ if (typeof value === 'number') {
1274
+ this._zoom = value;
1275
+ this._fitType = null;
1276
+ this.setZoomLevel(value);
1277
+ }
1278
+ else {
1279
+ this._zoom = 1;
1280
+ this._fitType = zoomToFitOptions[value];
1281
+ }
1282
+ this._zoomToFit = typeof value !== 'number';
1283
+ }
1284
+ get zoom() {
1285
+ return this._zoom;
1286
+ }
1249
1287
  /**
1250
1288
  * Returns the current page number of the loaded PDF document.
1251
1289
  */
@@ -1290,13 +1328,13 @@ class PDFViewerComponent {
1290
1328
  if (this.pdfScroller) {
1291
1329
  value ? this.pdfScroller.disablePanEventsTracking() : this.pdfScroller.enablePanEventsTracking();
1292
1330
  }
1293
- this._enabedSelection = value;
1331
+ this._enabledSelection = value;
1294
1332
  }
1295
1333
  /**
1296
1334
  * @hidden
1297
1335
  */
1298
1336
  get enabledSelection() {
1299
- return this._enabedSelection;
1337
+ return this._enabledSelection;
1300
1338
  }
1301
1339
  ngOnInit() {
1302
1340
  this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
@@ -1328,9 +1366,6 @@ class PDFViewerComponent {
1328
1366
  if (newUrl || newArrayBuffer || newBase64Data || newTypedArray) {
1329
1367
  this.loadPdf(source, this[source]);
1330
1368
  }
1331
- if (changes['zoom']) {
1332
- this.setZoomLevel(changes['zoom'].currentValue);
1333
- }
1334
1369
  }
1335
1370
  /**
1336
1371
  * Scrolls the PDFViewer document to the specified page number, treating 0 as the first page.
@@ -1420,17 +1455,18 @@ class PDFViewerComponent {
1420
1455
  /**
1421
1456
  * @hidden
1422
1457
  */
1423
- onZoomLevelChange(zoomLevel) {
1424
- if (typeof zoomLevel === 'string') {
1425
- const parsedValue = parseFloat(zoomLevel);
1426
- zoomLevel = { value: Number.isNaN(parsedValue) ? 1 : parsedValue / 100 };
1427
- }
1458
+ onZoomLevelChange(zoomLevel, emit = true) {
1428
1459
  if (!zoomLevel) {
1429
- zoomLevel = { value: 1 };
1460
+ zoomLevel = {
1461
+ value: 1,
1462
+ displayValue: '100%',
1463
+ text: '100%'
1464
+ };
1430
1465
  }
1431
1466
  let newZoom = calculateZoomLevel(zoomLevel.value, zoomLevel.type, this.pdfContext.zoom, this.pagesContainer.nativeElement);
1432
1467
  newZoom = Math.round(newZoom * 100) / 100;
1433
- if (hasObservers(this.zoomLevelChange)) {
1468
+ const sameZoom = this.zoom === newZoom;
1469
+ if (!sameZoom && emit && hasObservers(this.zoomLevelChange)) {
1434
1470
  this.zoomLevelChange.emit({
1435
1471
  previousZoomLevel: this.zoom,
1436
1472
  currentZoomLevel: newZoom
@@ -1512,10 +1548,19 @@ class PDFViewerComponent {
1512
1548
  dom: this.pagesContainer.nativeElement,
1513
1549
  zoom: ((_a = this.pdfContext) === null || _a === void 0 ? void 0 : _a.zoom) || this.zoom,
1514
1550
  done: (e) => {
1515
- this.ngZone.run(() => {
1516
- this.loading = false;
1551
+ if (!this._zoomToFit) {
1552
+ this.ngZone.run(() => {
1553
+ this.pdfContext = Object.assign(Object.assign({}, e), { element: this.pagesContainer.nativeElement });
1554
+ this.loading = false;
1555
+ this.cdr.markForCheck();
1556
+ });
1557
+ }
1558
+ else {
1559
+ const zoomLevelOption = this.zoomOptionsData.find(item => item.type === this._fitType);
1517
1560
  this.pdfContext = Object.assign(Object.assign({}, e), { element: this.pagesContainer.nativeElement });
1518
- });
1561
+ this.onZoomLevelChange(zoomLevelOption, false);
1562
+ this.cdr.markForCheck();
1563
+ }
1519
1564
  if (this.pdfScroller) {
1520
1565
  this.pdfScroller.destroy();
1521
1566
  }
@@ -1550,7 +1595,10 @@ class PDFViewerComponent {
1550
1595
  dom: this.pagesContainer.nativeElement,
1551
1596
  done: (pdfPages) => {
1552
1597
  this.pdfContext.pdfPages = pdfPages;
1553
- this.ngZone.run(() => this.loading = false);
1598
+ this.ngZone.run(() => {
1599
+ this.loading = false;
1600
+ this.cdr.markForCheck();
1601
+ });
1554
1602
  this.assignPageIds();
1555
1603
  },
1556
1604
  error: (e) => {
@@ -1574,7 +1622,7 @@ class PDFViewerComponent {
1574
1622
  }
1575
1623
  setZoomLevel(zoom) {
1576
1624
  const option = this.zoomOptionsData.find(item => !item.type && item.value === zoom);
1577
- this.zoomLevel = option || {
1625
+ this.zoomLevel = option ? Object.assign({}, option) : {
1578
1626
  value: zoom,
1579
1627
  displayValue: `${Math.round(zoom * 100)}%`,
1580
1628
  text: `${Math.round(zoom * 100)}%`
@@ -1594,7 +1642,7 @@ class PDFViewerComponent {
1594
1642
  return this[source] || (changes[source] && changes[source].currentValue);
1595
1643
  }
1596
1644
  }
1597
- PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1645
+ PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1598
1646
  PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFViewerComponent, isStandalone: true, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
1599
1647
  LocalizationService,
1600
1648
  {
@@ -1884,7 +1932,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1884
1932
  standalone: true,
1885
1933
  imports: [LocalizedPDFViewerMessagesDirective, NgIf, LoaderComponent, ToolbarComponent, PDFViewerSearchComponent, WatermarkOverlayComponent]
1886
1934
  }]
1887
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
1935
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
1888
1936
  type: HostBinding,
1889
1937
  args: ['class.k-pdf-viewer']
1890
1938
  }], direction: [{
@@ -17,6 +17,7 @@ import * as i1$1 from '@progress/kendo-angular-dropdowns';
17
17
  import { ComboBoxComponent, ItemTemplateDirective } from '@progress/kendo-angular-dropdowns';
18
18
  import { ButtonGroupComponent, ButtonComponent } from '@progress/kendo-angular-buttons';
19
19
  import { NgFor, NgSwitch, NgSwitchCase, NgIf } from '@angular/common';
20
+ import { map } from 'rxjs/operators';
20
21
  import { TextBoxComponent, TextBoxSuffixTemplateDirective } from '@progress/kendo-angular-inputs';
21
22
  import { LoaderComponent as LoaderComponent$1 } from '@progress/kendo-angular-indicators';
22
23
  import 'pdfjs-dist/build/pdf.worker.entry';
@@ -125,8 +126,8 @@ const packageMetadata = {
125
126
  name: '@progress/kendo-angular-pdfviewer',
126
127
  productName: 'Kendo UI for Angular',
127
128
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
128
- publishDate: 1724742168,
129
- version: '16.8.0',
129
+ publishDate: 1724927490,
130
+ version: '16.9.0-develop.10',
130
131
  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',
131
132
  };
132
133
 
@@ -198,6 +199,13 @@ const zoomOptionsData = [{
198
199
  displayValue: '400%',
199
200
  value: 4
200
201
  }];
202
+ /**
203
+ * @hidden
204
+ */
205
+ const zoomToFitOptions = {
206
+ 'fitToPage': 'FitToPage',
207
+ 'fitToWidth': 'FitToWidth'
208
+ };
201
209
 
202
210
  /**
203
211
  * Arguments for the `download` event. The event fires when the end user clicks the Download tool.
@@ -456,6 +464,15 @@ class ToolbarComponent {
456
464
  this.downloadIcon = downloadIcon;
457
465
  this.printIcon = printIcon;
458
466
  this.pagerType = 'input';
467
+ this.valueNormalizer = (text) => text.pipe(map((value) => {
468
+ const parsedValue = parseFloat(value);
469
+ const newValue = Number.isNaN(parsedValue) ? 1 : parsedValue / 100;
470
+ return {
471
+ value: newValue,
472
+ displayValue: `${Math.round(newValue * 100)}%`,
473
+ text: `${Math.round(newValue * 100)}%`
474
+ };
475
+ }));
459
476
  }
460
477
  messageFor(key) {
461
478
  return this.localization.get(key);
@@ -558,6 +575,8 @@ ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versi
558
575
  valueField="id"
559
576
  [value]="zoomLevelChooserValue"
560
577
  [allowCustom]="true"
578
+ [valueNormalizer]="valueNormalizer"
579
+ [clearButton]="false"
561
580
  (valueChange)="onZoomLevelChooserValueChange($event)">
562
581
  <ng-template kendoComboBoxItemTemplate let-dataItem>
563
582
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
@@ -728,6 +747,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
728
747
  valueField="id"
729
748
  [value]="zoomLevelChooserValue"
730
749
  [allowCustom]="true"
750
+ [valueNormalizer]="valueNormalizer"
751
+ [clearButton]="false"
731
752
  (valueChange)="onZoomLevelChooserValueChange($event)">
732
753
  <ng-template kendoComboBoxItemTemplate let-dataItem>
733
754
  {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
@@ -1134,10 +1155,11 @@ let counter = 0;
1134
1155
  * Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
1135
1156
  */
1136
1157
  class PDFViewerComponent {
1137
- constructor(ngZone, renderer, localizationService) {
1158
+ constructor(ngZone, renderer, localizationService, cdr) {
1138
1159
  this.ngZone = ngZone;
1139
1160
  this.renderer = renderer;
1140
1161
  this.localizationService = localizationService;
1162
+ this.cdr = cdr;
1141
1163
  this.hostClass = true;
1142
1164
  /**
1143
1165
  * Represents the tools collection rendered in the toolbar.
@@ -1174,12 +1196,6 @@ class PDFViewerComponent {
1174
1196
  * @default {}
1175
1197
  */
1176
1198
  this.saveOptions = {};
1177
- /**
1178
- * The initial zoom level of the PDF document.
1179
- *
1180
- * @default 1.25
1181
- */
1182
- this.zoom = INITIAL_ZOOM_LEVEL;
1183
1199
  /**
1184
1200
  * Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
1185
1201
  * @default 0.25
@@ -1227,7 +1243,9 @@ class PDFViewerComponent {
1227
1243
  this.zoomOptionsData = zoomOptionsData;
1228
1244
  this.zoomLevel = this.zoomOptionsData[5];
1229
1245
  this._pdfContext = null;
1230
- this._enabedSelection = false;
1246
+ this._enabledSelection = false;
1247
+ this._zoom = INITIAL_ZOOM_LEVEL;
1248
+ this._zoomToFit = false;
1231
1249
  this.subs = new Subscription();
1232
1250
  this.scrollListener = (e) => {
1233
1251
  const nextPage = currentPage(e.target.parentNode);
@@ -1246,6 +1264,26 @@ class PDFViewerComponent {
1246
1264
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
1247
1265
  counter++;
1248
1266
  }
1267
+ /**
1268
+ * The initial zoom level of the PDF document.
1269
+ *
1270
+ * @default 1.25
1271
+ */
1272
+ set zoom(value) {
1273
+ if (typeof value === 'number') {
1274
+ this._zoom = value;
1275
+ this._fitType = null;
1276
+ this.setZoomLevel(value);
1277
+ }
1278
+ else {
1279
+ this._zoom = 1;
1280
+ this._fitType = zoomToFitOptions[value];
1281
+ }
1282
+ this._zoomToFit = typeof value !== 'number';
1283
+ }
1284
+ get zoom() {
1285
+ return this._zoom;
1286
+ }
1249
1287
  /**
1250
1288
  * Returns the current page number of the loaded PDF document.
1251
1289
  */
@@ -1287,13 +1325,13 @@ class PDFViewerComponent {
1287
1325
  if (this.pdfScroller) {
1288
1326
  value ? this.pdfScroller.disablePanEventsTracking() : this.pdfScroller.enablePanEventsTracking();
1289
1327
  }
1290
- this._enabedSelection = value;
1328
+ this._enabledSelection = value;
1291
1329
  }
1292
1330
  /**
1293
1331
  * @hidden
1294
1332
  */
1295
1333
  get enabledSelection() {
1296
- return this._enabedSelection;
1334
+ return this._enabledSelection;
1297
1335
  }
1298
1336
  ngOnInit() {
1299
1337
  this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
@@ -1325,9 +1363,6 @@ class PDFViewerComponent {
1325
1363
  if (newUrl || newArrayBuffer || newBase64Data || newTypedArray) {
1326
1364
  this.loadPdf(source, this[source]);
1327
1365
  }
1328
- if (changes['zoom']) {
1329
- this.setZoomLevel(changes['zoom'].currentValue);
1330
- }
1331
1366
  }
1332
1367
  /**
1333
1368
  * Scrolls the PDFViewer document to the specified page number, treating 0 as the first page.
@@ -1417,17 +1452,18 @@ class PDFViewerComponent {
1417
1452
  /**
1418
1453
  * @hidden
1419
1454
  */
1420
- onZoomLevelChange(zoomLevel) {
1421
- if (typeof zoomLevel === 'string') {
1422
- const parsedValue = parseFloat(zoomLevel);
1423
- zoomLevel = { value: Number.isNaN(parsedValue) ? 1 : parsedValue / 100 };
1424
- }
1455
+ onZoomLevelChange(zoomLevel, emit = true) {
1425
1456
  if (!zoomLevel) {
1426
- zoomLevel = { value: 1 };
1457
+ zoomLevel = {
1458
+ value: 1,
1459
+ displayValue: '100%',
1460
+ text: '100%'
1461
+ };
1427
1462
  }
1428
1463
  let newZoom = calculateZoomLevel(zoomLevel.value, zoomLevel.type, this.pdfContext.zoom, this.pagesContainer.nativeElement);
1429
1464
  newZoom = Math.round(newZoom * 100) / 100;
1430
- if (hasObservers(this.zoomLevelChange)) {
1465
+ const sameZoom = this.zoom === newZoom;
1466
+ if (!sameZoom && emit && hasObservers(this.zoomLevelChange)) {
1431
1467
  this.zoomLevelChange.emit({
1432
1468
  previousZoomLevel: this.zoom,
1433
1469
  currentZoomLevel: newZoom
@@ -1508,10 +1544,19 @@ class PDFViewerComponent {
1508
1544
  dom: this.pagesContainer.nativeElement,
1509
1545
  zoom: this.pdfContext?.zoom || this.zoom,
1510
1546
  done: (e) => {
1511
- this.ngZone.run(() => {
1512
- this.loading = false;
1547
+ if (!this._zoomToFit) {
1548
+ this.ngZone.run(() => {
1549
+ this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
1550
+ this.loading = false;
1551
+ this.cdr.markForCheck();
1552
+ });
1553
+ }
1554
+ else {
1555
+ const zoomLevelOption = this.zoomOptionsData.find(item => item.type === this._fitType);
1513
1556
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
1514
- });
1557
+ this.onZoomLevelChange(zoomLevelOption, false);
1558
+ this.cdr.markForCheck();
1559
+ }
1515
1560
  if (this.pdfScroller) {
1516
1561
  this.pdfScroller.destroy();
1517
1562
  }
@@ -1545,7 +1590,10 @@ class PDFViewerComponent {
1545
1590
  dom: this.pagesContainer.nativeElement,
1546
1591
  done: (pdfPages) => {
1547
1592
  this.pdfContext.pdfPages = pdfPages;
1548
- this.ngZone.run(() => this.loading = false);
1593
+ this.ngZone.run(() => {
1594
+ this.loading = false;
1595
+ this.cdr.markForCheck();
1596
+ });
1549
1597
  this.assignPageIds();
1550
1598
  },
1551
1599
  error: (e) => {
@@ -1569,7 +1617,7 @@ class PDFViewerComponent {
1569
1617
  }
1570
1618
  setZoomLevel(zoom) {
1571
1619
  const option = this.zoomOptionsData.find(item => !item.type && item.value === zoom);
1572
- this.zoomLevel = option || {
1620
+ this.zoomLevel = option ? { ...option } : {
1573
1621
  value: zoom,
1574
1622
  displayValue: `${Math.round(zoom * 100)}%`,
1575
1623
  text: `${Math.round(zoom * 100)}%`
@@ -1589,7 +1637,7 @@ class PDFViewerComponent {
1589
1637
  return this[source] || (changes[source] && changes[source].currentValue);
1590
1638
  }
1591
1639
  }
1592
- PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
1640
+ PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1593
1641
  PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFViewerComponent, isStandalone: true, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
1594
1642
  LocalizationService,
1595
1643
  {
@@ -1879,7 +1927,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1879
1927
  standalone: true,
1880
1928
  imports: [LocalizedPDFViewerMessagesDirective, NgIf, LoaderComponent, ToolbarComponent, PDFViewerSearchComponent, WatermarkOverlayComponent]
1881
1929
  }]
1882
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }]; }, propDecorators: { hostClass: [{
1930
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { hostClass: [{
1883
1931
  type: HostBinding,
1884
1932
  args: ['class.k-pdf-viewer']
1885
1933
  }], direction: [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-pdfviewer",
3
- "version": "16.8.0",
3
+ "version": "16.9.0-develop.10",
4
4
  "description": "Kendo UI PDFViewer for Angular",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -23,21 +23,21 @@
23
23
  "@angular/core": "15 - 18",
24
24
  "@angular/platform-browser": "15 - 18",
25
25
  "@progress/kendo-licensing": "^1.0.2",
26
- "@progress/kendo-angular-buttons": "16.8.0",
27
- "@progress/kendo-angular-common": "16.8.0",
28
- "@progress/kendo-angular-dropdowns": "16.8.0",
29
- "@progress/kendo-angular-inputs": "16.8.0",
30
- "@progress/kendo-angular-intl": "16.8.0",
31
- "@progress/kendo-angular-l10n": "16.8.0",
32
- "@progress/kendo-angular-icons": "16.8.0",
33
- "@progress/kendo-angular-indicators": "16.8.0",
34
- "@progress/kendo-angular-pager": "16.8.0",
35
- "@progress/kendo-angular-popup": "16.8.0",
26
+ "@progress/kendo-angular-buttons": "16.9.0-develop.10",
27
+ "@progress/kendo-angular-common": "16.9.0-develop.10",
28
+ "@progress/kendo-angular-dropdowns": "16.9.0-develop.10",
29
+ "@progress/kendo-angular-inputs": "16.9.0-develop.10",
30
+ "@progress/kendo-angular-intl": "16.9.0-develop.10",
31
+ "@progress/kendo-angular-l10n": "16.9.0-develop.10",
32
+ "@progress/kendo-angular-icons": "16.9.0-develop.10",
33
+ "@progress/kendo-angular-indicators": "16.9.0-develop.10",
34
+ "@progress/kendo-angular-pager": "16.9.0-develop.10",
35
+ "@progress/kendo-angular-popup": "16.9.0-develop.10",
36
36
  "rxjs": "^6.5.3 || ^7.0.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "tslib": "^2.3.1",
40
- "@progress/kendo-angular-schematics": "16.8.0",
40
+ "@progress/kendo-angular-schematics": "16.9.0-develop.10",
41
41
  "@progress/kendo-file-saver": "^1.0.1",
42
42
  "@progress/kendo-pdfviewer-common": "0.2.10"
43
43
  },
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2024 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 { AfterViewInit, EventEmitter, NgZone, OnDestroy, OnInit, Renderer2, SimpleChanges } from '@angular/core';
5
+ import { AfterViewInit, ChangeDetectorRef, EventEmitter, NgZone, OnDestroy, OnInit, Renderer2, SimpleChanges } from '@angular/core';
6
6
  import { LoaderSettings } from './models/loader-settings';
7
7
  import { TypedArray } from '@progress/kendo-pdfviewer-common';
8
8
  import { PDFViewerContext } from './models/pdfviewer-context';
@@ -22,6 +22,7 @@ export declare class PDFViewerComponent implements OnInit, AfterViewInit, OnDest
22
22
  private ngZone;
23
23
  private renderer;
24
24
  private localizationService;
25
+ private cdr;
25
26
  hostClass: boolean;
26
27
  direction: string;
27
28
  /**
@@ -65,7 +66,8 @@ export declare class PDFViewerComponent implements OnInit, AfterViewInit, OnDest
65
66
  *
66
67
  * @default 1.25
67
68
  */
68
- zoom: number;
69
+ set zoom(value: number | 'fitToPage' | 'fitToWidth');
70
+ get zoom(): number;
69
71
  /**
70
72
  * Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
71
73
  * @default 0.25
@@ -152,11 +154,14 @@ export declare class PDFViewerComponent implements OnInit, AfterViewInit, OnDest
152
154
  })[];
153
155
  zoomLevel: ZoomLevel;
154
156
  private _pdfContext;
155
- private _enabedSelection;
157
+ private _enabledSelection;
158
+ private _zoom;
159
+ private _fitType;
160
+ private _zoomToFit;
156
161
  private pdfScroller;
157
162
  private searchService;
158
163
  private subs;
159
- constructor(ngZone: NgZone, renderer: Renderer2, localizationService: LocalizationService);
164
+ constructor(ngZone: NgZone, renderer: Renderer2, localizationService: LocalizationService, cdr: ChangeDetectorRef);
160
165
  ngOnInit(): void;
161
166
  ngAfterViewInit(): void;
162
167
  ngOnDestroy(): void;
@@ -192,7 +197,7 @@ export declare class PDFViewerComponent implements OnInit, AfterViewInit, OnDest
192
197
  /**
193
198
  * @hidden
194
199
  */
195
- onZoomLevelChange(zoomLevel: ZoomLevel | string): void;
200
+ onZoomLevelChange(zoomLevel: ZoomLevel, emit?: boolean): void;
196
201
  /**
197
202
  * @hidden
198
203
  */
@@ -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': '16.8.0',
8
- '@progress/kendo-angular-treeview': '16.8.0'
7
+ '@progress/kendo-angular-navigation': '16.9.0-develop.10',
8
+ '@progress/kendo-angular-treeview': '16.9.0-develop.10'
9
9
  } });
10
10
  return (0, schematics_1.externalSchematic)('@progress/kendo-angular-schematics', 'ng-add', finalOptions);
11
11
  }
@@ -9,6 +9,7 @@ import { SVGIcon } from '@progress/kendo-svg-icons';
9
9
  import { ToolbarNavigationService } from './toolbar-navigation.service';
10
10
  import { PDFViewerTool } from '../models/toolbar-tool';
11
11
  import { ZoomLevel } from '../models/zoom-level';
12
+ import { Observable } from 'rxjs';
12
13
  import * as i0 from "@angular/core";
13
14
  /**
14
15
  * @hidden
@@ -61,6 +62,11 @@ export declare class ToolbarComponent {
61
62
  onFileSelect(e: any): void;
62
63
  onZoomLevelChooserValueChange(zoomLevel: ZoomLevel): void;
63
64
  focus(): void;
65
+ valueNormalizer: (text: Observable<string>) => Observable<{
66
+ value: number;
67
+ displayValue: string;
68
+ text: string;
69
+ }>;
64
70
  static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
65
71
  static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "[kendoPDFViewerToolbar]", never, { "zoomLevel": "zoomLevel"; "calculatedComboBoxValue": "calculatedComboBoxValue"; "skip": "skip"; "pageSize": "pageSize"; "total": "total"; "zoomInDisabled": "zoomInDisabled"; "zoomOutDisabled": "zoomOutDisabled"; "disabledTools": "disabledTools"; "zoomLevelChooserValue": "zoomLevelChooserValue"; "zoomOptionsData": "zoomOptionsData"; "pagesContainerId": "pagesContainerId"; "tools": "tools"; }, { "fileSelect": "fileSelect"; "fileSelectStart": "fileSelectStart"; "fileSelectError": "fileSelectError"; "download": "download"; "selectionEnabled": "selectionEnabled"; "panningEnabled": "panningEnabled"; "pageChange": "pageChange"; "zoomIn": "zoomIn"; "zoomOut": "zoomOut"; "zoomLevelChange": "zoomLevelChange"; "print": "print"; "search": "search"; }, never, never, true, never>;
66
72
  }
package/util.d.ts CHANGED
@@ -30,3 +30,10 @@ export declare const zoomOptionsData: ({
30
30
  value: number;
31
31
  type?: undefined;
32
32
  })[];
33
+ /**
34
+ * @hidden
35
+ */
36
+ export declare const zoomToFitOptions: {
37
+ fitToPage: string;
38
+ fitToWidth: string;
39
+ };