@wizishop/img-manager 15.2.3 → 15.2.5
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/pexels-lib/pexels-lib.component.mjs +24 -23
- package/esm2020/lib/services/alert.service.mjs +3 -6
- 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 +257 -246
- package/fesm2015/wizishop-img-manager.mjs.map +1 -1
- package/fesm2020/wizishop-img-manager.mjs +192 -181
- package/fesm2020/wizishop-img-manager.mjs.map +1 -1
- package/lib/components/pexels-lib/pexels-lib.component.d.ts +3 -4
- 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 +1 -8
- package/lib/services/img-selection.service.d.ts +0 -6
- package/lib/services/snackbar.service.d.ts +19 -0
- package/lib/services/upload.service.d.ts +3 -5
- 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.5.tgz +0 -0
- package/wizishop-img-manager-15.2.3.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.
|
|
@@ -811,7 +647,7 @@ class PexelsService {
|
|
|
811
647
|
else { // Search by category or display Pexels selection
|
|
812
648
|
const shopCategory = this.apiService.getShopCategory();
|
|
813
649
|
// Search by shop category
|
|
814
|
-
if (shopCategory && shopCategory !== 'other' && shopCategory !== 'btob') {
|
|
650
|
+
if (shopCategory && shopCategory !== 'other' && shopCategory !== 'btob' && shopCategory !== 'default') {
|
|
815
651
|
request = `/search?query=${shopCategory}&per_page=${perPage}&page=${page}&locale=en-US`;
|
|
816
652
|
}
|
|
817
653
|
else { // Display Pexels selection
|
|
@@ -824,12 +660,9 @@ class PexelsService {
|
|
|
824
660
|
}
|
|
825
661
|
}
|
|
826
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 });
|
|
827
|
-
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 });
|
|
828
664
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PexelsService, decorators: [{
|
|
829
|
-
type: Injectable
|
|
830
|
-
args: [{
|
|
831
|
-
providedIn: 'root'
|
|
832
|
-
}]
|
|
665
|
+
type: Injectable
|
|
833
666
|
}], ctorParameters: function () { return [{ type: i3$1.HttpClient }, { type: ApiService }, { type: i3.TranslateService }]; } });
|
|
834
667
|
|
|
835
668
|
class AbstractDebounceDirective {
|
|
@@ -841,7 +674,7 @@ class AbstractDebounceDirective {
|
|
|
841
674
|
}
|
|
842
675
|
ngOnInit() {
|
|
843
676
|
this.emitEvent$
|
|
844
|
-
.pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap
|
|
677
|
+
.pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap(value => this.emitChange(value)))
|
|
845
678
|
.subscribe();
|
|
846
679
|
}
|
|
847
680
|
emitChange(value) {
|
|
@@ -1015,7 +848,7 @@ class PexelLibComponent {
|
|
|
1015
848
|
this.isLoading = true;
|
|
1016
849
|
this.initComponent = true;
|
|
1017
850
|
this.photosColumns = [];
|
|
1018
|
-
this.
|
|
851
|
+
this.nbColumns = 6;
|
|
1019
852
|
this.responsiveColumns = [1250, 1050, 750, 500];
|
|
1020
853
|
this.outerElement = null;
|
|
1021
854
|
this.uploadingImg = 'ImgManager.PexelLib.uploadingImg';
|
|
@@ -1028,8 +861,6 @@ class PexelLibComponent {
|
|
|
1028
861
|
set content(control) {
|
|
1029
862
|
this.outerElement = control;
|
|
1030
863
|
}
|
|
1031
|
-
ngOnInit() {
|
|
1032
|
-
}
|
|
1033
864
|
ngAfterViewInit() {
|
|
1034
865
|
this.oldSearchValue = this.searchValue;
|
|
1035
866
|
this.isLoading = false;
|
|
@@ -1040,11 +871,11 @@ class PexelLibComponent {
|
|
|
1040
871
|
setNbColumnsToDisplayPhoto() {
|
|
1041
872
|
const width = this.outerElement.nativeElement.offsetWidth;
|
|
1042
873
|
if (this.stateDisplayed !== 'window') {
|
|
1043
|
-
this.
|
|
874
|
+
this.nbColumns = 8;
|
|
1044
875
|
}
|
|
1045
876
|
this.responsiveColumns.forEach(value => {
|
|
1046
877
|
if (width < value) {
|
|
1047
|
-
this.
|
|
878
|
+
this.nbColumns--;
|
|
1048
879
|
}
|
|
1049
880
|
});
|
|
1050
881
|
}
|
|
@@ -1069,23 +900,26 @@ class PexelLibComponent {
|
|
|
1069
900
|
return;
|
|
1070
901
|
}
|
|
1071
902
|
this.isLoading = true;
|
|
1072
|
-
const searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe(
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
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);
|
|
1082
922
|
}
|
|
1083
|
-
this.isLoading = false;
|
|
1084
|
-
this.initComponent = false;
|
|
1085
|
-
}, error => {
|
|
1086
|
-
this.isLoading = false;
|
|
1087
|
-
this.initComponent = false;
|
|
1088
|
-
this.alertService.openAlert(this.errorRetrievePhotos);
|
|
1089
923
|
});
|
|
1090
924
|
this.subs.push(searchSub);
|
|
1091
925
|
}
|
|
@@ -1104,7 +938,7 @@ class PexelLibComponent {
|
|
|
1104
938
|
}
|
|
1105
939
|
}
|
|
1106
940
|
setPhotosColumns() {
|
|
1107
|
-
for (let indexColumn = 0; indexColumn < this.
|
|
941
|
+
for (let indexColumn = 0; indexColumn < this.nbColumns; indexColumn++) {
|
|
1108
942
|
const photosColumn = {
|
|
1109
943
|
height: 0,
|
|
1110
944
|
photos: []
|
|
@@ -1223,12 +1057,128 @@ class RenamePictureService {
|
|
|
1223
1057
|
}
|
|
1224
1058
|
}
|
|
1225
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 });
|
|
1226
|
-
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 });
|
|
1227
1061
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: RenamePictureService, decorators: [{
|
|
1228
|
-
type: Injectable
|
|
1229
|
-
args: [{ providedIn: 'root' }]
|
|
1062
|
+
type: Injectable
|
|
1230
1063
|
}], ctorParameters: function () { return [{ type: ApiService }, { type: AlertService }]; } });
|
|
1231
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
|
+
|
|
1232
1182
|
class ImgCDNService {
|
|
1233
1183
|
constructor() {
|
|
1234
1184
|
this.imgCDNConfig = inject(ApiService).IMG_SIZE;
|
|
@@ -1244,12 +1194,9 @@ class ImgCDNService {
|
|
|
1244
1194
|
}
|
|
1245
1195
|
}
|
|
1246
1196
|
ImgCDNService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1247
|
-
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 });
|
|
1248
1198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ImgCDNService, decorators: [{
|
|
1249
|
-
type: Injectable
|
|
1250
|
-
args: [{
|
|
1251
|
-
providedIn: 'root'
|
|
1252
|
-
}]
|
|
1199
|
+
type: Injectable
|
|
1253
1200
|
}] });
|
|
1254
1201
|
|
|
1255
1202
|
class ImagesActionHandler {
|
|
@@ -2434,12 +2381,9 @@ class FiltersTableService {
|
|
|
2434
2381
|
}
|
|
2435
2382
|
}
|
|
2436
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 });
|
|
2437
|
-
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 });
|
|
2438
2385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: FiltersTableService, decorators: [{
|
|
2439
|
-
type: Injectable
|
|
2440
|
-
args: [{
|
|
2441
|
-
providedIn: 'root'
|
|
2442
|
-
}]
|
|
2386
|
+
type: Injectable
|
|
2443
2387
|
}], ctorParameters: function () { return [{ type: i1.NwbFilterRoutingBuilder }]; } });
|
|
2444
2388
|
|
|
2445
2389
|
class CheckboxComponent {
|
|
@@ -3769,6 +3713,7 @@ class WzImgManagerComponent {
|
|
|
3769
3713
|
this.close = false;
|
|
3770
3714
|
this.listDisplayed = false;
|
|
3771
3715
|
this.hideTab = false;
|
|
3716
|
+
console.log('WzImgManagerComponent');
|
|
3772
3717
|
}
|
|
3773
3718
|
// If forceToOpenCanva is true : Canva will open with the canvaService.expectedImgSizesChange
|
|
3774
3719
|
// If forceToOpenCanva is a WiziBlockMediaDto, Canva open immediatly
|
|
@@ -3801,6 +3746,7 @@ class WzImgManagerComponent {
|
|
|
3801
3746
|
}
|
|
3802
3747
|
}
|
|
3803
3748
|
ngOnInit() {
|
|
3749
|
+
console.log('WzImgManagerComponent');
|
|
3804
3750
|
this.imgSelectionService.setMultipleImgMode(this._multipleImgMode);
|
|
3805
3751
|
this.imgSelectionService.initImgSelectedList(null);
|
|
3806
3752
|
this.selectImgEvent = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
|
|
@@ -3897,16 +3843,10 @@ class WzImgManagerComponent {
|
|
|
3897
3843
|
}
|
|
3898
3844
|
}
|
|
3899
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 });
|
|
3900
|
-
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)" } },
|
|
3901
|
-
ImgManagerServiceProvider,
|
|
3902
|
-
ImgSelectionServiceProvider
|
|
3903
|
-
], 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"] }] });
|
|
3904
3847
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: WzImgManagerComponent, decorators: [{
|
|
3905
3848
|
type: Component,
|
|
3906
|
-
args: [{ selector: 'wz-img-manager',
|
|
3907
|
-
ImgManagerServiceProvider,
|
|
3908
|
-
ImgSelectionServiceProvider
|
|
3909
|
-
], 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" }]
|
|
3910
3850
|
}], ctorParameters: function () { return [{ type: ImgSelectionService }, { type: UserSettingsService }, { type: CanvaService }, { type: ImgEventService }, { type: DomService }]; }, propDecorators: { stateDisplayed: [{
|
|
3911
3851
|
type: Input
|
|
3912
3852
|
}], showSelection: [{
|
|
@@ -3926,6 +3866,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
3926
3866
|
type: Output
|
|
3927
3867
|
}] } });
|
|
3928
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
|
+
|
|
3929
3926
|
;
|
|
3930
3927
|
const components = [
|
|
3931
3928
|
WzImgManagerComponent,
|
|
@@ -3979,7 +3976,20 @@ class WzImgManagerModule {
|
|
|
3979
3976
|
return {
|
|
3980
3977
|
ngModule: WzImgManagerModule,
|
|
3981
3978
|
providers: [
|
|
3982
|
-
|
|
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
|
|
3983
3993
|
]
|
|
3984
3994
|
};
|
|
3985
3995
|
}
|
|
@@ -4096,3 +4106,4 @@ class ImgManagerConfigDto {
|
|
|
4096
4106
|
|
|
4097
4107
|
export { ApiService, CanvaButtonApi, CanvaService, ImgApiDto, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule };
|
|
4098
4108
|
//# sourceMappingURL=wizishop-img-manager.mjs.map
|
|
4109
|
+
//# sourceMappingURL=wizishop-img-manager.mjs.map
|