@wizishop/img-manager 0.2.108 → 14.0.0

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