@progress/kendo-angular-pdfviewer 19.3.0-develop.9 → 19.3.1-develop.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.
@@ -3,26 +3,30 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
- import { Directive, Input, forwardRef, Component, Injectable, HostBinding, EventEmitter, ViewChild, Output, ElementRef, HostListener, isDevMode, NgModule } from '@angular/core';
6
+ import { Directive, Input, forwardRef, Component, Injectable, HostBinding, EventEmitter, ViewChild, Output, ElementRef, HostListener, isDevMode, ViewContainerRef, NgModule } from '@angular/core';
7
7
  import * as i1 from '@progress/kendo-angular-l10n';
8
8
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
9
  import { validatePackage } from '@progress/kendo-licensing';
10
- import { removeChildren, PdfViewer } from '@progress/kendo-pdfviewer-common';
11
- import { PreventableEvent, Keys, focusableSelector, shouldShowValidationUI, hasObservers, EventsOutsideAngularDirective, WatermarkOverlayComponent, ResizeBatchService } from '@progress/kendo-angular-common';
12
- import { saveAs } from '@progress/kendo-file-saver';
10
+ import { PdfViewerInteractionMode, removeChildren, PdfViewer } from '@progress/kendo-pdfviewer-common';
11
+ import { PreventableEvent, Keys, normalizeNumpadKeys, focusableSelector, getLicenseMessage, shouldShowValidationUI, hasObservers, EventsOutsideAngularDirective, WatermarkOverlayComponent, ResizeBatchService } from '@progress/kendo-angular-common';
13
12
  import { Subscription } from 'rxjs';
14
13
  import { PagerComponent, CustomMessagesComponent } from '@progress/kendo-angular-pager';
15
- import { zoomInIcon, zoomOutIcon, handIcon, pointerIcon, searchIcon, folderOpenIcon, downloadIcon, printIcon, convertLowercaseIcon, arrowUpIcon, arrowDownIcon, xIcon } from '@progress/kendo-svg-icons';
14
+ import { zoomInIcon, zoomOutIcon, handIcon, pointerIcon, searchIcon, folderOpenIcon, downloadIcon, printIcon, trackChangesIcon, highlightIcon, freeTextIcon, xIcon, convertLowercaseIcon, arrowUpIcon, arrowDownIcon, paletteIcon, trashIcon, checkIcon } from '@progress/kendo-svg-icons';
16
15
  import * as i1$1 from '@progress/kendo-angular-dropdowns';
17
- import { ComboBoxComponent, ItemTemplateDirective } from '@progress/kendo-angular-dropdowns';
18
- import { ButtonGroupComponent, ButtonComponent } from '@progress/kendo-angular-buttons';
16
+ import { ComboBoxComponent, ItemTemplateDirective, KENDO_DROPDOWNLIST } from '@progress/kendo-angular-dropdowns';
17
+ import * as i2 from '@progress/kendo-angular-buttons';
18
+ import { ButtonGroupComponent, ButtonComponent, KENDO_BUTTON } from '@progress/kendo-angular-buttons';
19
19
  import { NgFor, NgSwitch, NgSwitchCase, NgIf } from '@angular/common';
20
- import { map } from 'rxjs/operators';
21
- import { TextBoxComponent, TextBoxSuffixTemplateDirective } from '@progress/kendo-angular-inputs';
20
+ import { map, take } from 'rxjs/operators';
21
+ import * as i3 from '@progress/kendo-angular-inputs';
22
+ import { TextBoxComponent, TextBoxSuffixTemplateDirective, KENDO_FLATCOLORPICKER } from '@progress/kendo-angular-inputs';
22
23
  import { LoaderComponent as LoaderComponent$1 } from '@progress/kendo-angular-indicators';
23
24
  import 'pdfjs-dist/build/pdf.worker.min.mjs';
24
- import { IconsService } from '@progress/kendo-angular-icons';
25
+ import * as i2$1 from '@progress/kendo-angular-popup';
25
26
  import { PopupService } from '@progress/kendo-angular-popup';
27
+ import * as i1$2 from '@progress/kendo-angular-dialog';
28
+ import { DialogService } from '@progress/kendo-angular-dialog';
29
+ import { IconsService } from '@progress/kendo-angular-icons';
26
30
 
27
31
  /**
28
32
  * @hidden
@@ -128,8 +132,56 @@ class Messages extends ComponentMessages {
128
132
  * Sets the placeholder text for the zoom tool input.
129
133
  */
130
134
  zoomInputPlaceholder;
135
+ /**
136
+ * Sets the title and label for the **Annotation Editor** tool.
137
+ */
138
+ annotationsTitle;
139
+ /**
140
+ * Sets the title and label for the **Annotation Editor** tool.
141
+ */
142
+ annotationEditorTitle;
143
+ /**
144
+ * Sets the title and label for the **Delete Annotation** tool.
145
+ */
146
+ deleteAnnotationTitle;
147
+ /**
148
+ * Sets the title and label for the **Highligh Annotation** tool.
149
+ */
150
+ highlightAnnotationTitle;
151
+ /**
152
+ * Sets the title and label for the **Free Text Annotation** tool.
153
+ */
154
+ freeTextAnnotationTitle;
155
+ /**
156
+ * Sets the title and label for the **Close Annotations Toolbar** tool.
157
+ */
158
+ closeAnnotationsToolbarTitle;
159
+ /**
160
+ * Sets the title of the **Delete Annotation** confirmation dialog.
161
+ */
162
+ deleteAnnotationConfirmationDialogTitle;
163
+ /**
164
+ * Sets the content text of the **Delete Annotation** confirmation dialog.
165
+ */
166
+ deleteAnnotationConfirmationDialogContent;
167
+ /**
168
+ * Sets the text of the **Delete Annotation** confirmation dialog confirm action button.
169
+ */
170
+ deleteAnnotationConfirmationDialogConfirmText;
171
+ /**
172
+ * Sets the text of the **Delete Annotation** confirmation dialog reject action button.
173
+ */
174
+ deleteAnnotationConfirmationDialogRejectText;
175
+ /**
176
+ * Sets the text of the **Font Size** section in the annotation editor dialog.
177
+ */
178
+ annotationEditorFontSizeTitle;
179
+ /**
180
+ * Sets the text of the **Color** section in the annotation editor dialog.
181
+ */
182
+ annotationEditorColorTitle;
131
183
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
132
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: Messages, selector: "kendo-pdfviewer-messages-base", inputs: { zoomInTitle: "zoomInTitle", zoomOutTitle: "zoomOutTitle", selectionTitle: "selectionTitle", panningTitle: "panningTitle", searchTitle: "searchTitle", openTitle: "openTitle", downloadTitle: "downloadTitle", printTitle: "printTitle", pagerInputLabel: "pagerInputLabel", pagerInputTitle: "pagerInputTitle", pagerFirstPage: "pagerFirstPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerLastPage: "pagerLastPage", pagerOf: "pagerOf", pagerPage: "pagerPage", fitToPage: "fitToPage", fitToWidth: "fitToWidth", searchInputPlaceholder: "searchInputPlaceholder", searchMatchesOf: "searchMatchesOf", searchPreviousMatchTitle: "searchPreviousMatchTitle", searchNextMatchTitle: "searchNextMatchTitle", searchCloseTitle: "searchCloseTitle", searchMatchCaseTitle: "searchMatchCaseTitle", zoomInputPlaceholder: "zoomInputPlaceholder" }, usesInheritance: true, ngImport: i0 });
184
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: Messages, selector: "kendo-pdfviewer-messages-base", inputs: { zoomInTitle: "zoomInTitle", zoomOutTitle: "zoomOutTitle", selectionTitle: "selectionTitle", panningTitle: "panningTitle", searchTitle: "searchTitle", openTitle: "openTitle", downloadTitle: "downloadTitle", printTitle: "printTitle", pagerInputLabel: "pagerInputLabel", pagerInputTitle: "pagerInputTitle", pagerFirstPage: "pagerFirstPage", pagerPreviousPage: "pagerPreviousPage", pagerNextPage: "pagerNextPage", pagerLastPage: "pagerLastPage", pagerOf: "pagerOf", pagerPage: "pagerPage", fitToPage: "fitToPage", fitToWidth: "fitToWidth", searchInputPlaceholder: "searchInputPlaceholder", searchMatchesOf: "searchMatchesOf", searchPreviousMatchTitle: "searchPreviousMatchTitle", searchNextMatchTitle: "searchNextMatchTitle", searchCloseTitle: "searchCloseTitle", searchMatchCaseTitle: "searchMatchCaseTitle", zoomInputPlaceholder: "zoomInputPlaceholder", annotationsTitle: "annotationsTitle", annotationEditorTitle: "annotationEditorTitle", deleteAnnotationTitle: "deleteAnnotationTitle", highlightAnnotationTitle: "highlightAnnotationTitle", freeTextAnnotationTitle: "freeTextAnnotationTitle", closeAnnotationsToolbarTitle: "closeAnnotationsToolbarTitle", deleteAnnotationConfirmationDialogTitle: "deleteAnnotationConfirmationDialogTitle", deleteAnnotationConfirmationDialogContent: "deleteAnnotationConfirmationDialogContent", deleteAnnotationConfirmationDialogConfirmText: "deleteAnnotationConfirmationDialogConfirmText", deleteAnnotationConfirmationDialogRejectText: "deleteAnnotationConfirmationDialogRejectText", annotationEditorFontSizeTitle: "annotationEditorFontSizeTitle", annotationEditorColorTitle: "annotationEditorColorTitle" }, usesInheritance: true, ngImport: i0 });
133
185
  }
134
186
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, decorators: [{
135
187
  type: Directive,
@@ -187,6 +239,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
187
239
  type: Input
188
240
  }], zoomInputPlaceholder: [{
189
241
  type: Input
242
+ }], annotationsTitle: [{
243
+ type: Input
244
+ }], annotationEditorTitle: [{
245
+ type: Input
246
+ }], deleteAnnotationTitle: [{
247
+ type: Input
248
+ }], highlightAnnotationTitle: [{
249
+ type: Input
250
+ }], freeTextAnnotationTitle: [{
251
+ type: Input
252
+ }], closeAnnotationsToolbarTitle: [{
253
+ type: Input
254
+ }], deleteAnnotationConfirmationDialogTitle: [{
255
+ type: Input
256
+ }], deleteAnnotationConfirmationDialogContent: [{
257
+ type: Input
258
+ }], deleteAnnotationConfirmationDialogConfirmText: [{
259
+ type: Input
260
+ }], deleteAnnotationConfirmationDialogRejectText: [{
261
+ type: Input
262
+ }], annotationEditorFontSizeTitle: [{
263
+ type: Input
264
+ }], annotationEditorColorTitle: [{
265
+ type: Input
190
266
  }] } });
191
267
 
192
268
  /**
@@ -240,8 +316,8 @@ const packageMetadata = {
240
316
  productName: 'Kendo UI for Angular',
241
317
  productCode: 'KENDOUIANGULAR',
242
318
  productCodes: ['KENDOUIANGULAR'],
243
- publishDate: 1752672489,
244
- version: '19.3.0-develop.9',
319
+ publishDate: 1755502860,
320
+ version: '19.3.1-develop.1',
245
321
  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',
246
322
  };
247
323
 
@@ -320,15 +396,15 @@ const zoomToFitOptions = {
320
396
  'fitToPage': 'FitToPage',
321
397
  'fitToWidth': 'FitToWidth'
322
398
  };
399
+ /**
400
+ * @hidden
401
+ */
402
+ const fontSizes = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
323
403
 
324
404
  /**
325
405
  * Represents the arguments for the PDFViewer `download` event. The event fires when the user clicks the **Download** tool. Canceling the event prevents the download.
326
406
  */
327
407
  class PDFViewerDownloadEvent extends PreventableEvent {
328
- /**
329
- * Provides the Blob object to be saved.
330
- */
331
- blob;
332
408
  /**
333
409
  * Provides the file name for saving.
334
410
  */
@@ -344,9 +420,8 @@ class PDFViewerDownloadEvent extends PreventableEvent {
344
420
  /**
345
421
  * @hidden
346
422
  */
347
- constructor(blob, fileName, saveOptions, context) {
423
+ constructor(fileName, saveOptions, context) {
348
424
  super();
349
- this.blob = blob;
350
425
  this.fileName = fileName;
351
426
  this.saveOptions = saveOptions;
352
427
  this.context = context;
@@ -419,7 +494,7 @@ class ToolbarComboBoxDirective {
419
494
  this.inputElement.removeEventListener('keydown', this.keydownHandler);
420
495
  }
421
496
  keydownHandler = (e) => {
422
- if (e.keyCode === Keys.Escape) {
497
+ if (e.code === Keys.Escape) {
423
498
  e.stopPropagation();
424
499
  if (this.combo.isOpen) {
425
500
  this.combo.toggle(false);
@@ -460,8 +535,9 @@ class ToolbarFocusableDirective {
460
535
  this.renderer.setAttribute(element, 'tabindex', this.navigationService.isActive(this) ? '0' : '-1');
461
536
  element.addEventListener('keydown', (e) => {
462
537
  const targetsSelf = e.target === element;
463
- const isLeftArrow = e.keyCode === Keys.ArrowLeft;
464
- const isRightArrow = e.keyCode === Keys.ArrowRight;
538
+ const code = normalizeNumpadKeys(e);
539
+ const isLeftArrow = code === Keys.ArrowLeft;
540
+ const isRightArrow = code === Keys.ArrowRight;
465
541
  const isArrow = isLeftArrow || isRightArrow;
466
542
  if (!targetsSelf || !isArrow) {
467
543
  return;
@@ -589,6 +665,10 @@ class ToolbarComponent {
589
665
  zoomOptionsData;
590
666
  pagesContainerId;
591
667
  tools;
668
+ type = 'tools';
669
+ wrapperId;
670
+ isAnnotationsToolbarVisible = false;
671
+ annotationsToolId;
592
672
  fileSelect = new EventEmitter();
593
673
  fileSelectStart = new EventEmitter();
594
674
  fileSelectError = new EventEmitter();
@@ -601,6 +681,8 @@ class ToolbarComponent {
601
681
  zoomLevelChange = new EventEmitter();
602
682
  print = new EventEmitter();
603
683
  search = new EventEmitter();
684
+ toggleAnnotationsToolbar = new EventEmitter();
685
+ setAnnotationMode = new EventEmitter();
604
686
  zoomInIcon = zoomInIcon;
605
687
  zoomOutIcon = zoomOutIcon;
606
688
  handIcon = handIcon;
@@ -609,7 +691,14 @@ class ToolbarComponent {
609
691
  folderOpenIcon = folderOpenIcon;
610
692
  downloadIcon = downloadIcon;
611
693
  printIcon = printIcon;
694
+ trackChangesIcon = trackChangesIcon;
695
+ highlightIcon = highlightIcon;
696
+ freeTextIcon = freeTextIcon;
697
+ xIcon = xIcon;
612
698
  pagerType = 'input';
699
+ isSelectionEnabled = false;
700
+ isHighlightMode;
701
+ isFreeTextMode;
613
702
  constructor(localization, navigationService) {
614
703
  this.localization = localization;
615
704
  this.navigationService = navigationService;
@@ -638,6 +727,16 @@ class ToolbarComponent {
638
727
  focus() {
639
728
  this.navigationService.focusableTools[this.navigationService.currentFocusIndex].activate();
640
729
  }
730
+ onHighlightClick() {
731
+ this.isHighlightMode = !this.isHighlightMode;
732
+ this.isFreeTextMode = false;
733
+ this.setAnnotationMode.emit(this.isHighlightMode ? 'highlight' : 'none');
734
+ }
735
+ onFreeTextClick() {
736
+ this.isFreeTextMode = !this.isFreeTextMode;
737
+ this.isHighlightMode = false;
738
+ this.setAnnotationMode.emit(this.isFreeTextMode ? 'freeText' : 'none');
739
+ }
641
740
  valueNormalizer = (text) => text.pipe(map((value) => {
642
741
  const parsedValue = parseFloat(value);
643
742
  const newValue = Number.isNaN(parsedValue) ? 1 : parsedValue / 100;
@@ -648,184 +747,250 @@ class ToolbarComponent {
648
747
  };
649
748
  }));
650
749
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LocalizationService }, { token: ToolbarNavigationService }], target: i0.ɵɵFactoryTarget.Component });
651
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolbarComponent, isStandalone: true, selector: "[kendoPDFViewerToolbar]", inputs: { zoomLevel: "zoomLevel", calculatedComboBoxValue: "calculatedComboBoxValue", skip: "skip", pageSize: "pageSize", total: "total", zoomInDisabled: "zoomInDisabled", zoomOutDisabled: "zoomOutDisabled", disabledTools: "disabledTools", zoomLevelChooserValue: "zoomLevelChooserValue", zoomOptionsData: "zoomOptionsData", pagesContainerId: "pagesContainerId", tools: "tools" }, outputs: { fileSelect: "fileSelect", fileSelectStart: "fileSelectStart", fileSelectError: "fileSelectError", download: "download", selectionEnabled: "selectionEnabled", panningEnabled: "panningEnabled", pageChange: "pageChange", zoomIn: "zoomIn", zoomOut: "zoomOut", zoomLevelChange: "zoomLevelChange", print: "print", search: "search" }, host: { properties: { "class.k-toolbar": "this.toolbarClasses", "class.k-toolbar-md": "this.toolbarClasses", "class.k-toolbar-flat": "this.toolbarClasses" } }, providers: [ToolbarNavigationService], viewQueries: [{ propertyName: "fileSelectEl", first: true, predicate: ["fileSelectEl"], descendants: true }], ngImport: i0, template: `
652
- <ng-container *ngFor="let tool of tools">
653
- <ng-container [ngSwitch]="tool">
654
- <kendo-toolbar-input-wrapper
655
- *ngSwitchCase="'pager'"
656
- kendoPDFViewerToolbarFocusable
657
- [toolbarTool]="pager">
658
- <kendo-datapager
659
- #pager
750
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolbarComponent, isStandalone: true, selector: "[kendoPDFViewerToolbar]", inputs: { zoomLevel: "zoomLevel", calculatedComboBoxValue: "calculatedComboBoxValue", skip: "skip", pageSize: "pageSize", total: "total", zoomInDisabled: "zoomInDisabled", zoomOutDisabled: "zoomOutDisabled", disabledTools: "disabledTools", zoomLevelChooserValue: "zoomLevelChooserValue", zoomOptionsData: "zoomOptionsData", pagesContainerId: "pagesContainerId", tools: "tools", type: "type", wrapperId: "wrapperId", isAnnotationsToolbarVisible: "isAnnotationsToolbarVisible", annotationsToolId: "annotationsToolId" }, outputs: { fileSelect: "fileSelect", fileSelectStart: "fileSelectStart", fileSelectError: "fileSelectError", download: "download", selectionEnabled: "selectionEnabled", panningEnabled: "panningEnabled", pageChange: "pageChange", zoomIn: "zoomIn", zoomOut: "zoomOut", zoomLevelChange: "zoomLevelChange", print: "print", search: "search", toggleAnnotationsToolbar: "toggleAnnotationsToolbar", setAnnotationMode: "setAnnotationMode" }, host: { properties: { "class.k-toolbar": "this.toolbarClasses", "class.k-toolbar-md": "this.toolbarClasses", "class.k-toolbar-flat": "this.toolbarClasses" } }, providers: [ToolbarNavigationService], viewQueries: [{ propertyName: "fileSelectEl", first: true, predicate: ["fileSelectEl"], descendants: true }], ngImport: i0, template: `
751
+ <ng-container *ngIf="type === 'tools'">
752
+ <ng-container *ngFor="let tool of tools">
753
+ <ng-container [ngSwitch]="tool">
754
+ <kendo-toolbar-input-wrapper
755
+ *ngSwitchCase="'pager'"
756
+ kendoPDFViewerToolbarFocusable
757
+ [toolbarTool]="pager">
758
+ <kendo-datapager
759
+ #pager
760
+ [attr.aria-controls]="pagesContainerId"
761
+ [attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
762
+ [class.k-disabled]="disabledTools"
763
+ [navigable]="true"
764
+ [pageSize]="pageSize"
765
+ [skip]="skip"
766
+ [total]="total"
767
+ [pageSizeValues]="false"
768
+ [info]="false"
769
+ [type]="pagerType"
770
+ (pageChange)="pageChange.emit($event)">
771
+ <kendo-datapager-messages
772
+ [firstPage]="messageFor('pagerFirstPage')"
773
+ [previousPage]="messageFor('pagerPreviousPage')"
774
+ [nextPage]="messageFor('pagerNextPage')"
775
+ [lastPage]="messageFor('pagerLastPage')"
776
+ [inputLabel]="messageFor('pagerInputLabel')"
777
+ [pageNumberInputTitle]="messageFor('pagerInputTitle')"
778
+ [of]="messageFor('pagerOf')"
779
+ [page]="messageFor('pagerPage')"></kendo-datapager-messages>
780
+ </kendo-datapager>
781
+ </kendo-toolbar-input-wrapper>
782
+ <span
783
+ *ngSwitchCase="'spacer'"
784
+ class="k-spacer"></span>
785
+ <kendo-buttongroup
786
+ *ngSwitchCase="'zoomInOut'"
787
+ [attr.aria-controls]="pagesContainerId"
788
+ class="k-button-group-flat k-toolbar-button-group"
789
+ [navigable]="false">
790
+ <button
791
+ type="button"
792
+ kendoButton
793
+ fillMode="flat"
794
+ kendoPDFViewerToolbarFocusable
795
+ icon="zoom-out"
796
+ [disabled]="disabledTools || zoomOutDisabled"
797
+ [svgIcon]="zoomOutIcon"
798
+ [attr.title]="messageFor('zoomOutTitle')"
799
+ [attr.aria-label]="messageFor('zoomOutTitle')"
800
+ (click)="zoomOut.emit()"></button>
801
+ <button
802
+ type="button"
803
+ kendoButton
804
+ fillMode="flat"
805
+ kendoPDFViewerToolbarFocusable
806
+ icon="zoom-in"
807
+ [disabled]="disabledTools || zoomInDisabled"
808
+ [svgIcon]="zoomInIcon"
809
+ [attr.title]="messageFor('zoomInTitle')"
810
+ [attr.aria-label]="messageFor('zoomInTitle')"
811
+ (click)="zoomIn.emit()"></button>
812
+ </kendo-buttongroup>
813
+ <kendo-toolbar-input-wrapper
814
+ *ngSwitchCase="'zoom'"
815
+ kendoPDFViewerToolbarFocusable
816
+ [toolbarTool]="combobox">
817
+ <kendo-combobox
818
+ #combobox
819
+ kendoPDFViewerComboBox
820
+ class="k-toolbar-combobox"
821
+ fillMode="flat"
822
+ [attr.aria-controls]="pagesContainerId"
823
+ [tabindex]="-1"
824
+ [data]="zoomOptionsData"
825
+ [disabled]="disabledTools"
826
+ [placeholder]="messageFor('zoomInputPlaceholder')"
827
+ textField="displayValue"
828
+ valueField="id"
829
+ [value]="zoomLevelChooserValue"
830
+ [allowCustom]="true"
831
+ [valueNormalizer]="valueNormalizer"
832
+ [clearButton]="false"
833
+ (valueChange)="onZoomLevelChooserValueChange($event)">
834
+ <ng-template kendoComboBoxItemTemplate let-dataItem>
835
+ {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
836
+ </ng-template>
837
+ </kendo-combobox>
838
+ </kendo-toolbar-input-wrapper>
839
+ <kendo-buttongroup
840
+ *ngSwitchCase="'selection'"
660
841
  [attr.aria-controls]="pagesContainerId"
661
- [attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
662
- [class.k-disabled]="disabledTools"
663
- [navigable]="true"
664
- [pageSize]="pageSize"
665
- [skip]="skip"
666
- [total]="total"
667
- [pageSizeValues]="false"
668
- [info]="false"
669
- [type]="pagerType"
670
- (pageChange)="pageChange.emit($event)">
671
- <kendo-datapager-messages
672
- [firstPage]="messageFor('pagerFirstPage')"
673
- [previousPage]="messageFor('pagerPreviousPage')"
674
- [nextPage]="messageFor('pagerNextPage')"
675
- [lastPage]="messageFor('pagerLastPage')"
676
- [inputLabel]="messageFor('pagerInputLabel')"
677
- [pageNumberInputTitle]="messageFor('pagerInputTitle')"
678
- [of]="messageFor('pagerOf')"
679
- [page]="messageFor('pagerPage')"></kendo-datapager-messages>
680
- </kendo-datapager>
681
- </kendo-toolbar-input-wrapper>
682
- <span
683
- *ngSwitchCase="'spacer'"
684
- class="k-spacer"></span>
685
- <kendo-buttongroup
686
- *ngSwitchCase="'zoomInOut'"
687
- [attr.aria-controls]="pagesContainerId"
688
- class="k-button-group-flat k-toolbar-button-group"
689
- [navigable]="false">
842
+ [navigable]="false"
843
+ class="k-button-group-flat k-toolbar-button-group"
844
+ selection="single">
845
+ <button
846
+ type="button"
847
+ kendoButton
848
+ kendoPDFViewerToolbarFocusable
849
+ fillMode="flat"
850
+ icon="pointer"
851
+ [toggleable]="true"
852
+ [svgIcon]="pointerIcon"
853
+ [attr.title]="messageFor('selectionTitle')"
854
+ [attr.aria-label]="messageFor('selectionTitle')"
855
+ (click)="selectionEnabled.emit(); isSelectionEnabled = true;"></button>
856
+ <button
857
+ type="button"
858
+ kendoButton
859
+ kendoPDFViewerToolbarFocusable
860
+ fillMode="flat"
861
+ icon="hand"
862
+ [svgIcon]="handIcon"
863
+ [toggleable]="true"
864
+ [selected]="true"
865
+ [attr.title]="messageFor('panningTitle')"
866
+ [attr.aria-label]="messageFor('panningTitle')"
867
+ (click)="panningEnabled.emit(); isSelectionEnabled = false;"></button>
868
+ </kendo-buttongroup>
690
869
  <button
870
+ *ngSwitchCase="'search'"
691
871
  type="button"
872
+ kendoPDFViewerToolbarFocusable
692
873
  kendoButton
874
+ class="k-toolbar-button"
693
875
  fillMode="flat"
694
- kendoPDFViewerToolbarFocusable
695
- icon="zoom-out"
696
- [disabled]="disabledTools || zoomOutDisabled"
697
- [svgIcon]="zoomOutIcon"
698
- [attr.title]="messageFor('zoomOutTitle')"
699
- [attr.aria-label]="messageFor('zoomOutTitle')"
700
- (click)="zoomOut.emit()"></button>
876
+ icon="search"
877
+ [disabled]="disabledTools"
878
+ [attr.title]="messageFor('searchTitle')"
879
+ [attr.aria-label]="messageFor('searchTitle')"
880
+ aria-haspopup="dialog"
881
+ [svgIcon]="searchIcon"
882
+ (click)="search.emit()"></button>
701
883
  <button
884
+ *ngSwitchCase="'open'"
702
885
  type="button"
703
- kendoButton
704
886
  fillMode="flat"
705
887
  kendoPDFViewerToolbarFocusable
706
- icon="zoom-in"
707
- [disabled]="disabledTools || zoomInDisabled"
708
- [svgIcon]="zoomInIcon"
709
- [attr.title]="messageFor('zoomInTitle')"
710
- [attr.aria-label]="messageFor('zoomInTitle')"
711
- (click)="zoomIn.emit()"></button>
712
- </kendo-buttongroup>
713
- <kendo-toolbar-input-wrapper
714
- *ngSwitchCase="'zoom'"
715
- kendoPDFViewerToolbarFocusable
716
- [toolbarTool]="combobox">
717
- <kendo-combobox
718
- #combobox
719
- kendoPDFViewerComboBox
720
- class="k-toolbar-combobox"
888
+ kendoButton
889
+ class="k-toolbar-button"
721
890
  fillMode="flat"
891
+ icon="folder-open"
892
+ [svgIcon]="folderOpenIcon"
893
+ [attr.title]="messageFor('openTitle')"
894
+ [attr.aria-label]="messageFor('openTitle')"
722
895
  [attr.aria-controls]="pagesContainerId"
723
- [tabindex]="-1"
724
- [data]="zoomOptionsData"
725
- [disabled]="disabledTools"
726
- [placeholder]="messageFor('zoomInputPlaceholder')"
727
- textField="displayValue"
728
- valueField="id"
729
- [value]="zoomLevelChooserValue"
730
- [allowCustom]="true"
731
- [valueNormalizer]="valueNormalizer"
732
- [clearButton]="false"
733
- (valueChange)="onZoomLevelChooserValueChange($event)">
734
- <ng-template kendoComboBoxItemTemplate let-dataItem>
735
- {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
736
- </ng-template>
737
- </kendo-combobox>
738
- </kendo-toolbar-input-wrapper>
739
- <kendo-buttongroup
740
- *ngSwitchCase="'selection'"
741
- [attr.aria-controls]="pagesContainerId"
742
- [navigable]="false"
743
- class="k-button-group-flat k-toolbar-button-group"
744
- selection="single">
896
+ (click)="fileSelectEl?.nativeElement.click()">
897
+ </button>
745
898
  <button
899
+ *ngSwitchCase="'download'"
746
900
  type="button"
747
- kendoButton
748
- kendoPDFViewerToolbarFocusable
749
901
  fillMode="flat"
750
- icon="pointer"
751
- [toggleable]="true"
752
- [svgIcon]="pointerIcon"
753
- [attr.title]="messageFor('selectionTitle')"
754
- [attr.aria-label]="messageFor('selectionTitle')"
755
- (click)="selectionEnabled.emit()"></button>
902
+ kendoPDFViewerToolbarFocusable
903
+ kendoButton
904
+ class="k-toolbar-button"
905
+ icon="download"
906
+ [svgIcon]="downloadIcon"
907
+ [disabled]="disabledTools"
908
+ [attr.title]="messageFor('downloadTitle')"
909
+ [attr.aria-label]="messageFor('downloadTitle')"
910
+ (click)="download.emit()"></button>
756
911
  <button
912
+ *ngSwitchCase="'print'"
757
913
  type="button"
914
+ fillMode="flat"
915
+ kendoPDFViewerToolbarFocusable
758
916
  kendoButton
917
+ class="k-toolbar-button"
918
+ icon="print"
919
+ [svgIcon]="printIcon"
920
+ [disabled]="disabledTools"
921
+ [attr.title]="messageFor('printTitle')"
922
+ [attr.aria-label]="messageFor('printTitle')"
923
+ (click)="print.emit()"></button>
924
+ <button
925
+ *ngSwitchCase="'annotations'"
926
+ type="button"
927
+ [attr.id]="annotationsToolId"
759
928
  kendoPDFViewerToolbarFocusable
929
+ kendoButton
930
+ class="k-toolbar-button"
760
931
  fillMode="flat"
761
- icon="hand"
762
- [svgIcon]="handIcon"
763
- [toggleable]="true"
764
- [selected]="true"
765
- [attr.title]="messageFor('panningTitle')"
766
- [attr.aria-label]="messageFor('panningTitle')"
767
- (click)="panningEnabled.emit()"></button>
768
- </kendo-buttongroup>
769
- <button
770
- *ngSwitchCase="'search'"
771
- type="button"
772
- kendoPDFViewerToolbarFocusable
773
- kendoButton
774
- class="k-toolbar-button"
775
- fillMode="flat"
776
- icon="search"
777
- [disabled]="disabledTools"
778
- [attr.title]="messageFor('searchTitle')"
779
- [attr.aria-label]="messageFor('searchTitle')"
780
- aria-haspopup="dialog"
781
- [svgIcon]="searchIcon"
782
- (click)="search.emit()"></button>
783
- <button
784
- *ngSwitchCase="'open'"
785
- type="button"
786
- fillMode="flat"
787
- kendoPDFViewerToolbarFocusable
788
- kendoButton
789
- class="k-toolbar-button"
790
- fillMode="flat"
791
- icon="folder-open"
792
- [svgIcon]="folderOpenIcon"
793
- [attr.title]="messageFor('openTitle')"
794
- [attr.aria-label]="messageFor('openTitle')"
795
- [attr.aria-controls]="pagesContainerId"
796
- (click)="fileSelectEl?.nativeElement.click()">
797
- </button>
798
- <button
799
- *ngSwitchCase="'download'"
800
- type="button"
801
- fillMode="flat"
802
- kendoPDFViewerToolbarFocusable
803
- kendoButton
804
- class="k-toolbar-button"
805
- icon="download"
806
- [svgIcon]="downloadIcon"
807
- [disabled]="disabledTools"
808
- [attr.title]="messageFor('downloadTitle')"
809
- [attr.aria-label]="messageFor('downloadTitle')"
810
- (click)="download.emit()"></button>
811
- <button
812
- *ngSwitchCase="'print'"
813
- type="button"
814
- fillMode="flat"
815
- kendoPDFViewerToolbarFocusable
816
- kendoButton
817
- class="k-toolbar-button"
818
- icon="print"
819
- [svgIcon]="printIcon"
820
- [disabled]="disabledTools"
821
- [attr.title]="messageFor('printTitle')"
822
- [attr.aria-label]="messageFor('printTitle')"
823
- (click)="print.emit()"></button>
932
+ icon="track-changes"
933
+ [selected]="isAnnotationsToolbarVisible"
934
+ [disabled]="disabledTools || !isSelectionEnabled"
935
+ [attr.title]="messageFor('annotationsTitle')"
936
+ [attr.aria-label]="messageFor('annotationsTitle')"
937
+ [attr.aria-controls]="wrapperId"
938
+ [attr.aria-expanded]="isAnnotationsToolbarVisible"
939
+ [svgIcon]="trackChangesIcon"
940
+ (click)="toggleAnnotationsToolbar.emit();"></button>
941
+ </ng-container>
824
942
  </ng-container>
825
943
  </ng-container>
944
+ <ng-container *ngIf="type === 'annotations'">
945
+ <button
946
+ type="button"
947
+ kendoPDFViewerToolbarFocusable
948
+ kendoButton
949
+ class="k-toolbar-button"
950
+ fillMode="flat"
951
+ icon="highlight"
952
+ [selected]="isHighlightMode"
953
+ [disabled]="disabledTools"
954
+ [attr.title]="messageFor('highlightAnnotationTitle')"
955
+ [attr.aria-label]="messageFor('highlightAnnotationTitle')"
956
+ aria-haspopup="dialog"
957
+ [svgIcon]="highlightIcon"
958
+ (click)="onHighlightClick()"></button>
959
+ <div class="k-toolbar-separator k-separator"></div>
960
+ <button
961
+ type="button"
962
+ fillMode="flat"
963
+ kendoPDFViewerToolbarFocusable
964
+ kendoButton
965
+ [selected]="isFreeTextMode"
966
+ class="k-toolbar-button"
967
+ fillMode="flat"
968
+ icon="free-text"
969
+ [svgIcon]="freeTextIcon"
970
+ [attr.title]="messageFor('freeTextAnnotationTitle')"
971
+ [attr.aria-label]="messageFor('freeTextAnnotationTitle')"
972
+ [attr.aria-controls]="pagesContainerId"
973
+ (click)="onFreeTextClick()">
974
+ </button>
975
+ <span class="k-spacer"></span>
976
+ <button
977
+ type="button"
978
+ fillMode="flat"
979
+ kendoPDFViewerToolbarFocusable
980
+ kendoButton
981
+ class="k-toolbar-button"
982
+ fillMode="flat"
983
+ icon="x"
984
+ [svgIcon]="xIcon"
985
+ [attr.title]="messageFor('closeAnnotationsToolbarTitle')"
986
+ [attr.aria-label]="messageFor('closeAnnotationsToolbarTitle')"
987
+ [attr.aria-controls]="pagesContainerId"
988
+ (click)="toggleAnnotationsToolbar.emit();">
989
+ </button>
990
+ </ng-container>
826
991
  <input
827
992
  #fileSelectEl
828
- *ngIf="tools?.indexOf('open') > -1;"
993
+ *ngIf="type === 'tools' &&tools?.indexOf('open') > -1;"
829
994
  type="file"
830
995
  [style.display]="'none'"
831
996
  aria-hidden="true"
@@ -839,183 +1004,249 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
839
1004
  selector: '[kendoPDFViewerToolbar]',
840
1005
  providers: [ToolbarNavigationService],
841
1006
  template: `
842
- <ng-container *ngFor="let tool of tools">
843
- <ng-container [ngSwitch]="tool">
844
- <kendo-toolbar-input-wrapper
845
- *ngSwitchCase="'pager'"
846
- kendoPDFViewerToolbarFocusable
847
- [toolbarTool]="pager">
848
- <kendo-datapager
849
- #pager
1007
+ <ng-container *ngIf="type === 'tools'">
1008
+ <ng-container *ngFor="let tool of tools">
1009
+ <ng-container [ngSwitch]="tool">
1010
+ <kendo-toolbar-input-wrapper
1011
+ *ngSwitchCase="'pager'"
1012
+ kendoPDFViewerToolbarFocusable
1013
+ [toolbarTool]="pager">
1014
+ <kendo-datapager
1015
+ #pager
1016
+ [attr.aria-controls]="pagesContainerId"
1017
+ [attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
1018
+ [class.k-disabled]="disabledTools"
1019
+ [navigable]="true"
1020
+ [pageSize]="pageSize"
1021
+ [skip]="skip"
1022
+ [total]="total"
1023
+ [pageSizeValues]="false"
1024
+ [info]="false"
1025
+ [type]="pagerType"
1026
+ (pageChange)="pageChange.emit($event)">
1027
+ <kendo-datapager-messages
1028
+ [firstPage]="messageFor('pagerFirstPage')"
1029
+ [previousPage]="messageFor('pagerPreviousPage')"
1030
+ [nextPage]="messageFor('pagerNextPage')"
1031
+ [lastPage]="messageFor('pagerLastPage')"
1032
+ [inputLabel]="messageFor('pagerInputLabel')"
1033
+ [pageNumberInputTitle]="messageFor('pagerInputTitle')"
1034
+ [of]="messageFor('pagerOf')"
1035
+ [page]="messageFor('pagerPage')"></kendo-datapager-messages>
1036
+ </kendo-datapager>
1037
+ </kendo-toolbar-input-wrapper>
1038
+ <span
1039
+ *ngSwitchCase="'spacer'"
1040
+ class="k-spacer"></span>
1041
+ <kendo-buttongroup
1042
+ *ngSwitchCase="'zoomInOut'"
850
1043
  [attr.aria-controls]="pagesContainerId"
851
- [attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
852
- [class.k-disabled]="disabledTools"
853
- [navigable]="true"
854
- [pageSize]="pageSize"
855
- [skip]="skip"
856
- [total]="total"
857
- [pageSizeValues]="false"
858
- [info]="false"
859
- [type]="pagerType"
860
- (pageChange)="pageChange.emit($event)">
861
- <kendo-datapager-messages
862
- [firstPage]="messageFor('pagerFirstPage')"
863
- [previousPage]="messageFor('pagerPreviousPage')"
864
- [nextPage]="messageFor('pagerNextPage')"
865
- [lastPage]="messageFor('pagerLastPage')"
866
- [inputLabel]="messageFor('pagerInputLabel')"
867
- [pageNumberInputTitle]="messageFor('pagerInputTitle')"
868
- [of]="messageFor('pagerOf')"
869
- [page]="messageFor('pagerPage')"></kendo-datapager-messages>
870
- </kendo-datapager>
871
- </kendo-toolbar-input-wrapper>
872
- <span
873
- *ngSwitchCase="'spacer'"
874
- class="k-spacer"></span>
875
- <kendo-buttongroup
876
- *ngSwitchCase="'zoomInOut'"
877
- [attr.aria-controls]="pagesContainerId"
878
- class="k-button-group-flat k-toolbar-button-group"
879
- [navigable]="false">
1044
+ class="k-button-group-flat k-toolbar-button-group"
1045
+ [navigable]="false">
1046
+ <button
1047
+ type="button"
1048
+ kendoButton
1049
+ fillMode="flat"
1050
+ kendoPDFViewerToolbarFocusable
1051
+ icon="zoom-out"
1052
+ [disabled]="disabledTools || zoomOutDisabled"
1053
+ [svgIcon]="zoomOutIcon"
1054
+ [attr.title]="messageFor('zoomOutTitle')"
1055
+ [attr.aria-label]="messageFor('zoomOutTitle')"
1056
+ (click)="zoomOut.emit()"></button>
1057
+ <button
1058
+ type="button"
1059
+ kendoButton
1060
+ fillMode="flat"
1061
+ kendoPDFViewerToolbarFocusable
1062
+ icon="zoom-in"
1063
+ [disabled]="disabledTools || zoomInDisabled"
1064
+ [svgIcon]="zoomInIcon"
1065
+ [attr.title]="messageFor('zoomInTitle')"
1066
+ [attr.aria-label]="messageFor('zoomInTitle')"
1067
+ (click)="zoomIn.emit()"></button>
1068
+ </kendo-buttongroup>
1069
+ <kendo-toolbar-input-wrapper
1070
+ *ngSwitchCase="'zoom'"
1071
+ kendoPDFViewerToolbarFocusable
1072
+ [toolbarTool]="combobox">
1073
+ <kendo-combobox
1074
+ #combobox
1075
+ kendoPDFViewerComboBox
1076
+ class="k-toolbar-combobox"
1077
+ fillMode="flat"
1078
+ [attr.aria-controls]="pagesContainerId"
1079
+ [tabindex]="-1"
1080
+ [data]="zoomOptionsData"
1081
+ [disabled]="disabledTools"
1082
+ [placeholder]="messageFor('zoomInputPlaceholder')"
1083
+ textField="displayValue"
1084
+ valueField="id"
1085
+ [value]="zoomLevelChooserValue"
1086
+ [allowCustom]="true"
1087
+ [valueNormalizer]="valueNormalizer"
1088
+ [clearButton]="false"
1089
+ (valueChange)="onZoomLevelChooserValueChange($event)">
1090
+ <ng-template kendoComboBoxItemTemplate let-dataItem>
1091
+ {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
1092
+ </ng-template>
1093
+ </kendo-combobox>
1094
+ </kendo-toolbar-input-wrapper>
1095
+ <kendo-buttongroup
1096
+ *ngSwitchCase="'selection'"
1097
+ [attr.aria-controls]="pagesContainerId"
1098
+ [navigable]="false"
1099
+ class="k-button-group-flat k-toolbar-button-group"
1100
+ selection="single">
1101
+ <button
1102
+ type="button"
1103
+ kendoButton
1104
+ kendoPDFViewerToolbarFocusable
1105
+ fillMode="flat"
1106
+ icon="pointer"
1107
+ [toggleable]="true"
1108
+ [svgIcon]="pointerIcon"
1109
+ [attr.title]="messageFor('selectionTitle')"
1110
+ [attr.aria-label]="messageFor('selectionTitle')"
1111
+ (click)="selectionEnabled.emit(); isSelectionEnabled = true;"></button>
1112
+ <button
1113
+ type="button"
1114
+ kendoButton
1115
+ kendoPDFViewerToolbarFocusable
1116
+ fillMode="flat"
1117
+ icon="hand"
1118
+ [svgIcon]="handIcon"
1119
+ [toggleable]="true"
1120
+ [selected]="true"
1121
+ [attr.title]="messageFor('panningTitle')"
1122
+ [attr.aria-label]="messageFor('panningTitle')"
1123
+ (click)="panningEnabled.emit(); isSelectionEnabled = false;"></button>
1124
+ </kendo-buttongroup>
880
1125
  <button
1126
+ *ngSwitchCase="'search'"
881
1127
  type="button"
1128
+ kendoPDFViewerToolbarFocusable
882
1129
  kendoButton
1130
+ class="k-toolbar-button"
883
1131
  fillMode="flat"
884
- kendoPDFViewerToolbarFocusable
885
- icon="zoom-out"
886
- [disabled]="disabledTools || zoomOutDisabled"
887
- [svgIcon]="zoomOutIcon"
888
- [attr.title]="messageFor('zoomOutTitle')"
889
- [attr.aria-label]="messageFor('zoomOutTitle')"
890
- (click)="zoomOut.emit()"></button>
1132
+ icon="search"
1133
+ [disabled]="disabledTools"
1134
+ [attr.title]="messageFor('searchTitle')"
1135
+ [attr.aria-label]="messageFor('searchTitle')"
1136
+ aria-haspopup="dialog"
1137
+ [svgIcon]="searchIcon"
1138
+ (click)="search.emit()"></button>
891
1139
  <button
1140
+ *ngSwitchCase="'open'"
892
1141
  type="button"
893
- kendoButton
894
1142
  fillMode="flat"
895
1143
  kendoPDFViewerToolbarFocusable
896
- icon="zoom-in"
897
- [disabled]="disabledTools || zoomInDisabled"
898
- [svgIcon]="zoomInIcon"
899
- [attr.title]="messageFor('zoomInTitle')"
900
- [attr.aria-label]="messageFor('zoomInTitle')"
901
- (click)="zoomIn.emit()"></button>
902
- </kendo-buttongroup>
903
- <kendo-toolbar-input-wrapper
904
- *ngSwitchCase="'zoom'"
905
- kendoPDFViewerToolbarFocusable
906
- [toolbarTool]="combobox">
907
- <kendo-combobox
908
- #combobox
909
- kendoPDFViewerComboBox
910
- class="k-toolbar-combobox"
1144
+ kendoButton
1145
+ class="k-toolbar-button"
911
1146
  fillMode="flat"
1147
+ icon="folder-open"
1148
+ [svgIcon]="folderOpenIcon"
1149
+ [attr.title]="messageFor('openTitle')"
1150
+ [attr.aria-label]="messageFor('openTitle')"
912
1151
  [attr.aria-controls]="pagesContainerId"
913
- [tabindex]="-1"
914
- [data]="zoomOptionsData"
915
- [disabled]="disabledTools"
916
- [placeholder]="messageFor('zoomInputPlaceholder')"
917
- textField="displayValue"
918
- valueField="id"
919
- [value]="zoomLevelChooserValue"
920
- [allowCustom]="true"
921
- [valueNormalizer]="valueNormalizer"
922
- [clearButton]="false"
923
- (valueChange)="onZoomLevelChooserValueChange($event)">
924
- <ng-template kendoComboBoxItemTemplate let-dataItem>
925
- {{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
926
- </ng-template>
927
- </kendo-combobox>
928
- </kendo-toolbar-input-wrapper>
929
- <kendo-buttongroup
930
- *ngSwitchCase="'selection'"
931
- [attr.aria-controls]="pagesContainerId"
932
- [navigable]="false"
933
- class="k-button-group-flat k-toolbar-button-group"
934
- selection="single">
1152
+ (click)="fileSelectEl?.nativeElement.click()">
1153
+ </button>
935
1154
  <button
1155
+ *ngSwitchCase="'download'"
936
1156
  type="button"
937
- kendoButton
938
- kendoPDFViewerToolbarFocusable
939
1157
  fillMode="flat"
940
- icon="pointer"
941
- [toggleable]="true"
942
- [svgIcon]="pointerIcon"
943
- [attr.title]="messageFor('selectionTitle')"
944
- [attr.aria-label]="messageFor('selectionTitle')"
945
- (click)="selectionEnabled.emit()"></button>
1158
+ kendoPDFViewerToolbarFocusable
1159
+ kendoButton
1160
+ class="k-toolbar-button"
1161
+ icon="download"
1162
+ [svgIcon]="downloadIcon"
1163
+ [disabled]="disabledTools"
1164
+ [attr.title]="messageFor('downloadTitle')"
1165
+ [attr.aria-label]="messageFor('downloadTitle')"
1166
+ (click)="download.emit()"></button>
946
1167
  <button
1168
+ *ngSwitchCase="'print'"
947
1169
  type="button"
1170
+ fillMode="flat"
1171
+ kendoPDFViewerToolbarFocusable
948
1172
  kendoButton
1173
+ class="k-toolbar-button"
1174
+ icon="print"
1175
+ [svgIcon]="printIcon"
1176
+ [disabled]="disabledTools"
1177
+ [attr.title]="messageFor('printTitle')"
1178
+ [attr.aria-label]="messageFor('printTitle')"
1179
+ (click)="print.emit()"></button>
1180
+ <button
1181
+ *ngSwitchCase="'annotations'"
1182
+ type="button"
1183
+ [attr.id]="annotationsToolId"
949
1184
  kendoPDFViewerToolbarFocusable
1185
+ kendoButton
1186
+ class="k-toolbar-button"
950
1187
  fillMode="flat"
951
- icon="hand"
952
- [svgIcon]="handIcon"
953
- [toggleable]="true"
954
- [selected]="true"
955
- [attr.title]="messageFor('panningTitle')"
956
- [attr.aria-label]="messageFor('panningTitle')"
957
- (click)="panningEnabled.emit()"></button>
958
- </kendo-buttongroup>
959
- <button
960
- *ngSwitchCase="'search'"
961
- type="button"
962
- kendoPDFViewerToolbarFocusable
963
- kendoButton
964
- class="k-toolbar-button"
965
- fillMode="flat"
966
- icon="search"
967
- [disabled]="disabledTools"
968
- [attr.title]="messageFor('searchTitle')"
969
- [attr.aria-label]="messageFor('searchTitle')"
970
- aria-haspopup="dialog"
971
- [svgIcon]="searchIcon"
972
- (click)="search.emit()"></button>
973
- <button
974
- *ngSwitchCase="'open'"
975
- type="button"
976
- fillMode="flat"
977
- kendoPDFViewerToolbarFocusable
978
- kendoButton
979
- class="k-toolbar-button"
980
- fillMode="flat"
981
- icon="folder-open"
982
- [svgIcon]="folderOpenIcon"
983
- [attr.title]="messageFor('openTitle')"
984
- [attr.aria-label]="messageFor('openTitle')"
985
- [attr.aria-controls]="pagesContainerId"
986
- (click)="fileSelectEl?.nativeElement.click()">
987
- </button>
988
- <button
989
- *ngSwitchCase="'download'"
990
- type="button"
991
- fillMode="flat"
992
- kendoPDFViewerToolbarFocusable
993
- kendoButton
994
- class="k-toolbar-button"
995
- icon="download"
996
- [svgIcon]="downloadIcon"
997
- [disabled]="disabledTools"
998
- [attr.title]="messageFor('downloadTitle')"
999
- [attr.aria-label]="messageFor('downloadTitle')"
1000
- (click)="download.emit()"></button>
1001
- <button
1002
- *ngSwitchCase="'print'"
1003
- type="button"
1004
- fillMode="flat"
1005
- kendoPDFViewerToolbarFocusable
1006
- kendoButton
1007
- class="k-toolbar-button"
1008
- icon="print"
1009
- [svgIcon]="printIcon"
1010
- [disabled]="disabledTools"
1011
- [attr.title]="messageFor('printTitle')"
1012
- [attr.aria-label]="messageFor('printTitle')"
1013
- (click)="print.emit()"></button>
1188
+ icon="track-changes"
1189
+ [selected]="isAnnotationsToolbarVisible"
1190
+ [disabled]="disabledTools || !isSelectionEnabled"
1191
+ [attr.title]="messageFor('annotationsTitle')"
1192
+ [attr.aria-label]="messageFor('annotationsTitle')"
1193
+ [attr.aria-controls]="wrapperId"
1194
+ [attr.aria-expanded]="isAnnotationsToolbarVisible"
1195
+ [svgIcon]="trackChangesIcon"
1196
+ (click)="toggleAnnotationsToolbar.emit();"></button>
1197
+ </ng-container>
1014
1198
  </ng-container>
1015
1199
  </ng-container>
1200
+ <ng-container *ngIf="type === 'annotations'">
1201
+ <button
1202
+ type="button"
1203
+ kendoPDFViewerToolbarFocusable
1204
+ kendoButton
1205
+ class="k-toolbar-button"
1206
+ fillMode="flat"
1207
+ icon="highlight"
1208
+ [selected]="isHighlightMode"
1209
+ [disabled]="disabledTools"
1210
+ [attr.title]="messageFor('highlightAnnotationTitle')"
1211
+ [attr.aria-label]="messageFor('highlightAnnotationTitle')"
1212
+ aria-haspopup="dialog"
1213
+ [svgIcon]="highlightIcon"
1214
+ (click)="onHighlightClick()"></button>
1215
+ <div class="k-toolbar-separator k-separator"></div>
1216
+ <button
1217
+ type="button"
1218
+ fillMode="flat"
1219
+ kendoPDFViewerToolbarFocusable
1220
+ kendoButton
1221
+ [selected]="isFreeTextMode"
1222
+ class="k-toolbar-button"
1223
+ fillMode="flat"
1224
+ icon="free-text"
1225
+ [svgIcon]="freeTextIcon"
1226
+ [attr.title]="messageFor('freeTextAnnotationTitle')"
1227
+ [attr.aria-label]="messageFor('freeTextAnnotationTitle')"
1228
+ [attr.aria-controls]="pagesContainerId"
1229
+ (click)="onFreeTextClick()">
1230
+ </button>
1231
+ <span class="k-spacer"></span>
1232
+ <button
1233
+ type="button"
1234
+ fillMode="flat"
1235
+ kendoPDFViewerToolbarFocusable
1236
+ kendoButton
1237
+ class="k-toolbar-button"
1238
+ fillMode="flat"
1239
+ icon="x"
1240
+ [svgIcon]="xIcon"
1241
+ [attr.title]="messageFor('closeAnnotationsToolbarTitle')"
1242
+ [attr.aria-label]="messageFor('closeAnnotationsToolbarTitle')"
1243
+ [attr.aria-controls]="pagesContainerId"
1244
+ (click)="toggleAnnotationsToolbar.emit();">
1245
+ </button>
1246
+ </ng-container>
1016
1247
  <input
1017
1248
  #fileSelectEl
1018
- *ngIf="tools?.indexOf('open') > -1;"
1249
+ *ngIf="type === 'tools' &&tools?.indexOf('open') > -1;"
1019
1250
  type="file"
1020
1251
  [style.display]="'none'"
1021
1252
  aria-hidden="true"
@@ -1061,6 +1292,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1061
1292
  type: Input
1062
1293
  }], tools: [{
1063
1294
  type: Input
1295
+ }], type: [{
1296
+ type: Input
1297
+ }], wrapperId: [{
1298
+ type: Input
1299
+ }], isAnnotationsToolbarVisible: [{
1300
+ type: Input
1301
+ }], annotationsToolId: [{
1302
+ type: Input
1064
1303
  }], fileSelect: [{
1065
1304
  type: Output
1066
1305
  }], fileSelectStart: [{
@@ -1085,6 +1324,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1085
1324
  type: Output
1086
1325
  }], search: [{
1087
1326
  type: Output
1327
+ }], toggleAnnotationsToolbar: [{
1328
+ type: Output
1329
+ }], setAnnotationMode: [{
1330
+ type: Output
1088
1331
  }] } });
1089
1332
 
1090
1333
  /**
@@ -1341,6 +1584,198 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1341
1584
  }]
1342
1585
  }], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
1343
1586
 
1587
+ /**
1588
+ * @hidden
1589
+ */
1590
+ const AnnotationEditorTypes = {
1591
+ disable: -1,
1592
+ none: 0,
1593
+ freeText: 3,
1594
+ highlight: 9
1595
+ };
1596
+
1597
+ /**
1598
+ * @hidden
1599
+ */
1600
+ class AnnotationPopupToolbarContentComponent {
1601
+ dialogService;
1602
+ ngZone;
1603
+ hostClasses = true;
1604
+ paletteIcon = paletteIcon;
1605
+ trashIcon = trashIcon;
1606
+ localizationService;
1607
+ pdfViewerWidget;
1608
+ anchor;
1609
+ annotationEditorType;
1610
+ popupRef;
1611
+ showToolbar = true;
1612
+ initialColor;
1613
+ fontSizes = fontSizes;
1614
+ initialFontSize;
1615
+ dialogContainer;
1616
+ removeAnnotationConfirmation;
1617
+ dialogResultSub;
1618
+ constructor(dialogService, ngZone) {
1619
+ this.dialogService = dialogService;
1620
+ this.ngZone = ngZone;
1621
+ }
1622
+ ngOnDestroy() {
1623
+ if (this.dialogResultSub) {
1624
+ this.dialogResultSub.unsubscribe();
1625
+ }
1626
+ }
1627
+ editAnnotation() {
1628
+ this.popupRef.popup.setInput('popupClass', 'k-pdf-viewer-annotation-editor');
1629
+ this.hostClasses = false;
1630
+ this.ngZone.run(() => this.showToolbar = false);
1631
+ }
1632
+ deleteAnnotation() {
1633
+ const removeItem = (shouldRemove) => {
1634
+ if (shouldRemove) {
1635
+ this.pdfViewerWidget.deleteAnnotation();
1636
+ }
1637
+ };
1638
+ if (this.removeAnnotationConfirmation) {
1639
+ this.ngZone.run(() => {
1640
+ const dialog = this.dialogService.open({
1641
+ appendTo: this.dialogContainer,
1642
+ title: this.localizationService.get('deleteAnnotationConfirmationDialogTitle'),
1643
+ content: this.localizationService.get('deleteAnnotationConfirmationDialogContent'),
1644
+ actions: [{
1645
+ text: this.localizationService.get('deleteAnnotationConfirmationDialogConfirmText'),
1646
+ themeColor: 'primary',
1647
+ svgIcon: checkIcon,
1648
+ icon: 'check'
1649
+ }, {
1650
+ text: this.localizationService.get('deleteAnnotationConfirmationDialogRejectText'),
1651
+ svgIcon: xIcon,
1652
+ icon: 'x'
1653
+ }],
1654
+ });
1655
+ this.dialogResultSub = dialog.result.pipe(take(1)).subscribe((e) => {
1656
+ const shouldRemove = e.text === (this.localizationService.get('deleteAnnotationConfirmationDialogConfirmText'));
1657
+ removeItem(shouldRemove);
1658
+ this.dialogResultSub.unsubscribe();
1659
+ this.dialogResultSub = null;
1660
+ });
1661
+ });
1662
+ }
1663
+ else {
1664
+ removeItem(true);
1665
+ }
1666
+ }
1667
+ onColorValueChange(value) {
1668
+ this.pdfViewerWidget[this.annotationEditorType === 'highlight' ? 'setHighlightColor' : 'setFreeTextColor'](value);
1669
+ }
1670
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AnnotationPopupToolbarContentComponent, deps: [{ token: i1$2.DialogService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1671
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AnnotationPopupToolbarContentComponent, isStandalone: true, selector: "[kendoPDFViewerAnnotationPopupToolbar]", host: { properties: { "class.k-toolbar": "this.hostClasses", "class.k-toolbar-md": "this.hostClasses", "class.k-toolbar-flat": "this.hostClasses" } }, providers: [DialogService], ngImport: i0, template: `
1672
+ <ng-container *ngIf="showToolbar">
1673
+ <button
1674
+ kendoButton
1675
+ [attr.title]="localizationService?.get('annotationEditorTitle')"
1676
+ [attr.aria-label]="localizationService?.get('annotationEditorTitle')"
1677
+ [svgIcon]="paletteIcon"
1678
+ icon="palette"
1679
+ fillMode="flat"
1680
+ type="button"
1681
+ (click)="editAnnotation()"></button>
1682
+ <button
1683
+ kendoButton
1684
+ [attr.title]="localizationService?.get('deleteAnnotationTitle')"
1685
+ [attr.aria-label]="localizationService?.get('deleteAnnotationTitle')"
1686
+ [svgIcon]="trashIcon"
1687
+ icon="trash"
1688
+ fillMode="flat"
1689
+ type="button"
1690
+ (click)="deleteAnnotation()"></button>
1691
+ </ng-container>
1692
+ <ng-container *ngIf="!showToolbar">
1693
+ <ng-container *ngIf="annotationEditorType === 'freeText'">
1694
+ <span class="k-column-menu-group-header">
1695
+ <span id="text-font-size-label" class="k-column-menu-group-header-text">{{ localizationService?.get('annotationEditorFontSizeTitle') }}</span>
1696
+ </span>
1697
+ <kendo-dropdownlist
1698
+ [data]="fontSizes"
1699
+ [value]="initialFontSize"
1700
+ (valueChange)="pdfViewerWidget.setFreeTextFontSize($event)"
1701
+ fillMode="flat"
1702
+ aria-labelledby="text-font-size-label"></kendo-dropdownlist>
1703
+ </ng-container>
1704
+ <span class="k-column-menu-group-header">
1705
+ <label [for]="flatColorPicker" class="k-column-menu-group-header-text">{{ localizationService?.get('annotationEditorColorTitle') }}</label>
1706
+ </span>
1707
+ <kendo-flatcolorpicker
1708
+ #flatColorPicker
1709
+ [preview]="false"
1710
+ [value]="initialColor"
1711
+ (valueChange)="onColorValueChange($event)"
1712
+ fillMode="flat"></kendo-flatcolorpicker>
1713
+ <ng-container>
1714
+ `, isInline: true, dependencies: [{ kind: "component", type: i2.ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "component", type: i3.FlatColorPickerComponent, selector: "kendo-flatcolorpicker", inputs: ["readonly", "disabled", "format", "value", "tabindex", "clearButton", "preview", "actionsLayout", "activeView", "views", "gradientSettings", "adaptiveMode", "paletteSettings", "size"], outputs: ["valueChange", "cancel", "activeViewChange", "clearButtonClick", "actionButtonClick"], exportAs: ["kendoFlatColorPicker"] }, { kind: "component", type: i1$1.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["customIconClass", "showStickyHeader", "icon", "svgIcon", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "adaptiveTitle", "adaptiveSubtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1715
+ }
1716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AnnotationPopupToolbarContentComponent, decorators: [{
1717
+ type: Component,
1718
+ args: [{
1719
+ selector: '[kendoPDFViewerAnnotationPopupToolbar]',
1720
+ standalone: true,
1721
+ providers: [DialogService],
1722
+ imports: [KENDO_BUTTON, KENDO_FLATCOLORPICKER, KENDO_DROPDOWNLIST, NgIf],
1723
+ template: `
1724
+ <ng-container *ngIf="showToolbar">
1725
+ <button
1726
+ kendoButton
1727
+ [attr.title]="localizationService?.get('annotationEditorTitle')"
1728
+ [attr.aria-label]="localizationService?.get('annotationEditorTitle')"
1729
+ [svgIcon]="paletteIcon"
1730
+ icon="palette"
1731
+ fillMode="flat"
1732
+ type="button"
1733
+ (click)="editAnnotation()"></button>
1734
+ <button
1735
+ kendoButton
1736
+ [attr.title]="localizationService?.get('deleteAnnotationTitle')"
1737
+ [attr.aria-label]="localizationService?.get('deleteAnnotationTitle')"
1738
+ [svgIcon]="trashIcon"
1739
+ icon="trash"
1740
+ fillMode="flat"
1741
+ type="button"
1742
+ (click)="deleteAnnotation()"></button>
1743
+ </ng-container>
1744
+ <ng-container *ngIf="!showToolbar">
1745
+ <ng-container *ngIf="annotationEditorType === 'freeText'">
1746
+ <span class="k-column-menu-group-header">
1747
+ <span id="text-font-size-label" class="k-column-menu-group-header-text">{{ localizationService?.get('annotationEditorFontSizeTitle') }}</span>
1748
+ </span>
1749
+ <kendo-dropdownlist
1750
+ [data]="fontSizes"
1751
+ [value]="initialFontSize"
1752
+ (valueChange)="pdfViewerWidget.setFreeTextFontSize($event)"
1753
+ fillMode="flat"
1754
+ aria-labelledby="text-font-size-label"></kendo-dropdownlist>
1755
+ </ng-container>
1756
+ <span class="k-column-menu-group-header">
1757
+ <label [for]="flatColorPicker" class="k-column-menu-group-header-text">{{ localizationService?.get('annotationEditorColorTitle') }}</label>
1758
+ </span>
1759
+ <kendo-flatcolorpicker
1760
+ #flatColorPicker
1761
+ [preview]="false"
1762
+ [value]="initialColor"
1763
+ (valueChange)="onColorValueChange($event)"
1764
+ fillMode="flat"></kendo-flatcolorpicker>
1765
+ <ng-container>
1766
+ `
1767
+ }]
1768
+ }], ctorParameters: function () { return [{ type: i1$2.DialogService }, { type: i0.NgZone }]; }, propDecorators: { hostClasses: [{
1769
+ type: HostBinding,
1770
+ args: ['class.k-toolbar']
1771
+ }, {
1772
+ type: HostBinding,
1773
+ args: ['class.k-toolbar-md']
1774
+ }, {
1775
+ type: HostBinding,
1776
+ args: ['class.k-toolbar-flat']
1777
+ }] } });
1778
+
1344
1779
  let counter = 0;
1345
1780
  /**
1346
1781
  * Represents the [Kendo UI PDFViewer component for Angular](slug:overview_pdfviewer).
@@ -1363,11 +1798,13 @@ class PDFViewerComponent {
1363
1798
  localizationService;
1364
1799
  cdr;
1365
1800
  host;
1801
+ popupService;
1366
1802
  hostClass = true;
1367
1803
  direction;
1804
+ display = 'flex';
1368
1805
  /**
1369
1806
  * Represents the tools collection rendered in the toolbar.
1370
- * @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print' ]
1807
+ * @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print', 'annotations' ]
1371
1808
  */
1372
1809
  tools = [
1373
1810
  'pager',
@@ -1379,7 +1816,8 @@ class PDFViewerComponent {
1379
1816
  'search',
1380
1817
  'open',
1381
1818
  'download',
1382
- 'print'
1819
+ 'print',
1820
+ 'annotations'
1383
1821
  ];
1384
1822
  /**
1385
1823
  * The configuration of the internal Loader component.
@@ -1464,6 +1902,12 @@ class PDFViewerComponent {
1464
1902
  * @default 1
1465
1903
  */
1466
1904
  loadOnDemandPageSize = 1;
1905
+ /**
1906
+ * Determines whether a confirmation dialog is shown when the user tries to delete an annotation.
1907
+ *
1908
+ * @default true
1909
+ */
1910
+ removeAnnotationConfirmation = true;
1467
1911
  /**
1468
1912
  * Fires when the component loads a PDF document successfully.
1469
1913
  */
@@ -1485,6 +1929,8 @@ class PDFViewerComponent {
1485
1929
  */
1486
1930
  zoomLevelChange = new EventEmitter();
1487
1931
  pagesContainer;
1932
+ pagesContainerViewContainerRef;
1933
+ dialogContainerViewContainerRef;
1488
1934
  /**
1489
1935
  * Returns the current page number of the loaded PDF document.
1490
1936
  */
@@ -1519,17 +1965,30 @@ class PDFViewerComponent {
1519
1965
  }
1520
1966
  return `k-pdfviewer-${counter}-pages-container`;
1521
1967
  }
1968
+ /**
1969
+ * @hidden
1970
+ */
1971
+ get annotationsToolbarId() {
1972
+ return `k-pdfviewer-${counter}-annotations-toolbar`;
1973
+ }
1974
+ /**
1975
+ * @hidden
1976
+ */
1977
+ get annotationsToolId() {
1978
+ return `k-pdfviewer-${counter}-annotations-button`;
1979
+ }
1522
1980
  loading = false;
1523
1981
  searchActive = false;
1524
1982
  matchCase = false;
1525
1983
  currentMatches = [];
1526
1984
  currentMatch;
1985
+ showAnnotationsToolbar = false;
1527
1986
  /**
1528
1987
  * @hidden
1529
1988
  */
1530
1989
  set enabledSelection(value) {
1531
1990
  if (this.pdfViewerWidget) {
1532
- value ? this.pdfViewerWidget.documentScroller.disablePanEventsTracking() : this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
1991
+ this.ngZone.runOutsideAngular(() => this.pdfViewerWidget.setInteractionMode({ mode: value ? PdfViewerInteractionMode.TextSelection : PdfViewerInteractionMode.Pan }));
1533
1992
  }
1534
1993
  this._enabledSelection = value;
1535
1994
  }
@@ -1539,10 +1998,22 @@ class PDFViewerComponent {
1539
1998
  get enabledSelection() {
1540
1999
  return this._enabledSelection;
1541
2000
  }
2001
+ /**
2002
+ * @hidden
2003
+ */
2004
+ onSetAnnotationMode(mode) {
2005
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
2006
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.TextSelection });
2007
+ this.pdfViewerWidget?.setAnnotationEditorMode({ mode: AnnotationEditorTypes[mode], interactionMode: PdfViewerInteractionMode.TextSelection });
2008
+ }
1542
2009
  /**
1543
2010
  * @hidden
1544
2011
  */
1545
2012
  showLicenseWatermark = false;
2013
+ /**
2014
+ * @hidden
2015
+ */
2016
+ licenseMessage;
1546
2017
  skip = 0;
1547
2018
  zoomOptionsData = zoomOptionsData;
1548
2019
  zoomLevel = this.zoomOptionsData[5];
@@ -1552,14 +2023,18 @@ class PDFViewerComponent {
1552
2023
  _fitType;
1553
2024
  _zoomToFit = false;
1554
2025
  subs = new Subscription();
2026
+ popupSub = new Subscription();
1555
2027
  emitLoad = true;
1556
- constructor(ngZone, renderer, localizationService, cdr, host) {
2028
+ pdfViewerWidget;
2029
+ constructor(ngZone, renderer, localizationService, cdr, host, popupService) {
1557
2030
  this.ngZone = ngZone;
1558
2031
  this.renderer = renderer;
1559
2032
  this.localizationService = localizationService;
1560
2033
  this.cdr = cdr;
1561
2034
  this.host = host;
2035
+ this.popupService = popupService;
1562
2036
  const isValid = validatePackage(packageMetadata);
2037
+ this.licenseMessage = getLicenseMessage(packageMetadata);
1563
2038
  this.showLicenseWatermark = shouldShowValidationUI(isValid);
1564
2039
  this.direction = localizationService.rtl ? 'rtl' : 'ltr';
1565
2040
  counter++;
@@ -1569,8 +2044,11 @@ class PDFViewerComponent {
1569
2044
  }
1570
2045
  ngOnDestroy() {
1571
2046
  this.subs.unsubscribe();
2047
+ this.popupSub?.unsubscribe();
1572
2048
  this.pdfViewerWidget?.destroy();
1573
2049
  this.pdfContext = null;
2050
+ this.observer?.disconnect();
2051
+ this.observer = null;
1574
2052
  }
1575
2053
  ngOnChanges(changes) {
1576
2054
  const newBase64Data = changes['data'] && this.data;
@@ -1610,22 +2088,40 @@ class PDFViewerComponent {
1610
2088
  onPageChange(e) {
1611
2089
  this.ngZone.runOutsideAngular(() => this.scrollToPage(e.skip + 1));
1612
2090
  }
2091
+ /**
2092
+ * @hidden
2093
+ */
2094
+ onPanningEnabled() {
2095
+ this.enabledSelection = false;
2096
+ this.showAnnotationsToolbar = false;
2097
+ this.ngZone.runOutsideAngular(() => {
2098
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
2099
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.Pan });
2100
+ });
2101
+ }
2102
+ /**
2103
+ * @hidden
2104
+ */
2105
+ onSelectionEnabled() {
2106
+ this.enabledSelection = true;
2107
+ this.ngZone.runOutsideAngular(() => {
2108
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
2109
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.TextSelection });
2110
+ });
2111
+ }
1613
2112
  /**
1614
2113
  * @hidden
1615
2114
  */
1616
2115
  onDownload() {
1617
- this.ngZone.runOutsideAngular(() => this.pdfContext.pdfDoc.getData()
1618
- .then((data) => new Blob([data], { type: 'application/pdf' }))
1619
- .then((blob) => {
1620
- const downloadEvent = new PDFViewerDownloadEvent(blob, this.saveFileName, this.saveOptions, this.pdfContext);
1621
- this.zoneAwareEmitter('download', downloadEvent);
1622
- if (!downloadEvent.isDefaultPrevented()) {
1623
- saveAs(blob, this.saveFileName, this.saveOptions);
1624
- }
1625
- })
1626
- .catch((reason) => {
1627
- this.zoneAwareEmitter('error', { error: reason, context: this.pdfContext });
1628
- }));
2116
+ if (!this.pdfContext?.pdfDoc) {
2117
+ this.zoneAwareEmitter('error', { error: 'No document to export.', context: this.pdfContext });
2118
+ return;
2119
+ }
2120
+ const downloadEvent = new PDFViewerDownloadEvent(this.saveFileName, this.saveOptions, this.pdfContext);
2121
+ this.zoneAwareEmitter('download', downloadEvent);
2122
+ if (!downloadEvent.isDefaultPrevented()) {
2123
+ this.ngZone.runOutsideAngular(() => this.pdfViewerWidget?.downloadFile({ fileName: this.saveFileName, saveOptions: this.saveOptions }));
2124
+ }
1629
2125
  }
1630
2126
  /**
1631
2127
  * @hidden
@@ -1734,7 +2230,16 @@ class PDFViewerComponent {
1734
2230
  this.pdfViewerWidget?.goToPreviousSearchMatch();
1735
2231
  this.currentMatch = this.currentMatch - 1 < 1 ? this.currentMatches.length : this.currentMatch - 1;
1736
2232
  }
1737
- pdfViewerWidget;
2233
+ /**
2234
+ * @hidden
2235
+ */
2236
+ toggleAnnotationsToolbar() {
2237
+ this.showAnnotationsToolbar = !this.showAnnotationsToolbar;
2238
+ this.host.nativeElement.querySelector(`#${this.annotationsToolId}`)?.focus();
2239
+ if (!this.showAnnotationsToolbar) {
2240
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
2241
+ }
2242
+ }
1738
2243
  loadPdf(dataType, data) {
1739
2244
  this.pdfViewerWidget?.destroy();
1740
2245
  this.loading = true;
@@ -1759,7 +2264,9 @@ class PDFViewerComponent {
1759
2264
  this.loading = false;
1760
2265
  },
1761
2266
  scroll: this.scrollHandler,
1762
- error: this.errorHandler
2267
+ error: this.errorHandler,
2268
+ annotationEditorToolBarShow: this.onAnnotationEditorToolBarShowHandler,
2269
+ annotationEditorToolBarHide: this.onAnnotationEditorToolBarHideHandler,
1763
2270
  }
1764
2271
  });
1765
2272
  });
@@ -1807,6 +2314,7 @@ class PDFViewerComponent {
1807
2314
  if (!this.pdfContext) {
1808
2315
  this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
1809
2316
  }
2317
+ this.pdfViewerWidget.setInteractionMode({ mode: PdfViewerInteractionMode.Pan });
1810
2318
  if (!this._zoomToFit) {
1811
2319
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement, zoom: e.sender.state.zoomLevel };
1812
2320
  if (this.emitLoad) {
@@ -1819,6 +2327,7 @@ class PDFViewerComponent {
1819
2327
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
1820
2328
  this.onZoomLevelChange(zoomLevelOption, false);
1821
2329
  }
2330
+ this.pdfViewerWidget.activatePageNumber(1);
1822
2331
  this.cdr.markForCheck();
1823
2332
  this.assignPageIds();
1824
2333
  this.ngZone.run(() => this.loading = false);
@@ -1836,19 +2345,80 @@ class PDFViewerComponent {
1836
2345
  this.pdfContext = null;
1837
2346
  this.zoneAwareEmitter('error', { error: e, context: this.pdfContext });
1838
2347
  };
2348
+ annotationPopup = null;
2349
+ observer;
2350
+ onAnnotationEditorToolBarShowHandler = (e) => {
2351
+ this.cdr.markForCheck();
2352
+ this.observer?.disconnect();
2353
+ const type = e.annotationEditorMode;
2354
+ const anchor = e.anchor;
2355
+ const editor = e.source.firstSelectedEditor;
2356
+ const popup = this.annotationPopup?.popup;
2357
+ // Do not continue if popup is already visible for this annotation.
2358
+ if (popup && popup.instance.anchor === anchor && type === "freeText") {
2359
+ return;
2360
+ }
2361
+ if (this.annotationPopup) {
2362
+ this.annotationPopup.close();
2363
+ this.annotationPopup = null;
2364
+ }
2365
+ this.annotationPopup = this.popupService.open({
2366
+ anchor: anchor,
2367
+ appendTo: this.pagesContainerViewContainerRef,
2368
+ content: AnnotationPopupToolbarContentComponent,
2369
+ popupClass: 'k-pdfviewer-annotation-popup',
2370
+ });
2371
+ const annotationToolbarInstance = this.annotationPopup.content.instance;
2372
+ annotationToolbarInstance.localizationService = this.localizationService;
2373
+ annotationToolbarInstance.annotationEditorType = type;
2374
+ annotationToolbarInstance.pdfViewerWidget = this.pdfViewerWidget;
2375
+ annotationToolbarInstance.anchor = anchor;
2376
+ annotationToolbarInstance.popupRef = this.annotationPopup;
2377
+ annotationToolbarInstance.initialColor = editor?.color;
2378
+ annotationToolbarInstance.initialFontSize = editor.propertiesToUpdate[0][1];
2379
+ annotationToolbarInstance.dialogContainer = this.dialogContainerViewContainerRef;
2380
+ annotationToolbarInstance.removeAnnotationConfirmation = this.removeAnnotationConfirmation;
2381
+ this.popupSub = this.annotationPopup.popup.instance.anchorViewportLeave.subscribe(() => {
2382
+ this.ngZone.run(() => this.annotationPopup?.close());
2383
+ this.annotationPopup = null;
2384
+ this.popupSub?.unsubscribe();
2385
+ this.popupSub = null;
2386
+ });
2387
+ this.ngZone.runOutsideAngular(() => {
2388
+ this.observer = this.classMutationObserver(anchor, 'k-selected', () => {
2389
+ this.ngZone.run(() => this.annotationPopup?.close());
2390
+ });
2391
+ });
2392
+ };
2393
+ onAnnotationEditorToolBarHideHandler = () => {
2394
+ this.cdr.markForCheck();
2395
+ if (this.annotationPopup?.popup) {
2396
+ this.annotationPopup.close();
2397
+ this.annotationPopup = null;
2398
+ }
2399
+ };
1839
2400
  zoneAwareEmitter = (eventName, eventData) => {
1840
2401
  if (hasObservers(this[eventName])) {
1841
2402
  this.ngZone.run(() => this[eventName].emit(eventData));
1842
2403
  }
1843
2404
  };
1844
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1845
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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", loadOnDemand: "loadOnDemand", loadOnDemandPageSize: "loadOnDemandPageSize" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
2405
+ classMutationObserver = (element, className, callback) => {
2406
+ const observer = new MutationObserver((m) => {
2407
+ m.forEach(() => {
2408
+ callback();
2409
+ });
2410
+ });
2411
+ observer.observe(element, { attributeFilter: ['class'] });
2412
+ return observer;
2413
+ };
2414
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2$1.PopupService }], target: i0.ɵɵFactoryTarget.Component });
2415
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", 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", loadOnDemand: "loadOnDemand", loadOnDemandPageSize: "loadOnDemandPageSize", removeAnnotationConfirmation: "removeAnnotationConfirmation" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction", "attr.display": "this.display" } }, providers: [
1846
2416
  LocalizationService,
1847
2417
  {
1848
2418
  provide: L10N_PREFIX,
1849
2419
  useValue: 'kendo.pdfviewer'
1850
2420
  }
1851
- ], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
2421
+ ], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }, { propertyName: "pagesContainerViewContainerRef", first: true, predicate: ["pagesContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "dialogContainerViewContainerRef", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
1852
2422
  <ng-container kendoPDFViewerLocalizedMessages
1853
2423
  i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
1854
2424
  pagerFirstPage="Go to the first page"
@@ -1873,59 +2443,95 @@ class PDFViewerComponent {
1873
2443
 
1874
2444
  i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
1875
2445
  pagerInputLabel="Type a page number"
1876
-
2446
+
1877
2447
  i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
1878
2448
  zoomInTitle="Zoom in"
1879
-
2449
+
1880
2450
  i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
1881
2451
  zoomOutTitle="Zoom out"
1882
-
2452
+
1883
2453
  i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
1884
2454
  selectionTitle="Enable selection"
1885
-
2455
+
1886
2456
  i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
1887
2457
  panningTitle="Enable panning"
1888
-
2458
+
1889
2459
  i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
1890
2460
  searchTitle="Search"
1891
-
2461
+
1892
2462
  i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
1893
2463
  openTitle="Open"
1894
-
2464
+
1895
2465
  i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
1896
2466
  downloadTitle="Download"
1897
-
2467
+
1898
2468
  i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
1899
2469
  printTitle="Print"
1900
-
2470
+
1901
2471
  i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
1902
2472
  fitToPage="Fit to page"
1903
-
2473
+
1904
2474
  i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
1905
2475
  fitToWidth="Fit to width"
1906
-
2476
+
1907
2477
  i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
1908
2478
  searchInputPlaceholder="Search"
1909
-
2479
+
1910
2480
  i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
1911
2481
  searchMatchesOf="of"
1912
-
2482
+
1913
2483
  i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
1914
2484
  searchPreviousMatchTitle="Previous match"
1915
-
2485
+
1916
2486
  i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
1917
2487
  searchNextMatchTitle="Next match"
1918
-
2488
+
1919
2489
  i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
1920
2490
  searchCloseTitle="Close"
1921
-
2491
+
1922
2492
  i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
1923
2493
  searchMatchCaseTitle="Match case"
1924
-
2494
+
1925
2495
  i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
1926
- zoomInputPlaceholder="Choose zoom level">
2496
+ zoomInputPlaceholder="Choose zoom level"
2497
+
2498
+ i18n-annotationsTitle="kendo.pdfviewer.annotationsTitle|The Annotations tool title and label."
2499
+ annotationsTitle="Annotations"
2500
+
2501
+ i18n-annotationEditorTitle="kendo.pdfviewer.annotationEditorTitle|The annotation editor tool title and label."
2502
+ annotationEditorTitle="Annotation editor"
2503
+
2504
+ i18n-deleteAnnotationTitle="kendo.pdfviewer.deleteAnnotationTitle|The delete annotation tool title and label."
2505
+ deleteAnnotationTitle="Delete annotation"
2506
+
2507
+ i18n-highlightAnnotationTitle="kendo.pdfviewer.highlightAnnotationTitle|The highlight annotation tool title and label."
2508
+ highlightAnnotationTitle="Highlight"
2509
+
2510
+ i18n-freeTextAnnotationTitle="kendo.pdfviewer.freeTextAnnotationTitle|The free text annotation tool title and label."
2511
+ freeTextAnnotationTitle="Free text"
2512
+
2513
+ i18n-closeAnnotationsToolbarTitle="kendo.pdfviewer.closeAnnotationsToolbarTitle|The close annotations toolbar tool title and label."
2514
+ closeAnnotationsToolbarTitle="Close"
2515
+
2516
+ i18n-deleteAnnotationConfirmationDialogTitle="kendo.pdfviewer.deleteAnnotationConfirmationDialogTitle|The delete annotation confirmation dialog title."
2517
+ deleteAnnotationConfirmationDialogTitle="Delete annotation"
2518
+
2519
+ i18n-deleteAnnotationConfirmationDialogContent="kendo.pdfviewer.deleteAnnotationConfirmationDialogContent|The delete annotation confirmation dialog content."
2520
+ deleteAnnotationConfirmationDialogContent="Are you sure you want to delete this annotation?"
2521
+
2522
+ i18n-deleteAnnotationConfirmationDialogConfirmText="kendo.pdfviewer.deleteAnnotationConfirmationDialogConfirmText|The delete annotation confirmation dialog confirm button text."
2523
+ deleteAnnotationConfirmationDialogConfirmText="Delete"
2524
+
2525
+ i18n-deleteAnnotationConfirmationDialogRejectText="kendo.pdfviewer.deleteAnnotationConfirmationDialogRejectText|The delete annotation confirmation dialog reject button text."
2526
+ deleteAnnotationConfirmationDialogRejectText="Cancel"
2527
+
2528
+ i18n-annotationEditorFontSizeTitle="kendo.pdfviewer.annotationEditorFontSizeTitle|The annotation editor font size section title."
2529
+ annotationEditorFontSizeTitle="Font size"
2530
+
2531
+ i18n-annotationEditorColorTitle="kendo.pdfviewer.annotationEditorColorTitle|The annotation editor color section title."
2532
+ annotationEditorColorTitle="Color">
1927
2533
  </ng-container>
1928
- <div kendoPDFViewerLoader
2534
+ <div kendoPDFViewerLoader
1929
2535
  *ngIf="loading"
1930
2536
  [settings]="loaderSettings"></div>
1931
2537
  <div kendoPDFViewerToolbar
@@ -1941,18 +2547,32 @@ class PDFViewerComponent {
1941
2547
  [zoomOptionsData]="zoomOptionsData"
1942
2548
  [zoomLevelChooserValue]="zoomLevel"
1943
2549
  [disabledTools]="!pdfContext?.pdfDoc"
2550
+ [isAnnotationsToolbarVisible]="showAnnotationsToolbar"
2551
+ [wrapperId]="showAnnotationsToolbar ? annotationsToolbarId : undefined"
2552
+ [annotationsToolId]="annotationsToolId"
1944
2553
  (pageChange)="onPageChange($event)"
1945
2554
  (fileSelect)="onFileSelect($event)"
1946
2555
  (fileSelectStart)="loading = true;"
1947
2556
  (fileSelectError)="onFileSelectError($event)"
1948
2557
  (download)="onDownload()"
1949
- (panningEnabled)="enabledSelection = false;"
1950
- (selectionEnabled)="enabledSelection = true;"
2558
+ (panningEnabled)="onPanningEnabled();"
2559
+ (selectionEnabled)="onSelectionEnabled();"
1951
2560
  (zoomIn)="onZoomIn()"
1952
2561
  (zoomOut)="onZoomOut()"
1953
2562
  (zoomLevelChange)="onZoomLevelChange($event)"
1954
2563
  (print)="onPrint()"
1955
- (search)="onSearch()"></div>
2564
+ (search)="onSearch()"
2565
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
2566
+ <div *ngIf="showAnnotationsToolbar"
2567
+ [attr.id]="annotationsToolbarId"
2568
+ kendoPDFViewerToolbar
2569
+ #toolbar
2570
+ role="toolbar"
2571
+ type="annotations"
2572
+ (setAnnotationMode)="onSetAnnotationMode($event)"
2573
+ [attr.aria-controls]="pagesContainerId"
2574
+ [disabledTools]="!pdfContext?.pdfDoc"
2575
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
1956
2576
  <div
1957
2577
  class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
1958
2578
  [class.k-enable-text-select]="enabledSelection"
@@ -1969,7 +2589,7 @@ class PDFViewerComponent {
1969
2589
  (prevMatch)="onPreviousMatch()"
1970
2590
  (nextMatch)="onNextMatch()"
1971
2591
  (close)="closeSearch(toolbar)"></div>
1972
- <div
2592
+ <div
1973
2593
  #pagesContainer
1974
2594
  [kendoEventsOutsideAngular]="{
1975
2595
  wheel: stopPropagation
@@ -1978,8 +2598,9 @@ class PDFViewerComponent {
1978
2598
  [attr.id]="pagesContainerId"></div>
1979
2599
  </div>
1980
2600
 
1981
- <div kendoWatermarkOverlay *ngIf="showLicenseWatermark"></div>
1982
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: LoaderComponent, selector: "[kendoPDFViewerLoader]", inputs: ["settings"] }, { kind: "component", type: ToolbarComponent, selector: "[kendoPDFViewerToolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools"], outputs: ["fileSelect", "fileSelectStart", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search"] }, { kind: "component", type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]" }] });
2601
+ <div #dialogContainer></div>
2602
+ <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
2603
+ `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: LoaderComponent, selector: "[kendoPDFViewerLoader]", inputs: ["settings"] }, { kind: "component", type: ToolbarComponent, selector: "[kendoPDFViewerToolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools", "type", "wrapperId", "isAnnotationsToolbarVisible", "annotationsToolId"], outputs: ["fileSelect", "fileSelectStart", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search", "toggleAnnotationsToolbar", "setAnnotationMode"] }, { kind: "component", type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }] });
1983
2604
  }
1984
2605
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, decorators: [{
1985
2606
  type: Component,
@@ -2018,59 +2639,95 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2018
2639
 
2019
2640
  i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
2020
2641
  pagerInputLabel="Type a page number"
2021
-
2642
+
2022
2643
  i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
2023
2644
  zoomInTitle="Zoom in"
2024
-
2645
+
2025
2646
  i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
2026
2647
  zoomOutTitle="Zoom out"
2027
-
2648
+
2028
2649
  i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
2029
2650
  selectionTitle="Enable selection"
2030
-
2651
+
2031
2652
  i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
2032
2653
  panningTitle="Enable panning"
2033
-
2654
+
2034
2655
  i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
2035
2656
  searchTitle="Search"
2036
-
2657
+
2037
2658
  i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
2038
2659
  openTitle="Open"
2039
-
2660
+
2040
2661
  i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
2041
2662
  downloadTitle="Download"
2042
-
2663
+
2043
2664
  i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
2044
2665
  printTitle="Print"
2045
-
2666
+
2046
2667
  i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
2047
2668
  fitToPage="Fit to page"
2048
-
2669
+
2049
2670
  i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
2050
2671
  fitToWidth="Fit to width"
2051
-
2672
+
2052
2673
  i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
2053
2674
  searchInputPlaceholder="Search"
2054
-
2675
+
2055
2676
  i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
2056
2677
  searchMatchesOf="of"
2057
-
2678
+
2058
2679
  i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
2059
2680
  searchPreviousMatchTitle="Previous match"
2060
-
2681
+
2061
2682
  i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
2062
2683
  searchNextMatchTitle="Next match"
2063
-
2684
+
2064
2685
  i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
2065
2686
  searchCloseTitle="Close"
2066
-
2687
+
2067
2688
  i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
2068
2689
  searchMatchCaseTitle="Match case"
2069
-
2690
+
2070
2691
  i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
2071
- zoomInputPlaceholder="Choose zoom level">
2692
+ zoomInputPlaceholder="Choose zoom level"
2693
+
2694
+ i18n-annotationsTitle="kendo.pdfviewer.annotationsTitle|The Annotations tool title and label."
2695
+ annotationsTitle="Annotations"
2696
+
2697
+ i18n-annotationEditorTitle="kendo.pdfviewer.annotationEditorTitle|The annotation editor tool title and label."
2698
+ annotationEditorTitle="Annotation editor"
2699
+
2700
+ i18n-deleteAnnotationTitle="kendo.pdfviewer.deleteAnnotationTitle|The delete annotation tool title and label."
2701
+ deleteAnnotationTitle="Delete annotation"
2702
+
2703
+ i18n-highlightAnnotationTitle="kendo.pdfviewer.highlightAnnotationTitle|The highlight annotation tool title and label."
2704
+ highlightAnnotationTitle="Highlight"
2705
+
2706
+ i18n-freeTextAnnotationTitle="kendo.pdfviewer.freeTextAnnotationTitle|The free text annotation tool title and label."
2707
+ freeTextAnnotationTitle="Free text"
2708
+
2709
+ i18n-closeAnnotationsToolbarTitle="kendo.pdfviewer.closeAnnotationsToolbarTitle|The close annotations toolbar tool title and label."
2710
+ closeAnnotationsToolbarTitle="Close"
2711
+
2712
+ i18n-deleteAnnotationConfirmationDialogTitle="kendo.pdfviewer.deleteAnnotationConfirmationDialogTitle|The delete annotation confirmation dialog title."
2713
+ deleteAnnotationConfirmationDialogTitle="Delete annotation"
2714
+
2715
+ i18n-deleteAnnotationConfirmationDialogContent="kendo.pdfviewer.deleteAnnotationConfirmationDialogContent|The delete annotation confirmation dialog content."
2716
+ deleteAnnotationConfirmationDialogContent="Are you sure you want to delete this annotation?"
2717
+
2718
+ i18n-deleteAnnotationConfirmationDialogConfirmText="kendo.pdfviewer.deleteAnnotationConfirmationDialogConfirmText|The delete annotation confirmation dialog confirm button text."
2719
+ deleteAnnotationConfirmationDialogConfirmText="Delete"
2720
+
2721
+ i18n-deleteAnnotationConfirmationDialogRejectText="kendo.pdfviewer.deleteAnnotationConfirmationDialogRejectText|The delete annotation confirmation dialog reject button text."
2722
+ deleteAnnotationConfirmationDialogRejectText="Cancel"
2723
+
2724
+ i18n-annotationEditorFontSizeTitle="kendo.pdfviewer.annotationEditorFontSizeTitle|The annotation editor font size section title."
2725
+ annotationEditorFontSizeTitle="Font size"
2726
+
2727
+ i18n-annotationEditorColorTitle="kendo.pdfviewer.annotationEditorColorTitle|The annotation editor color section title."
2728
+ annotationEditorColorTitle="Color">
2072
2729
  </ng-container>
2073
- <div kendoPDFViewerLoader
2730
+ <div kendoPDFViewerLoader
2074
2731
  *ngIf="loading"
2075
2732
  [settings]="loaderSettings"></div>
2076
2733
  <div kendoPDFViewerToolbar
@@ -2086,18 +2743,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2086
2743
  [zoomOptionsData]="zoomOptionsData"
2087
2744
  [zoomLevelChooserValue]="zoomLevel"
2088
2745
  [disabledTools]="!pdfContext?.pdfDoc"
2746
+ [isAnnotationsToolbarVisible]="showAnnotationsToolbar"
2747
+ [wrapperId]="showAnnotationsToolbar ? annotationsToolbarId : undefined"
2748
+ [annotationsToolId]="annotationsToolId"
2089
2749
  (pageChange)="onPageChange($event)"
2090
2750
  (fileSelect)="onFileSelect($event)"
2091
2751
  (fileSelectStart)="loading = true;"
2092
2752
  (fileSelectError)="onFileSelectError($event)"
2093
2753
  (download)="onDownload()"
2094
- (panningEnabled)="enabledSelection = false;"
2095
- (selectionEnabled)="enabledSelection = true;"
2754
+ (panningEnabled)="onPanningEnabled();"
2755
+ (selectionEnabled)="onSelectionEnabled();"
2096
2756
  (zoomIn)="onZoomIn()"
2097
2757
  (zoomOut)="onZoomOut()"
2098
2758
  (zoomLevelChange)="onZoomLevelChange($event)"
2099
2759
  (print)="onPrint()"
2100
- (search)="onSearch()"></div>
2760
+ (search)="onSearch()"
2761
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
2762
+ <div *ngIf="showAnnotationsToolbar"
2763
+ [attr.id]="annotationsToolbarId"
2764
+ kendoPDFViewerToolbar
2765
+ #toolbar
2766
+ role="toolbar"
2767
+ type="annotations"
2768
+ (setAnnotationMode)="onSetAnnotationMode($event)"
2769
+ [attr.aria-controls]="pagesContainerId"
2770
+ [disabledTools]="!pdfContext?.pdfDoc"
2771
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
2101
2772
  <div
2102
2773
  class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
2103
2774
  [class.k-enable-text-select]="enabledSelection"
@@ -2114,7 +2785,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2114
2785
  (prevMatch)="onPreviousMatch()"
2115
2786
  (nextMatch)="onNextMatch()"
2116
2787
  (close)="closeSearch(toolbar)"></div>
2117
- <div
2788
+ <div
2118
2789
  #pagesContainer
2119
2790
  [kendoEventsOutsideAngular]="{
2120
2791
  wheel: stopPropagation
@@ -2123,17 +2794,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2123
2794
  [attr.id]="pagesContainerId"></div>
2124
2795
  </div>
2125
2796
 
2126
- <div kendoWatermarkOverlay *ngIf="showLicenseWatermark"></div>
2797
+ <div #dialogContainer></div>
2798
+ <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
2127
2799
  `,
2128
2800
  standalone: true,
2129
2801
  imports: [LocalizedPDFViewerMessagesDirective, NgIf, EventsOutsideAngularDirective, LoaderComponent, ToolbarComponent, PDFViewerSearchComponent, WatermarkOverlayComponent]
2130
2802
  }]
2131
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { hostClass: [{
2803
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2$1.PopupService }]; }, propDecorators: { hostClass: [{
2132
2804
  type: HostBinding,
2133
2805
  args: ['class.k-pdf-viewer']
2134
2806
  }], direction: [{
2135
2807
  type: HostBinding,
2136
2808
  args: ['attr.dir']
2809
+ }], display: [{
2810
+ type: HostBinding,
2811
+ args: ['attr.display']
2137
2812
  }], tools: [{
2138
2813
  type: Input
2139
2814
  }], loaderSettings: [{
@@ -2162,6 +2837,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2162
2837
  type: Input
2163
2838
  }], loadOnDemandPageSize: [{
2164
2839
  type: Input
2840
+ }], removeAnnotationConfirmation: [{
2841
+ type: Input
2165
2842
  }], load: [{
2166
2843
  type: Output
2167
2844
  }], error: [{
@@ -2175,6 +2852,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2175
2852
  }], pagesContainer: [{
2176
2853
  type: ViewChild,
2177
2854
  args: ['pagesContainer']
2855
+ }], pagesContainerViewContainerRef: [{
2856
+ type: ViewChild,
2857
+ args: ['pagesContainer', { read: ViewContainerRef }]
2858
+ }], dialogContainerViewContainerRef: [{
2859
+ type: ViewChild,
2860
+ args: ['dialogContainer', { read: ViewContainerRef }]
2178
2861
  }] } });
2179
2862
 
2180
2863
  /**