@wizishop/img-manager 18.2.0 → 18.2.2-beta

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.
Files changed (177) hide show
  1. package/esm2022/lib/components/canva-btn/canva-btn.component.mjs +73 -0
  2. package/esm2022/lib/components/images-view/images-actions-handler.mjs +168 -0
  3. package/esm2022/lib/components/images-view/images-view.component.mjs +391 -0
  4. package/esm2022/lib/components/images-view/mosaic-view/img-card/img-card.component.mjs +70 -0
  5. package/esm2022/lib/components/images-view/mosaic-view/mosaic-view.component.mjs +73 -0
  6. package/esm2022/lib/components/images-view/table-view/table-view.component.mjs +48 -0
  7. package/esm2022/lib/components/img-editor/cropper/cropper.component.mjs +313 -0
  8. package/esm2022/lib/components/img-editor/img-editor.component.mjs +129 -0
  9. package/esm2022/lib/components/img-editor/info-section/info-section.component.mjs +58 -0
  10. package/esm2022/lib/components/img-selection/img-selection.component.mjs +58 -0
  11. package/esm2022/lib/components/img-tabs/img-tabs.component.mjs +128 -0
  12. package/esm2022/lib/components/img-upload/img-upload.component.mjs +133 -0
  13. package/esm2022/lib/components/loader/loader.component.mjs +21 -0
  14. package/esm2022/lib/components/pexels-lib/pexels-lib.component.mjs +211 -0
  15. package/esm2022/lib/components/shared/alert/alert.component.mjs +26 -0
  16. package/esm2022/lib/components/shared/checkbox/checkbox.component.mjs +56 -0
  17. package/esm2022/lib/components/shared/dropdown/dropdown.component.mjs +21 -0
  18. package/esm2022/lib/components/shared/input-search/input-search.component.mjs +53 -0
  19. package/esm2022/lib/components/shared/pagination/page-selector/page-selector.component.mjs +50 -0
  20. package/esm2022/lib/components/shared/pagination/pagination.component.mjs +49 -0
  21. package/esm2022/lib/components/shared/select/select.component.mjs +117 -0
  22. package/esm2022/lib/components/shared/table/table.component.mjs +124 -0
  23. package/esm2022/lib/components/upload-list/upload-list.component.mjs +85 -0
  24. package/esm2022/lib/directives/abstract-debounce/abstract-debounce.directive.mjs +41 -0
  25. package/{esm2020 → esm2022}/lib/directives/abstract-debounce/debounce-keyup.directive.mjs +5 -5
  26. package/esm2022/lib/directives/auto-hide.directive.mjs +51 -0
  27. package/esm2022/lib/directives/copy-to-clipboard.directive.mjs +36 -0
  28. package/esm2022/lib/directives/drag-drop.directive.mjs +55 -0
  29. package/esm2022/lib/directives/loading.directive.mjs +43 -0
  30. package/esm2022/lib/directives/table/checkBoxRow.directive.mjs +130 -0
  31. package/esm2022/lib/directives/table/column.directive.mjs +50 -0
  32. package/esm2022/lib/directives/table/columnHeader.directive.mjs +215 -0
  33. package/esm2022/lib/directives/table/raw.directive.mjs +34 -0
  34. package/esm2022/lib/directives/zindex-toggle.directive.mjs +45 -0
  35. package/esm2022/lib/dto/canva-create-design.dto.mjs +9 -0
  36. package/esm2022/lib/dto/canva.dto.mjs +6 -0
  37. package/esm2022/lib/dto/config/apis/api.dto.mjs +11 -0
  38. package/esm2022/lib/dto/config/external/external-config.dto.mjs +5 -0
  39. package/esm2022/lib/dto/wizi-block-media.dto.mjs +7 -0
  40. package/esm2022/lib/pipes/images/img-src.pipe.mjs +29 -0
  41. package/{esm2020 → esm2022}/lib/pipes/number-to-array.pipe.mjs +4 -4
  42. package/esm2022/lib/pipes/pagination/array-total-pages/array-pages.pipe.mjs +28 -0
  43. package/esm2022/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.mjs +53 -0
  44. package/esm2022/lib/pipes/pagination/text/custom-text.pipe.mjs +36 -0
  45. package/esm2022/lib/pipes/pagination/total-pages/is-last-page.pipe.mjs +25 -0
  46. package/{esm2020 → esm2022}/lib/pipes/select/select-filters.pipe.mjs +4 -4
  47. package/esm2022/lib/services/alert.service.mjs +53 -0
  48. package/{esm2020 → esm2022}/lib/services/api.service.mjs +4 -4
  49. package/esm2022/lib/services/canva.service.mjs +165 -0
  50. package/esm2022/lib/services/config/img-cdn.service.mjs +21 -0
  51. package/esm2022/lib/services/dom.service.mjs +31 -0
  52. package/{esm2020 → esm2022}/lib/services/icon.service.mjs +4 -4
  53. package/{esm2020 → esm2022}/lib/services/image-not-found.service.mjs +4 -4
  54. package/esm2022/lib/services/img-event.service.mjs +33 -0
  55. package/esm2022/lib/services/img-manager.service.mjs +134 -0
  56. package/esm2022/lib/services/img-selection.service.mjs +75 -0
  57. package/esm2022/lib/services/pexels.service.mjs +66 -0
  58. package/esm2022/lib/services/rename-picture.service.mjs +66 -0
  59. package/esm2022/lib/services/snackbar.service.mjs +67 -0
  60. package/esm2022/lib/services/table/filters-table.service.mjs +61 -0
  61. package/esm2022/lib/services/upload.service.mjs +20 -0
  62. package/esm2022/lib/services/user-settings.service.mjs +23 -0
  63. package/esm2022/lib/wz-img-manager.component.mjs +209 -0
  64. package/{esm2020 → esm2022}/lib/wz-img-manager.module.mjs +61 -61
  65. package/{fesm2020 → fesm2022}/wizishop-img-manager.mjs +1018 -830
  66. package/fesm2022/wizishop-img-manager.mjs.map +1 -0
  67. package/lib/components/canva-btn/canva-btn.component.d.ts +1 -1
  68. package/lib/components/images-view/images-actions-handler.d.ts +2 -1
  69. package/lib/components/images-view/images-view.component.d.ts +4 -9
  70. package/lib/components/images-view/mosaic-view/img-card/img-card.component.d.ts +1 -1
  71. package/lib/components/images-view/mosaic-view/mosaic-view.component.d.ts +1 -1
  72. package/lib/components/img-editor/cropper/cropper.component.d.ts +1 -1
  73. package/lib/components/img-editor/img-editor.component.d.ts +1 -1
  74. package/lib/components/img-editor/info-section/info-section.component.d.ts +1 -1
  75. package/lib/components/img-selection/img-selection.component.d.ts +4 -5
  76. package/lib/components/img-tabs/img-tabs.component.d.ts +1 -1
  77. package/lib/components/img-upload/img-upload.component.d.ts +1 -1
  78. package/lib/components/loader/loader.component.d.ts +1 -1
  79. package/lib/components/pexels-lib/pexels-lib.component.d.ts +1 -1
  80. package/lib/components/shared/alert/alert.component.d.ts +1 -1
  81. package/lib/components/shared/checkbox/checkbox.component.d.ts +1 -1
  82. package/lib/components/shared/dropdown/dropdown.component.d.ts +1 -1
  83. package/lib/components/shared/input-search/input-search.component.d.ts +1 -1
  84. package/lib/components/shared/pagination/page-selector/page-selector.component.d.ts +1 -1
  85. package/lib/components/shared/pagination/pagination.component.d.ts +1 -1
  86. package/lib/components/shared/select/select.component.d.ts +1 -1
  87. package/lib/components/shared/table/table.component.d.ts +1 -1
  88. package/lib/components/upload-list/upload-list.component.d.ts +1 -1
  89. package/lib/directives/abstract-debounce/abstract-debounce.directive.d.ts +1 -1
  90. package/lib/directives/auto-hide.directive.d.ts +1 -1
  91. package/lib/directives/copy-to-clipboard.directive.d.ts +1 -1
  92. package/lib/directives/table/checkBoxRow.directive.d.ts +1 -1
  93. package/lib/directives/table/column.directive.d.ts +1 -1
  94. package/lib/directives/table/columnHeader.directive.d.ts +1 -1
  95. package/lib/directives/zindex-toggle.directive.d.ts +1 -1
  96. package/lib/wz-img-manager.component.d.ts +3 -3
  97. package/package.json +6 -12
  98. package/wizishop-img-manager-18.2.2-beta.tgz +0 -0
  99. package/wz-img-manager.scss +77 -60
  100. package/esm2020/lib/components/canva-btn/canva-btn.component.mjs +0 -67
  101. package/esm2020/lib/components/images-view/images-actions-handler.mjs +0 -154
  102. package/esm2020/lib/components/images-view/images-view.component.mjs +0 -369
  103. package/esm2020/lib/components/images-view/mosaic-view/img-card/img-card.component.mjs +0 -66
  104. package/esm2020/lib/components/images-view/mosaic-view/mosaic-view.component.mjs +0 -71
  105. package/esm2020/lib/components/images-view/table-view/table-view.component.mjs +0 -48
  106. package/esm2020/lib/components/img-editor/cropper/cropper.component.mjs +0 -307
  107. package/esm2020/lib/components/img-editor/img-editor.component.mjs +0 -124
  108. package/esm2020/lib/components/img-editor/info-section/info-section.component.mjs +0 -54
  109. package/esm2020/lib/components/img-selection/img-selection.component.mjs +0 -53
  110. package/esm2020/lib/components/img-tabs/img-tabs.component.mjs +0 -122
  111. package/esm2020/lib/components/img-upload/img-upload.component.mjs +0 -126
  112. package/esm2020/lib/components/loader/loader.component.mjs +0 -21
  113. package/esm2020/lib/components/pexels-lib/pexels-lib.component.mjs +0 -203
  114. package/esm2020/lib/components/shared/alert/alert.component.mjs +0 -27
  115. package/esm2020/lib/components/shared/checkbox/checkbox.component.mjs +0 -52
  116. package/esm2020/lib/components/shared/dropdown/dropdown.component.mjs +0 -21
  117. package/esm2020/lib/components/shared/input-search/input-search.component.mjs +0 -54
  118. package/esm2020/lib/components/shared/pagination/page-selector/page-selector.component.mjs +0 -49
  119. package/esm2020/lib/components/shared/pagination/pagination.component.mjs +0 -49
  120. package/esm2020/lib/components/shared/select/select.component.mjs +0 -110
  121. package/esm2020/lib/components/shared/table/table.component.mjs +0 -116
  122. package/esm2020/lib/components/upload-list/upload-list.component.mjs +0 -79
  123. package/esm2020/lib/directives/abstract-debounce/abstract-debounce.directive.mjs +0 -37
  124. package/esm2020/lib/directives/auto-hide.directive.mjs +0 -48
  125. package/esm2020/lib/directives/copy-to-clipboard.directive.mjs +0 -37
  126. package/esm2020/lib/directives/drag-drop.directive.mjs +0 -57
  127. package/esm2020/lib/directives/loading.directive.mjs +0 -42
  128. package/esm2020/lib/directives/table/checkBoxRow.directive.mjs +0 -114
  129. package/esm2020/lib/directives/table/column.directive.mjs +0 -45
  130. package/esm2020/lib/directives/table/columnHeader.directive.mjs +0 -204
  131. package/esm2020/lib/directives/table/raw.directive.mjs +0 -31
  132. package/esm2020/lib/directives/zindex-toggle.directive.mjs +0 -42
  133. package/esm2020/lib/dto/canva-create-design.dto.mjs +0 -4
  134. package/esm2020/lib/dto/canva.dto.mjs +0 -4
  135. package/esm2020/lib/dto/config/apis/api.dto.mjs +0 -9
  136. package/esm2020/lib/dto/config/external/external-config.dto.mjs +0 -3
  137. package/esm2020/lib/dto/wizi-block-media.dto.mjs +0 -3
  138. package/esm2020/lib/pipes/images/img-src.pipe.mjs +0 -28
  139. package/esm2020/lib/pipes/pagination/array-total-pages/array-pages.pipe.mjs +0 -28
  140. package/esm2020/lib/pipes/pagination/large-number-of-page/large-number-of-page.pipe.mjs +0 -53
  141. package/esm2020/lib/pipes/pagination/text/custom-text.pipe.mjs +0 -35
  142. package/esm2020/lib/pipes/pagination/total-pages/is-last-page.pipe.mjs +0 -25
  143. package/esm2020/lib/services/alert.service.mjs +0 -50
  144. package/esm2020/lib/services/canva.service.mjs +0 -159
  145. package/esm2020/lib/services/config/img-cdn.service.mjs +0 -23
  146. package/esm2020/lib/services/dom.service.mjs +0 -33
  147. package/esm2020/lib/services/img-event.service.mjs +0 -35
  148. package/esm2020/lib/services/img-manager.service.mjs +0 -136
  149. package/esm2020/lib/services/img-selection.service.mjs +0 -76
  150. package/esm2020/lib/services/pexels.service.mjs +0 -62
  151. package/esm2020/lib/services/rename-picture.service.mjs +0 -63
  152. package/esm2020/lib/services/snackbar.service.mjs +0 -64
  153. package/esm2020/lib/services/table/filters-table.service.mjs +0 -60
  154. package/esm2020/lib/services/upload.service.mjs +0 -22
  155. package/esm2020/lib/services/user-settings.service.mjs +0 -25
  156. package/esm2020/lib/wz-img-manager.component.mjs +0 -192
  157. package/fesm2015/wizishop-img-manager.mjs +0 -4035
  158. package/fesm2015/wizishop-img-manager.mjs.map +0 -1
  159. package/fesm2020/wizishop-img-manager.mjs.map +0 -1
  160. package/wizishop-img-manager-18.2.0.tgz +0 -0
  161. /package/{esm2020 → esm2022}/lib/animations/easeInOut/ease-in-out.animation.mjs +0 -0
  162. /package/{esm2020 → esm2022}/lib/animations/insertRemove/insert-remove.animation.mjs +0 -0
  163. /package/{esm2020 → esm2022}/lib/animations/listAnnimation/list.animation.mjs +0 -0
  164. /package/{esm2020 → esm2022}/lib/components/shared/select/call-to-action.model.mjs +0 -0
  165. /package/{esm2020 → esm2022}/lib/components/shared/select/select-items.dto.mjs +0 -0
  166. /package/{esm2020 → esm2022}/lib/dto/ImgManagerDisplayConfig.dto.mjs +0 -0
  167. /package/{esm2020 → esm2022}/lib/dto/config/image-cdn/image-cdn-config.dto.mjs +0 -0
  168. /package/{esm2020 → esm2022}/lib/dto/config/img-manager.mjs +0 -0
  169. /package/{esm2020 → esm2022}/lib/dto/export-dtos.api.mjs +0 -0
  170. /package/{esm2020 → esm2022}/lib/dto/img-editor-config.dto.mjs +0 -0
  171. /package/{esm2020 → esm2022}/lib/dto/img-manager.dto.mjs +0 -0
  172. /package/{esm2020 → esm2022}/lib/dto/pexels-img.dto.mjs +0 -0
  173. /package/{esm2020 → esm2022}/lib/dto/picture-name-update.dto.mjs +0 -0
  174. /package/{esm2020 → esm2022}/lib/dto/stateDisplayed.dto.mjs +0 -0
  175. /package/{esm2020 → esm2022}/lib/dto/tabDisplayed.dto.mjs +0 -0
  176. /package/{esm2020 → esm2022}/public-api.mjs +0 -0
  177. /package/{esm2020 → esm2022}/wizishop-img-manager.mjs +0 -0
@@ -1,4035 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, inject, Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostBinding, HostListener, ViewChild, ChangeDetectionStrategy, Pipe, Inject, NgModule } from '@angular/core';
3
- import { BehaviorSubject, Subject, tap, Observable, forkJoin, merge, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, switchMap, map as map$1, take as take$1, startWith, shareReplay, combineLatest } from 'rxjs';
4
- import { take, map, takeUntil, debounceTime, distinctUntilChanged, tap as tap$1, filter } from 'rxjs/operators';
5
- import * as i1 from '@wizishop/ng-wizi-bulma';
6
- import { NwbAllModule } from '@wizishop/ng-wizi-bulma';
7
- import * as i3 from '@ngx-translate/core';
8
- import { TranslateModule } from '@ngx-translate/core';
9
- import * as i2 from '@angular/common';
10
- import { DOCUMENT, CommonModule } from '@angular/common';
11
- import * as i3$2 from '@angular/router';
12
- import * as i2$1 from '@angular/forms';
13
- import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
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
- import * as i4 from 'ngx-scrollbar';
18
- import { NgScrollbarModule } from 'ngx-scrollbar';
19
- import * as i8 from 'ngx-scrollbar/reached-event';
20
- import { NgScrollbarReachedModule } from 'ngx-scrollbar/reached-event';
21
- import * as i4$1 from 'ngx-image-cropper';
22
- import { ImageCropperModule } from 'ngx-image-cropper';
23
- import { v4 } from 'uuid';
24
- import * as i3$3 from '@angular/cdk/drag-drop';
25
- import { DragDropModule } from '@angular/cdk/drag-drop';
26
- import { CdkTableModule } from '@angular/cdk/table';
27
-
28
- class ImgSelectionService {
29
- constructor() {
30
- this.multipleImgMode = false;
31
- this.imgSelection$ = new BehaviorSubject([]);
32
- this.imgSelectedListLoading$ = new BehaviorSubject(false);
33
- }
34
- getImgSelection() {
35
- return this.imgSelection$.getValue();
36
- }
37
- // Use in img manager webelement, when the product img selection is retrieved
38
- setImgSelection(imgSelectedList) {
39
- this.imgSelection$.next(imgSelectedList || []);
40
- }
41
- addImgSelected(picture) {
42
- if (this.multipleImgMode) {
43
- this.imgSelection$.next([...this.imgSelection$.getValue(), picture]);
44
- }
45
- else {
46
- this.imgSelection$.next([picture]);
47
- }
48
- }
49
- removeImgSelectedByIndex(index) {
50
- const imgSelectedList = this.imgSelection$.getValue();
51
- imgSelectedList.splice(index, 1);
52
- this.imgSelection$.next(imgSelectedList);
53
- }
54
- removeImgSelectedById(id_file) {
55
- if (!this.multipleImgMode) {
56
- this.imgSelection$.next([]);
57
- return;
58
- }
59
- this.imgSelection$.next(this.imgSelection$.getValue().filter(img => img.id_file !== id_file));
60
- }
61
- removeImgSelectionByIds(id_file_list) {
62
- if (!this.multipleImgMode) {
63
- this.imgSelection$.next([]);
64
- return;
65
- }
66
- this.imgSelection$.next(this.imgSelection$.getValue().filter(img => id_file_list.includes(img.id_file)));
67
- }
68
- removeAllImgSelected() {
69
- this.imgSelection$.next([]);
70
- }
71
- setMultipleImgMode(activated) {
72
- this.multipleImgMode = activated;
73
- }
74
- initImgSelectedList(imgSelectedList) {
75
- // Retrieve the imgSelectedList from parameter
76
- if (imgSelectedList) {
77
- this.imgSelection$.next(imgSelectedList);
78
- return;
79
- }
80
- this.imgSelection$.next([]);
81
- }
82
- /**
83
- * Use angular cdk function
84
- * Called by img selection component
85
- * @param event
86
- */
87
- moveImgOrder(event) {
88
- const fromIndex = event.previousIndex;
89
- const toIndex = event.currentIndex;
90
- const imgSelectedList = this.imgSelection$.getValue();
91
- imgSelectedList.splice(toIndex, 0, imgSelectedList.splice(fromIndex, 1)[0]);
92
- this.imgSelection$.next(imgSelectedList);
93
- }
94
- }
95
- ImgSelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
96
- ImgSelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgSelectionService });
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgSelectionService, decorators: [{
98
- type: Injectable
99
- }], ctorParameters: function () { return []; } });
100
-
101
- class UserSettingsService {
102
- constructor() {
103
- this.userdisplayPreference = 'WzImgManagerListDisplayed';
104
- }
105
- /**
106
- * true : display list
107
- * false : display mosaic
108
- * @param value
109
- */
110
- setUserDisplayPreference(value) {
111
- localStorage.setItem(this.userdisplayPreference, '' + value);
112
- }
113
- getUserDisplayPreference() {
114
- const value = localStorage.getItem(this.userdisplayPreference);
115
- return value == 'true';
116
- }
117
- }
118
- UserSettingsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
119
- UserSettingsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserSettingsService });
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UserSettingsService, decorators: [{
121
- type: Injectable
122
- }] });
123
-
124
- class ImgEventService {
125
- constructor() {
126
- this.imgRemoved$ = new BehaviorSubject(undefined);
127
- this.imgToEditEvent = new Subject();
128
- this.imgAdded = new Subject();
129
- this.listDisplayedChange = new Subject();
130
- }
131
- emitImgToEdit(imgToEdit) {
132
- this.imgToEditEvent.next(imgToEdit);
133
- }
134
- getImgToEditEventListener() {
135
- return this.imgToEditEvent.asObservable();
136
- }
137
- emitImgAdded(id_file) {
138
- this.imgAdded.next(id_file);
139
- }
140
- getImgAddedEventListner() {
141
- return this.imgAdded.asObservable();
142
- }
143
- emitlistDisplayedChange(value) {
144
- this.listDisplayedChange.next(value);
145
- }
146
- getlistDisplayedChange() {
147
- return this.listDisplayedChange.asObservable();
148
- }
149
- }
150
- ImgEventService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
151
- ImgEventService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgEventService });
152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgEventService, decorators: [{
153
- type: Injectable
154
- }] });
155
-
156
- class AlertService {
157
- constructor(nwbAlertService, translateService) {
158
- this.nwbAlertService = nwbAlertService;
159
- this.translateService = translateService;
160
- this.actionMsg = 'ImgManager.alert.action';
161
- this.alertConfig = {
162
- message: '',
163
- duration: 5000
164
- };
165
- }
166
- openAlert(msgKey) {
167
- this.closePreviousAlert();
168
- this.translateService.get(msgKey).subscribe(trans => {
169
- this.alertConfig.message = trans;
170
- this.setAlertColor(msgKey);
171
- this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
172
- this.alertRefComponent.afterClosed().subscribe();
173
- });
174
- }
175
- openAlertWithBackendResponse(msgKey, msgBackend) {
176
- this.translateService.get(msgKey).subscribe(trans => {
177
- this.alertConfig.message = trans;
178
- this.alertConfig.message += '<br/>' + JSON.parse(msgBackend).message;
179
- this.closePreviousAlert();
180
- this.alertRefComponent = this.nwbAlertService.open(this.alertConfig);
181
- this.alertRefComponent.afterClosed().subscribe();
182
- });
183
- }
184
- closePreviousAlert() {
185
- if (this.alertRefComponent) {
186
- this.alertRefComponent.dismiss();
187
- }
188
- }
189
- setAlertColor(msgKey) {
190
- const isErrorMsg = /error/i.test(msgKey);
191
- this.alertConfig.color = isErrorMsg ? 'is-danger' : 'is-success';
192
- }
193
- }
194
- AlertService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlertService, deps: [{ token: i1.NwbAlertService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
195
- AlertService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlertService });
196
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlertService, decorators: [{
197
- type: Injectable
198
- }], ctorParameters: function () { return [{ type: i1.NwbAlertService }, { type: i3.TranslateService }]; } });
199
-
200
- class ApiService {
201
- }
202
- ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
203
- ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiService });
204
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ApiService, decorators: [{
205
- type: Injectable
206
- }] });
207
-
208
- class UploadService {
209
- constructor() {
210
- this.imageUploaded$ = new Subject();
211
- this.apiService = inject(ApiService);
212
- }
213
- uploadFile(formData) {
214
- return this.apiService.uploadFile(formData).pipe(tap((img) => this.imageUploaded$.next(img)));
215
- }
216
- uploadFileByUrl(url, fileName) {
217
- return this.apiService.uploadFileByUrl(url, fileName).pipe(tap((img) => this.imageUploaded$.next(img)));
218
- }
219
- }
220
- UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
221
- UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadService });
222
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadService, decorators: [{
223
- type: Injectable
224
- }] });
225
-
226
- class CanvaService {
227
- get canvaApiURL() {
228
- return this.apiService.CONFIG.canva_url;
229
- }
230
- ;
231
- get canvaApiKey() {
232
- return this.apiService.CONFIG.canva_token;
233
- }
234
- constructor(wzImgEventService, alertService, translateService, uploadService, apiService) {
235
- this.wzImgEventService = wzImgEventService;
236
- this.alertService = alertService;
237
- this.translateService = translateService;
238
- this.uploadService = uploadService;
239
- this.apiService = apiService;
240
- this.imgLoading = false;
241
- this.uploadingImg = 'ImgManager.CanvaBtn.uploadingImg';
242
- this.successUploadPhoto = 'ImgManager.CanvaBtn.successImport';
243
- this.errorUploadCanvaImg = 'ImgManager.CanvaBtn.errorUploadCanvaImg';
244
- this.errorRenameCanvaImg = 'ImgManager.CanvaBtn.errorRenameCanvaImg';
245
- this.forceToOpenCanva = false;
246
- this.bindExpectedImgSizeEvent = new BehaviorSubject(null);
247
- this.bindExpectedSizeDone = this.bindExpectedImgSizeEvent.asObservable();
248
- }
249
- getCanvaLogo() {
250
- return this.apiService.CONFIG.assets_route + "canva/icon_canva.svg";
251
- }
252
- bindEventExepectedImgSizeChange() {
253
- return this.bindExpectedSizeDone;
254
- }
255
- expectedImgSizesChange(mediaDTO) {
256
- this.bindExpectedImgSizeEvent.next(mediaDTO);
257
- if (this.forceToOpenCanva) {
258
- this.openCanva(parseInt(mediaDTO.image_width), parseInt(mediaDTO.image_height));
259
- }
260
- }
261
- getCanvaApi() {
262
- return new Observable(observer => {
263
- this.loadCanva().subscribe({
264
- complete: () => {
265
- if (this.canvaApi && Canva.DesignButton) {
266
- observer.next(this.canvaApi);
267
- observer.complete();
268
- }
269
- else {
270
- this.initializeCanva(observer);
271
- }
272
- }
273
- });
274
- });
275
- }
276
- initializeCanva(observer) {
277
- if (Canva.DesignButton) {
278
- Canva.DesignButton.initialize({
279
- apiKey: this.canvaApiKey
280
- }).then((canvaApi) => {
281
- this.canvaApi = canvaApi;
282
- observer.next(this.canvaApi);
283
- observer.complete();
284
- });
285
- }
286
- }
287
- loadCanva() {
288
- return new Observable(observer => {
289
- if (this.canvaApi) {
290
- observer.complete();
291
- }
292
- else {
293
- this.loadCanvaScript(observer);
294
- }
295
- });
296
- }
297
- loadCanvaScript(observer) {
298
- const node = document.createElement('script');
299
- node.src = this.canvaApiURL;
300
- node.type = 'text/javascript';
301
- node.async = false;
302
- node.charset = 'utf-8';
303
- node.onload = () => {
304
- observer.complete();
305
- };
306
- document.getElementsByTagName('head')[0].appendChild(node);
307
- }
308
- openCanva(width, height) {
309
- if (this.imgLoading) {
310
- return;
311
- }
312
- this.getCanvaApi().pipe(take(1)).subscribe((api) => {
313
- this.canvaApi = api;
314
- this.addOverflowBody();
315
- this.createDesign(width, height);
316
- });
317
- }
318
- addOverflowBody() {
319
- document.body.classList.add('ovh-canva');
320
- }
321
- removeOverflowBody() {
322
- document.body.classList.remove('ovh-canva');
323
- }
324
- createDesign(width, height) {
325
- const createDesign = {
326
- type: 'EtsyShopIcon',
327
- dimensions: {
328
- units: 'px',
329
- width: width ? width : undefined,
330
- height: height ? height : undefined,
331
- },
332
- publishLabel: this.translateService.instant('ImgManager.CanvaBtn.publish'),
333
- };
334
- this.canvaApi.createDesign({
335
- design: createDesign,
336
- onDesignPublish: ({ exportUrl, designTitle }) => this.designPublished(exportUrl, designTitle),
337
- onDesignClose: () => {
338
- this.removeOverflowBody();
339
- }
340
- });
341
- }
342
- designPublished(exportUrl, designTitle) {
343
- this.alertService.openAlert(this.uploadingImg);
344
- this.imgLoading = true;
345
- this.uploadService.uploadFileByUrl(exportUrl, designTitle).pipe(take(1)).subscribe({
346
- next: (img) => {
347
- this.imgLoading = false;
348
- this.removeOverflowBody();
349
- this.wzImgEventService.emitImgAdded(img.id_file);
350
- this.alertService.openAlert(this.successUploadPhoto);
351
- },
352
- error: error => {
353
- this.imgLoading = false;
354
- this.removeOverflowBody();
355
- if (error.error.code === 406 && error.error.message) {
356
- this.alertService.openAlertWithBackendResponse(this.errorUploadCanvaImg, error.error.message);
357
- }
358
- else {
359
- this.alertService.openAlert(this.errorUploadCanvaImg);
360
- }
361
- }
362
- });
363
- }
364
- }
365
- CanvaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CanvaService, deps: [{ token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: UploadService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
366
- CanvaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CanvaService });
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CanvaService, decorators: [{
368
- type: Injectable
369
- }], ctorParameters: function () { return [{ type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: UploadService }, { type: ApiService }]; } });
370
-
371
- class DomService {
372
- constructor() {
373
- this.documentEventSource = new Subject();
374
- this.documentEventDone = this.documentEventSource.asObservable();
375
- this.documentScrollSource = new Subject();
376
- this.documentScrollDone = this.documentScrollSource.asObservable();
377
- }
378
- documentEvent() {
379
- return this.documentEventDone;
380
- }
381
- setDocumentEventListener() {
382
- document.body.addEventListener('click', event => {
383
- this.documentEventSource.next(event.target);
384
- });
385
- }
386
- documentScroll() {
387
- return this.documentScrollDone;
388
- }
389
- setScrollEventListener() {
390
- window.onscroll = () => {
391
- this.documentScrollSource.next(window);
392
- };
393
- }
394
- }
395
- DomService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
396
- DomService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService });
397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DomService, decorators: [{
398
- type: Injectable
399
- }] });
400
-
401
- class IconService {
402
- loadIconLib() {
403
- const link = document.createElement('link');
404
- link.href = 'https://media.cdnws.com/_t/_/dist/icons/fontawesome/css/all.min.css?v1.05';
405
- link.rel = 'stylesheet';
406
- link.crossOrigin = "anonymous";
407
- document.getElementsByTagName('head')[0].appendChild(link);
408
- }
409
- }
410
- IconService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
411
- IconService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IconService, providedIn: 'root' });
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IconService, decorators: [{
413
- type: Injectable,
414
- args: [{ providedIn: 'root' }]
415
- }] });
416
-
417
- const easeInOut = // the fade-in/fade-out animation.
418
- trigger('easeInOut', [
419
- // the "in" style determines the "resting" state of the element when it is visible.
420
- state('in', style({ opacity: 1 })),
421
- // fade in when created. this could also be written as transition('void => *')
422
- transition(':enter', [
423
- style({ opacity: 0 }),
424
- animate('0.5s ease-in-out')
425
- ]),
426
- ]);
427
-
428
- class LoaderComponent {
429
- constructor() {
430
- this.small = false;
431
- }
432
- }
433
- LoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
434
- LoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: LoaderComponent, selector: "wz-loader", inputs: { text: "text", small: "small", position: "position" }, ngImport: i0, template: "<div class=\"wz-loader\" [ngClass]=\"{'is-small': small}\" [ngStyle]=\"{'position': position}\">\n <div class='loader loader1'>\n <div>\n <div>\n <div>\n <div>\n <div>\n <div></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <p class=\"is-textcentered\" *ngIf=\"text\" [innerHTML]=\"text\"></p>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], encapsulation: i0.ViewEncapsulation.None });
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoaderComponent, decorators: [{
436
- type: Component,
437
- args: [{ selector: 'wz-loader', encapsulation: ViewEncapsulation.None, template: "<div class=\"wz-loader\" [ngClass]=\"{'is-small': small}\" [ngStyle]=\"{'position': position}\">\n <div class='loader loader1'>\n <div>\n <div>\n <div>\n <div>\n <div>\n <div></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <p class=\"is-textcentered\" *ngIf=\"text\" [innerHTML]=\"text\"></p>\n</div>\n" }]
438
- }], propDecorators: { text: [{
439
- type: Input
440
- }], small: [{
441
- type: Input
442
- }], position: [{
443
- type: Input
444
- }] } });
445
-
446
- class DragDropDirective {
447
- constructor() {
448
- this.onFileDropped = new EventEmitter();
449
- this.background = '#fff';
450
- this.opacity = '1';
451
- }
452
- onDragOver(evt) {
453
- evt.preventDefault();
454
- evt.stopPropagation();
455
- this.background = '#f5f5f5';
456
- this.opacity = '0.8';
457
- }
458
- onDragLeave(evt) {
459
- evt.preventDefault();
460
- evt.stopPropagation();
461
- this.background = '#fff';
462
- this.opacity = '1';
463
- }
464
- ondrop(evt) {
465
- evt.preventDefault();
466
- evt.stopPropagation();
467
- this.background = '#f5f5f5';
468
- this.opacity = '1';
469
- const files = evt.dataTransfer.files;
470
- if (files.length > 0) {
471
- this.onFileDropped.emit(files);
472
- }
473
- }
474
- }
475
- DragDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
476
- DragDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DragDropDirective, selector: "[appDragDrop]", outputs: { onFileDropped: "onFileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "style.background-color": "this.background", "style.opacity": "this.opacity" } }, ngImport: i0 });
477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DragDropDirective, decorators: [{
478
- type: Directive,
479
- args: [{
480
- selector: '[appDragDrop]'
481
- }]
482
- }], propDecorators: { onFileDropped: [{
483
- type: Output
484
- }], background: [{
485
- type: HostBinding,
486
- args: ['style.background-color']
487
- }], opacity: [{
488
- type: HostBinding,
489
- args: ['style.opacity']
490
- }], onDragOver: [{
491
- type: HostListener,
492
- args: ['dragover', ['$event']]
493
- }], onDragLeave: [{
494
- type: HostListener,
495
- args: ['dragleave', ['$event']]
496
- }], ondrop: [{
497
- type: HostListener,
498
- args: ['drop', ['$event']]
499
- }] } });
500
-
501
- class ImgUploadComponent {
502
- constructor(alertService, apiService, translateService, uploadService) {
503
- this.alertService = alertService;
504
- this.apiService = apiService;
505
- this.translateService = translateService;
506
- this.uploadService = uploadService;
507
- this.files = [];
508
- this.isLoading = false;
509
- this.imgUploaded = new EventEmitter();
510
- this.loadingText = 'ImgManager.ImgUpload.loading';
511
- this.errorUploadingImg = 'ImgManager.ImgUpload.errorUploadingImg';
512
- this.errorNotImg = 'ImgManager.ImgUpload.errorNotImg';
513
- this.MAX_IMAGE_SIZE = 10000000; // In bytes
514
- }
515
- ngOnInit() {
516
- this.assetsIcon = this.getAssets();
517
- }
518
- filesChangeByClick(event) {
519
- this.uploadFile(event.target.files);
520
- }
521
- getAssets() {
522
- return this.apiService.CONFIG.assets_route + "img/icon_picture.svg";
523
- }
524
- filesChangeByDragAndDrop(filesList) {
525
- this.removeDragAndDropStyle();
526
- this.uploadFile(Array.from(filesList));
527
- }
528
- uploadFile(files) {
529
- if (files && !files.length) {
530
- return;
531
- }
532
- this.isLoading = true;
533
- const imgToUploadList = [];
534
- for (const file of files) {
535
- if (!this.isFileImage(file.type)) {
536
- this.alertService.openAlert(this.errorNotImg);
537
- this.isLoading = false;
538
- continue;
539
- }
540
- if (!this.isSizeValid(file.size)) {
541
- this.alertService.openAlert(this.translateService.instant('ImgManager.ImgUpload.ErrorImgSize', {
542
- fileName: file.name,
543
- fileSize: this.getImageSizeInKo(file.size),
544
- maxFileSize: this.getImageSizeInKo(this.MAX_IMAGE_SIZE)
545
- }));
546
- this.isLoading = false;
547
- continue;
548
- }
549
- const formData = new FormData();
550
- formData.append('image', file, file.name);
551
- imgToUploadList.push(this.uploadService.uploadFile(formData));
552
- }
553
- forkJoin(imgToUploadList).subscribe({
554
- next: (img) => {
555
- this.onImgUpload(img),
556
- this.isLoading = false;
557
- },
558
- error: error => {
559
- var _a;
560
- if (((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.message) && error.statusText !== 'Bad Request') {
561
- this.alertService.openAlertWithBackendResponse(this.errorUploadingImg, error.error.message);
562
- }
563
- else {
564
- this.alertService.openAlert(this.errorUploadingImg);
565
- }
566
- this.isLoading = false;
567
- }
568
- });
569
- }
570
- /**
571
- * Send the img uploaded to the tabs components,
572
- * Then the tabs components add the img to upload list by calling the method onImgUploaded of the upload-list component
573
- * @param img
574
- */
575
- onImgUpload(img) {
576
- this.imgUploaded.emit(img);
577
- }
578
- isFileImage(fileType) {
579
- return fileType.split('/')[0] === 'image';
580
- }
581
- isSizeValid(imageBytesSize) {
582
- return imageBytesSize < this.MAX_IMAGE_SIZE;
583
- }
584
- getImageSizeInKo(size) {
585
- return Math.round(size / 1024);
586
- }
587
- /**
588
- * Remove the style of the drag and drop box
589
- * After an img is droped, the box is still grey
590
- */
591
- removeDragAndDropStyle() {
592
- this.dragAndDropBox.nativeElement.style = '';
593
- }
594
- }
595
- ImgUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgUploadComponent, deps: [{ token: AlertService }, { token: ApiService }, { token: i3.TranslateService }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
596
- ImgUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImgUploadComponent, selector: "img-upload", inputs: { stateDisplayed: "stateDisplayed" }, outputs: { imgUploaded: "imgUploaded" }, viewQueries: [{ propertyName: "dragAndDropBox", first: true, predicate: ["dragAndDropBox"], descendants: true }], ngImport: i0, template: "<div\r\n class=\"img-upload has-text-centered\"\r\n [ngClass]=\"{'img-upload--small': stateDisplayed === 'small'}\"\r\n (click)=\"fileInput.click()\"\r\n appDragDrop\r\n (onFileDropped)=\"filesChangeByDragAndDrop($any($event))\"\r\n #dragAndDropBox\r\n [@easeInOut]=\"'in'\"\r\n>\r\n <input hidden type=\"file\" #fileInput (change)=\"filesChangeByClick($event)\" accept=\"image/*\" multiple >\r\n <div class=\"img-upload__container\" [ngClass]=\"{'img-upload__container--small': stateDisplayed === 'small'}\">\r\n\r\n <div class=\"img-upload__container__wrapper\">\r\n\r\n <div class=\"img-upload__container__loader\" *ngIf=\"isLoading\">\r\n <wz-loader [small]=\"true\" [position]=\"'relative'\"></wz-loader>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!isLoading\">\r\n <div class=\"blueColor img-upload__container__dropImgIconDiv\">\r\n <img *ngIf=\"assetsIcon\" [src]=\"assetsIcon\" alt=\"icon picture\" />\r\n <p>{{ 'ImgManager.ImgUpload.dropImg' | translate }}</p>\r\n </div>\r\n\r\n <p class=\"img-upload__container__or\">{{ 'ImgManager.ImgUpload.or' | translate }}</p>\r\n\r\n <div class=\"img-upload__container__text\">\r\n <i class=\"fal fa-file-upload\"></i>{{ 'ImgManager.ImgUpload.selectImg' | translate }}\r\n </div>\r\n </ng-container>\r\n\r\n </div>\r\n </div>\r\n</div>\r\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: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "directive", type: DragDropDirective, selector: "[appDragDrop]", outputs: ["onFileDropped"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
597
- easeInOut
598
- ] });
599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgUploadComponent, decorators: [{
600
- type: Component,
601
- args: [{ selector: 'img-upload', animations: [
602
- easeInOut
603
- ], template: "<div\r\n class=\"img-upload has-text-centered\"\r\n [ngClass]=\"{'img-upload--small': stateDisplayed === 'small'}\"\r\n (click)=\"fileInput.click()\"\r\n appDragDrop\r\n (onFileDropped)=\"filesChangeByDragAndDrop($any($event))\"\r\n #dragAndDropBox\r\n [@easeInOut]=\"'in'\"\r\n>\r\n <input hidden type=\"file\" #fileInput (change)=\"filesChangeByClick($event)\" accept=\"image/*\" multiple >\r\n <div class=\"img-upload__container\" [ngClass]=\"{'img-upload__container--small': stateDisplayed === 'small'}\">\r\n\r\n <div class=\"img-upload__container__wrapper\">\r\n\r\n <div class=\"img-upload__container__loader\" *ngIf=\"isLoading\">\r\n <wz-loader [small]=\"true\" [position]=\"'relative'\"></wz-loader>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!isLoading\">\r\n <div class=\"blueColor img-upload__container__dropImgIconDiv\">\r\n <img *ngIf=\"assetsIcon\" [src]=\"assetsIcon\" alt=\"icon picture\" />\r\n <p>{{ 'ImgManager.ImgUpload.dropImg' | translate }}</p>\r\n </div>\r\n\r\n <p class=\"img-upload__container__or\">{{ 'ImgManager.ImgUpload.or' | translate }}</p>\r\n\r\n <div class=\"img-upload__container__text\">\r\n <i class=\"fal fa-file-upload\"></i>{{ 'ImgManager.ImgUpload.selectImg' | translate }}\r\n </div>\r\n </ng-container>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n" }]
604
- }], ctorParameters: function () { return [{ type: AlertService }, { type: ApiService }, { type: i3.TranslateService }, { type: UploadService }]; }, propDecorators: { stateDisplayed: [{
605
- type: Input
606
- }], imgUploaded: [{
607
- type: Output
608
- }], dragAndDropBox: [{
609
- type: ViewChild,
610
- args: ['dragAndDropBox']
611
- }] } });
612
-
613
- const listAnnimation = // the fade-in/fade-out animation.
614
- trigger('listAnimation', [
615
- transition(':enter, * => 0, * => -1', []),
616
- transition(':increment', [
617
- query(':enter', [
618
- style({ opacity: 0, transform: 'translateY(100px)' }),
619
- stagger(50, [
620
- animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' })),
621
- ]),
622
- ], { optional: true })
623
- ]),
624
- ]);
625
-
626
- class PexelsService {
627
- get apiBaseUrl() {
628
- return this.apiService.CONFIG.pexels_route;
629
- }
630
- ;
631
- get apiKey() {
632
- return this.apiService.CONFIG.pexels_token;
633
- }
634
- constructor(http, apiService, translateService) {
635
- this.http = http;
636
- this.apiService = apiService;
637
- this.translateService = translateService;
638
- this.languages = { 'fr': 'fr-FR', 'en': 'en-US', 'it': 'it-IT', 'es': 'es-ES' };
639
- this.setLang(this.translateService.currentLang);
640
- this.translateService.onLangChange.subscribe(langData => {
641
- this.setLang(langData.lang);
642
- });
643
- }
644
- setLang(lang) {
645
- this.lang = this.languages[lang] ? this.languages[lang] : 'fr-FR';
646
- }
647
- searchOnPexels(toSearch, perPage, page) {
648
- const httpOptions = {
649
- headers: new HttpHeaders({
650
- Authorization: this.apiKey
651
- })
652
- };
653
- let request;
654
- // If search value is not empty or blank
655
- if (toSearch && !/^\s*$/.test(toSearch)) {
656
- request = `/search?query=${toSearch}&per_page=${perPage}&page=${page}&locale=${this.lang}`;
657
- }
658
- else { // Search by category or display Pexels selection
659
- const shopCategory = this.apiService.getShopCategory();
660
- // Search by shop category
661
- if (shopCategory && shopCategory !== 'other' && shopCategory !== 'btob' && shopCategory !== 'default') {
662
- request = `/search?query=${shopCategory}&per_page=${perPage}&page=${page}&locale=en-US`;
663
- }
664
- else { // Display Pexels selection
665
- request = `/curated?per_page=${perPage}&page=${page}`;
666
- }
667
- }
668
- return this.http.get(this.apiBaseUrl + request, httpOptions).pipe(map((data) => {
669
- return data;
670
- }));
671
- }
672
- }
673
- PexelsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PexelsService, deps: [{ token: i3$1.HttpClient }, { token: ApiService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
674
- PexelsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PexelsService });
675
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PexelsService, decorators: [{
676
- type: Injectable
677
- }], ctorParameters: function () { return [{ type: i3$1.HttpClient }, { type: ApiService }, { type: i3.TranslateService }]; } });
678
-
679
- class AbstractDebounceDirective {
680
- constructor() {
681
- this.debounceTime = 500;
682
- this.onEventChange = new EventEmitter();
683
- this.emitEvent$ = new Subject();
684
- this.subscription$ = new Subject();
685
- }
686
- ngOnInit() {
687
- this.emitEvent$
688
- .pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap$1(value => this.emitChange(value)))
689
- .subscribe();
690
- }
691
- emitChange(value) {
692
- this.onEventChange.emit(value);
693
- }
694
- ngOnDestroy() {
695
- this.subscription$.next();
696
- this.subscription$.complete();
697
- }
698
- }
699
- AbstractDebounceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AbstractDebounceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
700
- AbstractDebounceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AbstractDebounceDirective, selector: "AbstractDebounceDirective", inputs: { debounceTime: "debounceTime" }, outputs: { onEventChange: "onEventChange" }, ngImport: i0 });
701
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AbstractDebounceDirective, decorators: [{
702
- type: Directive,
703
- args: [{
704
- selector: 'AbstractDebounceDirective'
705
- }]
706
- }], ctorParameters: function () { return []; }, propDecorators: { debounceTime: [{
707
- type: Input
708
- }], onEventChange: [{
709
- type: Output
710
- }] } });
711
-
712
- class DebounceKeyupDirective extends AbstractDebounceDirective {
713
- constructor() {
714
- super();
715
- }
716
- onKeyUp(event) {
717
- event.preventDefault();
718
- this.emitEvent$.next(event);
719
- }
720
- }
721
- DebounceKeyupDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DebounceKeyupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
722
- DebounceKeyupDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: DebounceKeyupDirective, selector: "input[debounceKeyUp]", host: { listeners: { "keyup": "onKeyUp($event)" } }, usesInheritance: true, ngImport: i0 });
723
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DebounceKeyupDirective, decorators: [{
724
- type: Directive,
725
- args: [{
726
- selector: 'input[debounceKeyUp]'
727
- }]
728
- }], ctorParameters: function () { return []; }, propDecorators: { onKeyUp: [{
729
- type: HostListener,
730
- args: ['keyup', ['$event']]
731
- }] } });
732
-
733
- class InputSearchComponent {
734
- constructor() {
735
- this.placeholder = '';
736
- this.smallPadding = false;
737
- this.innerValue = '';
738
- this.changeDebounced = new EventEmitter(); // debounced
739
- this.onTouchedCallback = () => { };
740
- this.onChangeCallback = () => { };
741
- }
742
- get value() {
743
- return this.innerValue;
744
- }
745
- set value(v) {
746
- if (v !== this.innerValue) {
747
- this.innerValue = v;
748
- this.onChangeCallback(v);
749
- }
750
- }
751
- writeValue(value) {
752
- if (value !== this.innerValue) {
753
- this.innerValue = value;
754
- }
755
- }
756
- registerOnChange(fn) {
757
- this.onChangeCallback = fn;
758
- }
759
- registerOnTouched(fn) {
760
- this.onTouchedCallback = fn;
761
- }
762
- handleDebouncedKeyUp(event) {
763
- this.changeDebounced.emit(event.target.value);
764
- }
765
- }
766
- InputSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InputSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
767
- InputSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: InputSearchComponent, selector: "wz-input-search", inputs: { placeholder: "placeholder", smallPadding: "smallPadding", id: "id" }, outputs: { changeDebounced: "changeDebounced" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: InputSearchComponent, multi: true }], ngImport: i0, template: "<div class=\"input-search field\" [ngClass]=\"smallPadding ? 'small-padding' : ''\">\n <p class=\"control has-icons-left has-icons-right\">\n <input\n [placeholder]=\"placeholder\"\n value=\"\"\n class=\"input\"\n type=\"text\"\n [attr.id]=\"id\"\n [(ngModel)]=\"value\"\n debounceKeyUp\n [debounceTime]=\"1000\"\n (onEventChange)=\"handleDebouncedKeyUp($event)\"\n />\n <i class=\"icon fal fa-search\"></i>\n </p>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: DebounceKeyupDirective, selector: "input[debounceKeyUp]" }] });
768
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: InputSearchComponent, decorators: [{
769
- type: Component,
770
- args: [{ selector: 'wz-input-search', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: InputSearchComponent, multi: true }], template: "<div class=\"input-search field\" [ngClass]=\"smallPadding ? 'small-padding' : ''\">\n <p class=\"control has-icons-left has-icons-right\">\n <input\n [placeholder]=\"placeholder\"\n value=\"\"\n class=\"input\"\n type=\"text\"\n [attr.id]=\"id\"\n [(ngModel)]=\"value\"\n debounceKeyUp\n [debounceTime]=\"1000\"\n (onEventChange)=\"handleDebouncedKeyUp($event)\"\n />\n <i class=\"icon fal fa-search\"></i>\n </p>\n</div>\n" }]
771
- }], propDecorators: { placeholder: [{
772
- type: Input
773
- }], smallPadding: [{
774
- type: Input
775
- }], id: [{
776
- type: Input
777
- }], changeDebounced: [{
778
- type: Output
779
- }] } });
780
-
781
- class AlertComponent {
782
- constructor() {
783
- this.icon = true;
784
- this.warning = false;
785
- this.success = false;
786
- this.iconClass = 'fa-solid fa-info';
787
- }
788
- ngOnInit() { }
789
- }
790
- AlertComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
791
- AlertComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AlertComponent, selector: "wz-alert", inputs: { icon: "icon", warning: "warning", success: "success", iconClass: "iconClass" }, ngImport: i0, template: "<div class=\"wz-alert\" [ngClass]=\"{ success: success, warning: warning }\">\n <i *ngIf=\"icon\" [ngClass]=\"iconClass\"></i>\n <p><ng-content></ng-content></p>\n</div>\n", styles: [".wz-alert{width:100%;background-color:#52aecd26;color:#52aecd;border-radius:3px;display:flex;flex-wrap:nowrap;justify-content:space-between;padding:20px}.wz-alert.success{background-color:#2ecc7126}.wz-alert.success p{color:#11552e}.wz-alert.success p>*{color:#11552e}.wz-alert.success i{color:#2ecc71}.wz-alert.warning{background-color:#e9565626}.wz-alert.warning p{color:#3a0505}.wz-alert.warning p>*{color:#3a0505}.wz-alert.warning i{color:#e95656}.wz-alert p{width:100%;font-size:rem(14);line-height:rem(25);margin:0;padding:0;color:#1e5568}.wz-alert p>*{color:#1e5568}.wz-alert i{width:auto;margin:0 10px 0 0;color:inherit;font-size:rem(14);line-height:rem(25)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
792
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AlertComponent, decorators: [{
793
- type: Component,
794
- args: [{ selector: 'wz-alert', template: "<div class=\"wz-alert\" [ngClass]=\"{ success: success, warning: warning }\">\n <i *ngIf=\"icon\" [ngClass]=\"iconClass\"></i>\n <p><ng-content></ng-content></p>\n</div>\n", styles: [".wz-alert{width:100%;background-color:#52aecd26;color:#52aecd;border-radius:3px;display:flex;flex-wrap:nowrap;justify-content:space-between;padding:20px}.wz-alert.success{background-color:#2ecc7126}.wz-alert.success p{color:#11552e}.wz-alert.success p>*{color:#11552e}.wz-alert.success i{color:#2ecc71}.wz-alert.warning{background-color:#e9565626}.wz-alert.warning p{color:#3a0505}.wz-alert.warning p>*{color:#3a0505}.wz-alert.warning i{color:#e95656}.wz-alert p{width:100%;font-size:rem(14);line-height:rem(25);margin:0;padding:0;color:#1e5568}.wz-alert p>*{color:#1e5568}.wz-alert i{width:auto;margin:0 10px 0 0;color:inherit;font-size:rem(14);line-height:rem(25)}\n"] }]
795
- }], ctorParameters: function () { return []; }, propDecorators: { icon: [{
796
- type: Input
797
- }], warning: [{
798
- type: Input
799
- }], success: [{
800
- type: Input
801
- }], iconClass: [{
802
- type: Input
803
- }] } });
804
-
805
- class LoadingDirective {
806
- constructor(el) {
807
- this.currentLoading = 0;
808
- this.interval = null;
809
- this.element = el;
810
- this.launchLoading();
811
- }
812
- launchLoading() {
813
- if (this.interval !== null) {
814
- return;
815
- }
816
- this.currentLoading = 10;
817
- this.element.nativeElement.style.width = this.currentLoading + '%';
818
- this.interval = setInterval(() => {
819
- if (this.currentLoading < 80) {
820
- this.currentLoading += Math.floor(Math.random() * 15);
821
- this.element.nativeElement.style.width = this.currentLoading + '%';
822
- }
823
- if (this.currentLoading >= 80 && this.currentLoading < 95) {
824
- this.currentLoading += Math.floor(Math.random() * 2);
825
- this.element.nativeElement.style.width = this.currentLoading + '%';
826
- }
827
- }, 70);
828
- }
829
- ngOnDestroy() {
830
- if (this.interval) {
831
- clearInterval(this.interval);
832
- this.interval = null;
833
- }
834
- }
835
- }
836
- LoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
837
- LoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LoadingDirective, selector: "[btnLoadingAnim]", ngImport: i0 });
838
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LoadingDirective, decorators: [{
839
- type: Directive,
840
- args: [{
841
- selector: '[btnLoadingAnim]'
842
- }]
843
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
844
-
845
- class PexelLibComponent {
846
- set content(control) {
847
- this.outerElement = control;
848
- }
849
- constructor(wzImgLibService, alertService, translateService, uploadService, changeDetectorRef) {
850
- this.wzImgLibService = wzImgLibService;
851
- this.alertService = alertService;
852
- this.translateService = translateService;
853
- this.uploadService = uploadService;
854
- this.changeDetectorRef = changeDetectorRef;
855
- this.searchValue = '';
856
- /** Pass to true to hide search input */
857
- this.disableSearch = false;
858
- this.perPage = 30;
859
- this.searchUpdated = new Subject();
860
- this.nbResult = 0;
861
- this.currentPage = 1;
862
- this.isLoading = true;
863
- this.initComponent = true;
864
- this.photosColumns = [];
865
- this.nbColumns = 6;
866
- this.responsiveColumns = [1250, 1050, 750, 500];
867
- this.outerElement = null;
868
- this.uploadingImg = 'ImgManager.PexelLib.uploadingImg';
869
- this.untitled = 'ImgManager.PexelLib.untitled';
870
- this.successUploadPhoto = 'ImgManager.PexelLib.successImport';
871
- this.errorUploadPhoto = 'ImgManager.PexelLib.errorUploadPhoto';
872
- this.errorRetrievePhotos = 'ImgManager.PexelLib.errorRetrievePhotos';
873
- this.subs = [];
874
- }
875
- ngAfterViewInit() {
876
- this.oldSearchValue = this.searchValue;
877
- this.isLoading = false;
878
- this.setNbColumnsToDisplayPhoto();
879
- this.setPhotosColumns();
880
- this.search();
881
- }
882
- setNbColumnsToDisplayPhoto() {
883
- const width = this.outerElement.nativeElement.offsetWidth;
884
- if (this.stateDisplayed !== 'window') {
885
- this.nbColumns = 8;
886
- }
887
- this.responsiveColumns.forEach(value => {
888
- if (width < value) {
889
- this.nbColumns--;
890
- }
891
- });
892
- }
893
- onSearchNameChanged() {
894
- this.onSearchChange();
895
- }
896
- onBottomReached() {
897
- this.scrollHandler();
898
- }
899
- onSearchChange() {
900
- this.search();
901
- }
902
- search() {
903
- if (this.isLoading) {
904
- return;
905
- }
906
- if (this.searchValue !== this.oldSearchValue) {
907
- this.resetSearch();
908
- }
909
- // All the picture are displayed
910
- if (this.nbResult && this.nbResult <= (this.currentPage - 1) * this.perPage) {
911
- return;
912
- }
913
- this.isLoading = true;
914
- const searchSub = this.wzImgLibService.searchOnPexels(this.searchValue, this.perPage, this.currentPage).subscribe({
915
- next: (data) => {
916
- this.wzImgLibDto = data;
917
- this.nbResult = this.wzImgLibDto.total_results;
918
- if (this.nbResult) {
919
- data.photos.forEach(photo => {
920
- const bestColumnIndex = this.getBestColumn();
921
- const height = (photo.height / photo.width) * 1000;
922
- this.photosColumns[bestColumnIndex].height += height;
923
- this.photosColumns[bestColumnIndex].photos.push(photo);
924
- });
925
- }
926
- this.isLoading = false;
927
- this.initComponent = false;
928
- this.changeDetectorRef.markForCheck();
929
- },
930
- error: error => {
931
- this.isLoading = false;
932
- this.initComponent = false;
933
- this.alertService.openAlert(this.errorRetrievePhotos);
934
- this.changeDetectorRef.markForCheck();
935
- }
936
- });
937
- this.subs.push(searchSub);
938
- }
939
- scrollHandler() {
940
- if (this.isLoading) {
941
- return;
942
- }
943
- const bestColumnIndex = this.getBestColumn();
944
- const lastPic = this.photosColumns[bestColumnIndex].photos[this.photosColumns[bestColumnIndex].photos.length - 1];
945
- const lastPhoto = lastPic ? document.querySelector('img[src="' + lastPic.src.medium + '"]') : null;
946
- if (lastPhoto) {
947
- if (!this.isLoading) {
948
- this.currentPage += 1;
949
- this.search();
950
- }
951
- }
952
- }
953
- setPhotosColumns() {
954
- for (let indexColumn = 0; indexColumn < this.nbColumns; indexColumn++) {
955
- const photosColumn = {
956
- height: 0,
957
- photos: []
958
- };
959
- this.photosColumns.push(photosColumn);
960
- }
961
- }
962
- getBestColumn() {
963
- const bestColumn = {
964
- index: 0,
965
- height: this.photosColumns[0].height
966
- };
967
- this.photosColumns.forEach((photosColumn, index) => {
968
- if (bestColumn.height > photosColumn.height) {
969
- bestColumn.index = index;
970
- bestColumn.height = photosColumn.height;
971
- }
972
- });
973
- return bestColumn.index;
974
- }
975
- resetSearch() {
976
- this.oldSearchValue = this.searchValue;
977
- this.photosColumns = [];
978
- this.currentPage = 1;
979
- this.setPhotosColumns();
980
- this.changeDetectorRef.markForCheck();
981
- }
982
- uploadPhoto(photo, url) {
983
- photo.uploading = true;
984
- const uploadSub = this.uploadService.uploadFileByUrl(url, photo.alt).subscribe(img => {
985
- photo.uploading = false;
986
- photo.uploaded = true;
987
- this.alertService.openAlert(this.successUploadPhoto);
988
- }, error => {
989
- photo.uploading = false;
990
- if (error.error.code === 406 && error.error.message) {
991
- this.alertService.openAlertWithBackendResponse(this.errorUploadPhoto, error.error.message);
992
- }
993
- else {
994
- this.alertService.openAlert(this.errorUploadPhoto);
995
- }
996
- });
997
- // Display img uploading msg
998
- this.alertService.openAlert(this.uploadingImg);
999
- this.subs.push(uploadSub);
1000
- }
1001
- ngOnDestroy() {
1002
- this.subs.forEach(sub => sub.unsubscribe());
1003
- }
1004
- }
1005
- PexelLibComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PexelLibComponent, deps: [{ token: PexelsService }, { token: AlertService }, { token: i3.TranslateService }, { token: UploadService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1006
- PexelLibComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PexelLibComponent, selector: "pexels-lib", inputs: { stateDisplayed: "stateDisplayed", searchValue: "searchValue", disableSearch: "disableSearch" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["outerElement"], descendants: true }], ngImport: i0, template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\r\n\r\n <ng-scrollbar\r\n [reachedOffset]=\"300\"\r\n class=\"pexels-lib__scroll\"\r\n [ngClass]=\"{\r\n 'pexels-lib__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'pexels-lib__scroll--noResult': !nbResult,\r\n 'pexels-lib__scroll--hide': (!nbResult && disableSearch)\r\n }\"\r\n (reachedBottom)=\"onBottomReached()\"\r\n >\r\n <div\r\n *ngIf=\"!disableSearch\"\r\n class=\"pexels-lib__search\"\r\n [ngClass]=\"{'pexels-lib__search--smallDisplay': stateDisplayed === 'small'}\"\r\n >\r\n <wz-input-search\r\n [(ngModel)]=\"searchValue\"\r\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\r\n (changeDebounced)=\"onSearchNameChanged()\"\r\n [smallPadding]=\"stateDisplayed === 'small'\">\r\n </wz-input-search>\r\n </div>\r\n\r\n <div *ngIf=\"!initComponent\" class=\"pexels-lib__wrapper\">\r\n <p *ngIf=\"nbResult\" class=\"pexels-lib__wrapper__result-nb\">{{ 'ImgManager.PexelLib.nbImgFound' | translate }} : {{ nbResult }}</p>\r\n\r\n <div class=\"pexels-lib__wrapper__result\">\r\n\r\n <div *ngFor=\"let photosColumn of photosColumns; let indexCol = index;\" class=\"pexels-lib__wrapper__result__column\" [@listAnimation]=\"photosColumn.photos.length\">\r\n <div *ngFor=\"let photo of photosColumn.photos; let indexPhoto = index;\" class=\"pexels-lib__wrapper__result__column__element\">\r\n\r\n <img [alt]=\"photo.src.medium\" [src]=\"photo.src.medium\"\r\n class=\"pexels-lib__wrapper__result__column__element__img\"/>\r\n\r\n <div class=\"pexels-lib__wrapper__result__column__element__wrapper\">\r\n <span class=\"pexels-lib__wrapper__result__column__element__wrapper__infos\">\r\n {{ photo.width }} x {{ photo.height}}\r\n </span>\r\n\r\n <div class=\"dropdown is-up\" [ngClass]=\"{'is-hoverable': !photo.uploading}\">\r\n <div class=\"dropdown-trigger\">\r\n <button\r\n type=\"button\"\r\n class=\"button pexels-lib__wrapper__result__column__element__wrapper__button\"\r\n aria-haspopup=\"true\"\r\n aria-controls=\"dropdown-menu\">\r\n\r\n <div *ngIf=\"!photo.uploading\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\r\n <span>{{ 'ImgManager.PexelLib.import' | translate }}</span>\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-angle-up\" aria-hidden=\"true\"></i>\r\n </span>\r\n <ng-container *ngIf=\"photo.uploaded\">\r\n &nbsp;<i class=\"fal fa-check\"></i>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"photo.uploading\">\r\n {{ 'ImgManager.PexelLib.importation' | translate }}\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\"></span>\r\n </ng-container>\r\n\r\n </button>\r\n </div>\r\n <div class=\"dropdown-menu pexels-lib__wrapper__result__column__element__wrapper__dropdown\" id=\"dropdown-menu\" role=\"menu\">\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdown-content__wrapper\">\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.portrait)\">\r\n <p>{{ 'ImgManager.PexelLib.portrait' | translate }}</p>\r\n <i class=\"fal fa-check iPortrait\"></i>\r\n </div>\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.landscape)\">\r\n <p>{{ 'ImgManager.PexelLib.landscape' | translate }}</p>\r\n <i class=\"fal fa-check iLandscape\"></i>\r\n </div>\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\r\n <p>{{ 'ImgManager.PexelLib.original' | translate }}</p>\r\n <i class=\"fal fa-check iOriginal\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-scrollbar>\r\n\r\n <ng-container *ngIf=\"isLoading\">\r\n <wz-loader></wz-loader>\r\n </ng-container>\r\n <div\r\n *ngIf=\"!isLoading && !nbResult\"\r\n class=\"pexels-lib__alert\"\r\n [@easeInOut]=\"'in'\">\r\n <wz-alert [warning]=\"true\">\r\n {{ 'ImgManager.PexelLib.noResult' | translate }}\r\n </wz-alert>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: i8.NgScrollbarReachedBottom, selector: "[reachedBottom], [reached-bottom]", outputs: ["reachedBottom"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "component", type: InputSearchComponent, selector: "wz-input-search", inputs: ["placeholder", "smallPadding", "id"], outputs: ["changeDebounced"] }, { kind: "component", type: AlertComponent, selector: "wz-alert", inputs: ["icon", "warning", "success", "iconClass"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1007
- easeInOut,
1008
- listAnnimation
1009
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1010
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PexelLibComponent, decorators: [{
1011
- type: Component,
1012
- args: [{ selector: 'pexels-lib', animations: [
1013
- easeInOut,
1014
- listAnnimation
1015
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"pexels-lib\" #outerElement [@easeInOut]=\"'in'\">\r\n\r\n <ng-scrollbar\r\n [reachedOffset]=\"300\"\r\n class=\"pexels-lib__scroll\"\r\n [ngClass]=\"{\r\n 'pexels-lib__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'pexels-lib__scroll--noResult': !nbResult,\r\n 'pexels-lib__scroll--hide': (!nbResult && disableSearch)\r\n }\"\r\n (reachedBottom)=\"onBottomReached()\"\r\n >\r\n <div\r\n *ngIf=\"!disableSearch\"\r\n class=\"pexels-lib__search\"\r\n [ngClass]=\"{'pexels-lib__search--smallDisplay': stateDisplayed === 'small'}\"\r\n >\r\n <wz-input-search\r\n [(ngModel)]=\"searchValue\"\r\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\r\n (changeDebounced)=\"onSearchNameChanged()\"\r\n [smallPadding]=\"stateDisplayed === 'small'\">\r\n </wz-input-search>\r\n </div>\r\n\r\n <div *ngIf=\"!initComponent\" class=\"pexels-lib__wrapper\">\r\n <p *ngIf=\"nbResult\" class=\"pexels-lib__wrapper__result-nb\">{{ 'ImgManager.PexelLib.nbImgFound' | translate }} : {{ nbResult }}</p>\r\n\r\n <div class=\"pexels-lib__wrapper__result\">\r\n\r\n <div *ngFor=\"let photosColumn of photosColumns; let indexCol = index;\" class=\"pexels-lib__wrapper__result__column\" [@listAnimation]=\"photosColumn.photos.length\">\r\n <div *ngFor=\"let photo of photosColumn.photos; let indexPhoto = index;\" class=\"pexels-lib__wrapper__result__column__element\">\r\n\r\n <img [alt]=\"photo.src.medium\" [src]=\"photo.src.medium\"\r\n class=\"pexels-lib__wrapper__result__column__element__img\"/>\r\n\r\n <div class=\"pexels-lib__wrapper__result__column__element__wrapper\">\r\n <span class=\"pexels-lib__wrapper__result__column__element__wrapper__infos\">\r\n {{ photo.width }} x {{ photo.height}}\r\n </span>\r\n\r\n <div class=\"dropdown is-up\" [ngClass]=\"{'is-hoverable': !photo.uploading}\">\r\n <div class=\"dropdown-trigger\">\r\n <button\r\n type=\"button\"\r\n class=\"button pexels-lib__wrapper__result__column__element__wrapper__button\"\r\n aria-haspopup=\"true\"\r\n aria-controls=\"dropdown-menu\">\r\n\r\n <div *ngIf=\"!photo.uploading\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\r\n <span>{{ 'ImgManager.PexelLib.import' | translate }}</span>\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-angle-up\" aria-hidden=\"true\"></i>\r\n </span>\r\n <ng-container *ngIf=\"photo.uploaded\">\r\n &nbsp;<i class=\"fal fa-check\"></i>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"photo.uploading\">\r\n {{ 'ImgManager.PexelLib.importation' | translate }}\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\"></span>\r\n </ng-container>\r\n\r\n </button>\r\n </div>\r\n <div class=\"dropdown-menu pexels-lib__wrapper__result__column__element__wrapper__dropdown\" id=\"dropdown-menu\" role=\"menu\">\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdown-content__wrapper\">\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.portrait)\">\r\n <p>{{ 'ImgManager.PexelLib.portrait' | translate }}</p>\r\n <i class=\"fal fa-check iPortrait\"></i>\r\n </div>\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.landscape)\">\r\n <p>{{ 'ImgManager.PexelLib.landscape' | translate }}</p>\r\n <i class=\"fal fa-check iLandscape\"></i>\r\n </div>\r\n <div class=\"dropdown-item\" (click)=\"uploadPhoto(photo, photo.src.large2x)\">\r\n <p>{{ 'ImgManager.PexelLib.original' | translate }}</p>\r\n <i class=\"fal fa-check iOriginal\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-scrollbar>\r\n\r\n <ng-container *ngIf=\"isLoading\">\r\n <wz-loader></wz-loader>\r\n </ng-container>\r\n <div\r\n *ngIf=\"!isLoading && !nbResult\"\r\n class=\"pexels-lib__alert\"\r\n [@easeInOut]=\"'in'\">\r\n <wz-alert [warning]=\"true\">\r\n {{ 'ImgManager.PexelLib.noResult' | translate }}\r\n </wz-alert>\r\n </div>\r\n</div>\r\n" }]
1016
- }], ctorParameters: function () { return [{ type: PexelsService }, { type: AlertService }, { type: i3.TranslateService }, { type: UploadService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { stateDisplayed: [{
1017
- type: Input
1018
- }], searchValue: [{
1019
- type: Input
1020
- }], disableSearch: [{
1021
- type: Input
1022
- }], content: [{
1023
- type: ViewChild,
1024
- args: ['outerElement']
1025
- }] } });
1026
-
1027
- class ImgManagerService {
1028
- constructor() {
1029
- this.uploadService = inject(UploadService);
1030
- this.params = new HttpParams().set("limit", "20").set("page", "1");
1031
- // Display the img selection
1032
- this.pageFicheProductConfig = {
1033
- stateDisplayed: 'closed',
1034
- multipleImgMode: true,
1035
- showImgManagerModule: true,
1036
- showSelection: true,
1037
- displayBtn: true,
1038
- pageficheProduct: true
1039
- };
1040
- this.angularFicheProductConfig = {
1041
- stateDisplayed: 'closed',
1042
- multipleImgMode: true,
1043
- showImgManagerModule: true,
1044
- showSelection: true,
1045
- displayBtn: false,
1046
- pageficheProduct: true
1047
- };
1048
- this.wiziblockConfig = {
1049
- stateDisplayed: 'closed',
1050
- multipleImgMode: false,
1051
- showImgManagerModule: true,
1052
- showSelection: false,
1053
- displayBtn: false
1054
- };
1055
- this.simpleWithButtonOpenerConfig = {
1056
- stateDisplayed: 'closed',
1057
- multipleImgMode: false,
1058
- showImgManagerModule: true,
1059
- showSelection: false,
1060
- displayBtn: true
1061
- };
1062
- this.fullWindowConfig = {
1063
- stateDisplayed: 'window',
1064
- multipleImgMode: false,
1065
- showImgManagerModule: true,
1066
- showSelection: false,
1067
- displayBtn: false
1068
- };
1069
- this.apiService = inject(ApiService);
1070
- this.destroy$ = new Subject();
1071
- this.searchImagesParameters$ = new BehaviorSubject(this.DEFAULT_SEARCH_PARAMS);
1072
- this.refreshImageList$ = new Subject();
1073
- this.resetImageList$ = merge(this.uploadService.imageUploaded$);
1074
- this.isLoading$ = new BehaviorSubject(true);
1075
- this.fetchImagesList$ = merge(this.searchImagesParameters$.pipe(debounceTime$1(800), distinctUntilChanged$1()), this.refreshImageList$.pipe(switchMap(() => this.searchImagesParameters$))).pipe(map$1((params) => this.getHttpParameters(params)), tap(() => this.isLoading$.next(true)), switchMap((params) => forkJoin({
1076
- imageList: this.apiService.getShopImgList(params).pipe(take$1(1)),
1077
- imageTotal: this.apiService.getShopTotalImgList(params).pipe(take$1(1))
1078
- })), tap(() => this.isLoading$.next(false)));
1079
- this.imageList$ = merge(this.fetchImagesList$, this.resetImageList$.pipe(tap(() => this.isLoading$.next(true)), tap(() => this.searchImagesParameters$.next(this.DEFAULT_SEARCH_PARAMS)), map$1(() => this.DEFAULT_DATA_LIST))).pipe(startWith(this.DEFAULT_DATA_LIST), shareReplay(1));
1080
- }
1081
- get DEFAULT_SEARCH_PARAMS() {
1082
- return {
1083
- limit: '30',
1084
- page: '1',
1085
- };
1086
- }
1087
- get DEFAULT_DATA_LIST() {
1088
- return {
1089
- imageList: {
1090
- data: [],
1091
- filter: [],
1092
- limit: 0,
1093
- page: 0,
1094
- totalRecords: 0
1095
- },
1096
- imageTotal: 0
1097
- };
1098
- }
1099
- getHttpParameters(params) {
1100
- let parameters = new HttpParams();
1101
- parameters = parameters.set('id_file:sort', 'desc');
1102
- for (const param in params) {
1103
- parameters = parameters.set(param, params[param]);
1104
- }
1105
- if (params === null || params === void 0 ? void 0 : params.search) {
1106
- parameters = parameters.set('display_name:contains', params.search);
1107
- }
1108
- return parameters;
1109
- }
1110
- getShopImg(idFile) {
1111
- return this.apiService.getShopImg(idFile).pipe(tap(() => this.refreshImageList$.next()));
1112
- }
1113
- replaceImg(imageBase64, id_file) {
1114
- return this.apiService.replaceImg(imageBase64, id_file).pipe(tap(() => this.refreshImageList$.next()));
1115
- }
1116
- removeImg(id_file) {
1117
- return this.apiService.removeImg(id_file).pipe(tap(() => this.refreshImageList$.next()));
1118
- }
1119
- removeMultipleImg(id_array) {
1120
- return this.apiService.removeMultipleImg(id_array).pipe(tap(() => this.refreshImageList$.next()));
1121
- }
1122
- getImgManagerDisplayConfig(displayName) {
1123
- switch (displayName) {
1124
- case "window":
1125
- return this.fullWindowConfig;
1126
- case "wizi-block":
1127
- return this.wiziblockConfig;
1128
- case "fiche-product":
1129
- return this.pageFicheProductConfig;
1130
- case "simple-with-button":
1131
- return this.simpleWithButtonOpenerConfig;
1132
- case 'angular-fiche-product':
1133
- return this.angularFicheProductConfig;
1134
- default:
1135
- return;
1136
- }
1137
- }
1138
- getAllImgManagerDisplayConfig() {
1139
- return [
1140
- this.fullWindowConfig,
1141
- this.wiziblockConfig,
1142
- this.pageFicheProductConfig,
1143
- this.simpleWithButtonOpenerConfig,
1144
- ];
1145
- }
1146
- ngOnDestroy() {
1147
- this.destroy$.next();
1148
- this.destroy$.complete();
1149
- }
1150
- }
1151
- ImgManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1152
- ImgManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgManagerService });
1153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgManagerService, decorators: [{
1154
- type: Injectable
1155
- }] });
1156
-
1157
- class RenamePictureService {
1158
- constructor(apiService, alertService, imgManagerService) {
1159
- this.apiService = apiService;
1160
- this.alertService = alertService;
1161
- this.imgManagerService = imgManagerService;
1162
- this.picturesList = [];
1163
- this.errorRenameImg = 'ImgManager.ImgList.errorRenameImg';
1164
- this.msgSavingImgName = 'ImgManager.ImgLib.savingImgName';
1165
- this.msgImgNameSaved = 'ImgManager.ImgLib.imgNameSaved';
1166
- }
1167
- setPicturesList(picturesList) {
1168
- this.picturesList = picturesList;
1169
- }
1170
- renamePicture(pictureNameUpdate) {
1171
- const picture = this.getPictureById(pictureNameUpdate.id);
1172
- if (!picture) {
1173
- this.alertService.openAlert(this.errorRenameImg);
1174
- return;
1175
- }
1176
- this.alertService.openAlert(this.msgSavingImgName);
1177
- this.apiService
1178
- .changeImgName(picture.display_name, picture.id_file).pipe(tap(() => this.imgManagerService.refreshImageList$.next()))
1179
- .subscribe({
1180
- next: (data) => {
1181
- picture.display_name = data.display_name;
1182
- this.alertService.openAlert(this.msgImgNameSaved);
1183
- },
1184
- error: () => {
1185
- picture.display_name = pictureNameUpdate.previousName;
1186
- this.alertService.openAlert(this.errorRenameImg);
1187
- }
1188
- });
1189
- }
1190
- changeImageName(name, idFile) {
1191
- return this.apiService.changeImgName(name, idFile).pipe(tap(() => this.imgManagerService.refreshImageList$.next()));
1192
- }
1193
- getPictureById(id_file) {
1194
- if (!this.picturesList) {
1195
- return;
1196
- }
1197
- for (const picture of this.picturesList) {
1198
- if (picture.id_file === id_file) {
1199
- return picture;
1200
- }
1201
- }
1202
- return null;
1203
- }
1204
- }
1205
- RenamePictureService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenamePictureService, deps: [{ token: ApiService }, { token: AlertService }, { token: ImgManagerService }], target: i0.ɵɵFactoryTarget.Injectable });
1206
- RenamePictureService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenamePictureService });
1207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RenamePictureService, decorators: [{
1208
- type: Injectable
1209
- }], ctorParameters: function () { return [{ type: ApiService }, { type: AlertService }, { type: ImgManagerService }]; } });
1210
-
1211
- class ImageNotFoundService {
1212
- imageNotFound($url) {
1213
- return;
1214
- }
1215
- }
1216
- ImageNotFoundService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageNotFoundService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1217
- ImageNotFoundService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageNotFoundService });
1218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageNotFoundService, decorators: [{
1219
- type: Injectable
1220
- }] });
1221
-
1222
- class ImgCDNService {
1223
- constructor() {
1224
- this.imgCDNConfig = inject(ApiService).IMG_SIZE;
1225
- }
1226
- getUrlImg(size) {
1227
- const urlProperty = Object.keys(this.imgCDNConfig)
1228
- .filter(url => new RegExp(size, 'i').test(url))[0];
1229
- return this.imgCDNConfig[urlProperty];
1230
- }
1231
- getAllSize() {
1232
- return Object.keys(this.imgCDNConfig)
1233
- .map(elem => elem.match(/_(\w+)_/)[1]);
1234
- }
1235
- }
1236
- ImgCDNService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgCDNService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1237
- ImgCDNService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgCDNService });
1238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgCDNService, decorators: [{
1239
- type: Injectable
1240
- }] });
1241
-
1242
- class ImagesActionHandler {
1243
- constructor(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService) {
1244
- this.imgManager = imgManager;
1245
- this.imgSelectionService = imgSelectionService;
1246
- this.http = http;
1247
- this.imgCDNService = imgCDNService;
1248
- this.imgEventCardService = imgEventCardService;
1249
- this.alertService = alertService;
1250
- this.translateService = translateService;
1251
- this.apiService = apiService;
1252
- this.picturesList = [];
1253
- this.picturesListChange = new EventEmitter();
1254
- this.tableFilters = {
1255
- sort: undefined,
1256
- order: undefined,
1257
- searchValue: '',
1258
- totalItems: 0,
1259
- itemsPerPage: 30,
1260
- currentPage: 1
1261
- };
1262
- this.displayPexelsResults = false;
1263
- this.disable = false;
1264
- this.disableChange = new EventEmitter();
1265
- this.filtersChange = new EventEmitter();
1266
- this.pictureNameChange = new EventEmitter();
1267
- this.isLoading = false;
1268
- this.fakeImgRoute = this.apiService.CONFIG.assets_route + 'img/fake.png';
1269
- this.errorRemoveImg = 'ImgManager.ImgList.errorRemoveImg';
1270
- this.errorAlreadyUsedImg = 'ImgManager.ImgList.errorAlreadyUsed';
1271
- this.imageNotFoundService = inject(ImageNotFoundService);
1272
- }
1273
- /** Event emit when the header checkbox is checked */
1274
- onToggleAllCheckBoxRow(event) {
1275
- this.picturesList.forEach(data => {
1276
- data.delSelected = event;
1277
- });
1278
- this._pictureListeChange();
1279
- }
1280
- onToggleDelSelection(index) {
1281
- if (this.disable) {
1282
- return;
1283
- }
1284
- this.picturesList[index].delSelected = !this.picturesList[index].delSelected;
1285
- this._pictureListeChange();
1286
- }
1287
- /** Event emit each time filters change */
1288
- onFiltersChange() {
1289
- this.filtersChange.emit();
1290
- }
1291
- onEdit(picture) {
1292
- this.imgEventCardService.emitImgToEdit(picture);
1293
- }
1294
- onToggleSelectImg(index) {
1295
- if (this.disable || this.stateDisplayed === 'window') {
1296
- return;
1297
- }
1298
- if (!this.picturesList[index].selected) {
1299
- this.imgSelectionService.addImgSelected(this.picturesList[index]);
1300
- this.picturesList[index].selected = true;
1301
- }
1302
- else {
1303
- this.imgSelectionService.removeImgSelectedById(this.picturesList[index].id_file);
1304
- this.picturesList[index].selected = false;
1305
- }
1306
- }
1307
- onRemoveImg(picture) {
1308
- picture.deleted = true;
1309
- this.imgManager.removeImg(picture.id_file).subscribe(data => {
1310
- this.imgEventCardService.imgRemoved$.next(picture.id_file);
1311
- this.imgSelectionService.removeImgSelectedById(picture.id_file);
1312
- }, error => {
1313
- const msg = error.status === 409 ? this.errorAlreadyUsedImg : this.errorRemoveImg;
1314
- picture.deleted = false;
1315
- this.alertService.openAlert(msg);
1316
- });
1317
- }
1318
- onPictureNotLoading(event) {
1319
- this.imageNotFoundService.imageNotFound(event.target.src);
1320
- event.target.src = this.fakeImgRoute;
1321
- }
1322
- onDownloadImg(display_name, file_name) {
1323
- this.http.get(this.getRAWImgRoute(file_name), { responseType: 'blob' }).subscribe(val => {
1324
- let url = URL.createObjectURL(val);
1325
- this.downloadUrl(url, display_name);
1326
- URL.revokeObjectURL(url);
1327
- });
1328
- }
1329
- onNameChange(id_file) {
1330
- this.pictureNameChange.emit({ id: id_file, previousName: this.previousName });
1331
- }
1332
- getRAWImgRoute(file_name) {
1333
- return this.imgCDNService.getUrlImg('raw') + file_name;
1334
- }
1335
- _pictureListeChange() {
1336
- this.picturesListChange.emit();
1337
- }
1338
- downloadUrl(url, fileName) {
1339
- const a = document.createElement('a');
1340
- a.href = url;
1341
- a.download = fileName;
1342
- a.click();
1343
- }
1344
- ngDestroy() {
1345
- if (this.getDataAPISub) {
1346
- this.getDataAPISub.unsubscribe();
1347
- }
1348
- }
1349
- }
1350
- ImagesActionHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImagesActionHandler, deps: [{ token: ImgManagerService }, { token: ImgSelectionService }, { token: i3$1.HttpClient }, { token: ImgCDNService }, { token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Directive });
1351
- ImagesActionHandler.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ImagesActionHandler, inputs: { picturesList: "picturesList", tableFilters: "tableFilters", displayPexelsResults: "displayPexelsResults", disable: "disable", isLoading: "isLoading", stateDisplayed: "stateDisplayed" }, outputs: { picturesListChange: "picturesListChange", disableChange: "disableChange", filtersChange: "filtersChange", pictureNameChange: "pictureNameChange" }, ngImport: i0 });
1352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImagesActionHandler, decorators: [{
1353
- type: Directive
1354
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgSelectionService }, { type: i3$1.HttpClient }, { type: ImgCDNService }, { type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: ApiService }]; }, propDecorators: { picturesList: [{
1355
- type: Input
1356
- }], picturesListChange: [{
1357
- type: Output
1358
- }], tableFilters: [{
1359
- type: Input
1360
- }], displayPexelsResults: [{
1361
- type: Input
1362
- }], disable: [{
1363
- type: Input
1364
- }], disableChange: [{
1365
- type: Output
1366
- }], filtersChange: [{
1367
- type: Output
1368
- }], pictureNameChange: [{
1369
- type: Output
1370
- }], isLoading: [{
1371
- type: Input
1372
- }], stateDisplayed: [{
1373
- type: Input
1374
- }] } });
1375
-
1376
- class ImageSrcPipe {
1377
- constructor(imgCDNService) {
1378
- this.imgCDNService = imgCDNService;
1379
- }
1380
- transform(pictureName, size) {
1381
- if (!size) {
1382
- throw "The size is undefined in ImageSrcPipe.";
1383
- }
1384
- const route = this.imgCDNService.getUrlImg(size);
1385
- if (!route) {
1386
- throw "The expected size is not defined in ImageSrcPipe.";
1387
- }
1388
- return route + pictureName;
1389
- }
1390
- }
1391
- ImageSrcPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageSrcPipe, deps: [{ token: ImgCDNService }], target: i0.ɵɵFactoryTarget.Pipe });
1392
- ImageSrcPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ImageSrcPipe, name: "imgSrc" });
1393
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImageSrcPipe, decorators: [{
1394
- type: Pipe,
1395
- args: [{
1396
- name: 'imgSrc'
1397
- }]
1398
- }], ctorParameters: function () { return [{ type: ImgCDNService }]; } });
1399
-
1400
- class ImgCardComponent extends ImagesActionHandler {
1401
- constructor(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService) {
1402
- super(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService);
1403
- this.focusInput = false;
1404
- this.toggleImgSelected = new EventEmitter();
1405
- this.switchDisplayWindow = new EventEmitter();
1406
- this.isUploadSection = false;
1407
- this.activeConfirmDelete = false;
1408
- }
1409
- ngOnInit() {
1410
- this.isUploadSection = this.tabDisplayed === 'img-upload';
1411
- }
1412
- displayLargeWindow() {
1413
- this.switchDisplayWindow.emit(true);
1414
- }
1415
- onToggleImgSelected() {
1416
- this.toggleImgSelected.next();
1417
- }
1418
- }
1419
- ImgCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgCardComponent, deps: [{ token: ImgManagerService }, { token: ImgSelectionService }, { token: i3$1.HttpClient }, { token: ImgCDNService }, { token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Component });
1420
- ImgCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImgCardComponent, selector: "img-card", inputs: { tabDisplayed: "tabDisplayed", fullSize: "fullSize", picture: "picture", index: "index" }, outputs: { toggleImgSelected: "toggleImgSelected", switchDisplayWindow: "switchDisplayWindow" }, usesInheritance: true, ngImport: i0, template: "<div class=\"addCssPriority\" [@easeInOut]=\"'in'\" [ngClass]=\"{ 'fullSize': fullSize }\">\r\n <div class=\"img-card\">\r\n <div class=\"img-card__container\"\r\n [ngClass]=\"{\r\n 'smallDisplay': stateDisplayed === 'small' || isUploadSection,\r\n 'imgSelected': picture.selected,\r\n 'deletion': picture.deleted}\">\r\n <img\r\n class=\"img-card__container__img\"\r\n [src]=\"picture.file_name | imgSrc : '400'\"\r\n [alt]=\"picture.display_name\"\r\n (click)=\"onToggleImgSelected()\"\r\n (error)=\"picture.imgNotLoaded=true;onPictureNotLoading($event);\"\r\n />\r\n <div\r\n class=\"img-card__container__config\"\r\n *ngIf=\"!picture.deleted && stateDisplayed !== 'small'\"\r\n >\r\n <button type=\"button\" class=\"size\"><i class=\"fal fa-image-polaroid\"></i><span>{{picture.raw_height}}x{{picture.raw_width}}</span></button>\r\n <button type=\"button\" class=\"dl\" (click)=\"onDownloadImg(picture.display_name, picture.file_name)\"><i class=\"fal fa-download\"></i><span>{{ 'ImgManager.ImgCard.download' | translate }}</span></button>\r\n <button type=\"button\" class=\"edit\" (click)=\"onEdit(picture)\"><i class=\"far fa-crop-alt\"></i><span>{{ 'ImgManager.ImgCard.edit' | translate }}</span></button>\r\n <button type=\"button\" class=\"deleted\" (click)=\"activeConfirmDelete = true;\"><i class=\"fal fa-times\"></i><span>{{ 'ImgManager.ImgCard.del' | translate }}</span></button>\r\n <button type=\"button\" class=\"selected\" (click)=\"onToggleImgSelected()\" *ngIf=\"stateDisplayed !== 'window'\">\r\n <i *ngIf=\"!picture.selected\" class=\"fal fa-square\"></i>\r\n <i *ngIf=\"picture.selected\" class=\"fa-solid fa-check-square checked\"></i>\r\n <span>{{ 'ImgManager.ImgCard.select' | translate }}</span>\r\n </button>\r\n </div>\r\n <div\r\n class=\"img-card__container__config img-card__container__config--small\"\r\n *ngIf=\"!picture.deleted && stateDisplayed === 'small'\"\r\n >\r\n <button class=\"show-edit\" (click)=\"displayLargeWindow()\"><i class=\"fa-solid fa-edit\"></i></button>\r\n </div>\r\n <div class=\"img-card__container__delete\" [ngClass]=\"{ 'show' : activeConfirmDelete}\">\r\n <span>{{ 'ImgManager.ImgCard.confirmDeleteImg' | translate }}</span>\r\n <div>\r\n <button (click)=\"activeConfirmDelete = false;\">{{ 'no' | translate }}</button>\r\n <button (click)=\"onRemoveImg(picture);activeConfirmDelete = false;\">{{ 'yes' | translate }}</button>\r\n </div>\r\n </div>\r\n <div class=\"img-card__container__valid\" *ngIf=\"stateDisplayed === 'small' && tabDisplayed == 'img-upload'\">\r\n <i class=\"far fa-check\"></i>\r\n <span>{{ 'ImgManager.ImgCard.validImgSmall' | translate }}</span>\r\n </div>\r\n <div\r\n *ngIf=\"picture.imgNotLoaded\"\r\n class=\"img-card__container__overlay\"\r\n [ngClass]=\"{'img-card__container__overlay--smallDisplay': stateDisplayed === 'small' || isUploadSection}\">\r\n <i (click)=\"onToggleImgSelected()\" class=\"fad fa-folder-times\"></i>\r\n </div>\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"picture.deleted\"></span>\r\n\r\n </div>\r\n <div\r\n class=\"img-card__nameContainer\"\r\n [ngClass]=\"{'smallNameDisplay': stateDisplayed === 'small' || isUploadSection, 'focus': focusInput}\">\r\n <input\r\n type=\"text\"\r\n class=\"wzImgMngInput img-card__nameContainer__name\"\r\n [(ngModel)]=\"picture.display_name\"\r\n (ngModelChange)=\"onNameChange(picture.id_file)\"\r\n [ngModelOptions]=\"{standalone: true, updateOn: 'blur'}\"\r\n (focus)=\"previousName=picture.display_name;focusInput = true;\"\r\n (blur)=\"focusInput = false;\"\r\n >\r\n <span>{{picture.display_name}}</span>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: ImageSrcPipe, name: "imgSrc" }], animations: [
1421
- easeInOut
1422
- ] });
1423
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgCardComponent, decorators: [{
1424
- type: Component,
1425
- args: [{ selector: 'img-card', animations: [
1426
- easeInOut
1427
- ], template: "<div class=\"addCssPriority\" [@easeInOut]=\"'in'\" [ngClass]=\"{ 'fullSize': fullSize }\">\r\n <div class=\"img-card\">\r\n <div class=\"img-card__container\"\r\n [ngClass]=\"{\r\n 'smallDisplay': stateDisplayed === 'small' || isUploadSection,\r\n 'imgSelected': picture.selected,\r\n 'deletion': picture.deleted}\">\r\n <img\r\n class=\"img-card__container__img\"\r\n [src]=\"picture.file_name | imgSrc : '400'\"\r\n [alt]=\"picture.display_name\"\r\n (click)=\"onToggleImgSelected()\"\r\n (error)=\"picture.imgNotLoaded=true;onPictureNotLoading($event);\"\r\n />\r\n <div\r\n class=\"img-card__container__config\"\r\n *ngIf=\"!picture.deleted && stateDisplayed !== 'small'\"\r\n >\r\n <button type=\"button\" class=\"size\"><i class=\"fal fa-image-polaroid\"></i><span>{{picture.raw_height}}x{{picture.raw_width}}</span></button>\r\n <button type=\"button\" class=\"dl\" (click)=\"onDownloadImg(picture.display_name, picture.file_name)\"><i class=\"fal fa-download\"></i><span>{{ 'ImgManager.ImgCard.download' | translate }}</span></button>\r\n <button type=\"button\" class=\"edit\" (click)=\"onEdit(picture)\"><i class=\"far fa-crop-alt\"></i><span>{{ 'ImgManager.ImgCard.edit' | translate }}</span></button>\r\n <button type=\"button\" class=\"deleted\" (click)=\"activeConfirmDelete = true;\"><i class=\"fal fa-times\"></i><span>{{ 'ImgManager.ImgCard.del' | translate }}</span></button>\r\n <button type=\"button\" class=\"selected\" (click)=\"onToggleImgSelected()\" *ngIf=\"stateDisplayed !== 'window'\">\r\n <i *ngIf=\"!picture.selected\" class=\"fal fa-square\"></i>\r\n <i *ngIf=\"picture.selected\" class=\"fa-solid fa-check-square checked\"></i>\r\n <span>{{ 'ImgManager.ImgCard.select' | translate }}</span>\r\n </button>\r\n </div>\r\n <div\r\n class=\"img-card__container__config img-card__container__config--small\"\r\n *ngIf=\"!picture.deleted && stateDisplayed === 'small'\"\r\n >\r\n <button class=\"show-edit\" (click)=\"displayLargeWindow()\"><i class=\"fa-solid fa-edit\"></i></button>\r\n </div>\r\n <div class=\"img-card__container__delete\" [ngClass]=\"{ 'show' : activeConfirmDelete}\">\r\n <span>{{ 'ImgManager.ImgCard.confirmDeleteImg' | translate }}</span>\r\n <div>\r\n <button (click)=\"activeConfirmDelete = false;\">{{ 'no' | translate }}</button>\r\n <button (click)=\"onRemoveImg(picture);activeConfirmDelete = false;\">{{ 'yes' | translate }}</button>\r\n </div>\r\n </div>\r\n <div class=\"img-card__container__valid\" *ngIf=\"stateDisplayed === 'small' && tabDisplayed == 'img-upload'\">\r\n <i class=\"far fa-check\"></i>\r\n <span>{{ 'ImgManager.ImgCard.validImgSmall' | translate }}</span>\r\n </div>\r\n <div\r\n *ngIf=\"picture.imgNotLoaded\"\r\n class=\"img-card__container__overlay\"\r\n [ngClass]=\"{'img-card__container__overlay--smallDisplay': stateDisplayed === 'small' || isUploadSection}\">\r\n <i (click)=\"onToggleImgSelected()\" class=\"fad fa-folder-times\"></i>\r\n </div>\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"picture.deleted\"></span>\r\n\r\n </div>\r\n <div\r\n class=\"img-card__nameContainer\"\r\n [ngClass]=\"{'smallNameDisplay': stateDisplayed === 'small' || isUploadSection, 'focus': focusInput}\">\r\n <input\r\n type=\"text\"\r\n class=\"wzImgMngInput img-card__nameContainer__name\"\r\n [(ngModel)]=\"picture.display_name\"\r\n (ngModelChange)=\"onNameChange(picture.id_file)\"\r\n [ngModelOptions]=\"{standalone: true, updateOn: 'blur'}\"\r\n (focus)=\"previousName=picture.display_name;focusInput = true;\"\r\n (blur)=\"focusInput = false;\"\r\n >\r\n <span>{{picture.display_name}}</span>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n" }]
1428
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgSelectionService }, { type: i3$1.HttpClient }, { type: ImgCDNService }, { type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: ApiService }]; }, propDecorators: { tabDisplayed: [{
1429
- type: Input
1430
- }], fullSize: [{
1431
- type: Input
1432
- }], picture: [{
1433
- type: Input
1434
- }], index: [{
1435
- type: Input
1436
- }], toggleImgSelected: [{
1437
- type: Output
1438
- }], switchDisplayWindow: [{
1439
- type: Output
1440
- }] } });
1441
-
1442
- class UploadListComponent {
1443
- constructor(imgSelectionService, renamePictureService) {
1444
- this.imgSelectionService = imgSelectionService;
1445
- this.renamePictureService = renamePictureService;
1446
- this.picturesList = [];
1447
- this.multipleImgMode = false;
1448
- this.switchDisplayWindow = new EventEmitter();
1449
- }
1450
- ngOnInit() {
1451
- this.setEvents();
1452
- }
1453
- onImgUploaded(img) {
1454
- img.forEach(picture => this.picturesList.push(picture));
1455
- this.renamePictureService.setPicturesList(this.picturesList);
1456
- }
1457
- onToggleSelectImg(index) {
1458
- if (this.stateDisplayed === 'window') {
1459
- return;
1460
- }
1461
- if (!this.picturesList[index].selected) {
1462
- this.imgSelectionService.addImgSelected(this.picturesList[index]);
1463
- this.picturesList[index].selected = true;
1464
- }
1465
- else {
1466
- this.imgSelectionService.removeImgSelectedById(this.picturesList[index].id_file);
1467
- this.picturesList[index].selected = false;
1468
- }
1469
- }
1470
- switchDisplayWindowCard() {
1471
- this.switchDisplayWindow.emit(true);
1472
- }
1473
- onRenamePicture(pictureRenamed) {
1474
- this.renamePictureService.renamePicture(pictureRenamed);
1475
- }
1476
- setEvents() {
1477
- this.imgSelectionChange = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
1478
- const idFileList = [];
1479
- imgSelection.map(img => idFileList.push(img.id_file));
1480
- for (const picture of this.picturesList) {
1481
- if (idFileList.indexOf(picture.id_file) === -1) {
1482
- picture.selected = false;
1483
- }
1484
- }
1485
- });
1486
- }
1487
- ngOnDestroy() {
1488
- this.imgSelectionChange.unsubscribe();
1489
- }
1490
- }
1491
- UploadListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadListComponent, deps: [{ token: ImgSelectionService }, { token: RenamePictureService }], target: i0.ɵɵFactoryTarget.Component });
1492
- UploadListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UploadListComponent, selector: "upload-list", inputs: { stateDisplayed: "stateDisplayed", tabDisplayed: "tabDisplayed", multipleImgMode: "multipleImgMode" }, outputs: { switchDisplayWindow: "switchDisplayWindow" }, ngImport: i0, template: "<div class=\"upload-list\" [ngClass]=\"{'smallDisplay': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\r\n\r\n <ng-scrollbar\r\n class=\"upload-list__scroll\"\r\n [ngClass]=\"{\r\n 'upload-list__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'upload-list__scroll--window': stateDisplayed === 'window'}\"\r\n >\r\n <div class=\"upload-list__box\">\r\n <div class=\"upload-list__box__container\">\r\n <div>\r\n <p class=\"mainColor\">\r\n {{ picturesList? picturesList.length : '' }}\r\n <ng-container *ngIf=\"picturesList && picturesList.length > 1\">{{ 'ImgManager.UploadList.imgSuccessImport' | translate }}</ng-container>\r\n <ng-container *ngIf=\"picturesList && picturesList.length === 1\">{{ 'ImgManager.UploadList.imgSuccessImportOne' | translate }}</ng-container>\r\n </p>\r\n <div class=\"dropdown is-hoverable\">\r\n <div class=\"dropdown-trigger\">\r\n <i\r\n aria-haspopup=\"true\" aria-controls=\"dropdown-menuInfoSeo\"\r\n class=\"fa-solid fa-info-circle\">\r\n </i>\r\n </div>\r\n <div class=\"dropdown-menu dropDownShadow\" id=\"dropdown-menuInfoSeo\" role=\"menu\">\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.rezise' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.webp' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.cdn' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.lazyloading' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-list__box__cards\">\r\n <div class=\"upload-list__box__cards__card\" *ngFor=\"let picture of picturesList; let index = index;\">\r\n <img-card\r\n [picture]=\"picture\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (toggleImgSelected)=\"onToggleSelectImg(index)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowCard()\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n ></img-card>\r\n <div class=\"upload-list__box__cards__card__btnBox\">\r\n <button type=\"button\" class=\"button success upload-list__box__cards__card__btnBox__btn\"><i class=\"fal fa-check\"></i></button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "component", type: ImgCardComponent, selector: "img-card", inputs: ["tabDisplayed", "fullSize", "picture", "index"], outputs: ["toggleImgSelected", "switchDisplayWindow"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1493
- easeInOut
1494
- ] });
1495
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UploadListComponent, decorators: [{
1496
- type: Component,
1497
- args: [{ selector: 'upload-list', animations: [
1498
- easeInOut
1499
- ], template: "<div class=\"upload-list\" [ngClass]=\"{'smallDisplay': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\r\n\r\n <ng-scrollbar\r\n class=\"upload-list__scroll\"\r\n [ngClass]=\"{\r\n 'upload-list__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'upload-list__scroll--window': stateDisplayed === 'window'}\"\r\n >\r\n <div class=\"upload-list__box\">\r\n <div class=\"upload-list__box__container\">\r\n <div>\r\n <p class=\"mainColor\">\r\n {{ picturesList? picturesList.length : '' }}\r\n <ng-container *ngIf=\"picturesList && picturesList.length > 1\">{{ 'ImgManager.UploadList.imgSuccessImport' | translate }}</ng-container>\r\n <ng-container *ngIf=\"picturesList && picturesList.length === 1\">{{ 'ImgManager.UploadList.imgSuccessImportOne' | translate }}</ng-container>\r\n </p>\r\n <div class=\"dropdown is-hoverable\">\r\n <div class=\"dropdown-trigger\">\r\n <i\r\n aria-haspopup=\"true\" aria-controls=\"dropdown-menuInfoSeo\"\r\n class=\"fa-solid fa-info-circle\">\r\n </i>\r\n </div>\r\n <div class=\"dropdown-menu dropDownShadow\" id=\"dropdown-menuInfoSeo\" role=\"menu\">\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.rezise' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.webp' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.cdn' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n <div class=\"dropdown-item\">\r\n <p>{{ 'ImgManager.UploadList.seo.lazyloading' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i> 100%</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"upload-list__box__cards\">\r\n <div class=\"upload-list__box__cards__card\" *ngFor=\"let picture of picturesList; let index = index;\">\r\n <img-card\r\n [picture]=\"picture\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (toggleImgSelected)=\"onToggleSelectImg(index)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowCard()\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n ></img-card>\r\n <div class=\"upload-list__box__cards__card__btnBox\">\r\n <button type=\"button\" class=\"button success upload-list__box__cards__card__btnBox__btn\"><i class=\"fal fa-check\"></i></button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n</div>\r\n" }]
1500
- }], ctorParameters: function () { return [{ type: ImgSelectionService }, { type: RenamePictureService }]; }, propDecorators: { stateDisplayed: [{
1501
- type: Input
1502
- }], tabDisplayed: [{
1503
- type: Input
1504
- }], multipleImgMode: [{
1505
- type: Input
1506
- }], switchDisplayWindow: [{
1507
- type: Output
1508
- }] } });
1509
-
1510
- class CopyClipboardDirective {
1511
- constructor() {
1512
- this.copied = new EventEmitter();
1513
- }
1514
- onClick(event) {
1515
- event.preventDefault();
1516
- if (!this.payload)
1517
- return;
1518
- let listener = (e) => {
1519
- let clipboard = e.clipboardData || window["clipboardData"];
1520
- clipboard.setData("text", this.payload.toString());
1521
- e.preventDefault();
1522
- this.copied.emit(this.payload);
1523
- };
1524
- document.addEventListener("copy", listener, false);
1525
- document.execCommand("copy");
1526
- document.removeEventListener("copy", listener, false);
1527
- }
1528
- }
1529
- CopyClipboardDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CopyClipboardDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1530
- CopyClipboardDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: CopyClipboardDirective, selector: "[copy-clipboard]", inputs: { payload: ["copy-clipboard", "payload"] }, outputs: { copied: "copied" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
1531
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CopyClipboardDirective, decorators: [{
1532
- type: Directive,
1533
- args: [{ selector: '[copy-clipboard]' }]
1534
- }], propDecorators: { payload: [{
1535
- type: Input,
1536
- args: ["copy-clipboard"]
1537
- }], copied: [{
1538
- type: Output,
1539
- args: ["copied"]
1540
- }], onClick: [{
1541
- type: HostListener,
1542
- args: ["click", ["$event"]]
1543
- }] } });
1544
-
1545
- class EditorInfoSectionComponent {
1546
- set isNameModified(isNameModified) {
1547
- this._isNameModified = isNameModified;
1548
- }
1549
- get isNameModified() {
1550
- return this._isNameModified;
1551
- }
1552
- constructor(alertService) {
1553
- this.alertService = alertService;
1554
- this._isNameModified = false;
1555
- this.isNameModifiedChange = new EventEmitter();
1556
- this.msgCopyToClipBoard = 'ImgManager.ImgEditor.copytoClipBoard';
1557
- }
1558
- ngOnInit() {
1559
- this.init();
1560
- }
1561
- init() {
1562
- this.imgName = this.imgToEdit.display_name;
1563
- }
1564
- getFileSize() {
1565
- return this.imgToEdit ? Math.round(parseInt(this.imgToEdit.size) / 1000) : '-';
1566
- }
1567
- copyToClipBoard(event) {
1568
- this.alertService.openAlert(this.msgCopyToClipBoard);
1569
- }
1570
- onNameChange() {
1571
- this.isNameModifiedChange.emit(true);
1572
- }
1573
- }
1574
- EditorInfoSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EditorInfoSectionComponent, deps: [{ token: AlertService }], target: i0.ɵɵFactoryTarget.Component });
1575
- EditorInfoSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: EditorInfoSectionComponent, selector: "info-section", inputs: { imgToEdit: "imgToEdit", isNameModified: "isNameModified" }, outputs: { isNameModifiedChange: "isNameModifiedChange" }, ngImport: i0, template: "\r\n<!-- Img properties -->\r\n<div class=\"img-editor__infoSection__propertyEditable\">\r\n <p class=\"mainColor\">\r\n {{ 'ImgManager.UploadList.properties.imgName' | translate }}\r\n <span class=\"img-editor__infoSection__propertyEditable__tooltips\" [nwbToolTip]=\"'ImgManager.ImgEditor.NameInfo' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></span>\r\n </p>\r\n <input\r\n type=\"text\"\r\n class=\"img-editor__infoSection__propertyEditable__input\"\r\n placeholder=\"{{'ImgManager.ImgEditor.nameEx' | translate}} \"\r\n [(ngModel)]=\"imgToEdit.display_name\"\r\n debounceKeyUp\r\n [debounceTime]=\"500\"\r\n (onEventChange)=\"onNameChange()\">\r\n</div>\r\n<div class=\"img-editor__infoSection__propertyEditable\">\r\n <p class=\"mainColor\">\r\n {{ 'ImgManager.UploadList.properties.imgURL' | translate }}\r\n <span class=\"img-editor__infoSection__propertyEditable__tooltips\" [nwbToolTip]=\"'ImgManager.editImg.changeName' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></span>\r\n </p>\r\n <button type=\"button\" [copy-clipboard]=\"imgToEdit.file_name | imgSrc : 'raw'\" (copied)=\"copyToClipBoard($event)\" ><span class=\"img-editor__infoSection__propertyEditable__span\">{{imgToEdit.file_name}}</span>&nbsp;&nbsp;<i class=\"far fa-copy\"></i></button>\r\n</div>\r\n<div class=\"img-editor__infoSection__property\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.properties.imgSize' | translate }}&nbsp;:</p>\r\n <p>{{imgToEdit.raw_height}}*{{imgToEdit.raw_width}}px</p>\r\n</div>\r\n<div class=\"img-editor__infoSection__property\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.properties.imgWeight' | translate }}&nbsp;:</p>\r\n <p >{{getFileSize()}}&nbsp;ko</p>\r\n</div>\r\n\r\n<!-- SEO info -->\r\n\r\n<span class=\"img-editor__infoSection__divider\"></span>\r\n\r\n<div class=\"img-editor__infoSection__titleSEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.title' | translate }}</p>\r\n</div>\r\n\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.rezise' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.reziseTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.webp' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.webpTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.cdn' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.cdnTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.lazyloading' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.lazyloadingTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NwbToolTipDirective, selector: "[nwbToolTip]", inputs: ["nwbToolTip", "nwbToolTipPosition", "nwbToolTipIsMultiline"] }, { kind: "directive", type: CopyClipboardDirective, selector: "[copy-clipboard]", inputs: ["copy-clipboard"], outputs: ["copied"] }, { kind: "directive", type: DebounceKeyupDirective, selector: "input[debounceKeyUp]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: ImageSrcPipe, name: "imgSrc" }] });
1576
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: EditorInfoSectionComponent, decorators: [{
1577
- type: Component,
1578
- args: [{ selector: 'info-section', template: "\r\n<!-- Img properties -->\r\n<div class=\"img-editor__infoSection__propertyEditable\">\r\n <p class=\"mainColor\">\r\n {{ 'ImgManager.UploadList.properties.imgName' | translate }}\r\n <span class=\"img-editor__infoSection__propertyEditable__tooltips\" [nwbToolTip]=\"'ImgManager.ImgEditor.NameInfo' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></span>\r\n </p>\r\n <input\r\n type=\"text\"\r\n class=\"img-editor__infoSection__propertyEditable__input\"\r\n placeholder=\"{{'ImgManager.ImgEditor.nameEx' | translate}} \"\r\n [(ngModel)]=\"imgToEdit.display_name\"\r\n debounceKeyUp\r\n [debounceTime]=\"500\"\r\n (onEventChange)=\"onNameChange()\">\r\n</div>\r\n<div class=\"img-editor__infoSection__propertyEditable\">\r\n <p class=\"mainColor\">\r\n {{ 'ImgManager.UploadList.properties.imgURL' | translate }}\r\n <span class=\"img-editor__infoSection__propertyEditable__tooltips\" [nwbToolTip]=\"'ImgManager.editImg.changeName' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></span>\r\n </p>\r\n <button type=\"button\" [copy-clipboard]=\"imgToEdit.file_name | imgSrc : 'raw'\" (copied)=\"copyToClipBoard($event)\" ><span class=\"img-editor__infoSection__propertyEditable__span\">{{imgToEdit.file_name}}</span>&nbsp;&nbsp;<i class=\"far fa-copy\"></i></button>\r\n</div>\r\n<div class=\"img-editor__infoSection__property\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.properties.imgSize' | translate }}&nbsp;:</p>\r\n <p>{{imgToEdit.raw_height}}*{{imgToEdit.raw_width}}px</p>\r\n</div>\r\n<div class=\"img-editor__infoSection__property\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.properties.imgWeight' | translate }}&nbsp;:</p>\r\n <p >{{getFileSize()}}&nbsp;ko</p>\r\n</div>\r\n\r\n<!-- SEO info -->\r\n\r\n<span class=\"img-editor__infoSection__divider\"></span>\r\n\r\n<div class=\"img-editor__infoSection__titleSEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.title' | translate }}</p>\r\n</div>\r\n\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.rezise' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.reziseTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.webp' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.webpTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.cdn' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.cdnTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n\r\n</div>\r\n<div class=\"img-editor__infoSection__propertySEO\">\r\n <p class=\"mainColor\">{{ 'ImgManager.UploadList.seo.lazyloading' | translate }}</p>\r\n <p><i class=\"fal fa-check\"></i>&nbsp;100%</p>\r\n <p class=\"img-editor__infoSection__propertySEO__tooltips\" [nwbToolTip]=\"'ImgManager.UploadList.seo.lazyloadingTooltips' | translate\" [nwbToolTipIsMultiline]=\"true\" nwbToolTipPosition=\"right\"><i class=\"fa-solid fa-info-circle\"></i></p>\r\n</div>\r\n" }]
1579
- }], ctorParameters: function () { return [{ type: AlertService }]; }, propDecorators: { imgToEdit: [{
1580
- type: Input
1581
- }], isNameModified: [{
1582
- type: Input
1583
- }], isNameModifiedChange: [{
1584
- type: Output
1585
- }] } });
1586
-
1587
- const insertRemove = // the fade-in/fade-out animation.
1588
- trigger('insertRemoveAnnim', [
1589
- transition(':enter', [
1590
- style({ opacity: 0 }),
1591
- animate('0.5s ease-in-out', style({ opacity: 1 })),
1592
- ])
1593
- ]);
1594
-
1595
- class DropdownComponent {
1596
- constructor() {
1597
- this.disable = false;
1598
- }
1599
- ngOnInit() {
1600
- }
1601
- }
1602
- DropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1603
- DropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DropdownComponent, selector: "dropdown", inputs: { dropDownMenuClass: "dropDownMenuClass", disable: "disable" }, ngImport: i0, template: "<div class=\"dropdown dropdownWizi\" [ngClass]=\"{'is-hoverable': !disable}\">\n <div class=\"dropdown-trigger\">\n\n <!-- Label -->\n <ng-content select=\"[label]\"></ng-content>\n\n </div>\n <div class=\"dropdown-menu\" [ngClass]=\"dropDownMenuClass\" role=\"menu\">\n <div class=\"dropdown-content\">\n\n <!-- Content -->\n <ng-content select=\"[item]\"></ng-content>\n\n </div>\n </div>\n</div>", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1604
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DropdownComponent, decorators: [{
1605
- type: Component,
1606
- args: [{ selector: 'dropdown', template: "<div class=\"dropdown dropdownWizi\" [ngClass]=\"{'is-hoverable': !disable}\">\n <div class=\"dropdown-trigger\">\n\n <!-- Label -->\n <ng-content select=\"[label]\"></ng-content>\n\n </div>\n <div class=\"dropdown-menu\" [ngClass]=\"dropDownMenuClass\" role=\"menu\">\n <div class=\"dropdown-content\">\n\n <!-- Content -->\n <ng-content select=\"[item]\"></ng-content>\n\n </div>\n </div>\n</div>" }]
1607
- }], ctorParameters: function () { return []; }, propDecorators: { dropDownMenuClass: [{
1608
- type: Input
1609
- }], disable: [{
1610
- type: Input
1611
- }] } });
1612
-
1613
- class CropperComponent {
1614
- set isImgModified(isImgModified) {
1615
- this._isImgModified = isImgModified;
1616
- if (!isImgModified) {
1617
- this.restartEdit();
1618
- }
1619
- }
1620
- get isImgModified() {
1621
- return this._isImgModified;
1622
- }
1623
- set isImgCropped(isImgCropped) {
1624
- setTimeout(() => {
1625
- this._isImgCropped = isImgCropped;
1626
- }, 0);
1627
- }
1628
- get isImgCropped() {
1629
- return this._isImgCropped;
1630
- }
1631
- constructor(imgCDNService) {
1632
- this.imgCDNService = imgCDNService;
1633
- this._isImgModified = false;
1634
- this.isImgModifiedChange = new EventEmitter();
1635
- this.editClosed = new EventEmitter();
1636
- this.currentCroppedImageChange = new EventEmitter();
1637
- this.msgFailLoad = 'ImgManager.ImgEditor.msgFailLoad';
1638
- this.isNameModified = false;
1639
- this.isCropperReady = false; // Use to not display the crop validation btn, after the img is loaded or changed
1640
- this.currentCroppedImage = ''; // Img modified return in base64
1641
- this.isCropped = false;
1642
- this.isLoading = false;
1643
- this._isImgCropped = false;
1644
- this.imgCropperChange = new Subject();
1645
- this.skipNextImgCropped = 1;
1646
- this.imageChangedEvent = '';
1647
- this.croppedImage = '';
1648
- this.canvasRotation = 0;
1649
- this.rotation = 0;
1650
- this.scale = 1;
1651
- this.showCropper = false;
1652
- this.containWithinAspectRatio = false;
1653
- this.transform = {};
1654
- // dropdown list
1655
- this.resolutionConfig = [
1656
- {
1657
- label: 'ImgManager.ImgEditor.config.origin',
1658
- config: {
1659
- maintainAspectRatio: true
1660
- },
1661
- },
1662
- {
1663
- label: 'ImgManager.ImgEditor.config.free',
1664
- config: {
1665
- maintainAspectRatio: false
1666
- },
1667
- active: true
1668
- },
1669
- {
1670
- label: 'ImgManager.ImgEditor.config.square',
1671
- config: {
1672
- maintainAspectRatio: true,
1673
- aspectRatio: 1 / 1
1674
- }
1675
- },
1676
- {
1677
- label: 'ImgManager.ImgEditor.config.Portrait',
1678
- config: {
1679
- maintainAspectRatio: true,
1680
- aspectRatio: 3 / 4
1681
- }
1682
- },
1683
- {
1684
- label: 'ImgManager.ImgEditor.config.landscape',
1685
- config: {
1686
- maintainAspectRatio: true,
1687
- aspectRatio: 5 / 3
1688
- }
1689
- }
1690
- ];
1691
- this.rotationConfig = [
1692
- {
1693
- label: 'ImgManager.ImgEditor.config.schedule',
1694
- icon: "fal fa-redo-alt",
1695
- method: "rotateRight",
1696
- active: true
1697
- },
1698
- {
1699
- label: 'ImgManager.ImgEditor.config.AntiSchedule',
1700
- icon: "fal fa-undo-alt",
1701
- method: "rotateLeft"
1702
- },
1703
- {
1704
- label: 'ImgManager.ImgEditor.config.flipVert',
1705
- icon: "fal fa-sort-alt",
1706
- method: "flipVertical"
1707
- },
1708
- {
1709
- label: 'ImgManager.ImgEditor.config.flipHoriz',
1710
- icon: "fal fa-exchange-alt",
1711
- method: "flipHorizontal"
1712
- }
1713
- ];
1714
- this.zoomConfig = [
1715
- {
1716
- label: 'ImgManager.ImgEditor.config.zoom',
1717
- icon: "fal fa-search-plus",
1718
- method: "zoomIn",
1719
- active: true
1720
- },
1721
- {
1722
- label: 'ImgManager.ImgEditor.config.dezoom',
1723
- icon: "fal fa-search-minus",
1724
- method: "zoomOut"
1725
- }
1726
- ];
1727
- // Img cropper variables
1728
- this.imgCropperConfig = {
1729
- maintainAspectRatio: false,
1730
- aspectRatio: undefined
1731
- };
1732
- }
1733
- ngOnInit() {
1734
- this.init();
1735
- this.detectImgCropperChange();
1736
- }
1737
- init() {
1738
- this.imgRoute = this.getRAWImgRoute();
1739
- this.imgType = this.getImgType();
1740
- this.croppedImage = null;
1741
- this.setDefautAspectRatio();
1742
- }
1743
- getRAWImgRoute() {
1744
- return this.imgCDNService.getUrlImg('raw') + this.imgToEdit.file_name;
1745
- }
1746
- getImgType() {
1747
- return (this.imgToEdit.file_name ? this.imgToEdit.file_name.split('.').pop() : undefined);
1748
- }
1749
- setDefautAspectRatio() {
1750
- const height = parseInt(this.imgToEdit.raw_height);
1751
- const width = parseInt(this.imgToEdit.raw_width);
1752
- this.defaultAspectRatio = height / width;
1753
- this.resolutionConfig[0].config.aspectRatio = this.defaultAspectRatio;
1754
- this.imgCropperConfig.aspectRatio = this.defaultAspectRatio;
1755
- }
1756
- onEditClosed(msgKey) {
1757
- this.editClosed.emit(msgKey);
1758
- }
1759
- onRestart() {
1760
- this.isImgModifiedChange.emit(false);
1761
- }
1762
- restartEdit() {
1763
- this.init();
1764
- this.resetConfCropper();
1765
- }
1766
- onImgModified() {
1767
- this.isImgModified = true;
1768
- this.isImgModifiedChange.emit(true);
1769
- }
1770
- ////// Img cropper methods ////////////////////////////////////////////////////////////////////////////////////////////////////////
1771
- /* Cropper output events */
1772
- fileChangeEvent(event) {
1773
- this.imageChangedEvent = event;
1774
- }
1775
- imageCropped(event) {
1776
- this.imgCropperChange.next();
1777
- this.currentCroppedImage = event.base64;
1778
- this.currentCroppedImageChange.emit(this.currentCroppedImage);
1779
- }
1780
- imageLoaded() {
1781
- this.showCropper = true;
1782
- }
1783
- cropperReady() {
1784
- this.isCropperReady = true;
1785
- }
1786
- loadImageFailed() {
1787
- this.onEditClosed(this.msgFailLoad);
1788
- }
1789
- /* Resize functions */
1790
- changeResolutionSize(index) {
1791
- this.setActiveItem(this.resolutionConfig, index);
1792
- const config = this.resolutionConfig[index].config;
1793
- this.setCropperProperties(config);
1794
- }
1795
- confirmCrop() {
1796
- setTimeout(() => {
1797
- this.imgRoute = null;
1798
- this.croppedImage = this.currentCroppedImage;
1799
- this.skipNextImgCropped = 2;
1800
- this.isImgCropped = false;
1801
- }, 0);
1802
- this.resetConfCropper();
1803
- this.onImgModified();
1804
- }
1805
- resetConfCropper() {
1806
- this.scale = 1;
1807
- this.rotation = 0;
1808
- this.canvasRotation = 0;
1809
- this.transform = {};
1810
- }
1811
- setActiveItem(array, index) {
1812
- // Set active-item class for the dropdown
1813
- array.forEach((item, indexItem) => {
1814
- item.active = indexItem === index ? true : false;
1815
- });
1816
- }
1817
- setCropperProperties(config) {
1818
- for (const property in config) {
1819
- this.imgCropperConfig[property] = config[property];
1820
- }
1821
- }
1822
- detectImgCropperChange() {
1823
- this.imgCropperChange
1824
- .subscribe(() => {
1825
- this.skipNextImgCropped--;
1826
- if (this.skipNextImgCropped >= 0) {
1827
- return;
1828
- }
1829
- this.skipNextImgCropped = 0;
1830
- this.isImgCropped = true;
1831
- });
1832
- }
1833
- /* Rotations functions */
1834
- rotateLeft() {
1835
- this.canvasRotation--;
1836
- this.flipAfterRotate();
1837
- this.onImgModified();
1838
- }
1839
- rotateRight() {
1840
- this.canvasRotation++;
1841
- this.flipAfterRotate();
1842
- this.onImgModified();
1843
- }
1844
- flipHorizontal() {
1845
- this.transform = Object.assign(Object.assign({}, this.transform), { flipH: !this.transform.flipH });
1846
- this.onImgModified();
1847
- }
1848
- flipVertical() {
1849
- this.transform = Object.assign(Object.assign({}, this.transform), { flipV: !this.transform.flipV });
1850
- this.onImgModified();
1851
- }
1852
- flipAfterRotate() {
1853
- const flippedH = this.transform.flipH;
1854
- const flippedV = this.transform.flipV;
1855
- this.transform = Object.assign(Object.assign({}, this.transform), { flipH: flippedV, flipV: flippedH });
1856
- }
1857
- /* Zoom functions */
1858
- zoomOut() {
1859
- this.scale -= this.scale < 0.2 ? 0 : .1;
1860
- this.transform = Object.assign(Object.assign({}, this.transform), { scale: this.scale });
1861
- this.onImgModified();
1862
- }
1863
- zoomIn() {
1864
- this.scale += .1;
1865
- this.transform = Object.assign(Object.assign({}, this.transform), { scale: this.scale });
1866
- this.onImgModified();
1867
- }
1868
- applyMethod(method) {
1869
- this[method](); // call the method contains in zoomConfig or rotationConfig
1870
- }
1871
- }
1872
- CropperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CropperComponent, deps: [{ token: ImgCDNService }], target: i0.ɵɵFactoryTarget.Component });
1873
- CropperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CropperComponent, selector: "cropper", inputs: { imgToEdit: "imgToEdit", isImgModified: "isImgModified" }, outputs: { isImgModifiedChange: "isImgModifiedChange", editClosed: "editClosed", currentCroppedImageChange: "currentCroppedImageChange" }, ngImport: i0, template: "<div class=\"img-editor__container__toolsContainer\">\r\n\r\n <div *ngIf=\"isImgCropped\">\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool img-editor__container__toolsContainer__tool--button\"\r\n (click)=\"confirmCrop()\"\r\n [nwbToolTip]=\"'ImgManager.ImgEditor.ValidtToolTip' | translate\"\r\n nwbToolTipPosition=\"left\"\r\n >\r\n <i class=\"far fa-check\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.Valid' | translate }}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Resolution -->\r\n <dropdown dropdownId=\"dropdown-resolution\">\r\n <ng-container label>\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool\"\r\n >\r\n <i class=\"far fa-crop\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.crop' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of resolutionConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"changeResolutionSize(index)\">\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <!-- Zoom -->\r\n <dropdown dropdownId=\"dropdown-rotation\">\r\n <ng-container label>\r\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"zoomIn()\">\r\n <i class=\"far fa-expand-arrows-alt\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.display' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of zoomConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"applyMethod(item.method)\">\r\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <!-- Rotation -->\r\n <dropdown dropdownId=\"dropdown-rotation\" dropDownMenuClass=\"img-editor__container__toolsContainer__RotationDropdown\">\r\n <ng-container label>\r\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"rotateRight()\">\r\n <i class=\"far fa-redo\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.rotation' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of rotationConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"applyMethod(item.method)\">\r\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool\"\r\n (click)=\"onRestart()\"\r\n @insertRemoveAnnim\r\n >\r\n <i class=\"far fa-retweet-alt\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.restart' | translate }}</p>\r\n </div>\r\n</div>\r\n\r\n<div class=\"img-editor__image-cropper\" >\r\n <image-cropper\r\n [imageURL]=\"imgRoute\"\r\n [imageBase64]=\"croppedImage\"\r\n [maintainAspectRatio]=\"imgCropperConfig.maintainAspectRatio\"\r\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\r\n [aspectRatio]=\"imgCropperConfig.aspectRatio\"\r\n [onlyScaleDown]=\"true\"\r\n [roundCropper]=\"false\"\r\n [canvasRotation]=\"canvasRotation\"\r\n [transform]=\"transform\"\r\n [alignImage]=\"'center'\"\r\n [style.display]=\"showCropper ? null : 'none'\"\r\n [format]=\"imgType\"\r\n [backgroundColor]=\"'white'\"\r\n (imageCropped)=\"imageCropped($event)\"\r\n (imageLoaded)=\"imageLoaded()\"\r\n (cropperReady)=\"cropperReady()\"\r\n (loadImageFailed)=\"loadImageFailed()\"\r\n ></image-cropper>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NwbToolTipDirective, selector: "[nwbToolTip]", inputs: ["nwbToolTip", "nwbToolTipPosition", "nwbToolTipIsMultiline"] }, { kind: "component", type: i4$1.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["dropDownMenuClass", "disable"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1874
- insertRemove
1875
- ] });
1876
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CropperComponent, decorators: [{
1877
- type: Component,
1878
- args: [{ selector: 'cropper', animations: [
1879
- insertRemove
1880
- ], template: "<div class=\"img-editor__container__toolsContainer\">\r\n\r\n <div *ngIf=\"isImgCropped\">\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool img-editor__container__toolsContainer__tool--button\"\r\n (click)=\"confirmCrop()\"\r\n [nwbToolTip]=\"'ImgManager.ImgEditor.ValidtToolTip' | translate\"\r\n nwbToolTipPosition=\"left\"\r\n >\r\n <i class=\"far fa-check\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.Valid' | translate }}</p>\r\n </div>\r\n </div>\r\n\r\n <!-- Resolution -->\r\n <dropdown dropdownId=\"dropdown-resolution\">\r\n <ng-container label>\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool\"\r\n >\r\n <i class=\"far fa-crop\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.crop' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of resolutionConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"changeResolutionSize(index)\">\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <!-- Zoom -->\r\n <dropdown dropdownId=\"dropdown-rotation\">\r\n <ng-container label>\r\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"zoomIn()\">\r\n <i class=\"far fa-expand-arrows-alt\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.display' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of zoomConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"applyMethod(item.method)\">\r\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <!-- Rotation -->\r\n <dropdown dropdownId=\"dropdown-rotation\" dropDownMenuClass=\"img-editor__container__toolsContainer__RotationDropdown\">\r\n <ng-container label>\r\n <div class=\"img-editor__container__toolsContainer__tool\" (click)=\"rotateRight()\">\r\n <i class=\"far fa-redo\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.rotation' | translate }}</p>\r\n </div>\r\n </ng-container>\r\n <ng-container item *ngFor=\"let item of rotationConfig; let index = index;\">\r\n <div\r\n class=\"dropdown-item\"\r\n [ngClass]=\"{'active-item': item.active}\"\r\n (click)=\"applyMethod(item.method)\">\r\n <i *ngIf=\"item.icon\" [ngClass]=\"item.icon\"></i>\r\n <p>{{item.label | translate}}</p>\r\n </div>\r\n </ng-container>\r\n </dropdown>\r\n\r\n <div\r\n class=\"img-editor__container__toolsContainer__tool\"\r\n (click)=\"onRestart()\"\r\n @insertRemoveAnnim\r\n >\r\n <i class=\"far fa-retweet-alt\"></i>\r\n <p>{{ 'ImgManager.ImgEditor.restart' | translate }}</p>\r\n </div>\r\n</div>\r\n\r\n<div class=\"img-editor__image-cropper\" >\r\n <image-cropper\r\n [imageURL]=\"imgRoute\"\r\n [imageBase64]=\"croppedImage\"\r\n [maintainAspectRatio]=\"imgCropperConfig.maintainAspectRatio\"\r\n [containWithinAspectRatio]=\"containWithinAspectRatio\"\r\n [aspectRatio]=\"imgCropperConfig.aspectRatio\"\r\n [onlyScaleDown]=\"true\"\r\n [roundCropper]=\"false\"\r\n [canvasRotation]=\"canvasRotation\"\r\n [transform]=\"transform\"\r\n [alignImage]=\"'center'\"\r\n [style.display]=\"showCropper ? null : 'none'\"\r\n [format]=\"imgType\"\r\n [backgroundColor]=\"'white'\"\r\n (imageCropped)=\"imageCropped($event)\"\r\n (imageLoaded)=\"imageLoaded()\"\r\n (cropperReady)=\"cropperReady()\"\r\n (loadImageFailed)=\"loadImageFailed()\"\r\n ></image-cropper>\r\n</div>\r\n" }]
1881
- }], ctorParameters: function () { return [{ type: ImgCDNService }]; }, propDecorators: { imgToEdit: [{
1882
- type: Input
1883
- }], isImgModified: [{
1884
- type: Input
1885
- }], isImgModifiedChange: [{
1886
- type: Output
1887
- }], editClosed: [{
1888
- type: Output
1889
- }], currentCroppedImageChange: [{
1890
- type: Output
1891
- }] } });
1892
-
1893
- class ImgEditorComponent {
1894
- constructor(imgManagerService, renamePictureService) {
1895
- this.imgManagerService = imgManagerService;
1896
- this.renamePictureService = renamePictureService;
1897
- this.editClosed = new EventEmitter();
1898
- this.isLoading = false;
1899
- this.isImgModified = false;
1900
- this.isNameModified = false;
1901
- this.currentCroppedImage = ''; // Img modified return in base64 by the cropper
1902
- this.msgFailSave = 'ImgManager.ImgEditor.msgFailSave';
1903
- this.msgFailLoad = 'ImgManager.ImgEditor.msgFailLoad';
1904
- this.msgSuccessEdit = "Les modifications de l'image ont bien été enregistrées.";
1905
- }
1906
- ngOnInit() {
1907
- this.previousName = this.imgToEdit.display_name;
1908
- }
1909
- onSave() {
1910
- if (this.isLoading) {
1911
- return;
1912
- }
1913
- this.isLoading = true;
1914
- if (!this.isImgModified && !this.isNameModified) {
1915
- this.isLoading = false;
1916
- this.onEditClosed();
1917
- }
1918
- const obsReplaceImg = this.imgManagerService.replaceImg(this.currentCroppedImage, this.imgToEdit.id_file);
1919
- const obsChangeImgName = this.renamePictureService.changeImageName(this.imgToEdit.display_name, this.imgToEdit.id_file);
1920
- if (this.isImgModified && this.isNameModified) {
1921
- this.renameAndReplaceImg(obsChangeImgName, obsReplaceImg);
1922
- return;
1923
- }
1924
- if (this.isImgModified) {
1925
- obsReplaceImg.subscribe({
1926
- next: data => {
1927
- this.isLoading = false;
1928
- this.onEditClosed(this.msgSuccessEdit);
1929
- },
1930
- error: error => {
1931
- this.isLoading = false;
1932
- this.currentCroppedImage = '';
1933
- this.onEditClosed(this.msgFailSave);
1934
- }
1935
- });
1936
- return;
1937
- }
1938
- if (this.isNameModified) {
1939
- obsChangeImgName.subscribe({
1940
- next: data => {
1941
- this.isLoading = false;
1942
- this.previousName = this.imgToEdit.display_name;
1943
- this.onEditClosed(this.msgSuccessEdit);
1944
- },
1945
- error: error => {
1946
- this.isLoading = false;
1947
- this.imgToEdit.display_name = this.previousName;
1948
- this.onEditClosed(this.msgFailSave);
1949
- }
1950
- });
1951
- }
1952
- this.isNameModified = false;
1953
- }
1954
- onEditClosed(msgKey) {
1955
- this.editClosed.emit(msgKey);
1956
- }
1957
- onRestartEdit() {
1958
- this.isImgModified = false;
1959
- this.isNameModified = false;
1960
- this.imgToEdit.display_name = this.previousName;
1961
- }
1962
- onCancel() {
1963
- this.onEditClosed('');
1964
- }
1965
- onImgCropped(imgBase64) {
1966
- this.currentCroppedImage = imgBase64;
1967
- }
1968
- renameAndReplaceImg(obsChangeImgName, obsReplaceImg) {
1969
- // Avoid to use forkjoin, because it can create conflict and loose the img
1970
- obsChangeImgName.subscribe({
1971
- next: res1 => {
1972
- obsReplaceImg.subscribe({
1973
- next: res2 => {
1974
- this.onEditClosed(this.msgSuccessEdit);
1975
- },
1976
- error: error => {
1977
- this.onEditClosed(this.msgFailSave);
1978
- }
1979
- });
1980
- },
1981
- error: error => {
1982
- this.onEditClosed(this.msgFailSave);
1983
- }
1984
- });
1985
- }
1986
- }
1987
- ImgEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgEditorComponent, deps: [{ token: ImgManagerService }, { token: RenamePictureService }], target: i0.ɵɵFactoryTarget.Component });
1988
- ImgEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImgEditorComponent, selector: "img-editor", inputs: { stateDisplayed: "stateDisplayed", imgToEdit: "imgToEdit" }, outputs: { editClosed: "editClosed" }, ngImport: i0, template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\r\n\r\n <!-- Button Action Section -->\r\n\r\n <div class=\"img-editor__infoSection__actions\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button img-editor__infoSection__actions__cancel\"\r\n (click)=\"onCancel()\"\r\n [disabled]=\"isLoading || (!isImgModified && !isNameModified)\"\r\n >\r\n {{ 'ImgManager.ImgLib.cancel' | translate }}\r\n </button>\r\n <div\r\n class=\"button danger button img-editor__infoSection__actions__save\"\r\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\r\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <ng-scrollbar\r\n class=\"img-editor__scroll\"\r\n [ngClass]=\"{\r\n 'img-editor__scroll--full': stateDisplayed === 'full',\r\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'img-editor__scroll--window': stateDisplayed === 'window'\r\n }\"\r\n >\r\n <div class=\"columns\">\r\n <!-- Left section -->\r\n <div class=\"column is-one-third img-editor__infoSection\">\r\n\r\n <info-section\r\n [imgToEdit]=\"imgToEdit\"\r\n [(isNameModified)]=\"isNameModified\"\r\n >\r\n </info-section>\r\n </div>\r\n\r\n\r\n <!-- Right section -->\r\n <div class=\"column img-editor__container\">\r\n <cropper\r\n [imgToEdit]=\"imgToEdit\"\r\n [(isImgModified)]=\"isImgModified\"\r\n (currentCroppedImageChange)=\"onImgCropped($event)\"\r\n (editClosed)=\"onEditClosed($event)\">\r\n </cropper>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "component", type: EditorInfoSectionComponent, selector: "info-section", inputs: ["imgToEdit", "isNameModified"], outputs: ["isNameModifiedChange"] }, { kind: "component", type: CropperComponent, selector: "cropper", inputs: ["imgToEdit", "isImgModified"], outputs: ["isImgModifiedChange", "editClosed", "currentCroppedImageChange"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
1989
- easeInOut
1990
- ] });
1991
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgEditorComponent, decorators: [{
1992
- type: Component,
1993
- args: [{ selector: 'img-editor', animations: [
1994
- easeInOut
1995
- ], template: "<div class=\"img-editor\" [@easeInOut]=\"'in'\">\r\n\r\n <!-- Button Action Section -->\r\n\r\n <div class=\"img-editor__infoSection__actions\">\r\n <div>\r\n <button\r\n type=\"button\"\r\n class=\"button img-editor__infoSection__actions__cancel\"\r\n (click)=\"onCancel()\"\r\n [disabled]=\"isLoading || (!isImgModified && !isNameModified)\"\r\n >\r\n {{ 'ImgManager.ImgLib.cancel' | translate }}\r\n </button>\r\n <div\r\n class=\"button danger button img-editor__infoSection__actions__save\"\r\n [ngClass]=\"{'img-editor__infoSection__actions__save--disable': isLoading}\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ 'ImgManager.ImgEditor.saveBtn' | translate }}\r\n <span btnLoadingAnim *ngIf=\"isLoading\" class=\"btnLoadingAnnimation\"></span>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n <ng-scrollbar\r\n class=\"img-editor__scroll\"\r\n [ngClass]=\"{\r\n 'img-editor__scroll--full': stateDisplayed === 'full',\r\n 'img-editor__scroll--smallDisplay': stateDisplayed === 'small',\r\n 'img-editor__scroll--window': stateDisplayed === 'window'\r\n }\"\r\n >\r\n <div class=\"columns\">\r\n <!-- Left section -->\r\n <div class=\"column is-one-third img-editor__infoSection\">\r\n\r\n <info-section\r\n [imgToEdit]=\"imgToEdit\"\r\n [(isNameModified)]=\"isNameModified\"\r\n >\r\n </info-section>\r\n </div>\r\n\r\n\r\n <!-- Right section -->\r\n <div class=\"column img-editor__container\">\r\n <cropper\r\n [imgToEdit]=\"imgToEdit\"\r\n [(isImgModified)]=\"isImgModified\"\r\n (currentCroppedImageChange)=\"onImgCropped($event)\"\r\n (editClosed)=\"onEditClosed($event)\">\r\n </cropper>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n</div>\r\n" }]
1996
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: RenamePictureService }]; }, propDecorators: { stateDisplayed: [{
1997
- type: Input
1998
- }], imgToEdit: [{
1999
- type: Input
2000
- }], editClosed: [{
2001
- type: Output
2002
- }] } });
2003
-
2004
- class AutoHideDirective {
2005
- constructor(_elementRef, domService) {
2006
- this._elementRef = _elementRef;
2007
- this.domService = domService;
2008
- this.forceOn = null;
2009
- this.clickOutside = new EventEmitter();
2010
- }
2011
- ngAfterViewInit() {
2012
- this.domService.documentEvent().subscribe((targetElement) => {
2013
- const clickedInside = this._elementRef.nativeElement.contains(targetElement);
2014
- const classNameFromElement = targetElement.getAttribute('class');
2015
- if (!clickedInside && (classNameFromElement === null || !classNameFromElement.includes(this.triggerElement))) {
2016
- this.clickOutside.emit(null);
2017
- }
2018
- if (this.forceOn != null && classNameFromElement !== null) {
2019
- let needToClose = true;
2020
- this.forceOn.forEach(v => {
2021
- if (!classNameFromElement.includes(v)) {
2022
- needToClose = false;
2023
- }
2024
- });
2025
- if (needToClose) {
2026
- this.clickOutside.emit(null);
2027
- }
2028
- }
2029
- });
2030
- }
2031
- }
2032
- AutoHideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutoHideDirective, deps: [{ token: i0.ElementRef }, { token: DomService }], target: i0.ɵɵFactoryTarget.Directive });
2033
- AutoHideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: { triggerElement: "triggerElement", forceOn: "forceOn" }, outputs: { clickOutside: "clickOutside" }, ngImport: i0 });
2034
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AutoHideDirective, decorators: [{
2035
- type: Directive,
2036
- args: [{
2037
- selector: '[wzAutoHide]'
2038
- }]
2039
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: DomService }]; }, propDecorators: { triggerElement: [{
2040
- type: Input
2041
- }], forceOn: [{
2042
- type: Input
2043
- }], clickOutside: [{
2044
- type: Output,
2045
- args: ['clickOutside']
2046
- }] } });
2047
-
2048
- class CanvaBtnComponent {
2049
- constructor(canvaService) {
2050
- this.canvaService = canvaService;
2051
- this.showImgUploaded = new EventEmitter();
2052
- this.imgLoading = false;
2053
- this.availableFormat = {
2054
- 'ImgManager.CanvaBtn.smallSquare': {
2055
- 'width': 500,
2056
- 'height': 500
2057
- },
2058
- 'ImgManager.CanvaBtn.mediumSquare': {
2059
- 'width': 1000,
2060
- 'height': 1000
2061
- },
2062
- 'ImgManager.CanvaBtn.bigSquare': {
2063
- 'width': 2500,
2064
- 'height': 2500
2065
- }
2066
- };
2067
- this.openDropDownMenu = false;
2068
- this.subs = [];
2069
- }
2070
- ngOnInit() {
2071
- this.canvaLogoRouteAssets = this.canvaService.getCanvaLogo();
2072
- this.listenCanvaExpectedSize();
2073
- }
2074
- listenCanvaExpectedSize() {
2075
- // Subcribe to askImg from wizi-block
2076
- const subExpectedImgSizesChange = this.canvaService.bindEventExepectedImgSizeChange().subscribe((mediaDTO) => {
2077
- if (mediaDTO) {
2078
- this.expectedWidth = parseInt(mediaDTO.image_width, 10);
2079
- this.expectedHeight = parseInt(mediaDTO.image_height, 10);
2080
- }
2081
- else {
2082
- this.expectedWidth = undefined;
2083
- this.expectedHeight = undefined;
2084
- }
2085
- });
2086
- this.subs.push(subExpectedImgSizesChange);
2087
- }
2088
- onOpenCanva(width, height) {
2089
- this.canvaService.openCanva(width, height);
2090
- }
2091
- ngOnDestroy() {
2092
- this.subs.forEach(sub => sub.unsubscribe());
2093
- }
2094
- }
2095
- CanvaBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CanvaBtnComponent, deps: [{ token: CanvaService }], target: i0.ɵɵFactoryTarget.Component });
2096
- CanvaBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CanvaBtnComponent, selector: "canva-btn", inputs: { stateDisplayed: "stateDisplayed" }, outputs: { showImgUploaded: "showImgUploaded" }, ngImport: i0, template: "<div class=\"canva dropdown is-right is-hoverable\"\r\n wzAutoHide (clickOutside)=\"openDropDownMenu = false;\"\r\n [ngClass]=\"{'is-up': stateDisplayed === 'small', 'noTooltip': stateDisplayed !== 'small'}\"\r\n >\r\n <div class=\"dropdown-trigger\">\r\n <div\r\n class=\"button canva-btn\"\r\n aria-controls=\"dropdown-menuCanva\"\r\n (click)=\"openDropDownMenu = true;\"\r\n >\r\n <span>{{'ImgManager.CanvaBtn.createImg' | translate}}</span>\r\n <img [src]=\"canvaLogoRouteAssets\" class=\"canva-btn__logo\">\r\n\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"imgLoading\"></span>\r\n </div>\r\n </div>\r\n <div\r\n class=\"dropdown-menu dropDownShadow\"\r\n [ngClass]=\"{'displayDropDownMenu': openDropDownMenu }\"\r\n id=\"dropdown-menuCanva\"\r\n role=\"menu\">\r\n <ng-scrollbar\r\n class=\"smallScroll\"\r\n >\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdownTitle\">\r\n <p>{{'ImgManager.CanvaBtn.createImg.title' | translate}}</p>\r\n </div>\r\n\r\n <div class=\"infoItem\">\r\n <p>{{'ImgManager.CanvaBtn.info' | translate}}</p>\r\n </div>\r\n\r\n <ng-container >\r\n <div\r\n *ngIf=\"expectedWidth && expectedHeight\"\r\n class=\"dropdown-item-wrapper\"\r\n >\r\n <div class=\"dropdown-item expectedSizes\" (click)=\"onOpenCanva(expectedWidth, expectedHeight)\">\r\n <p>{{'ImgManager.CanvaBtn.recommanded' | translate}}</p><p>{{expectedWidth}}*{{expectedHeight}}</p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <div\r\n *ngFor=\"let format of availableFormat| keyvalue\"\r\n class=\"dropdown-item-wrapper\">\r\n <div\r\n (click)=\"onOpenCanva(format.value.width, format.value.height)\"\r\n class=\"dropdown-item\">\r\n <p>{{format.key | translate}}</p><p>{{format.value.width}}*{{format.value.height}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
2097
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CanvaBtnComponent, decorators: [{
2098
- type: Component,
2099
- args: [{ selector: 'canva-btn', template: "<div class=\"canva dropdown is-right is-hoverable\"\r\n wzAutoHide (clickOutside)=\"openDropDownMenu = false;\"\r\n [ngClass]=\"{'is-up': stateDisplayed === 'small', 'noTooltip': stateDisplayed !== 'small'}\"\r\n >\r\n <div class=\"dropdown-trigger\">\r\n <div\r\n class=\"button canva-btn\"\r\n aria-controls=\"dropdown-menuCanva\"\r\n (click)=\"openDropDownMenu = true;\"\r\n >\r\n <span>{{'ImgManager.CanvaBtn.createImg' | translate}}</span>\r\n <img [src]=\"canvaLogoRouteAssets\" class=\"canva-btn__logo\">\r\n\r\n <span btnLoadingAnim class=\"btnLoadingAnnimation\" *ngIf=\"imgLoading\"></span>\r\n </div>\r\n </div>\r\n <div\r\n class=\"dropdown-menu dropDownShadow\"\r\n [ngClass]=\"{'displayDropDownMenu': openDropDownMenu }\"\r\n id=\"dropdown-menuCanva\"\r\n role=\"menu\">\r\n <ng-scrollbar\r\n class=\"smallScroll\"\r\n >\r\n <div class=\"dropdown-content\">\r\n <div class=\"dropdownTitle\">\r\n <p>{{'ImgManager.CanvaBtn.createImg.title' | translate}}</p>\r\n </div>\r\n\r\n <div class=\"infoItem\">\r\n <p>{{'ImgManager.CanvaBtn.info' | translate}}</p>\r\n </div>\r\n\r\n <ng-container >\r\n <div\r\n *ngIf=\"expectedWidth && expectedHeight\"\r\n class=\"dropdown-item-wrapper\"\r\n >\r\n <div class=\"dropdown-item expectedSizes\" (click)=\"onOpenCanva(expectedWidth, expectedHeight)\">\r\n <p>{{'ImgManager.CanvaBtn.recommanded' | translate}}</p><p>{{expectedWidth}}*{{expectedHeight}}</p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <div\r\n *ngFor=\"let format of availableFormat| keyvalue\"\r\n class=\"dropdown-item-wrapper\">\r\n <div\r\n (click)=\"onOpenCanva(format.value.width, format.value.height)\"\r\n class=\"dropdown-item\">\r\n <p>{{format.key | translate}}</p><p>{{format.value.width}}*{{format.value.height}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n </div>\r\n</div>\r\n" }]
2100
- }], ctorParameters: function () { return [{ type: CanvaService }]; }, propDecorators: { stateDisplayed: [{
2101
- type: Input
2102
- }], showImgUploaded: [{
2103
- type: Output
2104
- }] } });
2105
-
2106
- class PagniationIsLastPage {
2107
- /**
2108
- * Return true, if the current page is the last page. Otherwise, return false.
2109
- * @param currentPage
2110
- * @param totalItems
2111
- * @param itemsPerPage
2112
- */
2113
- transform(currentPage, totalItems, itemsPerPage) {
2114
- if (!(currentPage >= 0 && totalItems >= 0 && itemsPerPage >= 0)) {
2115
- throw new Error('currentPage or totalItems or itemsPerPage is/are missing in PagniationIsLastPage pipe.');
2116
- }
2117
- return currentPage === Math.ceil(totalItems / itemsPerPage);
2118
- }
2119
- }
2120
- PagniationIsLastPage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationIsLastPage, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2121
- PagniationIsLastPage.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PagniationIsLastPage, name: "IsLastPage" });
2122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationIsLastPage, decorators: [{
2123
- type: Pipe,
2124
- args: [{
2125
- name: 'IsLastPage'
2126
- }]
2127
- }] });
2128
-
2129
- class PagniationArrayTotalPages {
2130
- /**
2131
- * Return an incremental array corresponding with the number page
2132
- * [ 1, 2, 3 ..., last page number ]
2133
- * @param totalItems
2134
- * @param itemsPerPage
2135
- */
2136
- transform(totalItems, itemsPerPage) {
2137
- if (!(totalItems >= 0 && itemsPerPage >= 0)) {
2138
- throw new Error('totalItems or itemsPerPage missing in ArrayTotalPages pipe.');
2139
- }
2140
- const arrayLength = Math.ceil(totalItems / itemsPerPage);
2141
- return Array.apply(null, { length: arrayLength })
2142
- .map(Number.call, Number)
2143
- .map((x) => x + 1);
2144
- }
2145
- }
2146
- PagniationArrayTotalPages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationArrayTotalPages, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2147
- PagniationArrayTotalPages.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PagniationArrayTotalPages, name: "ArrayTotalPages" });
2148
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationArrayTotalPages, decorators: [{
2149
- type: Pipe,
2150
- args: [{
2151
- name: 'ArrayTotalPages'
2152
- }]
2153
- }] });
2154
-
2155
- class LargeNumberOfPagePipe {
2156
- /**
2157
- * Return an incremental array
2158
- * Display 30 pages, from -15 to +15 of the current page
2159
- * @param totalItems
2160
- * @param itemsPerPage
2161
- */
2162
- transform(totalItems, itemsPerPage, currentPage) {
2163
- if (!(totalItems >= 0 && itemsPerPage >= 0)) {
2164
- throw new Error('totalItems or itemsPerPage missing in ArrayTotalPages pipe.');
2165
- }
2166
- let arrayLength = 32;
2167
- const startAtPage = currentPage <= 15 ? 0 : currentPage - 15;
2168
- const totalPage = Math.ceil(totalItems / itemsPerPage);
2169
- const arrayWithPageNumber = Array.apply(null, { length: arrayLength })
2170
- .map(Number.call, Number)
2171
- .map((x) => {
2172
- const pageIndex = {
2173
- display: startAtPage + x + 1,
2174
- value: startAtPage + x + 1
2175
- };
2176
- if (x === arrayLength - 2) {
2177
- pageIndex.display = '...';
2178
- }
2179
- if (x === arrayLength - 1) {
2180
- pageIndex.display = totalPage;
2181
- pageIndex.value = totalPage;
2182
- }
2183
- return pageIndex;
2184
- });
2185
- if (startAtPage) {
2186
- arrayWithPageNumber.unshift({
2187
- display: 1,
2188
- value: 1
2189
- }, {
2190
- display: "...",
2191
- value: 2
2192
- });
2193
- }
2194
- return arrayWithPageNumber;
2195
- }
2196
- }
2197
- LargeNumberOfPagePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LargeNumberOfPagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2198
- LargeNumberOfPagePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: LargeNumberOfPagePipe, name: "LargeNumberOfPage" });
2199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LargeNumberOfPagePipe, decorators: [{
2200
- type: Pipe,
2201
- args: [{
2202
- name: 'LargeNumberOfPage'
2203
- }]
2204
- }] });
2205
-
2206
- class PageSelectorComponent {
2207
- set pagination(pagination) {
2208
- this._pagination = pagination;
2209
- }
2210
- get pagination() {
2211
- return this._pagination;
2212
- }
2213
- set totalItems(totalItems) {
2214
- this.numberOfPage = Math.ceil(totalItems / this.pagination.itemsPerPage);
2215
- this.largeNumberOfPage = this.numberOfPage > 30;
2216
- }
2217
- get totalItems() {
2218
- return this._totalItems;
2219
- }
2220
- constructor() {
2221
- this.openAbsoluteSelect = false;
2222
- this.largeNumberOfPage = false;
2223
- this.numberOfPage = 0;
2224
- this.pageChange = new EventEmitter();
2225
- }
2226
- onGotoPageChange(event, directValue) {
2227
- if (directValue) {
2228
- this.pageChange.emit(event);
2229
- this.openAbsoluteSelect = false;
2230
- }
2231
- else {
2232
- this.pageChange.emit(parseInt(event.target.value));
2233
- }
2234
- }
2235
- }
2236
- PageSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2237
- PageSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PageSelectorComponent, selector: "wz-page-selector", inputs: { pagination: "pagination", totalItems: "totalItems" }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: "<div class=\"wz-selector\">\r\n\r\n <div class=\"wz-selector__default\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\r\n <div class=\"wz-selector__default__base\" *ngIf=\"largeNumberOfPage;\" (click)=\"openAbsoluteSelect = !openAbsoluteSelect\">\r\n <input name=\"page-input\" [value]=\"pagination.currentPage\" (change)=\"onGotoPageChange($event, false);openAbsoluteSelect = false;\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\" />\r\n <i class=\"fa-solid fa-sort-down\"></i>\r\n </div>\r\n <div class=\"wz-selector__default__absolute\" *ngIf=\"openAbsoluteSelect\">\r\n <div class=\"wz-selector__default__absolute__wrapper\" *ngFor=\"let pageIndex of (pagination.totalItems | LargeNumberOfPage: pagination.itemsPerPage : pagination.currentPage).slice().reverse() as result\">\r\n <div class=\"wz-selector__default__absolute__wrapper__item\" [ngClass]=\"{'selected': pageIndex.value === pagination.currentPage}\" (click)=\"onGotoPageChange(pageIndex.value, true)\">\r\n <span>{{ pageIndex.display }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!largeNumberOfPage\">\r\n <select name=\"page\" (change)=\"onGotoPageChange($event, false)\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\r\n <ng-container *ngFor=\"let pageIndex of pagination.totalItems | ArrayTotalPages: pagination.itemsPerPage\">\r\n <option [selected]=\"pageIndex === pagination.currentPage\" [value]=\"pageIndex\">\r\n {{ pageIndex }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </ng-container>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "pipe", type: PagniationArrayTotalPages, name: "ArrayTotalPages" }, { kind: "pipe", type: LargeNumberOfPagePipe, name: "LargeNumberOfPage" }] });
2238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PageSelectorComponent, decorators: [{
2239
- type: Component,
2240
- args: [{ selector: 'wz-page-selector', template: "<div class=\"wz-selector\">\r\n\r\n <div class=\"wz-selector__default\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\r\n <div class=\"wz-selector__default__base\" *ngIf=\"largeNumberOfPage;\" (click)=\"openAbsoluteSelect = !openAbsoluteSelect\">\r\n <input name=\"page-input\" [value]=\"pagination.currentPage\" (change)=\"onGotoPageChange($event, false);openAbsoluteSelect = false;\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\" />\r\n <i class=\"fa-solid fa-sort-down\"></i>\r\n </div>\r\n <div class=\"wz-selector__default__absolute\" *ngIf=\"openAbsoluteSelect\">\r\n <div class=\"wz-selector__default__absolute__wrapper\" *ngFor=\"let pageIndex of (pagination.totalItems | LargeNumberOfPage: pagination.itemsPerPage : pagination.currentPage).slice().reverse() as result\">\r\n <div class=\"wz-selector__default__absolute__wrapper__item\" [ngClass]=\"{'selected': pageIndex.value === pagination.currentPage}\" (click)=\"onGotoPageChange(pageIndex.value, true)\">\r\n <span>{{ pageIndex.display }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!largeNumberOfPage\">\r\n <select name=\"page\" (change)=\"onGotoPageChange($event, false)\" [ngStyle]=\"{'width': 40 + (10*pagination.currentPage.toString().length) + 'px'}\">\r\n <ng-container *ngFor=\"let pageIndex of pagination.totalItems | ArrayTotalPages: pagination.itemsPerPage\">\r\n <option [selected]=\"pageIndex === pagination.currentPage\" [value]=\"pageIndex\">\r\n {{ pageIndex }}\r\n </option>\r\n </ng-container>\r\n </select>\r\n </ng-container>\r\n</div>\r\n" }]
2241
- }], ctorParameters: function () { return []; }, propDecorators: { pagination: [{
2242
- type: Input
2243
- }], totalItems: [{
2244
- type: Input
2245
- }], pageChange: [{
2246
- type: Output
2247
- }] } });
2248
-
2249
- class PagniationText {
2250
- constructor(translateService) {
2251
- this.translateService = translateService;
2252
- }
2253
- /**
2254
- * Update pagination text if at least one entrie change
2255
- * @param currentPage
2256
- * @param totalItems
2257
- * @param itemsPerPage
2258
- */
2259
- transform(currentPage, totalItems, itemsPerPage) {
2260
- let currentItemsLow = 0, currentItemsHigh = 0;
2261
- if (totalItems) {
2262
- currentItemsLow = (currentPage - 1) * itemsPerPage + 1;
2263
- currentItemsHigh = currentPage * itemsPerPage;
2264
- }
2265
- if (currentItemsHigh > totalItems) {
2266
- currentItemsHigh = totalItems;
2267
- }
2268
- return this.translateService.instant('PaginationComponent.on', { low: currentItemsLow, high: currentItemsHigh, total: totalItems });
2269
- }
2270
- }
2271
- PagniationText.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationText, deps: [{ token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
2272
- PagniationText.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PagniationText, name: "customPagniationText" });
2273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagniationText, decorators: [{
2274
- type: Pipe,
2275
- args: [{
2276
- name: 'customPagniationText'
2277
- }]
2278
- }], ctorParameters: function () { return [{ type: i3.TranslateService }]; } });
2279
-
2280
- class PaginationComponent {
2281
- set pagination(pagination) {
2282
- this._pagination = pagination;
2283
- }
2284
- get pagination() {
2285
- return this._pagination;
2286
- }
2287
- constructor() {
2288
- this.pageChange = new EventEmitter();
2289
- }
2290
- decrementPage() {
2291
- if (this.pagination.currentPage <= 1) {
2292
- return;
2293
- }
2294
- this.pagination.currentPage--;
2295
- this.pageChange.emit(this.pagination);
2296
- }
2297
- incrementPage() {
2298
- const isLastPage = new PagniationIsLastPage().transform(this.pagination.currentPage, this.pagination.totalItems, this.pagination.itemsPerPage);
2299
- if (isLastPage) {
2300
- return;
2301
- }
2302
- this.pagination.currentPage++;
2303
- this.pageChange.emit(this.pagination);
2304
- }
2305
- onGotoPageChange(pageNumber) {
2306
- this.pagination.currentPage = parseInt(pageNumber);
2307
- this.pageChange.emit(this.pagination);
2308
- }
2309
- }
2310
- PaginationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2311
- PaginationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PaginationComponent, selector: "wz-pagination", inputs: { pagination: "pagination" }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: "<div class=\"wz-pagination\" *ngIf=\"pagination && pagination.itemsPerPage\">\n <div class=\"wz-pagination__wrapper\">\n <div class=\"wz-pagination__wrapper__page\">\n <p>{{ 'PaginationComponent.page' | translate }}</p>\n\n <wz-page-selector [pagination]=\"pagination\" [totalItems]=\"pagination.totalItems\" (pageChange)=\"onGotoPageChange($event)\"></wz-page-selector>\n </div>\n\n <div class=\"wz-pagination__wrapper__elements\">\n <p>{{ pagination.currentPage | customPagniationText: pagination.totalItems:pagination.itemsPerPage }}</p>\n </div>\n\n <div class=\"wz-pagination__wrapper__arrows\">\n <div\n (click)=\"decrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--left\"\n [ngClass]=\"{ 'wz-pagination__wrapper__arrows__arrow--disabled': pagination.currentPage === 1 }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n <div\n (click)=\"incrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--right\"\n [ngClass]=\"{\n 'wz-pagination__wrapper__arrows__arrow--disabled':\n pagination.currentPage | IsLastPage: pagination.totalItems:pagination.itemsPerPage\n }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n </div>\n </div>\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: PageSelectorComponent, selector: "wz-page-selector", inputs: ["pagination", "totalItems"], outputs: ["pageChange"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: PagniationIsLastPage, name: "IsLastPage" }, { kind: "pipe", type: PagniationText, name: "customPagniationText" }] });
2312
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PaginationComponent, decorators: [{
2313
- type: Component,
2314
- args: [{ selector: 'wz-pagination', template: "<div class=\"wz-pagination\" *ngIf=\"pagination && pagination.itemsPerPage\">\n <div class=\"wz-pagination__wrapper\">\n <div class=\"wz-pagination__wrapper__page\">\n <p>{{ 'PaginationComponent.page' | translate }}</p>\n\n <wz-page-selector [pagination]=\"pagination\" [totalItems]=\"pagination.totalItems\" (pageChange)=\"onGotoPageChange($event)\"></wz-page-selector>\n </div>\n\n <div class=\"wz-pagination__wrapper__elements\">\n <p>{{ pagination.currentPage | customPagniationText: pagination.totalItems:pagination.itemsPerPage }}</p>\n </div>\n\n <div class=\"wz-pagination__wrapper__arrows\">\n <div\n (click)=\"decrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--left\"\n [ngClass]=\"{ 'wz-pagination__wrapper__arrows__arrow--disabled': pagination.currentPage === 1 }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n <div\n (click)=\"incrementPage()\"\n class=\"wz-pagination__wrapper__arrows__arrow wz-pagination__wrapper__arrows__arrow--right\"\n [ngClass]=\"{\n 'wz-pagination__wrapper__arrows__arrow--disabled':\n pagination.currentPage | IsLastPage: pagination.totalItems:pagination.itemsPerPage\n }\"\n >\n <span class=\"wz-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n </div>\n </div>\n</div>\n" }]
2315
- }], ctorParameters: function () { return []; }, propDecorators: { pagination: [{
2316
- type: Input
2317
- }], pageChange: [{
2318
- type: Output
2319
- }] } });
2320
-
2321
- class NumberToArray {
2322
- transform(number) {
2323
- return Array.from('x'.repeat(number));
2324
- }
2325
- }
2326
- NumberToArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NumberToArray, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2327
- NumberToArray.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: NumberToArray, name: "numberToArray" });
2328
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: NumberToArray, decorators: [{
2329
- type: Pipe,
2330
- args: [{
2331
- name: 'numberToArray'
2332
- }]
2333
- }] });
2334
-
2335
- class MosaicViewComponent extends ImagesActionHandler {
2336
- constructor(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService) {
2337
- super(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService);
2338
- this.nbFakeImg = 0;
2339
- this.switchDisplayWindow = new EventEmitter();
2340
- }
2341
- ngOnInit() {
2342
- }
2343
- onSearchChange(event) {
2344
- // Reset table filters
2345
- this.tableFilters.sort = undefined;
2346
- this.tableFilters.order = undefined;
2347
- this.tableFilters.currentPage = 1;
2348
- this.filtersChange.emit(this.tableFilters);
2349
- }
2350
- onCardRenamePicture(pictureRenamed) {
2351
- this.pictureNameChange.next(pictureRenamed);
2352
- }
2353
- switchDisplayWindowCard() {
2354
- this.switchDisplayWindow.emit(true);
2355
- }
2356
- trackById(index, picture) {
2357
- return picture.id;
2358
- }
2359
- }
2360
- MosaicViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MosaicViewComponent, deps: [{ token: ImgManagerService }, { token: ImgSelectionService }, { token: i3$1.HttpClient }, { token: ImgCDNService }, { token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Component });
2361
- MosaicViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MosaicViewComponent, selector: "mosaic-view", inputs: { tabDisplayed: "tabDisplayed", fullSize: "fullSize", nbFakeImg: "nbFakeImg" }, outputs: { switchDisplayWindow: "switchDisplayWindow" }, usesInheritance: true, ngImport: i0, template: "<div class=\"mosaic\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small', 'mosaic--displayPexelsImg': displayPexelsResults}\">\r\n <!-- Search section -->\r\n <div\r\n class=\"mosaic__search\"\r\n [ngClass]=\"{'mosaic__search--small': stateDisplayed === 'small'}\"\r\n *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n <wz-input-search\r\n [(ngModel)]=\"tableFilters.searchValue\"\r\n (changeDebounced)=\"onSearchChange($event)\"\r\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\r\n [smallPadding]=\"stateDisplayed === 'small'\"\r\n ></wz-input-search>\r\n </div>\r\n\r\n <!-- Cards section -->\r\n <div\r\n class=\"mosaic__container__cards\"\r\n [ngClass]=\"{'mosaic__container__cards--padding': stateDisplayed !== 'window'}\"\r\n [@listAnimation]=\"picturesList.length\"\r\n *ngIf=\"!isLoading && !displayPexelsResults\"\r\n >\r\n <img-card\r\n *ngFor=\"let picture of picturesList; let index = index; trackBy: trackById \"\r\n [picture]=\"picture\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabDisplayed\"\r\n [disable]=\"disable\"\r\n (toggleImgSelected)=\"onToggleSelectImg(index)\"\r\n (pictureNameChange)=\"onCardRenamePicture($event)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowCard()\"\r\n [fullSize]=\"fullSize\"\r\n ></img-card>\r\n <div\r\n *ngFor=\"let fakeImg of nbFakeImg | numberToArray\"\r\n class=\"mosaic__container__cards__fakeImg\"\r\n [ngClass]=\"{'mosaic__container__cards__fakeImg--smallFakeImg': stateDisplayed === 'small' || tabDisplayed === 'img-upload'}\">\r\n </div>\r\n </div>\r\n\r\n <!-- Loader section -->\r\n <div class=\"mosaic__container__loader\" *ngIf=\"isLoading\">\r\n <wz-loader [small]=\"true\"></wz-loader>\r\n </div>\r\n\r\n <!-- Pagination section -->\r\n <div class=\"mosaic__pagination\" *ngIf=\"picturesList.length && tabDisplayed !== 'img-upload' && !displayPexelsResults\" >\r\n <wz-pagination\r\n [pagination]=\"tableFilters\"\r\n (pageChange)=\"onFiltersChange()\"\r\n >\r\n </wz-pagination>\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImgCardComponent, selector: "img-card", inputs: ["tabDisplayed", "fullSize", "picture", "index"], outputs: ["toggleImgSelected", "switchDisplayWindow"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "component", type: InputSearchComponent, selector: "wz-input-search", inputs: ["placeholder", "smallPadding", "id"], outputs: ["changeDebounced"] }, { kind: "component", type: PaginationComponent, selector: "wz-pagination", inputs: ["pagination"], outputs: ["pageChange"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: NumberToArray, name: "numberToArray" }], animations: [
2362
- listAnnimation
2363
- ] });
2364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MosaicViewComponent, decorators: [{
2365
- type: Component,
2366
- args: [{ selector: 'mosaic-view', animations: [
2367
- listAnnimation
2368
- ], template: "<div class=\"mosaic\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small', 'mosaic--displayPexelsImg': displayPexelsResults}\">\r\n <!-- Search section -->\r\n <div\r\n class=\"mosaic__search\"\r\n [ngClass]=\"{'mosaic__search--small': stateDisplayed === 'small'}\"\r\n *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n <wz-input-search\r\n [(ngModel)]=\"tableFilters.searchValue\"\r\n (changeDebounced)=\"onSearchChange($event)\"\r\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\r\n [smallPadding]=\"stateDisplayed === 'small'\"\r\n ></wz-input-search>\r\n </div>\r\n\r\n <!-- Cards section -->\r\n <div\r\n class=\"mosaic__container__cards\"\r\n [ngClass]=\"{'mosaic__container__cards--padding': stateDisplayed !== 'window'}\"\r\n [@listAnimation]=\"picturesList.length\"\r\n *ngIf=\"!isLoading && !displayPexelsResults\"\r\n >\r\n <img-card\r\n *ngFor=\"let picture of picturesList; let index = index; trackBy: trackById \"\r\n [picture]=\"picture\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabDisplayed\"\r\n [disable]=\"disable\"\r\n (toggleImgSelected)=\"onToggleSelectImg(index)\"\r\n (pictureNameChange)=\"onCardRenamePicture($event)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowCard()\"\r\n [fullSize]=\"fullSize\"\r\n ></img-card>\r\n <div\r\n *ngFor=\"let fakeImg of nbFakeImg | numberToArray\"\r\n class=\"mosaic__container__cards__fakeImg\"\r\n [ngClass]=\"{'mosaic__container__cards__fakeImg--smallFakeImg': stateDisplayed === 'small' || tabDisplayed === 'img-upload'}\">\r\n </div>\r\n </div>\r\n\r\n <!-- Loader section -->\r\n <div class=\"mosaic__container__loader\" *ngIf=\"isLoading\">\r\n <wz-loader [small]=\"true\"></wz-loader>\r\n </div>\r\n\r\n <!-- Pagination section -->\r\n <div class=\"mosaic__pagination\" *ngIf=\"picturesList.length && tabDisplayed !== 'img-upload' && !displayPexelsResults\" >\r\n <wz-pagination\r\n [pagination]=\"tableFilters\"\r\n (pageChange)=\"onFiltersChange()\"\r\n >\r\n </wz-pagination>\r\n </div>\r\n\r\n</div>\r\n" }]
2369
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgSelectionService }, { type: i3$1.HttpClient }, { type: ImgCDNService }, { type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: ApiService }]; }, propDecorators: { tabDisplayed: [{
2370
- type: Input
2371
- }], fullSize: [{
2372
- type: Input
2373
- }], nbFakeImg: [{
2374
- type: Input
2375
- }], switchDisplayWindow: [{
2376
- type: Output
2377
- }] } });
2378
-
2379
- class FiltersTableService {
2380
- constructor(filterRoutingBuilder) {
2381
- this.filterRoutingBuilder = filterRoutingBuilder;
2382
- this.filterGroups = new Map();
2383
- this.dataTableFilters = {
2384
- sort: undefined,
2385
- order: undefined,
2386
- searchValue: undefined,
2387
- totalItems: 0,
2388
- itemsPerPage: 0,
2389
- currentPage: 0
2390
- };
2391
- this.sortSubject = new Subject();
2392
- }
2393
- getTableFilterGroup(dataTableName) {
2394
- if (this.filterGroups.has(dataTableName)) {
2395
- return this.filterGroups.get(dataTableName);
2396
- }
2397
- const filterGroup = this.filterRoutingBuilder.group(this.dataTableFilters, dataTableName);
2398
- this.filterGroups.set(dataTableName, filterGroup);
2399
- return filterGroup;
2400
- }
2401
- /**
2402
- * Use to reset the others sorts of the table
2403
- * @param dataTableName
2404
- * @param sortName
2405
- * @param order
2406
- */
2407
- emitSortChange(dataTableName, sortName, order) {
2408
- this.sortSubject.next({ dataTableName, sortName, order });
2409
- }
2410
- getSortChangeListner() {
2411
- return this.sortSubject.asObservable();
2412
- }
2413
- setPaginationFilters(dataTableName, totalItems, itemsPerPage, currentPage) {
2414
- const filterGroup = this.getTableFilterGroup(dataTableName);
2415
- filterGroup.setValues({
2416
- itemsPerPage,
2417
- currentPage
2418
- });
2419
- }
2420
- setInitialPaginationFiltersIfNotExist(dataTableName, itemsPerPage, currentPage) {
2421
- const filterGroup = this.getTableFilterGroup(dataTableName);
2422
- filterGroup.setValues({
2423
- itemsPerPage: filterGroup.get('itemsPerPage') ? parseInt(filterGroup.get('itemsPerPage')) : itemsPerPage,
2424
- currentPage: filterGroup.get('currentPage') ? parseInt(filterGroup.get('currentPage')) : currentPage
2425
- });
2426
- }
2427
- }
2428
- FiltersTableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FiltersTableService, deps: [{ token: i1.NwbFilterRoutingBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
2429
- FiltersTableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FiltersTableService });
2430
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FiltersTableService, decorators: [{
2431
- type: Injectable
2432
- }], ctorParameters: function () { return [{ type: i1.NwbFilterRoutingBuilder }]; } });
2433
-
2434
- class CheckboxComponent {
2435
- constructor() {
2436
- this.label = '';
2437
- this.alone = false;
2438
- this.checked = false;
2439
- this.id = '';
2440
- this.disabled = false;
2441
- }
2442
- registerOnChange(fn) {
2443
- this._onChange = fn;
2444
- }
2445
- registerOnTouched(fn) {
2446
- this._onTouched = fn;
2447
- }
2448
- setDisabledState(isDisabled) {
2449
- this.disabled = isDisabled;
2450
- }
2451
- writeValue(obj) {
2452
- this.value = obj;
2453
- }
2454
- onChange(value) {
2455
- if (this._onChange) {
2456
- this._onChange(value);
2457
- }
2458
- }
2459
- }
2460
- CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2461
- CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CheckboxComponent, selector: "wz-checkbox", inputs: { label: "label", value: "value", type: "type", alone: "alone", checked: "checked", id: "id", name: "name" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }], ngImport: i0, template: "<div class=\"checkBoxField field\" [ngClass]=\"{ 'field--nowrap': type === 'column', alone: alone }\">\n <div class=\"field__row\">\n <input\n type=\"checkbox\"\n [id]=\"id\"\n class=\"is-checkradio\"\n [name]=\"name\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\"\n [checked]=\"checked\"\n (ngModelChange)=\"onChange($event)\"\n />\n <label [attr.for]=\"id\">{{ label }}</label>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None });
2462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckboxComponent, decorators: [{
2463
- type: Component,
2464
- args: [{ selector: 'wz-checkbox', encapsulation: ViewEncapsulation.None, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }], template: "<div class=\"checkBoxField field\" [ngClass]=\"{ 'field--nowrap': type === 'column', alone: alone }\">\n <div class=\"field__row\">\n <input\n type=\"checkbox\"\n [id]=\"id\"\n class=\"is-checkradio\"\n [name]=\"name\"\n [value]=\"value\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"value\"\n [checked]=\"checked\"\n (ngModelChange)=\"onChange($event)\"\n />\n <label [attr.for]=\"id\">{{ label }}</label>\n </div>\n</div>\n" }]
2465
- }], ctorParameters: function () { return []; }, propDecorators: { label: [{
2466
- type: Input
2467
- }], value: [{
2468
- type: Input
2469
- }], type: [{
2470
- type: Input
2471
- }], alone: [{
2472
- type: Input
2473
- }], checked: [{
2474
- type: Input
2475
- }], id: [{
2476
- type: Input
2477
- }], name: [{
2478
- type: Input
2479
- }] } });
2480
-
2481
- class TableComponent {
2482
- constructor(filtersTableService) {
2483
- this.filtersTableService = filtersTableService;
2484
- this.tableFiltersChange = new EventEmitter();
2485
- this.placeholder = '';
2486
- /// Input/Output of checkbox ///
2487
- /** Pass to true to display checkbox in the header table */
2488
- this.checkbox = false;
2489
- /** Emit new header checboxValue */
2490
- this.toggleAllCheckBox = new EventEmitter();
2491
- /// Input to disable section ///
2492
- /** Pass to true to hide search input */
2493
- this.disableSearch = false;
2494
- /** Pass to true to hide the pagniator */
2495
- this.disablePagniation = false;
2496
- /// Input for loader on table body ///
2497
- this.isLoading = false;
2498
- }
2499
- ngOnInit() {
2500
- this.headerCheckBoxId = v4(); // Create checkbox unique id
2501
- /* Handle routing filters */
2502
- if (this.tableRoutingName) {
2503
- this._filterGroup = this.filtersTableService.getTableFilterGroup(this.tableRoutingName);
2504
- // Performe initial fetch data
2505
- this._filterGroup.valuesChange$.next([]);
2506
- this.setTablesFilters();
2507
- // Listen to filters changes with debounced time to limit multiple api calls
2508
- this.filterGroupChangeSub = this._filterGroup.valuesChange$.subscribe(filters => {
2509
- this.setTablesFilters();
2510
- });
2511
- }
2512
- }
2513
- onToggleAllCheckBox(event) {
2514
- this.toggleAllCheckBox.emit(event.target.checked);
2515
- }
2516
- searchChange(event) {
2517
- // Reset table filters
2518
- this.tableFilters.sort = undefined;
2519
- this.tableFilters.order = undefined;
2520
- this.tableFilters.currentPage = 1;
2521
- this.tableFiltersChange.emit(this.tableFilters);
2522
- // Reset routing filters
2523
- if (this._filterGroup) {
2524
- this._filterGroup.setValues({
2525
- searchValue: this.tableFilters.searchValue,
2526
- sort: undefined,
2527
- order: undefined,
2528
- currentPage: 1
2529
- });
2530
- }
2531
- }
2532
- pageChange() {
2533
- this.tableFiltersChange.emit(this.tableFilters);
2534
- if (this._filterGroup) {
2535
- this._filterGroup.setValues({
2536
- itemsPerPage: this.tableFilters.itemsPerPage,
2537
- currentPage: this.tableFilters.currentPage
2538
- });
2539
- }
2540
- }
2541
- /**
2542
- * Set tableFilters from routing data existing in the url
2543
- * */
2544
- setTablesFilters() {
2545
- this.tableFilters = {
2546
- sort: this._filterGroup.get('sort'),
2547
- order: this._filterGroup.get('order'),
2548
- searchValue: this._filterGroup.get('searchValue'),
2549
- itemsPerPage: this._filterGroup.get('itemsPerPage') ? parseInt(this._filterGroup.get('itemsPerPage')) : 0,
2550
- currentPage: this._filterGroup.get('currentPage') ? parseInt(this._filterGroup.get('currentPage')) : 0,
2551
- totalItems: this.tableFilters.totalItems
2552
- };
2553
- this.tableFiltersChange.emit(this.tableFilters);
2554
- }
2555
- ngDestroy() {
2556
- if (this.filterGroupChangeSub) {
2557
- this.filterGroupChangeSub.unsubscribe();
2558
- }
2559
- }
2560
- }
2561
- TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, deps: [{ token: FiltersTableService }], target: i0.ɵɵFactoryTarget.Component });
2562
- TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableComponent, selector: "wz-table", inputs: { tableFilters: "tableFilters", tableRoutingName: "tableRoutingName", placeholder: "placeholder", checkbox: "checkbox", disableSearch: "disableSearch", disablePagniation: "disablePagniation", isLoading: "isLoading" }, outputs: { tableFiltersChange: "tableFiltersChange", toggleAllCheckBox: "toggleAllCheckBox" }, ngImport: i0, template: "<div class=\"wz-table\">\n <!-- Header section -->\n <div class=\"wz-table__head\" id=\"headerTable\">\n <div *ngIf=\"checkbox\" class=\"wz-table__head__cell wz-table__head__cell--checkbox\">\n <wz-checkbox [id]=\"headerCheckBoxId\" (change)=\"onToggleAllCheckBox($event)\" [alone]=\"true\"></wz-checkbox>\n </div>\n\n <!-- Header contents are added with the headerCell directive -->\n <ng-content select=\"[headerCell]\"></ng-content>\n </div>\n\n <!-- Search section -->\n <div *ngIf=\"!disableSearch\" class=\"wz-table__search\">\n <wz-input-search\n [(ngModel)]=\"tableFilters.searchValue\"\n (changeDebounced)=\"searchChange($event)\"\n [placeholder]=\"placeholder\"\n [smallPadding]=\"true\"\n ></wz-input-search>\n </div>\n\n <!-- Body section -->\n <div class=\"wz-table__body\">\n <!-- Loader on body -->\n <div class=\"wz-table__body__loader\" *ngIf=\"isLoading\">\n <wz-loader [small]=\"true\"></wz-loader>\n </div>\n <!-- Body contents are added with the tableRow directive -->\n <ng-content select=\"[tableRow]\" *ngIf=\"!isLoading\"></ng-content>\n </div>\n\n <!-- Pagination section -->\n <wz-pagination *ngIf=\"!disablePagniation\" [pagination]=\"tableFilters\" (pageChange)=\"pageChange()\"></wz-pagination>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "component", type: InputSearchComponent, selector: "wz-input-search", inputs: ["placeholder", "smallPadding", "id"], outputs: ["changeDebounced"] }, { kind: "component", type: PaginationComponent, selector: "wz-pagination", inputs: ["pagination"], outputs: ["pageChange"] }, { kind: "component", type: CheckboxComponent, selector: "wz-checkbox", inputs: ["label", "value", "type", "alone", "checked", "id", "name"] }], encapsulation: i0.ViewEncapsulation.None });
2563
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableComponent, decorators: [{
2564
- type: Component,
2565
- args: [{ selector: 'wz-table', encapsulation: ViewEncapsulation.None, template: "<div class=\"wz-table\">\n <!-- Header section -->\n <div class=\"wz-table__head\" id=\"headerTable\">\n <div *ngIf=\"checkbox\" class=\"wz-table__head__cell wz-table__head__cell--checkbox\">\n <wz-checkbox [id]=\"headerCheckBoxId\" (change)=\"onToggleAllCheckBox($event)\" [alone]=\"true\"></wz-checkbox>\n </div>\n\n <!-- Header contents are added with the headerCell directive -->\n <ng-content select=\"[headerCell]\"></ng-content>\n </div>\n\n <!-- Search section -->\n <div *ngIf=\"!disableSearch\" class=\"wz-table__search\">\n <wz-input-search\n [(ngModel)]=\"tableFilters.searchValue\"\n (changeDebounced)=\"searchChange($event)\"\n [placeholder]=\"placeholder\"\n [smallPadding]=\"true\"\n ></wz-input-search>\n </div>\n\n <!-- Body section -->\n <div class=\"wz-table__body\">\n <!-- Loader on body -->\n <div class=\"wz-table__body__loader\" *ngIf=\"isLoading\">\n <wz-loader [small]=\"true\"></wz-loader>\n </div>\n <!-- Body contents are added with the tableRow directive -->\n <ng-content select=\"[tableRow]\" *ngIf=\"!isLoading\"></ng-content>\n </div>\n\n <!-- Pagination section -->\n <wz-pagination *ngIf=\"!disablePagniation\" [pagination]=\"tableFilters\" (pageChange)=\"pageChange()\"></wz-pagination>\n</div>\n" }]
2566
- }], ctorParameters: function () { return [{ type: FiltersTableService }]; }, propDecorators: { tableFilters: [{
2567
- type: Input
2568
- }], tableFiltersChange: [{
2569
- type: Output
2570
- }], tableRoutingName: [{
2571
- type: Input
2572
- }], placeholder: [{
2573
- type: Input
2574
- }], checkbox: [{
2575
- type: Input
2576
- }], toggleAllCheckBox: [{
2577
- type: Output
2578
- }], disableSearch: [{
2579
- type: Input
2580
- }], disablePagniation: [{
2581
- type: Input
2582
- }], isLoading: [{
2583
- type: Input
2584
- }] } });
2585
-
2586
- class TableColumn {
2587
- constructor(currentCell, renderer, document) {
2588
- this.currentCell = currentCell;
2589
- this.renderer = renderer;
2590
- this.document = document;
2591
- this.centerCellValue = ['left', 'center', 'right'];
2592
- }
2593
- ngAfterViewInit() {
2594
- this.applyCustomStylesOnCell();
2595
- }
2596
- applyCustomStylesOnCell() {
2597
- this.currentCell.nativeElement.style.flexGrow = typeof this.columnSize !== 'undefined' ? this.columnSize : '1';
2598
- this.renderer.addClass(this.currentCell.nativeElement, 'wz-table__body__line__cell');
2599
- if (this.centerCell) {
2600
- if (this.centerCellValue.indexOf(this.centerCell) === -1) {
2601
- throw 'Error : The centerCell directive has no matched value. The value must be one of the following : left, center, right.';
2602
- }
2603
- let className = 'wz-table__body__line__cell--center' + '--' + this.centerCell;
2604
- this.renderer.addClass(this.currentCell.nativeElement, className);
2605
- }
2606
- }
2607
- }
2608
- TableColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableColumn, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
2609
- TableColumn.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TableColumn, selector: "[tableColumn]", inputs: { columnSize: "columnSize", centerCell: "centerCell" }, ngImport: i0 });
2610
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableColumn, decorators: [{
2611
- type: Directive,
2612
- args: [{
2613
- selector: '[tableColumn]'
2614
- }]
2615
- }], ctorParameters: function () {
2616
- return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
2617
- type: Inject,
2618
- args: [DOCUMENT]
2619
- }] }];
2620
- }, propDecorators: { columnSize: [{
2621
- type: Input,
2622
- args: ['columnSize']
2623
- }], centerCell: [{
2624
- type: Input,
2625
- args: ['centerCell']
2626
- }] } });
2627
-
2628
- class CheckBoxRow {
2629
- set checkBoxValue(value) {
2630
- this._value = value;
2631
- if (this.checkboxComponentRef) {
2632
- this.setCheckBoxValue();
2633
- }
2634
- }
2635
- get checkBoxValue() {
2636
- return this._value;
2637
- }
2638
- constructor(currentRow, appRef, renderer, document, resolver, injector) {
2639
- this.currentRow = currentRow;
2640
- this.appRef = appRef;
2641
- this.renderer = renderer;
2642
- this.document = document;
2643
- this.resolver = resolver;
2644
- this.injector = injector;
2645
- this.checkBoxValueChange = new EventEmitter();
2646
- }
2647
- ngOnInit() {
2648
- this.createCheckBoxComponent();
2649
- this.handleChecboxInputs();
2650
- this.handleCheckboxOutputs();
2651
- }
2652
- createCheckBoxComponent() {
2653
- // Create the container
2654
- const checkBoxContainer = document.createElement('div');
2655
- checkBoxContainer.className = 'wz-table__body__line__cell wz-table__body__line__cell--checkbox';
2656
- // Insert divCheckBox in the DOM as the first child of the row
2657
- this.renderer.insertBefore(this.currentRow.nativeElement, checkBoxContainer, this.currentRow.nativeElement.firstChild);
2658
- // Insert the CheckBoxComponent inside the container (DOM and Angular DOM)
2659
- this.htmlContainer = new HtmlContainer(checkBoxContainer, this.appRef, this.resolver, this.injector);
2660
- this.checkboxComponentRef = this.htmlContainer.attach(CheckboxComponent);
2661
- }
2662
- handleChecboxInputs() {
2663
- this.checkboxComponentRef.instance.id = this.checkBoxId ? this.checkBoxId : v4();
2664
- this.checkboxComponentRef.instance.name = this.checkBoxName ? this.checkBoxName : undefined;
2665
- this.checkboxComponentRef.instance.alone = true;
2666
- this.setCheckBoxValue();
2667
- }
2668
- setCheckBoxValue() {
2669
- this.checkboxComponentRef.instance.value = this.checkBoxValue;
2670
- }
2671
- handleCheckboxOutputs() {
2672
- // Detect checkbox changes
2673
- this.checkboxComponentRef.instance.registerOnChange(() => {
2674
- this._toggleCheckbox();
2675
- });
2676
- }
2677
- _toggleCheckbox() {
2678
- this.checkBoxValue = !this.checkBoxValue;
2679
- this.checkBoxValueChange.emit(this.checkBoxValue);
2680
- }
2681
- ngOnDestroy() {
2682
- this.htmlContainer.dispose();
2683
- }
2684
- }
2685
- CheckBoxRow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckBoxRow, deps: [{ token: i0.ElementRef }, { token: i0.ApplicationRef }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive });
2686
- CheckBoxRow.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: CheckBoxRow, selector: "[checkBoxRow]", inputs: { checkBoxId: "checkBoxId", checkBoxName: "checkBoxName", checkBoxValue: "checkBoxValue" }, outputs: { checkBoxValueChange: "checkBoxValueChange" }, ngImport: i0 });
2687
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CheckBoxRow, decorators: [{
2688
- type: Directive,
2689
- args: [{
2690
- selector: '[checkBoxRow]'
2691
- }]
2692
- }], ctorParameters: function () {
2693
- return [{ type: i0.ElementRef }, { type: i0.ApplicationRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
2694
- type: Inject,
2695
- args: [DOCUMENT]
2696
- }] }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }];
2697
- }, propDecorators: { checkBoxId: [{
2698
- type: Input,
2699
- args: ['checkBoxId']
2700
- }], checkBoxName: [{
2701
- type: Input,
2702
- args: ['checkBoxName']
2703
- }], checkBoxValue: [{
2704
- type: Input,
2705
- args: ['checkBoxValue']
2706
- }], checkBoxValueChange: [{
2707
- type: Output
2708
- }] } });
2709
- class HtmlContainer {
2710
- constructor(hostElement, appRef, componentFactoryResolver, injector) {
2711
- this.hostElement = hostElement;
2712
- this.appRef = appRef;
2713
- this.componentFactoryResolver = componentFactoryResolver;
2714
- this.injector = injector;
2715
- this.attached = false;
2716
- }
2717
- attach(component) {
2718
- if (this.attached) {
2719
- throw new Error('component has already been attached');
2720
- }
2721
- this.attached = true;
2722
- const childComponentFactory = this.componentFactoryResolver.resolveComponentFactory(component);
2723
- let componentRef = childComponentFactory.create(this.injector);
2724
- this.appRef.attachView(componentRef.hostView);
2725
- this.disposeFn = () => {
2726
- this.appRef.detachView(componentRef.hostView);
2727
- componentRef.destroy();
2728
- };
2729
- this.hostElement.appendChild(componentRef.hostView.rootNodes[0]);
2730
- return componentRef;
2731
- }
2732
- dispose() {
2733
- if (this.attached) {
2734
- this.disposeFn();
2735
- }
2736
- }
2737
- }
2738
-
2739
- class TableColumnHeader {
2740
- set headerName(value) {
2741
- this._headerName = value;
2742
- this.setHeaderName();
2743
- }
2744
- get headerName() {
2745
- return this._headerName;
2746
- }
2747
- constructor(currentCell, renderer, document, filtersTableService) {
2748
- this.currentCell = currentCell;
2749
- this.renderer = renderer;
2750
- this.document = document;
2751
- this.filtersTableService = filtersTableService;
2752
- this._headerName = '';
2753
- this.filterRouting = false; // Optional. Set to true to use Filter Routing.
2754
- this.onSortChange = new EventEmitter(); // Emit the sort value (true, false, undefuned) of the current sort icon when clicking
2755
- this.tableFiltersChange = new EventEmitter();
2756
- this.centerCellValue = ['left', 'center', 'right'];
2757
- this.subscriptions = [];
2758
- }
2759
- ngOnInit() {
2760
- if (this.tableName && this.sortName) {
2761
- if (this.filterRouting) {
2762
- this.handleSortRouting();
2763
- }
2764
- else {
2765
- this.handleSortBasic();
2766
- }
2767
- }
2768
- }
2769
- ngAfterViewInit() {
2770
- this.applyCustomStylesOnCell();
2771
- this.renderHeaderColumn();
2772
- }
2773
- handleSortRouting() {
2774
- this.filterGroup = this.filtersTableService.getTableFilterGroup(this.tableName);
2775
- const filterGroupChangeSub = this.filterGroup.valuesChange$.subscribe(filters => {
2776
- const filterSort = filters.filter(filter => filter.key === 'sort')[0];
2777
- if (this.sortName !== filterSort.value) {
2778
- this.resetSortIcon();
2779
- }
2780
- });
2781
- this.subscriptions.push(filterGroupChangeSub);
2782
- }
2783
- handleSortBasic() {
2784
- const sortChangeSub = this.filtersTableService.getSortChangeListner().subscribe(sort => {
2785
- if (this.tableName === sort.dataTableName && this.sortName !== sort.sortName) {
2786
- // Reset the current sort icon
2787
- this.resetSortIcon();
2788
- }
2789
- });
2790
- this.subscriptions.push(sortChangeSub);
2791
- }
2792
- resetSortIcon() {
2793
- // Replace current icon with default icon
2794
- this.contentHeader.className = this.contentHeader.className.replace(this.getCurrentSortIcon(), 'idle');
2795
- }
2796
- applyCustomStylesOnCell() {
2797
- this.currentCell.nativeElement.style.flexGrow = typeof this.columnSize !== 'undefined' ? this.columnSize : '1';
2798
- this.renderer.addClass(this.currentCell.nativeElement, 'wz-table__head__cell');
2799
- if (this.centerCell) {
2800
- if (this.centerCellValue.indexOf(this.centerCell) === -1) {
2801
- throw 'Error : The centerCell directive has no matched value. The value must be one of the following : left, center, right.';
2802
- }
2803
- let className = 'wz-table__head__cell--center' + '--' + this.centerCell;
2804
- this.renderer.addClass(this.currentCell.nativeElement, className);
2805
- }
2806
- }
2807
- renderHeaderColumn() {
2808
- this.createHeaderContent();
2809
- this.renderer.appendChild(this.currentCell.nativeElement, this.contentHeader);
2810
- }
2811
- createHeaderContent() {
2812
- this.contentHeader = document.createElement('a');
2813
- this.contentHeader.className = 'wz-table__head__cell__search';
2814
- this.setHeaderName();
2815
- if (this.tableName && this.sortName) {
2816
- this.handleSort();
2817
- }
2818
- }
2819
- setHeaderName() {
2820
- if (!this.contentHeader) {
2821
- return;
2822
- }
2823
- this.contentHeader.innerHTML = this.headerName;
2824
- }
2825
- handleSort() {
2826
- // Set icon in the header column cell
2827
- this.contentHeader.className += ' wz-table__head__cell__search--' + this.getInitialSortIcon();
2828
- // On click on the content header, change the icon and emit event
2829
- this.renderer.listen(this.contentHeader, 'click', () => {
2830
- const currentIcon = this.getCurrentSortIcon();
2831
- let newIcon;
2832
- let newSort, newOrder;
2833
- switch (currentIcon) {
2834
- case 'idle':
2835
- newIcon = 'up';
2836
- newSort = this.sortName;
2837
- newOrder = true;
2838
- break;
2839
- case 'up':
2840
- newIcon = 'down';
2841
- newSort = this.sortName;
2842
- newOrder = false;
2843
- break;
2844
- case 'down':
2845
- newIcon = 'idle';
2846
- break;
2847
- default:
2848
- newIcon = 'idle';
2849
- break;
2850
- }
2851
- // Replace the icon
2852
- this.contentHeader.className = this.contentHeader.className.replace(currentIcon, newIcon);
2853
- this.emitEvents(newSort, newOrder);
2854
- });
2855
- }
2856
- getInitialSortIcon() {
2857
- if (!this.filterRouting) {
2858
- return 'idle';
2859
- }
2860
- // Get Initial Sort Icon for Routing Filter
2861
- let initialSortIcon = 'idle';
2862
- if (this.filterGroup.get('sort') === this.sortName) {
2863
- initialSortIcon = this.filterGroup.get('order') == 'true' ? 'up' : 'down';
2864
- }
2865
- return initialSortIcon;
2866
- }
2867
- getCurrentSortIcon() {
2868
- const regexp = /wz-table__head__cell__search--(?<icon>\w+)/;
2869
- const { groups } = regexp.exec(this.contentHeader.className);
2870
- return groups.icon;
2871
- }
2872
- emitEvents(newSort, newOrder) {
2873
- if (this.filterRouting) {
2874
- // Will send the filter routing value has changes event
2875
- this.filterGroup.setValues({
2876
- sort: newSort,
2877
- order: newOrder,
2878
- currentPage: 1
2879
- });
2880
- }
2881
- else {
2882
- // Send the event sort change
2883
- this.filtersTableService.emitSortChange(this.tableName, this.sortName, newOrder);
2884
- }
2885
- if (this.tableFilters) {
2886
- this.tableFilters.sort = this.sortName;
2887
- this.tableFilters.order = newOrder;
2888
- this.tableFilters.currentPage = 1;
2889
- this.tableFiltersChange.emit(this.tableFilters);
2890
- }
2891
- this.onSortChange.emit(newOrder);
2892
- }
2893
- ngOnDestroy() {
2894
- this.subscriptions.forEach(subscription => {
2895
- subscription.unsubscribe();
2896
- });
2897
- }
2898
- }
2899
- TableColumnHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableColumnHeader, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }, { token: FiltersTableService }], target: i0.ɵɵFactoryTarget.Directive });
2900
- TableColumnHeader.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TableColumnHeader, selector: "[headerCell]", inputs: { headerName: "headerName", columnSize: "columnSize", filterRouting: "filterRouting", tableName: "tableName", sortName: "sortName", centerCell: "centerCell", tableFilters: "tableFilters" }, outputs: { onSortChange: "onSortChange", tableFiltersChange: "tableFiltersChange" }, ngImport: i0 });
2901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableColumnHeader, decorators: [{
2902
- type: Directive,
2903
- args: [{
2904
- // The selector has the same name as the headerCell selector in table.component.html
2905
- selector: '[headerCell]'
2906
- }]
2907
- }], ctorParameters: function () {
2908
- return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
2909
- type: Inject,
2910
- args: [DOCUMENT]
2911
- }] }, { type: FiltersTableService }];
2912
- }, propDecorators: { headerName: [{
2913
- type: Input,
2914
- args: ['headerName']
2915
- }], columnSize: [{
2916
- type: Input,
2917
- args: ['columnSize']
2918
- }], filterRouting: [{
2919
- type: Input,
2920
- args: ['filterRouting']
2921
- }], tableName: [{
2922
- type: Input,
2923
- args: ['tableName']
2924
- }], sortName: [{
2925
- type: Input,
2926
- args: ['sortName']
2927
- }], centerCell: [{
2928
- type: Input,
2929
- args: ['centerCell']
2930
- }], onSortChange: [{
2931
- type: Output
2932
- }], tableFilters: [{
2933
- type: Input
2934
- }], tableFiltersChange: [{
2935
- type: Output
2936
- }] } });
2937
-
2938
- class TableRow {
2939
- constructor(currentCell, renderer, document) {
2940
- this.currentCell = currentCell;
2941
- this.renderer = renderer;
2942
- this.document = document;
2943
- }
2944
- ngAfterViewInit() {
2945
- this.applyCustomStylesOnCell();
2946
- }
2947
- applyCustomStylesOnCell() {
2948
- this.renderer.addClass(this.currentCell.nativeElement, 'wz-table__body__line');
2949
- }
2950
- }
2951
- TableRow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableRow, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
2952
- TableRow.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: TableRow, selector: "[tableRow]", ngImport: i0 });
2953
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableRow, decorators: [{
2954
- type: Directive,
2955
- args: [{
2956
- // The selector has the same name as the tableRaw selector in table.component.html
2957
- selector: '[tableRow]',
2958
- }]
2959
- }], ctorParameters: function () {
2960
- return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
2961
- type: Inject,
2962
- args: [DOCUMENT]
2963
- }] }];
2964
- } });
2965
-
2966
- class TableViewComponent extends ImagesActionHandler {
2967
- constructor(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService) {
2968
- super(imgManager, imgSelectionService, http, imgCDNService, imgEventCardService, alertService, translateService, apiService);
2969
- this.dataTableName = 'imgagesView'; // Name of your table
2970
- }
2971
- ngOnInit() {
2972
- }
2973
- }
2974
- TableViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableViewComponent, deps: [{ token: ImgManagerService }, { token: ImgSelectionService }, { token: i3$1.HttpClient }, { token: ImgCDNService }, { token: ImgEventService }, { token: AlertService }, { token: i3.TranslateService }, { token: ApiService }], target: i0.ɵɵFactoryTarget.Component });
2975
- TableViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: TableViewComponent, selector: "table-view", usesInheritance: true, ngImport: i0, template: "<div class=\"table-view\" [@listAnimation]=\"picturesList.length\">\n <wz-table\n [checkbox]=\"true\"\n (toggleAllCheckBox)=\"onToggleAllCheckBoxRow($event)\"\n [(tableFilters)]=\"tableFilters\"\n (tableFiltersChange)=\"onFiltersChange()\"\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\n [disablePagniation]=\"displayPexelsResults\"\n [isLoading]=\"isLoading\"\n >\n <!-- Header Section -->\n <div\n headerCell\n [headerName]=\"'ImgManager.ImgList.titleImgName' | translate\"\n columnSize=\"2\"\n sortName=\"name\"\n ></div>\n <div\n headerCell\n centerCell=\"center\"\n [headerName]=\"'ImgManager.ImgList.titleResolution' | translate\"\n ></div>\n <div headerCell columnSize=\"0\"></div>\n\n <!-- Body Section -->\n <div\n tableRow\n checkBoxRow\n [checkBoxValue]=\"picture.delSelected\"\n (checkBoxValueChange)=\"onToggleDelSelection(index)\"\n *ngFor=\"let picture of picturesList; let index = index\"\n >\n\n <div tableColumn columnSize=\"2\">\n <div class=\"table-view__row__container\">\n <div\n class=\"table-view__row__container__imgContainer\"\n [ngClass]=\"{'imgSelected': picture.selected}\"\n (click)=\"onToggleSelectImg(index)\">\n <img\n class=\"table-view__row__container__imgContainer__img\"\n [src]=\"picture.file_name | imgSrc : '100'\"\n alt=\"picture.display_name\"\n [ngClass]=\"{'pictureDeletion': picture.deleted}\"\n (error)=\"picture.imgNotLoaded=true;onPictureNotLoading($event);\"\n />\n <!-- If the img is not loaded, or the link is broken, an icon is displayed -->\n <div\n *ngIf=\"picture.imgNotLoaded\"\n class=\"table-view__row__container__imgContainer__overlay\"\n >\n <i class=\"fad fa-folder-times\"></i>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"wzImgMngInput table-view__row__container__name\"\n [(ngModel)]=\"picture.display_name\"\n (focus)=\"previousName=picture.display_name\"\n (blur)=\"onNameChange(picture.id_file)\"\n (click)=\"onToggleDelSelection(index)\"\n [ngClass]=\"{'desabled': picture.deleted}\"\n [disabled]=\"picture.deleted\"\n >\n </div>\n </div>\n\n <div\n tableColumn\n centerCell=\"center\"\n (click)=\"onToggleDelSelection(index)\"\n >\n <p class=\"grey\">{{picture.raw_height}}x{{picture.raw_width}}</p>\n </div>\n\n <div tableColumn centerCell=\"center\" columnSize=\"0\" class=\"table-view__dropdown-options\">\n <!-- Dropdown -->\n <dropdown dropdownId=\"dropdown-options\" [disable]=\"picture.deleted\">\n <ng-container label>\n <div class=\"table-view__dropdown-options__label rotate\">\n <span> <i class=\"far fa-ellipsis-h is-size-4\" aria-haspopup=\"true\" aria-controls=\"dropdown-menu\"> </i> </span>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onDownloadImg(picture.display_name, picture.file_name)\"\n >\n <i class=\"far fa-download download\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.download' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onEdit(picture)\"\n >\n <i class=\"far fa-crop-alt edit\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.edit' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onRemoveImg(picture)\"\n >\n <i class=\"fal fa-times deleted\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.remove' | translate }}</p>\n </div>\n </ng-container>\n </dropdown>\n </div>\n </div>\n </wz-table>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["dropDownMenuClass", "disable"] }, { kind: "component", type: TableComponent, selector: "wz-table", inputs: ["tableFilters", "tableRoutingName", "placeholder", "checkbox", "disableSearch", "disablePagniation", "isLoading"], outputs: ["tableFiltersChange", "toggleAllCheckBox"] }, { kind: "directive", type: TableColumn, selector: "[tableColumn]", inputs: ["columnSize", "centerCell"] }, { kind: "directive", type: CheckBoxRow, selector: "[checkBoxRow]", inputs: ["checkBoxId", "checkBoxName", "checkBoxValue"], outputs: ["checkBoxValueChange"] }, { kind: "directive", type: TableColumnHeader, selector: "[headerCell]", inputs: ["headerName", "columnSize", "filterRouting", "tableName", "sortName", "centerCell", "tableFilters"], outputs: ["onSortChange", "tableFiltersChange"] }, { kind: "directive", type: TableRow, selector: "[tableRow]" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: ImageSrcPipe, name: "imgSrc" }], animations: [
2976
- listAnnimation
2977
- ] });
2978
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TableViewComponent, decorators: [{
2979
- type: Component,
2980
- args: [{ selector: 'table-view', animations: [
2981
- listAnnimation
2982
- ], template: "<div class=\"table-view\" [@listAnimation]=\"picturesList.length\">\n <wz-table\n [checkbox]=\"true\"\n (toggleAllCheckBox)=\"onToggleAllCheckBoxRow($event)\"\n [(tableFilters)]=\"tableFilters\"\n (tableFiltersChange)=\"onFiltersChange()\"\n [placeholder]=\"'ImgManager.SearchBar.placeholder' | translate\"\n [disablePagniation]=\"displayPexelsResults\"\n [isLoading]=\"isLoading\"\n >\n <!-- Header Section -->\n <div\n headerCell\n [headerName]=\"'ImgManager.ImgList.titleImgName' | translate\"\n columnSize=\"2\"\n sortName=\"name\"\n ></div>\n <div\n headerCell\n centerCell=\"center\"\n [headerName]=\"'ImgManager.ImgList.titleResolution' | translate\"\n ></div>\n <div headerCell columnSize=\"0\"></div>\n\n <!-- Body Section -->\n <div\n tableRow\n checkBoxRow\n [checkBoxValue]=\"picture.delSelected\"\n (checkBoxValueChange)=\"onToggleDelSelection(index)\"\n *ngFor=\"let picture of picturesList; let index = index\"\n >\n\n <div tableColumn columnSize=\"2\">\n <div class=\"table-view__row__container\">\n <div\n class=\"table-view__row__container__imgContainer\"\n [ngClass]=\"{'imgSelected': picture.selected}\"\n (click)=\"onToggleSelectImg(index)\">\n <img\n class=\"table-view__row__container__imgContainer__img\"\n [src]=\"picture.file_name | imgSrc : '100'\"\n alt=\"picture.display_name\"\n [ngClass]=\"{'pictureDeletion': picture.deleted}\"\n (error)=\"picture.imgNotLoaded=true;onPictureNotLoading($event);\"\n />\n <!-- If the img is not loaded, or the link is broken, an icon is displayed -->\n <div\n *ngIf=\"picture.imgNotLoaded\"\n class=\"table-view__row__container__imgContainer__overlay\"\n >\n <i class=\"fad fa-folder-times\"></i>\n </div>\n </div>\n <input\n type=\"text\"\n class=\"wzImgMngInput table-view__row__container__name\"\n [(ngModel)]=\"picture.display_name\"\n (focus)=\"previousName=picture.display_name\"\n (blur)=\"onNameChange(picture.id_file)\"\n (click)=\"onToggleDelSelection(index)\"\n [ngClass]=\"{'desabled': picture.deleted}\"\n [disabled]=\"picture.deleted\"\n >\n </div>\n </div>\n\n <div\n tableColumn\n centerCell=\"center\"\n (click)=\"onToggleDelSelection(index)\"\n >\n <p class=\"grey\">{{picture.raw_height}}x{{picture.raw_width}}</p>\n </div>\n\n <div tableColumn centerCell=\"center\" columnSize=\"0\" class=\"table-view__dropdown-options\">\n <!-- Dropdown -->\n <dropdown dropdownId=\"dropdown-options\" [disable]=\"picture.deleted\">\n <ng-container label>\n <div class=\"table-view__dropdown-options__label rotate\">\n <span> <i class=\"far fa-ellipsis-h is-size-4\" aria-haspopup=\"true\" aria-controls=\"dropdown-menu\"> </i> </span>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onDownloadImg(picture.display_name, picture.file_name)\"\n >\n <i class=\"far fa-download download\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.download' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onEdit(picture)\"\n >\n <i class=\"far fa-crop-alt edit\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.edit' | translate }}</p>\n </div>\n </ng-container>\n <ng-container item>\n <div\n class=\"dropdown-item\"\n (click)=\"onRemoveImg(picture)\"\n >\n <i class=\"fal fa-times deleted\"></i>&nbsp;\n <p>{{ 'ImgManager.ImgList.remove' | translate }}</p>\n </div>\n </ng-container>\n </dropdown>\n </div>\n </div>\n </wz-table>\n</div>\n" }]
2983
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgSelectionService }, { type: i3$1.HttpClient }, { type: ImgCDNService }, { type: ImgEventService }, { type: AlertService }, { type: i3.TranslateService }, { type: ApiService }]; } });
2984
-
2985
- class ImagesViewComponent {
2986
- get searchImagesParameters$() {
2987
- return this.imgManager.searchImagesParameters$;
2988
- }
2989
- constructor(imgManager, imgEventService, imgSelectionService, alertService, userSettingsService, renamePictureService, changeDetectorRef) {
2990
- this.imgManager = imgManager;
2991
- this.imgEventService = imgEventService;
2992
- this.imgSelectionService = imgSelectionService;
2993
- this.alertService = alertService;
2994
- this.userSettingsService = userSettingsService;
2995
- this.renamePictureService = renamePictureService;
2996
- this.changeDetectorRef = changeDetectorRef;
2997
- this.listDisplayed = false; // Display format list or mosaic
2998
- this.multipleImgMode = false;
2999
- this.switchDisplayWindow = new EventEmitter();
3000
- this.widthLargeCard = 219; // Default value of a card width 199 + margin 20
3001
- this.widthSmallCard = 160; // Default value of a card width 140 + margin 20
3002
- this.nbFakeImg = 0;
3003
- this.imgFullWidthConfig = [
3004
- {
3005
- max: 419,
3006
- largeImgWidthFactor: 1,
3007
- smallImgWidthFactor: 0.5
3008
- },
3009
- {
3010
- max: 499,
3011
- largeImgWidthFactor: 1,
3012
- smallImgWidthFactor: 0.5
3013
- },
3014
- {
3015
- max: 719,
3016
- largeImgWidthFactor: 0.5,
3017
- smallImgWidthFactor: 0.3333
3018
- },
3019
- {
3020
- max: 1023,
3021
- largeImgWidthFactor: 0.3333,
3022
- smallImgWidthFactor: 0.2
3023
- },
3024
- {
3025
- max: 1399,
3026
- largeImgWidthFactor: 0.25,
3027
- smallImgWidthFactor: 0.125
3028
- },
3029
- {
3030
- max: 1599,
3031
- largeImgWidthFactor: 0.2,
3032
- smallImgWidthFactor: 0.1111
3033
- },
3034
- {
3035
- largeImgWidthFactor: 0.1666,
3036
- smallImgWidthFactor: 0.1
3037
- }
3038
- ];
3039
- this.imgWidthConfig = [
3040
- {
3041
- max: 1024,
3042
- largeImgWidthFactor: 0.25,
3043
- smallImgWidthFactor: 0.125
3044
- },
3045
- {
3046
- max: 1199,
3047
- largeImgWidthFactor: 0.3333,
3048
- smallImgWidthFactor: 0.2
3049
- },
3050
- {
3051
- max: 1299,
3052
- largeImgWidthFactor: 0.3333,
3053
- smallImgWidthFactor: 0.1666
3054
- },
3055
- {
3056
- max: 1399,
3057
- largeImgWidthFactor: 0.25,
3058
- smallImgWidthFactor: 0.1666
3059
- },
3060
- {
3061
- max: 1599,
3062
- largeImgWidthFactor: 0.25,
3063
- smallImgWidthFactor: 0.14
3064
- },
3065
- {
3066
- largeImgWidthFactor: 0.25,
3067
- smallImgWidthFactor: 0.125
3068
- }
3069
- ];
3070
- this.nbImgToDelSelected = 0;
3071
- this.disable = false; // Use to disable action during server request
3072
- this.delListImgLoader = false;
3073
- this.initComponent = true;
3074
- this.failLoaded = false;
3075
- this.confirmImgSup = false;
3076
- this.errorGetAllImg = 'ImgManager.ImgLib.errorGetAllImg';
3077
- this.errorGetTotalImg = 'ImgManager.ImgLib.errorGetTotalImg';
3078
- this.errorGetImg = 'ImgManager.ImgLib.errorGetCanvaImg';
3079
- this.errorRemoveImg = 'ImgManager.ImgList.errorRemoveImg';
3080
- this.destroy$ = new Subject();
3081
- this.vm$ = combineLatest({
3082
- imageSelection: this.imgSelectionService.imgSelection$,
3083
- imageListData: this.imgManager.imageList$,
3084
- isLoading: this.imgManager.isLoading$,
3085
- searchImagesParameters: this.imgManager.searchImagesParameters$,
3086
- }).pipe(map(({ imageSelection, imageListData: { imageList, imageTotal }, isLoading, searchImagesParameters }) => {
3087
- this.initVariables(true);
3088
- this.calculateNbImgFake(imageList.data.length);
3089
- const picturesList = this.setSelectedProperty(imageSelection, imageList.data);
3090
- this.renamePictureService.setPicturesList(picturesList);
3091
- const tableFilters = this.getTableFilters(searchImagesParameters, imageTotal);
3092
- const keepImagesDisplayed = (this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1') || (this.tabDisplayed === 'images-view' && imageList.data.length && searchImagesParameters.page === '1');
3093
- const skipSetImagesToDisplay = !!(picturesList === null || picturesList === void 0 ? void 0 : picturesList.length) && this.tabDisplayed === 'img-upload' && searchImagesParameters.page === '1';
3094
- const hideUntilFetchedFirstPageImagesForTabUpload = this.tabDisplayed === 'img-upload' && (searchImagesParameters.page !== '1' || (imageList === null || imageList === void 0 ? void 0 : imageList.page) !== 1);
3095
- return {
3096
- isLoading: hideUntilFetchedFirstPageImagesForTabUpload || !keepImagesDisplayed && isLoading,
3097
- displayPexelsResults: !isLoading && imageTotal === 0,
3098
- picturesList,
3099
- imageTotal,
3100
- tableFilters,
3101
- skipSetImagesToDisplay
3102
- };
3103
- }));
3104
- }
3105
- getTableFilters(searchImagesParameters, imageTotal) {
3106
- return {
3107
- sort: undefined,
3108
- order: undefined,
3109
- searchValue: searchImagesParameters.search,
3110
- totalItems: imageTotal,
3111
- itemsPerPage: parseInt(searchImagesParameters.limit),
3112
- currentPage: parseInt(searchImagesParameters.page)
3113
- };
3114
- }
3115
- ngAfterViewInit() {
3116
- this.vm$.pipe(take(1), filter(({ skipSetImagesToDisplay }) => !skipSetImagesToDisplay)).subscribe(({ tableFilters }) => {
3117
- this.setNbImgToDisplay(tableFilters);
3118
- });
3119
- }
3120
- /**
3121
- * true : go to list display
3122
- * false : go to mosaic display
3123
- * @param activate
3124
- */
3125
- onSwitchFormatDisplayed(activate) {
3126
- this.listDisplayed = activate;
3127
- this.userSettingsService.setUserDisplayPreference(activate);
3128
- this.imgEventService.emitlistDisplayedChange(activate);
3129
- }
3130
- /**
3131
- * Calcul the number of img selected for masse deletion
3132
- */
3133
- onImgSelected(picturesList) {
3134
- this.setNbImgToDelSelected(picturesList);
3135
- }
3136
- onRenamePicture(pictureRenamed) {
3137
- this.renamePictureService.renamePicture(pictureRenamed);
3138
- }
3139
- removeListImg(picturesList) {
3140
- if (this.disable) {
3141
- return;
3142
- }
3143
- this.disable = true;
3144
- this.delListImgLoader = true;
3145
- this.confirmImgSup = false;
3146
- // Get the id of the img to remove
3147
- // And add deleted property
3148
- const idImgToRemove = [];
3149
- picturesList.forEach(img => {
3150
- if (img.delSelected) {
3151
- img.deleted = true;
3152
- idImgToRemove.push(img.id_file);
3153
- }
3154
- });
3155
- this.imgManager.removeMultipleImg(idImgToRemove).subscribe({
3156
- next: () => {
3157
- this.imgSelectionService.removeImgSelectionByIds(idImgToRemove);
3158
- },
3159
- error: error => {
3160
- this.imgManager.refreshImageList$.next();
3161
- this.alertService.openAlert(this.errorRemoveImg);
3162
- }
3163
- });
3164
- }
3165
- selectImgChosen(picturesList) {
3166
- if (this.disable) {
3167
- return;
3168
- }
3169
- const picturesListSelected = [];
3170
- picturesList.map(img => {
3171
- if (img.delSelected) {
3172
- img.delSelected = false;
3173
- img.selected = true;
3174
- }
3175
- if (img.selected) {
3176
- picturesListSelected.push(img);
3177
- }
3178
- });
3179
- this.setNbImgToDelSelected(picturesList);
3180
- this.imgSelectionService.setImgSelection(picturesListSelected);
3181
- }
3182
- displayConfirmImgSup() {
3183
- if (this.disable) {
3184
- return;
3185
- }
3186
- this.confirmImgSup = true;
3187
- }
3188
- cancelSup() {
3189
- this.confirmImgSup = false;
3190
- }
3191
- /**
3192
- * Event emit when a img selected in order to delete
3193
- */
3194
- onPicturesListChange(picturesList) {
3195
- this.setNbImgToDelSelected(picturesList);
3196
- }
3197
- /**
3198
- * Set default number of img per page to display at the initialisation
3199
- * This number is between 30 and 50
3200
- */
3201
- setNbImgToDisplay(tableFilters) {
3202
- const containerWidth = this.imgLibContainer.nativeElement.offsetWidth + 30; // + 30px -> left + right margin
3203
- const scrollWidth = window.innerWidth - document.body.offsetWidth;
3204
- const [maxImgWidthFactor, minImgWidthFactor] = this.getImgWidthFactors();
3205
- const minImgWidth = Math.floor(containerWidth * minImgWidthFactor);
3206
- const maxImgWidth = Math.ceil((containerWidth + scrollWidth) * maxImgWidthFactor);
3207
- this.nbMaxImgPerLine = Math.floor(containerWidth / minImgWidth);
3208
- this.nbMinImgPerLine = Math.floor((containerWidth + scrollWidth) / maxImgWidth);
3209
- this.searchImagesParameters$.next(this.getParams(Object.assign(Object.assign({}, tableFilters), { itemsPerPage: this.getTotalImgPerPage(), currentPage: 1 })));
3210
- }
3211
- getImgWidthFactors() {
3212
- const screenWidth = window.innerWidth;
3213
- let minWidth = 0;
3214
- let imgSizesConfig = [];
3215
- const currentImgWidthConfig = this.fullSize ? this.imgFullWidthConfig : this.imgWidthConfig;
3216
- for (const widthConfig of currentImgWidthConfig) {
3217
- if (!widthConfig.max) {
3218
- imgSizesConfig = [widthConfig.largeImgWidthFactor, widthConfig.smallImgWidthFactor];
3219
- break;
3220
- }
3221
- if (minWidth < screenWidth && screenWidth <= widthConfig.max) {
3222
- imgSizesConfig = [widthConfig.largeImgWidthFactor, widthConfig.smallImgWidthFactor];
3223
- break;
3224
- }
3225
- minWidth = widthConfig.max;
3226
- }
3227
- return imgSizesConfig;
3228
- }
3229
- getTotalImgPerPage() {
3230
- if (this.nbRowToShow) {
3231
- const nbImgPerLine = this.stateDisplayed === 'full' ? this.nbMinImgPerLine : this.nbMaxImgPerLine;
3232
- return nbImgPerLine * this.nbRowToShow;
3233
- }
3234
- let total = this.nbMinImgPerLine;
3235
- while (total < 30 || total % this.nbMaxImgPerLine !== 0 || total % this.nbMinImgPerLine !== 0) {
3236
- total += this.nbMinImgPerLine;
3237
- }
3238
- return total;
3239
- }
3240
- getParams(tableFilters) {
3241
- return Object.assign({ limit: tableFilters.itemsPerPage.toString(), page: tableFilters.currentPage.toString() }, (tableFilters.searchValue && { search: tableFilters.searchValue.toString() }));
3242
- }
3243
- initVariables(loadingSuccess) {
3244
- this.nbImgToDelSelected = 0;
3245
- this.disable = false;
3246
- this.delListImgLoader = false;
3247
- this.initComponent = false;
3248
- this.failLoaded = !loadingSuccess;
3249
- this.nbFakeImg = 0;
3250
- }
3251
- setSelectedProperty(imgSelectedList, picturesList) {
3252
- const picturesListSelected = JSON.parse(JSON.stringify(picturesList));
3253
- imgSelectedList.forEach(img => {
3254
- const selectedImg = picturesListSelected.find(picture => picture.id_file === img.id_file);
3255
- if (selectedImg) {
3256
- selectedImg.selected = true;
3257
- }
3258
- });
3259
- return picturesListSelected;
3260
- }
3261
- /**
3262
- * Set a img list in order to fill properly all the line of images displayed in mosaic.
3263
- * Otherwise, the space-between css will do a bad display
3264
- */
3265
- calculateNbImgFake(nbImgDisplayed) {
3266
- const nbImgPerLine = this.stateDisplayed === 'small' || this.tabDisplayed === 'img-upload' ? this.nbMaxImgPerLine : this.nbMinImgPerLine;
3267
- if (isNaN(nbImgDisplayed % nbImgPerLine)) {
3268
- this.nbFakeImg = 0;
3269
- return;
3270
- }
3271
- if (nbImgDisplayed % nbImgPerLine !== 0) {
3272
- setTimeout(() => {
3273
- this.nbFakeImg = nbImgPerLine - nbImgDisplayed % nbImgPerLine;
3274
- }, 0);
3275
- }
3276
- }
3277
- setNbImgToDelSelected(picturesList) {
3278
- this.nbImgToDelSelected = picturesList.filter(img => img.delSelected).length;
3279
- if (!this.nbImgToDelSelected) {
3280
- this.confirmImgSup = false;
3281
- }
3282
- }
3283
- switchDisplayWindowMosaic() {
3284
- this.switchDisplayWindow.emit(true);
3285
- }
3286
- ngOnDestroy() {
3287
- this.destroy$.next();
3288
- this.destroy$.complete();
3289
- }
3290
- }
3291
- ImagesViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImagesViewComponent, deps: [{ token: ImgManagerService }, { token: ImgEventService }, { token: ImgSelectionService }, { token: AlertService }, { token: UserSettingsService }, { token: RenamePictureService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
3292
- ImagesViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImagesViewComponent, selector: "images-view", inputs: { stateDisplayed: "stateDisplayed", tabDisplayed: "tabDisplayed", fullSize: "fullSize", nbRowToShow: "nbRowToShow", listDisplayed: "listDisplayed", multipleImgMode: "multipleImgMode" }, outputs: { switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgLibContainer", first: true, predicate: ["imgLibContainer"], descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n\r\n <div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\r\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\r\n <div\r\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\r\n class=\"images-view__container\"\r\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\r\n >\r\n\r\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': vm.displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{vm.imageTotal}}</p>\r\n </div>\r\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\r\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\r\n </div>\r\n\r\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n\r\n <!-- For listforma : Display btn del multiple img & Confirm action -->\r\n <div class=\"images-view__container__boxAction\">\r\n\r\n\r\n <!-- Select -->\r\n <button\r\n class=\"button success images-view__container__boxAction__import\"\r\n @insertRemoveAnnim\r\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\r\n (click)=\"selectImgChosen(vm.picturesList)\"\r\n type=\"button\"\r\n >\r\n <i class=\"fal fa-check\"></i>\r\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\r\n </button>\r\n\r\n <!-- Display btn del multiple img -->\r\n <button\r\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\r\n (click)=\"displayConfirmImgSup()\"\r\n class=\"button images-view__container__boxAction__delBtn danger\"\r\n @insertRemoveAnnim\r\n type=\"button\"\r\n >\r\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\r\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\r\n </button>\r\n\r\n <!-- Confirm action -->\r\n <div\r\n class=\"images-view__container__boxAction__confirmSup\"\r\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\r\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\r\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\r\n <div>\r\n <button\r\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\r\n (click)=\"cancelSup()\"\r\n type=\"button\"\r\n >\r\n {{ 'ImgManager.ImgLib.cancel' | translate }}\r\n </button>\r\n <button\r\n (click)=\"removeListImg(vm.picturesList)\"\r\n class=\"button images-view__container__delBtn danger\"\r\n type=\"button\"\r\n >\r\n {{ 'ImgManager.ImgLib.confirm' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <!-- Swith mosaic/list forma -->\r\n <div class=\"field has-addons images-view__container__buttonBox\">\r\n <div class=\"control\">\r\n <div\r\n class=\"button is-lighted images-view__container__buttonBox__btn\"\r\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\r\n (click)=\"onSwitchFormatDisplayed(false)\"\r\n >\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-th\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"control\">\r\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\r\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\r\n (click)=\"onSwitchFormatDisplayed(true)\"\r\n >\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-bars\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Images section -->\r\n <ng-scrollbar\r\n class=\"images-view__scroll\"\r\n [ngClass]=\"{\r\n 'images-view__scroll--hide--mosaic': vm.displayPexelsResults && !listDisplayed,\r\n 'images-view__scroll--hide--table': vm.displayPexelsResults && listDisplayed,\r\n 'images-view__scroll--full': stateDisplayed === 'full',\r\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\r\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\r\n 'images-view__scroll--window': stateDisplayed === 'window'\r\n }\"\r\n >\r\n <div #imgLibContainer class=\"images-view__wrapper\">\r\n\r\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\r\n <mosaic-view\r\n [picturesList]=\"vm.picturesList\"\r\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\r\n [tableFilters]=\"vm.tableFilters\"\r\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\r\n [(disable)]=\"disable\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\r\n [nbFakeImg]=\"nbFakeImg\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabDisplayed\"\r\n [displayPexelsResults]=\"vm.displayPexelsResults\"\r\n [isLoading]=\"vm.isLoading\"\r\n [fullSize]=\"fullSize\"\r\n >\r\n </mosaic-view>\r\n </div>\r\n\r\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\r\n <table-view\r\n [picturesList]=\"vm.picturesList\"\r\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\r\n [tableFilters]=\"vm.tableFilters\"\r\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\r\n [(disable)]=\"disable\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n [displayPexelsResults]=\"vm.displayPexelsResults\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [isLoading]=\"vm.isLoading\"\r\n >\r\n </table-view>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n\r\n <!-- Pexels Section - When no img found -->\r\n <div\r\n *ngIf=\"vm.displayPexelsResults\"\r\n class=\"images-view--pexels\"\r\n [@easeInOut]=\"'in'\">\r\n <pexels-lib\r\n [searchValue]=\"vm.tableFilters.searchValue\"\r\n [disableSearch]=\"true\"\r\n >\r\n </pexels-lib>\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"] }, { kind: "component", type: MosaicViewComponent, selector: "mosaic-view", inputs: ["tabDisplayed", "fullSize", "nbFakeImg"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: TableViewComponent, selector: "table-view" }, { kind: "directive", type: LoadingDirective, selector: "[btnLoadingAnim]" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], animations: [
3293
- easeInOut,
3294
- insertRemove
3295
- ] });
3296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImagesViewComponent, decorators: [{
3297
- type: Component,
3298
- args: [{ selector: 'images-view', animations: [
3299
- easeInOut,
3300
- insertRemove
3301
- ], template: "<ng-container *ngIf=\"vm$ | async as vm\">\r\n\r\n <div class=\"images-view\" [ngClass]=\"{'fullSize': fullSize, 'small': stateDisplayed === 'small'}\" [@easeInOut]=\"'in'\">\r\n <!-- Subheader : Img number and actions btn (sup img list, switch forma display) -->\r\n <div\r\n *ngIf=\"(stateDisplayed !== 'small' || tabDisplayed === 'img-upload')\"\r\n class=\"images-view__container\"\r\n [ngClass]=\"{'images-view__container--uploadTab': tabDisplayed === 'img-upload', 'images-view__container--window': stateDisplayed === 'window'}\"\r\n >\r\n\r\n <div *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n <p class=\"mainColor\" [ngClass]=\"{'images-view__container__total--hide': vm.displayPexelsResults}\">{{ 'ImgManager.ImgLib.nbImg' | translate }} : {{vm.imageTotal}}</p>\r\n </div>\r\n <div *ngIf=\"tabDisplayed === 'img-upload'\">\r\n <p class=\"mainColor\">{{ 'ImgManager.ImgLib.lastImgs' | translate }}</p>\r\n </div>\r\n\r\n <div class=\"field has-addons subHeaderActions\" *ngIf=\"tabDisplayed !== 'img-upload'\">\r\n\r\n <!-- For listforma : Display btn del multiple img & Confirm action -->\r\n <div class=\"images-view__container__boxAction\">\r\n\r\n\r\n <!-- Select -->\r\n <button\r\n class=\"button success images-view__container__boxAction__import\"\r\n @insertRemoveAnnim\r\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup && !delListImgLoader && multipleImgMode\"\r\n (click)=\"selectImgChosen(vm.picturesList)\"\r\n type=\"button\"\r\n >\r\n <i class=\"fal fa-check\"></i>\r\n {{ 'ImgManager.ImgLib.select' | translate }} ({{nbImgToDelSelected}})\r\n </button>\r\n\r\n <!-- Display btn del multiple img -->\r\n <button\r\n *ngIf=\"listDisplayed && nbImgToDelSelected && !confirmImgSup\"\r\n (click)=\"displayConfirmImgSup()\"\r\n class=\"button images-view__container__boxAction__delBtn danger\"\r\n @insertRemoveAnnim\r\n type=\"button\"\r\n >\r\n <i class=\"fal fa-times\"></i>{{ 'ImgManager.ImgLib.delMlt' | translate }} ({{nbImgToDelSelected}})\r\n <span btnLoadingAnim *ngIf=\"delListImgLoader\" class=\"btnLoadingAnnimation\"></span>\r\n </button>\r\n\r\n <!-- Confirm action -->\r\n <div\r\n class=\"images-view__container__boxAction__confirmSup\"\r\n [ngClass]=\"{'images-view__container__boxAction__confirmSup--visible': confirmImgSup}\">\r\n <p *ngIf=\"nbImgToDelSelected > 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestions' | translate:{nbImage: nbImgToDelSelected} }}</p>\r\n <p *ngIf=\"nbImgToDelSelected === 1\" class=\"images-view__container__boxAction__confirmSup__text\">{{ 'ImgManager.ImgLib.confirmSupQuestion' | translate:{nbImage: nbImgToDelSelected} }}</p>\r\n <div>\r\n <button\r\n class=\"button images-view__container__boxAction__confirmSup__cancel\"\r\n (click)=\"cancelSup()\"\r\n type=\"button\"\r\n >\r\n {{ 'ImgManager.ImgLib.cancel' | translate }}\r\n </button>\r\n <button\r\n (click)=\"removeListImg(vm.picturesList)\"\r\n class=\"button images-view__container__delBtn danger\"\r\n type=\"button\"\r\n >\r\n {{ 'ImgManager.ImgLib.confirm' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n <!-- Swith mosaic/list forma -->\r\n <div class=\"field has-addons images-view__container__buttonBox\">\r\n <div class=\"control\">\r\n <div\r\n class=\"button is-lighted images-view__container__buttonBox__btn\"\r\n [ngClass]=\"{'actifDisplayed': !listDisplayed}\"\r\n (click)=\"onSwitchFormatDisplayed(false)\"\r\n >\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-th\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <div class=\"control\">\r\n <div class=\"button is-lighted images-view__container__buttonBox__btn\"\r\n [ngClass]=\"{'actifDisplayed': listDisplayed}\"\r\n (click)=\"onSwitchFormatDisplayed(true)\"\r\n >\r\n <span class=\"icon is-small\">\r\n <i class=\"fa-solid fa-bars\"></i>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <!-- Images section -->\r\n <ng-scrollbar\r\n class=\"images-view__scroll\"\r\n [ngClass]=\"{\r\n 'images-view__scroll--hide--mosaic': vm.displayPexelsResults && !listDisplayed,\r\n 'images-view__scroll--hide--table': vm.displayPexelsResults && listDisplayed,\r\n 'images-view__scroll--full': stateDisplayed === 'full',\r\n 'images-view__scroll--smallDisplay' : stateDisplayed === 'small' && tabDisplayed !== 'img-upload',\r\n 'images-view__scroll--smallUploadDisplay' : stateDisplayed === 'small' && tabDisplayed === 'img-upload',\r\n 'images-view__scroll--window': stateDisplayed === 'window'\r\n }\"\r\n >\r\n <div #imgLibContainer class=\"images-view__wrapper\">\r\n\r\n <div *ngIf=\"!listDisplayed || stateDisplayed === 'small'\" [@easeInOut]=\"'in'\">\r\n <mosaic-view\r\n [picturesList]=\"vm.picturesList\"\r\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\r\n [tableFilters]=\"vm.tableFilters\"\r\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\r\n [(disable)]=\"disable\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n (switchDisplayWindow)=\"switchDisplayWindowMosaic()\"\r\n [nbFakeImg]=\"nbFakeImg\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabDisplayed\"\r\n [displayPexelsResults]=\"vm.displayPexelsResults\"\r\n [isLoading]=\"vm.isLoading\"\r\n [fullSize]=\"fullSize\"\r\n >\r\n </mosaic-view>\r\n </div>\r\n\r\n <div *ngIf=\"listDisplayed && stateDisplayed !== 'small'\" [@easeInOut]=\"'in'\">\r\n <table-view\r\n [picturesList]=\"vm.picturesList\"\r\n (picturesListChange)=\"onPicturesListChange(vm.picturesList)\"\r\n [tableFilters]=\"vm.tableFilters\"\r\n (filtersChange)=\"searchImagesParameters$.next(getParams(vm.tableFilters));\"\r\n [(disable)]=\"disable\"\r\n (pictureNameChange)=\"onRenamePicture($event)\"\r\n [displayPexelsResults]=\"vm.displayPexelsResults\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [isLoading]=\"vm.isLoading\"\r\n >\r\n </table-view>\r\n </div>\r\n </div>\r\n </ng-scrollbar>\r\n\r\n <!-- Pexels Section - When no img found -->\r\n <div\r\n *ngIf=\"vm.displayPexelsResults\"\r\n class=\"images-view--pexels\"\r\n [@easeInOut]=\"'in'\">\r\n <pexels-lib\r\n [searchValue]=\"vm.tableFilters.searchValue\"\r\n [disableSearch]=\"true\"\r\n >\r\n </pexels-lib>\r\n </div>\r\n</ng-container>\r\n" }]
3302
- }], ctorParameters: function () { return [{ type: ImgManagerService }, { type: ImgEventService }, { type: ImgSelectionService }, { type: AlertService }, { type: UserSettingsService }, { type: RenamePictureService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { stateDisplayed: [{
3303
- type: Input
3304
- }], tabDisplayed: [{
3305
- type: Input
3306
- }], fullSize: [{
3307
- type: Input
3308
- }], nbRowToShow: [{
3309
- type: Input
3310
- }], listDisplayed: [{
3311
- type: Input
3312
- }], multipleImgMode: [{
3313
- type: Input
3314
- }], switchDisplayWindow: [{
3315
- type: Output
3316
- }], imgLibContainer: [{
3317
- type: ViewChild,
3318
- args: ['imgLibContainer']
3319
- }] } });
3320
-
3321
- class ZindexToggleDirective {
3322
- set isActive(value) {
3323
- this.isActived = value;
3324
- this.switchToggle();
3325
- }
3326
- get isActive() {
3327
- return this.isActived;
3328
- }
3329
- constructor(currentElement, renderer) {
3330
- this.currentElement = currentElement;
3331
- this.renderer = renderer;
3332
- this.isActived = false;
3333
- }
3334
- ngOnInit() {
3335
- }
3336
- switchToggle() {
3337
- if (this.isActived) {
3338
- this.renderer.addClass(this.currentElement.nativeElement.parentElement.parentNode, 'zindexToggle');
3339
- }
3340
- else {
3341
- this.renderer.removeClass(this.currentElement.nativeElement.parentElement.parentNode, 'zindexToggle');
3342
- }
3343
- }
3344
- ngOnDestroy() {
3345
- }
3346
- }
3347
- ZindexToggleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ZindexToggleDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
3348
- ZindexToggleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: { isActive: ["zIndexToggle", "isActive"] }, outputs: { onEventChange: "onEventChange" }, ngImport: i0 });
3349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ZindexToggleDirective, decorators: [{
3350
- type: Directive,
3351
- args: [{
3352
- selector: '[zIndexToggle]'
3353
- }]
3354
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onEventChange: [{
3355
- type: Output
3356
- }], isActive: [{
3357
- type: Input,
3358
- args: ['zIndexToggle']
3359
- }] } });
3360
-
3361
- class SelectFiltersPipe {
3362
- transform(items, filterName) {
3363
- return items.filter(item => {
3364
- const regexp = new RegExp(filterName, 'i');
3365
- return regexp.test(item.name);
3366
- });
3367
- }
3368
- }
3369
- SelectFiltersPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectFiltersPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3370
- SelectFiltersPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SelectFiltersPipe, name: "selectFilters" });
3371
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectFiltersPipe, decorators: [{
3372
- type: Pipe,
3373
- args: [{
3374
- name: 'selectFilters'
3375
- }]
3376
- }] });
3377
-
3378
- class SelectComponent {
3379
- constructor(translateService) {
3380
- this.translateService = translateService;
3381
- this.search = false;
3382
- this.type = 'default';
3383
- this.maxWidth = '100%';
3384
- this.disabled = false;
3385
- this.selectValue = new EventEmitter();
3386
- this.clickOnCallToAction = new EventEmitter();
3387
- this.openCategories = false;
3388
- this.searchValue = '';
3389
- this.indexItemSelected = -1;
3390
- // ControlValueAccessor methods
3391
- this.onChange = () => { };
3392
- this.onTouch = () => { };
3393
- }
3394
- ngOnInit() {
3395
- this.indexItemSelected = this.items.findIndex(item => item.selected);
3396
- }
3397
- onClose() {
3398
- this.openCategories = false;
3399
- }
3400
- customTB(item, index) {
3401
- return `${item.id}-${index}`;
3402
- }
3403
- onSelectItem(id) {
3404
- this.unselectAll();
3405
- this.setIndexItemSelected(id);
3406
- const itemSelected = this.getItemSelected();
3407
- itemSelected.selected = true;
3408
- this.selectValue.emit(this.indexItemSelected);
3409
- this.onChange(itemSelected);
3410
- }
3411
- onClickCallToAction() {
3412
- this.onClose();
3413
- this.clickOnCallToAction.emit(this.callToAction.value);
3414
- }
3415
- getItemSelected() {
3416
- return this.items[this.indexItemSelected];
3417
- }
3418
- showCategories() {
3419
- this.openCategories = true;
3420
- setTimeout(() => {
3421
- this.searchElement.nativeElement.focus();
3422
- }, 0);
3423
- }
3424
- unselectAll() {
3425
- this.items.forEach(item => item.selected = false);
3426
- }
3427
- setIndexItemSelected(id) {
3428
- this.indexItemSelected = this.items.findIndex(item => item.id === id);
3429
- }
3430
- writeValue(selectItem) {
3431
- if (!selectItem) {
3432
- return;
3433
- }
3434
- this.unselectAll();
3435
- selectItem.selected = true;
3436
- this.setIndexItemSelected(selectItem.id);
3437
- }
3438
- registerOnChange(fn) {
3439
- this.onChange = fn;
3440
- }
3441
- registerOnTouched(fn) {
3442
- this.onTouch = fn;
3443
- }
3444
- }
3445
- SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectComponent, deps: [{ token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
3446
- SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SelectComponent, selector: "wac-select", inputs: { items: "items", placeholder: "placeholder", label: "label", maxWidthItems: "maxWidthItems", search: "search", type: "type", callToAction: "callToAction", maxWidth: "maxWidth", disabled: "disabled" }, outputs: { selectValue: "selectValue", clickOnCallToAction: "clickOnCallToAction" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }], viewQueries: [{ propertyName: "searchElement", first: true, predicate: ["search"], descendants: true }], ngImport: i0, template: "<p *ngIf=\"label\" [innerHTML]=\"label\" class=\"wac-select__label\"></p>\r\n\r\n<div class=\"wac-select\" wzAutoHide (clickOutside)=\"onClose()\" [ngStyle]=\"{ 'max-width': maxWidth }\" [zIndexToggle]=\"openCategories\">\r\n\r\n <div class=\"wac-select__current\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && openCategories = !openCategories\" *ngIf=\"!search\">\r\n <span *ngIf=\"indexItemSelected !== -1\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\r\n <span [innerHTML]=\"(indexItemSelected !== -1 ? items[indexItemSelected].name : placeholder) | translate\"></span><span><i class=\"fa-solid fa-chevron-down\"></i></span>\r\n </div>\r\n\r\n <div class=\"wac-select__current wac-select__current--withSearch\" [ngClass]=\"{ 'select-disabled' : disabled, 'open-search': openCategories }\" *ngIf=\"search\">\r\n <div class=\"wac-select__current__search\" *ngIf=\"openCategories && !disabled\">\r\n <i class=\"far fa-search\"></i>\r\n <input #search type=\"text\" [(ngModel)]=\"searchValue\" />\r\n </div>\r\n <span (click)=\"openCategories = !openCategories;\" *ngIf=\"items[indexItemSelected]?.icon && !openCategories\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\r\n <span (click)=\"showCategories()\" [innerHTML]=\"items[indexItemSelected]?.name ? items[indexItemSelected].name : placeholder\"></span>\r\n <span (click)=\"openCategories = !openCategories;\"><i class=\"fa-solid fa-chevron-down\"></i></span>\r\n </div>\r\n\r\n <div class=\"wac-select__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openCategories, open: type === 'open' }\" [ngStyle]=\"{ 'max-width': maxWidthItems }\">\r\n <ng-scrollbar *ngIf=\"items.length\" style=\"height: 110px; width: 100%;\">\r\n\r\n <div *ngIf=\"callToAction\" class=\"wac-select__content__cta\">\r\n <div (click)=\"onClickCallToAction()\">\r\n <i *ngIf=\"callToAction.icon\" [classList]=\"callToAction.icon\"></i><strong *ngIf=\"callToAction.boldText\">{{ callToAction.boldText }}</strong\r\n ><span>{{ callToAction?.name }}</span>\r\n </div>\r\n </div>\r\n\r\n <div\r\n *ngFor=\"let item of items | selectFilters: searchValue; let index = index;\"\r\n (click)=\"onClose()\"\r\n class=\"wac-select__content__item\"\r\n >\r\n <div *ngIf=\"!item.hide\" [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(item.id)\">\r\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name | translate }}\r\n </div>\r\n </div>\r\n\r\n </ng-scrollbar>\r\n\r\n <div *ngIf=\"!(items | selectFilters: searchValue)?.length\" class=\"wac-select__content__empty\">\r\n <span>{{'wac.datatable.noresult' | translate}}</span>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgScrollbar, selector: "ng-scrollbar", inputs: ["disabled", "sensorDisabled", "pointerEventsDisabled", "viewportPropagateMouseMove", "autoHeightDisabled", "autoWidthDisabled", "viewClass", "trackClass", "thumbClass", "minThumbSize", "trackClickScrollDuration", "pointerEventsMethod", "track", "visibility", "appearance", "position", "sensorDebounce", "scrollAuditTime"], outputs: ["updated"], exportAs: ["ngScrollbar"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: SelectFiltersPipe, name: "selectFilters" }] });
3447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SelectComponent, decorators: [{
3448
- type: Component,
3449
- args: [{ selector: 'wac-select', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }], template: "<p *ngIf=\"label\" [innerHTML]=\"label\" class=\"wac-select__label\"></p>\r\n\r\n<div class=\"wac-select\" wzAutoHide (clickOutside)=\"onClose()\" [ngStyle]=\"{ 'max-width': maxWidth }\" [zIndexToggle]=\"openCategories\">\r\n\r\n <div class=\"wac-select__current\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && openCategories = !openCategories\" *ngIf=\"!search\">\r\n <span *ngIf=\"indexItemSelected !== -1\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\r\n <span [innerHTML]=\"(indexItemSelected !== -1 ? items[indexItemSelected].name : placeholder) | translate\"></span><span><i class=\"fa-solid fa-chevron-down\"></i></span>\r\n </div>\r\n\r\n <div class=\"wac-select__current wac-select__current--withSearch\" [ngClass]=\"{ 'select-disabled' : disabled, 'open-search': openCategories }\" *ngIf=\"search\">\r\n <div class=\"wac-select__current__search\" *ngIf=\"openCategories && !disabled\">\r\n <i class=\"far fa-search\"></i>\r\n <input #search type=\"text\" [(ngModel)]=\"searchValue\" />\r\n </div>\r\n <span (click)=\"openCategories = !openCategories;\" *ngIf=\"items[indexItemSelected]?.icon && !openCategories\" class=\"icon\" [innerHTML]=\"items[indexItemSelected].icon\"></span>\r\n <span (click)=\"showCategories()\" [innerHTML]=\"items[indexItemSelected]?.name ? items[indexItemSelected].name : placeholder\"></span>\r\n <span (click)=\"openCategories = !openCategories;\"><i class=\"fa-solid fa-chevron-down\"></i></span>\r\n </div>\r\n\r\n <div class=\"wac-select__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openCategories, open: type === 'open' }\" [ngStyle]=\"{ 'max-width': maxWidthItems }\">\r\n <ng-scrollbar *ngIf=\"items.length\" style=\"height: 110px; width: 100%;\">\r\n\r\n <div *ngIf=\"callToAction\" class=\"wac-select__content__cta\">\r\n <div (click)=\"onClickCallToAction()\">\r\n <i *ngIf=\"callToAction.icon\" [classList]=\"callToAction.icon\"></i><strong *ngIf=\"callToAction.boldText\">{{ callToAction.boldText }}</strong\r\n ><span>{{ callToAction?.name }}</span>\r\n </div>\r\n </div>\r\n\r\n <div\r\n *ngFor=\"let item of items | selectFilters: searchValue; let index = index;\"\r\n (click)=\"onClose()\"\r\n class=\"wac-select__content__item\"\r\n >\r\n <div *ngIf=\"!item.hide\" [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(item.id)\">\r\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name | translate }}\r\n </div>\r\n </div>\r\n\r\n </ng-scrollbar>\r\n\r\n <div *ngIf=\"!(items | selectFilters: searchValue)?.length\" class=\"wac-select__content__empty\">\r\n <span>{{'wac.datatable.noresult' | translate}}</span>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n" }]
3450
- }], ctorParameters: function () { return [{ type: i3.TranslateService }]; }, propDecorators: { items: [{
3451
- type: Input
3452
- }], placeholder: [{
3453
- type: Input
3454
- }], label: [{
3455
- type: Input
3456
- }], maxWidthItems: [{
3457
- type: Input
3458
- }], search: [{
3459
- type: Input
3460
- }], type: [{
3461
- type: Input
3462
- }], callToAction: [{
3463
- type: Input
3464
- }], maxWidth: [{
3465
- type: Input
3466
- }], disabled: [{
3467
- type: Input
3468
- }], selectValue: [{
3469
- type: Output
3470
- }], clickOnCallToAction: [{
3471
- type: Output
3472
- }], searchElement: [{
3473
- type: ViewChild,
3474
- args: ['search']
3475
- }] } });
3476
-
3477
- class ImgTabsComponent {
3478
- constructor(imgEventEditService, alertService, route) {
3479
- this.imgEventEditService = imgEventEditService;
3480
- this.alertService = alertService;
3481
- this.route = route;
3482
- this.multipleImgMode = false;
3483
- this.listDisplayed = false;
3484
- this.imgManagerClosed = new EventEmitter();
3485
- this.currentTab = new EventEmitter();
3486
- this.switchDisplayWindow = new EventEmitter();
3487
- this.tabs = [
3488
- {
3489
- name: 'ImgManager.Tabs.addImg',
3490
- value: 'img-upload',
3491
- selected: true,
3492
- id: 0
3493
- },
3494
- {
3495
- name: 'ImgManager.Tabs.imgLib',
3496
- value: 'images-view',
3497
- id: 1
3498
- },
3499
- {
3500
- name: 'ImgManager.Tabs.freeImgLib',
3501
- value: 'pexels-lib',
3502
- id: 2
3503
- },
3504
- {
3505
- name: 'ImgManager.Tabs.Editor',
3506
- value: 'img-edition',
3507
- hide: true,
3508
- id: 3
3509
- }
3510
- ];
3511
- this.tabActive = this.tabs[0];
3512
- /* tabActive = 'images-view';
3513
- tabs: string[] = ['img-upload', 'images-view', 'pexels-lib', 'img-edition']; */
3514
- this.editTab = false;
3515
- this.imgUpload = false;
3516
- this.snackBarNewVersionConfig = {
3517
- message: '',
3518
- duration: 3000
3519
- };
3520
- }
3521
- ngOnInit() {
3522
- this.imgEventEditService.getImgToEditEventListener().subscribe(imgToEdit => {
3523
- this.tabActive = this.tabs[3];
3524
- this.imgToEdit = imgToEdit;
3525
- this.editTab = true;
3526
- this.currentTab.emit(this.tabs[3]);
3527
- });
3528
- }
3529
- toggleTabs(item) {
3530
- this.imgUpload = false;
3531
- this.editTab = false;
3532
- this.tabActive = item;
3533
- }
3534
- onImgUploaded(img) {
3535
- this.imgUpload = true;
3536
- this.imgUploadedComponent.onImgUploaded(img);
3537
- }
3538
- onEditClosed(msgKey) {
3539
- this.editTab = false;
3540
- this.toggleTabs(this.tabs[1]);
3541
- if (msgKey) {
3542
- this.alertService.openAlert(msgKey);
3543
- }
3544
- this.currentTab.emit('close');
3545
- }
3546
- onShowImgUploaded() {
3547
- this.tabActive = this.tabs[1];
3548
- }
3549
- switchDisplayWindowImgView() {
3550
- this.switchDisplayWindow.emit(true);
3551
- }
3552
- switchRouterLink(event) {
3553
- }
3554
- onImgManagerClosed() {
3555
- this.imgManagerClosed.emit();
3556
- }
3557
- }
3558
- ImgTabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgTabsComponent, deps: [{ token: ImgEventService }, { token: AlertService }, { token: i3$2.Router }], target: i0.ɵɵFactoryTarget.Component });
3559
- ImgTabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImgTabsComponent, selector: "img-tabs", inputs: { multipleImgMode: "multipleImgMode", stateDisplayed: "stateDisplayed", listDisplayed: "listDisplayed" }, outputs: { imgManagerClosed: "imgManagerClosed", currentTab: "currentTab", switchDisplayWindow: "switchDisplayWindow" }, viewQueries: [{ propertyName: "imgUploadedComponent", first: true, predicate: ["imgUploadedImg"], descendants: true }], ngImport: i0, template: "<div\r\n class=\"img-tabs\" [ngClass]=\"{'small': stateDisplayed === 'small'}\">\r\n <div class=\"wrapper-tabs\">\r\n <div\r\n class=\"tabs\"\r\n [ngClass]=\"\r\n {\r\n 'tabs--notWindow': stateDisplayed !== 'window',\r\n 'tabs--notDisplayed': stateDisplayed === 'window' && tabActive.value === tabs[3].value\r\n }\">\r\n\r\n <ul>\r\n <li class=\"is-active\" [ngClass]=\"{'is-active': tabActive.value === tabs[0].value}\" (click)=\"toggleTabs(tabs[0])\"><a>{{ tabs[0].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[1].value}\" (click)=\"toggleTabs(tabs[1])\"><a>{{ tabs[1].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[2].value}\" (click)=\"toggleTabs(tabs[2])\"><a>{{ tabs[2].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[3].value}\" *ngIf=\"editTab\"><a>{{ tabs[3].name | translate }}</a></li>\r\n </ul>\r\n <div\r\n class=\"img-tabs__canva\"\r\n [ngClass]=\"{'img-tabs__canva--window': stateDisplayed === 'window'}\">\r\n <canva-btn\r\n (showImgUploaded)=\"onShowImgUploaded()\"\r\n [stateDisplayed]=\"stateDisplayed\">\r\n </canva-btn>\r\n </div>\r\n </div>\r\n <div class=\"select-mobile-page\">\r\n <wac-select\r\n [(ngModel)]=\"tabActive\"\r\n name=\"tabs\"\r\n [items]=\"tabs\"\r\n ></wac-select>\r\n </div>\r\n </div>\r\n\r\n <!-- Upload section -->\r\n <div\r\n class=\"columns img-tabs__tabsFirst\"\r\n [ngClass]=\"{\r\n 'img-tabs__tabsFirst--small': stateDisplayed === 'small',\r\n 'img-tabs__tabsFirst--window': stateDisplayed === 'window'\r\n }\"\r\n *ngIf=\"tabActive.value === tabs[0].value\">\r\n <div class=\"column img-tabs__tabsFirst__upload\">\r\n <img-upload\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (imgUploaded)=\"onImgUploaded($event)\"\r\n ></img-upload>\r\n </div>\r\n <div class=\"column img-tabs__tabsFirst__list\" [ngClass]=\"{\r\n 'img-tabs__tabsFirst__list--upload': imgUpload\r\n }\">\r\n <images-view\r\n *ngIf=\"!imgUpload\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [listDisplayed]=\"false\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n [nbRowToShow]=\"2\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n [fullSize]=\"false\">\r\n </images-view>\r\n\r\n\r\n <div [hidden]=\"!imgUpload\">\r\n <upload-list\r\n #imgUploadedImg\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n >\r\n </upload-list>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Images section -->\r\n <div class=\"columns img-tabs__tabsSecond\" *ngIf=\"tabActive.value === tabs[1].value\">\r\n <div class=\"column\">\r\n\r\n <images-view\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [listDisplayed]=\"listDisplayed\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n [fullSize]=\"true\">\r\n </images-view>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Pexels img section -->\r\n <div class=\"columns img-tabs__tabsThird\" *ngIf=\"tabActive.value === tabs[2].value\">\r\n <div class=\"column\">\r\n <pexels-lib\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (showImgUploaded)=\"onShowImgUploaded()\">\r\n </pexels-lib>\r\n </div>\r\n </div>\r\n\r\n <!--Edition section -->\r\n <div class=\"columns img-tabs__tabsEdit\" *ngIf=\"tabActive.value === tabs[3].value\">\r\n <div class=\"column\">\r\n <img-editor\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [imgToEdit]=\"imgToEdit\"\r\n (editClosed)=\"onEditClosed($event)\">\r\n </img-editor>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ImgUploadComponent, selector: "img-upload", inputs: ["stateDisplayed"], outputs: ["imgUploaded"] }, { kind: "component", type: PexelLibComponent, selector: "pexels-lib", inputs: ["stateDisplayed", "searchValue", "disableSearch"] }, { kind: "component", type: UploadListComponent, selector: "upload-list", inputs: ["stateDisplayed", "tabDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: ImgEditorComponent, selector: "img-editor", inputs: ["stateDisplayed", "imgToEdit"], outputs: ["editClosed"] }, { kind: "component", type: CanvaBtnComponent, selector: "canva-btn", inputs: ["stateDisplayed"], outputs: ["showImgUploaded"] }, { kind: "component", type: ImagesViewComponent, selector: "images-view", inputs: ["stateDisplayed", "tabDisplayed", "fullSize", "nbRowToShow", "listDisplayed", "multipleImgMode"], outputs: ["switchDisplayWindow"] }, { kind: "component", type: SelectComponent, selector: "wac-select", inputs: ["items", "placeholder", "label", "maxWidthItems", "search", "type", "callToAction", "maxWidth", "disabled"], outputs: ["selectValue", "clickOnCallToAction"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
3560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgTabsComponent, decorators: [{
3561
- type: Component,
3562
- args: [{ selector: 'img-tabs', template: "<div\r\n class=\"img-tabs\" [ngClass]=\"{'small': stateDisplayed === 'small'}\">\r\n <div class=\"wrapper-tabs\">\r\n <div\r\n class=\"tabs\"\r\n [ngClass]=\"\r\n {\r\n 'tabs--notWindow': stateDisplayed !== 'window',\r\n 'tabs--notDisplayed': stateDisplayed === 'window' && tabActive.value === tabs[3].value\r\n }\">\r\n\r\n <ul>\r\n <li class=\"is-active\" [ngClass]=\"{'is-active': tabActive.value === tabs[0].value}\" (click)=\"toggleTabs(tabs[0])\"><a>{{ tabs[0].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[1].value}\" (click)=\"toggleTabs(tabs[1])\"><a>{{ tabs[1].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[2].value}\" (click)=\"toggleTabs(tabs[2])\"><a>{{ tabs[2].name | translate }}</a></li>\r\n <li [ngClass]=\"{'is-active': tabActive.value === tabs[3].value}\" *ngIf=\"editTab\"><a>{{ tabs[3].name | translate }}</a></li>\r\n </ul>\r\n <div\r\n class=\"img-tabs__canva\"\r\n [ngClass]=\"{'img-tabs__canva--window': stateDisplayed === 'window'}\">\r\n <canva-btn\r\n (showImgUploaded)=\"onShowImgUploaded()\"\r\n [stateDisplayed]=\"stateDisplayed\">\r\n </canva-btn>\r\n </div>\r\n </div>\r\n <div class=\"select-mobile-page\">\r\n <wac-select\r\n [(ngModel)]=\"tabActive\"\r\n name=\"tabs\"\r\n [items]=\"tabs\"\r\n ></wac-select>\r\n </div>\r\n </div>\r\n\r\n <!-- Upload section -->\r\n <div\r\n class=\"columns img-tabs__tabsFirst\"\r\n [ngClass]=\"{\r\n 'img-tabs__tabsFirst--small': stateDisplayed === 'small',\r\n 'img-tabs__tabsFirst--window': stateDisplayed === 'window'\r\n }\"\r\n *ngIf=\"tabActive.value === tabs[0].value\">\r\n <div class=\"column img-tabs__tabsFirst__upload\">\r\n <img-upload\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (imgUploaded)=\"onImgUploaded($event)\"\r\n ></img-upload>\r\n </div>\r\n <div class=\"column img-tabs__tabsFirst__list\" [ngClass]=\"{\r\n 'img-tabs__tabsFirst__list--upload': imgUpload\r\n }\">\r\n <images-view\r\n *ngIf=\"!imgUpload\"\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [listDisplayed]=\"false\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n [nbRowToShow]=\"2\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n [fullSize]=\"false\">\r\n </images-view>\r\n\r\n\r\n <div [hidden]=\"!imgUpload\">\r\n <upload-list\r\n #imgUploadedImg\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n >\r\n </upload-list>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Images section -->\r\n <div class=\"columns img-tabs__tabsSecond\" *ngIf=\"tabActive.value === tabs[1].value\">\r\n <div class=\"column\">\r\n\r\n <images-view\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [listDisplayed]=\"listDisplayed\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [tabDisplayed]=\"tabActive.value\"\r\n (switchDisplayWindow)=\"switchDisplayWindowImgView()\"\r\n [fullSize]=\"true\">\r\n </images-view>\r\n\r\n </div>\r\n </div>\r\n\r\n <!-- Pexels img section -->\r\n <div class=\"columns img-tabs__tabsThird\" *ngIf=\"tabActive.value === tabs[2].value\">\r\n <div class=\"column\">\r\n <pexels-lib\r\n [stateDisplayed]=\"stateDisplayed\"\r\n (showImgUploaded)=\"onShowImgUploaded()\">\r\n </pexels-lib>\r\n </div>\r\n </div>\r\n\r\n <!--Edition section -->\r\n <div class=\"columns img-tabs__tabsEdit\" *ngIf=\"tabActive.value === tabs[3].value\">\r\n <div class=\"column\">\r\n <img-editor\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [imgToEdit]=\"imgToEdit\"\r\n (editClosed)=\"onEditClosed($event)\">\r\n </img-editor>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n" }]
3563
- }], ctorParameters: function () { return [{ type: ImgEventService }, { type: AlertService }, { type: i3$2.Router }]; }, propDecorators: { multipleImgMode: [{
3564
- type: Input
3565
- }], stateDisplayed: [{
3566
- type: Input
3567
- }], listDisplayed: [{
3568
- type: Input
3569
- }], imgManagerClosed: [{
3570
- type: Output
3571
- }], currentTab: [{
3572
- type: Output
3573
- }], switchDisplayWindow: [{
3574
- type: Output
3575
- }], imgUploadedComponent: [{
3576
- type: ViewChild,
3577
- args: ['imgUploadedImg']
3578
- }] } });
3579
-
3580
- class ImgSelectionComponent {
3581
- constructor(imgSelectionService) {
3582
- this.imgSelectionService = imgSelectionService;
3583
- this.imgManagerClosed = new EventEmitter();
3584
- this.removingAll = false;
3585
- this.cancellingAll = false;
3586
- this.importingAll = false;
3587
- this.dragStart = false;
3588
- this.vm$ = combineLatest({
3589
- imgSelectedList: this.imgSelectionService.imgSelection$,
3590
- isLoading: this.imgSelectionService.imgSelectedListLoading$
3591
- });
3592
- this.trashPositionIndex = 0;
3593
- this.trashPositionLeft = '-5px';
3594
- }
3595
- init() {
3596
- this.removingAll = false;
3597
- this.cancellingAll = false;
3598
- this.importingAll = false;
3599
- }
3600
- removeImg(index) {
3601
- this.imgSelectionService.removeImgSelectedByIndex(index);
3602
- }
3603
- drop(event) {
3604
- if (event.previousIndex !== event.currentIndex) {
3605
- this.imgSelectionService.moveImgOrder(event);
3606
- }
3607
- }
3608
- removeImgFromSelection(event) {
3609
- this.imgSelectionService.removeImgSelectedByIndex(event.previousIndex);
3610
- }
3611
- }
3612
- ImgSelectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgSelectionComponent, deps: [{ token: ImgSelectionService }], target: i0.ɵɵFactoryTarget.Component });
3613
- ImgSelectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: ImgSelectionComponent, selector: "img-selection", inputs: { tabDisplayed: "tabDisplayed" }, outputs: { imgManagerClosed: "imgManagerClosed" }, ngImport: i0, template: "<div\r\n class=\"trash\"\r\n cdkDropList\r\n #unSelectList=\"cdkDropList\"\r\n (cdkDropListDropped)=\"removeImgFromSelection($event)\">\r\n <p>{{'ImgManager.ImgSelection.unselect' | translate}}</p>\r\n</div>\r\n\r\n<ng-container *ngIf=\"vm$ | async as vm\">\r\n\r\n <div\r\n class=\"img-selection\"\r\n *ngIf=\"!vm.isLoading; else Loading\"\r\n [ngClass]=\"{'img-selection--visible' : vm.imgSelectedList && vm.imgSelectedList.length}\"\r\n >\r\n\r\n <div\r\n cdkDropList\r\n #selectionList=\"cdkDropList\"\r\n cdkDropListOrientation=\"horizontal\"\r\n class=\"list_img_selection\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [cdkDropListConnectedTo]=\"[unSelectList]\"\r\n >\r\n\r\n <div\r\n class=\"img_box\"\r\n *ngFor=\"let picture of vm.imgSelectedList; let index = index\"\r\n cdkDrag\r\n (cdkDragStarted)=\"dragStart = true;\"\r\n (cdkDragEnded)=\"dragStart = false;\"\r\n >\r\n\r\n <img\r\n *ngIf=\"index < 1\"\r\n class=\"drag__img\"\r\n [src]=\"picture.file_name | imgSrc : '400'\"\r\n [title]=\"picture.display_name\"\r\n />\r\n\r\n <img\r\n *ngIf=\"index > 0\"\r\n class=\"drag__img\"\r\n [src]=\"picture.file_name | imgSrc : '200'\"\r\n [title]=\"picture.display_name\"\r\n />\r\n\r\n <div class=\"delete-btn\" (click)=\"removeImg(index)\">{{'ImgManager.ImgSelection.deleteImg' | translate}}</div>\r\n\r\n <span class=\"drag__tooltips\">{{'ImgManager.ImgSelection.tooltips' | translate}}</span>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n<!-- Loader -->\r\n<ng-template #Loading>\r\n <wz-loader></wz-loader>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i3$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: LoaderComponent, selector: "wz-loader", inputs: ["text", "small", "position"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "pipe", type: ImageSrcPipe, name: "imgSrc" }] });
3614
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ImgSelectionComponent, decorators: [{
3615
- type: Component,
3616
- args: [{ selector: 'img-selection', template: "<div\r\n class=\"trash\"\r\n cdkDropList\r\n #unSelectList=\"cdkDropList\"\r\n (cdkDropListDropped)=\"removeImgFromSelection($event)\">\r\n <p>{{'ImgManager.ImgSelection.unselect' | translate}}</p>\r\n</div>\r\n\r\n<ng-container *ngIf=\"vm$ | async as vm\">\r\n\r\n <div\r\n class=\"img-selection\"\r\n *ngIf=\"!vm.isLoading; else Loading\"\r\n [ngClass]=\"{'img-selection--visible' : vm.imgSelectedList && vm.imgSelectedList.length}\"\r\n >\r\n\r\n <div\r\n cdkDropList\r\n #selectionList=\"cdkDropList\"\r\n cdkDropListOrientation=\"horizontal\"\r\n class=\"list_img_selection\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n [cdkDropListConnectedTo]=\"[unSelectList]\"\r\n >\r\n\r\n <div\r\n class=\"img_box\"\r\n *ngFor=\"let picture of vm.imgSelectedList; let index = index\"\r\n cdkDrag\r\n (cdkDragStarted)=\"dragStart = true;\"\r\n (cdkDragEnded)=\"dragStart = false;\"\r\n >\r\n\r\n <img\r\n *ngIf=\"index < 1\"\r\n class=\"drag__img\"\r\n [src]=\"picture.file_name | imgSrc : '400'\"\r\n [title]=\"picture.display_name\"\r\n />\r\n\r\n <img\r\n *ngIf=\"index > 0\"\r\n class=\"drag__img\"\r\n [src]=\"picture.file_name | imgSrc : '200'\"\r\n [title]=\"picture.display_name\"\r\n />\r\n\r\n <div class=\"delete-btn\" (click)=\"removeImg(index)\">{{'ImgManager.ImgSelection.deleteImg' | translate}}</div>\r\n\r\n <span class=\"drag__tooltips\">{{'ImgManager.ImgSelection.tooltips' | translate}}</span>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n<!-- Loader -->\r\n<ng-template #Loading>\r\n <wz-loader></wz-loader>\r\n</ng-template>\r\n" }]
3617
- }], ctorParameters: function () { return [{ type: ImgSelectionService }]; }, propDecorators: { tabDisplayed: [{
3618
- type: Input
3619
- }], imgManagerClosed: [{
3620
- type: Output
3621
- }] } });
3622
-
3623
- class WzImgManagerComponent {
3624
- // If forceToOpenCanva is true : Canva will open with the canvaService.expectedImgSizesChange
3625
- // If forceToOpenCanva is a WiziBlockMediaDto, Canva open immediatly
3626
- set forceToOpenCanva(forceToOpenCanva) {
3627
- this.canvaService.forceToOpenCanva = !!forceToOpenCanva;
3628
- if (typeof forceToOpenCanva === 'boolean') {
3629
- return;
3630
- }
3631
- this.canvaService.expectedImgSizesChange(forceToOpenCanva);
3632
- }
3633
- set multipleImgMode(activate) {
3634
- this._multipleImgMode = activate;
3635
- this.imgSelectionService.setMultipleImgMode(this._multipleImgMode);
3636
- }
3637
- get multipleImgMode() {
3638
- return this._multipleImgMode;
3639
- }
3640
- set showImgManagerModule(activate) {
3641
- this._showImgManagerModule = activate;
3642
- if (activate) {
3643
- this.displaySmall();
3644
- }
3645
- }
3646
- get showImgManagerModule() {
3647
- return this._multipleImgMode;
3648
- }
3649
- onKeydownHandler(event) {
3650
- if (this.stateDisplayed && this.stateDisplayed !== 'window') {
3651
- this.onClose();
3652
- }
3653
- }
3654
- constructor(imgSelectionService, userSettingsService, canvaService, imgEventService, domService, uploadService, iconService) {
3655
- this.imgSelectionService = imgSelectionService;
3656
- this.userSettingsService = userSettingsService;
3657
- this.canvaService = canvaService;
3658
- this.imgEventService = imgEventService;
3659
- this.domService = domService;
3660
- this.uploadService = uploadService;
3661
- this.iconService = iconService;
3662
- this.showSelection = false;
3663
- this.imgManagerClosed = new EventEmitter();
3664
- this._multipleImgMode = false;
3665
- this._showImgManagerModule = false;
3666
- this.imgSelectionChange = this.imgSelectionService.imgSelection$;
3667
- this.imageUploaded = this.uploadService.imageUploaded$;
3668
- this.close = false;
3669
- this.listDisplayed = false;
3670
- this.hideTab = false;
3671
- this.iconService.loadIconLib();
3672
- }
3673
- ngOnInit() {
3674
- this.imgSelectionService.setMultipleImgMode(this._multipleImgMode);
3675
- this.imgSelectionService.initImgSelectedList(null);
3676
- this.selectImgEvent = this.imgSelectionService.imgSelection$.subscribe(imgSelection => {
3677
- if (imgSelection && imgSelection.length && this.checkCloseImgManager()) {
3678
- // Close the img manager
3679
- this.onClose();
3680
- }
3681
- });
3682
- this.checkUserDisplayPreference();
3683
- // Use when the img manager is full open or open in page. This display the user preference display, mosaic or list.
3684
- this.listDisplayedEvent = this.imgEventService.getlistDisplayedChange().subscribe(value => this.listDisplayed = value);
3685
- // Register dom service to listen on all event on the body to avoid having multiple instance of the same thing every where
3686
- this.domService.setDocumentEventListener();
3687
- }
3688
- checkUserDisplayPreference() {
3689
- if (this.stateDisplayed === 'window' || this.stateDisplayed === 'full') {
3690
- this.listDisplayed = this.userSettingsService.getUserDisplayPreference();
3691
- }
3692
- }
3693
- setCurrentTab(event) {
3694
- if (event === 'img-edition') {
3695
- this.hideTab = true;
3696
- return;
3697
- }
3698
- this.hideTab = false;
3699
- }
3700
- displaySmall() {
3701
- if (this.stateDisplayed !== 'window') {
3702
- setTimeout(() => {
3703
- this.stateDisplayed = 'small';
3704
- this.addBodyBottomPaddingForModule();
3705
- }, 10);
3706
- }
3707
- }
3708
- openSmall() {
3709
- this.stateDisplayed = 'small';
3710
- this.setBodyMainScroll();
3711
- this.listDisplayed = false;
3712
- }
3713
- openFull() {
3714
- this.stateDisplayed = 'full';
3715
- this.checkUserDisplayPreference();
3716
- this.hideBodyMainScroll();
3717
- }
3718
- onClose() {
3719
- this.stateDisplayed = 'closed';
3720
- this.hideTab = false;
3721
- this.setBodyMainScroll();
3722
- this.removeBodyBottomPaddingForModule();
3723
- // Wait the end of the closing annimation
3724
- setTimeout(() => {
3725
- this.imgManagerClosed.emit();
3726
- }, 250);
3727
- }
3728
- onImgManagerClosed() {
3729
- this.onClose();
3730
- }
3731
- /**
3732
- * Close the img manager after one img is selected, if not in multiple img to select
3733
- */
3734
- checkCloseImgManager() {
3735
- return !this.multipleImgMode && this.stateDisplayed !== 'window' ? true : false;
3736
- }
3737
- hideBodyMainScroll() {
3738
- const html = document.getElementsByTagName('html')[0];
3739
- if (!this.overflowHTML) {
3740
- this.overflowHTML = html.style.overflowY;
3741
- }
3742
- html.style.overflowY = "hidden";
3743
- }
3744
- setBodyMainScroll() {
3745
- const html = document.getElementsByTagName('html')[0];
3746
- html.style.overflowY = this.overflowHTML ? this.overflowHTML : "scroll";
3747
- }
3748
- addBodyBottomPaddingForModule() {
3749
- const body = document.getElementsByTagName('body')[0];
3750
- this.bodyPadding = this.bodyPadding ? parseInt(body.style.paddingBottom) : 0;
3751
- body.style.paddingBottom = this.bodyPadding + 300 + 'px';
3752
- }
3753
- removeBodyBottomPaddingForModule() {
3754
- if (typeof this.bodyPadding !== 'undefined') {
3755
- const body = document.getElementsByTagName('body')[0];
3756
- body.style.paddingBottom = this.bodyPadding + 'px';
3757
- this.bodyPadding = 0;
3758
- }
3759
- }
3760
- changeDisplayTab() {
3761
- this.stateDisplayed = 'full';
3762
- }
3763
- ngOnDestroy() {
3764
- this.selectImgEvent.unsubscribe();
3765
- this.canvaService.expectedImgSizesChange(null);
3766
- this.listDisplayedEvent.unsubscribe();
3767
- }
3768
- }
3769
- WzImgManagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerComponent, deps: [{ token: ImgSelectionService }, { token: UserSettingsService }, { token: CanvaService }, { token: ImgEventService }, { token: DomService }, { token: UploadService }, { token: IconService }], target: i0.ɵɵFactoryTarget.Component });
3770
- WzImgManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WzImgManagerComponent, selector: "wz-img-manager", inputs: { stateDisplayed: "stateDisplayed", showSelection: "showSelection", forceToOpenCanva: "forceToOpenCanva", multipleImgMode: "multipleImgMode", showImgManagerModule: "showImgManagerModule" }, outputs: { imgManagerClosed: "imgManagerClosed", imgSelectionChange: "imgSelectionChange", imageUploaded: "imageUploaded" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div class=\"wz-img-manager\">\r\n <!-- Img selection handler -->\r\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\r\n <img-selection></img-selection>\r\n </div>\r\n\r\n <!-- Img manager module -->\r\n <div\r\n *ngIf=\"_showImgManagerModule\"\r\n class=\"wz-img-manager__module\"\r\n [ngClass]=\"{\r\n 'wz-img-manager__module--small': stateDisplayed === 'small',\r\n 'wz-img-manager__module--full': stateDisplayed === 'full',\r\n 'wz-img-manager__module--window': stateDisplayed === 'window',\r\n 'wz-img-manager__module--edit': hideTab}\"\r\n >\r\n\r\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\r\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\r\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\r\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\r\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\r\n </div>\r\n\r\n <div\r\n class=\"wz-img-manager__module__content wz-block\"\r\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\r\n <img-tabs\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [listDisplayed]=\"listDisplayed\"\r\n (imgManagerClosed)=\"onImgManagerClosed()\"\r\n (switchDisplayWindow)=\"changeDisplayTab()\"\r\n (currentTab)=\"setCurrentTab($event)\">\r\n </img-tabs>\r\n </div>\r\n </div>\r\n\r\n</div>\r\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"] }] });
3771
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerComponent, decorators: [{
3772
- type: Component,
3773
- args: [{ selector: 'wz-img-manager', template: "<div class=\"wz-img-manager\">\r\n <!-- Img selection handler -->\r\n <div class=\"wz-img-manager__selectionHandler\" *ngIf=\"showSelection\">\r\n <img-selection></img-selection>\r\n </div>\r\n\r\n <!-- Img manager module -->\r\n <div\r\n *ngIf=\"_showImgManagerModule\"\r\n class=\"wz-img-manager__module\"\r\n [ngClass]=\"{\r\n 'wz-img-manager__module--small': stateDisplayed === 'small',\r\n 'wz-img-manager__module--full': stateDisplayed === 'full',\r\n 'wz-img-manager__module--window': stateDisplayed === 'window',\r\n 'wz-img-manager__module--edit': hideTab}\"\r\n >\r\n\r\n <div class=\"wz-img-manager__module__header\" *ngIf=\"stateDisplayed !== 'window'\">\r\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'full'\" type=\"button\"><span>Expand</span><i class=\"fal fa-compress-alt\"></i></button>\r\n <button (click)=\"openSmall()\" *ngIf=\"stateDisplayed === 'closed'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\r\n <button (click)=\"openFull()\" *ngIf=\"stateDisplayed === 'small'\" type=\"button\"><span>Expand</span><i class=\"fal fa-expand-alt\"></i></button>\r\n <button (click)=\"onClose()\" *ngIf=\"stateDisplayed !== 'closed'\" type=\"button\"><span>Close</span><i class=\"fal fa-times\"></i></button>\r\n </div>\r\n\r\n <div\r\n class=\"wz-img-manager__module__content wz-block\"\r\n [ngClass]=\"{'wz-block--window': stateDisplayed === 'window'}\">\r\n <img-tabs\r\n [stateDisplayed]=\"stateDisplayed\"\r\n [multipleImgMode]=\"multipleImgMode\"\r\n [listDisplayed]=\"listDisplayed\"\r\n (imgManagerClosed)=\"onImgManagerClosed()\"\r\n (switchDisplayWindow)=\"changeDisplayTab()\"\r\n (currentTab)=\"setCurrentTab($event)\">\r\n </img-tabs>\r\n </div>\r\n </div>\r\n\r\n</div>\r\n" }]
3774
- }], ctorParameters: function () { return [{ type: ImgSelectionService }, { type: UserSettingsService }, { type: CanvaService }, { type: ImgEventService }, { type: DomService }, { type: UploadService }, { type: IconService }]; }, propDecorators: { stateDisplayed: [{
3775
- type: Input
3776
- }], showSelection: [{
3777
- type: Input
3778
- }], forceToOpenCanva: [{
3779
- type: Input
3780
- }], imgManagerClosed: [{
3781
- type: Output
3782
- }], multipleImgMode: [{
3783
- type: Input
3784
- }], showImgManagerModule: [{
3785
- type: Input
3786
- }], onKeydownHandler: [{
3787
- type: HostListener,
3788
- args: ['document:keydown.escape', ['$event']]
3789
- }], imgSelectionChange: [{
3790
- type: Output
3791
- }], imageUploaded: [{
3792
- type: Output
3793
- }] } });
3794
-
3795
- class SnackBarService {
3796
- constructor(nwbSnackbar, translateService) {
3797
- this.nwbSnackbar = nwbSnackbar;
3798
- this.translateService = translateService;
3799
- this.actionMsg = 'ImgManager.snackBar.action';
3800
- this.snackBarConfigAction = {
3801
- message: '',
3802
- duration: 5000
3803
- };
3804
- this.snackBarConfig = {
3805
- message: '',
3806
- duration: 5000
3807
- };
3808
- }
3809
- openSnackBar(msgKey) {
3810
- this.closePreviousSnackbar();
3811
- this.translateService.get(msgKey).subscribe(trans => {
3812
- this.snackBarConfig.message = trans;
3813
- this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfig);
3814
- this.snackBarRefComponent.afterClosed().subscribe();
3815
- });
3816
- }
3817
- openSnackBarWithAction(msgKey) {
3818
- return new Observable(observer => {
3819
- this.translateService.get([msgKey, this.actionMsg]).subscribe((trans) => {
3820
- this.snackBarConfigAction.message = trans[msgKey];
3821
- this.snackBarConfigAction.action = trans[this.actionMsg];
3822
- this.closePreviousSnackbar();
3823
- this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfigAction);
3824
- this.snackBarRefComponent.afterClosed().subscribe(manualClose => {
3825
- observer.next(manualClose);
3826
- observer.complete();
3827
- });
3828
- });
3829
- });
3830
- }
3831
- openSnackBarWithBackendRespons(msgKey, msgBackend) {
3832
- this.translateService.get(msgKey).subscribe(trans => {
3833
- this.snackBarConfig.message = trans;
3834
- this.snackBarConfig.message += '<br/>' + JSON.parse(msgBackend).message;
3835
- this.closePreviousSnackbar();
3836
- this.snackBarRefComponent = this.nwbSnackbar.open(this.snackBarConfig);
3837
- this.snackBarRefComponent.afterClosed().subscribe();
3838
- });
3839
- }
3840
- closePreviousSnackbar() {
3841
- if (this.snackBarRefComponent) {
3842
- this.snackBarRefComponent.dismiss(false);
3843
- }
3844
- }
3845
- }
3846
- SnackBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SnackBarService, deps: [{ token: i1.NwbSnackbarService }, { token: i3.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
3847
- SnackBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SnackBarService });
3848
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SnackBarService, decorators: [{
3849
- type: Injectable
3850
- }], ctorParameters: function () { return [{ type: i1.NwbSnackbarService }, { type: i3.TranslateService }]; } });
3851
-
3852
- ;
3853
- const components = [
3854
- WzImgManagerComponent,
3855
- ImgTabsComponent,
3856
- ImgUploadComponent,
3857
- PexelLibComponent,
3858
- ImgCardComponent,
3859
- UploadListComponent,
3860
- ImgEditorComponent,
3861
- EditorInfoSectionComponent,
3862
- CanvaBtnComponent,
3863
- ImgSelectionComponent,
3864
- LoaderComponent,
3865
- DropdownComponent,
3866
- CropperComponent,
3867
- ImagesViewComponent,
3868
- MosaicViewComponent,
3869
- TableViewComponent,
3870
- TableComponent,
3871
- InputSearchComponent,
3872
- PaginationComponent,
3873
- CheckboxComponent,
3874
- AlertComponent,
3875
- PageSelectorComponent,
3876
- SelectComponent
3877
- ];
3878
- const directives = [
3879
- DragDropDirective,
3880
- LoadingDirective,
3881
- AutoHideDirective,
3882
- CopyClipboardDirective,
3883
- TableColumn,
3884
- CheckBoxRow,
3885
- TableColumnHeader,
3886
- TableRow,
3887
- AbstractDebounceDirective,
3888
- DebounceKeyupDirective,
3889
- ZindexToggleDirective
3890
- ];
3891
- const pipes = [
3892
- PagniationArrayTotalPages,
3893
- PagniationIsLastPage,
3894
- PagniationText,
3895
- ImageSrcPipe,
3896
- NumberToArray,
3897
- LargeNumberOfPagePipe,
3898
- SelectFiltersPipe
3899
- ];
3900
- class WzImgManagerModule {
3901
- static withConfig(ApiService, ImageNotFoundProvider) {
3902
- return {
3903
- ngModule: WzImgManagerModule,
3904
- providers: [
3905
- CanvaService,
3906
- ImgManagerService,
3907
- ApiService,
3908
- ImgCDNService,
3909
- FiltersTableService,
3910
- AlertService,
3911
- DomService,
3912
- ImgEventService,
3913
- ImgSelectionService,
3914
- PexelsService,
3915
- RenamePictureService,
3916
- SnackBarService,
3917
- UploadService,
3918
- UserSettingsService,
3919
- ImageNotFoundProvider ? ImageNotFoundProvider : ImageNotFoundService
3920
- ]
3921
- };
3922
- }
3923
- }
3924
- WzImgManagerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3925
- WzImgManagerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerModule, declarations: [WzImgManagerComponent,
3926
- ImgTabsComponent,
3927
- ImgUploadComponent,
3928
- PexelLibComponent,
3929
- ImgCardComponent,
3930
- UploadListComponent,
3931
- ImgEditorComponent,
3932
- EditorInfoSectionComponent,
3933
- CanvaBtnComponent,
3934
- ImgSelectionComponent,
3935
- LoaderComponent,
3936
- DropdownComponent,
3937
- CropperComponent,
3938
- ImagesViewComponent,
3939
- MosaicViewComponent,
3940
- TableViewComponent,
3941
- TableComponent,
3942
- InputSearchComponent,
3943
- PaginationComponent,
3944
- CheckboxComponent,
3945
- AlertComponent,
3946
- PageSelectorComponent,
3947
- SelectComponent, DragDropDirective,
3948
- LoadingDirective,
3949
- AutoHideDirective,
3950
- CopyClipboardDirective,
3951
- TableColumn,
3952
- CheckBoxRow,
3953
- TableColumnHeader,
3954
- TableRow,
3955
- AbstractDebounceDirective,
3956
- DebounceKeyupDirective,
3957
- ZindexToggleDirective, PagniationArrayTotalPages,
3958
- PagniationIsLastPage,
3959
- PagniationText,
3960
- ImageSrcPipe,
3961
- NumberToArray,
3962
- LargeNumberOfPagePipe,
3963
- SelectFiltersPipe], imports: [CommonModule,
3964
- HttpClientModule,
3965
- FormsModule,
3966
- NgScrollbarModule,
3967
- NgScrollbarReachedModule,
3968
- NwbAllModule,
3969
- ImageCropperModule,
3970
- CdkTableModule,
3971
- DragDropModule,
3972
- TranslateModule], exports: [WzImgManagerComponent] });
3973
- WzImgManagerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerModule, imports: [CommonModule,
3974
- HttpClientModule,
3975
- FormsModule,
3976
- NgScrollbarModule,
3977
- NgScrollbarReachedModule,
3978
- NwbAllModule,
3979
- ImageCropperModule,
3980
- CdkTableModule,
3981
- DragDropModule,
3982
- TranslateModule] });
3983
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WzImgManagerModule, decorators: [{
3984
- type: NgModule,
3985
- args: [{
3986
- declarations: [
3987
- ...components,
3988
- ...directives,
3989
- ...pipes
3990
- ],
3991
- imports: [
3992
- CommonModule,
3993
- HttpClientModule,
3994
- FormsModule,
3995
- NgScrollbarModule,
3996
- NgScrollbarReachedModule,
3997
- NwbAllModule,
3998
- ImageCropperModule,
3999
- CdkTableModule,
4000
- DragDropModule,
4001
- TranslateModule,
4002
- ],
4003
- providers: [],
4004
- exports: [
4005
- WzImgManagerComponent
4006
- ]
4007
- }]
4008
- }] });
4009
-
4010
- class CanvaButtonApi {
4011
- }
4012
- ;
4013
-
4014
- class ImgApiDto {
4015
- constructor() {
4016
- this.image_manager_route = '';
4017
- this.pexels_route = '';
4018
- this.canva_url = '';
4019
- this.assets_route = 'assets/img-manager/';
4020
- }
4021
- }
4022
-
4023
- class ImgManagerConfigDto {
4024
- }
4025
-
4026
- /*
4027
- * Public API Surface of wz-img-manager
4028
- */
4029
-
4030
- /**
4031
- * Generated bundle index. Do not edit.
4032
- */
4033
-
4034
- export { ApiService, CanvaButtonApi, CanvaService, ImageNotFoundService, ImgApiDto, ImgManagerConfigDto, ImgManagerService, ImgSelectionService, RenamePictureService, WzImgManagerComponent, WzImgManagerModule };
4035
- //# sourceMappingURL=wizishop-img-manager.mjs.map