@vaadin-component-factory/vcf-pdf-viewer 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/pdfjs/dist/display_utils.js +714 -714
- package/pdfjs/dist/fetch_stream.js +293 -293
- package/pdfjs/dist/l10n_utils.js +122 -122
- package/pdfjs/dist/message_handler.js +524 -524
- package/pdfjs/dist/network.js +552 -552
- package/pdfjs/dist/network_utils.js +309 -309
- package/pdfjs/dist/node_stream.js +481 -481
- package/pdfjs/dist/pdf_link_service.js +534 -534
- package/pdfjs/dist/pdf_rendering_queue.js +154 -154
- package/pdfjs/dist/pdf_thumbnail_viewer.js +738 -738
- package/pdfjs/dist/pdf_viewer.js +3207 -3207
- package/pdfjs/dist/ui_utils.js +881 -881
- package/pdfjs/dist/util.js +991 -991
- package/pdfjs/dist/worker.js +60846 -60846
- package/src/vcf-pdf-viewer.js +48 -8
- package/theme/lumo/vcf-pdf-viewer-styles.js +6 -6
- package/theme/material/vcf-pdf-viewer-styles.js +4 -4
package/src/vcf-pdf-viewer.js
CHANGED
|
@@ -5,6 +5,8 @@ import '@vaadin/polymer-legacy-adapter/template-renderer.js';
|
|
|
5
5
|
import '@vaadin/text-field';
|
|
6
6
|
import '@vaadin/select';
|
|
7
7
|
import '@vaadin/item';
|
|
8
|
+
import '@vaadin/button';
|
|
9
|
+
import '@vaadin/icon';
|
|
8
10
|
|
|
9
11
|
import * as pdfjsLib from '../pdfjs/dist/pdf';
|
|
10
12
|
import * as pdfjsViewer from '../pdfjs/dist/pdf_viewer';
|
|
@@ -235,6 +237,12 @@ class PdfViewerElement extends
|
|
|
235
237
|
margin-right: 15px;
|
|
236
238
|
border: 2px solid;
|
|
237
239
|
border-color: rgba(0, 0, 0, 0.5);
|
|
240
|
+
width: 40px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
#nextPage, #previousPage {
|
|
244
|
+
width: 30px;
|
|
245
|
+
margin: 0;
|
|
238
246
|
}
|
|
239
247
|
|
|
240
248
|
</style>
|
|
@@ -247,13 +255,15 @@ class PdfViewerElement extends
|
|
|
247
255
|
</div>
|
|
248
256
|
<div id="mainContainer" part="main-container">
|
|
249
257
|
<div id="toolbar" part="toolbar">
|
|
250
|
-
<button id="sidebarToggle" part="toolbar-button toolbar-button-toogle-sidebar" on-click="__toogleSidebar"
|
|
258
|
+
<vaadin-button id="sidebarToggle" part="toolbar-button toolbar-button-toogle-sidebar" theme="icon" on-click="__toogleSidebar">
|
|
259
|
+
<vaadin-icon part="toggle-button-icon" slot="prefix"></vaadin-icon>
|
|
260
|
+
</vaadin-button>
|
|
251
261
|
<span id="title" part="toolbar-text toolbar-title">{{__title}}</span>
|
|
252
262
|
<vaadin-select id="zoom" part="toolbar-zoom" value="{{zoom}}">
|
|
253
263
|
<template>
|
|
254
264
|
<vaadin-list-box>
|
|
255
|
-
<vaadin-item value='auto'>
|
|
256
|
-
<vaadin-item value='page-fit'>
|
|
265
|
+
<vaadin-item value='auto'>{{autoZoomOptionLabel}}</vaadin-item>
|
|
266
|
+
<vaadin-item value='page-fit'>{{fitZoomOptionLabel}}</vaadin-item>
|
|
257
267
|
<vaadin-item value='0.5'>50%</vaadin-item>
|
|
258
268
|
<vaadin-item value='0.75'>75%</vaadin-item>
|
|
259
269
|
<vaadin-item value='1.0'>100%</vaadin-item>
|
|
@@ -269,8 +279,12 @@ class PdfViewerElement extends
|
|
|
269
279
|
<vaadin-text-field id="currentPage" part="toolbar-current-page" value="{{currentPage}}" on-change="__pageChange"></vaadin-text-field>
|
|
270
280
|
<span id="pageSeparator" part="toolbar-text toolbar-page-separator">/</span>
|
|
271
281
|
<span id="totalPages" part="toolbar-text toolbar-total-pages">{{__totalPages}}</span>
|
|
272
|
-
<button id="previousPage" part="toolbar-button toolbar-button-previous-page" on-click="__previousPage"
|
|
273
|
-
|
|
282
|
+
<vaadin-button id="previousPage" part="toolbar-button toolbar-button-previous-page" theme="icon" on-click="__previousPage">
|
|
283
|
+
<vaadin-icon part="previous-page-button-icon" slot="prefix"></vaadin-icon>
|
|
284
|
+
</vaadin-button>
|
|
285
|
+
<vaadin-button id="nextPage" part="toolbar-button toolbar-button-next-page" theme="icon" on-click="__nextPage">
|
|
286
|
+
<vaadin-icon part="next-page-button-icon" slot="prefix"></vaadin-icon>
|
|
287
|
+
</vaadin-button>
|
|
274
288
|
</div>
|
|
275
289
|
<slot></slot>
|
|
276
290
|
</div>
|
|
@@ -289,7 +303,7 @@ class PdfViewerElement extends
|
|
|
289
303
|
}
|
|
290
304
|
|
|
291
305
|
static get version() {
|
|
292
|
-
return '1.
|
|
306
|
+
return '1.1.1';
|
|
293
307
|
}
|
|
294
308
|
|
|
295
309
|
static get properties() {
|
|
@@ -379,6 +393,30 @@ class PdfViewerElement extends
|
|
|
379
393
|
type: Boolean,
|
|
380
394
|
value: false
|
|
381
395
|
},
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Flag to indicate if toolbar should only show filename as title
|
|
399
|
+
*/
|
|
400
|
+
toolbarOnlyFilename: {
|
|
401
|
+
type: Boolean,
|
|
402
|
+
value: false
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Property to define auto zoom label
|
|
407
|
+
*/
|
|
408
|
+
autoZoomOptionLabel: {
|
|
409
|
+
type: String,
|
|
410
|
+
value: "Automatic zoom"
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Property to define page fit zoom label
|
|
415
|
+
*/
|
|
416
|
+
fitZoomOptionLabel: {
|
|
417
|
+
type: String,
|
|
418
|
+
value: "Page fit"
|
|
419
|
+
},
|
|
382
420
|
};
|
|
383
421
|
}
|
|
384
422
|
|
|
@@ -389,7 +427,9 @@ class PdfViewerElement extends
|
|
|
389
427
|
}
|
|
390
428
|
|
|
391
429
|
__setTitle(pdfTitle, filename) {
|
|
392
|
-
if
|
|
430
|
+
if(this.__viewer && this.toolbarOnlyFilename && filename) {
|
|
431
|
+
this.__title = filename;
|
|
432
|
+
} else if (pdfTitle && filename) {
|
|
393
433
|
this.__title = pdfTitle + ' - ' + filename;
|
|
394
434
|
} else if (pdfTitle) {
|
|
395
435
|
this.__title = pdfTitle;
|
|
@@ -398,7 +438,7 @@ class PdfViewerElement extends
|
|
|
398
438
|
} else {
|
|
399
439
|
this.__title = 'PDF';
|
|
400
440
|
}
|
|
401
|
-
|
|
441
|
+
}
|
|
402
442
|
|
|
403
443
|
ready() {
|
|
404
444
|
super.ready();
|
|
@@ -81,7 +81,7 @@ registerStyles(
|
|
|
81
81
|
padding-top: 0.2em;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
[part~="toolbar-button"]
|
|
84
|
+
[part~="toolbar-button"][disabled] {
|
|
85
85
|
color: var(--lumo-contrast-40pct);
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -90,7 +90,7 @@ registerStyles(
|
|
|
90
90
|
color: var(--lumo-contrast-80pct);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
[part~="toolbar-button"]
|
|
93
|
+
[part~="toolbar-button"][disabled]:hover {
|
|
94
94
|
background-color: transparent;
|
|
95
95
|
color: var(--lumo-contrast-40pct);
|
|
96
96
|
}
|
|
@@ -105,19 +105,19 @@ registerStyles(
|
|
|
105
105
|
font-size: var(--lumo-icon-size-m);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
[part~="
|
|
108
|
+
[part~="previous-page-button-icon"]::before {
|
|
109
109
|
content: var(--lumo-icons-angle-up);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
[part~="
|
|
112
|
+
[part~="next-page-button-icon"]::before {
|
|
113
113
|
content: var(--lumo-icons-angle-down);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
[part~="
|
|
116
|
+
[part~="toggle-button-icon"]::before {
|
|
117
117
|
content: var(--lumo-icons-chevron-right);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
#outerContainer.sidebarOpen [part~="
|
|
120
|
+
#outerContainer.sidebarOpen [part~="toggle-button-icon"]::before {
|
|
121
121
|
content: var(--lumo-icons-chevron-left);
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -75,7 +75,7 @@ registerStyles(
|
|
|
75
75
|
opacity: 0.7;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
[part~="toolbar-button"]
|
|
78
|
+
[part~="toolbar-button"][disabled] {
|
|
79
79
|
opacity: 0.4;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -83,15 +83,15 @@ registerStyles(
|
|
|
83
83
|
opacity: 1;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
[part~="toolbar-button"]
|
|
86
|
+
[part~="toolbar-button"][disabled]:hover {
|
|
87
87
|
opacity: 0.4;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
[part~="
|
|
90
|
+
[part~="previous-page-button-icon"]::before {
|
|
91
91
|
content: url('baseline-keyboard_arrow_up-24px.svg');
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
[part~="
|
|
94
|
+
[part~="next-page-button-icon"]::before {
|
|
95
95
|
content: url('baseline-keyboard_arrow_down-24px.svg');
|
|
96
96
|
}
|
|
97
97
|
|