@alfresco/adf-core 8.0.3 → 8.0.4

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, RendererFactory2, Optional, Inject, NgModule, HostBinding, Pipe, InjectionToken, provideAppInitializer, EventEmitter, HostListener, ViewChild, Output, ElementRef, ViewChildren, DestroyRef, QueryList, DEFAULT_CURRENCY_CODE, SecurityContext, ViewContainerRef, forwardRef, Compiler, Injector } from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, RendererFactory2, Optional, Inject, NgModule, HostBinding, Pipe, InjectionToken, provideAppInitializer, EventEmitter, HostListener, ViewChild, Output, ViewChildren, DestroyRef, QueryList, DEFAULT_CURRENCY_CODE, SecurityContext, ElementRef, ViewContainerRef, forwardRef, Compiler, Injector } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT, NgIf, NgClass, NgForOf, AsyncPipe, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, DecimalPipe, DatePipe, NgFor } from '@angular/common';
5
5
  import * as i2 from '@angular/material/table';
@@ -35,7 +35,7 @@ import * as i3 from '@angular/material/progress-spinner';
35
35
  import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
36
36
  import Cropper from 'cropperjs';
37
37
  import * as i1$4 from '@angular/platform-browser';
38
- import { DomSanitizer, By } from '@angular/platform-browser';
38
+ import { By } from '@angular/platform-browser';
39
39
  import * as i2$6 from '@alfresco/adf-core/api';
40
40
  import { AdfHttpClient } from '@alfresco/adf-core/api';
41
41
  import * as i1$5 from '@angular/material/toolbar';
@@ -4549,9 +4549,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
4549
4549
  }] });
4550
4550
 
4551
4551
  class PdfThumbComponent {
4552
- constructor() {
4553
- this.sanitizer = inject(DomSanitizer);
4554
- this.element = inject(ElementRef);
4552
+ constructor(sanitizer, element) {
4553
+ this.sanitizer = sanitizer;
4554
+ this.element = element;
4555
+ this.page = null;
4555
4556
  }
4556
4557
  ngOnInit() {
4557
4558
  this.image$ = this.page.getPage().then((page) => this.getThumb(page));
@@ -4579,13 +4580,13 @@ class PdfThumbComponent {
4579
4580
  canvas.height = this.page.getHeight();
4580
4581
  return canvas;
4581
4582
  }
4582
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4583
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbComponent, deps: [{ token: i1$4.DomSanitizer }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
4583
4584
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: PdfThumbComponent, isStandalone: true, selector: "adf-pdf-thumb", inputs: { page: "page" }, host: { attributes: { "tabindex": "0" } }, ngImport: i0, template: "<ng-container *ngIf=\"image$ | async as image\">\n <img [src]=\"image\" role=\"button\"\n [alt]=\"'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id }\"\n title=\"{{ 'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id } }}\"\n [attr.aria-label]=\"'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id }\">\n</ng-container>\n", dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None }); }
4584
4585
  }
4585
4586
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbComponent, decorators: [{
4586
4587
  type: Component,
4587
4588
  args: [{ selector: 'adf-pdf-thumb', encapsulation: ViewEncapsulation.None, imports: [AsyncPipe, TranslatePipe, NgIf], host: { tabindex: '0' }, template: "<ng-container *ngIf=\"image$ | async as image\">\n <img [src]=\"image\" role=\"button\"\n [alt]=\"'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id }\"\n title=\"{{ 'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id } }}\"\n [attr.aria-label]=\"'ADF_VIEWER.SIDEBAR.THUMBNAILS.PAGE' | translate: { pageNum: page.id }\">\n</ng-container>\n" }]
4588
- }], propDecorators: { page: [{
4589
+ }], ctorParameters: () => [{ type: i1$4.DomSanitizer }, { type: i0.ElementRef }], propDecorators: { page: [{
4589
4590
  type: Input
4590
4591
  }] } });
4591
4592
 
@@ -4606,20 +4607,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
4606
4607
  * limitations under the License.
4607
4608
  */
4608
4609
  class PdfThumbListComponent {
4609
- constructor() {
4610
- this.element = inject(ElementRef);
4611
- this.document = inject(DOCUMENT);
4612
- this.close = new EventEmitter();
4613
- this.virtualHeight = 0;
4614
- this.translateY = 0;
4615
- this.renderItems = [];
4616
- this.width = 91;
4617
- this.currentHeight = 0;
4618
- this.items = [];
4619
- this.margin = 15;
4620
- this.itemHeight = 114 + this.margin;
4621
- this.previouslyFocusedElement = null;
4622
- }
4623
4610
  onKeydown(event) {
4624
4611
  const keyCode = event.keyCode;
4625
4612
  if (keyCode === UP_ARROW && this.canSelectPreviousItem()) {
@@ -4645,9 +4632,23 @@ class PdfThumbListComponent {
4645
4632
  onResize() {
4646
4633
  this.calculateItems();
4647
4634
  }
4648
- ngOnInit() {
4635
+ constructor(element, document) {
4636
+ this.element = element;
4637
+ this.document = document;
4638
+ this.close = new EventEmitter();
4639
+ this.virtualHeight = 0;
4640
+ this.translateY = 0;
4641
+ this.renderItems = [];
4642
+ this.width = 91;
4643
+ this.currentHeight = 0;
4644
+ this.items = [];
4645
+ this.margin = 15;
4646
+ this.itemHeight = 114 + this.margin;
4647
+ this.previouslyFocusedElement = null;
4649
4648
  this.calculateItems = this.calculateItems.bind(this);
4650
4649
  this.onPageChange = this.onPageChange.bind(this);
4650
+ }
4651
+ ngOnInit() {
4651
4652
  /* cspell:disable-next-line */
4652
4653
  this.pdfViewer.eventBus.on('pagechanging', this.onPageChange);
4653
4654
  this.element.nativeElement.addEventListener('scroll', this.calculateItems, true);
@@ -4673,6 +4674,9 @@ class PdfThumbListComponent {
4673
4674
  this.previouslyFocusedElement = null;
4674
4675
  }
4675
4676
  }
4677
+ trackByFn(_, item) {
4678
+ return item.id;
4679
+ }
4676
4680
  isSelected(pageNumber) {
4677
4681
  return this.pdfViewer.currentPageNumber === pageNumber;
4678
4682
  }
@@ -4749,13 +4753,16 @@ class PdfThumbListComponent {
4749
4753
  canSelectPreviousItem() {
4750
4754
  return this.pdfViewer.currentPageNumber !== 1;
4751
4755
  }
4752
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4753
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: PdfThumbListComponent, isStandalone: true, selector: "adf-pdf-thumbnails", inputs: { pdfViewer: "pdfViewer" }, outputs: { close: "close" }, host: { listeners: { "keydown": "onKeydown($event)", "window:resize": "onResize()" }, classAttribute: "adf-pdf-thumbnails" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "thumbsList", predicate: PdfThumbComponent, descendants: true }], ngImport: i0, template: "<div class=\"adf-pdf-thumbnails__content\"\n data-automation-id='adf-thumbnails-content'\n [style.height.px]=\"virtualHeight\"\n [style.transform]=\"'translate(-50%, ' + translateY + 'px)'\">\n @for (page of renderItems; track page.id) {\n <adf-pdf-thumb\n class=\"adf-pdf-thumbnails__thumb\"\n [id]=\"page.id\"\n [ngClass]=\"{'adf-pdf-thumbnails__thumb--selected' : isSelected(page.id)}\"\n [page]=\"page\"\n (click)=\"goTo(page.id)\" />\n }\n</div>\n", styles: [".adf-pdf-thumbnails{display:block;overflow:hidden;overflow-y:auto;height:100%;position:relative}.adf-pdf-thumbnails__content{top:5px;left:50%;height:0;position:absolute}.adf-pdf-thumbnails__thumb{cursor:pointer;display:block;width:91px;background:var(--theme-background-color);margin-bottom:15px}.adf-pdf-thumbnails__thumb:hover{box-shadow:0 0 5px 0 var(--adf-theme-foreground-text-color-087)}.adf-pdf-thumbnails__thumb--selected{border:2px solid var(--theme-accent-color-a200)}\n"], dependencies: [{ kind: "component", type: PdfThumbComponent, selector: "adf-pdf-thumb", inputs: ["page"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None }); }
4756
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbListComponent, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
4757
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: PdfThumbListComponent, isStandalone: true, selector: "adf-pdf-thumbnails", inputs: { pdfViewer: "pdfViewer" }, outputs: { close: "close" }, host: { listeners: { "keydown": "onKeydown($event)", "window:resize": "onResize()" }, classAttribute: "adf-pdf-thumbnails" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "thumbsList", predicate: PdfThumbComponent, descendants: true }], ngImport: i0, template: "<div class=\"adf-pdf-thumbnails__content\"\n data-automation-id='adf-thumbnails-content'\n [style.height.px]=\"virtualHeight\"\n [style.transform]=\"'translate(-50%, ' + translateY + 'px)'\">\n <adf-pdf-thumb *ngFor=\"let page of renderItems; trackBy: trackByFn\"\n class=\"adf-pdf-thumbnails__thumb\"\n [id]=\"page.id\"\n [ngClass]=\"{'adf-pdf-thumbnails__thumb--selected' : isSelected(page.id)}\"\n [page]=\"page\"\n (click)=\"goTo(page.id)\" />\n</div>\n", styles: [".adf-pdf-thumbnails{display:block;overflow:hidden;overflow-y:auto;height:100%;position:relative}.adf-pdf-thumbnails__content{top:5px;left:50%;height:0;position:absolute}.adf-pdf-thumbnails__thumb{cursor:pointer;display:block;width:91px;background:var(--theme-background-color);margin-bottom:15px}.adf-pdf-thumbnails__thumb:hover{box-shadow:0 0 5px 0 var(--adf-theme-foreground-text-color-087)}.adf-pdf-thumbnails__thumb--selected{border:2px solid var(--theme-accent-color-a200)}\n"], dependencies: [{ kind: "component", type: PdfThumbComponent, selector: "adf-pdf-thumb", inputs: ["page"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None }); }
4754
4758
  }
4755
4759
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbListComponent, decorators: [{
4756
4760
  type: Component,
4757
- args: [{ selector: 'adf-pdf-thumbnails', host: { class: 'adf-pdf-thumbnails' }, imports: [PdfThumbComponent, NgClass], encapsulation: ViewEncapsulation.None, template: "<div class=\"adf-pdf-thumbnails__content\"\n data-automation-id='adf-thumbnails-content'\n [style.height.px]=\"virtualHeight\"\n [style.transform]=\"'translate(-50%, ' + translateY + 'px)'\">\n @for (page of renderItems; track page.id) {\n <adf-pdf-thumb\n class=\"adf-pdf-thumbnails__thumb\"\n [id]=\"page.id\"\n [ngClass]=\"{'adf-pdf-thumbnails__thumb--selected' : isSelected(page.id)}\"\n [page]=\"page\"\n (click)=\"goTo(page.id)\" />\n }\n</div>\n", styles: [".adf-pdf-thumbnails{display:block;overflow:hidden;overflow-y:auto;height:100%;position:relative}.adf-pdf-thumbnails__content{top:5px;left:50%;height:0;position:absolute}.adf-pdf-thumbnails__thumb{cursor:pointer;display:block;width:91px;background:var(--theme-background-color);margin-bottom:15px}.adf-pdf-thumbnails__thumb:hover{box-shadow:0 0 5px 0 var(--adf-theme-foreground-text-color-087)}.adf-pdf-thumbnails__thumb--selected{border:2px solid var(--theme-accent-color-a200)}\n"] }]
4758
- }], propDecorators: { pdfViewer: [{
4761
+ args: [{ selector: 'adf-pdf-thumbnails', host: { class: 'adf-pdf-thumbnails' }, imports: [PdfThumbComponent, NgClass, NgForOf], encapsulation: ViewEncapsulation.None, template: "<div class=\"adf-pdf-thumbnails__content\"\n data-automation-id='adf-thumbnails-content'\n [style.height.px]=\"virtualHeight\"\n [style.transform]=\"'translate(-50%, ' + translateY + 'px)'\">\n <adf-pdf-thumb *ngFor=\"let page of renderItems; trackBy: trackByFn\"\n class=\"adf-pdf-thumbnails__thumb\"\n [id]=\"page.id\"\n [ngClass]=\"{'adf-pdf-thumbnails__thumb--selected' : isSelected(page.id)}\"\n [page]=\"page\"\n (click)=\"goTo(page.id)\" />\n</div>\n", styles: [".adf-pdf-thumbnails{display:block;overflow:hidden;overflow-y:auto;height:100%;position:relative}.adf-pdf-thumbnails__content{top:5px;left:50%;height:0;position:absolute}.adf-pdf-thumbnails__thumb{cursor:pointer;display:block;width:91px;background:var(--theme-background-color);margin-bottom:15px}.adf-pdf-thumbnails__thumb:hover{box-shadow:0 0 5px 0 var(--adf-theme-foreground-text-color-087)}.adf-pdf-thumbnails__thumb--selected{border:2px solid var(--theme-accent-color-a200)}\n"] }]
4762
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
4763
+ type: Inject,
4764
+ args: [DOCUMENT]
4765
+ }] }], propDecorators: { pdfViewer: [{
4759
4766
  type: Input,
4760
4767
  args: [{ required: true }]
4761
4768
  }], close: [{
@@ -4946,7 +4953,7 @@ class PdfViewerComponent {
4946
4953
  viewer,
4947
4954
  renderingQueue: this.renderingQueueServices,
4948
4955
  eventBus: this.eventBus,
4949
- annotationMode: 0
4956
+ annotationMode: 1
4950
4957
  });
4951
4958
  // cspell: disable-next
4952
4959
  this.eventBus.on('pagechanging', this.onPageChange);