@progress/kendo-angular-pdfviewer 17.0.0-develop.9 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/loader/loader.component.mjs +8 -9
- package/{esm2020 → esm2022}/localization/custom-messages.component.mjs +7 -6
- package/{esm2020 → esm2022}/localization/localized-messages.directive.mjs +9 -8
- package/esm2022/localization/messages.mjs +171 -0
- package/{esm2020 → esm2022}/models/events.mjs +16 -0
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/pdfviewer.component.mjs +146 -122
- package/{esm2020 → esm2022}/pdfviewer.module.mjs +8 -8
- package/{esm2020 → esm2022}/toolbar/input-wrapper.component.mjs +9 -6
- package/{esm2020 → esm2022}/toolbar/search.component.mjs +23 -18
- package/{esm2020 → esm2022}/toolbar/toolbar-combobox.directive.mjs +17 -14
- package/{esm2020 → esm2022}/toolbar/toolbar-focusable.directive.mjs +6 -3
- package/{esm2020 → esm2022}/toolbar/toolbar-navigation.service.mjs +6 -5
- package/{esm2020 → esm2022}/toolbar/toolbar.component.mjs +60 -49
- package/{fesm2020 → fesm2022}/progress-kendo-angular-pdfviewer.mjs +422 -255
- package/loader/loader.component.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/models/toolbar-tool.d.ts +1 -1
- package/package.json +21 -27
- package/pdfviewer.component.d.ts +1 -1
- package/schematics/ngAdd/index.js +2 -2
- package/toolbar/input-wrapper.component.d.ts +1 -1
- package/toolbar/search.component.d.ts +1 -1
- package/toolbar/toolbar.component.d.ts +1 -1
- package/esm2020/localization/messages.mjs +0 -71
- package/fesm2015/progress-kendo-angular-pdfviewer.mjs +0 -2061
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/models/loader-settings.mjs +0 -0
- /package/{esm2020 → esm2022}/models/pdfviewer-context.mjs +0 -0
- /package/{esm2020 → esm2022}/models/toolbar-tool.mjs +0 -0
- /package/{esm2020 → esm2022}/models/zoom-level.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-pdfviewer.mjs +0 -0
- /package/{esm2020 → esm2022}/util.mjs +0 -0
@@ -9,14 +9,12 @@ import * as i0 from "@angular/core";
|
|
9
9
|
* @hidden
|
10
10
|
*/
|
11
11
|
export class LoaderComponent {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
17
|
-
}
|
18
|
-
LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
19
|
-
LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: LoaderComponent, isStandalone: true, selector: "[kendoPDFViewerLoader]", inputs: { settings: "settings" }, host: { properties: { "class.k-loader-container": "this.loaderContainerClass", "class.k-loader-container-md": "this.loaderContainerSizingClass", "class.k-loader-top": "this.loaderPositionClass" } }, ngImport: i0, template: `
|
12
|
+
settings;
|
13
|
+
loaderContainerClass = true;
|
14
|
+
loaderContainerSizingClass = true;
|
15
|
+
loaderPositionClass = true;
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LoaderComponent, isStandalone: true, selector: "[kendoPDFViewerLoader]", inputs: { settings: "settings" }, host: { properties: { "class.k-loader-container": "this.loaderContainerClass", "class.k-loader-container-md": "this.loaderContainerSizingClass", "class.k-loader-top": "this.loaderPositionClass" } }, ngImport: i0, template: `
|
20
18
|
<div class="k-loader-container-overlay k-overlay-light"></div>
|
21
19
|
<div class="k-loader-container-inner">
|
22
20
|
<kendo-loader
|
@@ -25,7 +23,8 @@ LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", versio
|
|
25
23
|
[themeColor]="settings?.themeColor"></kendo-loader>
|
26
24
|
</div>
|
27
25
|
`, isInline: true, dependencies: [{ kind: "component", type: LoaderIndicatorComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }] });
|
28
|
-
|
26
|
+
}
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LoaderComponent, decorators: [{
|
29
28
|
type: Component,
|
30
29
|
args: [{
|
31
30
|
selector: '[kendoPDFViewerLoader]',
|
@@ -11,6 +11,7 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
11
11
|
* Custom component messages override default component messages.
|
12
12
|
*/
|
13
13
|
export class PDFViewerCustomMessagesComponent extends Messages {
|
14
|
+
service;
|
14
15
|
constructor(service) {
|
15
16
|
super();
|
16
17
|
this.service = service;
|
@@ -18,13 +19,13 @@ export class PDFViewerCustomMessagesComponent extends Messages {
|
|
18
19
|
get override() {
|
19
20
|
return true;
|
20
21
|
}
|
22
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerCustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFViewerCustomMessagesComponent, isStandalone: true, selector: "kendo-pdfviewer-messages", providers: [{
|
24
|
+
provide: Messages,
|
25
|
+
useExisting: forwardRef(() => PDFViewerCustomMessagesComponent)
|
26
|
+
}], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
21
27
|
}
|
22
|
-
|
23
|
-
PDFViewerCustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFViewerCustomMessagesComponent, isStandalone: true, selector: "kendo-pdfviewer-messages", providers: [{
|
24
|
-
provide: Messages,
|
25
|
-
useExisting: forwardRef(() => PDFViewerCustomMessagesComponent)
|
26
|
-
}], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerCustomMessagesComponent, decorators: [{
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerCustomMessagesComponent, decorators: [{
|
28
29
|
type: Component,
|
29
30
|
args: [{
|
30
31
|
providers: [{
|
@@ -11,19 +11,20 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
11
11
|
* @hidden
|
12
12
|
*/
|
13
13
|
export class LocalizedPDFViewerMessagesDirective extends Messages {
|
14
|
+
service;
|
14
15
|
constructor(service) {
|
15
16
|
super();
|
16
17
|
this.service = service;
|
17
18
|
}
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedPDFViewerMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LocalizedPDFViewerMessagesDirective, isStandalone: true, selector: "[kendoPDFViewerLocalizedMessages]", providers: [
|
21
|
+
{
|
22
|
+
provide: Messages,
|
23
|
+
useExisting: forwardRef(() => LocalizedPDFViewerMessagesDirective)
|
24
|
+
}
|
25
|
+
], usesInheritance: true, ngImport: i0 });
|
18
26
|
}
|
19
|
-
|
20
|
-
LocalizedPDFViewerMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedPDFViewerMessagesDirective, isStandalone: true, selector: "[kendoPDFViewerLocalizedMessages]", providers: [
|
21
|
-
{
|
22
|
-
provide: Messages,
|
23
|
-
useExisting: forwardRef(() => LocalizedPDFViewerMessagesDirective)
|
24
|
-
}
|
25
|
-
], usesInheritance: true, ngImport: i0 });
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedPDFViewerMessagesDirective, decorators: [{
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedPDFViewerMessagesDirective, decorators: [{
|
27
28
|
type: Directive,
|
28
29
|
args: [{
|
29
30
|
providers: [
|
@@ -0,0 +1,171 @@
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
5
|
+
import { Directive, Input } from '@angular/core';
|
6
|
+
import { ComponentMessages } from '@progress/kendo-angular-l10n';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
/**
|
9
|
+
* @hidden
|
10
|
+
*/
|
11
|
+
export class Messages extends ComponentMessages {
|
12
|
+
/**
|
13
|
+
* The ZoomIn tool title and label.
|
14
|
+
*/
|
15
|
+
zoomInTitle;
|
16
|
+
/**
|
17
|
+
* The ZoomOut tool titla and label.
|
18
|
+
*/
|
19
|
+
zoomOutTitle;
|
20
|
+
/**
|
21
|
+
* The Selection tool title and label.
|
22
|
+
*/
|
23
|
+
selectionTitle;
|
24
|
+
/**
|
25
|
+
* The Panning tool title and label.
|
26
|
+
*/
|
27
|
+
panningTitle;
|
28
|
+
/**
|
29
|
+
* The Search tool title and label.
|
30
|
+
*/
|
31
|
+
searchTitle;
|
32
|
+
/**
|
33
|
+
* The Open tool title and label.
|
34
|
+
*/
|
35
|
+
openTitle;
|
36
|
+
/**
|
37
|
+
* The Download tool title and label.
|
38
|
+
*/
|
39
|
+
downloadTitle;
|
40
|
+
/**
|
41
|
+
* The Print tool title and label.
|
42
|
+
*/
|
43
|
+
printTitle;
|
44
|
+
/**
|
45
|
+
* The `aria-label` attribute of the Pager input element.
|
46
|
+
*/
|
47
|
+
pagerInputLabel;
|
48
|
+
/**
|
49
|
+
* The `title` attribute of the Pager input element.
|
50
|
+
*/
|
51
|
+
pagerInputTitle;
|
52
|
+
/**
|
53
|
+
* The Pager **First page** button label.
|
54
|
+
*/
|
55
|
+
pagerFirstPage;
|
56
|
+
/**
|
57
|
+
* The Pager **Previous page** button label.
|
58
|
+
*/
|
59
|
+
pagerPreviousPage;
|
60
|
+
/**
|
61
|
+
* The Pager **Next page** button label.
|
62
|
+
*/
|
63
|
+
pagerNextPage;
|
64
|
+
/**
|
65
|
+
* The Pager **Last page** button label.
|
66
|
+
*/
|
67
|
+
pagerLastPage;
|
68
|
+
/**
|
69
|
+
* The text before the Pager total-page number.
|
70
|
+
*/
|
71
|
+
pagerOf;
|
72
|
+
/**
|
73
|
+
* The text displayed before the Pager input.
|
74
|
+
*/
|
75
|
+
pagerPage;
|
76
|
+
/**
|
77
|
+
* The text for the zoom level chooser Fit to page option.
|
78
|
+
*/
|
79
|
+
fitToPage;
|
80
|
+
/**
|
81
|
+
* The text for the zoom level chooser Fit to width option.
|
82
|
+
*/
|
83
|
+
fitToWidth;
|
84
|
+
/**
|
85
|
+
* The text for the search input placeholder.
|
86
|
+
*/
|
87
|
+
searchInputPlaceholder;
|
88
|
+
/**
|
89
|
+
* The text before the total number of matches in the Search tool.
|
90
|
+
*/
|
91
|
+
searchMatchesOf;
|
92
|
+
/**
|
93
|
+
* The title of the Search previous match button.
|
94
|
+
*/
|
95
|
+
searchPreviousMatchTitle;
|
96
|
+
/**
|
97
|
+
* The title of the Search next match button.
|
98
|
+
*/
|
99
|
+
searchNextMatchTitle;
|
100
|
+
/**
|
101
|
+
* The title of the Search close button.
|
102
|
+
*/
|
103
|
+
searchCloseTitle;
|
104
|
+
/**
|
105
|
+
* The title of the Search match case button.
|
106
|
+
*/
|
107
|
+
searchMatchCaseTitle;
|
108
|
+
/**
|
109
|
+
* The text for the zoom tool input placeholder.
|
110
|
+
*/
|
111
|
+
zoomInputPlaceholder;
|
112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
113
|
+
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 });
|
114
|
+
}
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, decorators: [{
|
116
|
+
type: Directive,
|
117
|
+
args: [{
|
118
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
119
|
+
selector: 'kendo-pdfviewer-messages-base'
|
120
|
+
}]
|
121
|
+
}], propDecorators: { zoomInTitle: [{
|
122
|
+
type: Input
|
123
|
+
}], zoomOutTitle: [{
|
124
|
+
type: Input
|
125
|
+
}], selectionTitle: [{
|
126
|
+
type: Input
|
127
|
+
}], panningTitle: [{
|
128
|
+
type: Input
|
129
|
+
}], searchTitle: [{
|
130
|
+
type: Input
|
131
|
+
}], openTitle: [{
|
132
|
+
type: Input
|
133
|
+
}], downloadTitle: [{
|
134
|
+
type: Input
|
135
|
+
}], printTitle: [{
|
136
|
+
type: Input
|
137
|
+
}], pagerInputLabel: [{
|
138
|
+
type: Input
|
139
|
+
}], pagerInputTitle: [{
|
140
|
+
type: Input
|
141
|
+
}], pagerFirstPage: [{
|
142
|
+
type: Input
|
143
|
+
}], pagerPreviousPage: [{
|
144
|
+
type: Input
|
145
|
+
}], pagerNextPage: [{
|
146
|
+
type: Input
|
147
|
+
}], pagerLastPage: [{
|
148
|
+
type: Input
|
149
|
+
}], pagerOf: [{
|
150
|
+
type: Input
|
151
|
+
}], pagerPage: [{
|
152
|
+
type: Input
|
153
|
+
}], fitToPage: [{
|
154
|
+
type: Input
|
155
|
+
}], fitToWidth: [{
|
156
|
+
type: Input
|
157
|
+
}], searchInputPlaceholder: [{
|
158
|
+
type: Input
|
159
|
+
}], searchMatchesOf: [{
|
160
|
+
type: Input
|
161
|
+
}], searchPreviousMatchTitle: [{
|
162
|
+
type: Input
|
163
|
+
}], searchNextMatchTitle: [{
|
164
|
+
type: Input
|
165
|
+
}], searchCloseTitle: [{
|
166
|
+
type: Input
|
167
|
+
}], searchMatchCaseTitle: [{
|
168
|
+
type: Input
|
169
|
+
}], zoomInputPlaceholder: [{
|
170
|
+
type: Input
|
171
|
+
}] } });
|
@@ -8,6 +8,22 @@ import { PreventableEvent } from "@progress/kendo-angular-common";
|
|
8
8
|
* If you cancel the event, the downloading of the file is prevented.
|
9
9
|
*/
|
10
10
|
export class PDFViewerDownloadEvent extends PreventableEvent {
|
11
|
+
/**
|
12
|
+
* The Blob object.
|
13
|
+
*/
|
14
|
+
blob;
|
15
|
+
/**
|
16
|
+
* The name which will be used for saving the file.
|
17
|
+
*/
|
18
|
+
fileName;
|
19
|
+
/**
|
20
|
+
* The options which will be used for saving the file.
|
21
|
+
*/
|
22
|
+
saveOptions;
|
23
|
+
/**
|
24
|
+
* Represents the currently loaded `PDF.js` document, its pages, and their DOM element wrapper.
|
25
|
+
*/
|
26
|
+
context;
|
11
27
|
/**
|
12
28
|
* @hidden
|
13
29
|
*/
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
9
9
|
name: '@progress/kendo-angular-pdfviewer',
|
10
10
|
productName: 'Kendo UI for Angular',
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
12
|
-
publishDate:
|
13
|
-
version: '17.0.0
|
12
|
+
publishDate: 1731414240,
|
13
|
+
version: '17.0.0',
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning',
|
15
15
|
};
|
@@ -25,115 +25,63 @@ let counter = 0;
|
|
25
25
|
* Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
|
26
26
|
*/
|
27
27
|
export class PDFViewerComponent {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
* The event fired when a PDF document is successfully loaded in the `PDFViewer` component.
|
86
|
-
*/
|
87
|
-
this.load = new EventEmitter();
|
88
|
-
/**
|
89
|
-
* The event fired when an error occurs during the loading or downloading of the PDF document.
|
90
|
-
*/
|
91
|
-
this.error = new EventEmitter();
|
92
|
-
/**
|
93
|
-
* The event fired when an error occurs during the loading of the PDF document.
|
94
|
-
*/
|
95
|
-
this.download = new EventEmitter();
|
96
|
-
/**
|
97
|
-
* The event fired when the end user changes the page of the loaded PDF document.
|
98
|
-
*/
|
99
|
-
this.pageChange = new EventEmitter();
|
100
|
-
/**
|
101
|
-
* The event fired when the end user changes the zoom level of the loaded PDF document.
|
102
|
-
*/
|
103
|
-
this.zoomLevelChange = new EventEmitter();
|
104
|
-
this.loading = false;
|
105
|
-
this.searchActive = false;
|
106
|
-
this.matchCase = false;
|
107
|
-
this.currentMatches = [];
|
108
|
-
/**
|
109
|
-
* @hidden
|
110
|
-
*/
|
111
|
-
this.showLicenseWatermark = false;
|
112
|
-
this.skip = 0;
|
113
|
-
this.zoomOptionsData = zoomOptionsData;
|
114
|
-
this.zoomLevel = this.zoomOptionsData[5];
|
115
|
-
this._pdfContext = null;
|
116
|
-
this._enabledSelection = false;
|
117
|
-
this._zoom = INITIAL_ZOOM_LEVEL;
|
118
|
-
this._zoomToFit = false;
|
119
|
-
this.subs = new Subscription();
|
120
|
-
this.scrollListener = (e) => {
|
121
|
-
const nextPage = currentPage(e.target.parentNode);
|
122
|
-
if (nextPage !== this.skip) {
|
123
|
-
this.ngZone.run(() => {
|
124
|
-
hasObservers(this.pageChange) && this.pageChange.emit({
|
125
|
-
previousPage: this.currentPage,
|
126
|
-
currentPage: nextPage + 1
|
127
|
-
});
|
128
|
-
this.skip = nextPage;
|
129
|
-
});
|
130
|
-
}
|
131
|
-
};
|
132
|
-
const isValid = validatePackage(packageMetadata);
|
133
|
-
this.showLicenseWatermark = shouldShowValidationUI(isValid);
|
134
|
-
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
135
|
-
counter++;
|
136
|
-
}
|
28
|
+
ngZone;
|
29
|
+
renderer;
|
30
|
+
localizationService;
|
31
|
+
cdr;
|
32
|
+
hostClass = true;
|
33
|
+
direction;
|
34
|
+
/**
|
35
|
+
* Represents the tools collection rendered in the toolbar.
|
36
|
+
* @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print' ]
|
37
|
+
*/
|
38
|
+
tools = [
|
39
|
+
'pager',
|
40
|
+
'spacer',
|
41
|
+
'zoomInOut',
|
42
|
+
'zoom',
|
43
|
+
'selection',
|
44
|
+
'spacer',
|
45
|
+
'search',
|
46
|
+
'open',
|
47
|
+
'download',
|
48
|
+
'print'
|
49
|
+
];
|
50
|
+
/**
|
51
|
+
* The configuration of the internal Loader component.
|
52
|
+
* @default { size: 'large', type: 'pulsing', themeColor: 'primary' }
|
53
|
+
*/
|
54
|
+
loaderSettings = {
|
55
|
+
size: 'large',
|
56
|
+
type: 'pulsing',
|
57
|
+
themeColor: 'primary'
|
58
|
+
};
|
59
|
+
/**
|
60
|
+
* The name of the file that will be saved when the end user clicks the Download tool.
|
61
|
+
* @default 'Download'
|
62
|
+
*/
|
63
|
+
saveFileName = 'Download';
|
64
|
+
/**
|
65
|
+
* Represents the options for saving the file when the end user clicks the Download tool.
|
66
|
+
* @default {}
|
67
|
+
*/
|
68
|
+
saveOptions = {};
|
69
|
+
/**
|
70
|
+
* Represents the url of the PDF file.
|
71
|
+
*/
|
72
|
+
url;
|
73
|
+
/**
|
74
|
+
* Represents the data of the PDF file in [Base64 format](https://developer.mozilla.org/en-US/docs/Glossary/Base64).
|
75
|
+
*/
|
76
|
+
data;
|
77
|
+
/**
|
78
|
+
* Represents the raw [binary data buffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) of the PDF file.
|
79
|
+
*/
|
80
|
+
arrayBuffer;
|
81
|
+
/**
|
82
|
+
* Represents the data of the PDF file in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) format.
|
83
|
+
*/
|
84
|
+
typedArray;
|
137
85
|
/**
|
138
86
|
* The initial zoom level of the PDF document
|
139
87
|
* ([see example](slug:tools_pdfviewer#zooming-tools)).
|
@@ -155,6 +103,42 @@ export class PDFViewerComponent {
|
|
155
103
|
get zoom() {
|
156
104
|
return this._zoom;
|
157
105
|
}
|
106
|
+
/**
|
107
|
+
* Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
|
108
|
+
* @default 0.25
|
109
|
+
*/
|
110
|
+
zoomRate = 0.25;
|
111
|
+
/**
|
112
|
+
* Represents minimum allowed zoom value.
|
113
|
+
* @default 0.5
|
114
|
+
*/
|
115
|
+
minZoom = 0.5;
|
116
|
+
/**
|
117
|
+
* Represents maximum allowed zoom value.
|
118
|
+
* @default 4
|
119
|
+
*/
|
120
|
+
maxZoom = 4;
|
121
|
+
/**
|
122
|
+
* The event fired when a PDF document is successfully loaded in the `PDFViewer` component.
|
123
|
+
*/
|
124
|
+
load = new EventEmitter();
|
125
|
+
/**
|
126
|
+
* The event fired when an error occurs during the loading or downloading of the PDF document.
|
127
|
+
*/
|
128
|
+
error = new EventEmitter();
|
129
|
+
/**
|
130
|
+
* The event fired when an error occurs during the loading of the PDF document.
|
131
|
+
*/
|
132
|
+
download = new EventEmitter();
|
133
|
+
/**
|
134
|
+
* The event fired when the end user changes the page of the loaded PDF document.
|
135
|
+
*/
|
136
|
+
pageChange = new EventEmitter();
|
137
|
+
/**
|
138
|
+
* The event fired when the end user changes the zoom level of the loaded PDF document.
|
139
|
+
*/
|
140
|
+
zoomLevelChange = new EventEmitter();
|
141
|
+
pagesContainer;
|
158
142
|
/**
|
159
143
|
* Returns the current page number of the loaded PDF document.
|
160
144
|
*/
|
@@ -189,6 +173,11 @@ export class PDFViewerComponent {
|
|
189
173
|
}
|
190
174
|
return `k-pdfviewer-${counter}-pages-container`;
|
191
175
|
}
|
176
|
+
loading = false;
|
177
|
+
searchActive = false;
|
178
|
+
matchCase = false;
|
179
|
+
currentMatches = [];
|
180
|
+
currentMatch;
|
192
181
|
/**
|
193
182
|
* @hidden
|
194
183
|
*/
|
@@ -204,6 +193,31 @@ export class PDFViewerComponent {
|
|
204
193
|
get enabledSelection() {
|
205
194
|
return this._enabledSelection;
|
206
195
|
}
|
196
|
+
/**
|
197
|
+
* @hidden
|
198
|
+
*/
|
199
|
+
showLicenseWatermark = false;
|
200
|
+
skip = 0;
|
201
|
+
zoomOptionsData = zoomOptionsData;
|
202
|
+
zoomLevel = this.zoomOptionsData[5];
|
203
|
+
_pdfContext = null;
|
204
|
+
_enabledSelection = false;
|
205
|
+
_zoom = INITIAL_ZOOM_LEVEL;
|
206
|
+
_fitType;
|
207
|
+
_zoomToFit = false;
|
208
|
+
pdfScroller;
|
209
|
+
searchService;
|
210
|
+
subs = new Subscription();
|
211
|
+
constructor(ngZone, renderer, localizationService, cdr) {
|
212
|
+
this.ngZone = ngZone;
|
213
|
+
this.renderer = renderer;
|
214
|
+
this.localizationService = localizationService;
|
215
|
+
this.cdr = cdr;
|
216
|
+
const isValid = validatePackage(packageMetadata);
|
217
|
+
this.showLicenseWatermark = shouldShowValidationUI(isValid);
|
218
|
+
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
219
|
+
counter++;
|
220
|
+
}
|
207
221
|
ngOnInit() {
|
208
222
|
this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
209
223
|
}
|
@@ -448,8 +462,7 @@ export class PDFViewerComponent {
|
|
448
462
|
if (hasObservers(this.error)) {
|
449
463
|
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
450
464
|
}
|
451
|
-
}
|
452
|
-
enableAnnotations: false
|
465
|
+
}
|
453
466
|
});
|
454
467
|
}));
|
455
468
|
}
|
@@ -478,8 +491,7 @@ export class PDFViewerComponent {
|
|
478
491
|
if (hasObservers(this.error)) {
|
479
492
|
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
480
493
|
}
|
481
|
-
}
|
482
|
-
enableAnnotations: false
|
494
|
+
}
|
483
495
|
});
|
484
496
|
}
|
485
497
|
}
|
@@ -510,15 +522,26 @@ export class PDFViewerComponent {
|
|
510
522
|
isSet(changes, source) {
|
511
523
|
return this[source] || (changes[source] && changes[source].currentValue);
|
512
524
|
}
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
525
|
+
scrollListener = (e) => {
|
526
|
+
const nextPage = currentPage(e.target.parentNode);
|
527
|
+
if (nextPage !== this.skip) {
|
528
|
+
this.ngZone.run(() => {
|
529
|
+
hasObservers(this.pageChange) && this.pageChange.emit({
|
530
|
+
previousPage: this.currentPage,
|
531
|
+
currentPage: nextPage + 1
|
532
|
+
});
|
533
|
+
this.skip = nextPage;
|
534
|
+
});
|
520
535
|
}
|
521
|
-
|
536
|
+
};
|
537
|
+
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 }], target: i0.ɵɵFactoryTarget.Component });
|
538
|
+
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" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
|
539
|
+
LocalizationService,
|
540
|
+
{
|
541
|
+
provide: L10N_PREFIX,
|
542
|
+
useValue: 'kendo.pdfviewer'
|
543
|
+
}
|
544
|
+
], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
|
522
545
|
<ng-container kendoPDFViewerLocalizedMessages
|
523
546
|
i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
|
524
547
|
pagerFirstPage="Go to the first page"
|
@@ -652,7 +675,8 @@ PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", ver
|
|
652
675
|
|
653
676
|
<div kendoWatermarkOverlay *ngIf="showLicenseWatermark"></div>
|
654
677
|
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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]" }] });
|
655
|
-
|
678
|
+
}
|
679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, decorators: [{
|
656
680
|
type: Component,
|
657
681
|
args: [{
|
658
682
|
exportAs: 'kendo-pdfviewer',
|
@@ -16,15 +16,15 @@ import * as i2 from "./localization/custom-messages.component";
|
|
16
16
|
* definition for the PDFViewer component.
|
17
17
|
*/
|
18
18
|
export class PDFViewerModule {
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
20
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerModule, imports: [i1.PDFViewerComponent, i2.PDFViewerCustomMessagesComponent], exports: [i1.PDFViewerComponent, i2.PDFViewerCustomMessagesComponent] });
|
21
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerModule, providers: [
|
22
|
+
IconsService,
|
23
|
+
PopupService,
|
24
|
+
ResizeBatchService
|
25
|
+
], imports: [i1.PDFViewerComponent] });
|
19
26
|
}
|
20
|
-
|
21
|
-
PDFViewerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerModule, imports: [i1.PDFViewerComponent, i2.PDFViewerCustomMessagesComponent], exports: [i1.PDFViewerComponent, i2.PDFViewerCustomMessagesComponent] });
|
22
|
-
PDFViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerModule, providers: [
|
23
|
-
IconsService,
|
24
|
-
PopupService,
|
25
|
-
ResizeBatchService
|
26
|
-
], imports: [KENDO_PDFVIEWER] });
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFViewerModule, decorators: [{
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerModule, decorators: [{
|
28
28
|
type: NgModule,
|
29
29
|
args: [{
|
30
30
|
exports: [...KENDO_PDFVIEWER],
|