@alfresco/adf-core 8.0.2 → 8.0.3-A.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.
@@ -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, ViewChildren, DestroyRef, QueryList, DEFAULT_CURRENCY_CODE, SecurityContext, ElementRef, 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, ElementRef, ViewChildren, DestroyRef, QueryList, DEFAULT_CURRENCY_CODE, SecurityContext, 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 { By } from '@angular/platform-browser';
38
+ import { DomSanitizer, 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,10 +4549,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
4549
4549
  }] });
4550
4550
 
4551
4551
  class PdfThumbComponent {
4552
- constructor(sanitizer, element) {
4553
- this.sanitizer = sanitizer;
4554
- this.element = element;
4555
- this.page = null;
4552
+ constructor() {
4553
+ this.sanitizer = inject(DomSanitizer);
4554
+ this.element = inject(ElementRef);
4556
4555
  }
4557
4556
  ngOnInit() {
4558
4557
  this.image$ = this.page.getPage().then((page) => this.getThumb(page));
@@ -4580,13 +4579,13 @@ class PdfThumbComponent {
4580
4579
  canvas.height = this.page.getHeight();
4581
4580
  return canvas;
4582
4581
  }
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 }); }
4582
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4584
4583
  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 }); }
4585
4584
  }
4586
4585
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbComponent, decorators: [{
4587
4586
  type: Component,
4588
4587
  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" }]
4589
- }], ctorParameters: () => [{ type: i1$4.DomSanitizer }, { type: i0.ElementRef }], propDecorators: { page: [{
4588
+ }], propDecorators: { page: [{
4590
4589
  type: Input
4591
4590
  }] } });
4592
4591
 
@@ -4607,6 +4606,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
4607
4606
  * limitations under the License.
4608
4607
  */
4609
4608
  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
+ }
4610
4623
  onKeydown(event) {
4611
4624
  const keyCode = event.keyCode;
4612
4625
  if (keyCode === UP_ARROW && this.canSelectPreviousItem()) {
@@ -4632,23 +4645,9 @@ class PdfThumbListComponent {
4632
4645
  onResize() {
4633
4646
  this.calculateItems();
4634
4647
  }
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;
4648
+ ngOnInit() {
4648
4649
  this.calculateItems = this.calculateItems.bind(this);
4649
4650
  this.onPageChange = this.onPageChange.bind(this);
4650
- }
4651
- ngOnInit() {
4652
4651
  /* cspell:disable-next-line */
4653
4652
  this.pdfViewer.eventBus.on('pagechanging', this.onPageChange);
4654
4653
  this.element.nativeElement.addEventListener('scroll', this.calculateItems, true);
@@ -4674,9 +4673,6 @@ class PdfThumbListComponent {
4674
4673
  this.previouslyFocusedElement = null;
4675
4674
  }
4676
4675
  }
4677
- trackByFn(_, item) {
4678
- return item.id;
4679
- }
4680
4676
  isSelected(pageNumber) {
4681
4677
  return this.pdfViewer.currentPageNumber === pageNumber;
4682
4678
  }
@@ -4753,16 +4749,13 @@ class PdfThumbListComponent {
4753
4749
  canSelectPreviousItem() {
4754
4750
  return this.pdfViewer.currentPageNumber !== 1;
4755
4751
  }
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 }); }
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 }); }
4758
4754
  }
4759
4755
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: PdfThumbListComponent, decorators: [{
4760
4756
  type: Component,
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: [{
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: [{
4766
4759
  type: Input,
4767
4760
  args: [{ required: true }]
4768
4761
  }], close: [{