@wizishop/img-manager 15.2.40 → 15.2.42

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,18 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, EventEmitter, Directive, Input, Output, Pipe, Component, ViewEncapsulation, HostBinding, HostListener, ViewChild, Inject, NgModule } from '@angular/core';
3
- import { BehaviorSubject, Subject, tap, Observable, of, delay, forkJoin, combineLatest } from 'rxjs';
3
+ import { BehaviorSubject, Subject, tap, Observable, merge, debounceTime, distinctUntilChanged, switchMap, map, forkJoin, take as take$1, startWith, shareReplay, combineLatest } from 'rxjs';
4
4
  import * as i3 from '@ngx-translate/core';
5
5
  import { TranslateModule } from '@ngx-translate/core';
6
6
  import * as i1 from '@wizishop/ng-wizi-bulma';
7
7
  import { NwbAllModule } from '@wizishop/ng-wizi-bulma';
8
- import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap as tap$1 } from 'rxjs/operators';
8
+ import { take, map as map$1, takeUntil, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, tap as tap$1, filter } from 'rxjs/operators';
9
9
  import * as i2 from '@angular/common';
10
10
  import { DOCUMENT, CommonModule } from '@angular/common';
11
11
  import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
12
- import * as i4 from 'ngx-scrollbar';
13
- import { NgScrollbarModule } from 'ngx-scrollbar';
14
12
  import * as i3$1 from '@angular/common/http';
15
13
  import { HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
14
+ import * as i4 from 'ngx-scrollbar';
15
+ import { NgScrollbarModule } from 'ngx-scrollbar';
16
16
  import * as i2$1 from '@angular/forms';
17
17
  import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
18
18
  import * as i3$2 from '@angular/router';
@@ -409,58 +409,9 @@ const easeInOut = // the fade-in/fade-out animation.
409
409
  ]),
410
410
  ]);
411
411
 
412
- class RenamePictureService {
413
- constructor(apiService, alertService) {
414
- this.apiService = apiService;
415
- this.alertService = alertService;
416
- this.picturesList = [];
417
- this.errorRenameImg = 'ImgManager.ImgList.errorRenameImg';
418
- this.msgSavingImgName = 'ImgManager.ImgLib.savingImgName';
419
- this.msgImgNameSaved = 'ImgManager.ImgLib.imgNameSaved';
420
- }
421
- setPicturesList(picturesList) {
422
- this.picturesList = picturesList;
423
- }
424
- renamePicture(pictureNameUpdate) {
425
- const picture = this.getPictureById(pictureNameUpdate.id);
426
- if (!picture) {
427
- this.alertService.openAlert(this.errorRenameImg);
428
- return;
429
- }
430
- this.alertService.openAlert(this.msgSavingImgName);
431
- this.apiService
432
- .changeImgName(picture.display_name, picture.id_file)
433
- .subscribe((data) => {
434
- picture.display_name = data.display_name;
435
- this.alertService.openAlert(this.msgImgNameSaved);
436
- }, () => {
437
- picture.display_name = pictureNameUpdate.previousName;
438
- this.alertService.openAlert(this.errorRenameImg);
439
- });
440
- }
441
- changeImageName(name, idFile) {
442
- return this.apiService.changeImgName(name, idFile);
443
- }
444
- getPictureById(id_file) {
445
- if (!this.picturesList) {
446
- return;
447
- }
448
- for (const picture of this.picturesList) {
449
- if (picture.id_file === id_file) {
450
- return picture;
451
- }
452
- }
453
- return null;
454
- }
455
- }
456
- RenamePictureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, deps: [{ token: ApiService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Injectable });
457
- RenamePictureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService });
458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, decorators: [{
459
- type: Injectable
460
- }], ctorParameters: function () { return [{ type: ApiService }, { type: AlertService }]; } });
461
-
462
412
  class ImgManagerService {
463
413
  constructor() {
414
+ this.uploadService = inject(UploadService);
464
415
  this.params = new HttpParams().set("limit", "20").set("page", "1");
465
416
  // Display the img selection
466
417
  this.pageFicheProductConfig = {
@@ -501,47 +452,57 @@ class ImgManagerService {
501
452
  displayBtn: false
502
453
  };
503
454
  this.apiService = inject(ApiService);
455
+ this.destroy$ = new Subject();
456
+ this.searchImagesParameters$ = new BehaviorSubject(this.DEFAULT_SEARCH_PARAMS);
457
+ this.refreshImageList$ = new Subject();
458
+ this.resetImageList$ = merge(this.uploadService.imageUploaded$);
459
+ this.isLoading$ = new BehaviorSubject(true);
460
+ this.fetchImagesList$ = merge(this.searchImagesParameters$.pipe(debounceTime(800), distinctUntilChanged()), this.refreshImageList$.pipe(switchMap(() => this.searchImagesParameters$))).pipe(map((params) => this.getHttpParameters(params)), tap(() => this.isLoading$.next(true)), switchMap((params) => forkJoin({
461
+ imageList: this.apiService.getShopImgList(params).pipe(take$1(1)),
462
+ imageTotal: this.apiService.getShopTotalImgList(params).pipe(take$1(1))
463
+ })), tap(() => this.isLoading$.next(false)));
464
+ this.imageList$ = merge(this.fetchImagesList$, this.resetImageList$.pipe(tap(() => this.isLoading$.next(true)), tap(() => this.searchImagesParameters$.next(this.DEFAULT_SEARCH_PARAMS)), map(() => this.DEFAULT_DATA_LIST))).pipe(startWith(this.DEFAULT_DATA_LIST), shareReplay(1));
465
+ }
466
+ get DEFAULT_SEARCH_PARAMS() {
467
+ return {
468
+ limit: '30',
469
+ page: '1',
470
+ };
504
471
  }
505
- getShopImgList(params, forceToUpdate = false) {
506
- if (!forceToUpdate &&
507
- params && this.previousParams && this.previousParams.limit === params.limit
508
- && this.previousParams.page === params.page && this.shopImgList
509
- && this.previousParams.search === params.search) {
510
- return of(this.shopImgList).pipe(delay(0));
511
- }
512
- const httpParams = params ? this.resetParams(params) : undefined;
513
- return this.apiService.getShopImgList(httpParams).pipe(tap((shopImgList) => {
514
- this.shopImgList = shopImgList;
515
- this.previousParams = params;
516
- }));
517
- ;
518
- }
519
- getShopTotalImgList(params) {
520
- const httpParams = params ? this.resetParams(params) : undefined;
521
- return this.apiService.getShopTotalImgList(httpParams);
522
- }
523
- getShopImg(idFile) {
524
- return this.apiService.getShopImg(idFile);
472
+ get DEFAULT_DATA_LIST() {
473
+ return {
474
+ imageList: {
475
+ data: [],
476
+ filter: [],
477
+ limit: 0,
478
+ page: 0,
479
+ totalRecords: 0
480
+ },
481
+ imageTotal: 0
482
+ };
525
483
  }
526
- resetParams(params) {
527
- this.params = new HttpParams();
528
- this.params = this.params.set('id_file:sort', 'desc');
484
+ getHttpParameters(params) {
485
+ let parameters = new HttpParams();
486
+ parameters = parameters.set('id_file:sort', 'desc');
529
487
  for (const param in params) {
530
- this.params = this.params.set(param, params[param]);
488
+ parameters = parameters.set(param, params[param]);
531
489
  }
532
- if (params.search) {
533
- this.params = this.params.set('display_name:contains', params.search);
490
+ if (params?.search) {
491
+ parameters = parameters.set('display_name:contains', params.search);
534
492
  }
535
- return this.params;
493
+ return parameters;
494
+ }
495
+ getShopImg(idFile) {
496
+ return this.apiService.getShopImg(idFile).pipe(tap(() => this.refreshImageList$.next()));
536
497
  }
537
498
  replaceImg(imageBase64, id_file) {
538
- return this.apiService.replaceImg(imageBase64, id_file);
499
+ return this.apiService.replaceImg(imageBase64, id_file).pipe(tap(() => this.refreshImageList$.next()));
539
500
  }
540
501
  removeImg(id_file) {
541
- return this.apiService.removeImg(id_file);
502
+ return this.apiService.removeImg(id_file).pipe(tap(() => this.refreshImageList$.next()));
542
503
  }
543
504
  removeMultipleImg(id_array) {
544
- return this.apiService.removeMultipleImg(id_array);
505
+ return this.apiService.removeMultipleImg(id_array).pipe(tap(() => this.refreshImageList$.next()));
545
506
  }
546
507
  getImgManagerDisplayConfig(displayName) {
547
508
  switch (displayName) {
@@ -567,6 +528,10 @@ class ImgManagerService {
567
528
  this.simpleWithButtonOpenerConfig,
568
529
  ];
569
530
  }
531
+ ngOnDestroy() {
532
+ this.destroy$.next();
533
+ this.destroy$.complete();
534
+ }
570
535
  }
571
536
  ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
572
537
  ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService });
@@ -574,6 +539,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
574
539
  type: Injectable
575
540
  }] });
576
541
 
542
+ class RenamePictureService {
543
+ constructor(apiService, alertService, imgManagerService) {
544
+ this.apiService = apiService;
545
+ this.alertService = alertService;
546
+ this.imgManagerService = imgManagerService;
547
+ this.picturesList = [];
548
+ this.errorRenameImg = 'ImgManager.ImgList.errorRenameImg';
549
+ this.msgSavingImgName = 'ImgManager.ImgLib.savingImgName';
550
+ this.msgImgNameSaved = 'ImgManager.ImgLib.imgNameSaved';
551
+ }
552
+ setPicturesList(picturesList) {
553
+ this.picturesList = picturesList;
554
+ }
555
+ renamePicture(pictureNameUpdate) {
556
+ const picture = this.getPictureById(pictureNameUpdate.id);
557
+ if (!picture) {
558
+ this.alertService.openAlert(this.errorRenameImg);
559
+ return;
560
+ }
561
+ this.alertService.openAlert(this.msgSavingImgName);
562
+ this.apiService
563
+ .changeImgName(picture.display_name, picture.id_file).pipe(tap(() => this.imgManagerService.refreshImageList$.next()))
564
+ .subscribe({
565
+ next: (data) => {
566
+ picture.display_name = data.display_name;
567
+ this.alertService.openAlert(this.msgImgNameSaved);
568
+ },
569
+ error: () => {
570
+ picture.display_name = pictureNameUpdate.previousName;
571
+ this.alertService.openAlert(this.errorRenameImg);
572
+ }
573
+ });
574
+ }
575
+ changeImageName(name, idFile) {
576
+ return this.apiService.changeImgName(name, idFile).pipe(tap(() => this.imgManagerService.refreshImageList$.next()));
577
+ }
578
+ getPictureById(id_file) {
579
+ if (!this.picturesList) {
580
+ return;
581
+ }
582
+ for (const picture of this.picturesList) {
583
+ if (picture.id_file === id_file) {
584
+ return picture;
585
+ }
586
+ }
587
+ return null;
588
+ }
589
+ }
590
+ RenamePictureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, deps: [{ token: ApiService }, { token: AlertService }, { token: ImgManagerService }], target: i0.ɵɵFactoryTarget.Injectable });
591
+ RenamePictureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService });
592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, decorators: [{
593
+ type: Injectable
594
+ }], ctorParameters: function () { return [{ type: ApiService }, { type: AlertService }, { type: ImgManagerService }]; } });
595
+
577
596
  class ImgCDNService {
578
597
  constructor() {
579
598
  this.imgCDNConfig = inject(ApiService).IMG_SIZE;
@@ -1139,7 +1158,7 @@ class PexelsService {
1139
1158
  request = `/curated?per_page=${perPage}&page=${page}`;
1140
1159
  }
1141
1160
  }
1142
- return this.http.get(this.apiBaseUrl + request, httpOptions).pipe(map((data) => {
1161
+ return this.http.get(this.apiBaseUrl + request, httpOptions).pipe(map$1((data) => {
1143
1162
  return data;
1144
1163
  }));
1145
1164
  }
@@ -1172,7 +1191,7 @@ class AbstractDebounceDirective {
1172
1191
  }
1173
1192
  ngOnInit() {
1174
1193
  this.emitEvent$
1175
- .pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap$1(value => this.emitChange(value)))
1194
+ .pipe(takeUntil(this.subscription$), debounceTime$1(this.debounceTime), distinctUntilChanged$1(), tap$1(value => this.emitChange(value)))
1176
1195
  .subscribe();
1177
1196
  }
1178
1197
  emitChange(value) {
@@ -1298,7 +1317,6 @@ class PexelLibComponent {
1298
1317
  this.searchValue = '';
1299
1318
  /** Pass to true to hide search input */
1300
1319
  this.disableSearch = false;
1301
- this.showImgUploaded = new EventEmitter();
1302
1320
  this.perPage = 30;
1303
1321
  this.searchUpdated = new Subject();
1304
1322
  this.nbResult = 0;
@@ -1447,7 +1465,7 @@ class PexelLibComponent {
1447
1465
  }
1448
1466
  }
1449
1467
  PexelLibComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelLibComponent, deps: [{ token: PexelsService }, { token: AlertService }, { token: i3.TranslateService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
1450
- PexelLibComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PexelLibComponent, selector: "pexels-lib", inputs: { stateDisplayed: "stateDisplayed", searchValue: "searchValue", disableSearch: "disableSearch" }, outputs: { showImgUploaded: "showImgUploaded" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["outerElement"], descendants: true }], ngImport: i0, template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n [reachedOffset]=\"300\"\n class=\"pexels-lib__scroll\"\n [ngClass]=\"{\n 'pexels-lib__scroll--smallDisplay': stateDisplayed === 'small',\n 'pexels-lib__scroll--noResult': !nbResult,\n 'pexels-lib__scroll--hide': (!nbResult && disableSearch)\n }\"\n (reachedBottom)=\"onBottomReached()\"\n >\n <div\n *ngIf=\"!disableSearch\"\n class=\"pexels-lib__search\"\n [ngClass]=\"{'pexels-lib__search--smallDisplay': stateDisplayed === 'small'}\"\n >\n <wz-input-search\n [(ngModel)]=\"searchValue\"\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\n (changeDebounced)=\"onSearchNameChanged()\"\n [smallPadding]=\"stateDisplayed === 'small'\">\n </wz-input-search>\n </div>\n\n <div *ngIf=\"!initComponent\" class=\"pexels-lib__wrapper\">\n <p *ngIf=\"nbResult\" class=\"pexels-lib__wrapper__result-nb\">{{ 'ImgManager.PexelLib.nbImgFound' | translate }} : {{ nbResult }}</p>\n\n <div class=\"pexels-lib__wrapper__result\">\n\n <div *ngFor=\"let photosColumn of photosColumns; let indexCol = index;\" class=\"pexels-lib__wrapper__result__column\" [@listAnimation]=\"photosColumn.photos.length\">\n <div *ngFor=\"let photo of photosColumn.photos; let indexPhoto = index;\" class=\"pexels-lib__wrapper__result__column__element\">\n\n <img [alt]=\"photo.src.medium\" [src]=\"photo.src.medium\"\n class=\"pexels-lib__wrapper__result__column__element__img\"/>\n\n <div class=\"pexels-lib__wrapper__result__column__element__wrapper\">\n <span class=\"pexels-lib__wrapper__result__column__element__wrapper__infos\">\n {{ photo.width }} x {{ photo.height}}\n </span>\n\n <div class=\"dropdown is-up\" [ngClass]=\"{'is-hoverable': !photo.uploading}\">\n <div class=\"dropdown-trigger\">\n <button\n type=\"button\"\n class=\"button pexels-lib__wrapper__result__column__element__wrapper__button\"\n aria-haspopup=\"true\"\n aria-controls=\"dropdown-menu\">\n\n <div *ngIf=\"!photo.uploading\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <span>{{ 'ImgManager.PexelLib.import' | translate }}</span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-up\" aria-hidden=\"true\"></i>\n </span>\n <ng-container *ngIf=\"photo.uploaded\">\n &nbsp;<i class=\"fal fa-check\"></i>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"photo.uploading\">\n {{ 'ImgManager.PexelLib.importation' | translate }}\n <span btnLoadingAnim class=\"btnLoadingAnnimation\"></span>\n </ng-container>\n\n </button>\n </div>\n <div class=\"dropdown-menu pexels-lib__wrapper__result__column__element__wrapper__dropdown\" id=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-content__wrapper\">\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.portrait)\">\n <p>{{ 'ImgManager.PexelLib.portrait' | translate }}</p>\n <i class=\"fal fa-check iPortrait\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.landscape)\">\n <p>{{ 'ImgManager.PexelLib.landscape' | translate }}</p>\n <i class=\"fal fa-check iLandscape\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <p>{{ 'ImgManager.PexelLib.original' | translate }}</p>\n <i class=\"fal fa-check iOriginal\"></i>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n\n </ng-scrollbar>\n\n <ng-container *ngIf=\"isLoading\">\n <wz-loader></wz-loader>\n </ng-container>\n <div\n *ngIf=\"!isLoading && !nbResult\"\n class=\"pexels-lib__alert\"\n [@easeInOut]=\"'in'\">\n <wz-alert [warning]=\"true\">\n {{ 'ImgManager.PexelLib.noResult' | translate }}\n </wz-alert>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: i8.NgScrollbarReachedBottom, selector: "[reachedBottom], [reached-bottom]", outputs: ["reachedBottom"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "component", type: InputSearchComponent, selector: "wz-input-search", inputs: ["placeholder", "smallPadding", "id"], outputs: ["changeDebounced"] }, { kind: "component", type: AlertComponent, selector: "wz-alert", inputs: ["icon", "warning", "success", "iconClass"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1468
+ PexelLibComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PexelLibComponent, selector: "pexels-lib", inputs: { stateDisplayed: "stateDisplayed", searchValue: "searchValue", disableSearch: "disableSearch" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["outerElement"], descendants: true }], ngImport: i0, template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\n\n <ng-scrollbar\n [reachedOffset]=\"300\"\n class=\"pexels-lib__scroll\"\n [ngClass]=\"{\n 'pexels-lib__scroll--smallDisplay': stateDisplayed === 'small',\n 'pexels-lib__scroll--noResult': !nbResult,\n 'pexels-lib__scroll--hide': (!nbResult && disableSearch)\n }\"\n (reachedBottom)=\"onBottomReached()\"\n >\n <div\n *ngIf=\"!disableSearch\"\n class=\"pexels-lib__search\"\n [ngClass]=\"{'pexels-lib__search--smallDisplay': stateDisplayed === 'small'}\"\n >\n <wz-input-search\n [(ngModel)]=\"searchValue\"\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\n (changeDebounced)=\"onSearchNameChanged()\"\n [smallPadding]=\"stateDisplayed === 'small'\">\n </wz-input-search>\n </div>\n\n <div *ngIf=\"!initComponent\" class=\"pexels-lib__wrapper\">\n <p *ngIf=\"nbResult\" class=\"pexels-lib__wrapper__result-nb\">{{ 'ImgManager.PexelLib.nbImgFound' | translate }} : {{ nbResult }}</p>\n\n <div class=\"pexels-lib__wrapper__result\">\n\n <div *ngFor=\"let photosColumn of photosColumns; let indexCol = index;\" class=\"pexels-lib__wrapper__result__column\" [@listAnimation]=\"photosColumn.photos.length\">\n <div *ngFor=\"let photo of photosColumn.photos; let indexPhoto = index;\" class=\"pexels-lib__wrapper__result__column__element\">\n\n <img [alt]=\"photo.src.medium\" [src]=\"photo.src.medium\"\n class=\"pexels-lib__wrapper__result__column__element__img\"/>\n\n <div class=\"pexels-lib__wrapper__result__column__element__wrapper\">\n <span class=\"pexels-lib__wrapper__result__column__element__wrapper__infos\">\n {{ photo.width }} x {{ photo.height}}\n </span>\n\n <div class=\"dropdown is-up\" [ngClass]=\"{'is-hoverable': !photo.uploading}\">\n <div class=\"dropdown-trigger\">\n <button\n type=\"button\"\n class=\"button pexels-lib__wrapper__result__column__element__wrapper__button\"\n aria-haspopup=\"true\"\n aria-controls=\"dropdown-menu\">\n\n <div *ngIf=\"!photo.uploading\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <span>{{ 'ImgManager.PexelLib.import' | translate }}</span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-up\" aria-hidden=\"true\"></i>\n </span>\n <ng-container *ngIf=\"photo.uploaded\">\n &nbsp;<i class=\"fal fa-check\"></i>\n </ng-container>\n </div>\n\n <ng-container *ngIf=\"photo.uploading\">\n {{ 'ImgManager.PexelLib.importation' | translate }}\n <span btnLoadingAnim class=\"btnLoadingAnnimation\"></span>\n </ng-container>\n\n </button>\n </div>\n <div class=\"dropdown-menu pexels-lib__wrapper__result__column__element__wrapper__dropdown\" id=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\">\n <div class=\"dropdown-content__wrapper\">\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.portrait)\">\n <p>{{ 'ImgManager.PexelLib.portrait' | translate }}</p>\n <i class=\"fal fa-check iPortrait\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.landscape)\">\n <p>{{ 'ImgManager.PexelLib.landscape' | translate }}</p>\n <i class=\"fal fa-check iLandscape\"></i>\n </div>\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\n <p>{{ 'ImgManager.PexelLib.original' | translate }}</p>\n <i class=\"fal fa-check iOriginal\"></i>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n\n </ng-scrollbar>\n\n <ng-container *ngIf=\"isLoading\">\n <wz-loader></wz-loader>\n </ng-container>\n <div\n *ngIf=\"!isLoading && !nbResult\"\n class=\"pexels-lib__alert\"\n [@easeInOut]=\"'in'\">\n <wz-alert [warning]=\"true\">\n {{ 'ImgManager.PexelLib.noResult' | translate }}\n </wz-alert>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: i8.NgScrollbarReachedBottom, selector: "[reachedBottom], [reached-bottom]", outputs: ["reachedBottom"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "component", type: InputSearchComponent, selector: "wz-input-search", inputs: ["placeholder", "smallPadding", "id"], outputs: ["changeDebounced"] }, { kind: "component", type: AlertComponent, selector: "wz-alert", inputs: ["icon", "warning", "success", "iconClass"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1451
1469
  easeInOut,
1452
1470
  listAnnimation
1453
1471
  ] });
@@ -1463,8 +1481,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1463
1481
  type: Input
1464
1482
  }], disableSearch: [{
1465
1483
  type: Input
1466
- }], showImgUploaded: [{
1467
- type: Output
1468
1484
  }], content: [{
1469
1485
  type: ViewChild,
1470
1486
  args: ['outerElement']
@@ -2927,7 +2943,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
2927
2943
  type: Directive,
2928
2944
  args: [{
2929
2945
  // The selector has the same name as the tableRaw selector in table.component.html
2930
- selector: '[tableRow]'
2946
+ selector: '[tableRow]',
2931
2947
  }]
2932
2948
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
2933
2949
  type: Inject,
@@ -2965,15 +2981,6 @@ class ImagesViewComponent {
2965
2981
  this.listDisplayed = false; // Display format list or mosaic
2966
2982
  this.multipleImgMode = false;
2967
2983
  this.switchDisplayWindow = new EventEmitter();
2968
- // Data filters
2969
- this.tableFilters = {
2970
- sort: undefined,
2971
- order: undefined,
2972
- searchValue: '',
2973
- totalItems: 0,
2974
- itemsPerPage: 0,
2975
- currentPage: 1
2976
- };
2977
2984
  this.widthLargeCard = 219; // Default value of a card width 199 + margin 20
2978
2985
  this.widthSmallCard = 160; // Default value of a card width 140 + margin 20
2979
2986
  this.nbFakeImg = 0;
@@ -3044,46 +3051,58 @@ class ImagesViewComponent {
3044
3051
  smallImgWidthFactor: 0.125
3045
3052
  }
3046
3053
  ];
3047
- this.searchQueryChanged = new Subject();
3048
- this.filtersChanged = new Subject();
3049
- this.picturesList = [];
3050
- this.savePictureList = [];
3051
3054
  this.nbImgToDelSelected = 0;
3052
3055
  this.disable = false; // Use to disable action during server request
3053
- this.isLoading = true;
3054
- this.isTotalRetrieved = false;
3055
3056
  this.delListImgLoader = false;
3056
3057
  this.initComponent = true;
3057
3058
  this.failLoaded = false;
3058
- this.displayPexelsResults = false; // Use when no img find by name, display img from Pexels
3059
3059
  this.confirmImgSup = false;
3060
- // Paginator Params
3061
- this.pageIndex = 0;
3062
- this.length = 0;
3063
- this.pageSize = 30; // Default value
3064
- this.pageSizeOptions = [25, 50, 100, 250];
3065
3060
  this.errorGetAllImg = 'ImgManager.ImgLib.errorGetAllImg';
3066
3061
  this.errorGetTotalImg = 'ImgManager.ImgLib.errorGetTotalImg';
3067
3062
  this.errorGetImg = 'ImgManager.ImgLib.errorGetCanvaImg';
3068
- this.msgNoImgFound = 'ImgManager.ImgLib.noImgFound';
3069
3063
  this.errorRemoveImg = 'ImgManager.ImgList.errorRemoveImg';
3064
+ this.destroy$ = new Subject();
3065
+ this.vm$ = combineLatest({
3066
+ imageSelection: this.imgSelectionService.imgSelection$,
3067
+ imageListData: this.imgManager.imageList$,
3068
+ isLoading: this.imgManager.isLoading$,
3069
+ searchImagesParameters: this.imgManager.searchImagesParameters$,
3070
+ }).pipe(map$1(({ imageSelection, imageListData: { imageList, imageTotal }, isLoading, searchImagesParameters }) => {
3071
+ this.initVariables(true);
3072
+ this.calculateNbImgFake(imageList.data.length);
3073
+ const picturesList = this.setSelectedProperty(imageSelection, imageList.data);
3074
+ this.renamePictureService.setPicturesList(picturesList);
3075
+ const tableFilters = this.getTableFilters(searchImagesParameters, imageTotal);
3076
+ const keepImagesDisplayed = (this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1') || (this.tabDisplayed === 'images-view' && imageList.data.length && searchImagesParameters.page === '1');
3077
+ const skipSetImagesToDisplay = !!picturesList?.length && this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1';
3078
+ const hideUntilFetchedFirstPageImagesForTabUpload = this.tabDisplayed === 'img-upload' && (searchImagesParameters.page !== '1' || imageList?.page !== 1);
3079
+ return {
3080
+ isLoading: hideUntilFetchedFirstPageImagesForTabUpload || !keepImagesDisplayed && isLoading,
3081
+ displayPexelsResults: !isLoading && imageTotal === 0,
3082
+ picturesList,
3083
+ imageTotal,
3084
+ tableFilters,
3085
+ skipSetImagesToDisplay
3086
+ };
3087
+ }));
3070
3088
  }
3071
- ngOnInit() {
3072
- /* if (this.maxLengthCardShow) {
3073
- this.reducePictureListMaxLength();
3074
- } */
3075
- this.setEvents();
3076
- this.imgSelectedList = this.imgSelectionService.getImgSelection();
3089
+ get searchImagesParameters$() {
3090
+ return this.imgManager.searchImagesParameters$;
3077
3091
  }
3078
- ngAfterViewInit() {
3079
- this.setNbImgToDisplay();
3080
- this._getImgList();
3081
- if (!this.savePictureList) {
3082
- this.savePictureList = this.picturesList;
3083
- }
3092
+ getTableFilters(searchImagesParameters, imageTotal) {
3093
+ return {
3094
+ sort: undefined,
3095
+ order: undefined,
3096
+ searchValue: searchImagesParameters.search,
3097
+ totalItems: imageTotal,
3098
+ itemsPerPage: parseInt(searchImagesParameters.limit),
3099
+ currentPage: parseInt(searchImagesParameters.page)
3100
+ };
3084
3101
  }
3085
- getImgList() {
3086
- this.filtersChanged.next();
3102
+ ngAfterViewInit() {
3103
+ this.vm$.pipe(take(1), filter(({ skipSetImagesToDisplay }) => !skipSetImagesToDisplay)).subscribe(({ tableFilters }) => {
3104
+ this.setNbImgToDisplay(tableFilters);
3105
+ });
3087
3106
  }
3088
3107
  /**
3089
3108
  * true : go to list display
@@ -3098,19 +3117,13 @@ class ImagesViewComponent {
3098
3117
  /**
3099
3118
  * Calcul the number of img selected for masse deletion
3100
3119
  */
3101
- onImgSelected() {
3102
- this.setNbImgToDelSelected();
3103
- }
3104
- onShowImgUploaded() {
3105
- this.searchText = null;
3106
- this.searchedValue = null;
3107
- this.getImgList();
3120
+ onImgSelected(picturesList) {
3121
+ this.setNbImgToDelSelected(picturesList);
3108
3122
  }
3109
3123
  onRenamePicture(pictureRenamed) {
3110
- console.log('onRenamePicture pictureRenamed', pictureRenamed);
3111
3124
  this.renamePictureService.renamePicture(pictureRenamed);
3112
3125
  }
3113
- removeListImg() {
3126
+ removeListImg(picturesList) {
3114
3127
  if (this.disable) {
3115
3128
  return;
3116
3129
  }
@@ -3120,26 +3133,28 @@ class ImagesViewComponent {
3120
3133
  // Get the id of the img to remove
3121
3134
  // And add deleted property
3122
3135
  const idImgToRemove = [];
3123
- this.picturesList.forEach(img => {
3136
+ picturesList.forEach(img => {
3124
3137
  if (img.delSelected) {
3125
3138
  img.deleted = true;
3126
3139
  idImgToRemove.push(img.id_file);
3127
3140
  }
3128
3141
  });
3129
- this.imgManager.removeMultipleImg(idImgToRemove).subscribe(() => {
3130
- this.getImgList();
3131
- this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
3132
- }, error => {
3133
- this.getImgList();
3134
- this.alertService.openAlert(this.errorRemoveImg);
3142
+ this.imgManager.removeMultipleImg(idImgToRemove).subscribe({
3143
+ next: () => {
3144
+ this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
3145
+ },
3146
+ error: error => {
3147
+ this.imgManager.refreshImageList$.next();
3148
+ this.alertService.openAlert(this.errorRemoveImg);
3149
+ }
3135
3150
  });
3136
3151
  }
3137
- selectImgChosen() {
3152
+ selectImgChosen(picturesList) {
3138
3153
  if (this.disable) {
3139
3154
  return;
3140
3155
  }
3141
3156
  const picturesListSelected = [];
3142
- this.picturesList.map(img => {
3157
+ picturesList.map(img => {
3143
3158
  if (img.delSelected) {
3144
3159
  img.delSelected = false;
3145
3160
  img.selected = true;
@@ -3148,7 +3163,7 @@ class ImagesViewComponent {
3148
3163
  picturesListSelected.push(img);
3149
3164
  }
3150
3165
  });
3151
- this.setNbImgToDelSelected();
3166
+ this.setNbImgToDelSelected(picturesList);
3152
3167
  this.imgSelectionService.setImgSelection(picturesListSelected);
3153
3168
  }
3154
3169
  displayConfirmImgSup() {
@@ -3163,17 +3178,14 @@ class ImagesViewComponent {
3163
3178
  /**
3164
3179
  * Event emit when a img selected in order to delete
3165
3180
  */
3166
- onPicturesListChange() {
3167
- this.setNbImgToDelSelected();
3168
- }
3169
- onFiltersChange() {
3170
- this.getImgList();
3181
+ onPicturesListChange(picturesList) {
3182
+ this.setNbImgToDelSelected(picturesList);
3171
3183
  }
3172
3184
  /**
3173
3185
  * Set default number of img per page to display at the initialisation
3174
3186
  * This number is between 30 and 50
3175
3187
  */
3176
- setNbImgToDisplay() {
3188
+ setNbImgToDisplay(tableFilters) {
3177
3189
  const containerWidth = this.imgLibContainer.nativeElement.offsetWidth + 30; // + 30px -> left + right margin
3178
3190
  const scrollWidth = window.innerWidth - document.body.offsetWidth;
3179
3191
  const [maxImgWidthFactor, minImgWidthFactor] = this.getImgWidthFactors();
@@ -3181,7 +3193,11 @@ class ImagesViewComponent {
3181
3193
  const maxImgWidth = Math.ceil((containerWidth + scrollWidth) * maxImgWidthFactor);
3182
3194
  this.nbMaxImgPerLine = Math.floor(containerWidth / minImgWidth);
3183
3195
  this.nbMinImgPerLine = Math.floor((containerWidth + scrollWidth) / maxImgWidth);
3184
- this.pageSize = this.getTotalImgPerPage();
3196
+ this.searchImagesParameters$.next(this.getParams({
3197
+ ...tableFilters,
3198
+ itemsPerPage: this.getTotalImgPerPage(),
3199
+ currentPage: 1
3200
+ }));
3185
3201
  }
3186
3202
  getImgWidthFactors() {
3187
3203
  const screenWidth = window.innerWidth;
@@ -3212,40 +3228,30 @@ class ImagesViewComponent {
3212
3228
  }
3213
3229
  return total;
3214
3230
  }
3215
- setParams() {
3216
- this.params = {
3217
- limit: this.maxLengthCardShow?.toString() || (this.tableFilters.itemsPerPage ? this.tableFilters.itemsPerPage.toString() : this.pageSize.toString()),
3218
- page: this.tableFilters.currentPage.toString()
3231
+ getParams(tableFilters) {
3232
+ return {
3233
+ limit: tableFilters.itemsPerPage.toString(),
3234
+ page: tableFilters.currentPage.toString(),
3235
+ ...(tableFilters.searchValue && { search: tableFilters.searchValue.toString() }),
3219
3236
  };
3220
- if (this.tableFilters.searchValue) {
3221
- this.params.search = this.tableFilters.searchValue.toString();
3222
- }
3223
3237
  }
3224
3238
  initVariables(loadingSuccess) {
3225
3239
  this.nbImgToDelSelected = 0;
3226
3240
  this.disable = false;
3227
- this.isLoading = false;
3228
3241
  this.delListImgLoader = false;
3229
3242
  this.initComponent = false;
3230
- this.displayPexelsResults = false;
3231
3243
  this.failLoaded = !loadingSuccess;
3232
3244
  this.nbFakeImg = 0;
3233
3245
  }
3234
- selectImgSelected() {
3235
- if (!this.imgSelectedList || !this.imgSelectedList.length) {
3236
- return;
3237
- }
3238
- const idImgSlectedList = [];
3239
- this.imgSelectedList.forEach(img => idImgSlectedList.push(img.id_file));
3240
- this.picturesList.forEach(picture => {
3241
- if (idImgSlectedList.indexOf(picture.id_file) !== -1) {
3242
- picture.selected = true;
3246
+ setSelectedProperty(imgSelectedList, picturesList) {
3247
+ const picturesListSelected = JSON.parse(JSON.stringify(picturesList));
3248
+ imgSelectedList.forEach(img => {
3249
+ const selectedImg = picturesListSelected.find(picture => picture.id_file === img.id_file);
3250
+ if (selectedImg) {
3251
+ selectedImg.selected = true;
3243
3252
  }
3244
3253
  });
3245
- }
3246
- displayPexelsLib() {
3247
- this.displayPexelsResults = true;
3248
- this.alertService.openAlert(this.msgNoImgFound);
3254
+ return picturesListSelected;
3249
3255
  }
3250
3256
  /**
3251
3257
  * Set a img list in order to fill properly all the line of images displayed in mosaic.
@@ -3253,137 +3259,32 @@ class ImagesViewComponent {
3253
3259
  */
3254
3260
  calculateNbImgFake(nbImgDisplayed) {
3255
3261
  const nbImgPerLine = this.stateDisplayed === 'small' || this.tabDisplayed === 'img-upload' ? this.nbMaxImgPerLine : this.nbMinImgPerLine;
3256
- if (nbImgDisplayed % nbImgPerLine !== 0) {
3257
- this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
3262
+ if (isNaN(nbImgDisplayed % nbImgPerLine)) {
3263
+ this.nbFakeImg = 0;
3264
+ return;
3258
3265
  }
3259
- }
3260
- getImg(id_file) {
3261
- this.imgManager.getShopImg(id_file).pipe(take(1)).subscribe({
3262
- next: (picture) => {
3263
- if (!this.imgAlreadyExist(picture.id_file)) {
3264
- // check the img is not already present
3265
- this.picturesList.unshift(picture);
3266
- this.length += 1;
3267
- }
3268
- },
3269
- error: () => {
3270
- this.alertService.openAlert(this.errorGetImg);
3271
- }
3272
- });
3273
- }
3274
- imgAlreadyExist(id_file) {
3275
- for (const img of this.picturesList) {
3276
- if (img.id_file === id_file) {
3277
- return true;
3278
- }
3266
+ if (nbImgDisplayed % nbImgPerLine !== 0) {
3267
+ setTimeout(() => {
3268
+ this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
3269
+ }, 0);
3279
3270
  }
3280
- return false;
3281
3271
  }
3282
- setNbImgToDelSelected() {
3283
- this.nbImgToDelSelected = this.picturesList.filter(img => img.delSelected).length;
3272
+ setNbImgToDelSelected(picturesList) {
3273
+ this.nbImgToDelSelected = picturesList.filter(img => img.delSelected).length;
3284
3274
  if (!this.nbImgToDelSelected) {
3285
3275
  this.confirmImgSup = false;
3286
3276
  }
3287
3277
  }
3288
- setEvents() {
3289
- // Add a timer to retrieve img when the search bar or the paginator are used
3290
- this.searchQueryChanged
3291
- .pipe(debounceTime(400)) // wait 0.5 sec after the last event before emitting last event
3292
- .subscribe(data => {
3293
- this.getImgList();
3294
- });
3295
- this.filtersChanged
3296
- .pipe(debounceTime(800)) // wait 0.8 sec after the last event before emitting last event
3297
- .subscribe(data => {
3298
- this._getImgList();
3299
- });
3300
- // Reload img when img is/are removed
3301
- this.imgRemovedEvent = this.imgEventService.imgRemoved$.subscribe(id_file => {
3302
- this.getImgList();
3303
- });
3304
- // Create img from Canva
3305
- this.imgAddedEvent = this.imgEventService.getImgAddedEventListner().subscribe(id_file => {
3306
- if (id_file && !this.imgAlreadyExist(id_file)) {
3307
- this.getImg(id_file);
3308
- }
3309
- });
3310
- this.imgSelectionChange = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
3311
- if (this.listDisplayed) {
3312
- return;
3313
- }
3314
- const idFileList = [];
3315
- imgSelection.map(img => idFileList.push(img.id_file));
3316
- for (const picture of this.picturesList) {
3317
- if (idFileList.indexOf(picture.id_file) === -1) {
3318
- picture.selected = false;
3319
- }
3320
- }
3321
- });
3322
- }
3323
- _getImgList() {
3324
- this.isLoading = true;
3325
- this.displayPexelsResults = false;
3326
- this.setParams();
3327
- this.refreshTotalImgList();
3328
- const forceToUpdate = this.isLastImgRemovedInList();
3329
- this.imgManager.getShopImgList(this.params, forceToUpdate).pipe(take(1)).subscribe({
3330
- next: (data) => {
3331
- this.initVariables(true);
3332
- const nbImgDisplayed = data.data.length;
3333
- this.calculateNbImgFake(nbImgDisplayed);
3334
- this.picturesList = data.data;
3335
- this.renamePictureService.setPicturesList(this.picturesList);
3336
- this.selectImgSelected();
3337
- this.length = this.isTotalRetrieved ? this.length : data.totalRecords;
3338
- this.tableFilters.totalItems = this.isTotalRetrieved ? this.tableFilters.totalItems : data.totalRecords;
3339
- this.tableFilters.itemsPerPage = this.tableFilters.itemsPerPage ? this.tableFilters.itemsPerPage : this.pageSize;
3340
- // Display Pexels if no result
3341
- if (data.totalRecords === 0) {
3342
- this.displayPexelsLib();
3343
- }
3344
- this.changeDetectorRef.markForCheck(); // In wizi-admin, the change detection is not working properly
3345
- },
3346
- error: error => {
3347
- this.alertService.openAlert(this.errorGetAllImg);
3348
- this.initVariables(false);
3349
- }
3350
- });
3351
- }
3352
- refreshTotalImgList() {
3353
- const searchValue = this.tableFilters.searchValue;
3354
- if (this.isTotalRetrieved && searchValue === this.previousSearchValue) {
3355
- // Keep current total result
3356
- return;
3357
- }
3358
- this.isTotalRetrieved = false;
3359
- this.imgManager.getShopTotalImgList(this.params).pipe(take(1)).subscribe({
3360
- next: total => {
3361
- this.previousSearchValue = searchValue;
3362
- this.isTotalRetrieved = true;
3363
- this.length = total;
3364
- this.tableFilters.totalItems = total;
3365
- },
3366
- error: error => {
3367
- //this.alertService.openAlert(this.errorGetTotalImg);
3368
- this.initVariables(false);
3369
- }
3370
- });
3371
- }
3372
3278
  switchDisplayWindowMosaic() {
3373
3279
  this.switchDisplayWindow.emit(true);
3374
3280
  }
3375
- isLastImgRemovedInList() {
3376
- return this.picturesList.some(picture => picture.id_file === this.imgEventService.imgRemoved$.getValue());
3377
- }
3378
3281
  ngOnDestroy() {
3379
- this.searchQueryChanged.unsubscribe();
3380
- this.imgRemovedEvent.unsubscribe();
3381
- this.imgAddedEvent.unsubscribe();
3382
- this.imgSelectionChange.unsubscribe();
3282
+ this.destroy$.next();
3283
+ this.destroy$.complete();
3383
3284
  }
3384
3285
  }
3385
3286
  ImagesViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImagesViewComponent, deps: [{ token: ImgManagerService }, { token: ImgEventService }, { token: ImgSelectionService }, { token: AlertService }, { token: UserSettingsService }, { token: RenamePictureService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3386
- ImagesViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImagesViewComponent, selector: "images-view", inputs: { stateDisplayed: "stateDisplayed", tabDisplayed: "tabDisplayed", fullSize: "fullSize", maxLengthCardShow: "maxLengthCardShow", nbRowToShow: "nbRowToShow", listDisplayed: "listDisplayed", multipleImgMode: "multipleImgMode" }, outputs: { switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgLibContainer", first: true, predicate: ["imgLibContainer"], descendants: true }], ngImport: i0, template: "<div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{length}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- Select -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen()\"\n type=\"button\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n type=\"button\"\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg()\"\n class=\"button images-view__container__delBtn danger\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<ng-scrollbar\n class=\"images-view__scroll\"\n [ngClass]=\"{\n 'images-view__scroll--hide--mosaic': displayPexelsResults && !listDisplayed,\n 'images-view__scroll--hide--table': displayPexelsResults && listDisplayed,\n 'images-view__scroll--full': stateDisplayed === 'full',\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\n 'images-view__scroll--window': stateDisplayed === 'window'\n}\"\n>\n <div #imgLibContainer class=\"images-view__wrapper\">\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\n <mosaic-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\n [nbFakeImg]=\"nbFakeImg\"\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabDisplayed\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [isLoading]=\"isLoading\"\n [fullSize]=\"fullSize\"\n >\n </mosaic-view>\n </div>\n\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\n <table-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [stateDisplayed]=\"stateDisplayed\"\n [isLoading]=\"isLoading\"\n >\n </table-view>\n </div>\n\n </div>\n</ng-scrollbar>\n\n<!-- Pexels Section - When no img found -->\n<div\n *ngIf=\"displayPexelsResults\"\n class=\"images-view--pexels\"\n [@easeInOut]=\"'in'\">\n <pexels-lib\n [searchValue]=\"tableFilters.searchValue\"\n (showImgUploaded)=\"onShowImgUploaded()\"\n [disableSearch]=\"true\"\n >\n </pexels-lib>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"], outputs: ["showImgUploaded"] }, { kind: "component", type: MosaicViewComponent, selector: "mosaic-view", inputs: ["tabDisplayed", "fullSize", "nbFakeImg"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: TableViewComponent, selector: "table-view" }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
3287
+ ImagesViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImagesViewComponent, selector: "images-view", inputs: { stateDisplayed: "stateDisplayed", tabDisplayed: "tabDisplayed", fullSize: "fullSize", nbRowToShow: "nbRowToShow", listDisplayed: "listDisplayed", multipleImgMode: "multipleImgMode" }, outputs: { switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgLibContainer", first: true, predicate: ["imgLibContainer"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\n\n <div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': vm.displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{vm.imageTotal}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- Select -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen(vm.picturesList)\"\n type=\"button\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n type=\"button\"\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg(vm.picturesList)\"\n class=\"button images-view__container__delBtn danger\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n <!-- Images section -->\n <ng-scrollbar\n class=\"images-view__scroll\"\n [ngClass]=\"{\n 'images-view__scroll--hide--mosaic': vm.displayPexelsResults && !listDisplayed,\n 'images-view__scroll--hide--table': vm.displayPexelsResults && listDisplayed,\n 'images-view__scroll--full': stateDisplayed === 'full',\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\n 'images-view__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div #imgLibContainer class=\"images-view__wrapper\">\n\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\n <mosaic-view\n [picturesList]=\"vm.picturesList\"\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\n [tableFilters]=\"vm.tableFilters\"\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\n [nbFakeImg]=\"nbFakeImg\"\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabDisplayed\"\n [displayPexelsResults]=\"vm.displayPexelsResults\"\n [isLoading]=\"vm.isLoading\"\n [fullSize]=\"fullSize\"\n >\n </mosaic-view>\n </div>\n\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\n <table-view\n [picturesList]=\"vm.picturesList\"\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\n [tableFilters]=\"vm.tableFilters\"\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n [displayPexelsResults]=\"vm.displayPexelsResults\"\n [stateDisplayed]=\"stateDisplayed\"\n [isLoading]=\"vm.isLoading\"\n >\n </table-view>\n </div>\n </div>\n </ng-scrollbar>\n\n <!-- Pexels Section - When no img found -->\n <div\n *ngIf=\"vm.displayPexelsResults\"\n class=\"images-view--pexels\"\n [@easeInOut]=\"'in'\">\n <pexels-lib\n [searchValue]=\"vm.tableFilters.searchValue\"\n [disableSearch]=\"true\"\n >\n </pexels-lib>\n </div>\n</ng-container>", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"] }, { kind: "component", type: MosaicViewComponent, selector: "mosaic-view", inputs: ["tabDisplayed", "fullSize", "nbFakeImg"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: TableViewComponent, selector: "table-view" }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
3387
3288
  easeInOut,
3388
3289
  insertRemove
3389
3290
  ] });
@@ -3392,15 +3293,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
3392
3293
  args: [{ selector: 'images-view', animations: [
3393
3294
  easeInOut,
3394
3295
  insertRemove
3395
- ], template: "<div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{length}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- Select -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen()\"\n type=\"button\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n type=\"button\"\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg()\"\n class=\"button images-view__container__delBtn danger\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\n\n <!-- Images section -->\n<ng-scrollbar\n class=\"images-view__scroll\"\n [ngClass]=\"{\n 'images-view__scroll--hide--mosaic': displayPexelsResults && !listDisplayed,\n 'images-view__scroll--hide--table': displayPexelsResults && listDisplayed,\n 'images-view__scroll--full': stateDisplayed === 'full',\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\n 'images-view__scroll--window': stateDisplayed === 'window'\n}\"\n>\n <div #imgLibContainer class=\"images-view__wrapper\">\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\n <mosaic-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\n [nbFakeImg]=\"nbFakeImg\"\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabDisplayed\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [isLoading]=\"isLoading\"\n [fullSize]=\"fullSize\"\n >\n </mosaic-view>\n </div>\n\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\n <table-view\n [picturesList]=\"picturesList\"\n (picturesListChange)=\"onPicturesListChange()\"\n [tableFilters]=\"tableFilters\"\n (filtersChange)=\"onFiltersChange()\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n [displayPexelsResults]=\"displayPexelsResults\"\n [stateDisplayed]=\"stateDisplayed\"\n [isLoading]=\"isLoading\"\n >\n </table-view>\n </div>\n\n </div>\n</ng-scrollbar>\n\n<!-- Pexels Section - When no img found -->\n<div\n *ngIf=\"displayPexelsResults\"\n class=\"images-view--pexels\"\n [@easeInOut]=\"'in'\">\n <pexels-lib\n [searchValue]=\"tableFilters.searchValue\"\n (showImgUploaded)=\"onShowImgUploaded()\"\n [disableSearch]=\"true\"\n >\n </pexels-lib>\n</div>\n" }]
3296
+ ], template: "<ng-container *ngIf=\"vm$ | async as vm\">\n\n <div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\n <div\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\n class=\"images-view__container\"\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\n >\n\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': vm.displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{vm.imageTotal}}</p>\n </div>\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\n </div>\n\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\n\n <!-- For listforma : Display btn del multiple img & Confirm action -->\n <div class=\"images-view__container__boxAction\">\n\n\n <!-- Select -->\n <button\n class=\"button success images-view__container__boxAction__import\"\n @insertRemoveAnnim\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\n (click)=\"selectImgChosen(vm.picturesList)\"\n type=\"button\"\n >\n <i class=\"fal fa-check\"></i>\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\n </button>\n\n <!-- Display btn del multiple img -->\n <button\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\n (click)=\"displayConfirmImgSup()\"\n class=\"button images-view__container__boxAction__delBtn danger\"\n @insertRemoveAnnim\n type=\"button\"\n >\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\n </button>\n\n <!-- Confirm action -->\n <div\n class=\"images-view__container__boxAction__confirmSup\"\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\n <div>\n <button\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\n (click)=\"cancelSup()\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.cancel' | translate }}\n </button>\n <button\n (click)=\"removeListImg(vm.picturesList)\"\n class=\"button images-view__container__delBtn danger\"\n type=\"button\"\n >\n {{ 'ImgManager.ImgLib.confirm' | translate }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n <!-- Swith mosaic/list forma -->\n <div class=\"field has-addons images-view__container__buttonBox\">\n <div class=\"control\">\n <div\n class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(false)\"\n >\n <span class=\"icon is-small\">\n <i class=\"far fa-th\"></i>\n </span>\n </div>\n </div>\n\n <div class=\"control\">\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\n (click)=\"onSwitchFormatDisplayed(true)\"\n >\n <span class=\"icon is-small\">\n <i class=\"fas fa-bars\"></i>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n <!-- Images section -->\n <ng-scrollbar\n class=\"images-view__scroll\"\n [ngClass]=\"{\n 'images-view__scroll--hide--mosaic': vm.displayPexelsResults && !listDisplayed,\n 'images-view__scroll--hide--table': vm.displayPexelsResults && listDisplayed,\n 'images-view__scroll--full': stateDisplayed === 'full',\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\n 'images-view__scroll--window': stateDisplayed === 'window'\n }\"\n >\n <div #imgLibContainer class=\"images-view__wrapper\">\n\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\n <mosaic-view\n [picturesList]=\"vm.picturesList\"\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\n [tableFilters]=\"vm.tableFilters\"\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\n [nbFakeImg]=\"nbFakeImg\"\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabDisplayed\"\n [displayPexelsResults]=\"vm.displayPexelsResults\"\n [isLoading]=\"vm.isLoading\"\n [fullSize]=\"fullSize\"\n >\n </mosaic-view>\n </div>\n\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\n <table-view\n [picturesList]=\"vm.picturesList\"\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\n [tableFilters]=\"vm.tableFilters\"\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\n [(disable)]=\"disable\"\n (pictureNameChange)=\"onRenamePicture($event)\"\n [displayPexelsResults]=\"vm.displayPexelsResults\"\n [stateDisplayed]=\"stateDisplayed\"\n [isLoading]=\"vm.isLoading\"\n >\n </table-view>\n </div>\n </div>\n </ng-scrollbar>\n\n <!-- Pexels Section - When no img found -->\n <div\n *ngIf=\"vm.displayPexelsResults\"\n class=\"images-view--pexels\"\n [@easeInOut]=\"'in'\">\n <pexels-lib\n [searchValue]=\"vm.tableFilters.searchValue\"\n [disableSearch]=\"true\"\n >\n </pexels-lib>\n </div>\n</ng-container>" }]
3396
3297
  }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgEventService }, { type: ImgSelectionService }, { type: AlertService }, { type: UserSettingsService }, { type: RenamePictureService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { stateDisplayed: [{
3397
3298
  type: Input
3398
3299
  }], tabDisplayed: [{
3399
3300
  type: Input
3400
3301
  }], fullSize: [{
3401
3302
  type: Input
3402
- }], maxLengthCardShow: [{
3403
- type: Input
3404
3303
  }], nbRowToShow: [{
3405
3304
  type: Input
3406
3305
  }], listDisplayed: [{
@@ -3652,7 +3551,7 @@ class ImgTabsComponent {
3652
3551
  }
3653
3552
  }
3654
3553
  ImgTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgTabsComponent, deps: [{ token: ImgEventService }, { token: AlertService }, { token: i3$2.Router }], target: i0.ɵɵFactoryTarget.Component });
3655
- ImgTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImgTabsComponent, selector: "img-tabs", inputs: { multipleImgMode: "multipleImgMode", stateDisplayed: "stateDisplayed", listDisplayed: "listDisplayed" }, outputs: { imgManagerClosed: "imgManagerClosed", currentTab: "currentTab", switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgUploadedComponent", first: true, predicate: ["imgUploadedImg"], descendants: true }], ngImport: i0, template: "<div\n class=\"img-tabs\" [ngClass]=\"{'small': stateDisplayed === 'small'}\">\n <div class=\"wrapper-tabs\">\n <div\n class=\"tabs\"\n [ngClass]=\"\n {\n 'tabs--notWindow': stateDisplayed !== 'window',\n 'tabs--notDisplayed': stateDisplayed === 'window' && tabActive.value === tabs[3].value\n }\">\n\n <ul>\n <li class=\"is-active\" [ngClass]=\"{'is-active': tabActive.value === tabs[0].value}\" (click)=\"toggleTabs(tabs[0])\"><a>{{ tabs[0].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[1].value}\" (click)=\"toggleTabs(tabs[1])\"><a>{{ tabs[1].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[2].value}\" (click)=\"toggleTabs(tabs[2])\"><a>{{ tabs[2].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[3].value}\" *ngIf=\"editTab\"><a>{{ tabs[3].name | translate }}</a></li>\n </ul>\n <div\n class=\"img-tabs__canva\"\n [ngClass]=\"{'img-tabs__canva--window': stateDisplayed === 'window'}\">\n <canva-btn\n (showImgUploaded)=\"onShowImgUploaded()\"\n [stateDisplayed]=\"stateDisplayed\">\n </canva-btn>\n </div>\n </div>\n <div class=\"select-mobile-page\">\n <wac-select\n [(ngModel)]=\"tabActive\"\n name=\"tabs\"\n [items]=\"tabs\"\n ></wac-select>\n </div>\n </div>\n\n <!-- Upload section -->\n <div\n class=\"columns img-tabs__tabsFirst\"\n [ngClass]=\"{\n 'img-tabs__tabsFirst--small': stateDisplayed === 'small',\n 'img-tabs__tabsFirst--window': stateDisplayed === 'window'\n }\"\n *ngIf=\"tabActive.value === tabs[0].value\">\n <div class=\"column img-tabs__tabsFirst__upload\">\n <img-upload\n [stateDisplayed]=\"stateDisplayed\"\n (imgUploaded)=\"onImgUploaded($event)\"\n ></img-upload>\n </div>\n <div class=\"column img-tabs__tabsFirst__list\" [ngClass]=\"{\n 'img-tabs__tabsFirst__list--upload': imgUpload\n }\">\n <images-view\n *ngIf=\"!imgUpload\"\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"false\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n [nbRowToShow]=\"2\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"false\">\n </images-view>\n\n\n <div [hidden]=\"!imgUpload\">\n <upload-list\n #imgUploadedImg\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabActive.value\"\n [multipleImgMode]=\"multipleImgMode\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n >\n </upload-list>\n </div>\n </div>\n </div>\n\n <!-- Images section -->\n <div class=\"columns img-tabs__tabsSecond\" *ngIf=\"tabActive.value === tabs[1].value\">\n <div class=\"column\">\n\n <images-view\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"listDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"true\">\n </images-view>\n\n </div>\n </div>\n\n <!-- Pexels img section -->\n <div class=\"columns img-tabs__tabsThird\" *ngIf=\"tabActive.value === tabs[2].value\">\n <div class=\"column\">\n <pexels-lib\n [stateDisplayed]=\"stateDisplayed\"\n (showImgUploaded)=\"onShowImgUploaded()\">\n </pexels-lib>\n </div>\n </div>\n\n <!--Edition section -->\n <div class=\"columns img-tabs__tabsEdit\" *ngIf=\"tabActive.value === tabs[3].value\">\n <div class=\"column\">\n <img-editor\n [stateDisplayed]=\"stateDisplayed\"\n [imgToEdit]=\"imgToEdit\"\n (editClosed)=\"onEditClosed($event)\">\n </img-editor>\n </div>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImgUploadComponent, selector: "img-upload", inputs: ["stateDisplayed"], outputs: ["imgUploaded"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"], outputs: ["showImgUploaded"] }, { kind: "component", type: UploadListComponent, selector: "upload-list", inputs: ["stateDisplayed", "tabDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: ImgEditorComponent, selector: "img-editor", inputs: ["stateDisplayed", "imgToEdit"], outputs: ["editClosed"] }, { kind: "component", type: CanvaBtnComponent, selector: "canva-btn", inputs: ["stateDisplayed"], outputs: ["showImgUploaded"] }, { kind: "component", type: ImagesViewComponent, selector: "images-view", inputs: ["stateDisplayed", "tabDisplayed", "fullSize", "maxLengthCardShow", "nbRowToShow", "listDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: SelectComponent, selector: "wac-select", inputs: ["items", "placeholder", "label", "maxWidthItems", "search", "type", "callToAction", "maxWidth", "disabled"], outputs: ["selectValue", "clickOnCallToAction"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
3554
+ ImgTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: ImgTabsComponent, selector: "img-tabs", inputs: { multipleImgMode: "multipleImgMode", stateDisplayed: "stateDisplayed", listDisplayed: "listDisplayed" }, outputs: { imgManagerClosed: "imgManagerClosed", currentTab: "currentTab", switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgUploadedComponent", first: true, predicate: ["imgUploadedImg"], descendants: true }], ngImport: i0, template: "<div\n class=\"img-tabs\" [ngClass]=\"{'small': stateDisplayed === 'small'}\">\n <div class=\"wrapper-tabs\">\n <div\n class=\"tabs\"\n [ngClass]=\"\n {\n 'tabs--notWindow': stateDisplayed !== 'window',\n 'tabs--notDisplayed': stateDisplayed === 'window' && tabActive.value === tabs[3].value\n }\">\n\n <ul>\n <li class=\"is-active\" [ngClass]=\"{'is-active': tabActive.value === tabs[0].value}\" (click)=\"toggleTabs(tabs[0])\"><a>{{ tabs[0].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[1].value}\" (click)=\"toggleTabs(tabs[1])\"><a>{{ tabs[1].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[2].value}\" (click)=\"toggleTabs(tabs[2])\"><a>{{ tabs[2].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[3].value}\" *ngIf=\"editTab\"><a>{{ tabs[3].name | translate }}</a></li>\n </ul>\n <div\n class=\"img-tabs__canva\"\n [ngClass]=\"{'img-tabs__canva--window': stateDisplayed === 'window'}\">\n <canva-btn\n (showImgUploaded)=\"onShowImgUploaded()\"\n [stateDisplayed]=\"stateDisplayed\">\n </canva-btn>\n </div>\n </div>\n <div class=\"select-mobile-page\">\n <wac-select\n [(ngModel)]=\"tabActive\"\n name=\"tabs\"\n [items]=\"tabs\"\n ></wac-select>\n </div>\n </div>\n\n <!-- Upload section -->\n <div\n class=\"columns img-tabs__tabsFirst\"\n [ngClass]=\"{\n 'img-tabs__tabsFirst--small': stateDisplayed === 'small',\n 'img-tabs__tabsFirst--window': stateDisplayed === 'window'\n }\"\n *ngIf=\"tabActive.value === tabs[0].value\">\n <div class=\"column img-tabs__tabsFirst__upload\">\n <img-upload\n [stateDisplayed]=\"stateDisplayed\"\n (imgUploaded)=\"onImgUploaded($event)\"\n ></img-upload>\n </div>\n <div class=\"column img-tabs__tabsFirst__list\" [ngClass]=\"{\n 'img-tabs__tabsFirst__list--upload': imgUpload\n }\">\n <images-view\n *ngIf=\"!imgUpload\"\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"false\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n [nbRowToShow]=\"2\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"false\">\n </images-view>\n\n\n <div [hidden]=\"!imgUpload\">\n <upload-list\n #imgUploadedImg\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabActive.value\"\n [multipleImgMode]=\"multipleImgMode\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n >\n </upload-list>\n </div>\n </div>\n </div>\n\n <!-- Images section -->\n <div class=\"columns img-tabs__tabsSecond\" *ngIf=\"tabActive.value === tabs[1].value\">\n <div class=\"column\">\n\n <images-view\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"listDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"true\">\n </images-view>\n\n </div>\n </div>\n\n <!-- Pexels img section -->\n <div class=\"columns img-tabs__tabsThird\" *ngIf=\"tabActive.value === tabs[2].value\">\n <div class=\"column\">\n <pexels-lib\n [stateDisplayed]=\"stateDisplayed\"\n (showImgUploaded)=\"onShowImgUploaded()\">\n </pexels-lib>\n </div>\n </div>\n\n <!--Edition section -->\n <div class=\"columns img-tabs__tabsEdit\" *ngIf=\"tabActive.value === tabs[3].value\">\n <div class=\"column\">\n <img-editor\n [stateDisplayed]=\"stateDisplayed\"\n [imgToEdit]=\"imgToEdit\"\n (editClosed)=\"onEditClosed($event)\">\n </img-editor>\n </div>\n </div>\n\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImgUploadComponent, selector: "img-upload", inputs: ["stateDisplayed"], outputs: ["imgUploaded"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"] }, { kind: "component", type: UploadListComponent, selector: "upload-list", inputs: ["stateDisplayed", "tabDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: ImgEditorComponent, selector: "img-editor", inputs: ["stateDisplayed", "imgToEdit"], outputs: ["editClosed"] }, { kind: "component", type: CanvaBtnComponent, selector: "canva-btn", inputs: ["stateDisplayed"], outputs: ["showImgUploaded"] }, { kind: "component", type: ImagesViewComponent, selector: "images-view", inputs: ["stateDisplayed", "tabDisplayed", "fullSize", "nbRowToShow", "listDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: SelectComponent, selector: "wac-select", inputs: ["items", "placeholder", "label", "maxWidthItems", "search", "type", "callToAction", "maxWidth", "disabled"], outputs: ["selectValue", "clickOnCallToAction"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
3656
3555
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgTabsComponent, decorators: [{
3657
3556
  type: Component,
3658
3557
  args: [{ selector: 'img-tabs', template: "<div\n class=\"img-tabs\" [ngClass]=\"{'small': stateDisplayed === 'small'}\">\n <div class=\"wrapper-tabs\">\n <div\n class=\"tabs\"\n [ngClass]=\"\n {\n 'tabs--notWindow': stateDisplayed !== 'window',\n 'tabs--notDisplayed': stateDisplayed === 'window' && tabActive.value === tabs[3].value\n }\">\n\n <ul>\n <li class=\"is-active\" [ngClass]=\"{'is-active': tabActive.value === tabs[0].value}\" (click)=\"toggleTabs(tabs[0])\"><a>{{ tabs[0].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[1].value}\" (click)=\"toggleTabs(tabs[1])\"><a>{{ tabs[1].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[2].value}\" (click)=\"toggleTabs(tabs[2])\"><a>{{ tabs[2].name | translate }}</a></li>\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[3].value}\" *ngIf=\"editTab\"><a>{{ tabs[3].name | translate }}</a></li>\n </ul>\n <div\n class=\"img-tabs__canva\"\n [ngClass]=\"{'img-tabs__canva--window': stateDisplayed === 'window'}\">\n <canva-btn\n (showImgUploaded)=\"onShowImgUploaded()\"\n [stateDisplayed]=\"stateDisplayed\">\n </canva-btn>\n </div>\n </div>\n <div class=\"select-mobile-page\">\n <wac-select\n [(ngModel)]=\"tabActive\"\n name=\"tabs\"\n [items]=\"tabs\"\n ></wac-select>\n </div>\n </div>\n\n <!-- Upload section -->\n <div\n class=\"columns img-tabs__tabsFirst\"\n [ngClass]=\"{\n 'img-tabs__tabsFirst--small': stateDisplayed === 'small',\n 'img-tabs__tabsFirst--window': stateDisplayed === 'window'\n }\"\n *ngIf=\"tabActive.value === tabs[0].value\">\n <div class=\"column img-tabs__tabsFirst__upload\">\n <img-upload\n [stateDisplayed]=\"stateDisplayed\"\n (imgUploaded)=\"onImgUploaded($event)\"\n ></img-upload>\n </div>\n <div class=\"column img-tabs__tabsFirst__list\" [ngClass]=\"{\n 'img-tabs__tabsFirst__list--upload': imgUpload\n }\">\n <images-view\n *ngIf=\"!imgUpload\"\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"false\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n [nbRowToShow]=\"2\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"false\">\n </images-view>\n\n\n <div [hidden]=\"!imgUpload\">\n <upload-list\n #imgUploadedImg\n [stateDisplayed]=\"stateDisplayed\"\n [tabDisplayed]=\"tabActive.value\"\n [multipleImgMode]=\"multipleImgMode\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n >\n </upload-list>\n </div>\n </div>\n </div>\n\n <!-- Images section -->\n <div class=\"columns img-tabs__tabsSecond\" *ngIf=\"tabActive.value === tabs[1].value\">\n <div class=\"column\">\n\n <images-view\n [stateDisplayed]=\"stateDisplayed\"\n [listDisplayed]=\"listDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [tabDisplayed]=\"tabActive.value\"\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\n [fullSize]=\"true\">\n </images-view>\n\n </div>\n </div>\n\n <!-- Pexels img section -->\n <div class=\"columns img-tabs__tabsThird\" *ngIf=\"tabActive.value === tabs[2].value\">\n <div class=\"column\">\n <pexels-lib\n [stateDisplayed]=\"stateDisplayed\"\n (showImgUploaded)=\"onShowImgUploaded()\">\n </pexels-lib>\n </div>\n </div>\n\n <!--Edition section -->\n <div class=\"columns img-tabs__tabsEdit\" *ngIf=\"tabActive.value === tabs[3].value\">\n <div class=\"column\">\n <img-editor\n [stateDisplayed]=\"stateDisplayed\"\n [imgToEdit]=\"imgToEdit\"\n (editClosed)=\"onEditClosed($event)\">\n </img-editor>\n </div>\n </div>\n\n</div>\n" }]