@wizishop/img-manager 15.2.40 → 15.2.41

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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostBinding, HostListener, ViewChild, Pipe, Inject, NgModule } from '@angular/core';
3
- import { BehaviorSubject, Subject, tap, Observable, forkJoin, of, delay, combineLatest } from 'rxjs';
4
- import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap as tap$1 } from 'rxjs/operators';
3
+ import { BehaviorSubject, Subject, tap, Observable, forkJoin, merge, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, switchMap, map as map$1, take as take$1, startWith, shareReplay, combineLatest } from 'rxjs';
4
+ import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap as tap$1, filter } from 'rxjs/operators';
5
5
  import * as i1 from '@wizishop/ng-wizi-bulma';
6
6
  import { NwbAllModule } from '@wizishop/ng-wizi-bulma';
7
7
  import * as i3 from '@ngx-translate/core';
@@ -835,7 +835,6 @@ class PexelLibComponent {
835
835
  this.searchValue = '';
836
836
  /** Pass to true to hide search input */
837
837
  this.disableSearch = false;
838
- this.showImgUploaded = new EventEmitter();
839
838
  this.perPage = 30;
840
839
  this.searchUpdated = new Subject();
841
840
  this.nbResult = 0;
@@ -984,7 +983,7 @@ class PexelLibComponent {
984
983
  }
985
984
  }
986
985
  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 });
987
- 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: [
986
+ 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: [
988
987
  easeInOut,
989
988
  listAnnimation
990
989
  ] });
@@ -1000,8 +999,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1000
999
  type: Input
1001
1000
  }], disableSearch: [{
1002
1001
  type: Input
1003
- }], showImgUploaded: [{
1004
- type: Output
1005
1002
  }], content: [{
1006
1003
  type: ViewChild,
1007
1004
  args: ['outerElement']
@@ -1070,6 +1067,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
1070
1067
 
1071
1068
  class ImgManagerService {
1072
1069
  constructor() {
1070
+ this.uploadService = inject(UploadService);
1073
1071
  this.params = new HttpParams().set("limit", "20").set("page", "1");
1074
1072
  // Display the img selection
1075
1073
  this.pageFicheProductConfig = {
@@ -1110,47 +1108,57 @@ class ImgManagerService {
1110
1108
  displayBtn: false
1111
1109
  };
1112
1110
  this.apiService = inject(ApiService);
1111
+ this.destroy$ = new Subject();
1112
+ this.searchImagesParameters$ = new BehaviorSubject(this.DEFAULT_SEARCH_PARAMS);
1113
+ this.refreshImageList$ = new Subject();
1114
+ this.resetImageList$ = merge(this.uploadService.imageUploaded$);
1115
+ this.isLoading$ = new BehaviorSubject(true);
1116
+ this.fetchImagesList$ = merge(this.searchImagesParameters$.pipe(debounceTime$1(800), distinctUntilChanged$1()), this.refreshImageList$.pipe(switchMap(() => this.searchImagesParameters$))).pipe(map$1((params) => this.getHttpParameters(params)), tap(() => this.isLoading$.next(true)), switchMap((params) => forkJoin({
1117
+ imageList: this.apiService.getShopImgList(params).pipe(take$1(1)),
1118
+ imageTotal: this.apiService.getShopTotalImgList(params).pipe(take$1(1))
1119
+ })), tap(() => this.isLoading$.next(false)));
1120
+ this.imageList$ = merge(this.fetchImagesList$, this.resetImageList$.pipe(tap(() => this.isLoading$.next(true)), tap(() => this.searchImagesParameters$.next(this.DEFAULT_SEARCH_PARAMS)), map$1(() => this.DEFAULT_DATA_LIST))).pipe(startWith(this.DEFAULT_DATA_LIST), shareReplay(1));
1121
+ }
1122
+ get DEFAULT_SEARCH_PARAMS() {
1123
+ return {
1124
+ limit: '30',
1125
+ page: '1',
1126
+ };
1113
1127
  }
1114
- getShopImgList(params, forceToUpdate = false) {
1115
- if (!forceToUpdate &&
1116
- params && this.previousParams && this.previousParams.limit === params.limit
1117
- && this.previousParams.page === params.page && this.shopImgList
1118
- && this.previousParams.search === params.search) {
1119
- return of(this.shopImgList).pipe(delay(0));
1120
- }
1121
- const httpParams = params ? this.resetParams(params) : undefined;
1122
- return this.apiService.getShopImgList(httpParams).pipe(tap((shopImgList) => {
1123
- this.shopImgList = shopImgList;
1124
- this.previousParams = params;
1125
- }));
1126
- ;
1127
- }
1128
- getShopTotalImgList(params) {
1129
- const httpParams = params ? this.resetParams(params) : undefined;
1130
- return this.apiService.getShopTotalImgList(httpParams);
1131
- }
1132
- getShopImg(idFile) {
1133
- return this.apiService.getShopImg(idFile);
1128
+ get DEFAULT_DATA_LIST() {
1129
+ return {
1130
+ imageList: {
1131
+ data: [],
1132
+ filter: [],
1133
+ limit: 0,
1134
+ page: 0,
1135
+ totalRecords: 0
1136
+ },
1137
+ imageTotal: 0
1138
+ };
1134
1139
  }
1135
- resetParams(params) {
1136
- this.params = new HttpParams();
1137
- this.params = this.params.set('id_file:sort', 'desc');
1140
+ getHttpParameters(params) {
1141
+ let parameters = new HttpParams();
1142
+ parameters = parameters.set('id_file:sort', 'desc');
1138
1143
  for (const param in params) {
1139
- this.params = this.params.set(param, params[param]);
1144
+ parameters = parameters.set(param, params[param]);
1140
1145
  }
1141
- if (params.search) {
1142
- this.params = this.params.set('display_name:contains', params.search);
1146
+ if (params === null || params === void 0 ? void 0 : params.search) {
1147
+ parameters = parameters.set('display_name:contains', params.search);
1143
1148
  }
1144
- return this.params;
1149
+ return parameters;
1150
+ }
1151
+ getShopImg(idFile) {
1152
+ return this.apiService.getShopImg(idFile).pipe(tap(() => this.refreshImageList$.next()));
1145
1153
  }
1146
1154
  replaceImg(imageBase64, id_file) {
1147
- return this.apiService.replaceImg(imageBase64, id_file);
1155
+ return this.apiService.replaceImg(imageBase64, id_file).pipe(tap(() => this.refreshImageList$.next()));
1148
1156
  }
1149
1157
  removeImg(id_file) {
1150
- return this.apiService.removeImg(id_file);
1158
+ return this.apiService.removeImg(id_file).pipe(tap(() => this.refreshImageList$.next()));
1151
1159
  }
1152
1160
  removeMultipleImg(id_array) {
1153
- return this.apiService.removeMultipleImg(id_array);
1161
+ return this.apiService.removeMultipleImg(id_array).pipe(tap(() => this.refreshImageList$.next()));
1154
1162
  }
1155
1163
  getImgManagerDisplayConfig(displayName) {
1156
1164
  switch (displayName) {
@@ -1176,6 +1184,10 @@ class ImgManagerService {
1176
1184
  this.simpleWithButtonOpenerConfig,
1177
1185
  ];
1178
1186
  }
1187
+ ngOnDestroy() {
1188
+ this.destroy$.next();
1189
+ this.destroy$.complete();
1190
+ }
1179
1191
  }
1180
1192
  ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1181
1193
  ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService });
@@ -2918,7 +2930,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
2918
2930
  type: Directive,
2919
2931
  args: [{
2920
2932
  // The selector has the same name as the tableRaw selector in table.component.html
2921
- selector: '[tableRow]'
2933
+ selector: '[tableRow]',
2922
2934
  }]
2923
2935
  }], ctorParameters: function () {
2924
2936
  return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
@@ -2958,15 +2970,6 @@ class ImagesViewComponent {
2958
2970
  this.listDisplayed = false; // Display format list or mosaic
2959
2971
  this.multipleImgMode = false;
2960
2972
  this.switchDisplayWindow = new EventEmitter();
2961
- // Data filters
2962
- this.tableFilters = {
2963
- sort: undefined,
2964
- order: undefined,
2965
- searchValue: '',
2966
- totalItems: 0,
2967
- itemsPerPage: 0,
2968
- currentPage: 1
2969
- };
2970
2973
  this.widthLargeCard = 219; // Default value of a card width 199 + margin 20
2971
2974
  this.widthSmallCard = 160; // Default value of a card width 140 + margin 20
2972
2975
  this.nbFakeImg = 0;
@@ -3037,46 +3040,58 @@ class ImagesViewComponent {
3037
3040
  smallImgWidthFactor: 0.125
3038
3041
  }
3039
3042
  ];
3040
- this.searchQueryChanged = new Subject();
3041
- this.filtersChanged = new Subject();
3042
- this.picturesList = [];
3043
- this.savePictureList = [];
3044
3043
  this.nbImgToDelSelected = 0;
3045
3044
  this.disable = false; // Use to disable action during server request
3046
- this.isLoading = true;
3047
- this.isTotalRetrieved = false;
3048
3045
  this.delListImgLoader = false;
3049
3046
  this.initComponent = true;
3050
3047
  this.failLoaded = false;
3051
- this.displayPexelsResults = false; // Use when no img find by name, display img from Pexels
3052
3048
  this.confirmImgSup = false;
3053
- // Paginator Params
3054
- this.pageIndex = 0;
3055
- this.length = 0;
3056
- this.pageSize = 30; // Default value
3057
- this.pageSizeOptions = [25, 50, 100, 250];
3058
3049
  this.errorGetAllImg = 'ImgManager.ImgLib.errorGetAllImg';
3059
3050
  this.errorGetTotalImg = 'ImgManager.ImgLib.errorGetTotalImg';
3060
3051
  this.errorGetImg = 'ImgManager.ImgLib.errorGetCanvaImg';
3061
- this.msgNoImgFound = 'ImgManager.ImgLib.noImgFound';
3062
3052
  this.errorRemoveImg = 'ImgManager.ImgList.errorRemoveImg';
3053
+ this.destroy$ = new Subject();
3054
+ this.vm$ = combineLatest({
3055
+ imageSelection: this.imgSelectionService.imgSelection$,
3056
+ imageListData: this.imgManager.imageList$,
3057
+ isLoading: this.imgManager.isLoading$,
3058
+ searchImagesParameters: this.imgManager.searchImagesParameters$,
3059
+ }).pipe(map(({ imageSelection, imageListData: { imageList, imageTotal }, isLoading, searchImagesParameters }) => {
3060
+ this.initVariables(true);
3061
+ this.calculateNbImgFake(imageList.data.length);
3062
+ const picturesList = this.setSelectedProperty(imageSelection, imageList.data);
3063
+ this.renamePictureService.setPicturesList(picturesList);
3064
+ const tableFilters = this.getTableFilters(searchImagesParameters, imageTotal);
3065
+ const keepImagesDisplayed = (this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1') || (this.tabDisplayed === 'images-view' && imageList.data.length && searchImagesParameters.page === '1');
3066
+ const skipSetImagesToDisplay = !!(picturesList === null || picturesList === void 0 ? void 0 : picturesList.length) && this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1';
3067
+ const hideUntilFetchedFirstPageImagesForTabUpload = this.tabDisplayed === 'img-upload' && (searchImagesParameters.page !== '1' || (imageList === null || imageList === void 0 ? void 0 : imageList.page) !== 1);
3068
+ return {
3069
+ isLoading: hideUntilFetchedFirstPageImagesForTabUpload || !keepImagesDisplayed && isLoading,
3070
+ displayPexelsResults: !isLoading && imageTotal === 0,
3071
+ picturesList,
3072
+ imageTotal,
3073
+ tableFilters,
3074
+ skipSetImagesToDisplay
3075
+ };
3076
+ }));
3063
3077
  }
3064
- ngOnInit() {
3065
- /* if (this.maxLengthCardShow) {
3066
- this.reducePictureListMaxLength();
3067
- } */
3068
- this.setEvents();
3069
- this.imgSelectedList = this.imgSelectionService.getImgSelection();
3078
+ get searchImagesParameters$() {
3079
+ return this.imgManager.searchImagesParameters$;
3070
3080
  }
3071
- ngAfterViewInit() {
3072
- this.setNbImgToDisplay();
3073
- this._getImgList();
3074
- if (!this.savePictureList) {
3075
- this.savePictureList = this.picturesList;
3076
- }
3081
+ getTableFilters(searchImagesParameters, imageTotal) {
3082
+ return {
3083
+ sort: undefined,
3084
+ order: undefined,
3085
+ searchValue: searchImagesParameters.search,
3086
+ totalItems: imageTotal,
3087
+ itemsPerPage: parseInt(searchImagesParameters.limit),
3088
+ currentPage: parseInt(searchImagesParameters.page)
3089
+ };
3077
3090
  }
3078
- getImgList() {
3079
- this.filtersChanged.next();
3091
+ ngAfterViewInit() {
3092
+ this.vm$.pipe(take(1), filter(({ skipSetImagesToDisplay }) => !skipSetImagesToDisplay)).subscribe(({ tableFilters }) => {
3093
+ this.setNbImgToDisplay(tableFilters);
3094
+ });
3080
3095
  }
3081
3096
  /**
3082
3097
  * true : go to list display
@@ -3091,19 +3106,14 @@ class ImagesViewComponent {
3091
3106
  /**
3092
3107
  * Calcul the number of img selected for masse deletion
3093
3108
  */
3094
- onImgSelected() {
3095
- this.setNbImgToDelSelected();
3096
- }
3097
- onShowImgUploaded() {
3098
- this.searchText = null;
3099
- this.searchedValue = null;
3100
- this.getImgList();
3109
+ onImgSelected(picturesList) {
3110
+ this.setNbImgToDelSelected(picturesList);
3101
3111
  }
3102
3112
  onRenamePicture(pictureRenamed) {
3103
3113
  console.log('onRenamePicture pictureRenamed', pictureRenamed);
3104
3114
  this.renamePictureService.renamePicture(pictureRenamed);
3105
3115
  }
3106
- removeListImg() {
3116
+ removeListImg(picturesList) {
3107
3117
  if (this.disable) {
3108
3118
  return;
3109
3119
  }
@@ -3113,26 +3123,28 @@ class ImagesViewComponent {
3113
3123
  // Get the id of the img to remove
3114
3124
  // And add deleted property
3115
3125
  const idImgToRemove = [];
3116
- this.picturesList.forEach(img => {
3126
+ picturesList.forEach(img => {
3117
3127
  if (img.delSelected) {
3118
3128
  img.deleted = true;
3119
3129
  idImgToRemove.push(img.id_file);
3120
3130
  }
3121
3131
  });
3122
- this.imgManager.removeMultipleImg(idImgToRemove).subscribe(() => {
3123
- this.getImgList();
3124
- this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
3125
- }, error => {
3126
- this.getImgList();
3127
- this.alertService.openAlert(this.errorRemoveImg);
3132
+ this.imgManager.removeMultipleImg(idImgToRemove).subscribe({
3133
+ next: () => {
3134
+ this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
3135
+ },
3136
+ error: error => {
3137
+ this.imgManager.refreshImageList$.next();
3138
+ this.alertService.openAlert(this.errorRemoveImg);
3139
+ }
3128
3140
  });
3129
3141
  }
3130
- selectImgChosen() {
3142
+ selectImgChosen(picturesList) {
3131
3143
  if (this.disable) {
3132
3144
  return;
3133
3145
  }
3134
3146
  const picturesListSelected = [];
3135
- this.picturesList.map(img => {
3147
+ picturesList.map(img => {
3136
3148
  if (img.delSelected) {
3137
3149
  img.delSelected = false;
3138
3150
  img.selected = true;
@@ -3141,7 +3153,7 @@ class ImagesViewComponent {
3141
3153
  picturesListSelected.push(img);
3142
3154
  }
3143
3155
  });
3144
- this.setNbImgToDelSelected();
3156
+ this.setNbImgToDelSelected(picturesList);
3145
3157
  this.imgSelectionService.setImgSelection(picturesListSelected);
3146
3158
  }
3147
3159
  displayConfirmImgSup() {
@@ -3156,17 +3168,14 @@ class ImagesViewComponent {
3156
3168
  /**
3157
3169
  * Event emit when a img selected in order to delete
3158
3170
  */
3159
- onPicturesListChange() {
3160
- this.setNbImgToDelSelected();
3161
- }
3162
- onFiltersChange() {
3163
- this.getImgList();
3171
+ onPicturesListChange(picturesList) {
3172
+ this.setNbImgToDelSelected(picturesList);
3164
3173
  }
3165
3174
  /**
3166
3175
  * Set default number of img per page to display at the initialisation
3167
3176
  * This number is between 30 and 50
3168
3177
  */
3169
- setNbImgToDisplay() {
3178
+ setNbImgToDisplay(tableFilters) {
3170
3179
  const containerWidth = this.imgLibContainer.nativeElement.offsetWidth + 30; // + 30px -> left + right margin
3171
3180
  const scrollWidth = window.innerWidth - document.body.offsetWidth;
3172
3181
  const [maxImgWidthFactor, minImgWidthFactor] = this.getImgWidthFactors();
@@ -3174,7 +3183,7 @@ class ImagesViewComponent {
3174
3183
  const maxImgWidth = Math.ceil((containerWidth + scrollWidth) * maxImgWidthFactor);
3175
3184
  this.nbMaxImgPerLine = Math.floor(containerWidth / minImgWidth);
3176
3185
  this.nbMinImgPerLine = Math.floor((containerWidth + scrollWidth) / maxImgWidth);
3177
- this.pageSize = this.getTotalImgPerPage();
3186
+ this.searchImagesParameters$.next(this.getParams(Object.assign(Object.assign({}, tableFilters), { itemsPerPage: this.getTotalImgPerPage(), currentPage: 1 })));
3178
3187
  }
3179
3188
  getImgWidthFactors() {
3180
3189
  const screenWidth = window.innerWidth;
@@ -3205,41 +3214,26 @@ class ImagesViewComponent {
3205
3214
  }
3206
3215
  return total;
3207
3216
  }
3208
- setParams() {
3209
- var _a;
3210
- this.params = {
3211
- limit: ((_a = this.maxLengthCardShow) === null || _a === void 0 ? void 0 : _a.toString()) || (this.tableFilters.itemsPerPage ? this.tableFilters.itemsPerPage.toString() : this.pageSize.toString()),
3212
- page: this.tableFilters.currentPage.toString()
3213
- };
3214
- if (this.tableFilters.searchValue) {
3215
- this.params.search = this.tableFilters.searchValue.toString();
3216
- }
3217
+ getParams(tableFilters) {
3218
+ return Object.assign({ limit: tableFilters.itemsPerPage.toString(), page: tableFilters.currentPage.toString() }, (tableFilters.searchValue && { search: tableFilters.searchValue.toString() }));
3217
3219
  }
3218
3220
  initVariables(loadingSuccess) {
3219
3221
  this.nbImgToDelSelected = 0;
3220
3222
  this.disable = false;
3221
- this.isLoading = false;
3222
3223
  this.delListImgLoader = false;
3223
3224
  this.initComponent = false;
3224
- this.displayPexelsResults = false;
3225
3225
  this.failLoaded = !loadingSuccess;
3226
3226
  this.nbFakeImg = 0;
3227
3227
  }
3228
- selectImgSelected() {
3229
- if (!this.imgSelectedList || !this.imgSelectedList.length) {
3230
- return;
3231
- }
3232
- const idImgSlectedList = [];
3233
- this.imgSelectedList.forEach(img => idImgSlectedList.push(img.id_file));
3234
- this.picturesList.forEach(picture => {
3235
- if (idImgSlectedList.indexOf(picture.id_file) !== -1) {
3236
- picture.selected = true;
3228
+ setSelectedProperty(imgSelectedList, picturesList) {
3229
+ const picturesListSelected = JSON.parse(JSON.stringify(picturesList));
3230
+ imgSelectedList.forEach(img => {
3231
+ const selectedImg = picturesListSelected.find(picture => picture.id_file === img.id_file);
3232
+ if (selectedImg) {
3233
+ selectedImg.selected = true;
3237
3234
  }
3238
3235
  });
3239
- }
3240
- displayPexelsLib() {
3241
- this.displayPexelsResults = true;
3242
- this.alertService.openAlert(this.msgNoImgFound);
3236
+ return picturesListSelected;
3243
3237
  }
3244
3238
  /**
3245
3239
  * Set a img list in order to fill properly all the line of images displayed in mosaic.
@@ -3247,137 +3241,32 @@ class ImagesViewComponent {
3247
3241
  */
3248
3242
  calculateNbImgFake(nbImgDisplayed) {
3249
3243
  const nbImgPerLine = this.stateDisplayed === 'small' || this.tabDisplayed === 'img-upload' ? this.nbMaxImgPerLine : this.nbMinImgPerLine;
3250
- if (nbImgDisplayed % nbImgPerLine !== 0) {
3251
- this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
3244
+ if (isNaN(nbImgDisplayed % nbImgPerLine)) {
3245
+ this.nbFakeImg = 0;
3246
+ return;
3252
3247
  }
3253
- }
3254
- getImg(id_file) {
3255
- this.imgManager.getShopImg(id_file).pipe(take(1)).subscribe({
3256
- next: (picture) => {
3257
- if (!this.imgAlreadyExist(picture.id_file)) {
3258
- // check the img is not already present
3259
- this.picturesList.unshift(picture);
3260
- this.length += 1;
3261
- }
3262
- },
3263
- error: () => {
3264
- this.alertService.openAlert(this.errorGetImg);
3265
- }
3266
- });
3267
- }
3268
- imgAlreadyExist(id_file) {
3269
- for (const img of this.picturesList) {
3270
- if (img.id_file === id_file) {
3271
- return true;
3272
- }
3248
+ if (nbImgDisplayed % nbImgPerLine !== 0) {
3249
+ setTimeout(() => {
3250
+ this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
3251
+ }, 0);
3273
3252
  }
3274
- return false;
3275
3253
  }
3276
- setNbImgToDelSelected() {
3277
- this.nbImgToDelSelected = this.picturesList.filter(img => img.delSelected).length;
3254
+ setNbImgToDelSelected(picturesList) {
3255
+ this.nbImgToDelSelected = picturesList.filter(img => img.delSelected).length;
3278
3256
  if (!this.nbImgToDelSelected) {
3279
3257
  this.confirmImgSup = false;
3280
3258
  }
3281
3259
  }
3282
- setEvents() {
3283
- // Add a timer to retrieve img when the search bar or the paginator are used
3284
- this.searchQueryChanged
3285
- .pipe(debounceTime(400)) // wait 0.5 sec after the last event before emitting last event
3286
- .subscribe(data => {
3287
- this.getImgList();
3288
- });
3289
- this.filtersChanged
3290
- .pipe(debounceTime(800)) // wait 0.8 sec after the last event before emitting last event
3291
- .subscribe(data => {
3292
- this._getImgList();
3293
- });
3294
- // Reload img when img is/are removed
3295
- this.imgRemovedEvent = this.imgEventService.imgRemoved$.subscribe(id_file => {
3296
- this.getImgList();
3297
- });
3298
- // Create img from Canva
3299
- this.imgAddedEvent = this.imgEventService.getImgAddedEventListner().subscribe(id_file => {
3300
- if (id_file && !this.imgAlreadyExist(id_file)) {
3301
- this.getImg(id_file);
3302
- }
3303
- });
3304
- this.imgSelectionChange = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
3305
- if (this.listDisplayed) {
3306
- return;
3307
- }
3308
- const idFileList = [];
3309
- imgSelection.map(img => idFileList.push(img.id_file));
3310
- for (const picture of this.picturesList) {
3311
- if (idFileList.indexOf(picture.id_file) === -1) {
3312
- picture.selected = false;
3313
- }
3314
- }
3315
- });
3316
- }
3317
- _getImgList() {
3318
- this.isLoading = true;
3319
- this.displayPexelsResults = false;
3320
- this.setParams();
3321
- this.refreshTotalImgList();
3322
- const forceToUpdate = this.isLastImgRemovedInList();
3323
- this.imgManager.getShopImgList(this.params, forceToUpdate).pipe(take(1)).subscribe({
3324
- next: (data) => {
3325
- this.initVariables(true);
3326
- const nbImgDisplayed = data.data.length;
3327
- this.calculateNbImgFake(nbImgDisplayed);
3328
- this.picturesList = data.data;
3329
- this.renamePictureService.setPicturesList(this.picturesList);
3330
- this.selectImgSelected();
3331
- this.length = this.isTotalRetrieved ? this.length : data.totalRecords;
3332
- this.tableFilters.totalItems = this.isTotalRetrieved ? this.tableFilters.totalItems : data.totalRecords;
3333
- this.tableFilters.itemsPerPage = this.tableFilters.itemsPerPage ? this.tableFilters.itemsPerPage : this.pageSize;
3334
- // Display Pexels if no result
3335
- if (data.totalRecords === 0) {
3336
- this.displayPexelsLib();
3337
- }
3338
- this.changeDetectorRef.markForCheck(); // In wizi-admin, the change detection is not working properly
3339
- },
3340
- error: error => {
3341
- this.alertService.openAlert(this.errorGetAllImg);
3342
- this.initVariables(false);
3343
- }
3344
- });
3345
- }
3346
- refreshTotalImgList() {
3347
- const searchValue = this.tableFilters.searchValue;
3348
- if (this.isTotalRetrieved && searchValue === this.previousSearchValue) {
3349
- // Keep current total result
3350
- return;
3351
- }
3352
- this.isTotalRetrieved = false;
3353
- this.imgManager.getShopTotalImgList(this.params).pipe(take(1)).subscribe({
3354
- next: total => {
3355
- this.previousSearchValue = searchValue;
3356
- this.isTotalRetrieved = true;
3357
- this.length = total;
3358
- this.tableFilters.totalItems = total;
3359
- },
3360
- error: error => {
3361
- //this.alertService.openAlert(this.errorGetTotalImg);
3362
- this.initVariables(false);
3363
- }
3364
- });
3365
- }
3366
3260
  switchDisplayWindowMosaic() {
3367
3261
  this.switchDisplayWindow.emit(true);
3368
3262
  }
3369
- isLastImgRemovedInList() {
3370
- return this.picturesList.some(picture => picture.id_file === this.imgEventService.imgRemoved$.getValue());
3371
- }
3372
3263
  ngOnDestroy() {
3373
- this.searchQueryChanged.unsubscribe();
3374
- this.imgRemovedEvent.unsubscribe();
3375
- this.imgAddedEvent.unsubscribe();
3376
- this.imgSelectionChange.unsubscribe();
3264
+ this.destroy$.next();
3265
+ this.destroy$.complete();
3377
3266
  }
3378
3267
  }
3379
3268
  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 });
3380
- 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: [
3269
+ 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: [
3381
3270
  easeInOut,
3382
3271
  insertRemove
3383
3272
  ] });
@@ -3386,15 +3275,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
3386
3275
  args: [{ selector: 'images-view', animations: [
3387
3276
  easeInOut,
3388
3277
  insertRemove
3389
- ], 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" }]
3278
+ ], 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>" }]
3390
3279
  }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgEventService }, { type: ImgSelectionService }, { type: AlertService }, { type: UserSettingsService }, { type: RenamePictureService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { stateDisplayed: [{
3391
3280
  type: Input
3392
3281
  }], tabDisplayed: [{
3393
3282
  type: Input
3394
3283
  }], fullSize: [{
3395
3284
  type: Input
3396
- }], maxLengthCardShow: [{
3397
- type: Input
3398
3285
  }], nbRowToShow: [{
3399
3286
  type: Input
3400
3287
  }], listDisplayed: [{
@@ -3646,7 +3533,7 @@ class ImgTabsComponent {
3646
3533
  }
3647
3534
  }
3648
3535
  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 });
3649
- 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" }] });
3536
+ 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" }] });
3650
3537
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgTabsComponent, decorators: [{
3651
3538
  type: Component,
3652
3539
  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" }]