@vaadin-component-factory/vcf-pdf-viewer 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -245,6 +245,10 @@ class PdfViewerElement extends
245
245
  margin: 0;
246
246
  }
247
247
 
248
+ [part~="toolbar"].ready [part~="toolbar-zoom"].hide-zoom {
249
+ display: none;
250
+ }
251
+
248
252
  </style>
249
253
 
250
254
  <div id="outerContainer" part="outer-container" >
@@ -303,7 +307,7 @@ class PdfViewerElement extends
303
307
  }
304
308
 
305
309
  static get version() {
306
- return '1.1.1';
310
+ return '1.3.0';
307
311
  }
308
312
 
309
313
  static get properties() {
@@ -417,17 +421,45 @@ class PdfViewerElement extends
417
421
  type: String,
418
422
  value: "Page fit"
419
423
  },
424
+
425
+ /**
426
+ * Property to define a custom title for the viewer
427
+ */
428
+ customTitle: {
429
+ type: String,
430
+ value: ""
431
+ },
432
+
433
+ /**
434
+ * Renders interactive form elements in the annotation layer (html) if true,
435
+ * renders values of form elements directly onto the canvas if false
436
+ */
437
+ renderInteractiveForms: {
438
+ type: Boolean,
439
+ value: true
440
+ },
441
+
442
+ /**
443
+ * Allows to hide the zoom dropdown. By default it's always shown.
444
+ */
445
+ hideZoom: {
446
+ type: Boolean,
447
+ value: false
448
+ },
420
449
  };
421
450
  }
422
451
 
423
452
  static get observers() {
424
453
  return [
425
- '__setTitle(__pdfTitle, __filename)'
454
+ '__setTitle(__pdfTitle, __filename)',
455
+ '__updateZoomVisibility()'
426
456
  ];
427
457
  }
428
458
 
429
459
  __setTitle(pdfTitle, filename) {
430
- if(this.__viewer && this.toolbarOnlyFilename && filename) {
460
+ if(this.customTitle){
461
+ this.__title = this.customTitle;
462
+ } else if(this.__viewer && this.toolbarOnlyFilename && filename) {
431
463
  this.__title = filename;
432
464
  } else if (pdfTitle && filename) {
433
465
  this.__title = pdfTitle + ' - ' + filename;
@@ -440,6 +472,14 @@ class PdfViewerElement extends
440
472
  }
441
473
  }
442
474
 
475
+ __updateZoomVisibility() {
476
+ if(this.hideZoom) {
477
+ this.$.zoom.classList.add('hide-zoom');
478
+ } else {
479
+ this.$.zoom.classList.remove('hide-zoom');
480
+ }
481
+ }
482
+
443
483
  ready() {
444
484
  super.ready();
445
485
  this.$.viewerContainer.addEventListener('focus', e => this.__setFocused(true), true);
@@ -469,7 +509,8 @@ class PdfViewerElement extends
469
509
  eventBus: eventBus,
470
510
  linkService: this.__linkService,
471
511
  renderingQueue: pdfRenderingQueue,
472
- l10n: l10n
512
+ l10n: l10n,
513
+ renderInteractiveForms: this.renderInteractiveForms
473
514
  });
474
515
 
475
516
  this.__linkService.setViewer(this.__viewer);
@@ -514,7 +555,7 @@ class PdfViewerElement extends
514
555
 
515
556
  connectedCallback() {
516
557
  super.connectedCallback();
517
- this.__recalculateSizes();
558
+ this.__recalculateSizes();
518
559
  }
519
560
 
520
561
  __updateCurrentPageValue(pageNumber){