@wizishop/img-manager 15.2.1 → 15.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/images-view/images-view.component.mjs +4 -4
- package/esm2020/lib/components/img-editor/img-editor.component.mjs +1 -1
- package/esm2020/lib/components/img-upload/img-upload.component.mjs +13 -10
- package/esm2020/lib/components/pexels-lib/pexels-lib.component.mjs +24 -23
- package/esm2020/lib/services/alert.service.mjs +3 -6
- package/esm2020/lib/services/api.service.mjs +1 -1
- package/esm2020/lib/services/canva.service.mjs +3 -6
- package/esm2020/lib/services/config/img-cdn.service.mjs +3 -6
- package/esm2020/lib/services/dom.service.mjs +3 -6
- package/esm2020/lib/services/img-event.service.mjs +4 -7
- package/esm2020/lib/services/img-manager.service.mjs +6 -22
- package/esm2020/lib/services/img-selection.service.mjs +2 -18
- package/esm2020/lib/services/pexels.service.mjs +4 -7
- package/esm2020/lib/services/rename-picture.service.mjs +3 -4
- package/esm2020/lib/services/snackbar.service.mjs +64 -0
- package/esm2020/lib/services/table/filters-table.service.mjs +3 -6
- package/esm2020/lib/services/upload.service.mjs +8 -10
- package/esm2020/lib/services/user-settings.service.mjs +4 -7
- package/esm2020/lib/wz-img-manager.component.mjs +6 -11
- package/esm2020/lib/wz-img-manager.module.mjs +28 -2
- package/fesm2015/wizishop-img-manager.mjs +272 -259
- package/fesm2015/wizishop-img-manager.mjs.map +1 -1
- package/fesm2020/wizishop-img-manager.mjs +206 -193
- package/fesm2020/wizishop-img-manager.mjs.map +1 -1
- package/lib/components/pexels-lib/pexels-lib.component.d.ts +3 -4
- package/lib/services/api.service.d.ts +8 -8
- package/lib/services/config/img-cdn.service.d.ts +1 -2
- package/lib/services/img-event.service.d.ts +0 -1
- package/lib/services/img-manager.service.d.ts +5 -12
- package/lib/services/img-selection.service.d.ts +0 -6
- package/lib/services/rename-picture.service.d.ts +1 -1
- package/lib/services/snackbar.service.d.ts +19 -0
- package/lib/services/upload.service.d.ts +3 -4
- package/lib/services/user-settings.service.d.ts +0 -1
- package/lib/wz-img-manager.component.d.ts +2 -2
- package/package.json +1 -1
- package/wizishop-img-manager-15.2.4.tgz +0 -0
- package/wz-img-manager.scss +58 -58
- package/wizishop-img-manager-15.2.1.tgz +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable,
|
|
3
|
-
import { BehaviorSubject,
|
|
4
|
-
import
|
|
5
|
-
import { HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
6
|
-
import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap as tap$1 } from 'rxjs/operators';
|
|
2
|
+
import { Injectable, inject, Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostBinding, HostListener, ViewChild, Pipe, Inject, NgModule } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject, Subject, Observable, forkJoin, of, delay, tap as tap$1 } from 'rxjs';
|
|
4
|
+
import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';
|
|
7
5
|
import * as i1 from '@wizishop/ng-wizi-bulma';
|
|
8
6
|
import { NwbAllModule } from '@wizishop/ng-wizi-bulma';
|
|
9
7
|
import * as i3 from '@ngx-translate/core';
|
|
@@ -14,6 +12,8 @@ import * as i3$2 from '@angular/router';
|
|
|
14
12
|
import * as i2$1 from '@angular/forms';
|
|
15
13
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
16
14
|
import { trigger, state, style, transition, animate, query, stagger } from '@angular/animations';
|
|
15
|
+
import * as i3$1 from '@angular/common/http';
|
|
16
|
+
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
17
17
|
import * as i4 from 'ngx-scrollbar';
|
|
18
18
|
import { NgScrollbarModule } from 'ngx-scrollbar';
|
|
19
19
|
import * as i8 from 'ngx-scrollbar/reached-event';
|
|
@@ -97,162 +97,6 @@ ImgSelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0",
|
|
|
97
97
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgSelectionService, decorators: [{
|
|
98
98
|
type: Injectable
|
|
99
99
|
}], ctorParameters: function () { return []; } });
|
|
100
|
-
const ImgSelectionServiceProvider = {
|
|
101
|
-
provide: ImgSelectionService,
|
|
102
|
-
useFactory: (parentService) => {
|
|
103
|
-
console.log('parentService', !!parentService);
|
|
104
|
-
// Vérifie si le service existe déjà dans le provider parent
|
|
105
|
-
if (parentService) {
|
|
106
|
-
return parentService;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
// Si le service n'existe pas dans le provider parent, crée un nouveau service
|
|
110
|
-
return new ImgSelectionService();
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
// Utilise l'injection conditionnelle pour vérifier si le service existe déjà dans le provider parent
|
|
114
|
-
deps: [[new Optional(), new SkipSelf(), ImgSelectionService]],
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
class ApiService {
|
|
118
|
-
}
|
|
119
|
-
ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
120
|
-
ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService });
|
|
121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService, decorators: [{
|
|
122
|
-
type: Injectable
|
|
123
|
-
}] });
|
|
124
|
-
|
|
125
|
-
class ImgManagerService {
|
|
126
|
-
constructor(apiService) {
|
|
127
|
-
this.apiService = apiService;
|
|
128
|
-
this.params = new HttpParams().set("limit", "20").set("page", "1");
|
|
129
|
-
// Display the img selection
|
|
130
|
-
this.pageFicheProductConfig = {
|
|
131
|
-
stateDisplayed: 'closed',
|
|
132
|
-
multipleImgMode: true,
|
|
133
|
-
showImgManagerModule: true,
|
|
134
|
-
showSelection: true,
|
|
135
|
-
displayBtn: true,
|
|
136
|
-
pageficheProduct: true
|
|
137
|
-
};
|
|
138
|
-
this.angularFicheProductConfig = {
|
|
139
|
-
stateDisplayed: 'closed',
|
|
140
|
-
multipleImgMode: true,
|
|
141
|
-
showImgManagerModule: true,
|
|
142
|
-
showSelection: true,
|
|
143
|
-
displayBtn: false,
|
|
144
|
-
pageficheProduct: true
|
|
145
|
-
};
|
|
146
|
-
this.wiziblockConfig = {
|
|
147
|
-
stateDisplayed: 'closed',
|
|
148
|
-
multipleImgMode: false,
|
|
149
|
-
showImgManagerModule: true,
|
|
150
|
-
showSelection: false,
|
|
151
|
-
displayBtn: false
|
|
152
|
-
};
|
|
153
|
-
this.simpleWithButtonOpenerConfig = {
|
|
154
|
-
stateDisplayed: 'closed',
|
|
155
|
-
multipleImgMode: false,
|
|
156
|
-
showImgManagerModule: true,
|
|
157
|
-
showSelection: false,
|
|
158
|
-
displayBtn: true
|
|
159
|
-
};
|
|
160
|
-
this.fullWindowConfig = {
|
|
161
|
-
stateDisplayed: 'window',
|
|
162
|
-
multipleImgMode: false,
|
|
163
|
-
showImgManagerModule: true,
|
|
164
|
-
showSelection: false,
|
|
165
|
-
displayBtn: false
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
getShopImgList(params) {
|
|
169
|
-
if (params && this.previousParams && this.previousParams.limit === params.limit
|
|
170
|
-
&& this.previousParams.page === params.page && this.shopImgList
|
|
171
|
-
&& this.previousParams.search === params.search) {
|
|
172
|
-
return of(this.shopImgList).pipe(delay(0));
|
|
173
|
-
}
|
|
174
|
-
if (params) {
|
|
175
|
-
this.resetParams(params);
|
|
176
|
-
}
|
|
177
|
-
return this.apiService.getShopImgList(params).pipe(tap((shopImgList) => {
|
|
178
|
-
this.shopImgList = shopImgList;
|
|
179
|
-
this.previousParams = params;
|
|
180
|
-
}));
|
|
181
|
-
;
|
|
182
|
-
}
|
|
183
|
-
getShopTotalImgList(params) {
|
|
184
|
-
if (params) {
|
|
185
|
-
this.resetParams(params);
|
|
186
|
-
}
|
|
187
|
-
return this.apiService.getShopTotalImgList(params);
|
|
188
|
-
}
|
|
189
|
-
getShopImg(idFile) {
|
|
190
|
-
return this.apiService.getShopImg(idFile);
|
|
191
|
-
}
|
|
192
|
-
resetParams(params) {
|
|
193
|
-
this.params = new HttpParams();
|
|
194
|
-
this.params = this.params.set('id_file:sort', 'desc');
|
|
195
|
-
for (const param in params) {
|
|
196
|
-
this.params = this.params.set(param, params[param]);
|
|
197
|
-
}
|
|
198
|
-
if (params.search) {
|
|
199
|
-
this.params = this.params.set('display_name:contains', params.search);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
replaceImg(imageBase64, id_file) {
|
|
203
|
-
return this.apiService.replaceImg(imageBase64, id_file);
|
|
204
|
-
}
|
|
205
|
-
removeImg(id_file) {
|
|
206
|
-
return this.apiService.removeImg(id_file);
|
|
207
|
-
}
|
|
208
|
-
removeMultipleImg(id_array) {
|
|
209
|
-
return this.apiService.removeMultipleImg(id_array);
|
|
210
|
-
}
|
|
211
|
-
getImgManagerDisplayConfig(displayName) {
|
|
212
|
-
switch (displayName) {
|
|
213
|
-
case "window":
|
|
214
|
-
return this.fullWindowConfig;
|
|
215
|
-
case "wizi-block":
|
|
216
|
-
return this.wiziblockConfig;
|
|
217
|
-
case "fiche-product":
|
|
218
|
-
return this.pageFicheProductConfig;
|
|
219
|
-
case "simple-with-button":
|
|
220
|
-
return this.simpleWithButtonOpenerConfig;
|
|
221
|
-
case 'angular-fiche-product':
|
|
222
|
-
return this.angularFicheProductConfig;
|
|
223
|
-
default:
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
getAllImgManagerDisplayConfig() {
|
|
228
|
-
return [
|
|
229
|
-
this.fullWindowConfig,
|
|
230
|
-
this.wiziblockConfig,
|
|
231
|
-
this.pageFicheProductConfig,
|
|
232
|
-
this.simpleWithButtonOpenerConfig,
|
|
233
|
-
];
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
237
|
-
ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService });
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, decorators: [{
|
|
239
|
-
type: Injectable
|
|
240
|
-
}], ctorParameters: function () { return [{ type: ApiService }]; } });
|
|
241
|
-
const ImgManagerServiceProvider = {
|
|
242
|
-
provide: ImgManagerService,
|
|
243
|
-
useFactory: (parentService, apiService) => {
|
|
244
|
-
// Vérifie si le service existe déjà dans le provider parent
|
|
245
|
-
if (parentService) {
|
|
246
|
-
return parentService;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
// Si le service n'existe pas dans le provider parent, crée un nouveau service
|
|
250
|
-
return new ImgManagerService(apiService);
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
// Utilise l'injection conditionnelle pour vérifier si le service existe déjà dans le provider parent
|
|
254
|
-
deps: [[new Optional(), new SkipSelf(), ImgManagerService], ApiService],
|
|
255
|
-
};
|
|
256
100
|
|
|
257
101
|
class UserSettingsService {
|
|
258
102
|
constructor() {
|
|
@@ -272,13 +116,10 @@ class UserSettingsService {
|
|
|
272
116
|
}
|
|
273
117
|
}
|
|
274
118
|
UserSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
275
|
-
UserSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserSettingsService
|
|
119
|
+
UserSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserSettingsService });
|
|
276
120
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UserSettingsService, decorators: [{
|
|
277
|
-
type: Injectable
|
|
278
|
-
|
|
279
|
-
providedIn: 'root'
|
|
280
|
-
}]
|
|
281
|
-
}], ctorParameters: function () { return []; } });
|
|
121
|
+
type: Injectable
|
|
122
|
+
}] });
|
|
282
123
|
|
|
283
124
|
class ImgEventService {
|
|
284
125
|
constructor() {
|
|
@@ -313,13 +154,10 @@ class ImgEventService {
|
|
|
313
154
|
}
|
|
314
155
|
}
|
|
315
156
|
ImgEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
316
|
-
ImgEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgEventService
|
|
157
|
+
ImgEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgEventService });
|
|
317
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgEventService, decorators: [{
|
|
318
|
-
type: Injectable
|
|
319
|
-
|
|
320
|
-
providedIn: 'root'
|
|
321
|
-
}]
|
|
322
|
-
}], ctorParameters: function () { return []; } });
|
|
159
|
+
type: Injectable
|
|
160
|
+
}] });
|
|
323
161
|
|
|
324
162
|
class AlertService {
|
|
325
163
|
constructor(nwbAlertService, translateService) {
|
|
@@ -360,17 +198,22 @@ class AlertService {
|
|
|
360
198
|
}
|
|
361
199
|
}
|
|
362
200
|
AlertService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AlertService, deps: [{ token: i1.NwbAlertService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
363
|
-
AlertService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AlertService
|
|
201
|
+
AlertService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AlertService });
|
|
364
202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AlertService, decorators: [{
|
|
365
|
-
type: Injectable
|
|
366
|
-
args: [{
|
|
367
|
-
providedIn: 'root'
|
|
368
|
-
}]
|
|
203
|
+
type: Injectable
|
|
369
204
|
}], ctorParameters: function () { return [{ type: i1.NwbAlertService }, { type: i3.TranslateService }]; } });
|
|
370
205
|
|
|
206
|
+
class ApiService {
|
|
207
|
+
}
|
|
208
|
+
ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
209
|
+
ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService });
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ApiService, decorators: [{
|
|
211
|
+
type: Injectable
|
|
212
|
+
}] });
|
|
213
|
+
|
|
371
214
|
class UploadService {
|
|
372
|
-
constructor(
|
|
373
|
-
this.apiService =
|
|
215
|
+
constructor() {
|
|
216
|
+
this.apiService = inject(ApiService);
|
|
374
217
|
}
|
|
375
218
|
uploadFile(formData) {
|
|
376
219
|
return this.apiService.uploadFile(formData);
|
|
@@ -379,12 +222,11 @@ class UploadService {
|
|
|
379
222
|
return this.apiService.uploadFileByUrl(url, fileName);
|
|
380
223
|
}
|
|
381
224
|
}
|
|
382
|
-
UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UploadService, deps: [
|
|
383
|
-
UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UploadService
|
|
225
|
+
UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
226
|
+
UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UploadService });
|
|
384
227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: UploadService, decorators: [{
|
|
385
|
-
type: Injectable
|
|
386
|
-
|
|
387
|
-
}], ctorParameters: function () { return [{ type: ApiService }]; } });
|
|
228
|
+
type: Injectable
|
|
229
|
+
}] });
|
|
388
230
|
|
|
389
231
|
class CanvaService {
|
|
390
232
|
constructor(wzImgEventService, alertService, translateService, uploadService, apiService) {
|
|
@@ -526,12 +368,9 @@ class CanvaService {
|
|
|
526
368
|
}
|
|
527
369
|
}
|
|
528
370
|
CanvaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CanvaService, deps: [{ token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: UploadService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
529
|
-
CanvaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CanvaService
|
|
371
|
+
CanvaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CanvaService });
|
|
530
372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: CanvaService, decorators: [{
|
|
531
|
-
type: Injectable
|
|
532
|
-
args: [{
|
|
533
|
-
providedIn: 'root'
|
|
534
|
-
}]
|
|
373
|
+
type: Injectable
|
|
535
374
|
}], ctorParameters: function () { return [{ type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: UploadService }, { type: ApiService }]; } });
|
|
536
375
|
|
|
537
376
|
class DomService {
|
|
@@ -559,12 +398,9 @@ class DomService {
|
|
|
559
398
|
}
|
|
560
399
|
}
|
|
561
400
|
DomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
562
|
-
DomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DomService
|
|
401
|
+
DomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DomService });
|
|
563
402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DomService, decorators: [{
|
|
564
|
-
type: Injectable
|
|
565
|
-
args: [{
|
|
566
|
-
providedIn: 'root'
|
|
567
|
-
}]
|
|
403
|
+
type: Injectable
|
|
568
404
|
}] });
|
|
569
405
|
|
|
570
406
|
const easeInOut = // the fade-in/fade-out animation.
|
|
@@ -703,18 +539,21 @@ class ImgUploadComponent {
|
|
|
703
539
|
formData.append('image', file, file.name);
|
|
704
540
|
imgToUploadList.push(this.uploadService.uploadFile(formData));
|
|
705
541
|
}
|
|
706
|
-
forkJoin(imgToUploadList).subscribe(
|
|
707
|
-
|
|
542
|
+
forkJoin(imgToUploadList).subscribe({
|
|
543
|
+
next: (img) => {
|
|
544
|
+
this.onImgUpload(img),
|
|
545
|
+
this.isLoading = false;
|
|
546
|
+
},
|
|
547
|
+
error: error => {
|
|
548
|
+
var _a;
|
|
549
|
+
if (((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) && error.statusText !== 'Bad Request') {
|
|
550
|
+
this.alertService.openAlertWithBackendResponse(this.errorUploadingImg, error.error.message);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
this.alertService.openAlert(this.errorUploadingImg);
|
|
554
|
+
}
|
|
708
555
|
this.isLoading = false;
|
|
709
|
-
}, error => {
|
|
710
|
-
var _a;
|
|
711
|
-
if (((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) && error.statusText !== 'Bad Request') {
|
|
712
|
-
this.alertService.openAlertWithBackendResponse(this.errorUploadingImg, error.error.message);
|
|
713
|
-
}
|
|
714
|
-
else {
|
|
715
|
-
this.alertService.openAlert(this.errorUploadingImg);
|
|
716
556
|
}
|
|
717
|
-
this.isLoading = false;
|
|
718
557
|
});
|
|
719
558
|
}
|
|
720
559
|
/**
|
|
@@ -806,7 +645,7 @@ class PexelsService {
|
|
|
806
645
|
request = `/search?query=${toSearch}&per_page=${perPage}&page=${page}&locale=${this.lang}`;
|
|
807
646
|
}
|
|
808
647
|
else { // Search by category or display Pexels selection
|
|
809
|
-
const shopCategory = this.apiService.
|
|
648
|
+
const shopCategory = this.apiService.getShopCategory();
|
|
810
649
|
// Search by shop category
|
|
811
650
|
if (shopCategory && shopCategory !== 'other' && shopCategory !== 'btob') {
|
|
812
651
|
request = `/search?query=${shopCategory}&per_page=${perPage}&page=${page}&locale=en-US`;
|
|
@@ -821,12 +660,9 @@ class PexelsService {
|
|
|
821
660
|
}
|
|
822
661
|
}
|
|
823
662
|
PexelsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelsService, deps: [{ token: i3$1.HttpClient }, { token: ApiService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
824
|
-
PexelsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelsService
|
|
663
|
+
PexelsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelsService });
|
|
825
664
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelsService, decorators: [{
|
|
826
|
-
type: Injectable
|
|
827
|
-
args: [{
|
|
828
|
-
providedIn: 'root'
|
|
829
|
-
}]
|
|
665
|
+
type: Injectable
|
|
830
666
|
}], ctorParameters: function () { return [{ type: i3$1.HttpClient }, { type: ApiService }, { type: i3.TranslateService }]; } });
|
|
831
667
|
|
|
832
668
|
class AbstractDebounceDirective {
|
|
@@ -838,7 +674,7 @@ class AbstractDebounceDirective {
|
|
|
838
674
|
}
|
|
839
675
|
ngOnInit() {
|
|
840
676
|
this.emitEvent$
|
|
841
|
-
.pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap
|
|
677
|
+
.pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap(value => this.emitChange(value)))
|
|
842
678
|
.subscribe();
|
|
843
679
|
}
|
|
844
680
|
emitChange(value) {
|
|
@@ -1012,7 +848,7 @@ class PexelLibComponent {
|
|
|
1012
848
|
this.isLoading = true;
|
|
1013
849
|
this.initComponent = true;
|
|
1014
850
|
this.photosColumns = [];
|
|
1015
|
-
this.
|
|
851
|
+
this.nbColumns = 6;
|
|
1016
852
|
this.responsiveColumns = [1250, 1050, 750, 500];
|
|
1017
853
|
this.outerElement = null;
|
|
1018
854
|
this.uploadingImg = 'ImgManager.PexelLib.uploadingImg';
|
|
@@ -1025,8 +861,6 @@ class PexelLibComponent {
|
|
|
1025
861
|
set content(control) {
|
|
1026
862
|
this.outerElement = control;
|
|
1027
863
|
}
|
|
1028
|
-
ngOnInit() {
|
|
1029
|
-
}
|
|
1030
864
|
ngAfterViewInit() {
|
|
1031
865
|
this.oldSearchValue = this.searchValue;
|
|
1032
866
|
this.isLoading = false;
|
|
@@ -1037,11 +871,11 @@ class PexelLibComponent {
|
|
|
1037
871
|
setNbColumnsToDisplayPhoto() {
|
|
1038
872
|
const width = this.outerElement.nativeElement.offsetWidth;
|
|
1039
873
|
if (this.stateDisplayed !== 'window') {
|
|
1040
|
-
this.
|
|
874
|
+
this.nbColumns = 8;
|
|
1041
875
|
}
|
|
1042
876
|
this.responsiveColumns.forEach(value => {
|
|
1043
877
|
if (width < value) {
|
|
1044
|
-
this.
|
|
878
|
+
this.nbColumns--;
|
|
1045
879
|
}
|
|
1046
880
|
});
|
|
1047
881
|
}
|
|
@@ -1066,23 +900,26 @@ class PexelLibComponent {
|
|
|
1066
900
|
return;
|
|
1067
901
|
}
|
|
1068
902
|
this.isLoading = true;
|
|
1069
|
-
const searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe(
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
903
|
+
const searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe({
|
|
904
|
+
next: (data) => {
|
|
905
|
+
this.wzImgLibDto = data;
|
|
906
|
+
this.nbResult = this.wzImgLibDto.total_results;
|
|
907
|
+
if (this.nbResult) {
|
|
908
|
+
data.photos.forEach(photo => {
|
|
909
|
+
const bestColumnIndex = this.getBestColumn();
|
|
910
|
+
const height = (photo.height / photo.width) * 1000;
|
|
911
|
+
this.photosColumns[bestColumnIndex].height += height;
|
|
912
|
+
this.photosColumns[bestColumnIndex].photos.push(photo);
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
this.isLoading = false;
|
|
916
|
+
this.initComponent = false;
|
|
917
|
+
},
|
|
918
|
+
error: error => {
|
|
919
|
+
this.isLoading = false;
|
|
920
|
+
this.initComponent = false;
|
|
921
|
+
this.alertService.openAlert(this.errorRetrievePhotos);
|
|
1079
922
|
}
|
|
1080
|
-
this.isLoading = false;
|
|
1081
|
-
this.initComponent = false;
|
|
1082
|
-
}, error => {
|
|
1083
|
-
this.isLoading = false;
|
|
1084
|
-
this.initComponent = false;
|
|
1085
|
-
this.alertService.openAlert(this.errorRetrievePhotos);
|
|
1086
923
|
});
|
|
1087
924
|
this.subs.push(searchSub);
|
|
1088
925
|
}
|
|
@@ -1101,7 +938,7 @@ class PexelLibComponent {
|
|
|
1101
938
|
}
|
|
1102
939
|
}
|
|
1103
940
|
setPhotosColumns() {
|
|
1104
|
-
for (let indexColumn = 0; indexColumn < this.
|
|
941
|
+
for (let indexColumn = 0; indexColumn < this.nbColumns; indexColumn++) {
|
|
1105
942
|
const photosColumn = {
|
|
1106
943
|
height: 0,
|
|
1107
944
|
photos: []
|
|
@@ -1220,12 +1057,128 @@ class RenamePictureService {
|
|
|
1220
1057
|
}
|
|
1221
1058
|
}
|
|
1222
1059
|
RenamePictureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, deps: [{ token: ApiService }, { token: AlertService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1223
|
-
RenamePictureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService
|
|
1060
|
+
RenamePictureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService });
|
|
1224
1061
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, decorators: [{
|
|
1225
|
-
type: Injectable
|
|
1226
|
-
args: [{ providedIn: 'root' }]
|
|
1062
|
+
type: Injectable
|
|
1227
1063
|
}], ctorParameters: function () { return [{ type: ApiService }, { type: AlertService }]; } });
|
|
1228
1064
|
|
|
1065
|
+
class ImgManagerService {
|
|
1066
|
+
constructor() {
|
|
1067
|
+
this.params = new HttpParams().set("limit", "20").set("page", "1");
|
|
1068
|
+
// Display the img selection
|
|
1069
|
+
this.pageFicheProductConfig = {
|
|
1070
|
+
stateDisplayed: 'closed',
|
|
1071
|
+
multipleImgMode: true,
|
|
1072
|
+
showImgManagerModule: true,
|
|
1073
|
+
showSelection: true,
|
|
1074
|
+
displayBtn: true,
|
|
1075
|
+
pageficheProduct: true
|
|
1076
|
+
};
|
|
1077
|
+
this.angularFicheProductConfig = {
|
|
1078
|
+
stateDisplayed: 'closed',
|
|
1079
|
+
multipleImgMode: true,
|
|
1080
|
+
showImgManagerModule: true,
|
|
1081
|
+
showSelection: true,
|
|
1082
|
+
displayBtn: false,
|
|
1083
|
+
pageficheProduct: true
|
|
1084
|
+
};
|
|
1085
|
+
this.wiziblockConfig = {
|
|
1086
|
+
stateDisplayed: 'closed',
|
|
1087
|
+
multipleImgMode: false,
|
|
1088
|
+
showImgManagerModule: true,
|
|
1089
|
+
showSelection: false,
|
|
1090
|
+
displayBtn: false
|
|
1091
|
+
};
|
|
1092
|
+
this.simpleWithButtonOpenerConfig = {
|
|
1093
|
+
stateDisplayed: 'closed',
|
|
1094
|
+
multipleImgMode: false,
|
|
1095
|
+
showImgManagerModule: true,
|
|
1096
|
+
showSelection: false,
|
|
1097
|
+
displayBtn: true
|
|
1098
|
+
};
|
|
1099
|
+
this.fullWindowConfig = {
|
|
1100
|
+
stateDisplayed: 'window',
|
|
1101
|
+
multipleImgMode: false,
|
|
1102
|
+
showImgManagerModule: true,
|
|
1103
|
+
showSelection: false,
|
|
1104
|
+
displayBtn: false
|
|
1105
|
+
};
|
|
1106
|
+
this.apiService = inject(ApiService);
|
|
1107
|
+
}
|
|
1108
|
+
getShopImgList(params) {
|
|
1109
|
+
if (params && this.previousParams && this.previousParams.limit === params.limit
|
|
1110
|
+
&& this.previousParams.page === params.page && this.shopImgList
|
|
1111
|
+
&& this.previousParams.search === params.search) {
|
|
1112
|
+
return of(this.shopImgList).pipe(delay(0));
|
|
1113
|
+
}
|
|
1114
|
+
if (params) {
|
|
1115
|
+
this.resetParams(params);
|
|
1116
|
+
}
|
|
1117
|
+
return this.apiService.getShopImgList(params).pipe(tap$1((shopImgList) => {
|
|
1118
|
+
this.shopImgList = shopImgList;
|
|
1119
|
+
this.previousParams = params;
|
|
1120
|
+
}));
|
|
1121
|
+
;
|
|
1122
|
+
}
|
|
1123
|
+
getShopTotalImgList(params) {
|
|
1124
|
+
if (params) {
|
|
1125
|
+
this.resetParams(params);
|
|
1126
|
+
}
|
|
1127
|
+
return this.apiService.getShopTotalImgList(params);
|
|
1128
|
+
}
|
|
1129
|
+
getShopImg(idFile) {
|
|
1130
|
+
return this.apiService.getShopImg(idFile);
|
|
1131
|
+
}
|
|
1132
|
+
resetParams(params) {
|
|
1133
|
+
this.params = new HttpParams();
|
|
1134
|
+
this.params = this.params.set('id_file:sort', 'desc');
|
|
1135
|
+
for (const param in params) {
|
|
1136
|
+
this.params = this.params.set(param, params[param]);
|
|
1137
|
+
}
|
|
1138
|
+
if (params.search) {
|
|
1139
|
+
this.params = this.params.set('display_name:contains', params.search);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
replaceImg(imageBase64, id_file) {
|
|
1143
|
+
return this.apiService.replaceImg(imageBase64, id_file);
|
|
1144
|
+
}
|
|
1145
|
+
removeImg(id_file) {
|
|
1146
|
+
return this.apiService.removeImg(id_file);
|
|
1147
|
+
}
|
|
1148
|
+
removeMultipleImg(id_array) {
|
|
1149
|
+
return this.apiService.removeMultipleImg(id_array);
|
|
1150
|
+
}
|
|
1151
|
+
getImgManagerDisplayConfig(displayName) {
|
|
1152
|
+
switch (displayName) {
|
|
1153
|
+
case "window":
|
|
1154
|
+
return this.fullWindowConfig;
|
|
1155
|
+
case "wizi-block":
|
|
1156
|
+
return this.wiziblockConfig;
|
|
1157
|
+
case "fiche-product":
|
|
1158
|
+
return this.pageFicheProductConfig;
|
|
1159
|
+
case "simple-with-button":
|
|
1160
|
+
return this.simpleWithButtonOpenerConfig;
|
|
1161
|
+
case 'angular-fiche-product':
|
|
1162
|
+
return this.angularFicheProductConfig;
|
|
1163
|
+
default:
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
getAllImgManagerDisplayConfig() {
|
|
1168
|
+
return [
|
|
1169
|
+
this.fullWindowConfig,
|
|
1170
|
+
this.wiziblockConfig,
|
|
1171
|
+
this.pageFicheProductConfig,
|
|
1172
|
+
this.simpleWithButtonOpenerConfig,
|
|
1173
|
+
];
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1177
|
+
ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService });
|
|
1178
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgManagerService, decorators: [{
|
|
1179
|
+
type: Injectable
|
|
1180
|
+
}] });
|
|
1181
|
+
|
|
1229
1182
|
class ImgCDNService {
|
|
1230
1183
|
constructor() {
|
|
1231
1184
|
this.imgCDNConfig = inject(ApiService).IMG_SIZE;
|
|
@@ -1241,12 +1194,9 @@ class ImgCDNService {
|
|
|
1241
1194
|
}
|
|
1242
1195
|
}
|
|
1243
1196
|
ImgCDNService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1244
|
-
ImgCDNService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService
|
|
1197
|
+
ImgCDNService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService });
|
|
1245
1198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService, decorators: [{
|
|
1246
|
-
type: Injectable
|
|
1247
|
-
args: [{
|
|
1248
|
-
providedIn: 'root'
|
|
1249
|
-
}]
|
|
1199
|
+
type: Injectable
|
|
1250
1200
|
}] });
|
|
1251
1201
|
|
|
1252
1202
|
class ImagesActionHandler {
|
|
@@ -2431,12 +2381,9 @@ class FiltersTableService {
|
|
|
2431
2381
|
}
|
|
2432
2382
|
}
|
|
2433
2383
|
FiltersTableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FiltersTableService, deps: [{ token: i1.NwbFilterRoutingBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2434
|
-
FiltersTableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FiltersTableService
|
|
2384
|
+
FiltersTableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FiltersTableService });
|
|
2435
2385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FiltersTableService, decorators: [{
|
|
2436
|
-
type: Injectable
|
|
2437
|
-
args: [{
|
|
2438
|
-
providedIn: 'root'
|
|
2439
|
-
}]
|
|
2386
|
+
type: Injectable
|
|
2440
2387
|
}], ctorParameters: function () { return [{ type: i1.NwbFilterRoutingBuilder }]; } });
|
|
2441
2388
|
|
|
2442
2389
|
class CheckboxComponent {
|
|
@@ -3391,11 +3338,11 @@ class ImagesViewComponent {
|
|
|
3391
3338
|
}
|
|
3392
3339
|
this.isTotalRetrieved = false;
|
|
3393
3340
|
this.imgManager.getShopTotalImgList(this.params).pipe(take(1)).subscribe({
|
|
3394
|
-
next:
|
|
3341
|
+
next: total => {
|
|
3395
3342
|
this.previousSearchValue = searchValue;
|
|
3396
3343
|
this.isTotalRetrieved = true;
|
|
3397
|
-
this.length =
|
|
3398
|
-
this.tableFilters.totalItems =
|
|
3344
|
+
this.length = total;
|
|
3345
|
+
this.tableFilters.totalItems = total;
|
|
3399
3346
|
},
|
|
3400
3347
|
error: error => {
|
|
3401
3348
|
//this.alertService.openAlert(this.errorGetTotalImg);
|
|
@@ -3766,6 +3713,7 @@ class WzImgManagerComponent {
|
|
|
3766
3713
|
this.close = false;
|
|
3767
3714
|
this.listDisplayed = false;
|
|
3768
3715
|
this.hideTab = false;
|
|
3716
|
+
console.log('WzImgManagerComponent');
|
|
3769
3717
|
}
|
|
3770
3718
|
// If forceToOpenCanva is true : Canva will open with the canvaService.expectedImgSizesChange
|
|
3771
3719
|
// If forceToOpenCanva is a WiziBlockMediaDto, Canva open immediatly
|
|
@@ -3798,6 +3746,7 @@ class WzImgManagerComponent {
|
|
|
3798
3746
|
}
|
|
3799
3747
|
}
|
|
3800
3748
|
ngOnInit() {
|
|
3749
|
+
console.log('WzImgManagerComponent');
|
|
3801
3750
|
this.imgSelectionService.setMultipleImgMode(this._multipleImgMode);
|
|
3802
3751
|
this.imgSelectionService.initImgSelectedList(null);
|
|
3803
3752
|
this.selectImgEvent = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
|
|
@@ -3894,16 +3843,10 @@ class WzImgManagerComponent {
|
|
|
3894
3843
|
}
|
|
3895
3844
|
}
|
|
3896
3845
|
WzImgManagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WzImgManagerComponent, deps: [{ token: ImgSelectionService }, { token: UserSettingsService }, { token: CanvaService }, { token: ImgEventService }, { token: DomService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3897
|
-
WzImgManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: WzImgManagerComponent, selector: "wz-img-manager", inputs: { stateDisplayed: "stateDisplayed", showSelection: "showSelection", forceToOpenCanva: "forceToOpenCanva", multipleImgMode: "multipleImgMode", showImgManagerModule: "showImgManagerModule" }, outputs: { imgManagerClosed: "imgManagerClosed", imgSelectionChange: "imgSelectionChange" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } },
|
|
3898
|
-
ImgManagerServiceProvider,
|
|
3899
|
-
ImgSelectionServiceProvider
|
|
3900
|
-
], ngImport: i0, template: "<div class=\"wz-img-manager\">\n <!-- Img slection handler -->\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\n <img-selection></img-selection>\n </div>\n\n <!-- Img manager module -->\n <div\n *ngIf=\"_showImgManagerModule\"\n class=\"wz-img-manager__module\"\n [ngClass]=\"{\n 'wz-img-manager__module--small': stateDisplayed === 'small',\n 'wz-img-manager__module--full': stateDisplayed === 'full',\n 'wz-img-manager__module--window': stateDisplayed === 'window',\n 'wz-img-manager__module--edit': hideTab}\"\n >\n\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\n </div>\n\n <div\n class=\"wz-img-manager__module__content wz-block\"\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\n <img-tabs\n [stateDisplayed]=\"stateDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [listDisplayed]=\"listDisplayed\"\n (imgManagerClosed)=\"onImgManagerClosed()\"\n (switchDisplayWindow)=\"changeDisplayTab()\"\n (currentTab)=\"setCurrentTab($event)\">\n </img-tabs>\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: "component", type: ImgTabsComponent, selector: "img-tabs", inputs: ["multipleImgMode", "stateDisplayed", "listDisplayed"], outputs: ["imgManagerClosed", "currentTab", "switchDisplayWindow"] }, { kind: "component", type: ImgSelectionComponent, selector: "img-selection", inputs: ["tabDisplayed"], outputs: ["imgManagerClosed"] }] });
|
|
3846
|
+
WzImgManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: WzImgManagerComponent, selector: "wz-img-manager", inputs: { stateDisplayed: "stateDisplayed", showSelection: "showSelection", forceToOpenCanva: "forceToOpenCanva", multipleImgMode: "multipleImgMode", showImgManagerModule: "showImgManagerModule" }, outputs: { imgManagerClosed: "imgManagerClosed", imgSelectionChange: "imgSelectionChange" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div class=\"wz-img-manager\">\n <!-- Img slection handler -->\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\n <img-selection></img-selection>\n </div>\n\n <!-- Img manager module -->\n <div\n *ngIf=\"_showImgManagerModule\"\n class=\"wz-img-manager__module\"\n [ngClass]=\"{\n 'wz-img-manager__module--small': stateDisplayed === 'small',\n 'wz-img-manager__module--full': stateDisplayed === 'full',\n 'wz-img-manager__module--window': stateDisplayed === 'window',\n 'wz-img-manager__module--edit': hideTab}\"\n >\n\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\n </div>\n\n <div\n class=\"wz-img-manager__module__content wz-block\"\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\n <img-tabs\n [stateDisplayed]=\"stateDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [listDisplayed]=\"listDisplayed\"\n (imgManagerClosed)=\"onImgManagerClosed()\"\n (switchDisplayWindow)=\"changeDisplayTab()\"\n (currentTab)=\"setCurrentTab($event)\">\n </img-tabs>\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: "component", type: ImgTabsComponent, selector: "img-tabs", inputs: ["multipleImgMode", "stateDisplayed", "listDisplayed"], outputs: ["imgManagerClosed", "currentTab", "switchDisplayWindow"] }, { kind: "component", type: ImgSelectionComponent, selector: "img-selection", inputs: ["tabDisplayed"], outputs: ["imgManagerClosed"] }] });
|
|
3901
3847
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WzImgManagerComponent, decorators: [{
|
|
3902
3848
|
type: Component,
|
|
3903
|
-
args: [{ selector: 'wz-img-manager',
|
|
3904
|
-
ImgManagerServiceProvider,
|
|
3905
|
-
ImgSelectionServiceProvider
|
|
3906
|
-
], template: "<div class=\"wz-img-manager\">\n <!-- Img slection handler -->\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\n <img-selection></img-selection>\n </div>\n\n <!-- Img manager module -->\n <div\n *ngIf=\"_showImgManagerModule\"\n class=\"wz-img-manager__module\"\n [ngClass]=\"{\n 'wz-img-manager__module--small': stateDisplayed === 'small',\n 'wz-img-manager__module--full': stateDisplayed === 'full',\n 'wz-img-manager__module--window': stateDisplayed === 'window',\n 'wz-img-manager__module--edit': hideTab}\"\n >\n\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\n </div>\n\n <div\n class=\"wz-img-manager__module__content wz-block\"\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\n <img-tabs\n [stateDisplayed]=\"stateDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [listDisplayed]=\"listDisplayed\"\n (imgManagerClosed)=\"onImgManagerClosed()\"\n (switchDisplayWindow)=\"changeDisplayTab()\"\n (currentTab)=\"setCurrentTab($event)\">\n </img-tabs>\n </div>\n </div>\n\n</div>\n" }]
|
|
3849
|
+
args: [{ selector: 'wz-img-manager', template: "<div class=\"wz-img-manager\">\n <!-- Img slection handler -->\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\n <img-selection></img-selection>\n </div>\n\n <!-- Img manager module -->\n <div\n *ngIf=\"_showImgManagerModule\"\n class=\"wz-img-manager__module\"\n [ngClass]=\"{\n 'wz-img-manager__module--small': stateDisplayed === 'small',\n 'wz-img-manager__module--full': stateDisplayed === 'full',\n 'wz-img-manager__module--window': stateDisplayed === 'window',\n 'wz-img-manager__module--edit': hideTab}\"\n >\n\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\n </div>\n\n <div\n class=\"wz-img-manager__module__content wz-block\"\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\n <img-tabs\n [stateDisplayed]=\"stateDisplayed\"\n [multipleImgMode]=\"multipleImgMode\"\n [listDisplayed]=\"listDisplayed\"\n (imgManagerClosed)=\"onImgManagerClosed()\"\n (switchDisplayWindow)=\"changeDisplayTab()\"\n (currentTab)=\"setCurrentTab($event)\">\n </img-tabs>\n </div>\n </div>\n\n</div>\n" }]
|
|
3907
3850
|
}], ctorParameters: function () { return [{ type: ImgSelectionService }, { type: UserSettingsService }, { type: CanvaService }, { type: ImgEventService }, { type: DomService }]; }, propDecorators: { stateDisplayed: [{
|
|
3908
3851
|
type: Input
|
|
3909
3852
|
}], showSelection: [{
|
|
@@ -3923,6 +3866,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
3923
3866
|
type: Output
|
|
3924
3867
|
}] } });
|
|
3925
3868
|
|
|
3869
|
+
class SnackBarService {
|
|
3870
|
+
constructor(nwbSnackbar, translateService) {
|
|
3871
|
+
this.nwbSnackbar = nwbSnackbar;
|
|
3872
|
+
this.translateService = translateService;
|
|
3873
|
+
this.actionMsg = 'ImgManager.snackBar.action';
|
|
3874
|
+
this.snackBarConfigAction = {
|
|
3875
|
+
message: '',
|
|
3876
|
+
duration: 5000
|
|
3877
|
+
};
|
|
3878
|
+
this.snackBarConfig = {
|
|
3879
|
+
message: '',
|
|
3880
|
+
duration: 5000
|
|
3881
|
+
};
|
|
3882
|
+
}
|
|
3883
|
+
openSnackBar(msgKey) {
|
|
3884
|
+
this.closePreviousSnackbar();
|
|
3885
|
+
this.translateService.get(msgKey).subscribe(trans => {
|
|
3886
|
+
this.snackBarConfig.message = trans;
|
|
3887
|
+
this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfig);
|
|
3888
|
+
this.snackBarRefComponent.afterClosed().subscribe();
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3891
|
+
openSnackBarWithAction(msgKey) {
|
|
3892
|
+
return new Observable(observer => {
|
|
3893
|
+
this.translateService.get([msgKey, this.actionMsg]).subscribe((trans) => {
|
|
3894
|
+
this.snackBarConfigAction.message = trans[msgKey];
|
|
3895
|
+
this.snackBarConfigAction.action = trans[this.actionMsg];
|
|
3896
|
+
this.closePreviousSnackbar();
|
|
3897
|
+
this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfigAction);
|
|
3898
|
+
this.snackBarRefComponent.afterClosed().subscribe(manualClose => {
|
|
3899
|
+
observer.next(manualClose);
|
|
3900
|
+
observer.complete();
|
|
3901
|
+
});
|
|
3902
|
+
});
|
|
3903
|
+
});
|
|
3904
|
+
}
|
|
3905
|
+
openSnackBarWithBackendRespons(msgKey, msgBackend) {
|
|
3906
|
+
this.translateService.get(msgKey).subscribe(trans => {
|
|
3907
|
+
this.snackBarConfig.message = trans;
|
|
3908
|
+
this.snackBarConfig.message += '<br/>' + JSON.parse(msgBackend).message;
|
|
3909
|
+
this.closePreviousSnackbar();
|
|
3910
|
+
this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfig);
|
|
3911
|
+
this.snackBarRefComponent.afterClosed().subscribe();
|
|
3912
|
+
});
|
|
3913
|
+
}
|
|
3914
|
+
closePreviousSnackbar() {
|
|
3915
|
+
if (this.snackBarRefComponent) {
|
|
3916
|
+
this.snackBarRefComponent.dismiss(false);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
}
|
|
3920
|
+
SnackBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SnackBarService, deps: [{ token: i1.NwbSnackbarService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3921
|
+
SnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SnackBarService });
|
|
3922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SnackBarService, decorators: [{
|
|
3923
|
+
type: Injectable
|
|
3924
|
+
}], ctorParameters: function () { return [{ type: i1.NwbSnackbarService }, { type: i3.TranslateService }]; } });
|
|
3925
|
+
|
|
3926
3926
|
;
|
|
3927
3927
|
const components = [
|
|
3928
3928
|
WzImgManagerComponent,
|
|
@@ -3976,7 +3976,20 @@ class WzImgManagerModule {
|
|
|
3976
3976
|
return {
|
|
3977
3977
|
ngModule: WzImgManagerModule,
|
|
3978
3978
|
providers: [
|
|
3979
|
-
|
|
3979
|
+
ImgManagerService,
|
|
3980
|
+
ApiService,
|
|
3981
|
+
ImgCDNService,
|
|
3982
|
+
FiltersTableService,
|
|
3983
|
+
AlertService,
|
|
3984
|
+
CanvaService,
|
|
3985
|
+
DomService,
|
|
3986
|
+
ImgEventService,
|
|
3987
|
+
ImgSelectionService,
|
|
3988
|
+
PexelsService,
|
|
3989
|
+
RenamePictureService,
|
|
3990
|
+
SnackBarService,
|
|
3991
|
+
UploadService,
|
|
3992
|
+
UserSettingsService
|
|
3980
3993
|
]
|
|
3981
3994
|
};
|
|
3982
3995
|
}
|