@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,460 @@
|
|
|
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
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
6
|
+
import { Component, ElementRef, EventEmitter, HostBinding, Input, Output, ViewChild } from '@angular/core';
|
|
7
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
|
+
import { searchIcon, zoomInIcon, zoomOutIcon, pointerIcon, handIcon, folderOpenIcon, downloadIcon, printIcon } from '@progress/kendo-svg-icons';
|
|
9
|
+
import { ToolbarNavigationService } from './toolbar-navigation.service';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
12
|
+
import * as i2 from "./toolbar-navigation.service";
|
|
13
|
+
import * as i3 from "./input-wrapper.component";
|
|
14
|
+
import * as i4 from "@progress/kendo-angular-pager";
|
|
15
|
+
import * as i5 from "@progress/kendo-angular-buttons";
|
|
16
|
+
import * as i6 from "@progress/kendo-angular-dropdowns";
|
|
17
|
+
import * as i7 from "@angular/common";
|
|
18
|
+
import * as i8 from "./toolbar-focusable.directive";
|
|
19
|
+
import * as i9 from "./toolbar-combobox.directive";
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export class ToolbarComponent {
|
|
24
|
+
constructor(localization, navigationService) {
|
|
25
|
+
this.localization = localization;
|
|
26
|
+
this.navigationService = navigationService;
|
|
27
|
+
this.toolbarClass = true;
|
|
28
|
+
this.toolbarSizeClass = true;
|
|
29
|
+
this.zoomLevel = {
|
|
30
|
+
text: '125%',
|
|
31
|
+
displayValue: '125%',
|
|
32
|
+
value: 1.25
|
|
33
|
+
};
|
|
34
|
+
this.calculatedComboBoxValue = {
|
|
35
|
+
text: 'Fit to width',
|
|
36
|
+
displayValue: null,
|
|
37
|
+
value: null
|
|
38
|
+
};
|
|
39
|
+
this.skip = 0;
|
|
40
|
+
this.pageSize = 1;
|
|
41
|
+
this.fileSelect = new EventEmitter();
|
|
42
|
+
this.fileSelectError = new EventEmitter();
|
|
43
|
+
this.download = new EventEmitter();
|
|
44
|
+
this.selectionEnabled = new EventEmitter();
|
|
45
|
+
this.panningEnabled = new EventEmitter();
|
|
46
|
+
this.pageChange = new EventEmitter();
|
|
47
|
+
this.zoomIn = new EventEmitter();
|
|
48
|
+
this.zoomOut = new EventEmitter();
|
|
49
|
+
this.zoomLevelChange = new EventEmitter();
|
|
50
|
+
this.print = new EventEmitter();
|
|
51
|
+
this.search = new EventEmitter();
|
|
52
|
+
this.zoomInIcon = zoomInIcon;
|
|
53
|
+
this.zoomOutIcon = zoomOutIcon;
|
|
54
|
+
this.handIcon = handIcon;
|
|
55
|
+
this.pointerIcon = pointerIcon;
|
|
56
|
+
this.searchIcon = searchIcon;
|
|
57
|
+
this.folderOpenIcon = folderOpenIcon;
|
|
58
|
+
this.downloadIcon = downloadIcon;
|
|
59
|
+
this.printIcon = printIcon;
|
|
60
|
+
this.pagerType = 'input';
|
|
61
|
+
}
|
|
62
|
+
messageFor(key) {
|
|
63
|
+
return this.localization.get(key);
|
|
64
|
+
}
|
|
65
|
+
onFileSelect(e) {
|
|
66
|
+
const file = e.target.files[0];
|
|
67
|
+
if (file) {
|
|
68
|
+
const reader = new FileReader();
|
|
69
|
+
reader.onload = (e) => {
|
|
70
|
+
const data = e.target.result;
|
|
71
|
+
this.fileSelect.emit(data);
|
|
72
|
+
};
|
|
73
|
+
reader.onerror = (e) => {
|
|
74
|
+
this.fileSelect.emit(e);
|
|
75
|
+
};
|
|
76
|
+
reader.readAsDataURL(file);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
onZoomLevelChooserValueChange(zoomLevel) {
|
|
80
|
+
this.zoomLevelChange.emit(zoomLevel);
|
|
81
|
+
}
|
|
82
|
+
focus() {
|
|
83
|
+
this.navigationService.focusableTools[this.navigationService.currentFocusIndex].activate();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
ToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComponent, deps: [{ token: i1.LocalizationService }, { token: i2.ToolbarNavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
87
|
+
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: `
|
|
88
|
+
<ng-container *ngFor="let tool of tools">
|
|
89
|
+
<ng-container [ngSwitch]="tool">
|
|
90
|
+
<kendo-toolbar-input-wrapper
|
|
91
|
+
*ngSwitchCase="'pager'"
|
|
92
|
+
kendoPDFViewerToolbarFocusable
|
|
93
|
+
[toolbarTool]="pager">
|
|
94
|
+
<kendo-datapager
|
|
95
|
+
#pager
|
|
96
|
+
[attr.aria-controls]="pagesContainerId"
|
|
97
|
+
[attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
|
|
98
|
+
[class.k-disabled]="disabledTools"
|
|
99
|
+
[navigable]="true"
|
|
100
|
+
[pageSize]="pageSize"
|
|
101
|
+
[skip]="skip"
|
|
102
|
+
[total]="total"
|
|
103
|
+
[pageSizeValues]="false"
|
|
104
|
+
[info]="false"
|
|
105
|
+
[type]="pagerType"
|
|
106
|
+
(pageChange)="pageChange.emit($event)">
|
|
107
|
+
<kendo-datapager-messages
|
|
108
|
+
[firstPage]="messageFor('pagerFirstPage')"
|
|
109
|
+
[previousPage]="messageFor('pagerPreviousPage')"
|
|
110
|
+
[nextPage]="messageFor('pagerNextPage')"
|
|
111
|
+
[lastPage]="messageFor('pagerLastPage')"
|
|
112
|
+
[inputLabel]="messageFor('pagerInputLabel')"
|
|
113
|
+
[pageNumberInputTitle]="messageFor('pagerInputTitle')"
|
|
114
|
+
[of]="messageFor('pagerOf')"
|
|
115
|
+
[page]="messageFor('pagerPage')"></kendo-datapager-messages>
|
|
116
|
+
</kendo-datapager>
|
|
117
|
+
</kendo-toolbar-input-wrapper>
|
|
118
|
+
<span
|
|
119
|
+
*ngSwitchCase="'spacer'"
|
|
120
|
+
class="k-spacer"></span>
|
|
121
|
+
<kendo-buttongroup
|
|
122
|
+
*ngSwitchCase="'zoomInOut'"
|
|
123
|
+
[attr.aria-controls]="pagesContainerId"
|
|
124
|
+
[navigable]="false">
|
|
125
|
+
<button
|
|
126
|
+
kendoButton
|
|
127
|
+
kendoPDFViewerToolbarFocusable
|
|
128
|
+
icon="zoom-out"
|
|
129
|
+
[disabled]="disabledTools || zoomOutDisabled"
|
|
130
|
+
[svgIcon]="zoomOutIcon"
|
|
131
|
+
[attr.title]="messageFor('zoomOutTitle')"
|
|
132
|
+
[attr.aria-label]="messageFor('zoomOutTitle')"
|
|
133
|
+
(click)="zoomOut.emit()"></button>
|
|
134
|
+
<button
|
|
135
|
+
kendoButton
|
|
136
|
+
kendoPDFViewerToolbarFocusable
|
|
137
|
+
icon="zoom-in"
|
|
138
|
+
[disabled]="disabledTools || zoomInDisabled"
|
|
139
|
+
[svgIcon]="zoomInIcon"
|
|
140
|
+
[attr.title]="messageFor('zoomInTitle')"
|
|
141
|
+
[attr.aria-label]="messageFor('zoomInTitle')"
|
|
142
|
+
(click)="zoomIn.emit()"></button>
|
|
143
|
+
</kendo-buttongroup>
|
|
144
|
+
<kendo-toolbar-input-wrapper
|
|
145
|
+
*ngSwitchCase="'zoom'"
|
|
146
|
+
kendoPDFViewerToolbarFocusable
|
|
147
|
+
[toolbarTool]="combobox">
|
|
148
|
+
<kendo-combobox
|
|
149
|
+
#combobox
|
|
150
|
+
kendoPDFViewerComboBox
|
|
151
|
+
[attr.aria-controls]="pagesContainerId"
|
|
152
|
+
[tabindex]="-1"
|
|
153
|
+
[data]="zoomOptionsData"
|
|
154
|
+
[disabled]="disabledTools"
|
|
155
|
+
[placeholder]="messageFor('zoomInputPlaceholder')"
|
|
156
|
+
textField="displayValue"
|
|
157
|
+
valueField="id"
|
|
158
|
+
[value]="zoomLevelChooserValue"
|
|
159
|
+
[allowCustom]="true"
|
|
160
|
+
(valueChange)="onZoomLevelChooserValueChange($event)">
|
|
161
|
+
<ng-template kendoComboBoxItemTemplate let-dataItem>
|
|
162
|
+
{{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
|
|
163
|
+
</ng-template>
|
|
164
|
+
</kendo-combobox>
|
|
165
|
+
</kendo-toolbar-input-wrapper>
|
|
166
|
+
<kendo-buttongroup
|
|
167
|
+
*ngSwitchCase="'selection'"
|
|
168
|
+
[attr.aria-controls]="pagesContainerId"
|
|
169
|
+
[navigable]="false"
|
|
170
|
+
selection="single">
|
|
171
|
+
<button
|
|
172
|
+
kendoButton
|
|
173
|
+
kendoPDFViewerToolbarFocusable
|
|
174
|
+
icon="pointer"
|
|
175
|
+
[toggleable]="true"
|
|
176
|
+
[svgIcon]="pointerIcon"
|
|
177
|
+
[attr.title]="messageFor('selectionTitle')"
|
|
178
|
+
[attr.aria-label]="messageFor('selectionTitle')"
|
|
179
|
+
(click)="selectionEnabled.emit()"></button>
|
|
180
|
+
<button
|
|
181
|
+
kendoButton
|
|
182
|
+
kendoPDFViewerToolbarFocusable
|
|
183
|
+
icon="hand"
|
|
184
|
+
[toggleable]="true"
|
|
185
|
+
[selected]="true"
|
|
186
|
+
[attr.title]="messageFor('panningTitle')"
|
|
187
|
+
[attr.aria-label]="messageFor('panningTitle')"
|
|
188
|
+
(click)="panningEnabled.emit()"></button>
|
|
189
|
+
</kendo-buttongroup>
|
|
190
|
+
<button
|
|
191
|
+
*ngSwitchCase="'search'"
|
|
192
|
+
kendoPDFViewerToolbarFocusable
|
|
193
|
+
kendoButton
|
|
194
|
+
icon="search"
|
|
195
|
+
[disabled]="disabledTools"
|
|
196
|
+
[attr.title]="messageFor('searchTitle')"
|
|
197
|
+
[attr.aria-label]="messageFor('searchTitle')"
|
|
198
|
+
aria-haspopup="dialog"
|
|
199
|
+
[svgIcon]="searchIcon"
|
|
200
|
+
(click)="search.emit()"></button>
|
|
201
|
+
<button
|
|
202
|
+
*ngSwitchCase="'open'"
|
|
203
|
+
kendoPDFViewerToolbarFocusable
|
|
204
|
+
kendoButton
|
|
205
|
+
icon="folder-open"
|
|
206
|
+
[svgIcon]="folderOpenIcon"
|
|
207
|
+
[attr.title]="messageFor('openTitle')"
|
|
208
|
+
[attr.aria-label]="messageFor('openTitle')"
|
|
209
|
+
[attr.aria-controls]="pagesContainerId"
|
|
210
|
+
(click)="fileSelectEl?.nativeElement.click()">
|
|
211
|
+
</button>
|
|
212
|
+
<button
|
|
213
|
+
*ngSwitchCase="'download'"
|
|
214
|
+
kendoPDFViewerToolbarFocusable
|
|
215
|
+
kendoButton
|
|
216
|
+
icon="download"
|
|
217
|
+
[svgIcon]="downloadIcon"
|
|
218
|
+
[disabled]="disabledTools"
|
|
219
|
+
[attr.title]="messageFor('downloadTitle')"
|
|
220
|
+
[attr.aria-label]="messageFor('downloadTitle')"
|
|
221
|
+
(click)="download.emit()"></button>
|
|
222
|
+
<button
|
|
223
|
+
*ngSwitchCase="'print'"
|
|
224
|
+
kendoPDFViewerToolbarFocusable
|
|
225
|
+
kendoButton
|
|
226
|
+
icon="print"
|
|
227
|
+
[svgIcon]="printIcon"
|
|
228
|
+
[disabled]="disabledTools"
|
|
229
|
+
[attr.title]="messageFor('printTitle')"
|
|
230
|
+
[attr.aria-label]="messageFor('printTitle')"
|
|
231
|
+
(click)="print.emit()"></button>
|
|
232
|
+
</ng-container>
|
|
233
|
+
</ng-container>
|
|
234
|
+
<input
|
|
235
|
+
#fileSelectEl
|
|
236
|
+
*ngIf="tools?.indexOf('open') > -1;"
|
|
237
|
+
type="file"
|
|
238
|
+
[style.display]="'none'"
|
|
239
|
+
aria-hidden="true"
|
|
240
|
+
accept=".pdf, .PDF"
|
|
241
|
+
(change)="onFileSelect($event)" />
|
|
242
|
+
`, isInline: true, components: [{ type: i3.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: i6.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: i8.ToolbarFocusableDirective, selector: "[kendoPDFViewerToolbarFocusable]" }, { type: i9.ToolbarComboBoxDirective, selector: "[kendoPDFViewerComboBox]" }, { type: i6.ItemTemplateDirective, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]" }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
243
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ToolbarComponent, decorators: [{
|
|
244
|
+
type: Component,
|
|
245
|
+
args: [{
|
|
246
|
+
selector: '[toolbar]',
|
|
247
|
+
providers: [ToolbarNavigationService],
|
|
248
|
+
template: `
|
|
249
|
+
<ng-container *ngFor="let tool of tools">
|
|
250
|
+
<ng-container [ngSwitch]="tool">
|
|
251
|
+
<kendo-toolbar-input-wrapper
|
|
252
|
+
*ngSwitchCase="'pager'"
|
|
253
|
+
kendoPDFViewerToolbarFocusable
|
|
254
|
+
[toolbarTool]="pager">
|
|
255
|
+
<kendo-datapager
|
|
256
|
+
#pager
|
|
257
|
+
[attr.aria-controls]="pagesContainerId"
|
|
258
|
+
[attr.aria-label]="messageFor('page') + ' ' + (skip + 1) + ' ' + messageFor('of') + total"
|
|
259
|
+
[class.k-disabled]="disabledTools"
|
|
260
|
+
[navigable]="true"
|
|
261
|
+
[pageSize]="pageSize"
|
|
262
|
+
[skip]="skip"
|
|
263
|
+
[total]="total"
|
|
264
|
+
[pageSizeValues]="false"
|
|
265
|
+
[info]="false"
|
|
266
|
+
[type]="pagerType"
|
|
267
|
+
(pageChange)="pageChange.emit($event)">
|
|
268
|
+
<kendo-datapager-messages
|
|
269
|
+
[firstPage]="messageFor('pagerFirstPage')"
|
|
270
|
+
[previousPage]="messageFor('pagerPreviousPage')"
|
|
271
|
+
[nextPage]="messageFor('pagerNextPage')"
|
|
272
|
+
[lastPage]="messageFor('pagerLastPage')"
|
|
273
|
+
[inputLabel]="messageFor('pagerInputLabel')"
|
|
274
|
+
[pageNumberInputTitle]="messageFor('pagerInputTitle')"
|
|
275
|
+
[of]="messageFor('pagerOf')"
|
|
276
|
+
[page]="messageFor('pagerPage')"></kendo-datapager-messages>
|
|
277
|
+
</kendo-datapager>
|
|
278
|
+
</kendo-toolbar-input-wrapper>
|
|
279
|
+
<span
|
|
280
|
+
*ngSwitchCase="'spacer'"
|
|
281
|
+
class="k-spacer"></span>
|
|
282
|
+
<kendo-buttongroup
|
|
283
|
+
*ngSwitchCase="'zoomInOut'"
|
|
284
|
+
[attr.aria-controls]="pagesContainerId"
|
|
285
|
+
[navigable]="false">
|
|
286
|
+
<button
|
|
287
|
+
kendoButton
|
|
288
|
+
kendoPDFViewerToolbarFocusable
|
|
289
|
+
icon="zoom-out"
|
|
290
|
+
[disabled]="disabledTools || zoomOutDisabled"
|
|
291
|
+
[svgIcon]="zoomOutIcon"
|
|
292
|
+
[attr.title]="messageFor('zoomOutTitle')"
|
|
293
|
+
[attr.aria-label]="messageFor('zoomOutTitle')"
|
|
294
|
+
(click)="zoomOut.emit()"></button>
|
|
295
|
+
<button
|
|
296
|
+
kendoButton
|
|
297
|
+
kendoPDFViewerToolbarFocusable
|
|
298
|
+
icon="zoom-in"
|
|
299
|
+
[disabled]="disabledTools || zoomInDisabled"
|
|
300
|
+
[svgIcon]="zoomInIcon"
|
|
301
|
+
[attr.title]="messageFor('zoomInTitle')"
|
|
302
|
+
[attr.aria-label]="messageFor('zoomInTitle')"
|
|
303
|
+
(click)="zoomIn.emit()"></button>
|
|
304
|
+
</kendo-buttongroup>
|
|
305
|
+
<kendo-toolbar-input-wrapper
|
|
306
|
+
*ngSwitchCase="'zoom'"
|
|
307
|
+
kendoPDFViewerToolbarFocusable
|
|
308
|
+
[toolbarTool]="combobox">
|
|
309
|
+
<kendo-combobox
|
|
310
|
+
#combobox
|
|
311
|
+
kendoPDFViewerComboBox
|
|
312
|
+
[attr.aria-controls]="pagesContainerId"
|
|
313
|
+
[tabindex]="-1"
|
|
314
|
+
[data]="zoomOptionsData"
|
|
315
|
+
[disabled]="disabledTools"
|
|
316
|
+
[placeholder]="messageFor('zoomInputPlaceholder')"
|
|
317
|
+
textField="displayValue"
|
|
318
|
+
valueField="id"
|
|
319
|
+
[value]="zoomLevelChooserValue"
|
|
320
|
+
[allowCustom]="true"
|
|
321
|
+
(valueChange)="onZoomLevelChooserValueChange($event)">
|
|
322
|
+
<ng-template kendoComboBoxItemTemplate let-dataItem>
|
|
323
|
+
{{ dataItem.type ? messageFor('f' + dataItem.type.slice(1)) : dataItem.text }}
|
|
324
|
+
</ng-template>
|
|
325
|
+
</kendo-combobox>
|
|
326
|
+
</kendo-toolbar-input-wrapper>
|
|
327
|
+
<kendo-buttongroup
|
|
328
|
+
*ngSwitchCase="'selection'"
|
|
329
|
+
[attr.aria-controls]="pagesContainerId"
|
|
330
|
+
[navigable]="false"
|
|
331
|
+
selection="single">
|
|
332
|
+
<button
|
|
333
|
+
kendoButton
|
|
334
|
+
kendoPDFViewerToolbarFocusable
|
|
335
|
+
icon="pointer"
|
|
336
|
+
[toggleable]="true"
|
|
337
|
+
[svgIcon]="pointerIcon"
|
|
338
|
+
[attr.title]="messageFor('selectionTitle')"
|
|
339
|
+
[attr.aria-label]="messageFor('selectionTitle')"
|
|
340
|
+
(click)="selectionEnabled.emit()"></button>
|
|
341
|
+
<button
|
|
342
|
+
kendoButton
|
|
343
|
+
kendoPDFViewerToolbarFocusable
|
|
344
|
+
icon="hand"
|
|
345
|
+
[toggleable]="true"
|
|
346
|
+
[selected]="true"
|
|
347
|
+
[attr.title]="messageFor('panningTitle')"
|
|
348
|
+
[attr.aria-label]="messageFor('panningTitle')"
|
|
349
|
+
(click)="panningEnabled.emit()"></button>
|
|
350
|
+
</kendo-buttongroup>
|
|
351
|
+
<button
|
|
352
|
+
*ngSwitchCase="'search'"
|
|
353
|
+
kendoPDFViewerToolbarFocusable
|
|
354
|
+
kendoButton
|
|
355
|
+
icon="search"
|
|
356
|
+
[disabled]="disabledTools"
|
|
357
|
+
[attr.title]="messageFor('searchTitle')"
|
|
358
|
+
[attr.aria-label]="messageFor('searchTitle')"
|
|
359
|
+
aria-haspopup="dialog"
|
|
360
|
+
[svgIcon]="searchIcon"
|
|
361
|
+
(click)="search.emit()"></button>
|
|
362
|
+
<button
|
|
363
|
+
*ngSwitchCase="'open'"
|
|
364
|
+
kendoPDFViewerToolbarFocusable
|
|
365
|
+
kendoButton
|
|
366
|
+
icon="folder-open"
|
|
367
|
+
[svgIcon]="folderOpenIcon"
|
|
368
|
+
[attr.title]="messageFor('openTitle')"
|
|
369
|
+
[attr.aria-label]="messageFor('openTitle')"
|
|
370
|
+
[attr.aria-controls]="pagesContainerId"
|
|
371
|
+
(click)="fileSelectEl?.nativeElement.click()">
|
|
372
|
+
</button>
|
|
373
|
+
<button
|
|
374
|
+
*ngSwitchCase="'download'"
|
|
375
|
+
kendoPDFViewerToolbarFocusable
|
|
376
|
+
kendoButton
|
|
377
|
+
icon="download"
|
|
378
|
+
[svgIcon]="downloadIcon"
|
|
379
|
+
[disabled]="disabledTools"
|
|
380
|
+
[attr.title]="messageFor('downloadTitle')"
|
|
381
|
+
[attr.aria-label]="messageFor('downloadTitle')"
|
|
382
|
+
(click)="download.emit()"></button>
|
|
383
|
+
<button
|
|
384
|
+
*ngSwitchCase="'print'"
|
|
385
|
+
kendoPDFViewerToolbarFocusable
|
|
386
|
+
kendoButton
|
|
387
|
+
icon="print"
|
|
388
|
+
[svgIcon]="printIcon"
|
|
389
|
+
[disabled]="disabledTools"
|
|
390
|
+
[attr.title]="messageFor('printTitle')"
|
|
391
|
+
[attr.aria-label]="messageFor('printTitle')"
|
|
392
|
+
(click)="print.emit()"></button>
|
|
393
|
+
</ng-container>
|
|
394
|
+
</ng-container>
|
|
395
|
+
<input
|
|
396
|
+
#fileSelectEl
|
|
397
|
+
*ngIf="tools?.indexOf('open') > -1;"
|
|
398
|
+
type="file"
|
|
399
|
+
[style.display]="'none'"
|
|
400
|
+
aria-hidden="true"
|
|
401
|
+
accept=".pdf, .PDF"
|
|
402
|
+
(change)="onFileSelect($event)" />
|
|
403
|
+
`
|
|
404
|
+
}]
|
|
405
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.ToolbarNavigationService }]; }, propDecorators: { toolbarClass: [{
|
|
406
|
+
type: HostBinding,
|
|
407
|
+
args: ['class.k-toolbar']
|
|
408
|
+
}], toolbarSizeClass: [{
|
|
409
|
+
type: HostBinding,
|
|
410
|
+
args: ['class.k-toolbar-md']
|
|
411
|
+
}], fileSelectEl: [{
|
|
412
|
+
type: ViewChild,
|
|
413
|
+
args: ['fileSelectEl']
|
|
414
|
+
}], zoomLevel: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], calculatedComboBoxValue: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}], skip: [{
|
|
419
|
+
type: Input
|
|
420
|
+
}], pageSize: [{
|
|
421
|
+
type: Input
|
|
422
|
+
}], total: [{
|
|
423
|
+
type: Input
|
|
424
|
+
}], zoomInDisabled: [{
|
|
425
|
+
type: Input
|
|
426
|
+
}], zoomOutDisabled: [{
|
|
427
|
+
type: Input
|
|
428
|
+
}], disabledTools: [{
|
|
429
|
+
type: Input
|
|
430
|
+
}], zoomLevelChooserValue: [{
|
|
431
|
+
type: Input
|
|
432
|
+
}], zoomOptionsData: [{
|
|
433
|
+
type: Input
|
|
434
|
+
}], pagesContainerId: [{
|
|
435
|
+
type: Input
|
|
436
|
+
}], tools: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], fileSelect: [{
|
|
439
|
+
type: Output
|
|
440
|
+
}], fileSelectError: [{
|
|
441
|
+
type: Output
|
|
442
|
+
}], download: [{
|
|
443
|
+
type: Output
|
|
444
|
+
}], selectionEnabled: [{
|
|
445
|
+
type: Output
|
|
446
|
+
}], panningEnabled: [{
|
|
447
|
+
type: Output
|
|
448
|
+
}], pageChange: [{
|
|
449
|
+
type: Output
|
|
450
|
+
}], zoomIn: [{
|
|
451
|
+
type: Output
|
|
452
|
+
}], zoomOut: [{
|
|
453
|
+
type: Output
|
|
454
|
+
}], zoomLevelChange: [{
|
|
455
|
+
type: Output
|
|
456
|
+
}], print: [{
|
|
457
|
+
type: Output
|
|
458
|
+
}], search: [{
|
|
459
|
+
type: Output
|
|
460
|
+
}] } });
|
package/esm2020/util.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export const INITIAL_ZOOM_LEVEL = 1.25;
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export const MIN_ZOOM_LEVEL = 0.5;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export const MAX_ZOOM_LEVEL = 4;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export const zoomOptionsData = [{
|
|
21
|
+
id: 1,
|
|
22
|
+
text: 'Fit to width',
|
|
23
|
+
type: 'FitToWidth',
|
|
24
|
+
displayValue: '',
|
|
25
|
+
value: 1
|
|
26
|
+
}, {
|
|
27
|
+
id: 2,
|
|
28
|
+
text: 'Fit to page',
|
|
29
|
+
type: 'FitToPage',
|
|
30
|
+
displayValue: '',
|
|
31
|
+
value: 1
|
|
32
|
+
}, {
|
|
33
|
+
id: 3,
|
|
34
|
+
text: '50%',
|
|
35
|
+
displayValue: '50%',
|
|
36
|
+
value: 0.5
|
|
37
|
+
}, {
|
|
38
|
+
id: 4,
|
|
39
|
+
text: '75%',
|
|
40
|
+
displayValue: '75%',
|
|
41
|
+
value: 0.75
|
|
42
|
+
}, {
|
|
43
|
+
id: 5,
|
|
44
|
+
text: '100%',
|
|
45
|
+
displayValue: '100%',
|
|
46
|
+
value: 1
|
|
47
|
+
}, {
|
|
48
|
+
id: 6,
|
|
49
|
+
text: '125%',
|
|
50
|
+
displayValue: '125%',
|
|
51
|
+
value: 1.25
|
|
52
|
+
}, {
|
|
53
|
+
id: 7,
|
|
54
|
+
text: '150%',
|
|
55
|
+
displayValue: '150%',
|
|
56
|
+
value: 1.5
|
|
57
|
+
}, {
|
|
58
|
+
id: 8,
|
|
59
|
+
text: '200%',
|
|
60
|
+
displayValue: '200%',
|
|
61
|
+
value: 2
|
|
62
|
+
}, {
|
|
63
|
+
id: 9,
|
|
64
|
+
text: '300%',
|
|
65
|
+
displayValue: '300%',
|
|
66
|
+
value: 3
|
|
67
|
+
}, {
|
|
68
|
+
id: 10,
|
|
69
|
+
text: '400%',
|
|
70
|
+
displayValue: '400%',
|
|
71
|
+
value: 4
|
|
72
|
+
}];
|