@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.
- package/assets/i18n/en.json +1 -1
- package/assets/i18n/fr.json +1 -1
- package/esm2020/lib/components/images-view/images-view.component.mjs +90 -206
- package/esm2020/lib/components/img-tabs/img-tabs.component.mjs +1 -1
- package/esm2020/lib/components/pexels-lib/pexels-lib.component.mjs +3 -6
- package/esm2020/lib/directives/table/raw.directive.mjs +2 -2
- package/esm2020/lib/services/api.service.mjs +1 -1
- package/esm2020/lib/services/img-manager.service.mjs +47 -31
- package/esm2020/lib/services/rename-picture.service.mjs +1 -1
- package/fesm2015/wizishop-img-manager.mjs +130 -243
- package/fesm2015/wizishop-img-manager.mjs.map +1 -1
- package/fesm2020/wizishop-img-manager.mjs +139 -243
- package/fesm2020/wizishop-img-manager.mjs.map +1 -1
- package/lib/components/images-view/images-view.component.d.ts +24 -42
- package/lib/components/pexels-lib/pexels-lib.component.d.ts +2 -3
- package/lib/services/img-manager.service.d.ts +25 -13
- package/package.json +1 -1
- package/wizishop-img-manager-15.2.41.tgz +0 -0
- package/wz-img-manager.scss +1 -1
- package/wizishop-img-manager-15.2.40.tgz +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
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,
|
|
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';
|
|
@@ -461,6 +461,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
461
461
|
|
|
462
462
|
class ImgManagerService {
|
|
463
463
|
constructor() {
|
|
464
|
+
this.uploadService = inject(UploadService);
|
|
464
465
|
this.params = new HttpParams().set("limit", "20").set("page", "1");
|
|
465
466
|
// Display the img selection
|
|
466
467
|
this.pageFicheProductConfig = {
|
|
@@ -501,47 +502,57 @@ class ImgManagerService {
|
|
|
501
502
|
displayBtn: false
|
|
502
503
|
};
|
|
503
504
|
this.apiService = inject(ApiService);
|
|
505
|
+
this.destroy$ = new Subject();
|
|
506
|
+
this.searchImagesParameters$ = new BehaviorSubject(this.DEFAULT_SEARCH_PARAMS);
|
|
507
|
+
this.refreshImageList$ = new Subject();
|
|
508
|
+
this.resetImageList$ = merge(this.uploadService.imageUploaded$);
|
|
509
|
+
this.isLoading$ = new BehaviorSubject(true);
|
|
510
|
+
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({
|
|
511
|
+
imageList: this.apiService.getShopImgList(params).pipe(take$1(1)),
|
|
512
|
+
imageTotal: this.apiService.getShopTotalImgList(params).pipe(take$1(1))
|
|
513
|
+
})), tap(() => this.isLoading$.next(false)));
|
|
514
|
+
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));
|
|
515
|
+
}
|
|
516
|
+
get DEFAULT_SEARCH_PARAMS() {
|
|
517
|
+
return {
|
|
518
|
+
limit: '30',
|
|
519
|
+
page: '1',
|
|
520
|
+
};
|
|
504
521
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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);
|
|
522
|
+
get DEFAULT_DATA_LIST() {
|
|
523
|
+
return {
|
|
524
|
+
imageList: {
|
|
525
|
+
data: [],
|
|
526
|
+
filter: [],
|
|
527
|
+
limit: 0,
|
|
528
|
+
page: 0,
|
|
529
|
+
totalRecords: 0
|
|
530
|
+
},
|
|
531
|
+
imageTotal: 0
|
|
532
|
+
};
|
|
525
533
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
534
|
+
getHttpParameters(params) {
|
|
535
|
+
let parameters = new HttpParams();
|
|
536
|
+
parameters = parameters.set('id_file:sort', 'desc');
|
|
529
537
|
for (const param in params) {
|
|
530
|
-
|
|
538
|
+
parameters = parameters.set(param, params[param]);
|
|
531
539
|
}
|
|
532
|
-
if (params
|
|
533
|
-
|
|
540
|
+
if (params?.search) {
|
|
541
|
+
parameters = parameters.set('display_name:contains', params.search);
|
|
534
542
|
}
|
|
535
|
-
return
|
|
543
|
+
return parameters;
|
|
544
|
+
}
|
|
545
|
+
getShopImg(idFile) {
|
|
546
|
+
return this.apiService.getShopImg(idFile).pipe(tap(() => this.refreshImageList$.next()));
|
|
536
547
|
}
|
|
537
548
|
replaceImg(imageBase64, id_file) {
|
|
538
|
-
return this.apiService.replaceImg(imageBase64, id_file);
|
|
549
|
+
return this.apiService.replaceImg(imageBase64, id_file).pipe(tap(() => this.refreshImageList$.next()));
|
|
539
550
|
}
|
|
540
551
|
removeImg(id_file) {
|
|
541
|
-
return this.apiService.removeImg(id_file);
|
|
552
|
+
return this.apiService.removeImg(id_file).pipe(tap(() => this.refreshImageList$.next()));
|
|
542
553
|
}
|
|
543
554
|
removeMultipleImg(id_array) {
|
|
544
|
-
return this.apiService.removeMultipleImg(id_array);
|
|
555
|
+
return this.apiService.removeMultipleImg(id_array).pipe(tap(() => this.refreshImageList$.next()));
|
|
545
556
|
}
|
|
546
557
|
getImgManagerDisplayConfig(displayName) {
|
|
547
558
|
switch (displayName) {
|
|
@@ -567,6 +578,10 @@ class ImgManagerService {
|
|
|
567
578
|
this.simpleWithButtonOpenerConfig,
|
|
568
579
|
];
|
|
569
580
|
}
|
|
581
|
+
ngOnDestroy() {
|
|
582
|
+
this.destroy$.next();
|
|
583
|
+
this.destroy$.complete();
|
|
584
|
+
}
|
|
570
585
|
}
|
|
571
586
|
ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
572
587
|
ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService });
|
|
@@ -1139,7 +1154,7 @@ class PexelsService {
|
|
|
1139
1154
|
request = `/curated?per_page=${perPage}&page=${page}`;
|
|
1140
1155
|
}
|
|
1141
1156
|
}
|
|
1142
|
-
return this.http.get(this.apiBaseUrl + request, httpOptions).pipe(map((data) => {
|
|
1157
|
+
return this.http.get(this.apiBaseUrl + request, httpOptions).pipe(map$1((data) => {
|
|
1143
1158
|
return data;
|
|
1144
1159
|
}));
|
|
1145
1160
|
}
|
|
@@ -1172,7 +1187,7 @@ class AbstractDebounceDirective {
|
|
|
1172
1187
|
}
|
|
1173
1188
|
ngOnInit() {
|
|
1174
1189
|
this.emitEvent$
|
|
1175
|
-
.pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap$1(value => this.emitChange(value)))
|
|
1190
|
+
.pipe(takeUntil(this.subscription$), debounceTime$1(this.debounceTime), distinctUntilChanged$1(), tap$1(value => this.emitChange(value)))
|
|
1176
1191
|
.subscribe();
|
|
1177
1192
|
}
|
|
1178
1193
|
emitChange(value) {
|
|
@@ -1298,7 +1313,6 @@ class PexelLibComponent {
|
|
|
1298
1313
|
this.searchValue = '';
|
|
1299
1314
|
/** Pass to true to hide search input */
|
|
1300
1315
|
this.disableSearch = false;
|
|
1301
|
-
this.showImgUploaded = new EventEmitter();
|
|
1302
1316
|
this.perPage = 30;
|
|
1303
1317
|
this.searchUpdated = new Subject();
|
|
1304
1318
|
this.nbResult = 0;
|
|
@@ -1447,7 +1461,7 @@ class PexelLibComponent {
|
|
|
1447
1461
|
}
|
|
1448
1462
|
}
|
|
1449
1463
|
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" },
|
|
1464
|
+
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 <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
1465
|
easeInOut,
|
|
1452
1466
|
listAnnimation
|
|
1453
1467
|
] });
|
|
@@ -1463,8 +1477,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
1463
1477
|
type: Input
|
|
1464
1478
|
}], disableSearch: [{
|
|
1465
1479
|
type: Input
|
|
1466
|
-
}], showImgUploaded: [{
|
|
1467
|
-
type: Output
|
|
1468
1480
|
}], content: [{
|
|
1469
1481
|
type: ViewChild,
|
|
1470
1482
|
args: ['outerElement']
|
|
@@ -2927,7 +2939,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
2927
2939
|
type: Directive,
|
|
2928
2940
|
args: [{
|
|
2929
2941
|
// The selector has the same name as the tableRaw selector in table.component.html
|
|
2930
|
-
selector: '[tableRow]'
|
|
2942
|
+
selector: '[tableRow]',
|
|
2931
2943
|
}]
|
|
2932
2944
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
|
|
2933
2945
|
type: Inject,
|
|
@@ -2965,15 +2977,6 @@ class ImagesViewComponent {
|
|
|
2965
2977
|
this.listDisplayed = false; // Display format list or mosaic
|
|
2966
2978
|
this.multipleImgMode = false;
|
|
2967
2979
|
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
2980
|
this.widthLargeCard = 219; // Default value of a card width 199 + margin 20
|
|
2978
2981
|
this.widthSmallCard = 160; // Default value of a card width 140 + margin 20
|
|
2979
2982
|
this.nbFakeImg = 0;
|
|
@@ -3044,46 +3047,58 @@ class ImagesViewComponent {
|
|
|
3044
3047
|
smallImgWidthFactor: 0.125
|
|
3045
3048
|
}
|
|
3046
3049
|
];
|
|
3047
|
-
this.searchQueryChanged = new Subject();
|
|
3048
|
-
this.filtersChanged = new Subject();
|
|
3049
|
-
this.picturesList = [];
|
|
3050
|
-
this.savePictureList = [];
|
|
3051
3050
|
this.nbImgToDelSelected = 0;
|
|
3052
3051
|
this.disable = false; // Use to disable action during server request
|
|
3053
|
-
this.isLoading = true;
|
|
3054
|
-
this.isTotalRetrieved = false;
|
|
3055
3052
|
this.delListImgLoader = false;
|
|
3056
3053
|
this.initComponent = true;
|
|
3057
3054
|
this.failLoaded = false;
|
|
3058
|
-
this.displayPexelsResults = false; // Use when no img find by name, display img from Pexels
|
|
3059
3055
|
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
3056
|
this.errorGetAllImg = 'ImgManager.ImgLib.errorGetAllImg';
|
|
3066
3057
|
this.errorGetTotalImg = 'ImgManager.ImgLib.errorGetTotalImg';
|
|
3067
3058
|
this.errorGetImg = 'ImgManager.ImgLib.errorGetCanvaImg';
|
|
3068
|
-
this.msgNoImgFound = 'ImgManager.ImgLib.noImgFound';
|
|
3069
3059
|
this.errorRemoveImg = 'ImgManager.ImgList.errorRemoveImg';
|
|
3060
|
+
this.destroy$ = new Subject();
|
|
3061
|
+
this.vm$ = combineLatest({
|
|
3062
|
+
imageSelection: this.imgSelectionService.imgSelection$,
|
|
3063
|
+
imageListData: this.imgManager.imageList$,
|
|
3064
|
+
isLoading: this.imgManager.isLoading$,
|
|
3065
|
+
searchImagesParameters: this.imgManager.searchImagesParameters$,
|
|
3066
|
+
}).pipe(map$1(({ imageSelection, imageListData: { imageList, imageTotal }, isLoading, searchImagesParameters }) => {
|
|
3067
|
+
this.initVariables(true);
|
|
3068
|
+
this.calculateNbImgFake(imageList.data.length);
|
|
3069
|
+
const picturesList = this.setSelectedProperty(imageSelection, imageList.data);
|
|
3070
|
+
this.renamePictureService.setPicturesList(picturesList);
|
|
3071
|
+
const tableFilters = this.getTableFilters(searchImagesParameters, imageTotal);
|
|
3072
|
+
const keepImagesDisplayed = (this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1') || (this.tabDisplayed === 'images-view' && imageList.data.length && searchImagesParameters.page === '1');
|
|
3073
|
+
const skipSetImagesToDisplay = !!picturesList?.length && this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1';
|
|
3074
|
+
const hideUntilFetchedFirstPageImagesForTabUpload = this.tabDisplayed === 'img-upload' && (searchImagesParameters.page !== '1' || imageList?.page !== 1);
|
|
3075
|
+
return {
|
|
3076
|
+
isLoading: hideUntilFetchedFirstPageImagesForTabUpload || !keepImagesDisplayed && isLoading,
|
|
3077
|
+
displayPexelsResults: !isLoading && imageTotal === 0,
|
|
3078
|
+
picturesList,
|
|
3079
|
+
imageTotal,
|
|
3080
|
+
tableFilters,
|
|
3081
|
+
skipSetImagesToDisplay
|
|
3082
|
+
};
|
|
3083
|
+
}));
|
|
3070
3084
|
}
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
this.reducePictureListMaxLength();
|
|
3074
|
-
} */
|
|
3075
|
-
this.setEvents();
|
|
3076
|
-
this.imgSelectedList = this.imgSelectionService.getImgSelection();
|
|
3085
|
+
get searchImagesParameters$() {
|
|
3086
|
+
return this.imgManager.searchImagesParameters$;
|
|
3077
3087
|
}
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3088
|
+
getTableFilters(searchImagesParameters, imageTotal) {
|
|
3089
|
+
return {
|
|
3090
|
+
sort: undefined,
|
|
3091
|
+
order: undefined,
|
|
3092
|
+
searchValue: searchImagesParameters.search,
|
|
3093
|
+
totalItems: imageTotal,
|
|
3094
|
+
itemsPerPage: parseInt(searchImagesParameters.limit),
|
|
3095
|
+
currentPage: parseInt(searchImagesParameters.page)
|
|
3096
|
+
};
|
|
3084
3097
|
}
|
|
3085
|
-
|
|
3086
|
-
this.
|
|
3098
|
+
ngAfterViewInit() {
|
|
3099
|
+
this.vm$.pipe(take(1), filter(({ skipSetImagesToDisplay }) => !skipSetImagesToDisplay)).subscribe(({ tableFilters }) => {
|
|
3100
|
+
this.setNbImgToDisplay(tableFilters);
|
|
3101
|
+
});
|
|
3087
3102
|
}
|
|
3088
3103
|
/**
|
|
3089
3104
|
* true : go to list display
|
|
@@ -3098,19 +3113,14 @@ class ImagesViewComponent {
|
|
|
3098
3113
|
/**
|
|
3099
3114
|
* Calcul the number of img selected for masse deletion
|
|
3100
3115
|
*/
|
|
3101
|
-
onImgSelected() {
|
|
3102
|
-
this.setNbImgToDelSelected();
|
|
3103
|
-
}
|
|
3104
|
-
onShowImgUploaded() {
|
|
3105
|
-
this.searchText = null;
|
|
3106
|
-
this.searchedValue = null;
|
|
3107
|
-
this.getImgList();
|
|
3116
|
+
onImgSelected(picturesList) {
|
|
3117
|
+
this.setNbImgToDelSelected(picturesList);
|
|
3108
3118
|
}
|
|
3109
3119
|
onRenamePicture(pictureRenamed) {
|
|
3110
3120
|
console.log('onRenamePicture pictureRenamed', pictureRenamed);
|
|
3111
3121
|
this.renamePictureService.renamePicture(pictureRenamed);
|
|
3112
3122
|
}
|
|
3113
|
-
removeListImg() {
|
|
3123
|
+
removeListImg(picturesList) {
|
|
3114
3124
|
if (this.disable) {
|
|
3115
3125
|
return;
|
|
3116
3126
|
}
|
|
@@ -3120,26 +3130,28 @@ class ImagesViewComponent {
|
|
|
3120
3130
|
// Get the id of the img to remove
|
|
3121
3131
|
// And add deleted property
|
|
3122
3132
|
const idImgToRemove = [];
|
|
3123
|
-
|
|
3133
|
+
picturesList.forEach(img => {
|
|
3124
3134
|
if (img.delSelected) {
|
|
3125
3135
|
img.deleted = true;
|
|
3126
3136
|
idImgToRemove.push(img.id_file);
|
|
3127
3137
|
}
|
|
3128
3138
|
});
|
|
3129
|
-
this.imgManager.removeMultipleImg(idImgToRemove).subscribe(
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3139
|
+
this.imgManager.removeMultipleImg(idImgToRemove).subscribe({
|
|
3140
|
+
next: () => {
|
|
3141
|
+
this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
|
|
3142
|
+
},
|
|
3143
|
+
error: error => {
|
|
3144
|
+
this.imgManager.refreshImageList$.next();
|
|
3145
|
+
this.alertService.openAlert(this.errorRemoveImg);
|
|
3146
|
+
}
|
|
3135
3147
|
});
|
|
3136
3148
|
}
|
|
3137
|
-
selectImgChosen() {
|
|
3149
|
+
selectImgChosen(picturesList) {
|
|
3138
3150
|
if (this.disable) {
|
|
3139
3151
|
return;
|
|
3140
3152
|
}
|
|
3141
3153
|
const picturesListSelected = [];
|
|
3142
|
-
|
|
3154
|
+
picturesList.map(img => {
|
|
3143
3155
|
if (img.delSelected) {
|
|
3144
3156
|
img.delSelected = false;
|
|
3145
3157
|
img.selected = true;
|
|
@@ -3148,7 +3160,7 @@ class ImagesViewComponent {
|
|
|
3148
3160
|
picturesListSelected.push(img);
|
|
3149
3161
|
}
|
|
3150
3162
|
});
|
|
3151
|
-
this.setNbImgToDelSelected();
|
|
3163
|
+
this.setNbImgToDelSelected(picturesList);
|
|
3152
3164
|
this.imgSelectionService.setImgSelection(picturesListSelected);
|
|
3153
3165
|
}
|
|
3154
3166
|
displayConfirmImgSup() {
|
|
@@ -3163,17 +3175,14 @@ class ImagesViewComponent {
|
|
|
3163
3175
|
/**
|
|
3164
3176
|
* Event emit when a img selected in order to delete
|
|
3165
3177
|
*/
|
|
3166
|
-
onPicturesListChange() {
|
|
3167
|
-
this.setNbImgToDelSelected();
|
|
3168
|
-
}
|
|
3169
|
-
onFiltersChange() {
|
|
3170
|
-
this.getImgList();
|
|
3178
|
+
onPicturesListChange(picturesList) {
|
|
3179
|
+
this.setNbImgToDelSelected(picturesList);
|
|
3171
3180
|
}
|
|
3172
3181
|
/**
|
|
3173
3182
|
* Set default number of img per page to display at the initialisation
|
|
3174
3183
|
* This number is between 30 and 50
|
|
3175
3184
|
*/
|
|
3176
|
-
setNbImgToDisplay() {
|
|
3185
|
+
setNbImgToDisplay(tableFilters) {
|
|
3177
3186
|
const containerWidth = this.imgLibContainer.nativeElement.offsetWidth + 30; // + 30px -> left + right margin
|
|
3178
3187
|
const scrollWidth = window.innerWidth - document.body.offsetWidth;
|
|
3179
3188
|
const [maxImgWidthFactor, minImgWidthFactor] = this.getImgWidthFactors();
|
|
@@ -3181,7 +3190,11 @@ class ImagesViewComponent {
|
|
|
3181
3190
|
const maxImgWidth = Math.ceil((containerWidth + scrollWidth) * maxImgWidthFactor);
|
|
3182
3191
|
this.nbMaxImgPerLine = Math.floor(containerWidth / minImgWidth);
|
|
3183
3192
|
this.nbMinImgPerLine = Math.floor((containerWidth + scrollWidth) / maxImgWidth);
|
|
3184
|
-
this.
|
|
3193
|
+
this.searchImagesParameters$.next(this.getParams({
|
|
3194
|
+
...tableFilters,
|
|
3195
|
+
itemsPerPage: this.getTotalImgPerPage(),
|
|
3196
|
+
currentPage: 1
|
|
3197
|
+
}));
|
|
3185
3198
|
}
|
|
3186
3199
|
getImgWidthFactors() {
|
|
3187
3200
|
const screenWidth = window.innerWidth;
|
|
@@ -3212,40 +3225,30 @@ class ImagesViewComponent {
|
|
|
3212
3225
|
}
|
|
3213
3226
|
return total;
|
|
3214
3227
|
}
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
limit:
|
|
3218
|
-
page:
|
|
3228
|
+
getParams(tableFilters) {
|
|
3229
|
+
return {
|
|
3230
|
+
limit: tableFilters.itemsPerPage.toString(),
|
|
3231
|
+
page: tableFilters.currentPage.toString(),
|
|
3232
|
+
...(tableFilters.searchValue && { search: tableFilters.searchValue.toString() }),
|
|
3219
3233
|
};
|
|
3220
|
-
if (this.tableFilters.searchValue) {
|
|
3221
|
-
this.params.search = this.tableFilters.searchValue.toString();
|
|
3222
|
-
}
|
|
3223
3234
|
}
|
|
3224
3235
|
initVariables(loadingSuccess) {
|
|
3225
3236
|
this.nbImgToDelSelected = 0;
|
|
3226
3237
|
this.disable = false;
|
|
3227
|
-
this.isLoading = false;
|
|
3228
3238
|
this.delListImgLoader = false;
|
|
3229
3239
|
this.initComponent = false;
|
|
3230
|
-
this.displayPexelsResults = false;
|
|
3231
3240
|
this.failLoaded = !loadingSuccess;
|
|
3232
3241
|
this.nbFakeImg = 0;
|
|
3233
3242
|
}
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
this.picturesList.forEach(picture => {
|
|
3241
|
-
if (idImgSlectedList.indexOf(picture.id_file) !== -1) {
|
|
3242
|
-
picture.selected = true;
|
|
3243
|
+
setSelectedProperty(imgSelectedList, picturesList) {
|
|
3244
|
+
const picturesListSelected = JSON.parse(JSON.stringify(picturesList));
|
|
3245
|
+
imgSelectedList.forEach(img => {
|
|
3246
|
+
const selectedImg = picturesListSelected.find(picture => picture.id_file === img.id_file);
|
|
3247
|
+
if (selectedImg) {
|
|
3248
|
+
selectedImg.selected = true;
|
|
3243
3249
|
}
|
|
3244
3250
|
});
|
|
3245
|
-
|
|
3246
|
-
displayPexelsLib() {
|
|
3247
|
-
this.displayPexelsResults = true;
|
|
3248
|
-
this.alertService.openAlert(this.msgNoImgFound);
|
|
3251
|
+
return picturesListSelected;
|
|
3249
3252
|
}
|
|
3250
3253
|
/**
|
|
3251
3254
|
* Set a img list in order to fill properly all the line of images displayed in mosaic.
|
|
@@ -3253,137 +3256,32 @@ class ImagesViewComponent {
|
|
|
3253
3256
|
*/
|
|
3254
3257
|
calculateNbImgFake(nbImgDisplayed) {
|
|
3255
3258
|
const nbImgPerLine = this.stateDisplayed === 'small' || this.tabDisplayed === 'img-upload' ? this.nbMaxImgPerLine : this.nbMinImgPerLine;
|
|
3256
|
-
if (nbImgDisplayed % nbImgPerLine
|
|
3257
|
-
this.nbFakeImg =
|
|
3259
|
+
if (isNaN(nbImgDisplayed % nbImgPerLine)) {
|
|
3260
|
+
this.nbFakeImg = 0;
|
|
3261
|
+
return;
|
|
3258
3262
|
}
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
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
|
-
}
|
|
3263
|
+
if (nbImgDisplayed % nbImgPerLine !== 0) {
|
|
3264
|
+
setTimeout(() => {
|
|
3265
|
+
this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
|
|
3266
|
+
}, 0);
|
|
3279
3267
|
}
|
|
3280
|
-
return false;
|
|
3281
3268
|
}
|
|
3282
|
-
setNbImgToDelSelected() {
|
|
3283
|
-
this.nbImgToDelSelected =
|
|
3269
|
+
setNbImgToDelSelected(picturesList) {
|
|
3270
|
+
this.nbImgToDelSelected = picturesList.filter(img => img.delSelected).length;
|
|
3284
3271
|
if (!this.nbImgToDelSelected) {
|
|
3285
3272
|
this.confirmImgSup = false;
|
|
3286
3273
|
}
|
|
3287
3274
|
}
|
|
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
3275
|
switchDisplayWindowMosaic() {
|
|
3373
3276
|
this.switchDisplayWindow.emit(true);
|
|
3374
3277
|
}
|
|
3375
|
-
isLastImgRemovedInList() {
|
|
3376
|
-
return this.picturesList.some(picture => picture.id_file === this.imgEventService.imgRemoved$.getValue());
|
|
3377
|
-
}
|
|
3378
3278
|
ngOnDestroy() {
|
|
3379
|
-
this.
|
|
3380
|
-
this.
|
|
3381
|
-
this.imgAddedEvent.unsubscribe();
|
|
3382
|
-
this.imgSelectionChange.unsubscribe();
|
|
3279
|
+
this.destroy$.next();
|
|
3280
|
+
this.destroy$.complete();
|
|
3383
3281
|
}
|
|
3384
3282
|
}
|
|
3385
3283
|
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",
|
|
3284
|
+
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
3285
|
easeInOut,
|
|
3388
3286
|
insertRemove
|
|
3389
3287
|
] });
|
|
@@ -3392,15 +3290,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
3392
3290
|
args: [{ selector: 'images-view', animations: [
|
|
3393
3291
|
easeInOut,
|
|
3394
3292
|
insertRemove
|
|
3395
|
-
], template: "<div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\n
|
|
3293
|
+
], 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
3294
|
}], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgEventService }, { type: ImgSelectionService }, { type: AlertService }, { type: UserSettingsService }, { type: RenamePictureService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { stateDisplayed: [{
|
|
3397
3295
|
type: Input
|
|
3398
3296
|
}], tabDisplayed: [{
|
|
3399
3297
|
type: Input
|
|
3400
3298
|
}], fullSize: [{
|
|
3401
3299
|
type: Input
|
|
3402
|
-
}], maxLengthCardShow: [{
|
|
3403
|
-
type: Input
|
|
3404
3300
|
}], nbRowToShow: [{
|
|
3405
3301
|
type: Input
|
|
3406
3302
|
}], listDisplayed: [{
|
|
@@ -3652,7 +3548,7 @@ class ImgTabsComponent {
|
|
|
3652
3548
|
}
|
|
3653
3549
|
}
|
|
3654
3550
|
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"]
|
|
3551
|
+
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
3552
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgTabsComponent, decorators: [{
|
|
3657
3553
|
type: Component,
|
|
3658
3554
|
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" }]
|