@progress/kendo-angular-pdfviewer 13.0.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +32 -0
- package/esm2020/index.mjs +16 -0
- package/esm2020/loader/loader.component.mjs +53 -0
- package/esm2020/localization/custom-messages.component.mjs +38 -0
- package/esm2020/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/localization/messages.mjs +71 -0
- package/esm2020/models/events.mjs +21 -0
- package/esm2020/models/loader-settings.mjs +5 -0
- package/esm2020/models/pdfviewer-context.mjs +5 -0
- package/esm2020/models/toolbar-tool.mjs +5 -0
- package/esm2020/models/zoom-level.mjs +5 -0
- package/esm2020/package-metadata.mjs +15 -0
- package/esm2020/pdfviewer.component.mjs +801 -0
- package/esm2020/pdfviewer.module.mjs +81 -0
- package/esm2020/progress-kendo-angular-pdfviewer.mjs +8 -0
- package/esm2020/toolbar/input-wrapper.component.mjs +63 -0
- package/esm2020/toolbar/search.component.mjs +171 -0
- package/esm2020/toolbar/toolbar-combobox.directive.mjs +43 -0
- package/esm2020/toolbar/toolbar-focusable.directive.mjs +63 -0
- package/esm2020/toolbar/toolbar-navigation.service.mjs +52 -0
- package/esm2020/toolbar/toolbar.component.mjs +460 -0
- package/esm2020/util.mjs +72 -0
- package/fesm2015/progress-kendo-angular-pdfviewer.mjs +1943 -0
- package/fesm2020/progress-kendo-angular-pdfviewer.mjs +1938 -0
- package/index.d.ts +16 -0
- package/loader/loader.component.d.ts +17 -0
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +113 -0
- package/models/events.d.ts +81 -0
- package/models/loader-settings.d.ts +48 -0
- package/models/pdfviewer-context.d.ts +27 -0
- package/models/toolbar-tool.d.ts +8 -0
- package/models/zoom-level.d.ts +14 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +65 -0
- package/pdfviewer.component.d.ts +228 -0
- package/pdfviewer.module.d.ts +30 -0
- package/progress-kendo-angular-pdfviewer.d.ts +9 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +8 -0
- package/schematics/ngAdd/schema.json +24 -0
- package/toolbar/input-wrapper.component.d.ts +21 -0
- package/toolbar/search.component.d.ts +39 -0
- package/toolbar/toolbar-combobox.directive.d.ts +21 -0
- package/toolbar/toolbar-focusable.directive.d.ts +21 -0
- package/toolbar/toolbar-navigation.service.d.ts +23 -0
- package/toolbar/toolbar.component.d.ts +65 -0
- package/util.d.ts +32 -0
|
@@ -0,0 +1,1938 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { Component, Input, HostBinding, Injectable, Directive, EventEmitter, ViewChild, Output, ElementRef, HostListener, forwardRef, isDevMode, NgModule } from '@angular/core';
|
|
7
|
+
import * as i7 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
+
import { currentPage, removeChildren, scrollToPage, calculateZoomLevel, SearchService, print, goToNextSearchMatch, goToPreviousSearchMatch, loadPDF, Scroller, reloadDocument } from '@progress/kendo-pdfviewer-common';
|
|
11
|
+
import { PreventableEvent, focusableSelector, Keys, hasObservers } from '@progress/kendo-angular-common';
|
|
12
|
+
import * as i1$1 from '@progress/kendo-angular-l10n';
|
|
13
|
+
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
14
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
15
|
+
import { Subscription } from 'rxjs';
|
|
16
|
+
import 'pdfjs-dist/build/pdf.worker.entry';
|
|
17
|
+
import * as i1 from '@progress/kendo-angular-indicators';
|
|
18
|
+
import { LoaderModule } from '@progress/kendo-angular-indicators';
|
|
19
|
+
import { zoomInIcon, zoomOutIcon, handIcon, pointerIcon, searchIcon, folderOpenIcon, downloadIcon, printIcon, convertLowercaseIcon, arrowUpIcon, arrowDownIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
20
|
+
import * as i4 from '@progress/kendo-angular-pager';
|
|
21
|
+
import { PagerModule } from '@progress/kendo-angular-pager';
|
|
22
|
+
import * as i5 from '@progress/kendo-angular-buttons';
|
|
23
|
+
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
24
|
+
import * as i1$2 from '@progress/kendo-angular-dropdowns';
|
|
25
|
+
import { ComboBoxModule } from '@progress/kendo-angular-dropdowns';
|
|
26
|
+
import * as i2 from '@progress/kendo-angular-inputs';
|
|
27
|
+
import { TextBoxModule } from '@progress/kendo-angular-inputs';
|
|
28
|
+
import { IconsModule } from '@progress/kendo-angular-icons';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
const packageMetadata = {
|
|
34
|
+
name: '@progress/kendo-angular-pdfviewer',
|
|
35
|
+
productName: 'Kendo UI for Angular',
|
|
36
|
+
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
37
|
+
publishDate: 1685119777,
|
|
38
|
+
version: '13.0.0-develop.10',
|
|
39
|
+
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',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
const INITIAL_ZOOM_LEVEL = 1.25;
|
|
46
|
+
/**
|
|
47
|
+
* @hidden
|
|
48
|
+
*/
|
|
49
|
+
const MIN_ZOOM_LEVEL = 0.5;
|
|
50
|
+
/**
|
|
51
|
+
* @hidden
|
|
52
|
+
*/
|
|
53
|
+
const MAX_ZOOM_LEVEL = 4;
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
const zoomOptionsData = [{
|
|
58
|
+
id: 1,
|
|
59
|
+
text: 'Fit to width',
|
|
60
|
+
type: 'FitToWidth',
|
|
61
|
+
displayValue: '',
|
|
62
|
+
value: 1
|
|
63
|
+
}, {
|
|
64
|
+
id: 2,
|
|
65
|
+
text: 'Fit to page',
|
|
66
|
+
type: 'FitToPage',
|
|
67
|
+
displayValue: '',
|
|
68
|
+
value: 1
|
|
69
|
+
}, {
|
|
70
|
+
id: 3,
|
|
71
|
+
text: '50%',
|
|
72
|
+
displayValue: '50%',
|
|
73
|
+
value: 0.5
|
|
74
|
+
}, {
|
|
75
|
+
id: 4,
|
|
76
|
+
text: '75%',
|
|
77
|
+
displayValue: '75%',
|
|
78
|
+
value: 0.75
|
|
79
|
+
}, {
|
|
80
|
+
id: 5,
|
|
81
|
+
text: '100%',
|
|
82
|
+
displayValue: '100%',
|
|
83
|
+
value: 1
|
|
84
|
+
}, {
|
|
85
|
+
id: 6,
|
|
86
|
+
text: '125%',
|
|
87
|
+
displayValue: '125%',
|
|
88
|
+
value: 1.25
|
|
89
|
+
}, {
|
|
90
|
+
id: 7,
|
|
91
|
+
text: '150%',
|
|
92
|
+
displayValue: '150%',
|
|
93
|
+
value: 1.5
|
|
94
|
+
}, {
|
|
95
|
+
id: 8,
|
|
96
|
+
text: '200%',
|
|
97
|
+
displayValue: '200%',
|
|
98
|
+
value: 2
|
|
99
|
+
}, {
|
|
100
|
+
id: 9,
|
|
101
|
+
text: '300%',
|
|
102
|
+
displayValue: '300%',
|
|
103
|
+
value: 3
|
|
104
|
+
}, {
|
|
105
|
+
id: 10,
|
|
106
|
+
text: '400%',
|
|
107
|
+
displayValue: '400%',
|
|
108
|
+
value: 4
|
|
109
|
+
}];
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Arguments for the `download` event. The event fires when the end user clicks the Download tool.
|
|
113
|
+
* If you cancel the event, the downloading of the file is prevented.
|
|
114
|
+
*/
|
|
115
|
+
class PDFViewerDownloadEvent extends PreventableEvent {
|
|
116
|
+
/**
|
|
117
|
+
* @hidden
|
|
118
|
+
*/
|
|
119
|
+
constructor(blob, fileName, saveOptions, context) {
|
|
120
|
+
super();
|
|
121
|
+
this.blob = blob;
|
|
122
|
+
this.fileName = fileName;
|
|
123
|
+
this.saveOptions = saveOptions;
|
|
124
|
+
this.context = context;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @hidden
|
|
130
|
+
*/
|
|
131
|
+
class LoaderComponent {
|
|
132
|
+
constructor() {
|
|
133
|
+
this.loaderContainerClass = true;
|
|
134
|
+
this.loaderContainerSizingClass = true;
|
|
135
|
+
this.loaderPositionClass = true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
139
|
+
LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: LoaderComponent, selector: "[loader]", 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: `
|
|
140
|
+
<div class="k-loader-container-overlay k-overlay-light"></div>
|
|
141
|
+
<div class="k-loader-container-inner">
|
|
142
|
+
<kendo-loader
|
|
143
|
+
[size]="settings?.size"
|
|
144
|
+
[type]="settings?.type"
|
|
145
|
+
[themeColor]="settings?.themeColor"></kendo-loader>
|
|
146
|
+
</div>
|
|
147
|
+
`, isInline: true, components: [{ type: i1.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }] });
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
149
|
+
type: Component,
|
|
150
|
+
args: [{
|
|
151
|
+
selector: '[loader]',
|
|
152
|
+
template: `
|
|
153
|
+
<div class="k-loader-container-overlay k-overlay-light"></div>
|
|
154
|
+
<div class="k-loader-container-inner">
|
|
155
|
+
<kendo-loader
|
|
156
|
+
[size]="settings?.size"
|
|
157
|
+
[type]="settings?.type"
|
|
158
|
+
[themeColor]="settings?.themeColor"></kendo-loader>
|
|
159
|
+
</div>
|
|
160
|
+
`
|
|
161
|
+
}]
|
|
162
|
+
}], propDecorators: { settings: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], loaderContainerClass: [{
|
|
165
|
+
type: HostBinding,
|
|
166
|
+
args: ['class.k-loader-container']
|
|
167
|
+
}], loaderContainerSizingClass: [{
|
|
168
|
+
type: HostBinding,
|
|
169
|
+
args: ['class.k-loader-container-md']
|
|
170
|
+
}], loaderPositionClass: [{
|
|
171
|
+
type: HostBinding,
|
|
172
|
+
args: ['class.k-loader-top']
|
|
173
|
+
}] } });
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @hidden
|
|
177
|
+
*/
|
|
178
|
+
class ToolbarNavigationService {
|
|
179
|
+
constructor(localizationService) {
|
|
180
|
+
this.localizationService = localizationService;
|
|
181
|
+
this.focusableTools = [];
|
|
182
|
+
this.currentFocusIndex = 0;
|
|
183
|
+
}
|
|
184
|
+
register(tool) {
|
|
185
|
+
if (!this.focusableTools.some(el => el === tool)) {
|
|
186
|
+
this.focusableTools.push(tool);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
unregister(tool) {
|
|
190
|
+
this.currentFocusIndex = 0;
|
|
191
|
+
this.focusableTools = this.focusableTools.filter(el => el !== tool);
|
|
192
|
+
}
|
|
193
|
+
isActive(focusable) {
|
|
194
|
+
return this.focusableTools[this.currentFocusIndex] === focusable;
|
|
195
|
+
}
|
|
196
|
+
setActiveIndex(tool) {
|
|
197
|
+
this.currentFocusIndex = Math.max(this.focusableTools.indexOf(tool), 0);
|
|
198
|
+
}
|
|
199
|
+
move(direction) {
|
|
200
|
+
let delta = direction === 'right' ? 1 : -1;
|
|
201
|
+
if (this.localizationService.rtl) {
|
|
202
|
+
delta = -delta;
|
|
203
|
+
}
|
|
204
|
+
this.currentFocusIndex += delta;
|
|
205
|
+
if (this.currentFocusIndex < 0) {
|
|
206
|
+
this.currentFocusIndex = this.focusableTools.length - 1;
|
|
207
|
+
}
|
|
208
|
+
else if (this.currentFocusIndex >= this.focusableTools.length) {
|
|
209
|
+
this.currentFocusIndex = 0;
|
|
210
|
+
}
|
|
211
|
+
this.focusableTools[this.currentFocusIndex].activate();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
ToolbarNavigationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
215
|
+
ToolbarNavigationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService });
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarNavigationService, decorators: [{
|
|
217
|
+
type: Injectable
|
|
218
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @hidden
|
|
222
|
+
*/
|
|
223
|
+
class ToolbarInputWrapperComponent {
|
|
224
|
+
constructor(host, renderer) {
|
|
225
|
+
this.host = host;
|
|
226
|
+
this.renderer = renderer;
|
|
227
|
+
this.hostClass = true;
|
|
228
|
+
this.subs = new Subscription();
|
|
229
|
+
}
|
|
230
|
+
ngAfterViewInit() {
|
|
231
|
+
this.subs.add(this.renderer.listen(this.host.nativeElement, 'keydown.enter', () => {
|
|
232
|
+
if (this.toolbarTool.focus) {
|
|
233
|
+
this.toolbarTool.focus();
|
|
234
|
+
}
|
|
235
|
+
else if (this.toolbarTool.element) {
|
|
236
|
+
this.toolbarTool.element.nativeElement.setAttribute('tabindex', '0');
|
|
237
|
+
this.toolbarTool.element.nativeElement.focus();
|
|
238
|
+
}
|
|
239
|
+
}));
|
|
240
|
+
this.subs.add(this.renderer.listen(this.host.nativeElement, 'blur', () => this.host.nativeElement.querySelectorAll(focusableSelector).forEach(el => el.setAttribute('tabindex', '-1'))));
|
|
241
|
+
this.subs.add(this.renderer.listen(this.host.nativeElement, 'keydown.escape', () => {
|
|
242
|
+
if (this.toolbarTool.blur) {
|
|
243
|
+
this.toolbarTool.blur();
|
|
244
|
+
}
|
|
245
|
+
else if (this.toolbarTool.element) {
|
|
246
|
+
this.toolbarTool.element.nativeElement.setAttribute('tabindex', '-1');
|
|
247
|
+
this.toolbarTool.element.nativeElement.blur();
|
|
248
|
+
}
|
|
249
|
+
;
|
|
250
|
+
this.host.nativeElement.focus();
|
|
251
|
+
}));
|
|
252
|
+
}
|
|
253
|
+
ngOnDestroy() {
|
|
254
|
+
this.subs.unsubscribe();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
ToolbarInputWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarInputWrapperComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
258
|
+
ToolbarInputWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ToolbarInputWrapperComponent, selector: "kendo-toolbar-input-wrapper", inputs: { toolbarTool: "toolbarTool" }, host: { properties: { "class.k-toolbar-item": "this.hostClass" } }, ngImport: i0, template: `
|
|
259
|
+
<ng-content></ng-content>
|
|
260
|
+
`, isInline: true });
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarInputWrapperComponent, decorators: [{
|
|
262
|
+
type: Component,
|
|
263
|
+
args: [{
|
|
264
|
+
selector: 'kendo-toolbar-input-wrapper',
|
|
265
|
+
template: `
|
|
266
|
+
<ng-content></ng-content>
|
|
267
|
+
`
|
|
268
|
+
}]
|
|
269
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { toolbarTool: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}], hostClass: [{
|
|
272
|
+
type: HostBinding,
|
|
273
|
+
args: ['class.k-toolbar-item']
|
|
274
|
+
}] } });
|
|
275
|
+
|
|
276
|
+
const controller = new AbortController();
|
|
277
|
+
const { signal } = controller;
|
|
278
|
+
/**
|
|
279
|
+
* @hidden
|
|
280
|
+
*/
|
|
281
|
+
class ToolbarFocusableDirective {
|
|
282
|
+
constructor(host, navigationService, renderer) {
|
|
283
|
+
this.host = host;
|
|
284
|
+
this.navigationService = navigationService;
|
|
285
|
+
this.renderer = renderer;
|
|
286
|
+
navigationService.register(this);
|
|
287
|
+
}
|
|
288
|
+
ngAfterViewInit() {
|
|
289
|
+
const element = this.host.nativeElement;
|
|
290
|
+
this.renderer.setAttribute(element, 'tabindex', this.navigationService.isActive(this) ? '0' : '-1');
|
|
291
|
+
element.addEventListener('keydown', (e) => {
|
|
292
|
+
const targetsSelf = e.target === element;
|
|
293
|
+
const isLeftArrow = e.keyCode === Keys.ArrowLeft;
|
|
294
|
+
const isRightArrow = e.keyCode === Keys.ArrowRight;
|
|
295
|
+
const isArrow = isLeftArrow || isRightArrow;
|
|
296
|
+
if (!targetsSelf || !isArrow) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this.renderer.setAttribute(element, 'tabindex', '-1');
|
|
300
|
+
element.querySelectorAll(focusableSelector).forEach(el => {
|
|
301
|
+
this.renderer.setAttribute(el, 'tabindex', '-1');
|
|
302
|
+
});
|
|
303
|
+
if (isRightArrow) {
|
|
304
|
+
this.navigationService.move('right');
|
|
305
|
+
}
|
|
306
|
+
else if (isLeftArrow) {
|
|
307
|
+
this.navigationService.move('left');
|
|
308
|
+
}
|
|
309
|
+
}, { signal, capture: true });
|
|
310
|
+
element.addEventListener('click', () => {
|
|
311
|
+
this.navigationService.setActiveIndex(this);
|
|
312
|
+
}, { signal, capture: true });
|
|
313
|
+
}
|
|
314
|
+
ngOnDestroy() {
|
|
315
|
+
controller.abort();
|
|
316
|
+
this.navigationService.unregister(this);
|
|
317
|
+
}
|
|
318
|
+
activate() {
|
|
319
|
+
const element = this.host.nativeElement;
|
|
320
|
+
this.renderer.setAttribute(element, 'tabindex', '0');
|
|
321
|
+
element.focus();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
ToolbarFocusableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarFocusableDirective, deps: [{ token: i0.ElementRef }, { token: ToolbarNavigationService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
325
|
+
ToolbarFocusableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: ToolbarFocusableDirective, selector: "[kendoPDFViewerToolbarFocusable]", ngImport: i0 });
|
|
326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarFocusableDirective, decorators: [{
|
|
327
|
+
type: Directive,
|
|
328
|
+
args: [{ selector: '[kendoPDFViewerToolbarFocusable]' }]
|
|
329
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ToolbarNavigationService }, { type: i0.Renderer2 }]; } });
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @hidden
|
|
333
|
+
*/
|
|
334
|
+
class ToolbarComboBoxDirective {
|
|
335
|
+
constructor(combo, hostEl) {
|
|
336
|
+
this.combo = combo;
|
|
337
|
+
this.hostEl = hostEl;
|
|
338
|
+
this.keydownHandler = (e) => {
|
|
339
|
+
if (e.keyCode === Keys.Escape) {
|
|
340
|
+
e.stopPropagation();
|
|
341
|
+
if (this.combo.isOpen) {
|
|
342
|
+
this.combo.toggle(false);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
this.hostEl.nativeElement.parentElement.focus();
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
ngAfterViewInit() {
|
|
351
|
+
this.inputElement = this.combo.searchbar.input.nativeElement;
|
|
352
|
+
this.hostEl.nativeElement.setAttribute('tabindex', '-1');
|
|
353
|
+
this.inputElement.addEventListener('keydown', this.keydownHandler, true);
|
|
354
|
+
}
|
|
355
|
+
ngOnDestroy() {
|
|
356
|
+
this.inputElement.removeEventListener('keydown', this.keydownHandler);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
ToolbarComboBoxDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComboBoxDirective, deps: [{ token: i1$2.ComboBoxComponent }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
360
|
+
ToolbarComboBoxDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: ToolbarComboBoxDirective, selector: "[kendoPDFViewerComboBox]", ngImport: i0 });
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComboBoxDirective, decorators: [{
|
|
362
|
+
type: Directive,
|
|
363
|
+
args: [{ selector: '[kendoPDFViewerComboBox]' }]
|
|
364
|
+
}], ctorParameters: function () { return [{ type: i1$2.ComboBoxComponent }, { type: i0.ElementRef }]; } });
|
|
365
|
+
|
|
366
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
367
|
+
/**
|
|
368
|
+
* @hidden
|
|
369
|
+
*/
|
|
370
|
+
class ToolbarComponent {
|
|
371
|
+
constructor(localization, navigationService) {
|
|
372
|
+
this.localization = localization;
|
|
373
|
+
this.navigationService = navigationService;
|
|
374
|
+
this.toolbarClass = true;
|
|
375
|
+
this.toolbarSizeClass = true;
|
|
376
|
+
this.zoomLevel = {
|
|
377
|
+
text: '125%',
|
|
378
|
+
displayValue: '125%',
|
|
379
|
+
value: 1.25
|
|
380
|
+
};
|
|
381
|
+
this.calculatedComboBoxValue = {
|
|
382
|
+
text: 'Fit to width',
|
|
383
|
+
displayValue: null,
|
|
384
|
+
value: null
|
|
385
|
+
};
|
|
386
|
+
this.skip = 0;
|
|
387
|
+
this.pageSize = 1;
|
|
388
|
+
this.fileSelect = new EventEmitter();
|
|
389
|
+
this.fileSelectError = new EventEmitter();
|
|
390
|
+
this.download = new EventEmitter();
|
|
391
|
+
this.selectionEnabled = new EventEmitter();
|
|
392
|
+
this.panningEnabled = new EventEmitter();
|
|
393
|
+
this.pageChange = new EventEmitter();
|
|
394
|
+
this.zoomIn = new EventEmitter();
|
|
395
|
+
this.zoomOut = new EventEmitter();
|
|
396
|
+
this.zoomLevelChange = new EventEmitter();
|
|
397
|
+
this.print = new EventEmitter();
|
|
398
|
+
this.search = new EventEmitter();
|
|
399
|
+
this.zoomInIcon = zoomInIcon;
|
|
400
|
+
this.zoomOutIcon = zoomOutIcon;
|
|
401
|
+
this.handIcon = handIcon;
|
|
402
|
+
this.pointerIcon = pointerIcon;
|
|
403
|
+
this.searchIcon = searchIcon;
|
|
404
|
+
this.folderOpenIcon = folderOpenIcon;
|
|
405
|
+
this.downloadIcon = downloadIcon;
|
|
406
|
+
this.printIcon = printIcon;
|
|
407
|
+
this.pagerType = 'input';
|
|
408
|
+
}
|
|
409
|
+
messageFor(key) {
|
|
410
|
+
return this.localization.get(key);
|
|
411
|
+
}
|
|
412
|
+
onFileSelect(e) {
|
|
413
|
+
const file = e.target.files[0];
|
|
414
|
+
if (file) {
|
|
415
|
+
const reader = new FileReader();
|
|
416
|
+
reader.onload = (e) => {
|
|
417
|
+
const data = e.target.result;
|
|
418
|
+
this.fileSelect.emit(data);
|
|
419
|
+
};
|
|
420
|
+
reader.onerror = (e) => {
|
|
421
|
+
this.fileSelect.emit(e);
|
|
422
|
+
};
|
|
423
|
+
reader.readAsDataURL(file);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
onZoomLevelChooserValueChange(zoomLevel) {
|
|
427
|
+
this.zoomLevelChange.emit(zoomLevel);
|
|
428
|
+
}
|
|
429
|
+
focus() {
|
|
430
|
+
this.navigationService.focusableTools[this.navigationService.currentFocusIndex].activate();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1$1.LocalizationService }, { token: ToolbarNavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
434
|
+
ToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ToolbarComponent, selector: "[toolbar]", 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", 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.toolbarClass", "class.k-toolbar-md": "this.toolbarSizeClass" } }, providers: [ToolbarNavigationService], viewQueries: [{ propertyName: "fileSelectEl", first: true, predicate: ["fileSelectEl"], descendants: true }], ngImport: i0, template: `
|
|
435
|
+
<ng-container *ngFor="let tool of tools">
|
|
436
|
+
<ng-container [ngSwitch]="tool">
|
|
437
|
+
<kendo-toolbar-input-wrapper
|
|
438
|
+
*ngSwitchCase="'pager'"
|
|
439
|
+
kendoPDFViewerToolbarFocusable
|
|
440
|
+
[toolbarTool]="pager">
|
|
441
|
+
<kendo-datapager
|
|
442
|
+
#pager
|
|
443
|
+
[attr.aria-controls]="pagesContainerId"
|
|
444
|
+
[attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
|
|
445
|
+
[class.k-disabled]="disabledTools"
|
|
446
|
+
[navigable]="true"
|
|
447
|
+
[pageSize]="pageSize"
|
|
448
|
+
[skip]="skip"
|
|
449
|
+
[total]="total"
|
|
450
|
+
[pageSizeValues]="false"
|
|
451
|
+
[info]="false"
|
|
452
|
+
[type]="pagerType"
|
|
453
|
+
(pageChange)="pageChange.emit($event)">
|
|
454
|
+
<kendo-datapager-messages
|
|
455
|
+
[firstPage]="messageFor('pagerFirstPage')"
|
|
456
|
+
[previousPage]="messageFor('pagerPreviousPage')"
|
|
457
|
+
[nextPage]="messageFor('pagerNextPage')"
|
|
458
|
+
[lastPage]="messageFor('pagerLastPage')"
|
|
459
|
+
[inputLabel]="messageFor('pagerInputLabel')"
|
|
460
|
+
[pageNumberInputTitle]="messageFor('pagerInputTitle')"
|
|
461
|
+
[of]="messageFor('pagerOf')"
|
|
462
|
+
[page]="messageFor('pagerPage')"></kendo-datapager-messages>
|
|
463
|
+
</kendo-datapager>
|
|
464
|
+
</kendo-toolbar-input-wrapper>
|
|
465
|
+
<span
|
|
466
|
+
*ngSwitchCase="'spacer'"
|
|
467
|
+
class="k-spacer"></span>
|
|
468
|
+
<kendo-buttongroup
|
|
469
|
+
*ngSwitchCase="'zoomInOut'"
|
|
470
|
+
[attr.aria-controls]="pagesContainerId"
|
|
471
|
+
[navigable]="false">
|
|
472
|
+
<button
|
|
473
|
+
kendoButton
|
|
474
|
+
kendoPDFViewerToolbarFocusable
|
|
475
|
+
icon="zoom-out"
|
|
476
|
+
[disabled]="disabledTools || zoomOutDisabled"
|
|
477
|
+
[svgIcon]="zoomOutIcon"
|
|
478
|
+
[attr.title]="messageFor('zoomOutTitle')"
|
|
479
|
+
[attr.aria-label]="messageFor('zoomOutTitle')"
|
|
480
|
+
(click)="zoomOut.emit()"></button>
|
|
481
|
+
<button
|
|
482
|
+
kendoButton
|
|
483
|
+
kendoPDFViewerToolbarFocusable
|
|
484
|
+
icon="zoom-in"
|
|
485
|
+
[disabled]="disabledTools || zoomInDisabled"
|
|
486
|
+
[svgIcon]="zoomInIcon"
|
|
487
|
+
[attr.title]="messageFor('zoomInTitle')"
|
|
488
|
+
[attr.aria-label]="messageFor('zoomInTitle')"
|
|
489
|
+
(click)="zoomIn.emit()"></button>
|
|
490
|
+
</kendo-buttongroup>
|
|
491
|
+
<kendo-toolbar-input-wrapper
|
|
492
|
+
*ngSwitchCase="'zoom'"
|
|
493
|
+
kendoPDFViewerToolbarFocusable
|
|
494
|
+
[toolbarTool]="combobox">
|
|
495
|
+
<kendo-combobox
|
|
496
|
+
#combobox
|
|
497
|
+
kendoPDFViewerComboBox
|
|
498
|
+
[attr.aria-controls]="pagesContainerId"
|
|
499
|
+
[tabindex]="-1"
|
|
500
|
+
[data]="zoomOptionsData"
|
|
501
|
+
[disabled]="disabledTools"
|
|
502
|
+
[placeholder]="messageFor('zoomInputPlaceholder')"
|
|
503
|
+
textField="displayValue"
|
|
504
|
+
valueField="id"
|
|
505
|
+
[value]="zoomLevelChooserValue"
|
|
506
|
+
[allowCustom]="true"
|
|
507
|
+
(valueChange)="onZoomLevelChooserValueChange($event)">
|
|
508
|
+
<ng-template kendoComboBoxItemTemplate let-dataItem>
|
|
509
|
+
{{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
|
|
510
|
+
</ng-template>
|
|
511
|
+
</kendo-combobox>
|
|
512
|
+
</kendo-toolbar-input-wrapper>
|
|
513
|
+
<kendo-buttongroup
|
|
514
|
+
*ngSwitchCase="'selection'"
|
|
515
|
+
[attr.aria-controls]="pagesContainerId"
|
|
516
|
+
[navigable]="false"
|
|
517
|
+
selection="single">
|
|
518
|
+
<button
|
|
519
|
+
kendoButton
|
|
520
|
+
kendoPDFViewerToolbarFocusable
|
|
521
|
+
icon="pointer"
|
|
522
|
+
[toggleable]="true"
|
|
523
|
+
[svgIcon]="pointerIcon"
|
|
524
|
+
[attr.title]="messageFor('selectionTitle')"
|
|
525
|
+
[attr.aria-label]="messageFor('selectionTitle')"
|
|
526
|
+
(click)="selectionEnabled.emit()"></button>
|
|
527
|
+
<button
|
|
528
|
+
kendoButton
|
|
529
|
+
kendoPDFViewerToolbarFocusable
|
|
530
|
+
icon="hand"
|
|
531
|
+
[toggleable]="true"
|
|
532
|
+
[selected]="true"
|
|
533
|
+
[attr.title]="messageFor('panningTitle')"
|
|
534
|
+
[attr.aria-label]="messageFor('panningTitle')"
|
|
535
|
+
(click)="panningEnabled.emit()"></button>
|
|
536
|
+
</kendo-buttongroup>
|
|
537
|
+
<button
|
|
538
|
+
*ngSwitchCase="'search'"
|
|
539
|
+
kendoPDFViewerToolbarFocusable
|
|
540
|
+
kendoButton
|
|
541
|
+
icon="search"
|
|
542
|
+
[disabled]="disabledTools"
|
|
543
|
+
[attr.title]="messageFor('searchTitle')"
|
|
544
|
+
[attr.aria-label]="messageFor('searchTitle')"
|
|
545
|
+
aria-haspopup="dialog"
|
|
546
|
+
[svgIcon]="searchIcon"
|
|
547
|
+
(click)="search.emit()"></button>
|
|
548
|
+
<button
|
|
549
|
+
*ngSwitchCase="'open'"
|
|
550
|
+
kendoPDFViewerToolbarFocusable
|
|
551
|
+
kendoButton
|
|
552
|
+
icon="folder-open"
|
|
553
|
+
[svgIcon]="folderOpenIcon"
|
|
554
|
+
[attr.title]="messageFor('openTitle')"
|
|
555
|
+
[attr.aria-label]="messageFor('openTitle')"
|
|
556
|
+
[attr.aria-controls]="pagesContainerId"
|
|
557
|
+
(click)="fileSelectEl?.nativeElement.click()">
|
|
558
|
+
</button>
|
|
559
|
+
<button
|
|
560
|
+
*ngSwitchCase="'download'"
|
|
561
|
+
kendoPDFViewerToolbarFocusable
|
|
562
|
+
kendoButton
|
|
563
|
+
icon="download"
|
|
564
|
+
[svgIcon]="downloadIcon"
|
|
565
|
+
[disabled]="disabledTools"
|
|
566
|
+
[attr.title]="messageFor('downloadTitle')"
|
|
567
|
+
[attr.aria-label]="messageFor('downloadTitle')"
|
|
568
|
+
(click)="download.emit()"></button>
|
|
569
|
+
<button
|
|
570
|
+
*ngSwitchCase="'print'"
|
|
571
|
+
kendoPDFViewerToolbarFocusable
|
|
572
|
+
kendoButton
|
|
573
|
+
icon="print"
|
|
574
|
+
[svgIcon]="printIcon"
|
|
575
|
+
[disabled]="disabledTools"
|
|
576
|
+
[attr.title]="messageFor('printTitle')"
|
|
577
|
+
[attr.aria-label]="messageFor('printTitle')"
|
|
578
|
+
(click)="print.emit()"></button>
|
|
579
|
+
</ng-container>
|
|
580
|
+
</ng-container>
|
|
581
|
+
<input
|
|
582
|
+
#fileSelectEl
|
|
583
|
+
*ngIf="tools?.indexOf('open') > -1;"
|
|
584
|
+
type="file"
|
|
585
|
+
[style.display]="'none'"
|
|
586
|
+
aria-hidden="true"
|
|
587
|
+
accept=".pdf, .PDF"
|
|
588
|
+
(change)="onFileSelect($event)" />
|
|
589
|
+
`, isInline: true, components: [{ type: ToolbarInputWrapperComponent, selector: "kendo-toolbar-input-wrapper", inputs: ["toolbarTool"] }, { type: i4.PagerComponent, selector: "kendo-datapager", inputs: ["total", "skip", "pageSize", "buttonCount", "info", "type", "pageSizeValues", "previousNext", "navigable", "size"], outputs: ["pageChange", "pageSizeChange"], exportAs: ["kendoDataPager"] }, { type: i4.CustomMessagesComponent, selector: "kendo-datapager-messages" }, { type: i5.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex", "navigable"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }, { type: i5.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i1$2.ComboBoxComponent, selector: "kendo-combobox", inputs: ["focusableId", "allowCustom", "data", "value", "textField", "valueField", "valuePrimitive", "valueNormalizer", "placeholder", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "iconClass", "loading", "suggest", "clearButton", "disabled", "itemDisabled", "readonly", "tabindex", "tabIndex", "filterable", "virtual", "size", "rounded", "fillMode"], outputs: ["valueChange", "selectionChange", "filterChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoComboBox"] }], directives: [{ type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i7.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: ToolbarFocusableDirective, selector: "[kendoPDFViewerToolbarFocusable]" }, { type: ToolbarComboBoxDirective, selector: "[kendoPDFViewerComboBox]" }, { type: i1$2.ItemTemplateDirective, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
590
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
591
|
+
type: Component,
|
|
592
|
+
args: [{
|
|
593
|
+
selector: '[toolbar]',
|
|
594
|
+
providers: [ToolbarNavigationService],
|
|
595
|
+
template: `
|
|
596
|
+
<ng-container *ngFor="let tool of tools">
|
|
597
|
+
<ng-container [ngSwitch]="tool">
|
|
598
|
+
<kendo-toolbar-input-wrapper
|
|
599
|
+
*ngSwitchCase="'pager'"
|
|
600
|
+
kendoPDFViewerToolbarFocusable
|
|
601
|
+
[toolbarTool]="pager">
|
|
602
|
+
<kendo-datapager
|
|
603
|
+
#pager
|
|
604
|
+
[attr.aria-controls]="pagesContainerId"
|
|
605
|
+
[attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
|
|
606
|
+
[class.k-disabled]="disabledTools"
|
|
607
|
+
[navigable]="true"
|
|
608
|
+
[pageSize]="pageSize"
|
|
609
|
+
[skip]="skip"
|
|
610
|
+
[total]="total"
|
|
611
|
+
[pageSizeValues]="false"
|
|
612
|
+
[info]="false"
|
|
613
|
+
[type]="pagerType"
|
|
614
|
+
(pageChange)="pageChange.emit($event)">
|
|
615
|
+
<kendo-datapager-messages
|
|
616
|
+
[firstPage]="messageFor('pagerFirstPage')"
|
|
617
|
+
[previousPage]="messageFor('pagerPreviousPage')"
|
|
618
|
+
[nextPage]="messageFor('pagerNextPage')"
|
|
619
|
+
[lastPage]="messageFor('pagerLastPage')"
|
|
620
|
+
[inputLabel]="messageFor('pagerInputLabel')"
|
|
621
|
+
[pageNumberInputTitle]="messageFor('pagerInputTitle')"
|
|
622
|
+
[of]="messageFor('pagerOf')"
|
|
623
|
+
[page]="messageFor('pagerPage')"></kendo-datapager-messages>
|
|
624
|
+
</kendo-datapager>
|
|
625
|
+
</kendo-toolbar-input-wrapper>
|
|
626
|
+
<span
|
|
627
|
+
*ngSwitchCase="'spacer'"
|
|
628
|
+
class="k-spacer"></span>
|
|
629
|
+
<kendo-buttongroup
|
|
630
|
+
*ngSwitchCase="'zoomInOut'"
|
|
631
|
+
[attr.aria-controls]="pagesContainerId"
|
|
632
|
+
[navigable]="false">
|
|
633
|
+
<button
|
|
634
|
+
kendoButton
|
|
635
|
+
kendoPDFViewerToolbarFocusable
|
|
636
|
+
icon="zoom-out"
|
|
637
|
+
[disabled]="disabledTools || zoomOutDisabled"
|
|
638
|
+
[svgIcon]="zoomOutIcon"
|
|
639
|
+
[attr.title]="messageFor('zoomOutTitle')"
|
|
640
|
+
[attr.aria-label]="messageFor('zoomOutTitle')"
|
|
641
|
+
(click)="zoomOut.emit()"></button>
|
|
642
|
+
<button
|
|
643
|
+
kendoButton
|
|
644
|
+
kendoPDFViewerToolbarFocusable
|
|
645
|
+
icon="zoom-in"
|
|
646
|
+
[disabled]="disabledTools || zoomInDisabled"
|
|
647
|
+
[svgIcon]="zoomInIcon"
|
|
648
|
+
[attr.title]="messageFor('zoomInTitle')"
|
|
649
|
+
[attr.aria-label]="messageFor('zoomInTitle')"
|
|
650
|
+
(click)="zoomIn.emit()"></button>
|
|
651
|
+
</kendo-buttongroup>
|
|
652
|
+
<kendo-toolbar-input-wrapper
|
|
653
|
+
*ngSwitchCase="'zoom'"
|
|
654
|
+
kendoPDFViewerToolbarFocusable
|
|
655
|
+
[toolbarTool]="combobox">
|
|
656
|
+
<kendo-combobox
|
|
657
|
+
#combobox
|
|
658
|
+
kendoPDFViewerComboBox
|
|
659
|
+
[attr.aria-controls]="pagesContainerId"
|
|
660
|
+
[tabindex]="-1"
|
|
661
|
+
[data]="zoomOptionsData"
|
|
662
|
+
[disabled]="disabledTools"
|
|
663
|
+
[placeholder]="messageFor('zoomInputPlaceholder')"
|
|
664
|
+
textField="displayValue"
|
|
665
|
+
valueField="id"
|
|
666
|
+
[value]="zoomLevelChooserValue"
|
|
667
|
+
[allowCustom]="true"
|
|
668
|
+
(valueChange)="onZoomLevelChooserValueChange($event)">
|
|
669
|
+
<ng-template kendoComboBoxItemTemplate let-dataItem>
|
|
670
|
+
{{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
|
|
671
|
+
</ng-template>
|
|
672
|
+
</kendo-combobox>
|
|
673
|
+
</kendo-toolbar-input-wrapper>
|
|
674
|
+
<kendo-buttongroup
|
|
675
|
+
*ngSwitchCase="'selection'"
|
|
676
|
+
[attr.aria-controls]="pagesContainerId"
|
|
677
|
+
[navigable]="false"
|
|
678
|
+
selection="single">
|
|
679
|
+
<button
|
|
680
|
+
kendoButton
|
|
681
|
+
kendoPDFViewerToolbarFocusable
|
|
682
|
+
icon="pointer"
|
|
683
|
+
[toggleable]="true"
|
|
684
|
+
[svgIcon]="pointerIcon"
|
|
685
|
+
[attr.title]="messageFor('selectionTitle')"
|
|
686
|
+
[attr.aria-label]="messageFor('selectionTitle')"
|
|
687
|
+
(click)="selectionEnabled.emit()"></button>
|
|
688
|
+
<button
|
|
689
|
+
kendoButton
|
|
690
|
+
kendoPDFViewerToolbarFocusable
|
|
691
|
+
icon="hand"
|
|
692
|
+
[toggleable]="true"
|
|
693
|
+
[selected]="true"
|
|
694
|
+
[attr.title]="messageFor('panningTitle')"
|
|
695
|
+
[attr.aria-label]="messageFor('panningTitle')"
|
|
696
|
+
(click)="panningEnabled.emit()"></button>
|
|
697
|
+
</kendo-buttongroup>
|
|
698
|
+
<button
|
|
699
|
+
*ngSwitchCase="'search'"
|
|
700
|
+
kendoPDFViewerToolbarFocusable
|
|
701
|
+
kendoButton
|
|
702
|
+
icon="search"
|
|
703
|
+
[disabled]="disabledTools"
|
|
704
|
+
[attr.title]="messageFor('searchTitle')"
|
|
705
|
+
[attr.aria-label]="messageFor('searchTitle')"
|
|
706
|
+
aria-haspopup="dialog"
|
|
707
|
+
[svgIcon]="searchIcon"
|
|
708
|
+
(click)="search.emit()"></button>
|
|
709
|
+
<button
|
|
710
|
+
*ngSwitchCase="'open'"
|
|
711
|
+
kendoPDFViewerToolbarFocusable
|
|
712
|
+
kendoButton
|
|
713
|
+
icon="folder-open"
|
|
714
|
+
[svgIcon]="folderOpenIcon"
|
|
715
|
+
[attr.title]="messageFor('openTitle')"
|
|
716
|
+
[attr.aria-label]="messageFor('openTitle')"
|
|
717
|
+
[attr.aria-controls]="pagesContainerId"
|
|
718
|
+
(click)="fileSelectEl?.nativeElement.click()">
|
|
719
|
+
</button>
|
|
720
|
+
<button
|
|
721
|
+
*ngSwitchCase="'download'"
|
|
722
|
+
kendoPDFViewerToolbarFocusable
|
|
723
|
+
kendoButton
|
|
724
|
+
icon="download"
|
|
725
|
+
[svgIcon]="downloadIcon"
|
|
726
|
+
[disabled]="disabledTools"
|
|
727
|
+
[attr.title]="messageFor('downloadTitle')"
|
|
728
|
+
[attr.aria-label]="messageFor('downloadTitle')"
|
|
729
|
+
(click)="download.emit()"></button>
|
|
730
|
+
<button
|
|
731
|
+
*ngSwitchCase="'print'"
|
|
732
|
+
kendoPDFViewerToolbarFocusable
|
|
733
|
+
kendoButton
|
|
734
|
+
icon="print"
|
|
735
|
+
[svgIcon]="printIcon"
|
|
736
|
+
[disabled]="disabledTools"
|
|
737
|
+
[attr.title]="messageFor('printTitle')"
|
|
738
|
+
[attr.aria-label]="messageFor('printTitle')"
|
|
739
|
+
(click)="print.emit()"></button>
|
|
740
|
+
</ng-container>
|
|
741
|
+
</ng-container>
|
|
742
|
+
<input
|
|
743
|
+
#fileSelectEl
|
|
744
|
+
*ngIf="tools?.indexOf('open') > -1;"
|
|
745
|
+
type="file"
|
|
746
|
+
[style.display]="'none'"
|
|
747
|
+
aria-hidden="true"
|
|
748
|
+
accept=".pdf, .PDF"
|
|
749
|
+
(change)="onFileSelect($event)" />
|
|
750
|
+
`
|
|
751
|
+
}]
|
|
752
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }, { type: ToolbarNavigationService }]; }, propDecorators: { toolbarClass: [{
|
|
753
|
+
type: HostBinding,
|
|
754
|
+
args: ['class.k-toolbar']
|
|
755
|
+
}], toolbarSizeClass: [{
|
|
756
|
+
type: HostBinding,
|
|
757
|
+
args: ['class.k-toolbar-md']
|
|
758
|
+
}], fileSelectEl: [{
|
|
759
|
+
type: ViewChild,
|
|
760
|
+
args: ['fileSelectEl']
|
|
761
|
+
}], zoomLevel: [{
|
|
762
|
+
type: Input
|
|
763
|
+
}], calculatedComboBoxValue: [{
|
|
764
|
+
type: Input
|
|
765
|
+
}], skip: [{
|
|
766
|
+
type: Input
|
|
767
|
+
}], pageSize: [{
|
|
768
|
+
type: Input
|
|
769
|
+
}], total: [{
|
|
770
|
+
type: Input
|
|
771
|
+
}], zoomInDisabled: [{
|
|
772
|
+
type: Input
|
|
773
|
+
}], zoomOutDisabled: [{
|
|
774
|
+
type: Input
|
|
775
|
+
}], disabledTools: [{
|
|
776
|
+
type: Input
|
|
777
|
+
}], zoomLevelChooserValue: [{
|
|
778
|
+
type: Input
|
|
779
|
+
}], zoomOptionsData: [{
|
|
780
|
+
type: Input
|
|
781
|
+
}], pagesContainerId: [{
|
|
782
|
+
type: Input
|
|
783
|
+
}], tools: [{
|
|
784
|
+
type: Input
|
|
785
|
+
}], fileSelect: [{
|
|
786
|
+
type: Output
|
|
787
|
+
}], fileSelectError: [{
|
|
788
|
+
type: Output
|
|
789
|
+
}], download: [{
|
|
790
|
+
type: Output
|
|
791
|
+
}], selectionEnabled: [{
|
|
792
|
+
type: Output
|
|
793
|
+
}], panningEnabled: [{
|
|
794
|
+
type: Output
|
|
795
|
+
}], pageChange: [{
|
|
796
|
+
type: Output
|
|
797
|
+
}], zoomIn: [{
|
|
798
|
+
type: Output
|
|
799
|
+
}], zoomOut: [{
|
|
800
|
+
type: Output
|
|
801
|
+
}], zoomLevelChange: [{
|
|
802
|
+
type: Output
|
|
803
|
+
}], print: [{
|
|
804
|
+
type: Output
|
|
805
|
+
}], search: [{
|
|
806
|
+
type: Output
|
|
807
|
+
}] } });
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* @hidden
|
|
811
|
+
*/
|
|
812
|
+
class PDFViewerSearchComponent {
|
|
813
|
+
constructor(localization) {
|
|
814
|
+
this.localization = localization;
|
|
815
|
+
this.ariaRole = 'dialog';
|
|
816
|
+
this.searchChange = new EventEmitter();
|
|
817
|
+
this.prevMatch = new EventEmitter();
|
|
818
|
+
this.nextMatch = new EventEmitter();
|
|
819
|
+
this.close = new EventEmitter();
|
|
820
|
+
this.convertLowercaseIcon = convertLowercaseIcon;
|
|
821
|
+
this.arrowUpIcon = arrowUpIcon;
|
|
822
|
+
this.arrowDownIcon = arrowDownIcon;
|
|
823
|
+
this.xIcon = xIcon;
|
|
824
|
+
this.value = null;
|
|
825
|
+
this.matchCase = false;
|
|
826
|
+
}
|
|
827
|
+
onEscape() {
|
|
828
|
+
this.close.emit();
|
|
829
|
+
}
|
|
830
|
+
ngAfterViewInit() {
|
|
831
|
+
this.textbox.focus();
|
|
832
|
+
}
|
|
833
|
+
messageFor(key) {
|
|
834
|
+
return this.localization.get(key);
|
|
835
|
+
}
|
|
836
|
+
onShiftTab(e) {
|
|
837
|
+
if (e.target.matches('.k-input-inner')) {
|
|
838
|
+
e.preventDefault();
|
|
839
|
+
this.closeButton.nativeElement.focus();
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
PDFViewerSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerSearchComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
844
|
+
PDFViewerSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: { matches: "matches", currentMatch: "currentMatch" }, outputs: { searchChange: "searchChange", prevMatch: "prevMatch", nextMatch: "nextMatch", close: "close" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "attr.role": "this.ariaRole" } }, viewQueries: [{ propertyName: "textbox", first: true, predicate: ["textbox"], descendants: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
845
|
+
<kendo-textbox
|
|
846
|
+
#textbox
|
|
847
|
+
[placeholder]="messageFor('searchInputPlaceholder')"
|
|
848
|
+
[value]="value"
|
|
849
|
+
(valueChange)="value = $event; searchChange.emit({text: $event, matchCase})"
|
|
850
|
+
(keydown.shift.tab)="onShiftTab($event)">
|
|
851
|
+
<ng-template kendoTextBoxSuffixTemplate>
|
|
852
|
+
<button
|
|
853
|
+
kendoButton
|
|
854
|
+
[attr.title]="messageFor('searchMatchCaseTitle')"
|
|
855
|
+
fillMode="flat"
|
|
856
|
+
[togglable]="true"
|
|
857
|
+
(click)="matchCase = !matchCase; searchChange.emit({text: value, matchCase})"
|
|
858
|
+
icon="convert-lowercase"
|
|
859
|
+
[svgIcon]="convertLowercaseIcon"></button>
|
|
860
|
+
</ng-template>
|
|
861
|
+
</kendo-textbox>
|
|
862
|
+
<span class="k-search-matches">
|
|
863
|
+
<span>{{currentMatch}}</span> {{messageFor('searchMatchesOf')}} <span>{{matches}}</span>
|
|
864
|
+
</span>
|
|
865
|
+
<button
|
|
866
|
+
kendoButton
|
|
867
|
+
[attr.title]="messageFor('searchPreviousMatchTitle')"
|
|
868
|
+
fillMode="flat"
|
|
869
|
+
[disabled]="matches === 0"
|
|
870
|
+
(click)="prevMatch.emit()"
|
|
871
|
+
icon='arrow-up'
|
|
872
|
+
[svgIcon]="arrowUpIcon"></button>
|
|
873
|
+
<button
|
|
874
|
+
kendoButton
|
|
875
|
+
[attr.title]="messageFor('searchNextMatchTitle')"
|
|
876
|
+
fillMode="flat"
|
|
877
|
+
[disabled]="matches === 0"
|
|
878
|
+
(click)="nextMatch.emit()"
|
|
879
|
+
icon='arrow-down'
|
|
880
|
+
[svgIcon]="arrowDownIcon"></button>
|
|
881
|
+
<button
|
|
882
|
+
#closeButton
|
|
883
|
+
kendoButton
|
|
884
|
+
[attr.title]="messageFor('searchCloseTitle')"
|
|
885
|
+
fillMode="flat"
|
|
886
|
+
(click)="close.emit()"
|
|
887
|
+
(keydown.tab)="$event.preventDefault(); textbox.focus();"
|
|
888
|
+
icon='x'
|
|
889
|
+
[svgIcon]="xIcon"></button>
|
|
890
|
+
`, isInline: true, components: [{ type: i2.TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "errorIcon", "clearButtonIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { type: i5.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i2.TextBoxSuffixTemplateDirective, selector: "[kendoTextBoxSuffixTemplate]" }] });
|
|
891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerSearchComponent, decorators: [{
|
|
892
|
+
type: Component,
|
|
893
|
+
args: [{
|
|
894
|
+
selector: '[kendoPDFViewerSearch]',
|
|
895
|
+
template: `
|
|
896
|
+
<kendo-textbox
|
|
897
|
+
#textbox
|
|
898
|
+
[placeholder]="messageFor('searchInputPlaceholder')"
|
|
899
|
+
[value]="value"
|
|
900
|
+
(valueChange)="value = $event; searchChange.emit({text: $event, matchCase})"
|
|
901
|
+
(keydown.shift.tab)="onShiftTab($event)">
|
|
902
|
+
<ng-template kendoTextBoxSuffixTemplate>
|
|
903
|
+
<button
|
|
904
|
+
kendoButton
|
|
905
|
+
[attr.title]="messageFor('searchMatchCaseTitle')"
|
|
906
|
+
fillMode="flat"
|
|
907
|
+
[togglable]="true"
|
|
908
|
+
(click)="matchCase = !matchCase; searchChange.emit({text: value, matchCase})"
|
|
909
|
+
icon="convert-lowercase"
|
|
910
|
+
[svgIcon]="convertLowercaseIcon"></button>
|
|
911
|
+
</ng-template>
|
|
912
|
+
</kendo-textbox>
|
|
913
|
+
<span class="k-search-matches">
|
|
914
|
+
<span>{{currentMatch}}</span> {{messageFor('searchMatchesOf')}} <span>{{matches}}</span>
|
|
915
|
+
</span>
|
|
916
|
+
<button
|
|
917
|
+
kendoButton
|
|
918
|
+
[attr.title]="messageFor('searchPreviousMatchTitle')"
|
|
919
|
+
fillMode="flat"
|
|
920
|
+
[disabled]="matches === 0"
|
|
921
|
+
(click)="prevMatch.emit()"
|
|
922
|
+
icon='arrow-up'
|
|
923
|
+
[svgIcon]="arrowUpIcon"></button>
|
|
924
|
+
<button
|
|
925
|
+
kendoButton
|
|
926
|
+
[attr.title]="messageFor('searchNextMatchTitle')"
|
|
927
|
+
fillMode="flat"
|
|
928
|
+
[disabled]="matches === 0"
|
|
929
|
+
(click)="nextMatch.emit()"
|
|
930
|
+
icon='arrow-down'
|
|
931
|
+
[svgIcon]="arrowDownIcon"></button>
|
|
932
|
+
<button
|
|
933
|
+
#closeButton
|
|
934
|
+
kendoButton
|
|
935
|
+
[attr.title]="messageFor('searchCloseTitle')"
|
|
936
|
+
fillMode="flat"
|
|
937
|
+
(click)="close.emit()"
|
|
938
|
+
(keydown.tab)="$event.preventDefault(); textbox.focus();"
|
|
939
|
+
icon='x'
|
|
940
|
+
[svgIcon]="xIcon"></button>
|
|
941
|
+
`
|
|
942
|
+
}]
|
|
943
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; }, propDecorators: { textbox: [{
|
|
944
|
+
type: ViewChild,
|
|
945
|
+
args: ['textbox']
|
|
946
|
+
}], closeButton: [{
|
|
947
|
+
type: ViewChild,
|
|
948
|
+
args: ['closeButton', { read: ElementRef }]
|
|
949
|
+
}], ariaRole: [{
|
|
950
|
+
type: HostBinding,
|
|
951
|
+
args: ['attr.role']
|
|
952
|
+
}], onEscape: [{
|
|
953
|
+
type: HostListener,
|
|
954
|
+
args: ['keydown.escape']
|
|
955
|
+
}], matches: [{
|
|
956
|
+
type: Input
|
|
957
|
+
}], currentMatch: [{
|
|
958
|
+
type: Input
|
|
959
|
+
}], searchChange: [{
|
|
960
|
+
type: Output
|
|
961
|
+
}], prevMatch: [{
|
|
962
|
+
type: Output
|
|
963
|
+
}], nextMatch: [{
|
|
964
|
+
type: Output
|
|
965
|
+
}], close: [{
|
|
966
|
+
type: Output
|
|
967
|
+
}] } });
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* @hidden
|
|
971
|
+
*/
|
|
972
|
+
class Messages extends ComponentMessages {
|
|
973
|
+
}
|
|
974
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
975
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.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 });
|
|
976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
|
977
|
+
type: Directive,
|
|
978
|
+
args: [{
|
|
979
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
980
|
+
selector: 'kendo-pdfviewer-messages-base'
|
|
981
|
+
}]
|
|
982
|
+
}], propDecorators: { zoomInTitle: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}], zoomOutTitle: [{
|
|
985
|
+
type: Input
|
|
986
|
+
}], selectionTitle: [{
|
|
987
|
+
type: Input
|
|
988
|
+
}], panningTitle: [{
|
|
989
|
+
type: Input
|
|
990
|
+
}], searchTitle: [{
|
|
991
|
+
type: Input
|
|
992
|
+
}], openTitle: [{
|
|
993
|
+
type: Input
|
|
994
|
+
}], downloadTitle: [{
|
|
995
|
+
type: Input
|
|
996
|
+
}], printTitle: [{
|
|
997
|
+
type: Input
|
|
998
|
+
}], pagerInputLabel: [{
|
|
999
|
+
type: Input
|
|
1000
|
+
}], pagerInputTitle: [{
|
|
1001
|
+
type: Input
|
|
1002
|
+
}], pagerFirstPage: [{
|
|
1003
|
+
type: Input
|
|
1004
|
+
}], pagerPreviousPage: [{
|
|
1005
|
+
type: Input
|
|
1006
|
+
}], pagerNextPage: [{
|
|
1007
|
+
type: Input
|
|
1008
|
+
}], pagerLastPage: [{
|
|
1009
|
+
type: Input
|
|
1010
|
+
}], pagerOf: [{
|
|
1011
|
+
type: Input
|
|
1012
|
+
}], pagerPage: [{
|
|
1013
|
+
type: Input
|
|
1014
|
+
}], fitToPage: [{
|
|
1015
|
+
type: Input
|
|
1016
|
+
}], fitToWidth: [{
|
|
1017
|
+
type: Input
|
|
1018
|
+
}], searchInputPlaceholder: [{
|
|
1019
|
+
type: Input
|
|
1020
|
+
}], searchMatchesOf: [{
|
|
1021
|
+
type: Input
|
|
1022
|
+
}], searchPreviousMatchTitle: [{
|
|
1023
|
+
type: Input
|
|
1024
|
+
}], searchNextMatchTitle: [{
|
|
1025
|
+
type: Input
|
|
1026
|
+
}], searchCloseTitle: [{
|
|
1027
|
+
type: Input
|
|
1028
|
+
}], searchMatchCaseTitle: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}], zoomInputPlaceholder: [{
|
|
1031
|
+
type: Input
|
|
1032
|
+
}] } });
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* @hidden
|
|
1036
|
+
*/
|
|
1037
|
+
class LocalizedPDFViewerMessagesDirective extends Messages {
|
|
1038
|
+
constructor(service) {
|
|
1039
|
+
super();
|
|
1040
|
+
this.service = service;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
LocalizedPDFViewerMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedPDFViewerMessagesDirective, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1044
|
+
LocalizedPDFViewerMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]", providers: [
|
|
1045
|
+
{
|
|
1046
|
+
provide: Messages,
|
|
1047
|
+
useExisting: forwardRef(() => LocalizedPDFViewerMessagesDirective)
|
|
1048
|
+
}
|
|
1049
|
+
], usesInheritance: true, ngImport: i0 });
|
|
1050
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedPDFViewerMessagesDirective, decorators: [{
|
|
1051
|
+
type: Directive,
|
|
1052
|
+
args: [{
|
|
1053
|
+
providers: [
|
|
1054
|
+
{
|
|
1055
|
+
provide: Messages,
|
|
1056
|
+
useExisting: forwardRef(() => LocalizedPDFViewerMessagesDirective)
|
|
1057
|
+
}
|
|
1058
|
+
],
|
|
1059
|
+
selector: '[kendoPDFViewerLocalizedMessages]'
|
|
1060
|
+
}]
|
|
1061
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
1062
|
+
|
|
1063
|
+
let counter = 0;
|
|
1064
|
+
/**
|
|
1065
|
+
* Represents the [Kendo UI PDFViewer component for Angular]({% slug overview_pdfviewer %}).
|
|
1066
|
+
*/
|
|
1067
|
+
class PDFViewerComponent {
|
|
1068
|
+
constructor(ngZone, renderer, localizationService) {
|
|
1069
|
+
this.ngZone = ngZone;
|
|
1070
|
+
this.renderer = renderer;
|
|
1071
|
+
this.localizationService = localizationService;
|
|
1072
|
+
this.hostClass = true;
|
|
1073
|
+
/**
|
|
1074
|
+
* Represents the tools collection rendered in the toolbar.
|
|
1075
|
+
* @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print' ]
|
|
1076
|
+
*/
|
|
1077
|
+
this.tools = [
|
|
1078
|
+
'pager',
|
|
1079
|
+
'spacer',
|
|
1080
|
+
'zoomInOut',
|
|
1081
|
+
'zoom',
|
|
1082
|
+
'selection',
|
|
1083
|
+
'spacer',
|
|
1084
|
+
'search',
|
|
1085
|
+
'open',
|
|
1086
|
+
'download',
|
|
1087
|
+
'print'
|
|
1088
|
+
];
|
|
1089
|
+
/**
|
|
1090
|
+
* The configuration of the internal Loader component.
|
|
1091
|
+
* @default { size: 'large', type: 'pulsing', themeColor: 'primary' }
|
|
1092
|
+
*/
|
|
1093
|
+
this.loaderSettings = {
|
|
1094
|
+
size: 'large',
|
|
1095
|
+
type: 'pulsing',
|
|
1096
|
+
themeColor: 'primary'
|
|
1097
|
+
};
|
|
1098
|
+
/**
|
|
1099
|
+
* The name of the file that will be saved when the end user clicks the Download tool.
|
|
1100
|
+
* @default 'Download'
|
|
1101
|
+
*/
|
|
1102
|
+
this.saveFileName = 'Download';
|
|
1103
|
+
/**
|
|
1104
|
+
* Represents the options for saving the file when the end user clicks the Download tool.
|
|
1105
|
+
* @default {}
|
|
1106
|
+
*/
|
|
1107
|
+
this.saveOptions = {};
|
|
1108
|
+
/**
|
|
1109
|
+
* The initial zoom level of the PDF document.
|
|
1110
|
+
*
|
|
1111
|
+
* @default 1.25
|
|
1112
|
+
*/
|
|
1113
|
+
this.zoom = INITIAL_ZOOM_LEVEL;
|
|
1114
|
+
/**
|
|
1115
|
+
* Represents the step the zoom level will be changed with when using the ZoomIn and ZoomOut tools.
|
|
1116
|
+
* @default 0.25
|
|
1117
|
+
*/
|
|
1118
|
+
this.zoomRate = 0.25;
|
|
1119
|
+
/**
|
|
1120
|
+
* Represents minimum allowed zoom value.
|
|
1121
|
+
* @default 0.5
|
|
1122
|
+
*/
|
|
1123
|
+
this.minZoom = 0.5;
|
|
1124
|
+
/**
|
|
1125
|
+
* Represents maximum allowed zoom value.
|
|
1126
|
+
* @default 4
|
|
1127
|
+
*/
|
|
1128
|
+
this.maxZoom = 4;
|
|
1129
|
+
/**
|
|
1130
|
+
* The event fired when a PDF document is successfully loaded in the `PDFViewer` component.
|
|
1131
|
+
*/
|
|
1132
|
+
this.load = new EventEmitter();
|
|
1133
|
+
/**
|
|
1134
|
+
* The event fired when an error occurs during the loading or downloading of the PDF document.
|
|
1135
|
+
*/
|
|
1136
|
+
this.error = new EventEmitter();
|
|
1137
|
+
/**
|
|
1138
|
+
* The event fired when an error occurs during the loading of the PDF document.
|
|
1139
|
+
*/
|
|
1140
|
+
this.download = new EventEmitter();
|
|
1141
|
+
/**
|
|
1142
|
+
* The event fired when the end user changes the page of the loaded PDF document.
|
|
1143
|
+
*/
|
|
1144
|
+
this.pageChange = new EventEmitter();
|
|
1145
|
+
/**
|
|
1146
|
+
* The event fired when the end user changes the zoom level of the loaded PDF document.
|
|
1147
|
+
*/
|
|
1148
|
+
this.zoomLevelChange = new EventEmitter();
|
|
1149
|
+
this.loading = false;
|
|
1150
|
+
this.searchActive = false;
|
|
1151
|
+
this.matchCase = false;
|
|
1152
|
+
this.currentMatches = [];
|
|
1153
|
+
this.skip = 0;
|
|
1154
|
+
this.zoomOptionsData = zoomOptionsData;
|
|
1155
|
+
this.zoomLevel = this.zoomOptionsData[5];
|
|
1156
|
+
this._pdfContext = null;
|
|
1157
|
+
this._enabedSelection = false;
|
|
1158
|
+
this.subs = new Subscription();
|
|
1159
|
+
this.scrollListener = (e) => {
|
|
1160
|
+
const nextPage = currentPage(e.target.parentNode);
|
|
1161
|
+
if (nextPage !== this.skip) {
|
|
1162
|
+
this.ngZone.run(() => {
|
|
1163
|
+
hasObservers(this.pageChange) && this.pageChange.emit({
|
|
1164
|
+
previousPage: this.currentPage,
|
|
1165
|
+
currentPage: nextPage + 1
|
|
1166
|
+
});
|
|
1167
|
+
this.skip = nextPage;
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
validatePackage(packageMetadata);
|
|
1172
|
+
this.direction = localizationService.rtl ? 'rtl' : 'ltr';
|
|
1173
|
+
counter++;
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Returns the current page number of the loaded PDF document.
|
|
1177
|
+
*/
|
|
1178
|
+
get currentPage() {
|
|
1179
|
+
const isDocumentLoaded = this.pagesContainer && this.pdfContext?.pdfDoc;
|
|
1180
|
+
return isDocumentLoaded ? this.skip + 1 : null;
|
|
1181
|
+
}
|
|
1182
|
+
set pdfContext(doc) {
|
|
1183
|
+
this._pdfContext = doc;
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Exposes the currently loaded `PDF.js` document, its pages, and their DOM element wrapper.
|
|
1187
|
+
*/
|
|
1188
|
+
get pdfContext() {
|
|
1189
|
+
return this._pdfContext;
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* @hidden
|
|
1193
|
+
*/
|
|
1194
|
+
get activePageId() {
|
|
1195
|
+
if (!this.pdfContext?.pdfPages.length) {
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
return this.pagesContainer.nativeElement.querySelectorAll('.k-page')[this.skip]?.getAttribute('id');
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* @hidden
|
|
1202
|
+
*/
|
|
1203
|
+
get pagesContainerId() {
|
|
1204
|
+
if (!this.pdfContext?.pdfPages.length) {
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
return `k-pdfviewer-${counter}-pages-container`;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* @hidden
|
|
1211
|
+
*/
|
|
1212
|
+
set enabledSelection(value) {
|
|
1213
|
+
if (this.pdfScroller) {
|
|
1214
|
+
value ? this.pdfScroller.disablePanEventsTracking() : this.pdfScroller.enablePanEventsTracking();
|
|
1215
|
+
}
|
|
1216
|
+
this._enabedSelection = value;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* @hidden
|
|
1220
|
+
*/
|
|
1221
|
+
get enabledSelection() {
|
|
1222
|
+
return this._enabedSelection;
|
|
1223
|
+
}
|
|
1224
|
+
ngOnInit() {
|
|
1225
|
+
this.subs.add(this.localizationService.changes.subscribe(({ rtl }) => this.direction = rtl ? 'rtl' : 'ltr'));
|
|
1226
|
+
}
|
|
1227
|
+
ngAfterViewInit() {
|
|
1228
|
+
const pagesContainer = this.pagesContainer.nativeElement.parentNode;
|
|
1229
|
+
this.ngZone.runOutsideAngular(() => this.subs.add(this.renderer.listen(pagesContainer, 'scroll', this.scrollListener)));
|
|
1230
|
+
}
|
|
1231
|
+
ngOnDestroy() {
|
|
1232
|
+
this.subs.unsubscribe();
|
|
1233
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
1234
|
+
if (this.pdfScroller) {
|
|
1235
|
+
this.pdfScroller.destroy();
|
|
1236
|
+
this.pdfScroller = null;
|
|
1237
|
+
}
|
|
1238
|
+
if (this.searchService) {
|
|
1239
|
+
this.searchService.destroy();
|
|
1240
|
+
this.searchService = null;
|
|
1241
|
+
}
|
|
1242
|
+
this.pdfContext = null;
|
|
1243
|
+
}
|
|
1244
|
+
ngOnChanges(changes) {
|
|
1245
|
+
const newBase64Data = changes['data'] && this.data;
|
|
1246
|
+
const newUrl = changes['url'] && this.url;
|
|
1247
|
+
const newArrayBuffer = changes['arrayBuffer'] && this.arrayBuffer;
|
|
1248
|
+
const newTypedArray = changes['typedArray'] && this.typedArray;
|
|
1249
|
+
this.verifySettings(changes);
|
|
1250
|
+
const source = newUrl ? 'url' : newArrayBuffer ? 'arrayBuffer' : newBase64Data ? 'data' : 'typedArray';
|
|
1251
|
+
if (newUrl || newArrayBuffer || newBase64Data || newTypedArray) {
|
|
1252
|
+
this.loadPdf(source, this[source]);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Scrolls the PDFViewer document to the passed page number.
|
|
1257
|
+
*/
|
|
1258
|
+
scrollToPage(page) {
|
|
1259
|
+
scrollToPage(this.pagesContainer.nativeElement, page);
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* @hidden
|
|
1263
|
+
*/
|
|
1264
|
+
onFileSelect(e) {
|
|
1265
|
+
this.loadPdf('data', e);
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* @hidden
|
|
1269
|
+
*/
|
|
1270
|
+
onFileSelectError(e) {
|
|
1271
|
+
hasObservers(this.error) && this.error.emit({ error: e, context: this.pdfContext });
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* @hidden
|
|
1275
|
+
*/
|
|
1276
|
+
onPageChange(e) {
|
|
1277
|
+
this.scrollToPage(e.skip);
|
|
1278
|
+
hasObservers(this.pageChange) && this.pageChange.emit({
|
|
1279
|
+
previousPage: this.skip,
|
|
1280
|
+
currentPage: e.skip
|
|
1281
|
+
});
|
|
1282
|
+
this.skip = e.skip;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* @hidden
|
|
1286
|
+
*/
|
|
1287
|
+
onDownload() {
|
|
1288
|
+
this.ngZone.runOutsideAngular(() => this.pdfContext.pdfDoc.getData()
|
|
1289
|
+
.then((data) => new Blob([data], { type: 'application/pdf' }))
|
|
1290
|
+
.then((blob) => {
|
|
1291
|
+
const downloadEvent = new PDFViewerDownloadEvent(blob, this.saveFileName, this.saveOptions, this.pdfContext);
|
|
1292
|
+
this.ngZone.run(() => this.download.emit(downloadEvent));
|
|
1293
|
+
if (!downloadEvent.isDefaultPrevented()) {
|
|
1294
|
+
saveAs(blob, this.saveFileName, this.saveOptions);
|
|
1295
|
+
}
|
|
1296
|
+
})
|
|
1297
|
+
.catch((reason) => {
|
|
1298
|
+
if (hasObservers(this.error)) {
|
|
1299
|
+
this.ngZone.run(() => this.error.emit({
|
|
1300
|
+
error: reason,
|
|
1301
|
+
context: this.pdfContext
|
|
1302
|
+
}));
|
|
1303
|
+
}
|
|
1304
|
+
}));
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* @hidden
|
|
1308
|
+
*/
|
|
1309
|
+
onZoomIn() {
|
|
1310
|
+
const newZoom = Math.min(this.pdfContext.zoom + this.zoomRate, this.maxZoom);
|
|
1311
|
+
if (newZoom !== this.pdfContext.zoom && this.pdfContext.pdfDoc) {
|
|
1312
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
1313
|
+
this.zoomLevelChange.emit({
|
|
1314
|
+
previousZoomLevel: this.zoom,
|
|
1315
|
+
currentZoomLevel: newZoom
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
1319
|
+
this.setZoomLevel(newZoom);
|
|
1320
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* @hidden
|
|
1325
|
+
*/
|
|
1326
|
+
onZoomOut() {
|
|
1327
|
+
const newZoom = Math.max(this.pdfContext.zoom - this.zoomRate, this.minZoom);
|
|
1328
|
+
if (newZoom !== this.pdfContext.zoom && this.pdfContext.pdfDoc) {
|
|
1329
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
1330
|
+
this.zoomLevelChange.emit({
|
|
1331
|
+
previousZoomLevel: this.zoom,
|
|
1332
|
+
currentZoomLevel: newZoom
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
1336
|
+
this.setZoomLevel(newZoom);
|
|
1337
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* @hidden
|
|
1342
|
+
*/
|
|
1343
|
+
onZoomLevelChange(zoomLevel) {
|
|
1344
|
+
if (typeof zoomLevel === 'string') {
|
|
1345
|
+
const parsedValue = parseFloat(zoomLevel);
|
|
1346
|
+
zoomLevel = { value: Number.isNaN(parsedValue) ? 1 : parsedValue / 100 };
|
|
1347
|
+
}
|
|
1348
|
+
if (!zoomLevel) {
|
|
1349
|
+
zoomLevel = { value: 1 };
|
|
1350
|
+
}
|
|
1351
|
+
let newZoom = calculateZoomLevel(zoomLevel.value, zoomLevel.type, this.pdfContext.zoom, this.pagesContainer.nativeElement);
|
|
1352
|
+
newZoom = Math.round(newZoom * 100) / 100;
|
|
1353
|
+
if (hasObservers(this.zoomLevelChange)) {
|
|
1354
|
+
this.zoomLevelChange.emit({
|
|
1355
|
+
previousZoomLevel: this.zoom,
|
|
1356
|
+
currentZoomLevel: newZoom
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
this.zoom = this.pdfContext.zoom = newZoom;
|
|
1360
|
+
this.setZoomLevel(newZoom);
|
|
1361
|
+
this.ngZone.runOutsideAngular(() => this.reloadDocument());
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* @hidden
|
|
1365
|
+
*/
|
|
1366
|
+
onSearch() {
|
|
1367
|
+
this.searchActive = true;
|
|
1368
|
+
this.ngZone.runOutsideAngular(() => {
|
|
1369
|
+
const pagesTextLayers = Array.from(this.pagesContainer.nativeElement.querySelectorAll('.k-text-layer'));
|
|
1370
|
+
this.searchService = new SearchService({
|
|
1371
|
+
textContainers: pagesTextLayers || [],
|
|
1372
|
+
highlightClass: 'k-search-highlight',
|
|
1373
|
+
highlightMarkClass: 'k-search-highlight-mark',
|
|
1374
|
+
charClass: 'k-text-char'
|
|
1375
|
+
});
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* @hidden
|
|
1380
|
+
*/
|
|
1381
|
+
onPrint() {
|
|
1382
|
+
this.loading = true;
|
|
1383
|
+
const onError = (e) => {
|
|
1384
|
+
this.loading = false;
|
|
1385
|
+
if (hasObservers(this.error)) {
|
|
1386
|
+
this.error.emit(e);
|
|
1387
|
+
}
|
|
1388
|
+
;
|
|
1389
|
+
};
|
|
1390
|
+
const onDone = () => {
|
|
1391
|
+
this.loading = false;
|
|
1392
|
+
};
|
|
1393
|
+
print(this.pdfContext.pdfPages, onDone, onError);
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* @hidden
|
|
1397
|
+
*/
|
|
1398
|
+
onSearchChange(e) {
|
|
1399
|
+
this.currentMatches = this.searchService.search({ ...e });
|
|
1400
|
+
this.currentMatch = this.currentMatches.length ? 1 : 0;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* @hidden
|
|
1404
|
+
*/
|
|
1405
|
+
closeSearch(toolbar) {
|
|
1406
|
+
this.searchActive = false;
|
|
1407
|
+
this.searchService.destroy();
|
|
1408
|
+
this.currentMatches = [];
|
|
1409
|
+
this.currentMatch = null;
|
|
1410
|
+
toolbar.focus();
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* @hidden
|
|
1414
|
+
*/
|
|
1415
|
+
onNextMatch() {
|
|
1416
|
+
goToNextSearchMatch({ search: this.searchService, scroller: this.pdfScroller });
|
|
1417
|
+
this.currentMatch = this.currentMatch + 1 > this.currentMatches.length ? 1 : this.currentMatch + 1;
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* @hidden
|
|
1421
|
+
*/
|
|
1422
|
+
onPreviousMatch() {
|
|
1423
|
+
goToPreviousSearchMatch({ search: this.searchService, scroller: this.pdfScroller });
|
|
1424
|
+
this.currentMatch = this.currentMatch - 1 < 1 ? this.currentMatches.length : this.currentMatch - 1;
|
|
1425
|
+
}
|
|
1426
|
+
loadPdf(dataType, data) {
|
|
1427
|
+
this.loading = true;
|
|
1428
|
+
this.ngZone.runOutsideAngular(() => setTimeout(() => {
|
|
1429
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
1430
|
+
loadPDF({
|
|
1431
|
+
[dataType]: data,
|
|
1432
|
+
dom: this.pagesContainer.nativeElement,
|
|
1433
|
+
zoom: this.pdfContext?.zoom || this.zoom,
|
|
1434
|
+
done: (e) => {
|
|
1435
|
+
this.ngZone.run(() => {
|
|
1436
|
+
this.loading = false;
|
|
1437
|
+
this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
|
|
1438
|
+
});
|
|
1439
|
+
if (this.pdfScroller) {
|
|
1440
|
+
this.pdfScroller.destroy();
|
|
1441
|
+
}
|
|
1442
|
+
this.pdfScroller = this.pdfScroller = new Scroller(this.pagesContainer.nativeElement.parentNode, {
|
|
1443
|
+
filter: '.k-page',
|
|
1444
|
+
events: {}
|
|
1445
|
+
});
|
|
1446
|
+
this.pdfScroller.enablePanEventsTracking();
|
|
1447
|
+
this.assignPageIds();
|
|
1448
|
+
if (hasObservers(this.load)) {
|
|
1449
|
+
this.ngZone.run(() => this.load.emit({ context: this.pdfContext }));
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
error: (e) => {
|
|
1453
|
+
this.ngZone.run(() => this.loading = false);
|
|
1454
|
+
this.pdfContext = null;
|
|
1455
|
+
if (hasObservers(this.error)) {
|
|
1456
|
+
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
});
|
|
1460
|
+
}));
|
|
1461
|
+
}
|
|
1462
|
+
reloadDocument() {
|
|
1463
|
+
if (this.pagesContainer?.nativeElement) {
|
|
1464
|
+
this.ngZone.run(() => this.loading = true);
|
|
1465
|
+
removeChildren(this.pagesContainer.nativeElement);
|
|
1466
|
+
reloadDocument({
|
|
1467
|
+
pdfDoc: this.pdfContext?.pdfDoc,
|
|
1468
|
+
zoom: this.zoom,
|
|
1469
|
+
dom: this.pagesContainer.nativeElement,
|
|
1470
|
+
done: (pdfPages) => {
|
|
1471
|
+
this.pdfContext.pdfPages = pdfPages;
|
|
1472
|
+
this.ngZone.run(() => this.loading = false);
|
|
1473
|
+
this.assignPageIds();
|
|
1474
|
+
},
|
|
1475
|
+
error: (e) => {
|
|
1476
|
+
if (this.pdfScroller) {
|
|
1477
|
+
this.pdfScroller.destroy();
|
|
1478
|
+
this.pdfScroller = null;
|
|
1479
|
+
}
|
|
1480
|
+
this.pdfContext = null;
|
|
1481
|
+
if (hasObservers(this.error)) {
|
|
1482
|
+
this.ngZone.run(() => this.error.emit({ error: e, context: this.pdfContext }));
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
assignPageIds() {
|
|
1489
|
+
this.pagesContainer.nativeElement.querySelectorAll('.k-page').forEach((pageElement, index) => {
|
|
1490
|
+
const id = `k-pdfviewer-${counter}-page-${index + 1}`;
|
|
1491
|
+
this.renderer.setAttribute(pageElement, 'id', id);
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
setZoomLevel(zoom) {
|
|
1495
|
+
const option = this.zoomOptionsData.find(item => !item.type && item.value === zoom);
|
|
1496
|
+
this.zoomLevel = option || {
|
|
1497
|
+
value: zoom,
|
|
1498
|
+
displayValue: `${Math.round(zoom * 100)}%`,
|
|
1499
|
+
text: `${Math.round(zoom * 100)}%`
|
|
1500
|
+
};
|
|
1501
|
+
}
|
|
1502
|
+
verifySettings(changes) {
|
|
1503
|
+
const sourceTypes = ['url', 'arrayBuffer', 'data', 'typedArray'];
|
|
1504
|
+
const setTypes = sourceTypes.map(item => this.isSet(changes, item)).filter(item => item);
|
|
1505
|
+
if (isDevMode() && setTypes.length > 1) {
|
|
1506
|
+
console.warn(`
|
|
1507
|
+
Setting more than one source of data simultaneously is not supported.
|
|
1508
|
+
Only one of 'url', 'arrayBuffer', 'data', or 'typedArray' can be set.
|
|
1509
|
+
`);
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
isSet(changes, source) {
|
|
1513
|
+
return this[source] || (changes[source] && changes[source].currentValue);
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
PDFViewerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1517
|
+
PDFViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PDFViewerComponent, 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: [
|
|
1518
|
+
LocalizationService,
|
|
1519
|
+
{
|
|
1520
|
+
provide: L10N_PREFIX,
|
|
1521
|
+
useValue: 'kendo.pdfviewer'
|
|
1522
|
+
}
|
|
1523
|
+
], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
|
|
1524
|
+
<ng-container kendoPDFViewerLocalizedMessages
|
|
1525
|
+
i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
|
|
1526
|
+
pagerFirstPage="Go to the first page"
|
|
1527
|
+
|
|
1528
|
+
i18n-pagerPreviousPage="kendo.pdfviewer.pagerPreviousPage|The label for the previous page button in the Pager"
|
|
1529
|
+
pagerPreviousPage="Go to the previous page"
|
|
1530
|
+
|
|
1531
|
+
i18n-pagerNextPage="kendo.pdfviewer.pagerNextPage|The label for the next page button in the Pager"
|
|
1532
|
+
pagerNextPage="Go to the next page"
|
|
1533
|
+
|
|
1534
|
+
i18n-pagerLastPage="kendo.pdfviewer.pagerLastPage|The label for the last page button in the Pager"
|
|
1535
|
+
pagerLastPage="Go to the last page"
|
|
1536
|
+
|
|
1537
|
+
i18n-pagerPage="kendo.pdfviewer.pagerPage|The text before the current page number in the Pager"
|
|
1538
|
+
pagerPage="Page"
|
|
1539
|
+
|
|
1540
|
+
i18n-pagerOf="kendo.pdfviewer.pagerOf|The text before the total pages number in the Pager"
|
|
1541
|
+
pagerOf="of"
|
|
1542
|
+
|
|
1543
|
+
i18n-pagerInputTitle="kendo.pdfviewer.pagerInputTitle|The label of the pager input element"
|
|
1544
|
+
pagerInputTitle="Page Number"
|
|
1545
|
+
|
|
1546
|
+
i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
|
|
1547
|
+
pagerInputLabel="Type a page number"
|
|
1548
|
+
|
|
1549
|
+
i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
|
|
1550
|
+
zoomInTitle="Zoom in"
|
|
1551
|
+
|
|
1552
|
+
i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
|
|
1553
|
+
zoomOutTitle="Zoom out"
|
|
1554
|
+
|
|
1555
|
+
i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
|
|
1556
|
+
selectionTitle="Enable selection"
|
|
1557
|
+
|
|
1558
|
+
i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
|
|
1559
|
+
panningTitle="Enable panning"
|
|
1560
|
+
|
|
1561
|
+
i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
|
|
1562
|
+
searchTitle="Search"
|
|
1563
|
+
|
|
1564
|
+
i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
|
|
1565
|
+
openTitle="Open"
|
|
1566
|
+
|
|
1567
|
+
i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
|
|
1568
|
+
downloadTitle="Download"
|
|
1569
|
+
|
|
1570
|
+
i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
|
|
1571
|
+
printTitle="Print"
|
|
1572
|
+
|
|
1573
|
+
i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
|
|
1574
|
+
fitToPage="Fit to page"
|
|
1575
|
+
|
|
1576
|
+
i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
|
|
1577
|
+
fitToWidth="Fit to width"
|
|
1578
|
+
|
|
1579
|
+
i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
|
|
1580
|
+
searchInputPlaceholder="Search"
|
|
1581
|
+
|
|
1582
|
+
i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
|
|
1583
|
+
searchMatchesOf="of"
|
|
1584
|
+
|
|
1585
|
+
i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
|
|
1586
|
+
searchPreviousMatchTitle="Previous match"
|
|
1587
|
+
|
|
1588
|
+
i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
|
|
1589
|
+
searchNextMatchTitle="Next match"
|
|
1590
|
+
|
|
1591
|
+
i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
|
|
1592
|
+
searchCloseTitle="Close"
|
|
1593
|
+
|
|
1594
|
+
i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
|
|
1595
|
+
searchMatchCaseTitle="Match case"
|
|
1596
|
+
|
|
1597
|
+
i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
|
|
1598
|
+
zoomInputPlaceholder="Choose zoom level">
|
|
1599
|
+
</ng-container>
|
|
1600
|
+
<div loader
|
|
1601
|
+
*ngIf="loading"
|
|
1602
|
+
[settings]="loaderSettings"></div>
|
|
1603
|
+
<div toolbar
|
|
1604
|
+
#toolbar
|
|
1605
|
+
role="toolbar"
|
|
1606
|
+
[attr.aria-controls]="pagesContainerId"
|
|
1607
|
+
[tools]="tools"
|
|
1608
|
+
[skip]="skip"
|
|
1609
|
+
[total]="pdfContext?.pdfPages.length ? pdfContext?.pdfPages.length : 1"
|
|
1610
|
+
[pageSize]="1"
|
|
1611
|
+
[zoomInDisabled]="zoom >= maxZoom || !pdfContext?.pdfDoc"
|
|
1612
|
+
[zoomOutDisabled]="zoom <= minZoom || !pdfContext?.pdfDoc"
|
|
1613
|
+
[zoomOptionsData]="zoomOptionsData"
|
|
1614
|
+
[zoomLevelChooserValue]="zoomLevel"
|
|
1615
|
+
[disabledTools]="!pdfContext?.pdfDoc"
|
|
1616
|
+
(pageChange)="onPageChange($event)"
|
|
1617
|
+
(fileSelect)="onFileSelect($event)"
|
|
1618
|
+
(fileSelectError)="onFileSelectError($event)"
|
|
1619
|
+
(download)="onDownload()"
|
|
1620
|
+
(panningEnabled)="enabledSelection = false;"
|
|
1621
|
+
(selectionEnabled)="enabledSelection = true;"
|
|
1622
|
+
(zoomIn)="onZoomIn()"
|
|
1623
|
+
(zoomOut)="onZoomOut()"
|
|
1624
|
+
(zoomLevelChange)="onZoomLevelChange($event)"
|
|
1625
|
+
(print)="onPrint()"
|
|
1626
|
+
(search)="onSearch()"></div>
|
|
1627
|
+
<div
|
|
1628
|
+
class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
|
|
1629
|
+
[class.k-enable-text-select]="enabledSelection"
|
|
1630
|
+
[class.k-enable-panning]="!enabledSelection"
|
|
1631
|
+
[attr.aria-describedby]="activePageId"
|
|
1632
|
+
tabindex="0">
|
|
1633
|
+
<div
|
|
1634
|
+
kendoPDFViewerSearch
|
|
1635
|
+
*ngIf="searchActive"
|
|
1636
|
+
[currentMatch]="currentMatch"
|
|
1637
|
+
[matches]="currentMatches.length"
|
|
1638
|
+
class="k-search-panel k-pos-sticky k-top-center"
|
|
1639
|
+
(searchChange)="onSearchChange($event)"
|
|
1640
|
+
(prevMatch)="onPreviousMatch()"
|
|
1641
|
+
(nextMatch)="onNextMatch()"
|
|
1642
|
+
(close)="closeSearch(toolbar)"></div>
|
|
1643
|
+
<div
|
|
1644
|
+
#pagesContainer
|
|
1645
|
+
class="k-pdf-viewer-pages"
|
|
1646
|
+
[style.--scale-factor]="zoom"
|
|
1647
|
+
[attr.id]="pagesContainerId">
|
|
1648
|
+
<div class="k-page">
|
|
1649
|
+
<div class="k-text-layer"></div>
|
|
1650
|
+
</div>
|
|
1651
|
+
</div>
|
|
1652
|
+
</div>
|
|
1653
|
+
`, isInline: true, components: [{ type: LoaderComponent, selector: "[loader]", inputs: ["settings"] }, { type: ToolbarComponent, selector: "[toolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools"], outputs: ["fileSelect", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search"] }, { type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }], directives: [{ type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1654
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerComponent, decorators: [{
|
|
1655
|
+
type: Component,
|
|
1656
|
+
args: [{
|
|
1657
|
+
exportAs: 'kendo-pdfviewer',
|
|
1658
|
+
selector: 'kendo-pdfviewer',
|
|
1659
|
+
providers: [
|
|
1660
|
+
LocalizationService,
|
|
1661
|
+
{
|
|
1662
|
+
provide: L10N_PREFIX,
|
|
1663
|
+
useValue: 'kendo.pdfviewer'
|
|
1664
|
+
}
|
|
1665
|
+
],
|
|
1666
|
+
template: `
|
|
1667
|
+
<ng-container kendoPDFViewerLocalizedMessages
|
|
1668
|
+
i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
|
|
1669
|
+
pagerFirstPage="Go to the first page"
|
|
1670
|
+
|
|
1671
|
+
i18n-pagerPreviousPage="kendo.pdfviewer.pagerPreviousPage|The label for the previous page button in the Pager"
|
|
1672
|
+
pagerPreviousPage="Go to the previous page"
|
|
1673
|
+
|
|
1674
|
+
i18n-pagerNextPage="kendo.pdfviewer.pagerNextPage|The label for the next page button in the Pager"
|
|
1675
|
+
pagerNextPage="Go to the next page"
|
|
1676
|
+
|
|
1677
|
+
i18n-pagerLastPage="kendo.pdfviewer.pagerLastPage|The label for the last page button in the Pager"
|
|
1678
|
+
pagerLastPage="Go to the last page"
|
|
1679
|
+
|
|
1680
|
+
i18n-pagerPage="kendo.pdfviewer.pagerPage|The text before the current page number in the Pager"
|
|
1681
|
+
pagerPage="Page"
|
|
1682
|
+
|
|
1683
|
+
i18n-pagerOf="kendo.pdfviewer.pagerOf|The text before the total pages number in the Pager"
|
|
1684
|
+
pagerOf="of"
|
|
1685
|
+
|
|
1686
|
+
i18n-pagerInputTitle="kendo.pdfviewer.pagerInputTitle|The label of the pager input element"
|
|
1687
|
+
pagerInputTitle="Page Number"
|
|
1688
|
+
|
|
1689
|
+
i18n-pagerInputLabel="kendo.pdfviewer.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number."
|
|
1690
|
+
pagerInputLabel="Type a page number"
|
|
1691
|
+
|
|
1692
|
+
i18n-zoomInTitle="kendo.pdfviewer.zoomInTitle|The ZoomIn tool title and label."
|
|
1693
|
+
zoomInTitle="Zoom in"
|
|
1694
|
+
|
|
1695
|
+
i18n-zoomOutTitle="kendo.pdfviewer.zoomOutTitle|The ZoomOut tool title and label."
|
|
1696
|
+
zoomOutTitle="Zoom out"
|
|
1697
|
+
|
|
1698
|
+
i18n-selectionTitle="kendo.pdfviewer.selectionTitle|The Selection tool title and label."
|
|
1699
|
+
selectionTitle="Enable selection"
|
|
1700
|
+
|
|
1701
|
+
i18n-panningTitle="kendo.pdfviewer.panningTitle|The Panning tool title and label."
|
|
1702
|
+
panningTitle="Enable panning"
|
|
1703
|
+
|
|
1704
|
+
i18n-searchTitle="kendo.pdfviewer.searchTitle|The Search tool title and label."
|
|
1705
|
+
searchTitle="Search"
|
|
1706
|
+
|
|
1707
|
+
i18n-openTitle="kendo.pdfviewer.openTitle|The Open tool title and label."
|
|
1708
|
+
openTitle="Open"
|
|
1709
|
+
|
|
1710
|
+
i18n-downloadTitle="kendo.pdfviewer.downloadTitle|The Download tool title and label."
|
|
1711
|
+
downloadTitle="Download"
|
|
1712
|
+
|
|
1713
|
+
i18n-printTitle="kendo.pdfviewer.printTitle|The Print tool title and label."
|
|
1714
|
+
printTitle="Print"
|
|
1715
|
+
|
|
1716
|
+
i18n-fitToPage="kendo.pdfviewer.fitToPage|The text for the zoom level chooser Fit to page option."
|
|
1717
|
+
fitToPage="Fit to page"
|
|
1718
|
+
|
|
1719
|
+
i18n-fitToWidth="kendo.pdfviewer.fitToWidth|The text for the zoom level chooser Fit to width option."
|
|
1720
|
+
fitToWidth="Fit to width"
|
|
1721
|
+
|
|
1722
|
+
i18n-searchInputPlaceholder="kendo.pdfviewer.searchInputPlaceholder|The text for the search input placeholder."
|
|
1723
|
+
searchInputPlaceholder="Search"
|
|
1724
|
+
|
|
1725
|
+
i18n-searchMatchesOf="kendo.pdfviewer.searchMatchesOf|The text before the total number of matches in the Search tool."
|
|
1726
|
+
searchMatchesOf="of"
|
|
1727
|
+
|
|
1728
|
+
i18n-searchPreviousMatchTitle="kendo.pdfviewer.searchPreviousMatchTitle|The title of the Search tool previous match button."
|
|
1729
|
+
searchPreviousMatchTitle="Previous match"
|
|
1730
|
+
|
|
1731
|
+
i18n-searchNextMatchTitle="kendo.pdfviewer.searchNextMatchTitle|The title of the Search tool next match button."
|
|
1732
|
+
searchNextMatchTitle="Next match"
|
|
1733
|
+
|
|
1734
|
+
i18n-searchCloseTitle="kendo.pdfviewer.searchCloseTitle|The title of the Search tool close button."
|
|
1735
|
+
searchCloseTitle="Close"
|
|
1736
|
+
|
|
1737
|
+
i18n-searchMatchCaseTitle="kendo.pdfviewer.searchMatchCaseTitle|The title of the Search tool match case button."
|
|
1738
|
+
searchMatchCaseTitle="Match case"
|
|
1739
|
+
|
|
1740
|
+
i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
|
|
1741
|
+
zoomInputPlaceholder="Choose zoom level">
|
|
1742
|
+
</ng-container>
|
|
1743
|
+
<div loader
|
|
1744
|
+
*ngIf="loading"
|
|
1745
|
+
[settings]="loaderSettings"></div>
|
|
1746
|
+
<div toolbar
|
|
1747
|
+
#toolbar
|
|
1748
|
+
role="toolbar"
|
|
1749
|
+
[attr.aria-controls]="pagesContainerId"
|
|
1750
|
+
[tools]="tools"
|
|
1751
|
+
[skip]="skip"
|
|
1752
|
+
[total]="pdfContext?.pdfPages.length ? pdfContext?.pdfPages.length : 1"
|
|
1753
|
+
[pageSize]="1"
|
|
1754
|
+
[zoomInDisabled]="zoom >= maxZoom || !pdfContext?.pdfDoc"
|
|
1755
|
+
[zoomOutDisabled]="zoom <= minZoom || !pdfContext?.pdfDoc"
|
|
1756
|
+
[zoomOptionsData]="zoomOptionsData"
|
|
1757
|
+
[zoomLevelChooserValue]="zoomLevel"
|
|
1758
|
+
[disabledTools]="!pdfContext?.pdfDoc"
|
|
1759
|
+
(pageChange)="onPageChange($event)"
|
|
1760
|
+
(fileSelect)="onFileSelect($event)"
|
|
1761
|
+
(fileSelectError)="onFileSelectError($event)"
|
|
1762
|
+
(download)="onDownload()"
|
|
1763
|
+
(panningEnabled)="enabledSelection = false;"
|
|
1764
|
+
(selectionEnabled)="enabledSelection = true;"
|
|
1765
|
+
(zoomIn)="onZoomIn()"
|
|
1766
|
+
(zoomOut)="onZoomOut()"
|
|
1767
|
+
(zoomLevelChange)="onZoomLevelChange($event)"
|
|
1768
|
+
(print)="onPrint()"
|
|
1769
|
+
(search)="onSearch()"></div>
|
|
1770
|
+
<div
|
|
1771
|
+
class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
|
|
1772
|
+
[class.k-enable-text-select]="enabledSelection"
|
|
1773
|
+
[class.k-enable-panning]="!enabledSelection"
|
|
1774
|
+
[attr.aria-describedby]="activePageId"
|
|
1775
|
+
tabindex="0">
|
|
1776
|
+
<div
|
|
1777
|
+
kendoPDFViewerSearch
|
|
1778
|
+
*ngIf="searchActive"
|
|
1779
|
+
[currentMatch]="currentMatch"
|
|
1780
|
+
[matches]="currentMatches.length"
|
|
1781
|
+
class="k-search-panel k-pos-sticky k-top-center"
|
|
1782
|
+
(searchChange)="onSearchChange($event)"
|
|
1783
|
+
(prevMatch)="onPreviousMatch()"
|
|
1784
|
+
(nextMatch)="onNextMatch()"
|
|
1785
|
+
(close)="closeSearch(toolbar)"></div>
|
|
1786
|
+
<div
|
|
1787
|
+
#pagesContainer
|
|
1788
|
+
class="k-pdf-viewer-pages"
|
|
1789
|
+
[style.--scale-factor]="zoom"
|
|
1790
|
+
[attr.id]="pagesContainerId">
|
|
1791
|
+
<div class="k-page">
|
|
1792
|
+
<div class="k-text-layer"></div>
|
|
1793
|
+
</div>
|
|
1794
|
+
</div>
|
|
1795
|
+
</div>
|
|
1796
|
+
`,
|
|
1797
|
+
}]
|
|
1798
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1$1.LocalizationService }]; }, propDecorators: { hostClass: [{
|
|
1799
|
+
type: HostBinding,
|
|
1800
|
+
args: ['class.k-pdf-viewer']
|
|
1801
|
+
}], direction: [{
|
|
1802
|
+
type: HostBinding,
|
|
1803
|
+
args: ['attr.dir']
|
|
1804
|
+
}], tools: [{
|
|
1805
|
+
type: Input
|
|
1806
|
+
}], loaderSettings: [{
|
|
1807
|
+
type: Input
|
|
1808
|
+
}], saveFileName: [{
|
|
1809
|
+
type: Input
|
|
1810
|
+
}], saveOptions: [{
|
|
1811
|
+
type: Input
|
|
1812
|
+
}], url: [{
|
|
1813
|
+
type: Input
|
|
1814
|
+
}], data: [{
|
|
1815
|
+
type: Input
|
|
1816
|
+
}], arrayBuffer: [{
|
|
1817
|
+
type: Input
|
|
1818
|
+
}], typedArray: [{
|
|
1819
|
+
type: Input
|
|
1820
|
+
}], zoom: [{
|
|
1821
|
+
type: Input
|
|
1822
|
+
}], zoomRate: [{
|
|
1823
|
+
type: Input
|
|
1824
|
+
}], minZoom: [{
|
|
1825
|
+
type: Input
|
|
1826
|
+
}], maxZoom: [{
|
|
1827
|
+
type: Input
|
|
1828
|
+
}], load: [{
|
|
1829
|
+
type: Output
|
|
1830
|
+
}], error: [{
|
|
1831
|
+
type: Output
|
|
1832
|
+
}], download: [{
|
|
1833
|
+
type: Output
|
|
1834
|
+
}], pageChange: [{
|
|
1835
|
+
type: Output
|
|
1836
|
+
}], zoomLevelChange: [{
|
|
1837
|
+
type: Output
|
|
1838
|
+
}], pagesContainer: [{
|
|
1839
|
+
type: ViewChild,
|
|
1840
|
+
args: ['pagesContainer']
|
|
1841
|
+
}] } });
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Custom component messages override default component messages
|
|
1845
|
+
* ([see example]({% slug rtl_pdfviewer %}).
|
|
1846
|
+
*/
|
|
1847
|
+
class PDFViewerCustomMessagesComponent extends Messages {
|
|
1848
|
+
constructor(service) {
|
|
1849
|
+
super();
|
|
1850
|
+
this.service = service;
|
|
1851
|
+
}
|
|
1852
|
+
get override() {
|
|
1853
|
+
return true;
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
PDFViewerCustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerCustomMessagesComponent, deps: [{ token: i1$1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1857
|
+
PDFViewerCustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: PDFViewerCustomMessagesComponent, selector: "kendo-pdfviewer-messages", providers: [{
|
|
1858
|
+
provide: Messages,
|
|
1859
|
+
useExisting: forwardRef(() => PDFViewerCustomMessagesComponent)
|
|
1860
|
+
}], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerCustomMessagesComponent, decorators: [{
|
|
1862
|
+
type: Component,
|
|
1863
|
+
args: [{
|
|
1864
|
+
providers: [{
|
|
1865
|
+
provide: Messages,
|
|
1866
|
+
useExisting: forwardRef(() => PDFViewerCustomMessagesComponent)
|
|
1867
|
+
}],
|
|
1868
|
+
selector: 'kendo-pdfviewer-messages',
|
|
1869
|
+
template: ``
|
|
1870
|
+
}]
|
|
1871
|
+
}], ctorParameters: function () { return [{ type: i1$1.LocalizationService }]; } });
|
|
1872
|
+
|
|
1873
|
+
const DIRECTIVES = [
|
|
1874
|
+
PDFViewerComponent,
|
|
1875
|
+
ToolbarComponent,
|
|
1876
|
+
LoaderComponent,
|
|
1877
|
+
PDFViewerCustomMessagesComponent,
|
|
1878
|
+
LocalizedPDFViewerMessagesDirective,
|
|
1879
|
+
ToolbarInputWrapperComponent,
|
|
1880
|
+
ToolbarFocusableDirective,
|
|
1881
|
+
ToolbarComboBoxDirective,
|
|
1882
|
+
PDFViewerSearchComponent
|
|
1883
|
+
];
|
|
1884
|
+
const IMPORTS = [
|
|
1885
|
+
CommonModule,
|
|
1886
|
+
IconsModule,
|
|
1887
|
+
PagerModule,
|
|
1888
|
+
ButtonsModule,
|
|
1889
|
+
TextBoxModule,
|
|
1890
|
+
ComboBoxModule,
|
|
1891
|
+
LoaderModule
|
|
1892
|
+
];
|
|
1893
|
+
/**
|
|
1894
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
1895
|
+
* definition for the PDFViewer component.
|
|
1896
|
+
*/
|
|
1897
|
+
class PDFViewerModule {
|
|
1898
|
+
}
|
|
1899
|
+
PDFViewerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1900
|
+
PDFViewerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerModule, declarations: [PDFViewerComponent,
|
|
1901
|
+
ToolbarComponent,
|
|
1902
|
+
LoaderComponent,
|
|
1903
|
+
PDFViewerCustomMessagesComponent,
|
|
1904
|
+
LocalizedPDFViewerMessagesDirective,
|
|
1905
|
+
ToolbarInputWrapperComponent,
|
|
1906
|
+
ToolbarFocusableDirective,
|
|
1907
|
+
ToolbarComboBoxDirective,
|
|
1908
|
+
PDFViewerSearchComponent], imports: [CommonModule,
|
|
1909
|
+
IconsModule,
|
|
1910
|
+
PagerModule,
|
|
1911
|
+
ButtonsModule,
|
|
1912
|
+
TextBoxModule,
|
|
1913
|
+
ComboBoxModule,
|
|
1914
|
+
LoaderModule], exports: [PDFViewerComponent,
|
|
1915
|
+
ToolbarComponent,
|
|
1916
|
+
LoaderComponent,
|
|
1917
|
+
PDFViewerCustomMessagesComponent,
|
|
1918
|
+
LocalizedPDFViewerMessagesDirective,
|
|
1919
|
+
ToolbarInputWrapperComponent,
|
|
1920
|
+
ToolbarFocusableDirective,
|
|
1921
|
+
ToolbarComboBoxDirective,
|
|
1922
|
+
PDFViewerSearchComponent] });
|
|
1923
|
+
PDFViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerModule, imports: [IMPORTS] });
|
|
1924
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: PDFViewerModule, decorators: [{
|
|
1925
|
+
type: NgModule,
|
|
1926
|
+
args: [{
|
|
1927
|
+
declarations: DIRECTIVES,
|
|
1928
|
+
exports: DIRECTIVES,
|
|
1929
|
+
imports: IMPORTS,
|
|
1930
|
+
}]
|
|
1931
|
+
}] });
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Generated bundle index. Do not edit.
|
|
1935
|
+
*/
|
|
1936
|
+
|
|
1937
|
+
export { LoaderComponent, LocalizedPDFViewerMessagesDirective, PDFViewerComponent, PDFViewerCustomMessagesComponent, PDFViewerDownloadEvent, PDFViewerModule, PDFViewerSearchComponent, ToolbarComboBoxDirective, ToolbarComponent, ToolbarFocusableDirective, ToolbarInputWrapperComponent };
|
|
1938
|
+
|