@wizishop/angular-components 0.0.164 → 14.0.1

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 (313) hide show
  1. package/angular-components.scss +4248 -4845
  2. package/{esm2015/lib/animations/in-out/in-out-x.animation.js → esm2020/lib/animations/in-out/in-out-x.animation.mjs} +0 -0
  3. package/{esm2015/lib/animations/in-out/in-out-y.animation.js → esm2020/lib/animations/in-out/in-out-y.animation.mjs} +0 -0
  4. package/esm2020/lib/components/alert/alert.component.mjs +30 -0
  5. package/esm2020/lib/components/alert-popup/alert-popup-module.mjs +21 -0
  6. package/esm2020/lib/components/alert-popup/alert-popup.component.mjs +41 -0
  7. package/esm2020/lib/components/alert-popup/alert-popup.service.mjs +30 -0
  8. package/esm2020/lib/components/back/back.component.mjs +12 -0
  9. package/esm2020/lib/components/block/block.component.mjs +44 -0
  10. package/esm2020/lib/components/button/button.component.mjs +155 -0
  11. package/esm2020/lib/components/calendar/calendar.component.mjs +196 -0
  12. package/esm2020/lib/components/checkbox/checkbox.component.mjs +70 -0
  13. package/esm2020/lib/components/checkbox/checkbox.module.mjs +25 -0
  14. package/esm2020/lib/components/delete/delete.component.mjs +12 -0
  15. package/esm2020/lib/components/dropdown/dropdown.component.mjs +26 -0
  16. package/esm2020/lib/components/edit-in-place/edit-in-place.component.mjs +202 -0
  17. package/{esm2015/lib/components/filters/filter-item.dto.js → esm2020/lib/components/filters/filter-item.dto.mjs} +0 -0
  18. package/esm2020/lib/components/filters/filters.component.mjs +41 -0
  19. package/esm2020/lib/components/free-popin/free-popin.component.mjs +63 -0
  20. package/esm2020/lib/components/header-page/header-page.component.mjs +24 -0
  21. package/esm2020/lib/components/hn/h1/h1.component.mjs +18 -0
  22. package/esm2020/lib/components/hn/h2/h2.component.mjs +13 -0
  23. package/esm2020/lib/components/hn/h3/h3.component.mjs +18 -0
  24. package/esm2020/lib/components/hn/h4/h4.component.mjs +18 -0
  25. package/esm2020/lib/components/image/image.component.mjs +15 -0
  26. package/esm2020/lib/components/info/info.component.mjs +12 -0
  27. package/esm2020/lib/components/inputs/input/input.component.mjs +162 -0
  28. package/esm2020/lib/components/inputs/input/input.module.mjs +37 -0
  29. package/esm2020/lib/components/inputs/input-search/input-search.component.mjs +54 -0
  30. package/esm2020/lib/components/inputs/input-search/input-search.module.mjs +33 -0
  31. package/esm2020/lib/components/inputs/input-with-select/input-with-select.component.mjs +62 -0
  32. package/{esm2015/lib/components/inputs/input-with-select/option-item.dto.js → esm2020/lib/components/inputs/input-with-select/option-item.dto.mjs} +0 -0
  33. package/esm2020/lib/components/label/label.component.mjs +34 -0
  34. package/esm2020/lib/components/link/link.component.mjs +51 -0
  35. package/esm2020/lib/components/loader/loader.component.mjs +20 -0
  36. package/esm2020/lib/components/loader/loader.module.mjs +25 -0
  37. package/esm2020/lib/components/logo/logo.component.mjs +17 -0
  38. package/esm2020/lib/components/multiple-search/multiple-search.component.mjs +115 -0
  39. package/esm2020/lib/components/multiple-search-plus/multiple-search-plus.component.mjs +93 -0
  40. package/{esm2015/lib/components/multiple-search-plus/shared/multiple-search-plus-option.model.js → esm2020/lib/components/multiple-search-plus/shared/multiple-search-plus-option.model.mjs} +0 -0
  41. package/{esm2015/lib/components/multiple-search-plus/shared/multiple-search-plus-results.model.js → esm2020/lib/components/multiple-search-plus/shared/multiple-search-plus-results.model.mjs} +0 -0
  42. package/esm2020/lib/components/pagination/pagination.component.mjs +50 -0
  43. package/esm2020/lib/components/pagination/pagination.module.mjs +33 -0
  44. package/esm2020/lib/components/pagination/pipes/array-pages.pipe.mjs +28 -0
  45. package/esm2020/lib/components/pagination/pipes/custom-text.pipe.mjs +34 -0
  46. package/esm2020/lib/components/pagination/pipes/is-last-page.pipe.mjs +25 -0
  47. package/esm2020/lib/components/popin/popin.component.mjs +67 -0
  48. package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +74 -0
  49. package/esm2020/lib/components/progress-bar/progress-bar.module.mjs +25 -0
  50. package/esm2020/lib/components/radio/radio.component.mjs +57 -0
  51. package/esm2020/lib/components/search/search.component.mjs +86 -0
  52. package/{esm2015/lib/components/search/shared/search-option.model.js → esm2020/lib/components/search/shared/search-option.model.mjs} +0 -0
  53. package/esm2020/lib/components/selected-list/selected-list.component.mjs +62 -0
  54. package/{esm2015/lib/components/selected-list/shared/selected-list-option.model.js → esm2020/lib/components/selected-list/shared/selected-list-option.model.mjs} +0 -0
  55. package/{esm2015/lib/components/selects/call-to-action.model.js → esm2020/lib/components/selects/call-to-action.model.mjs} +0 -0
  56. package/esm2020/lib/components/selects/select/select.component.mjs +133 -0
  57. package/esm2020/lib/components/selects/select-in-text/select-in-text.component.mjs +102 -0
  58. package/{esm2015/lib/components/selects/select-items.dto.js → esm2020/lib/components/selects/select-items.dto.mjs} +0 -0
  59. package/esm2020/lib/components/separator/separator.component.mjs +17 -0
  60. package/esm2020/lib/components/settings/settings.component.mjs +12 -0
  61. package/esm2020/lib/components/shared-components.module.mjs +301 -0
  62. package/esm2020/lib/components/snackbar/snackbar.component.mjs +84 -0
  63. package/esm2020/lib/components/state/state.component.mjs +16 -0
  64. package/esm2020/lib/components/switch/switch.component.mjs +54 -0
  65. package/esm2020/lib/components/tab/tab.component.mjs +33 -0
  66. package/esm2020/lib/components/table/directives/checkBoxRow.directive.mjs +95 -0
  67. package/{esm2015/lib/components/table/directives/column.directive.js → esm2020/lib/components/table/directives/column.directive.mjs} +20 -17
  68. package/esm2020/lib/components/table/directives/columnHeader.directive.mjs +205 -0
  69. package/esm2020/lib/components/table/directives/raw.directive.mjs +30 -0
  70. package/esm2020/lib/components/table/shared/filters-table.service.mjs +68 -0
  71. package/esm2020/lib/components/table/shared/table-checkbox-id.service.mjs +20 -0
  72. package/{esm2015/lib/components/table/shared/table-filters-group.model.js → esm2020/lib/components/table/shared/table-filters-group.model.mjs} +0 -0
  73. package/{esm2015/lib/components/table/shared/table-filters.model.js → esm2020/lib/components/table/shared/table-filters.model.mjs} +0 -0
  74. package/esm2020/lib/components/table/table.component.mjs +147 -0
  75. package/esm2020/lib/components/table/table.module.mjs +46 -0
  76. package/esm2020/lib/components/tag/tag.component.mjs +35 -0
  77. package/esm2020/lib/components/text/text.component.mjs +15 -0
  78. package/esm2020/lib/components/text-area/text-area.component.mjs +73 -0
  79. package/esm2020/lib/components/tooltip/tooltip.component.mjs +30 -0
  80. package/esm2020/lib/components/tooltip/tooltip.module.mjs +25 -0
  81. package/esm2020/lib/components/tree/tree.component.mjs +23 -0
  82. package/{esm2015/lib/components/tree/tree.dto.js → esm2020/lib/components/tree/tree.dto.mjs} +0 -0
  83. package/esm2020/lib/components/tree/tree.module.mjs +29 -0
  84. package/esm2020/lib/components/upload/upload.component.mjs +36 -0
  85. package/esm2020/lib/components/wrapper/wrapper.component.mjs +18 -0
  86. package/esm2020/lib/components/wrapper-blocs/wrapper-blocs.component.mjs +19 -0
  87. package/esm2020/lib/directives/abstract-debounce/abstract-debounce.directive.mjs +37 -0
  88. package/esm2020/lib/directives/abstract-debounce/debounce-keyup.directive.mjs +24 -0
  89. package/esm2020/lib/directives/auto-hide/auto-hide.directive.mjs +50 -0
  90. package/esm2020/lib/directives/keyboard-events/keypress-enter.directive.mjs +25 -0
  91. package/esm2020/lib/directives/ng-var.directive.mjs +32 -0
  92. package/esm2020/lib/directives/shared-directives.module.mjs +25 -0
  93. package/esm2020/lib/directives/zindex-toggle/zindex-toggle.directive.mjs +44 -0
  94. package/esm2020/lib/pipes/select/select-filters.pipe.mjs +19 -0
  95. package/esm2020/lib/pipes/selected-list/are-all-options-selected.pipe.mjs +17 -0
  96. package/esm2020/lib/pipes/shared-pipes.module.mjs +29 -0
  97. package/esm2020/lib/pipes/tree/format-object-to-recursif-tree.pipe.mjs +41 -0
  98. package/esm2020/lib/pipes/tree/format-object-to-simple-tree.pipe.mjs +49 -0
  99. package/esm2020/lib/services/dom.service.mjs +59 -0
  100. package/esm2020/lib/services/multiple-selection.service.mjs +62 -0
  101. package/{esm2015/lib/utils/html-container.class.js → esm2020/lib/utils/html-container.class.mjs} +0 -0
  102. package/{esm2015/lib/utils/slection-item.interface.js → esm2020/lib/utils/slection-item.interface.mjs} +0 -0
  103. package/esm2020/lib/wizi-components.module.mjs +34 -0
  104. package/esm2020/public-api.mjs +90 -0
  105. package/esm2020/wizishop-angular-components.mjs +5 -0
  106. package/fesm2015/wizishop-angular-components.mjs +4219 -0
  107. package/fesm2015/wizishop-angular-components.mjs.map +1 -0
  108. package/fesm2020/wizishop-angular-components.mjs +4209 -0
  109. package/fesm2020/wizishop-angular-components.mjs.map +1 -0
  110. package/index.d.ts +5 -0
  111. package/lib/components/alert/alert.component.d.ts +3 -0
  112. package/lib/components/alert-popup/alert-popup-module.d.ts +6 -0
  113. package/lib/components/alert-popup/alert-popup.component.d.ts +3 -0
  114. package/lib/components/alert-popup/alert-popup.service.d.ts +3 -0
  115. package/lib/components/back/back.component.d.ts +3 -0
  116. package/lib/components/block/block.component.d.ts +3 -0
  117. package/lib/components/button/button.component.d.ts +3 -2
  118. package/lib/components/calendar/calendar.component.d.ts +3 -0
  119. package/lib/components/checkbox/checkbox.component.d.ts +3 -0
  120. package/lib/components/checkbox/checkbox.module.d.ts +7 -0
  121. package/lib/components/delete/delete.component.d.ts +3 -0
  122. package/lib/components/dropdown/dropdown.component.d.ts +3 -0
  123. package/lib/components/edit-in-place/edit-in-place.component.d.ts +3 -0
  124. package/lib/components/filters/filters.component.d.ts +3 -0
  125. package/lib/components/free-popin/free-popin.component.d.ts +3 -0
  126. package/lib/components/header-page/header-page.component.d.ts +3 -1
  127. package/lib/components/hn/h1/h1.component.d.ts +3 -2
  128. package/lib/components/hn/h2/h2.component.d.ts +3 -0
  129. package/lib/components/hn/h3/h3.component.d.ts +3 -0
  130. package/lib/components/hn/h4/h4.component.d.ts +3 -0
  131. package/lib/components/image/image.component.d.ts +3 -0
  132. package/lib/components/info/info.component.d.ts +3 -0
  133. package/lib/components/inputs/input/input.component.d.ts +3 -0
  134. package/lib/components/inputs/input/input.module.d.ts +10 -0
  135. package/lib/components/inputs/input-search/input-search.component.d.ts +3 -0
  136. package/lib/components/inputs/input-search/input-search.module.d.ts +9 -0
  137. package/lib/components/inputs/input-with-select/input-with-select.component.d.ts +3 -0
  138. package/lib/components/label/label.component.d.ts +3 -0
  139. package/lib/components/link/link.component.d.ts +3 -0
  140. package/lib/components/loader/loader.component.d.ts +3 -0
  141. package/lib/components/loader/loader.module.d.ts +7 -0
  142. package/lib/components/logo/logo.component.d.ts +3 -0
  143. package/lib/components/multiple-search/multiple-search.component.d.ts +3 -0
  144. package/lib/components/multiple-search-plus/multiple-search-plus.component.d.ts +3 -0
  145. package/lib/components/pagination/pagination.component.d.ts +3 -0
  146. package/lib/components/pagination/pagination.module.d.ts +11 -0
  147. package/lib/components/pagination/pipes/array-pages.pipe.d.ts +3 -0
  148. package/lib/components/pagination/pipes/custom-text.pipe.d.ts +3 -0
  149. package/lib/components/pagination/pipes/is-last-page.pipe.d.ts +3 -0
  150. package/lib/components/popin/popin.component.d.ts +3 -0
  151. package/lib/components/progress-bar/progress-bar.component.d.ts +3 -0
  152. package/lib/components/progress-bar/progress-bar.module.d.ts +7 -0
  153. package/lib/components/radio/radio.component.d.ts +3 -0
  154. package/lib/components/search/search.component.d.ts +3 -0
  155. package/lib/components/selected-list/selected-list.component.d.ts +3 -0
  156. package/lib/components/selects/select/select.component.d.ts +3 -0
  157. package/lib/components/selects/select-in-text/select-in-text.component.d.ts +3 -0
  158. package/lib/components/separator/separator.component.d.ts +3 -0
  159. package/lib/components/settings/settings.component.d.ts +3 -0
  160. package/lib/components/shared-components.module.d.ts +78 -0
  161. package/lib/components/snackbar/snackbar.component.d.ts +3 -0
  162. package/lib/components/state/state.component.d.ts +3 -0
  163. package/lib/components/switch/switch.component.d.ts +3 -0
  164. package/lib/components/tab/tab.component.d.ts +3 -0
  165. package/lib/components/table/directives/checkBoxRow.directive.d.ts +3 -0
  166. package/lib/components/table/directives/column.directive.d.ts +3 -0
  167. package/lib/components/table/directives/columnHeader.directive.d.ts +3 -0
  168. package/lib/components/table/directives/raw.directive.d.ts +3 -0
  169. package/lib/components/table/shared/filters-table.service.d.ts +3 -0
  170. package/lib/components/table/shared/table-checkbox-id.service.d.ts +3 -0
  171. package/lib/components/table/table.component.d.ts +3 -0
  172. package/lib/components/table/table.module.d.ts +15 -0
  173. package/lib/components/tag/tag.component.d.ts +3 -0
  174. package/lib/components/text/text.component.d.ts +3 -0
  175. package/lib/components/text-area/text-area.component.d.ts +3 -2
  176. package/lib/components/tooltip/tooltip.component.d.ts +3 -0
  177. package/lib/components/tooltip/tooltip.module.d.ts +7 -0
  178. package/lib/components/tree/tree.component.d.ts +3 -0
  179. package/lib/components/tree/tree.module.d.ts +8 -0
  180. package/lib/components/upload/upload.component.d.ts +3 -0
  181. package/lib/components/wrapper/wrapper.component.d.ts +3 -0
  182. package/lib/components/wrapper-blocs/wrapper-blocs.component.d.ts +3 -0
  183. package/lib/directives/abstract-debounce/abstract-debounce.directive.d.ts +3 -0
  184. package/lib/directives/abstract-debounce/debounce-keyup.directive.d.ts +3 -0
  185. package/lib/directives/auto-hide/auto-hide.directive.d.ts +3 -0
  186. package/lib/directives/keyboard-events/keypress-enter.directive.d.ts +3 -0
  187. package/lib/directives/ng-var.directive.d.ts +3 -0
  188. package/lib/directives/shared-directives.module.d.ts +12 -0
  189. package/lib/directives/zindex-toggle/zindex-toggle.directive.d.ts +3 -0
  190. package/lib/pipes/select/select-filters.pipe.d.ts +3 -0
  191. package/lib/pipes/selected-list/are-all-options-selected.pipe.d.ts +3 -0
  192. package/lib/pipes/shared-pipes.module.d.ts +10 -0
  193. package/lib/pipes/tree/format-object-to-recursif-tree.pipe.d.ts +3 -0
  194. package/lib/pipes/tree/format-object-to-simple-tree.pipe.d.ts +3 -0
  195. package/lib/services/dom.service.d.ts +3 -0
  196. package/lib/services/multiple-selection.service.d.ts +3 -0
  197. package/lib/wizi-components.module.d.ts +9 -0
  198. package/package.json +20 -8
  199. package/public-api.d.ts +0 -7
  200. package/wizishop-angular-components-14.0.1.tgz +0 -0
  201. package/bundles/wizishop-angular-components.umd.js +0 -4656
  202. package/bundles/wizishop-angular-components.umd.js.map +0 -1
  203. package/bundles/wizishop-angular-components.umd.min.js +0 -16
  204. package/bundles/wizishop-angular-components.umd.min.js.map +0 -1
  205. package/esm2015/lib/components/alert/alert.component.js +0 -26
  206. package/esm2015/lib/components/alert-popup/alert-popup-module.js +0 -16
  207. package/esm2015/lib/components/alert-popup/alert-popup.component.js +0 -41
  208. package/esm2015/lib/components/alert-popup/alert-popup.service.js +0 -30
  209. package/esm2015/lib/components/back/back.component.js +0 -12
  210. package/esm2015/lib/components/block/block.component.js +0 -35
  211. package/esm2015/lib/components/block-with-checkbox/block-with-checkbox.component.js +0 -40
  212. package/esm2015/lib/components/breadcrumbs/breadcrumbs.component.js +0 -25
  213. package/esm2015/lib/components/breadcrumbs/breadcrumbs.dto.js +0 -2
  214. package/esm2015/lib/components/button/button.component.js +0 -134
  215. package/esm2015/lib/components/calendar/calendar.component.js +0 -185
  216. package/esm2015/lib/components/card-price/card-price.component.js +0 -37
  217. package/esm2015/lib/components/checkbox/checkbox.component.js +0 -62
  218. package/esm2015/lib/components/checkbox/checkbox.module.js +0 -18
  219. package/esm2015/lib/components/confirm-delete/confirm-delete.component.js +0 -36
  220. package/esm2015/lib/components/delete/delete.component.js +0 -12
  221. package/esm2015/lib/components/dropdown/dropdown.component.js +0 -24
  222. package/esm2015/lib/components/edit-in-place/edit-in-place.component.js +0 -190
  223. package/esm2015/lib/components/filters/filters.component.js +0 -39
  224. package/esm2015/lib/components/free-popin/free-popin.component.js +0 -55
  225. package/esm2015/lib/components/header-page/header-page.component.js +0 -22
  226. package/esm2015/lib/components/hn/h1/h1.component.js +0 -22
  227. package/esm2015/lib/components/hn/h2/h2.component.js +0 -13
  228. package/esm2015/lib/components/hn/h3/h3.component.js +0 -18
  229. package/esm2015/lib/components/hn/h4/h4.component.js +0 -18
  230. package/esm2015/lib/components/image/image.component.js +0 -15
  231. package/esm2015/lib/components/info/info.component.js +0 -12
  232. package/esm2015/lib/components/inputs/input/input.component.js +0 -128
  233. package/esm2015/lib/components/inputs/input/input.module.js +0 -24
  234. package/esm2015/lib/components/inputs/input-search/input-search.component.js +0 -49
  235. package/esm2015/lib/components/inputs/input-search/input-search.module.js +0 -22
  236. package/esm2015/lib/components/inputs/input-with-select/input-with-select.component.js +0 -54
  237. package/esm2015/lib/components/label/label.component.js +0 -33
  238. package/esm2015/lib/components/link/link.component.js +0 -48
  239. package/esm2015/lib/components/loader/loader.component.js +0 -19
  240. package/esm2015/lib/components/loader/loader.module.js +0 -18
  241. package/esm2015/lib/components/logo/logo.component.js +0 -17
  242. package/esm2015/lib/components/mosaic/mosaic.component.js +0 -34
  243. package/esm2015/lib/components/multiple-search/multiple-search.component.js +0 -113
  244. package/esm2015/lib/components/multiple-search-plus/multiple-search-plus.component.js +0 -83
  245. package/esm2015/lib/components/pagination/pagination.component.js +0 -44
  246. package/esm2015/lib/components/pagination/pagination.module.js +0 -24
  247. package/esm2015/lib/components/pagination/pipes/array-pages.pipe.js +0 -24
  248. package/esm2015/lib/components/pagination/pipes/custom-text.pipe.js +0 -33
  249. package/esm2015/lib/components/pagination/pipes/is-last-page.pipe.js +0 -21
  250. package/esm2015/lib/components/popin/popin.component.js +0 -56
  251. package/esm2015/lib/components/progress-bar/progress-bar.component.js +0 -74
  252. package/esm2015/lib/components/progress-bar/progress-bar.module.js +0 -18
  253. package/esm2015/lib/components/radio/radio.component.js +0 -51
  254. package/esm2015/lib/components/search/search.component.js +0 -75
  255. package/esm2015/lib/components/selected-list/selected-list.component.js +0 -51
  256. package/esm2015/lib/components/selects/select/select.component.js +0 -117
  257. package/esm2015/lib/components/selects/select-in-text/select-in-text.component.js +0 -89
  258. package/esm2015/lib/components/separator/separator.component.js +0 -18
  259. package/esm2015/lib/components/settings/settings.component.js +0 -13
  260. package/esm2015/lib/components/shared-components.module.js +0 -181
  261. package/esm2015/lib/components/snackbar/snackbar.component.js +0 -63
  262. package/esm2015/lib/components/state/state.component.js +0 -18
  263. package/esm2015/lib/components/switch/switch.component.js +0 -44
  264. package/esm2015/lib/components/tab/tab.component.js +0 -30
  265. package/esm2015/lib/components/table/directives/checkBoxRow.directive.js +0 -92
  266. package/esm2015/lib/components/table/directives/columnHeader.directive.js +0 -192
  267. package/esm2015/lib/components/table/directives/raw.directive.js +0 -29
  268. package/esm2015/lib/components/table/shared/filters-table.service.js +0 -70
  269. package/esm2015/lib/components/table/shared/table-checkbox-id.service.js +0 -18
  270. package/esm2015/lib/components/table/table.component.js +0 -130
  271. package/esm2015/lib/components/table/table.module.js +0 -31
  272. package/esm2015/lib/components/tag/tag.component.js +0 -30
  273. package/esm2015/lib/components/text/text.component.js +0 -16
  274. package/esm2015/lib/components/text-area/text-area.component.js +0 -67
  275. package/esm2015/lib/components/token-check/token-check.component.js +0 -21
  276. package/esm2015/lib/components/tooltip/tooltip.component.js +0 -27
  277. package/esm2015/lib/components/tooltip/tooltip.module.js +0 -18
  278. package/esm2015/lib/components/tree/tree.component.js +0 -20
  279. package/esm2015/lib/components/tree/tree.module.js +0 -20
  280. package/esm2015/lib/components/upload/upload.component.js +0 -31
  281. package/esm2015/lib/components/wrapper/wrapper.component.js +0 -18
  282. package/esm2015/lib/components/wrapper-blocs/wrapper-blocs.component.js +0 -19
  283. package/esm2015/lib/components/wrapper-sidebar/wrapper-sidebar.component.js +0 -19
  284. package/esm2015/lib/directives/abstract-debounce/abstract-debounce.directive.js +0 -34
  285. package/esm2015/lib/directives/abstract-debounce/debounce-keyup.directive.js +0 -21
  286. package/esm2015/lib/directives/auto-hide/auto-hide.directive.js +0 -48
  287. package/esm2015/lib/directives/keyboard-events/keypress-enter.directive.js +0 -21
  288. package/esm2015/lib/directives/ng-var.directive.js +0 -33
  289. package/esm2015/lib/directives/shared-directives.module.js +0 -20
  290. package/esm2015/lib/directives/zindex-toggle/zindex-toggle.directive.js +0 -43
  291. package/esm2015/lib/pipes/select/select-filters.pipe.js +0 -15
  292. package/esm2015/lib/pipes/selected-list/are-all-options-selected.pipe.js +0 -13
  293. package/esm2015/lib/pipes/shared-pipes.module.js +0 -22
  294. package/esm2015/lib/pipes/tree/format-object-to-recursif-tree.pipe.js +0 -37
  295. package/esm2015/lib/pipes/tree/format-object-to-simple-tree.pipe.js +0 -45
  296. package/esm2015/lib/services/dom.service.js +0 -64
  297. package/esm2015/lib/services/multiple-selection.service.js +0 -61
  298. package/esm2015/lib/wizi-components.module.js +0 -21
  299. package/esm2015/public-api.js +0 -97
  300. package/esm2015/wizishop-angular-components.js +0 -21
  301. package/fesm2015/wizishop-angular-components.js +0 -4017
  302. package/fesm2015/wizishop-angular-components.js.map +0 -1
  303. package/lib/components/block-with-checkbox/block-with-checkbox.component.d.ts +0 -14
  304. package/lib/components/breadcrumbs/breadcrumbs.component.d.ts +0 -10
  305. package/lib/components/breadcrumbs/breadcrumbs.dto.d.ts +0 -5
  306. package/lib/components/card-price/card-price.component.d.ts +0 -18
  307. package/lib/components/confirm-delete/confirm-delete.component.d.ts +0 -14
  308. package/lib/components/mosaic/mosaic.component.d.ts +0 -11
  309. package/lib/components/token-check/token-check.component.d.ts +0 -9
  310. package/lib/components/wrapper-sidebar/wrapper-sidebar.component.d.ts +0 -6
  311. package/wizishop-angular-components-0.0.164.tgz +0 -0
  312. package/wizishop-angular-components.d.ts +0 -20
  313. package/wizishop-angular-components.metadata.json +0 -1
@@ -1,4017 +0,0 @@
1
- import { NwbFilterRoutingBuilder, NwbAllModule, NwbFilterGroup } from '@wizishop/ng-wizi-bulma';
2
- import { Component, ViewEncapsulation, Input, EventEmitter, Output, Directive, HostListener, ɵɵdefineInjectable, ɵɵinject, ComponentFactoryResolver, ApplicationRef, INJECTOR, Injectable, Injector, ElementRef, Renderer2, TemplateRef, ViewContainerRef, NgModule, Inject, ContentChildren, ViewChild, Pipe } from '@angular/core';
3
- import { CommonModule, DOCUMENT } from '@angular/common';
4
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
6
- import { Subject, ReplaySubject, merge, fromEvent, interval } from 'rxjs';
7
- import { takeUntil, debounceTime, distinctUntilChanged, tap, map, takeWhile } from 'rxjs/operators';
8
- import { OverlayContainer } from '@angular/cdk/overlay';
9
- import { CdkTableModule } from '@angular/cdk/table';
10
- import { trigger, transition, style, animate, state } from '@angular/animations';
11
- import { TagInputModule } from 'ngx-chips';
12
- import { TranslateService, TranslateModule } from '@ngx-translate/core';
13
- import { RouterModule } from '@angular/router';
14
- import { AutosizeModule } from 'ngx-autosize';
15
-
16
- class LoaderComponent {
17
- constructor() {
18
- this.text = '';
19
- this.small = false;
20
- }
21
- }
22
- LoaderComponent.decorators = [
23
- { type: Component, args: [{
24
- selector: 'wac-loader',
25
- template: "<div class=\"wac-loader\" [ngClass]=\"{ 'is-small': small }\">\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",
26
- encapsulation: ViewEncapsulation.None
27
- },] }
28
- ];
29
- LoaderComponent.propDecorators = {
30
- text: [{ type: Input }],
31
- small: [{ type: Input }]
32
- };
33
-
34
- class InputSearchComponent {
35
- constructor() {
36
- this.placeholder = '';
37
- this.smallPadding = false; // todo Try to be more flexible like changing type : export type PaddingConfig = "default" | "small" | "big" | "no-padding";
38
- this.innerValue = '';
39
- this.changeDebounced = new EventEmitter(); // debounced
40
- this.onTouchedCallback = () => { };
41
- this.onChangeCallback = () => { };
42
- }
43
- get value() {
44
- return this.innerValue;
45
- }
46
- set value(v) {
47
- if (v !== this.innerValue) {
48
- this.innerValue = v;
49
- this.onChangeCallback(v);
50
- }
51
- }
52
- writeValue(value) {
53
- if (value !== this.innerValue) {
54
- this.innerValue = value;
55
- }
56
- }
57
- registerOnChange(fn) {
58
- this.onChangeCallback = fn;
59
- }
60
- registerOnTouched(fn) {
61
- this.onTouchedCallback = fn;
62
- }
63
- handleDebouncedKeyUp() {
64
- this.changeDebounced.emit(this.value);
65
- }
66
- }
67
- InputSearchComponent.decorators = [
68
- { type: Component, args: [{
69
- selector: 'wac-input-search',
70
- template: "<div class=\"wac-field-input-search\" [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()\"\n />\n <i class=\"icon fal fa-search\"></i>\n </p>\n</div>\n",
71
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: InputSearchComponent, multi: true }]
72
- },] }
73
- ];
74
- InputSearchComponent.propDecorators = {
75
- placeholder: [{ type: Input }],
76
- smallPadding: [{ type: Input }],
77
- id: [{ type: Input }],
78
- changeDebounced: [{ type: Output }]
79
- };
80
-
81
- class AbstractDebounceDirective {
82
- constructor() {
83
- this.debounceTime = 500;
84
- this.onEventChange = new EventEmitter();
85
- this.emitEvent$ = new Subject();
86
- this.subscription$ = new Subject();
87
- }
88
- ngOnInit() {
89
- this.emitEvent$
90
- .pipe(takeUntil(this.subscription$), debounceTime(this.debounceTime), distinctUntilChanged(), tap(value => this.emitChange(value)))
91
- .subscribe();
92
- }
93
- emitChange(value) {
94
- this.onEventChange.emit(value);
95
- }
96
- ngOnDestroy() {
97
- this.subscription$.next();
98
- this.subscription$.complete();
99
- }
100
- }
101
- AbstractDebounceDirective.decorators = [
102
- { type: Directive, args: [{
103
- selector: 'AbstractDebounceDirective'
104
- },] }
105
- ];
106
- AbstractDebounceDirective.ctorParameters = () => [];
107
- AbstractDebounceDirective.propDecorators = {
108
- debounceTime: [{ type: Input }],
109
- onEventChange: [{ type: Output }]
110
- };
111
-
112
- class DebounceKeyupDirective extends AbstractDebounceDirective {
113
- constructor() {
114
- super();
115
- }
116
- onKeyUp(event) {
117
- event.preventDefault();
118
- this.emitEvent$.next(event);
119
- }
120
- }
121
- DebounceKeyupDirective.decorators = [
122
- { type: Directive, args: [{
123
- selector: 'input[debounceKeyUp]'
124
- },] }
125
- ];
126
- DebounceKeyupDirective.ctorParameters = () => [];
127
- DebounceKeyupDirective.propDecorators = {
128
- onKeyUp: [{ type: HostListener, args: ['keyup', ['$event'],] }]
129
- };
130
-
131
- class DomService {
132
- constructor(componentFactoryResolver, appRef, injector, overlayContainer) {
133
- this.componentFactoryResolver = componentFactoryResolver;
134
- this.appRef = appRef;
135
- this.injector = injector;
136
- this.overlayContainer = overlayContainer;
137
- this.documentEventSource = new Subject();
138
- this.documentEventDone = this.documentEventSource.asObservable();
139
- this.eventInitialisation = true;
140
- this.documentScrollSource = new Subject();
141
- this.documentScrollDone = this.documentScrollSource.asObservable();
142
- }
143
- documentEvent() {
144
- this.setDocumentEventListener();
145
- return this.documentEventDone;
146
- }
147
- setDocumentEventListener() {
148
- if (!this.eventInitialisation) {
149
- return;
150
- }
151
- this.eventInitialisation = false;
152
- document.body.addEventListener('click', event => {
153
- this.documentEventSource.next(event.target);
154
- });
155
- }
156
- documentScroll() {
157
- return this.documentScrollDone;
158
- }
159
- setScrollEventListener() {
160
- window.onscroll = () => {
161
- this.documentScrollSource.next(window);
162
- };
163
- }
164
- attachComponentPortal(component, injector) {
165
- const componentRef = this.componentFactoryResolver
166
- .resolveComponentFactory(component)
167
- .create(injector ? injector : this.injector);
168
- this.appRef.attachView(componentRef.hostView);
169
- this.overlayContainer.getContainerElement().appendChild(this._getComponentRootNode(componentRef));
170
- return componentRef;
171
- }
172
- /** Gets the root HTMLElement for an instantiated component. */
173
- _getComponentRootNode(componentRef) {
174
- return componentRef.hostView.rootNodes[0];
175
- }
176
- }
177
- DomService.ɵprov = ɵɵdefineInjectable({ factory: function DomService_Factory() { return new DomService(ɵɵinject(ComponentFactoryResolver), ɵɵinject(ApplicationRef), ɵɵinject(INJECTOR), ɵɵinject(OverlayContainer)); }, token: DomService, providedIn: "root" });
178
- DomService.decorators = [
179
- { type: Injectable, args: [{
180
- providedIn: 'root'
181
- },] }
182
- ];
183
- DomService.ctorParameters = () => [
184
- { type: ComponentFactoryResolver },
185
- { type: ApplicationRef },
186
- { type: Injector },
187
- { type: OverlayContainer }
188
- ];
189
-
190
- class AutoHideDirective {
191
- constructor(_elementRef, domService) {
192
- this._elementRef = _elementRef;
193
- this.domService = domService;
194
- this.forceOn = null;
195
- this.clickOutside = new EventEmitter();
196
- }
197
- ngAfterViewInit() {
198
- this.subscription = this.domService.documentEvent().subscribe((targetElement) => {
199
- const clickedInside = this._elementRef.nativeElement.contains(targetElement);
200
- const classNameFromElement = targetElement.getAttribute('class');
201
- if (!clickedInside && (classNameFromElement === null || !classNameFromElement.includes(this.triggerElement))) {
202
- this.clickOutside.emit(null);
203
- }
204
- if (this.forceOn != null && classNameFromElement !== null) {
205
- let needToClose = true;
206
- this.forceOn.forEach(v => {
207
- if (!classNameFromElement.includes(v)) {
208
- needToClose = false;
209
- }
210
- });
211
- if (needToClose) {
212
- this.clickOutside.emit(null);
213
- }
214
- }
215
- });
216
- }
217
- ngOnDestroy() {
218
- this.subscription.unsubscribe();
219
- }
220
- }
221
- AutoHideDirective.decorators = [
222
- { type: Directive, args: [{
223
- selector: '[wzAutoHide]'
224
- },] }
225
- ];
226
- AutoHideDirective.ctorParameters = () => [
227
- { type: ElementRef },
228
- { type: DomService }
229
- ];
230
- AutoHideDirective.propDecorators = {
231
- triggerElement: [{ type: Input }],
232
- forceOn: [{ type: Input }],
233
- clickOutside: [{ type: Output, args: ['clickOutside',] }]
234
- };
235
-
236
- class ZindexToggleDirective {
237
- constructor(currentElement, renderer) {
238
- this.currentElement = currentElement;
239
- this.renderer = renderer;
240
- this.isActived = false;
241
- }
242
- set isActive(value) {
243
- this.isActived = value;
244
- this.switchToggle();
245
- }
246
- get isActive() {
247
- return this.isActived;
248
- }
249
- ngOnInit() {
250
- }
251
- switchToggle() {
252
- if (this.isActived) {
253
- this.renderer.addClass(this.currentElement.nativeElement.parentElement.parentNode, 'zindexToggle');
254
- this.renderer.addClass(this.currentElement.nativeElement.parentElement.parentNode.parentNode, 'zindexToggle');
255
- }
256
- else {
257
- this.renderer.removeClass(this.currentElement.nativeElement.parentElement.parentNode, 'zindexToggle');
258
- this.renderer.removeClass(this.currentElement.nativeElement.parentElement.parentNode.parentNode, 'zindexToggle');
259
- }
260
- }
261
- ngOnDestroy() {
262
- }
263
- }
264
- ZindexToggleDirective.decorators = [
265
- { type: Directive, args: [{
266
- selector: '[zIndexToggle]'
267
- },] }
268
- ];
269
- ZindexToggleDirective.ctorParameters = () => [
270
- { type: ElementRef },
271
- { type: Renderer2 }
272
- ];
273
- ZindexToggleDirective.propDecorators = {
274
- onEventChange: [{ type: Output }],
275
- isActive: [{ type: Input, args: ['zIndexToggle',] }]
276
- };
277
-
278
- class VarDirective {
279
- constructor(templateRef, vcRef) {
280
- this.templateRef = templateRef;
281
- this.vcRef = vcRef;
282
- this.context = {
283
- $implicit: null,
284
- ngVar: null,
285
- };
286
- this.hasView = false;
287
- }
288
- // https://stackoverflow.com/questions/38582293/how-to-declare-a-variable-in-a-template-in-angular
289
- set ngVar(context) {
290
- this.context.$implicit = this.context.ngVar = context;
291
- if (!this.hasView) {
292
- this.vcRef.createEmbeddedView(this.templateRef, this.context);
293
- this.hasView = true;
294
- }
295
- }
296
- }
297
- VarDirective.decorators = [
298
- { type: Directive, args: [{
299
- selector: '[ngVar]',
300
- },] }
301
- ];
302
- VarDirective.ctorParameters = () => [
303
- { type: TemplateRef },
304
- { type: ViewContainerRef }
305
- ];
306
- VarDirective.propDecorators = {
307
- ngVar: [{ type: Input }]
308
- };
309
-
310
- class KeypressEnterDirective {
311
- constructor() {
312
- this.KEYPRESS_ENTER = "Enter";
313
- this.keypressEnter = new EventEmitter();
314
- }
315
- onKeypress(event) {
316
- if (event.key === this.KEYPRESS_ENTER) {
317
- this.keypressEnter.next(true);
318
- }
319
- }
320
- }
321
- KeypressEnterDirective.decorators = [
322
- { type: Directive, args: [{ selector: '[keypressEnter]' },] }
323
- ];
324
- KeypressEnterDirective.ctorParameters = () => [];
325
- KeypressEnterDirective.propDecorators = {
326
- onKeypress: [{ type: HostListener, args: ['keypress', ['$event'],] }],
327
- keypressEnter: [{ type: Output }]
328
- };
329
-
330
- const directives = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective];
331
- class SharedDirectives {
332
- }
333
- SharedDirectives.decorators = [
334
- { type: NgModule, args: [{
335
- imports: [CommonModule, FormsModule],
336
- declarations: directives,
337
- exports: directives
338
- },] }
339
- ];
340
-
341
- const inOutY = trigger('inOutYAnimation', [
342
- transition(':enter', [
343
- style({ transform: 'scaleY(0)', height: 0, opacity: 0 }),
344
- animate('.3s ease-out', style({ transform: 'scaleY(1)', height: 'auto', opacity: 1 }))
345
- ]),
346
- transition(':leave', [
347
- style({ transform: 'scaleY(1)', height: 'auto', opacity: 1 }),
348
- animate('.3s ease-in', style({ transform: 'scaleY(0)', height: 0, opacity: 0 }))
349
- ])
350
- ]);
351
-
352
- class CheckboxComponent {
353
- constructor() {
354
- this.label = '';
355
- this.alone = false;
356
- this.checked = false;
357
- this.hasInput = false;
358
- this.inputPlaceholder = '';
359
- this.id = '';
360
- this.whiteSpace = true;
361
- this.disabled = false;
362
- }
363
- registerOnChange(fn) {
364
- this._onChange = fn;
365
- }
366
- registerOnTouched(fn) {
367
- this._onTouched = fn;
368
- }
369
- setDisabledState(isDisabled) {
370
- this.disabled = isDisabled;
371
- }
372
- writeValue(obj) {
373
- this.value = obj;
374
- }
375
- onChange(value) {
376
- if (this._onChange) {
377
- this._onChange(value);
378
- }
379
- }
380
- onTextInputChange(value) {
381
- if (this._onTextInputChange) {
382
- this._onTextInputChange(value);
383
- }
384
- }
385
- inputClick($event) {
386
- $event.stopPropagation();
387
- }
388
- }
389
- CheckboxComponent.decorators = [
390
- { type: Component, args: [{
391
- selector: 'wac-checkbox',
392
- template: "<div class=\"wac-field-checkbox\" [ngClass]=\"{ 'wac-field-checkbox--nowrap': type === 'column', 'disable-wt' : !whiteSpace, alone: alone }\">\n <div class=\"wac-field-checkbox__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\"><span [innerHTML]=\"label\"></span></label>\n </div>\n <input\n *ngIf=\"hasInput && checked\"\n [@inOutYAnimation]\n type=\"text\"\n [placeholder]=\"inputPlaceholder\"\n (click)=\"inputClick($event)\"\n />\n</div>\n",
393
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }],
394
- animations: [inOutY]
395
- },] }
396
- ];
397
- CheckboxComponent.ctorParameters = () => [];
398
- CheckboxComponent.propDecorators = {
399
- label: [{ type: Input }],
400
- value: [{ type: Input }],
401
- type: [{ type: Input }],
402
- alone: [{ type: Input }],
403
- checked: [{ type: Input }],
404
- hasInput: [{ type: Input }],
405
- inputPlaceholder: [{ type: Input }],
406
- id: [{ type: Input }],
407
- name: [{ type: Input }],
408
- whiteSpace: [{ type: Input }]
409
- };
410
-
411
- class FiltersTableService {
412
- constructor(filterRoutingBuilder) {
413
- this.filterRoutingBuilder = filterRoutingBuilder;
414
- this.filterGroups = new Map();
415
- this.sortSubject = new Subject();
416
- }
417
- getTableFilterGroup(dataTableName) {
418
- if (this.filterGroups.has(dataTableName)) {
419
- return this.filterGroups.get(dataTableName);
420
- }
421
- const dataTableFilters = {
422
- sort: undefined,
423
- order: undefined,
424
- searchValue: undefined,
425
- totalItems: 0,
426
- itemsPerPage: 0,
427
- currentPage: 0
428
- };
429
- const filterGroup = this.filterRoutingBuilder.group(dataTableFilters, dataTableName);
430
- filterGroup.tableFiltersValuesChange$ = new ReplaySubject(1);
431
- filterGroup.tableFiltersValuesDebouncedChange$ = filterGroup.tableFiltersValuesChange$.pipe(debounceTime(300));
432
- this.filterGroups.set(dataTableName, filterGroup);
433
- return filterGroup;
434
- }
435
- /**
436
- * Use to reset the others sorts of the table
437
- * @param dataTableName
438
- * @param sortName
439
- * @param order
440
- */
441
- emitSortChange(dataTableName, sortName, order) {
442
- this.sortSubject.next({ dataTableName, sortName, order });
443
- }
444
- getSortChangeListner() {
445
- return this.sortSubject.asObservable();
446
- }
447
- setPaginationFilters(dataTableName, totalItems, itemsPerPage, currentPage) {
448
- const filterGroup = this.getTableFilterGroup(dataTableName);
449
- filterGroup.setValues({
450
- itemsPerPage,
451
- currentPage
452
- });
453
- }
454
- /*
455
- Add defaults filters in the URL if they not exists.
456
- */
457
- setInitialPaginationFiltersIfNotExist(dataTableName, itemsPerPage, currentPage) {
458
- const filterGroup = this.getTableFilterGroup(dataTableName);
459
- filterGroup.setValues({
460
- itemsPerPage: filterGroup.get('itemsPerPage') ? parseInt(filterGroup.get('itemsPerPage')) : itemsPerPage,
461
- currentPage: filterGroup.get('currentPage') ? parseInt(filterGroup.get('currentPage')) : currentPage
462
- });
463
- }
464
- }
465
- FiltersTableService.ɵprov = ɵɵdefineInjectable({ factory: function FiltersTableService_Factory() { return new FiltersTableService(ɵɵinject(NwbFilterRoutingBuilder)); }, token: FiltersTableService, providedIn: "root" });
466
- FiltersTableService.decorators = [
467
- { type: Injectable, args: [{
468
- providedIn: 'root'
469
- },] }
470
- ];
471
- FiltersTableService.ctorParameters = () => [
472
- { type: NwbFilterRoutingBuilder }
473
- ];
474
-
475
- class HtmlContainer {
476
- constructor(hostElement, appRef, componentFactoryResolver, injector) {
477
- this.hostElement = hostElement;
478
- this.appRef = appRef;
479
- this.componentFactoryResolver = componentFactoryResolver;
480
- this.injector = injector;
481
- this.attached = false;
482
- }
483
- attach(component) {
484
- if (this.attached) {
485
- throw new Error('component has already been attached');
486
- }
487
- this.attached = true;
488
- const childComponentFactory = this.componentFactoryResolver.resolveComponentFactory(component);
489
- let componentRef = childComponentFactory.create(this.injector);
490
- this.appRef.attachView(componentRef.hostView);
491
- this.disposeFn = () => {
492
- this.appRef.detachView(componentRef.hostView);
493
- componentRef.destroy();
494
- };
495
- this.hostElement.appendChild(componentRef.hostView.rootNodes[0]);
496
- return componentRef;
497
- }
498
- dispose() {
499
- if (this.attached) {
500
- this.disposeFn();
501
- }
502
- }
503
- }
504
-
505
- class TableCheckboxIdService {
506
- constructor() {
507
- this.nbCheckboxInstances = 0;
508
- TableCheckboxIdService.tableInstance++;
509
- this.currentTableInstance = TableCheckboxIdService.tableInstance;
510
- }
511
- getUniqueId() {
512
- this.nbCheckboxInstances++;
513
- return `wac-table-${this.currentTableInstance}-${this.nbCheckboxInstances}`;
514
- }
515
- }
516
- TableCheckboxIdService.tableInstance = 0;
517
- TableCheckboxIdService.decorators = [
518
- { type: Injectable }
519
- ];
520
- TableCheckboxIdService.ctorParameters = () => [];
521
-
522
- class CheckBoxRow {
523
- constructor(currentRow, appRef, renderer, document, resolver, injector, tableCheckboxIdService) {
524
- this.currentRow = currentRow;
525
- this.appRef = appRef;
526
- this.renderer = renderer;
527
- this.document = document;
528
- this.resolver = resolver;
529
- this.injector = injector;
530
- this.tableCheckboxIdService = tableCheckboxIdService;
531
- this.checkBoxValueChange = new EventEmitter();
532
- }
533
- set checkBoxValue(value) {
534
- this._value = value;
535
- if (this.checkboxComponentRef) {
536
- this.setCheckBoxValue();
537
- }
538
- }
539
- get checkBoxValue() {
540
- return this._value;
541
- }
542
- ngOnInit() {
543
- this.createCheckBoxComponent();
544
- this.handleChecboxInputs();
545
- this.handleCheckboxOutputs();
546
- }
547
- createCheckBoxComponent() {
548
- // Create the container
549
- this.checkBoxElement = document.createElement('div');
550
- this.checkBoxElement.className = 'wac-table__body__line__cell wac-table__body__line__cell--checkbox';
551
- // Insert divCheckBox in the DOM as the first child of the row
552
- this.renderer.insertBefore(this.currentRow.nativeElement, this.checkBoxElement, this.currentRow.nativeElement.firstChild);
553
- // Insert the CheckBoxComponent inside the container (DOM and Angular DOM)
554
- this.htmlContainer = new HtmlContainer(this.checkBoxElement, this.appRef, this.resolver, this.injector);
555
- this.checkboxComponentRef = this.htmlContainer.attach(CheckboxComponent);
556
- }
557
- handleChecboxInputs() {
558
- this.checkboxComponentRef.instance.id = this.checkBoxId ? '' + this.checkBoxId : this.tableCheckboxIdService.getUniqueId();
559
- this.checkboxComponentRef.instance.name = this.checkBoxName ? this.checkBoxName : undefined;
560
- this.checkboxComponentRef.instance.alone = true;
561
- this.setCheckBoxValue();
562
- }
563
- setCheckBoxValue() {
564
- this.checkboxComponentRef.instance.value = this.checkBoxValue;
565
- }
566
- handleCheckboxOutputs() {
567
- // Detect checkbox changes
568
- this.checkboxComponentRef.instance.registerOnChange(() => {
569
- this._toggleCheckbox();
570
- });
571
- }
572
- _toggleCheckbox() {
573
- this.checkBoxValueChange.emit(this.checkBoxValue);
574
- }
575
- getElement() {
576
- return this.checkBoxElement.querySelector('.wac-field-checkbox');
577
- }
578
- isActive() {
579
- return !!this.checkboxComponentRef.instance.value;
580
- }
581
- setActive(isActive) {
582
- this.checkboxComponentRef.instance.value = isActive; //? does not trigger output
583
- }
584
- ngOnDestroy() {
585
- this.htmlContainer.dispose();
586
- }
587
- }
588
- CheckBoxRow.decorators = [
589
- { type: Directive, args: [{
590
- selector: '[checkBoxRow]'
591
- },] }
592
- ];
593
- CheckBoxRow.ctorParameters = () => [
594
- { type: ElementRef },
595
- { type: ApplicationRef },
596
- { type: Renderer2 },
597
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
598
- { type: ComponentFactoryResolver },
599
- { type: Injector },
600
- { type: TableCheckboxIdService }
601
- ];
602
- CheckBoxRow.propDecorators = {
603
- checkBoxId: [{ type: Input, args: ['checkBoxId',] }],
604
- checkBoxName: [{ type: Input, args: ['checkBoxName',] }],
605
- checkBoxValue: [{ type: Input, args: ['checkBoxValue',] }],
606
- checkBoxValueChange: [{ type: Output }]
607
- };
608
-
609
- class MultiSelectionService {
610
- constructor() {
611
- this.activeChanges = new Subject();
612
- this.activeChanges$ = this.activeChanges.asObservable();
613
- }
614
- handle(items, toggleSingleItem = false) {
615
- if (!items || !items.first) {
616
- this.destroy();
617
- return;
618
- }
619
- this.destroy(); // close previous subsciption
620
- this.items = items;
621
- const clicks$ = this.getListeners();
622
- this.subscription = merge(...clicks$).subscribe(({ component, isShift: isShiftKeyPressed, index }) => {
623
- if (!isShiftKeyPressed) {
624
- if (toggleSingleItem) {
625
- component.setActive(!component.isActive());
626
- }
627
- this.activeChanges.next([index]);
628
- this.lastIndex = index;
629
- return;
630
- }
631
- const start = index;
632
- const end = this.lastIndex;
633
- const [first, last] = [Math.min(start, end), Math.max(start, end) + 1];
634
- const itemsSelection = this.items.toArray().slice(first, last);
635
- const isBeginnerItemActive = this.items.get(end).isActive();
636
- itemsSelection.forEach(current => current.setActive(isBeginnerItemActive));
637
- window.getSelection().removeAllRanges(); // remove text selection
638
- const indexInRange = Array.from({ length: last - first }, (x, i) => i + first);
639
- this.activeChanges.next(indexInRange);
640
- });
641
- }
642
- getListeners() {
643
- return this.items.map((item, index) => {
644
- return fromEvent(item.getElement(), 'click').pipe(map((event) => {
645
- return {
646
- index,
647
- isShift: event.shiftKey,
648
- component: item
649
- };
650
- }))
651
- .pipe(debounceTime(100)); // debounced, because when clicking on a wac-checkbox it is emitted twice and can not find why
652
- });
653
- }
654
- getActives() {
655
- return this.items.filter(item => item.isActive());
656
- }
657
- destroy() {
658
- var _a;
659
- (_a = this.subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
660
- }
661
- }
662
- MultiSelectionService.decorators = [
663
- { type: Injectable }
664
- ];
665
- MultiSelectionService.ctorParameters = () => [];
666
-
667
- class TableRow {
668
- constructor(currentCell, renderer, document) {
669
- this.currentCell = currentCell;
670
- this.renderer = renderer;
671
- this.document = document;
672
- }
673
- ngAfterViewInit() {
674
- this.applyCustomStylesOnCell();
675
- }
676
- applyCustomStylesOnCell() {
677
- this.renderer.addClass(this.currentCell.nativeElement, 'wac-table__body__line');
678
- }
679
- }
680
- TableRow.decorators = [
681
- { type: Directive, args: [{
682
- // The selector has the same name as the tableRaw selector in table.component.html
683
- selector: '[tableRow]'
684
- },] }
685
- ];
686
- TableRow.ctorParameters = () => [
687
- { type: ElementRef },
688
- { type: Renderer2 },
689
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
690
- ];
691
-
692
- class TableComponent {
693
- constructor(filtersTableService, tableCheckboxIdService, multiSelectionService) {
694
- this.filtersTableService = filtersTableService;
695
- this.tableCheckboxIdService = tableCheckboxIdService;
696
- this.multiSelectionService = multiSelectionService;
697
- this.tableFiltersChange = new EventEmitter();
698
- this.placeholder = '';
699
- /// Input/Output of checkbox ///
700
- /** Pass to true to display checkbox in the header table */
701
- this.checkbox = false;
702
- this.toggleAllCheckBox = new EventEmitter(); // todo replace by checkBoxSelectionChange
703
- this.checkBoxSelectionChange = new EventEmitter(); // todo add to doc
704
- /// Input to disable section ///
705
- /** Pass to true to hide search input */
706
- this.disableSearch = false;
707
- /** Pass to true to hide the pagniator */
708
- this.disablePagniation = false;
709
- /// Input for loader on table body ///
710
- this.isLoading = false;
711
- }
712
- ngOnInit() {
713
- this.headerCheckBoxId = this.tableCheckboxIdService.getUniqueId(); // Create checkbox unique id
714
- /* Handle routing filters */
715
- if (this.tableRoutingName) {
716
- this.filtersTableService.setInitialPaginationFiltersIfNotExist(this.tableRoutingName, this.tableFilters.itemsPerPage, this.tableFilters.currentPage);
717
- this._tableFiltersGroup = this.filtersTableService.getTableFilterGroup(this.tableRoutingName);
718
- this.setTablesFilters();
719
- // Listen to filters changes with debounced time to limit multiple api calls
720
- this.filterGroupChangeSub = this._tableFiltersGroup.valuesChange$.subscribe(() => {
721
- this.setTablesFilters();
722
- });
723
- }
724
- this.multiSelectionService.activeChanges$.subscribe(selectionIndexRawCheckChange => {
725
- this.checkBoxSelectionChange.emit(selectionIndexRawCheckChange);
726
- });
727
- }
728
- ngAfterViewInit() {
729
- this.multiSelectionService.handle(this.checkBoxRows);
730
- this.checkBoxRows.changes.subscribe(() => {
731
- this.multiSelectionService.handle(this.checkBoxRows);
732
- });
733
- console.log('this.tableRows', this.tableRows);
734
- }
735
- onToggleAllCheckBox(event) {
736
- this.toggleAllCheckBox.emit(event.target.checked);
737
- }
738
- searchChange() {
739
- // Reset table filters
740
- this.tableFilters.sort = undefined;
741
- this.tableFilters.order = undefined;
742
- this.tableFilters.currentPage = 1;
743
- this.tableFiltersChange.emit(this.tableFilters);
744
- // Reset routing filters
745
- if (this._tableFiltersGroup) {
746
- this._tableFiltersGroup.setValues({
747
- searchValue: this.tableFilters.searchValue,
748
- sort: undefined,
749
- order: undefined,
750
- currentPage: 1
751
- });
752
- }
753
- }
754
- pageChange() {
755
- this.tableFiltersChange.emit(this.tableFilters);
756
- if (this._tableFiltersGroup) {
757
- this._tableFiltersGroup.setValues({
758
- itemsPerPage: this.tableFilters.itemsPerPage,
759
- currentPage: this.tableFilters.currentPage
760
- });
761
- }
762
- }
763
- /**
764
- * Set tableFilters from routing data existing in the url
765
- * */
766
- setTablesFilters() {
767
- this.tableFilters = {
768
- sort: this._tableFiltersGroup.get('sort'),
769
- order: this._tableFiltersGroup.get('order') ? this._tableFiltersGroup.get('order') === 'true' : undefined,
770
- searchValue: this._tableFiltersGroup.get('searchValue'),
771
- itemsPerPage: this._tableFiltersGroup.get('itemsPerPage') ? parseInt(this._tableFiltersGroup.get('itemsPerPage')) : 0,
772
- currentPage: this._tableFiltersGroup.get('currentPage') ? parseInt(this._tableFiltersGroup.get('currentPage')) : 0,
773
- totalItems: this.tableFilters.totalItems
774
- };
775
- this.tableFiltersChange.emit(this.tableFilters);
776
- this._tableFiltersGroup.tableFiltersValuesChange$.next(this.tableFilters);
777
- }
778
- ngOnDestroy() {
779
- if (this.filterGroupChangeSub) {
780
- this.filterGroupChangeSub.unsubscribe();
781
- }
782
- this.multiSelectionService.destroy();
783
- }
784
- }
785
- TableComponent.decorators = [
786
- { type: Component, args: [{
787
- selector: 'wac-table',
788
- template: "<div class=\"wac-table\">\n <!-- Header section -->\n <div class=\"wac-table__head\" id=\"headerTable\">\n <div *ngIf=\"checkbox\" class=\"wac-table__head__cell wac-table__head__cell--checkbox\">\n <wac-checkbox [id]=\"headerCheckBoxId\" (change)=\"onToggleAllCheckBox($event)\" [alone]=\"true\"></wac-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=\"wac-table__search\">\n <wac-input-search\n [(ngModel)]=\"tableFilters.searchValue\"\n (changeDebounced)=\"searchChange()\"\n [placeholder]=\"placeholder\"\n [smallPadding]=\"true\"\n ></wac-input-search>\n </div>\n\n <!-- Body section -->\n <div class=\"wac-table__body\">\n <!-- Loader on body -->\n <div class=\"wac-table__body__loader\" *ngIf=\"isLoading\">\n <wac-loader [small]=\"true\"></wac-loader>\n </div>\n <!-- Body contents are added with the tableRow directive -->\n <ng-content select=\".complex-table\" *ngIf=\"!isLoading\"></ng-content>\n <ng-content select=\"[tableRow]\" *ngIf=\"!isLoading\"></ng-content>\n </div>\n\n <!-- Pagination section -->\n <wac-pagination *ngIf=\"!disablePagniation\" [pagination]=\"tableFilters\" (pageChange)=\"pageChange()\"></wac-pagination>\n</div>\n",
789
- encapsulation: ViewEncapsulation.None,
790
- providers: [
791
- TableCheckboxIdService,
792
- MultiSelectionService
793
- ]
794
- },] }
795
- ];
796
- TableComponent.ctorParameters = () => [
797
- { type: FiltersTableService },
798
- { type: TableCheckboxIdService },
799
- { type: MultiSelectionService }
800
- ];
801
- TableComponent.propDecorators = {
802
- checkBoxRows: [{ type: ContentChildren, args: [CheckBoxRow,] }],
803
- tableRows: [{ type: ContentChildren, args: [TableRow,] }],
804
- tableFilters: [{ type: Input }],
805
- tableFiltersChange: [{ type: Output }],
806
- tableRoutingName: [{ type: Input }],
807
- placeholder: [{ type: Input }],
808
- checkbox: [{ type: Input }],
809
- toggleAllCheckBox: [{ type: Output }],
810
- checkBoxSelectionChange: [{ type: Output }],
811
- disableSearch: [{ type: Input }],
812
- disablePagniation: [{ type: Input }],
813
- isLoading: [{ type: Input }]
814
- };
815
-
816
- class TagComponent {
817
- constructor() {
818
- this.label = '';
819
- this.hasClose = false;
820
- this.big = false;
821
- this.isOpen = true;
822
- this.isOpenChange = new EventEmitter();
823
- }
824
- toggleTag() {
825
- this.isOpen = !this.isOpen;
826
- this.isOpenChange.next(this.isOpen);
827
- }
828
- }
829
- TagComponent.decorators = [
830
- { type: Component, args: [{
831
- selector: 'wac-tag',
832
- template: "<div class=\"wac-tag\" [classList]=\"'wac-tag--' + class\" [ngClass]=\"{ hover: hasClose, 'big': big }\">\n {{ label }}\n <span class=\"wac-tag__close\" *ngIf=\"hasClose\" (click)=\"toggleTag()\"><i class=\"fas fa-times\"></i></span>\n</div>\n"
833
- },] }
834
- ];
835
- TagComponent.ctorParameters = () => [];
836
- TagComponent.propDecorators = {
837
- label: [{ type: Input }],
838
- class: [{ type: Input }],
839
- hasClose: [{ type: Input }],
840
- big: [{ type: Input }],
841
- isOpen: [{ type: Input }],
842
- isOpenChange: [{ type: Output }]
843
- };
844
-
845
- class TabComponent {
846
- constructor() {
847
- this.underline = false;
848
- this.button = false;
849
- this.tabs = [];
850
- this.index = 0;
851
- this.indexChange = new EventEmitter();
852
- }
853
- valueChanged(i) {
854
- this.index = i;
855
- this.indexChange.emit(this.index);
856
- }
857
- }
858
- TabComponent.decorators = [
859
- { type: Component, args: [{
860
- selector: 'wac-tab',
861
- template: "<div class=\"wac-tab\" [ngClass]=\"{'wac-tab--underline': underline, 'wac-tab--button' : button}\">\n <div class=\"wac-tab__wrapper\">\n <a\n *ngFor=\"let tab of tabs\"\n class=\"wac-tab__wrapper__tab\"\n [ngClass]=\"index === tab.index ? 'wac-tab__wrapper__tab--selected' : ''\"\n (click)=\"valueChanged(tab.index)\"\n >\n {{ tab.label }}\n </a>\n </div>\n</div>\n",
862
- encapsulation: ViewEncapsulation.None
863
- },] }
864
- ];
865
- TabComponent.ctorParameters = () => [];
866
- TabComponent.propDecorators = {
867
- underline: [{ type: Input }],
868
- button: [{ type: Input }],
869
- tabs: [{ type: Input }],
870
- index: [{ type: Input }],
871
- indexChange: [{ type: Output }]
872
- };
873
-
874
- class ButtonComponent {
875
- constructor() {
876
- this.extraClasses = 'is-info'; // todo make a list of existing class
877
- this.label = '';
878
- this.icon = '';
879
- this.textcolor = null;
880
- this.widthAuto = false;
881
- this.contentHorizontalPosition = 'center';
882
- this.iconFontSize = 12;
883
- this.hasLoader = false;
884
- this.disabled = false;
885
- this.whiteSpaceNowrap = false;
886
- this.opacity = false;
887
- // TODO MAKE ANNIMATION AVAILABLE FOR MOBILE as CONFIRM DELETE DO (because, its doeant show the text and trigger click)
888
- this.animation = false;
889
- this.animationRight = false;
890
- this.animationText = '';
891
- this.confirmDelete = false;
892
- this.confirmDeleteText = '';
893
- this.confirmDeletePosition = 'right';
894
- this.click = new EventEmitter();
895
- this.isLoadingChange = new EventEmitter();
896
- this._isLoading = false;
897
- this.interval = null;
898
- this.waitForConfirmDelete = false;
899
- this.buttonMaxWidth = '0px';
900
- this.buttonWidth = '0px';
901
- this.buttonMaxWidthDelete = '0px';
902
- this.buttonWidthDelete = '0px';
903
- this.currentLoading = 0;
904
- }
905
- set isLoading(isLoading) {
906
- this._isLoading = isLoading;
907
- this.isLoadingChange.next(isLoading);
908
- this.toggleLoading();
909
- }
910
- get isLoading() {
911
- return this._isLoading;
912
- }
913
- ngOnInit() {
914
- if (this.confirmDelete) {
915
- this.waitForConfirmDelete = true;
916
- }
917
- }
918
- toggleLoading() {
919
- this.currentLoading = this.isLoading ? 10 : 100;
920
- interval(200).pipe(takeWhile(time => this.isLoading)).subscribe(() => {
921
- if (this.currentLoading < 85) {
922
- this.currentLoading += Math.floor(Math.random() * 15);
923
- }
924
- });
925
- }
926
- addMaxWidth() {
927
- this.buttonMaxWidth = this.buttonWidth + 'px';
928
- }
929
- resetMaxWidth() {
930
- this.buttonMaxWidth = '0px';
931
- }
932
- addMaxWidthDelete() {
933
- this.buttonMaxWidthDelete = this.buttonWidthDelete + 'px';
934
- }
935
- resetMaxWidthDelete() {
936
- this.buttonMaxWidthDelete = '0px';
937
- this.waitForConfirmDelete = true;
938
- }
939
- onButtonClick(event) {
940
- event.stopPropagation();
941
- if (this.disabled) {
942
- return;
943
- }
944
- if (this.hasLoader) {
945
- this.isLoading = false;
946
- setTimeout(() => {
947
- this.isLoading = true;
948
- }, 0);
949
- }
950
- if (!this.waitForConfirmDelete) {
951
- this.click.emit(event);
952
- if (this.confirmDelete) {
953
- this.resetMaxWidthDelete();
954
- }
955
- }
956
- else {
957
- this.waitForConfirmDelete = false;
958
- }
959
- }
960
- ngAfterViewInit() {
961
- setTimeout(() => {
962
- if (this.animation) {
963
- this.buttonWidth = this.calculWidth.nativeElement.offsetWidth;
964
- }
965
- if (this.confirmDelete) {
966
- this.buttonWidthDelete = this.calculWidthDelete.nativeElement.offsetWidth;
967
- }
968
- }, 1000);
969
- }
970
- }
971
- ButtonComponent.decorators = [
972
- { type: Component, args: [{
973
- selector: 'wac-button',
974
- template: "<a\n [class]=\"'wac-button ' + extraClasses\"\n (click)=\"confirmDelete && waitForConfirmDelete ? addMaxWidthDelete() : '';onButtonClick($event);\"\n (mouseleave)=\"animation ? resetMaxWidth() : '';\"\n (mouseenter)=\"animation ? addMaxWidth() : '';\"\n wzAutoHide (clickOutside)=\"confirmDelete && !waitForConfirmDelete ? resetMaxWidthDelete() : ''\"\n [ngClass]=\"[\n label === '' ? 'alone' : '',\n coin ? 'has-coin width-auto' : '',\n animationRight ? 'animation-right' : '',\n animation ? 'animationText' : '',\n isLoading ? 'is-loading' : '',\n opacity ? 'opacity' : '',\n disabled ? 'disabled' : '',\n widthAuto ? 'width-auto' : '',\n whiteSpaceNowrap ? 'white-space-no-wrap' : '',\n !waitForConfirmDelete && confirmDelete ? 'step-delete' : '',\n confirmDelete ? 'deletePosition-' + confirmDeletePosition : ''\n ]\"\n [ngStyle]=\"{\n 'text-align': contentHorizontalPosition\n }\"\n>\n <span class=\"wac-button__wrapper\" [style.color]=\"textcolor ? textcolor : ''\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n <span class=\"wac-button__animation\" [style.maxWidth]=\"buttonMaxWidth\" [style.width]=\"buttonWidth + 'px'\">\n <span #calculWidth class=\"wac-button__animation__text\" [innerHTML]=\"animationText\"></span>\n </span>\n <span class=\"wac-button__confirmDelete\" [style.maxWidth]=\"buttonMaxWidthDelete\" [style.width]=\"buttonWidthDelete + 'px'\">\n <span #calculWidthDelete class=\"wac-button__confirmDelete__text\" [innerHTML]=\"confirmDeleteText\"></span>\n </span>\n <span *ngIf=\"coin\" class=\"wac-button__coin\"><i class=\"fa-solid fa-coin-front\"></i><span [innerHTML]=\"coin\"></span></span>\n <span\n class=\"wac-button__loader\"\n [ngClass]=\"extraClasses.includes('is-outlined') ? 'outlined' : ''\"\n *ngIf=\"isLoading\"\n [style.width]=\"currentLoading + '%'\"\n >\n <span *ngIf=\"extraClasses.includes('is-outlined')\">\n <i *ngIf=\"icon !== ''\" [ngClass]=\"icon\" [style.font-size.px]=\"iconFontSize\"></i>\n {{ label }}\n <i *ngIf=\"iconNext !== ''\" [ngClass]=\"iconNext\" [style.font-size.px]=\"iconFontSize\"></i>\n </span>\n\n </span>\n</a>\n"
975
- },] }
976
- ];
977
- ButtonComponent.ctorParameters = () => [];
978
- ButtonComponent.propDecorators = {
979
- extraClasses: [{ type: Input }],
980
- label: [{ type: Input }],
981
- icon: [{ type: Input }],
982
- iconNext: [{ type: Input }],
983
- textcolor: [{ type: Input }],
984
- widthAuto: [{ type: Input }],
985
- contentHorizontalPosition: [{ type: Input }],
986
- iconFontSize: [{ type: Input }],
987
- hasLoader: [{ type: Input }],
988
- disabled: [{ type: Input }],
989
- whiteSpaceNowrap: [{ type: Input }],
990
- opacity: [{ type: Input }],
991
- animation: [{ type: Input }],
992
- animationRight: [{ type: Input }],
993
- animationText: [{ type: Input }],
994
- confirmDelete: [{ type: Input }],
995
- confirmDeleteText: [{ type: Input }],
996
- coin: [{ type: Input }],
997
- confirmDeletePosition: [{ type: Input }],
998
- click: [{ type: Output }],
999
- isLoading: [{ type: Input }],
1000
- isLoadingChange: [{ type: Output }],
1001
- calculWidth: [{ type: ViewChild, args: ['calculWidth',] }],
1002
- calculWidthDelete: [{ type: ViewChild, args: ['calculWidthDelete',] }]
1003
- };
1004
-
1005
- class InfoComponent {
1006
- constructor() { }
1007
- }
1008
- InfoComponent.decorators = [
1009
- { type: Component, args: [{
1010
- selector: 'wac-info',
1011
- template: "<div class=\"wac-info\">\n <div class=\"wac-info__wrapper\">\n <i class=\"fas fa-info-circle\"></i>\n <div class=\"wac-info__wrapper__sublevel\">\n <div class=\"wac-info__wrapper__sublevel__container\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</div>\n"
1012
- },] }
1013
- ];
1014
- InfoComponent.ctorParameters = () => [];
1015
-
1016
- class SettingsComponent {
1017
- constructor() { }
1018
- }
1019
- SettingsComponent.decorators = [
1020
- { type: Component, args: [{
1021
- selector: 'wac-settings',
1022
- template: "<div class=\"wac-settings\">\n <div class=\"wac-settings__wrapper\">\n <i class=\"fas fa-cog\"></i>\n </div>\n</div>\n",
1023
- encapsulation: ViewEncapsulation.None
1024
- },] }
1025
- ];
1026
- SettingsComponent.ctorParameters = () => [];
1027
-
1028
- class DeleteComponent {
1029
- constructor() { }
1030
- }
1031
- DeleteComponent.decorators = [
1032
- { type: Component, args: [{
1033
- selector: 'wac-delete',
1034
- template: "<div class=\"wac-delete\">\n <div class=\"wac-delete__wrapper\">\n <i class=\"fas fa-trash\"></i>\n </div>\n</div>\n"
1035
- },] }
1036
- ];
1037
- DeleteComponent.ctorParameters = () => [];
1038
-
1039
- class DropdownComponent {
1040
- constructor() {
1041
- this.hasIcons = false;
1042
- this.items = [];
1043
- this.userInput = new EventEmitter();
1044
- }
1045
- onUserInput(itemIndex) {
1046
- this.userInput.emit(itemIndex);
1047
- }
1048
- }
1049
- DropdownComponent.decorators = [
1050
- { type: Component, args: [{
1051
- selector: 'wac-dropdown',
1052
- template: "<div class=\"wac-dropdown\">\n <div class=\"wac-dropdown__wrapper\">\n <i class=\"wac-dropdown__wrapper__icon far fa-ellipsis-v\"></i>\n <div class=\"wac-dropdown__wrapper__sublevel\">\n <ul class=\"wac-dropdown__wrapper__sublevel__container\">\n <li\n *ngFor=\"let item of items\"\n class=\"wac-dropdown__wrapper__sublevel__container__item\"\n (click)=\"onUserInput(item.index)\"\n >\n <i\n *ngIf=\"hasIcons\"\n [class]=\"item.icon\"\n [style.font-size.px]=\"item.iconFontSize ? item.iconFontSize : '14'\"\n ></i>\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</div>\n"
1053
- },] }
1054
- ];
1055
- DropdownComponent.ctorParameters = () => [];
1056
- DropdownComponent.propDecorators = {
1057
- hasIcons: [{ type: Input }],
1058
- items: [{ type: Input }],
1059
- userInput: [{ type: Output }]
1060
- };
1061
-
1062
- class ImageComponent {
1063
- constructor() { }
1064
- }
1065
- ImageComponent.decorators = [
1066
- { type: Component, args: [{
1067
- selector: 'wac-image',
1068
- template: "<div class=\"wac-image\">\n <div class=\"wac-image__wrapper\" [ngClass]=\"src === '' ? 'empty' : ''\" [style.background-image]=\"'url(' + src + ')'\">\n <i class=\"fal fa-images\" *ngIf=\"src === ''\"></i>\n </div>\n</div>\n"
1069
- },] }
1070
- ];
1071
- ImageComponent.ctorParameters = () => [];
1072
- ImageComponent.propDecorators = {
1073
- src: [{ type: Input }]
1074
- };
1075
-
1076
- class BackComponent {
1077
- constructor() { }
1078
- }
1079
- BackComponent.decorators = [
1080
- { type: Component, args: [{
1081
- selector: 'wac-back',
1082
- template: "<div class=\"wac-back\">\n <div class=\"wac-back__wrapper\">\n <i class=\"fas fa-chevron-left\"></i>\n </div>\n</div>\n"
1083
- },] }
1084
- ];
1085
- BackComponent.ctorParameters = () => [];
1086
-
1087
- class SeparatorComponent {
1088
- constructor() {
1089
- this.dashed = false;
1090
- }
1091
- }
1092
- SeparatorComponent.decorators = [
1093
- { type: Component, args: [{
1094
- selector: 'wac-separator',
1095
- template: "<div class=\"wac-separator\" [ngClass]=\"dashed ? 'dashed' : ''\"></div>\n",
1096
- encapsulation: ViewEncapsulation.None
1097
- },] }
1098
- ];
1099
- SeparatorComponent.ctorParameters = () => [];
1100
- SeparatorComponent.propDecorators = {
1101
- dashed: [{ type: Input }]
1102
- };
1103
-
1104
- class LogoComponent {
1105
- constructor() { }
1106
- }
1107
- LogoComponent.decorators = [
1108
- { type: Component, args: [{
1109
- selector: 'wac-logo',
1110
- template: "<div class=\"wac-logo\">\n <div class=\"wac-logo__wrapper\" [ngClass]=\"isWhite ? 'white' : ''\" *ngIf=\"isDropizi\">\n <svg id=\"Calque_1\" data-name=\"Calque 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 102.33 40\">\n <defs>\n <style>\n .cls-0 {\n fill: #fa096a;\n }\n </style>\n </defs>\n <title>Logo_Dropizi</title>\n <path\n id=\"Logo_Dropizi-2\"\n data-name=\"Logo Dropizi-2\"\n class=\"cls-0\"\n d=\"M83,44.94a4.87,4.87,0,0,1-4.36-7,3.81,3.81,0,0,1-.72-2l-.3-5.69a9.61,9.61,0,0,1-3.43,2,13.51,13.51,0,0,1-3.34.63l-1.06,0L70,36.29a3.75,3.75,0,0,1-3.54,3.94l-2.25.11H64a3.69,3.69,0,0,1-3-1.56,12.82,12.82,0,0,1-7.68,2.61,13.45,13.45,0,0,1-5.37-1.14,3.67,3.67,0,0,1-2.46,1.09l-2.15.12h-.2a3.76,3.76,0,0,1-3.17-1.74l-3.29-5.25L36.84,38a3.78,3.78,0,0,1-1,2.7A3.74,3.74,0,0,1,33.28,42L31,42.09h-.19a3.77,3.77,0,0,1-3.06-1.58,12.62,12.62,0,0,1-1.62.87,15,15,0,0,1-5.35,1.24L13.49,43H13.3a3.76,3.76,0,0,1-3.74-3.54L8.5,19.3A3.75,3.75,0,0,1,12,15.36L19.37,15c.3,0,.59,0,.88,0a14.67,14.67,0,0,1,4.56.7,13.17,13.17,0,0,1,1.74.7,3.73,3.73,0,0,1,3.06-1.91l7.14-.37c.35,0,.69,0,1,0,3.65,0,6,1.12,7.41,2.57A13.29,13.29,0,0,1,49,14.33a12.05,12.05,0,0,1,4.44-.82c.23,0,.45,0,.69,0a13.63,13.63,0,0,1,5.2,1.35l.22.11a3.75,3.75,0,0,1,3.25-2.29l5.32-.27c.7,0,1.38-.06,2-.06.92,0,1.78,0,2.57.11a10.17,10.17,0,0,1,4.16,1.26l.37.24a3.78,3.78,0,0,1,3.22-2.2l2.18-.12h.2a3.89,3.89,0,0,1,2,.57,3.63,3.63,0,0,1,2.07-.79l12.9-.67h.11c0-.24-.07-.47-.09-.71a4.88,4.88,0,0,1,4.62-5.12h.25a4.86,4.86,0,0,1,4.88,4.62v.26A4.89,4.89,0,0,1,109,12a3.62,3.62,0,0,1,.72,2l1.06,20.14,0,0a3.75,3.75,0,0,1-3.54,3.94l-2.18.11h-.2a3.83,3.83,0,0,1-2-.57,3.54,3.54,0,0,1-2.06.78l-12.9.68h-.1c0,.24.07.47.09.71a4.87,4.87,0,0,1-1.25,3.51,4.82,4.82,0,0,1-3.37,1.6Zm-2-4.87v.11a2,2,0,0,0,2.1,1.9h0a2,2,0,0,0,1.9-2V40a2,2,0,0,0-2-1.9H83A2,2,0,0,0,81.05,40.07ZM19.54,17.84l-7.34.39a.89.89,0,0,0-.84.93l1.06,20.17a.89.89,0,0,0,.92.83l7.33-.39a11.89,11.89,0,0,0,4.32-1,9.7,9.7,0,0,0,3.3-2.36,8.91,8.91,0,0,0,1.46-2.14L30,38.4a.88.88,0,0,0,.92.84l2.25-.12A.88.88,0,0,0,34,38.2h0l-.34-6.38a.88.88,0,0,1,.84-.93h0l2.67-.14a.89.89,0,0,1,.8.41l4.41,7a.92.92,0,0,0,.8.42l2.17-.12a.88.88,0,0,0,.72-1.34l-4.25-7A.88.88,0,0,1,42,29c.22-.18.44-.37.64-.56a10.07,10.07,0,0,0,.5,3,9.65,9.65,0,0,0,2,3.45,11.39,11.39,0,0,0,3.45,2.5,10,10,0,0,0,8.09.47,11,11,0,0,0,6.08-6l.08-.18.26,4.91a.89.89,0,0,0,.92.84l2.25-.12a.89.89,0,0,0,.84-.92L66.86,31a.87.87,0,0,1,.83-.92h0l3-.16a10.49,10.49,0,0,0,2.6-.5A6.87,6.87,0,0,0,75.75,28a6.67,6.67,0,0,0,1.68-2.36l0-.12A8.77,8.77,0,0,0,78,21.73a9,9,0,0,0-.77-3.49,4.1,4.1,0,0,0-.22-.41,4.71,4.71,0,0,0-1.63-1.63,7.28,7.28,0,0,0-3-.87,28.9,28.9,0,0,0-4.16,0l-5.33.28a.86.86,0,0,0-.61.29.9.9,0,0,0-.22.63L62.33,21a10.85,10.85,0,0,0-.8-1A11.54,11.54,0,0,0,54,16.38,9.3,9.3,0,0,0,50,17a10.46,10.46,0,0,0-3.46,2.22,11.5,11.5,0,0,0-1.92,2.41q-1-5.05-7.73-4.7l-7.14.37a.88.88,0,0,0-.84.93l.22,4.15a9.5,9.5,0,0,0-5.19-4,12.2,12.2,0,0,0-3.65-.56C20.05,17.82,19.79,17.82,19.54,17.84Zm63.22-3.31-2.17.12a.9.9,0,0,0-.61.29.87.87,0,0,0-.23.64l1.06,20.15a.88.88,0,0,0,.93.84L84,36.45a.83.83,0,0,0,.61-.29.87.87,0,0,0,.23-.63l-1-20.09a1,1,0,0,0-1-.9Zm11.48,3.85a.9.9,0,0,1,.07.87L86.94,35a.88.88,0,0,0,.06.86.85.85,0,0,0,.76.4l12.9-.67h0a.76.76,0,0,0,.72-.8h0l-.13-2.48a.75.75,0,0,0-.8-.72l-6.21.33a.89.89,0,0,1-.84-1.26l7.37-15.74a.9.9,0,0,0-.07-.87.87.87,0,0,0-.78-.39L87,14.31a.75.75,0,0,0-.71.8l.13,2.49a.74.74,0,0,0,.25.52.75.75,0,0,0,.55.2L93.46,18h.05A.89.89,0,0,1,94.24,18.38ZM106,13.31l-2.24.12a.89.89,0,0,0-.85.93l.85,16.15v.1l.2,3.83a1,1,0,0,0,1,.91l2.18-.11h0a.9.9,0,0,0,.83-.93l-1.06-20.16a.88.88,0,0,0-.88-.84Zm-3.32-3.5v.1a2,2,0,0,0,4-.1V9.7a2,2,0,0,0-2-1.9h-.1a2,2,0,0,0-1.91,2ZM16.25,35.28l-.66-12.51a.87.87,0,0,1,.23-.64.83.83,0,0,1,.61-.29l3.3-.18a6,6,0,0,1,4.87,1.62,7.74,7.74,0,0,1,1.92,5.19,7.71,7.71,0,0,1-1.37,5.35A6,6,0,0,1,20.47,36l-3.31.17h0a.88.88,0,0,1-.88-.84Zm36.61-.55A6.9,6.9,0,0,1,48,32.44a5.3,5.3,0,0,1-1.12-2.17,6.7,6.7,0,0,1-.09-2.6,11,11,0,0,1,2.57-5.41,6.42,6.42,0,0,1,2.07-1.58,5.52,5.52,0,0,1,2.4-.52,6.36,6.36,0,0,1,2.64.66,5.45,5.45,0,0,1,3.3,3.78A8.32,8.32,0,0,1,59,30.1a10.69,10.69,0,0,1-1.66,2.54,6.76,6.76,0,0,1-2.07,1.57,5.42,5.42,0,0,1-2.31.52.27.27,0,0,1-.09,0Zm-19.2-7.84a.83.83,0,0,1-.29-.61l-.26-4.91a.87.87,0,0,1,.83-.92l2.22-.12a5.2,5.2,0,0,1,3.39.63,3.08,3.08,0,0,1,1,2.41,3.29,3.29,0,0,1-.8,2.6,5.23,5.23,0,0,1-3.43,1l-2.07.11h0a.89.89,0,0,1-.59-.23Zm32.93-1.41-.31-5.84a.9.9,0,0,1,.23-.64.86.86,0,0,1,.61-.29l2.4-.12a8.81,8.81,0,0,1,2,.09,3.1,3.1,0,0,1,1.33.57,2.58,2.58,0,0,1,.75,1.09A6.22,6.22,0,0,1,73.94,22a4.16,4.16,0,0,1-.79,3.14A4.63,4.63,0,0,1,70,26.19l-2.51.13h0a.9.9,0,0,1-.89-.84Z\"\n transform=\"translate(-8.49 -4.94)\"\n />\n </svg>\n </div>\n <div class=\"wac-logo__wrapper\" [ngClass]=\"isWhite ? 'white' : ''\" *ngIf=\"!isDropizi\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128.044 40\">\n <defs>\n <style>\n .cls-1 {\n fill: #a4c445;\n }\n .cls-2 {\n fill: #52aecd;\n }\n </style>\n </defs>\n <g id=\"Logo_WiziShop\" transform=\"translate(0.024 0)\">\n <path\n id=\"Shop\"\n class=\"cls-1\"\n d=\"M50.812,38.431V12.3a2.468,2.468,0,0,1,2.452-1.643A2.307,2.307,0,0,1,55.446,12a7.058,7.058,0,0,1,4.107-1.348A5.245,5.245,0,0,1,63.218,12,6.1,6.1,0,0,1,64.7,16.365v7.208h-.012q0,7.282-5.835,7.282a8.453,8.453,0,0,1-3.224-.674v8.25A2.471,2.471,0,0,1,53.178,40,2.419,2.419,0,0,1,50.812,38.431Zm4.805-21.845V26a7.046,7.046,0,0,0,2.709.834c1.1-.012,1.655-1.091,1.655-3.248V15.912c0-.65-.4-.981-1.226-.981A3.59,3.59,0,0,0,55.617,16.586ZM33.858,19.614q0-9.727,7.159-9.721,4.1,0,5.762,3.065a15.8,15.8,0,0,1,1.067,6.656q0,4.56-1.226,6.8-1.655,3.144-6.031,3.138Q33.858,29.556,33.858,19.614Zm4.462,0c0,3.947.846,5.909,2.538,5.909,1.741.012,2.623-1.961,2.623-5.909q0-5.682-2.538-5.688Q38.315,13.926,38.321,19.614Zm-35.8,8.4A5.577,5.577,0,0,1,.172,23.917L0,22.262l4.536-.6a12.942,12.942,0,0,0,.613,2.317,1.976,1.976,0,0,0,2.01,1.189,1.375,1.375,0,0,0,1.226-.674A4.161,4.161,0,0,0,9,22.4c0-1.2-.736-2.623-2.219-4.266s-2.954-3.273-4.4-4.867A10,10,0,0,1,.025,7.2a9.322,9.322,0,0,1,.441-2.77Q1.955.012,6.84.012a7.629,7.629,0,0,1,4.585,1.5,5.555,5.555,0,0,1,2.317,4.131l.172,1.655-4.585.588a12.943,12.943,0,0,0-.613-2.317,1.976,1.976,0,0,0-2.01-1.189c-.7,0-1.189.429-1.483,1.275A3.756,3.756,0,0,0,4.965,7q0,2.537,4.622,7.416t4.622,8.017a7.691,7.691,0,0,1-1.876,4.72,6.225,6.225,0,0,1-5.185,2.39A7.665,7.665,0,0,1,2.525,28.011Zm23.488-.368V15.3c0-.552-.343-.821-1.042-.821a3.356,3.356,0,0,0-2.954,1.569v11.6a2.629,2.629,0,0,1-2.538,1.716,2.589,2.589,0,0,1-2.452-1.728V1.729A2.578,2.578,0,0,1,19.479,0a2.641,2.641,0,0,1,2.538,1.729v9.292a7.611,7.611,0,0,1,3.751-1.042,5.039,5.039,0,0,1,3.665,1.459,5.748,5.748,0,0,1,1.483,4.3V27.631a2.548,2.548,0,0,1-2.366,1.728l-.136,0A2.521,2.521,0,0,1,26.013,27.643Z\"\n transform=\"translate(63.32 0)\"\n />\n <path\n id=\"Wizi\"\n class=\"cls-2\"\n d=\"M13.341,28.661,12.2,22.617l-1.226,6.044a2.9,2.9,0,0,1-2.353,1.189,3.26,3.26,0,0,1-2.44-1.1L.064,2.55A1.793,1.793,0,0,1,.591.674,2.977,2.977,0,0,1,2.6,0c1.287,0,2.047.478,2.28,1.422L8.535,18.707l1.312-6.055a2.228,2.228,0,0,1,2.524-1.876,2.035,2.035,0,0,1,2.183,1.876l1.213,6.142Q16.816,12.6,18,6.3c.785-4.2,2.06-6.3,3.8-6.3a2.717,2.717,0,0,1,1.054.221,1.774,1.774,0,0,1,1.41,2.329l-6.032,26.1a2.881,2.881,0,0,1-2.354,1.2A3.247,3.247,0,0,1,13.341,28.661Zm39.816-.356V11.67c.293-.6,1.139-.895,2.537-.895,1.336,0,2.182.294,2.538.895V28.305c-.355.65-1.2.968-2.538.968C54.3,29.273,53.451,28.955,53.157,28.305Zm-15.667.968c-1.287-.147-1.924-.772-1.924-1.863a2.936,2.936,0,0,1,.343-1.5l7.16-10.984H37.33a2.307,2.307,0,0,1-1.765-2.182,2.226,2.226,0,0,1,1.778-2.182h10.1a2.144,2.144,0,0,1,1.679,2.1q0,1.8-2.574,5.529-2.483,3.366-4.879,6.73h5.7v-.013a2.235,2.235,0,0,1,0,4.364Zm-11.5-.968V11.67c.294-.6,1.14-.895,2.538-.895,1.336,0,2.182.294,2.537.895V28.305c-.355.65-1.2.968-2.537.968C27.131,29.273,26.285,28.955,25.991,28.305ZM53.9,8.054a2,2,0,0,1-.747-1.544A1.858,1.858,0,0,1,53.9,5a2.969,2.969,0,0,1,3.58,0,1.859,1.859,0,0,1,.748,1.508,1.962,1.962,0,0,1-.748,1.544,2.833,2.833,0,0,1-3.58,0Zm-27.165,0a2,2,0,0,1-.748-1.544A1.859,1.859,0,0,1,26.739,5a2.968,2.968,0,0,1,3.579,0,1.892,1.892,0,0,1,.748,1.508,1.959,1.959,0,0,1-.748,1.544,2.832,2.832,0,0,1-3.579,0Z\"\n transform=\"translate(-0.024 0.086)\"\n />\n </g>\n </svg>\n </div>\n</div>\n",
1111
- encapsulation: ViewEncapsulation.None
1112
- },] }
1113
- ];
1114
- LogoComponent.ctorParameters = () => [];
1115
- LogoComponent.propDecorators = {
1116
- isDropizi: [{ type: Input }],
1117
- isWhite: [{ type: Input }]
1118
- };
1119
-
1120
- class RadioComponent {
1121
- constructor() {
1122
- this.label = '';
1123
- this.id = '';
1124
- this.alone = false;
1125
- this.changeInput = new EventEmitter();
1126
- this.disabled = false;
1127
- }
1128
- registerOnChange(fn) {
1129
- this._onChange = fn;
1130
- }
1131
- registerOnTouched(fn) {
1132
- this._onTouched = fn;
1133
- }
1134
- setDisabledState(isDisabled) {
1135
- this.disabled = isDisabled;
1136
- }
1137
- writeValue(obj) {
1138
- this.value = obj;
1139
- }
1140
- onChange(value) {
1141
- if (this._onChange) {
1142
- this._onChange(value);
1143
- }
1144
- }
1145
- valueInput(value) {
1146
- this.changeInput.emit(value);
1147
- }
1148
- }
1149
- RadioComponent.decorators = [
1150
- { type: Component, args: [{
1151
- selector: 'wac-radio',
1152
- template: "<div class=\"wac-radio\" *ngFor=\"let option of options\" [ngClass]=\"{ 'wac-radio--nowrap': type === 'column', alone: alone }\">\n <div class=\"wac-radio__row\">\n <input\n type=\"radio\"\n [id]=\"option.id\"\n class=\"is-checkradio\"\n [name]=\"option.name\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onChange($event)\"\n />\n <label [attr.for]=\"option.id\">{{ option.label }}</label>\n <div class=\"wac-radio__input\" *ngIf=\"value && option.value && option.hasInput\">\n <input type=\"text\" [placeholder]=\"option.placeholderInput\" (blur)=\"valueInput($event)\" />\n </div>\n </div>\n</div>\n",
1153
- encapsulation: ViewEncapsulation.None,
1154
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: RadioComponent, multi: true }]
1155
- },] }
1156
- ];
1157
- RadioComponent.ctorParameters = () => [];
1158
- RadioComponent.propDecorators = {
1159
- label: [{ type: Input }],
1160
- options: [{ type: Input }],
1161
- value: [{ type: Input }],
1162
- type: [{ type: Input }],
1163
- id: [{ type: Input }],
1164
- name: [{ type: Input }],
1165
- alone: [{ type: Input }],
1166
- changeInput: [{ type: Output }]
1167
- };
1168
-
1169
- class StateComponent {
1170
- constructor() {
1171
- this.state = 'success';
1172
- }
1173
- }
1174
- StateComponent.decorators = [
1175
- { type: Component, args: [{
1176
- selector: 'wac-state',
1177
- template: "<div [class]=\"'wac-state ' + state\"></div>\n",
1178
- encapsulation: ViewEncapsulation.None
1179
- },] }
1180
- ];
1181
- StateComponent.ctorParameters = () => [];
1182
- StateComponent.propDecorators = {
1183
- state: [{ type: Input }]
1184
- };
1185
-
1186
- const inOutX = trigger('inOutXAnimation', [
1187
- transition(':enter', [
1188
- style({ zIndex: -1, transform: 'scaleX(0)', width: 0, opacity: 0 }),
1189
- animate('.3s ease-out', style({ zIndex: 1, transform: 'scaleX(1)', width: 'auto', opacity: 1 }))
1190
- ]),
1191
- transition(':leave', [
1192
- style({ zIndex: 1, transform: 'scaleX(1)', width: 'auto', opacity: 1 }),
1193
- animate('.3s ease-in', style({ zIndex: -1, transform: 'scaleX(0)', width: 0, opacity: 0 }))
1194
- ])
1195
- ]);
1196
-
1197
- class LabelComponent {
1198
- constructor() {
1199
- this.index = 0;
1200
- this.label = '';
1201
- this.deleted = false;
1202
- this.onDeleteLabel = new EventEmitter();
1203
- }
1204
- deleteLabel() {
1205
- this.deleted = true;
1206
- this.onDeleteLabel.emit({
1207
- index: this.index,
1208
- label: this.label
1209
- });
1210
- }
1211
- }
1212
- LabelComponent.decorators = [
1213
- { type: Component, args: [{
1214
- selector: 'wac-label',
1215
- template: "<div *ngIf=\"!deleted\" [@inOutXAnimation] class=\"wac-label\">\n <div class=\"wac-label__wrapper\">\n {{ label }}\n <i class=\"far fa-times\" (click)=\"deleteLabel()\"></i>\n </div>\n</div>\n",
1216
- encapsulation: ViewEncapsulation.None,
1217
- animations: [inOutX]
1218
- },] }
1219
- ];
1220
- LabelComponent.ctorParameters = () => [];
1221
- LabelComponent.propDecorators = {
1222
- index: [{ type: Input }],
1223
- label: [{ type: Input }],
1224
- deleted: [{ type: Input }],
1225
- onDeleteLabel: [{ type: Output }]
1226
- };
1227
-
1228
- class CalendarComponent {
1229
- constructor() {
1230
- this.type = 'input';
1231
- this.options = {
1232
- displayMode: 'inline',
1233
- showHeader: false,
1234
- showFooter: true,
1235
- showButton: true
1236
- };
1237
- this.position = 'bottom';
1238
- this.dateSelected = new Date();
1239
- this.typeDate = 'datetime-local';
1240
- this.noMargin = false;
1241
- this.selected = new EventEmitter();
1242
- this.changeData = new EventEmitter();
1243
- this.open = false;
1244
- this.startLabel = '';
1245
- this.endLabel = '';
1246
- }
1247
- changeDate(event) {
1248
- this.currentDate = new Date(new Date(event.startDate).setHours(0, 0, 0, 0));
1249
- this.dateSelected = new Date(new Date(new Date(event.startDate).setHours(0, 0, 0, 0)).getTime() +
1250
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1251
- parseInt(this.currentMinutes, 0) * 60000);
1252
- this.triggerChange({
1253
- startDate: this.dateSelected,
1254
- endDate: this.dateSelected
1255
- });
1256
- }
1257
- triggerChange(event) {
1258
- this.changeData.emit(event);
1259
- }
1260
- openCalendar(value = null) {
1261
- if (value === 'close') {
1262
- if (this.open) {
1263
- this.open = false;
1264
- }
1265
- }
1266
- else {
1267
- this.open = !this.open;
1268
- }
1269
- }
1270
- ngOnInit() {
1271
- if (this.type === 'edit' && this.label) {
1272
- const splitLabel = this.label.split('{x}');
1273
- if (splitLabel.length > 1) {
1274
- this.startLabel = splitLabel[0];
1275
- this.endLabel = splitLabel[1];
1276
- }
1277
- else {
1278
- this.startLabel = this.label;
1279
- }
1280
- }
1281
- this.currentHours =
1282
- new Date(this.dateSelected).getHours() < 10 ? '0' + new Date(this.dateSelected).getHours() : new Date(this.dateSelected).getHours();
1283
- this.currentMinutes =
1284
- new Date(this.dateSelected).getMinutes() < 10
1285
- ? '0' + new Date(this.dateSelected).getMinutes()
1286
- : new Date(this.dateSelected).getMinutes();
1287
- this.currentDate = new Date(this.dateSelected).setHours(0, 0, 0, 0);
1288
- if (this.typeDate === 'date') {
1289
- this.currentHours = '00';
1290
- this.currentMinutes = '00';
1291
- }
1292
- }
1293
- verifKeyup(events) {
1294
- events.target.value = events.target.value.replace(/\D+/g, '');
1295
- }
1296
- verifHours(events) {
1297
- const value = parseInt(events.target.value, 0);
1298
- events.target.value = this.currentHours = value < 24 ? (value < 10 ? '0' + value : value) : 23;
1299
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1300
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1301
- parseInt(this.currentMinutes, 0) * 60000);
1302
- this.dateSelected = dateData;
1303
- this.triggerChange({
1304
- startDate: dateData,
1305
- endDate: dateData
1306
- });
1307
- }
1308
- verifMinutes(events) {
1309
- const value = parseInt(events.target.value, 0);
1310
- events.target.value = this.currentMinutes = value < 60 ? (value < 10 ? '0' + value : value) : 59;
1311
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1312
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1313
- parseInt(this.currentMinutes, 0) * 60000);
1314
- this.dateSelected = dateData;
1315
- this.triggerChange({
1316
- startDate: dateData,
1317
- endDate: dateData
1318
- });
1319
- }
1320
- addHours(target) {
1321
- target.value = this.currentHours =
1322
- parseInt(target.value, 0) + 1 < 24
1323
- ? parseInt(target.value, 0) + 1 < 10
1324
- ? '0' + (parseInt(target.value, 0) + 1)
1325
- : parseInt(target.value, 0) + 1
1326
- : parseInt(target.value, 0) < 10
1327
- ? '0' + parseInt(target.value, 0)
1328
- : parseInt(target.value, 0);
1329
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1330
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1331
- parseInt(this.currentMinutes, 0) * 60000);
1332
- this.dateSelected = dateData;
1333
- this.triggerChange({
1334
- startDate: dateData,
1335
- endDate: dateData
1336
- });
1337
- }
1338
- removeHours(target) {
1339
- target.value = this.currentHours =
1340
- parseInt(target.value, 0) - 1 > -1
1341
- ? parseInt(target.value, 0) - 1 < 10
1342
- ? '0' + (parseInt(target.value, 0) - 1)
1343
- : parseInt(target.value, 0) - 1
1344
- : parseInt(target.value, 0) < 10
1345
- ? '0' + parseInt(target.value, 0)
1346
- : parseInt(target.value, 0);
1347
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1348
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1349
- parseInt(this.currentMinutes, 0) * 60000);
1350
- this.dateSelected = dateData;
1351
- this.triggerChange({
1352
- startDate: dateData,
1353
- endDate: dateData
1354
- });
1355
- }
1356
- addMinutes(target) {
1357
- target.value = this.currentMinutes =
1358
- parseInt(target.value, 0) + 1 < 60
1359
- ? parseInt(target.value, 0) + 1 < 10
1360
- ? '0' + (parseInt(target.value, 0) + 1)
1361
- : parseInt(target.value, 0) + 1
1362
- : parseInt(target.value, 0) < 10
1363
- ? '0' + parseInt(target.value, 0)
1364
- : parseInt(target.value, 0);
1365
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1366
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1367
- parseInt(this.currentMinutes, 0) * 60000);
1368
- this.dateSelected = dateData;
1369
- this.triggerChange({
1370
- startDate: dateData,
1371
- endDate: dateData
1372
- });
1373
- }
1374
- removeMinutes(target) {
1375
- target.value = this.currentMinutes =
1376
- parseInt(target.value, 0) - 1 > -1
1377
- ? parseInt(target.value, 0) - 1 < 10
1378
- ? '0' + (parseInt(target.value, 0) - 1)
1379
- : parseInt(target.value, 0) - 1
1380
- : parseInt(target.value, 0) < 10
1381
- ? '0' + parseInt(target.value, 0)
1382
- : parseInt(target.value, 0);
1383
- const dateData = new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
1384
- parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
1385
- parseInt(this.currentMinutes, 0) * 60000);
1386
- this.dateSelected = dateData;
1387
- this.triggerChange({
1388
- startDate: dateData,
1389
- endDate: dateData
1390
- });
1391
- }
1392
- }
1393
- CalendarComponent.decorators = [
1394
- { type: Component, args: [{
1395
- selector: 'wac-calendar',
1396
- template: "<div\n class=\"wac-calendar\"\n [ngClass]=\"{\n 'wac-calendar--input': type === 'input',\n 'wac-calendar--edit': type === 'edit',\n 'wac-calendar--select': type === 'select',\n 'wac-calendar--no-margin': noMargin,\n 'wac-calendar--open': open\n }\"\n [zIndexToggle]=\"open\"\n>\n <p class=\"wac-calendar__label\" *ngIf=\"label && (type === 'input' || type === 'select')\" (click)=\"openCalendar()\">{{ label }}</p>\n <p class=\"wac-calendar__startLabel\" *ngIf=\"type === 'edit'\">{{ startLabel }}</p>\n <div class=\"wac-calendar__autoHide\" wzAutoHide (clickOutside)=\"openCalendar('close')\">\n <div class=\"wac-calendar__wrapper\">\n <div class=\"wac-calendar__wrapper__input\" *ngIf=\"type === 'input'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__input__icon\">\n <i class=\"far fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__input__date\">\n {{ dateSelected | date: 'dd/MM/yyyy' }}\n </div>\n <div class=\"wac-calendar__wrapper__input__time\">\n {{ dateSelected | date: 'HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace\" *ngIf=\"type === 'edit'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__editInPlace__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__select\" *ngIf=\"type === 'select'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__select__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__select__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n </div>\n <div\n class=\"wac-calendar__absolute\"\n [ngClass]=\"{\n top: position === 'top',\n bottom: position === 'bottom',\n left: position === 'left',\n right: position === 'right',\n 'right-top': position === 'right-top',\n 'right-bottom': position === 'right-bottom',\n 'left-top': position === 'left-top',\n 'left-bottom': position === 'left-bottom',\n 'with-time': typeDate === 'datetime-local' || typeDate === 'datetime'\n }\"\n >\n <nwb-date-picker #datePicker (change)=\"changeDate($event)\" [options]=\"options\">\n <input [nwbDatepickerStart]=\"datePicker\" type=\"date\" [value]=\"dateSelected\" />\n </nwb-date-picker>\n <div class=\"wac-calendar__absolute__time\" *ngIf=\"typeDate === 'datetime-local' || typeDate === 'datetime'\">\n <div class=\"wac-calendar__absolute__time__wrapper\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours__left\">\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"addHours(hours)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"removeHours(hours)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__hours__right\">\n <input #hours type=\"text\" value=\"{{ currentHours }}\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifHours($event)\" />\n </div>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes\">\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__left\">\n <input #minutes type=\"text\" value=\"{{ currentMinutes }}\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifMinutes($event)\" />\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__right\">\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"addMinutes(minutes)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"removeMinutes(minutes)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <p class=\"wac-calendar__endLabel\" *ngIf=\"type === 'edit'\">{{ endLabel }}</p>\n</div>\n"
1397
- },] }
1398
- ];
1399
- CalendarComponent.ctorParameters = () => [];
1400
- CalendarComponent.propDecorators = {
1401
- label: [{ type: Input }],
1402
- type: [{ type: Input }],
1403
- options: [{ type: Input }],
1404
- position: [{ type: Input }],
1405
- dateSelected: [{ type: Input }],
1406
- typeDate: [{ type: Input }],
1407
- noMargin: [{ type: Input }],
1408
- selected: [{ type: Output }],
1409
- changeData: [{ type: Output }]
1410
- };
1411
-
1412
- class WzEditInPlaceComponent {
1413
- constructor() {
1414
- this.config = {};
1415
- this.customChange = new EventEmitter();
1416
- this.objectKeys = Object.keys;
1417
- this.editing = false;
1418
- this.onChange = Function.prototype;
1419
- this.onTouched = Function.prototype;
1420
- }
1421
- get value() {
1422
- return this.currentValue;
1423
- }
1424
- set value(v) {
1425
- if (v !== this.currentValue) {
1426
- this.currentValue = v;
1427
- }
1428
- }
1429
- writeValue(value) {
1430
- if (value !== null) {
1431
- if (this.config.currency) {
1432
- this.currentValue = this.parseValueToNumber(value);
1433
- if (this.config.separator !== '.') {
1434
- this.currentValue = this.parseValueToSeparator(this.currentValue);
1435
- }
1436
- this.currentValue += this.config.currency;
1437
- }
1438
- else {
1439
- this.currentValue = value;
1440
- }
1441
- }
1442
- }
1443
- registerOnChange(fn) {
1444
- this.onChange = fn;
1445
- }
1446
- registerOnTouched(fn) {
1447
- this.onTouched = fn;
1448
- }
1449
- _setValue(v) {
1450
- if (this.type === 'select') {
1451
- this.onChange(v);
1452
- }
1453
- else if (typeof this.config.currency === 'string') {
1454
- v = this.parseValueToNumber(v);
1455
- this.onChange(v);
1456
- if (this.config.separator !== '.') {
1457
- v = this.parseValueToSeparator(v);
1458
- }
1459
- v = v + this.config.currency;
1460
- this.customChange.emit(v);
1461
- }
1462
- else {
1463
- this.onChange(v);
1464
- }
1465
- this.writeValue(v);
1466
- this.value = v;
1467
- }
1468
- ngAfterViewChecked() {
1469
- if (this.input && this.editing) {
1470
- this.input.nativeElement.focus();
1471
- if (this.config.selectTextUponClick && this.firstEdit && this.preValue && this.input.nativeElement.value) {
1472
- this.input.nativeElement.select();
1473
- this.firstEdit = false;
1474
- }
1475
- }
1476
- this.initialized = true;
1477
- }
1478
- startEditing() {
1479
- if (!this.editing) {
1480
- this.editing = true;
1481
- this.currentValue = this.checkAndRemoveCurrency(this.currentValue);
1482
- this.firstEdit = true;
1483
- }
1484
- }
1485
- edit() {
1486
- this.preValue = this.currentValue;
1487
- this.editing = true;
1488
- }
1489
- onSubmit() {
1490
- this.editing = false;
1491
- if (this.currentValue !== this.preValue) {
1492
- if (typeof this.config.handler === 'function') {
1493
- this.isLoading = true;
1494
- this.config.handler(this.currentValue, this.config.data).subscribe(data => {
1495
- let hasChanged;
1496
- this.isLoading = false;
1497
- if (typeof data !== 'boolean') {
1498
- this.currentValue = data.value;
1499
- hasChanged = data.success;
1500
- }
1501
- else {
1502
- hasChanged = data;
1503
- }
1504
- if (hasChanged) {
1505
- this._setValue(this.currentValue);
1506
- }
1507
- else {
1508
- this._setValue(this.preValue);
1509
- }
1510
- }, () => {
1511
- this.isLoading = false;
1512
- this._setValue(this.preValue);
1513
- });
1514
- }
1515
- else {
1516
- this._setValue(this.currentValue);
1517
- }
1518
- }
1519
- else {
1520
- if (typeof this.config.currency === 'string') {
1521
- this.currentValue = this.currentValue + this.config.currency;
1522
- }
1523
- }
1524
- }
1525
- checkAndRemoveCurrency(value) {
1526
- if (typeof this.config.currency === 'string') {
1527
- return value.slice(0, -1);
1528
- }
1529
- return value;
1530
- }
1531
- parseValueToNumber(value) {
1532
- if (!isNaN(value) && value !== '') {
1533
- return parseFloat(value);
1534
- }
1535
- if (typeof this.config.currency === 'string') {
1536
- const indexComma = value.indexOf(',');
1537
- const indexDot = value.indexOf('.');
1538
- if (indexComma > 0 && indexDot === -1) {
1539
- const parsedValue = value.replace(',', '.');
1540
- if (!isNaN(parsedValue)) {
1541
- return parseFloat(parsedValue);
1542
- }
1543
- }
1544
- if (indexDot > 0 && indexComma === -1) {
1545
- if (!isNaN(value)) {
1546
- return parseFloat(value);
1547
- }
1548
- }
1549
- return 0;
1550
- }
1551
- }
1552
- parseValueToSeparator(value) {
1553
- if (typeof this.config.separator === 'string') {
1554
- value = parseFloat(value).toFixed(2);
1555
- return value.replace('.', this.config.separator);
1556
- }
1557
- return value;
1558
- }
1559
- ngOnChanges(changes) {
1560
- if (this.initialized) {
1561
- this.currentValue = this.checkAndRemoveCurrency(this.currentValue) + this.config.currency;
1562
- this.customChange.emit(this.value);
1563
- }
1564
- }
1565
- selectOption(event) {
1566
- this.currentValue = event.target.innerText;
1567
- this.closeSelect(event);
1568
- event.stopPropagation();
1569
- this.customChange.emit(event.target.value);
1570
- }
1571
- closeSelect(event) {
1572
- this.editing = false;
1573
- this.isLoading = false;
1574
- event.stopPropagation();
1575
- }
1576
- }
1577
- WzEditInPlaceComponent.decorators = [
1578
- { type: Component, args: [{
1579
- selector: 'wac-edit-in-place',
1580
- template: "<div [class.nwb-wrapper--editable]=\"type === 'select' || (!editing && !isLoading)\" class=\"wac-edit-in-place nwb-wrapper\" (click)=\"startEditing()\">\n <span\n data-text=\"dd\"\n [class.nwb-is-loading]=\"type === 'select' ? '' : isLoading\"\n [class.nwb-editing]=\"type === 'select' ? '' : editing\"\n [ngClass]=\"type === 'select' ? 'nwbSelect' : ''\"\n >\n {{ currentValue }}\n </span>\n\n <input\n #input\n *ngIf=\"type !== 'select' && editing\"\n [class.nwb-editable]=\"!editing\"\n [class.nwb-editing]=\"editing\"\n [class.nwb-is-loading]=\"isLoading\"\n type=\"text\"\n [(ngModel)]=\"value\"\n (focus)=\"edit()\"\n (blur)=\"onSubmit()\"\n (keyup.enter)=\"onSubmit()\"\n [ngStyle]=\"{ 'width.px': inputWidth }\"\n />\n <div class=\"nwbSelect__container\" *ngIf=\"type === 'select' && editing\">\n <div class=\"nwbSelect__background\" (click)=\"closeSelect($event)\"></div>\n <ng-container *ngFor=\"let nwbOption of objectKeys(nwbOptions)\">\n <button\n *ngIf=\"nwbOptions[nwbOption]\"\n [ngClass]=\"\n nwbOptions[nwbOption].label === currentValue\n ? 'nwbSelect__container__item nwbSelect__container__item--selected'\n : 'nwbSelect__container__item'\n \"\n (click)=\"selectOption($event)\"\n [value]=\"nwbOptions[nwbOption].value\"\n >\n {{ nwbOptions[nwbOption].label ? nwbOptions[nwbOption].label : nwbOptions[nwbOption].value }}\n </button>\n </ng-container>\n </div>\n\n <span class=\"nwb-loader\" [class.nwb-is-loading]=\"type === 'select' ? '' : isLoading\"></span>\n</div>\n",
1581
- encapsulation: ViewEncapsulation.None,
1582
- providers: [
1583
- {
1584
- provide: NG_VALUE_ACCESSOR,
1585
- useExisting: WzEditInPlaceComponent,
1586
- multi: true
1587
- }
1588
- ]
1589
- },] }
1590
- ];
1591
- WzEditInPlaceComponent.propDecorators = {
1592
- type: [{ type: Input }],
1593
- nwbOptions: [{ type: Input }],
1594
- config: [{ type: Input }],
1595
- label: [{ type: Input }],
1596
- customChange: [{ type: Output }],
1597
- input: [{ type: ViewChild, args: ['input',] }]
1598
- };
1599
-
1600
- class TextAreaComponent {
1601
- constructor() {
1602
- // todo simplify and improve progress bar
1603
- this.label = '';
1604
- this.value = '';
1605
- this.placeholder = '';
1606
- this.textInfo = null;
1607
- this.textError = null;
1608
- this.size = null;
1609
- this.min = null;
1610
- this.max = null;
1611
- this.dynamicSize = false;
1612
- this.progressBar = false;
1613
- this.disabled = false;
1614
- this.id = 'wac-textarea__' +
1615
- Math.random()
1616
- .toString(36)
1617
- .substr(2, 9);
1618
- }
1619
- registerOnChange(fn) {
1620
- this._onChange = fn;
1621
- }
1622
- registerOnTouched(fn) {
1623
- this._onTouched = fn;
1624
- }
1625
- setDisabledState(isDisabled) {
1626
- this.disabled = isDisabled;
1627
- }
1628
- writeValue(obj) {
1629
- this.value = obj;
1630
- }
1631
- onChange(value) {
1632
- if (this._onChange) {
1633
- this._onChange(value);
1634
- this.writeValue(value);
1635
- }
1636
- }
1637
- onBlur() {
1638
- if (this._onTouched) {
1639
- this._onTouched();
1640
- }
1641
- }
1642
- }
1643
- TextAreaComponent.decorators = [
1644
- { type: Component, args: [{
1645
- selector: 'wac-text-area',
1646
- template: "<div class=\"field wac-text-area\" [ngClass]=\"{'dynamic': dynamicSize}\">\n <div class=\"field-label is-normal has-text-left\">\n <label class=\"label has-text-weight-normal\" [innerHTML]=\"label\" [for]=\"id\"></label>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <p class=\"control\" [ngClass]=\"{ 'has-icons-right': textError }\">\n <textarea\n class=\"textarea\"\n [id]=\"id\"\n [ngClass]=\"{ 'is-danger': textError, 'has-help-text': textInfo != '' || size }\"\n [placeholder]=\"placeholder\"\n [attr.size]=\"size\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n [disabled]=\"disabled\"\n [autosize]=\"dynamicSize\"\n [onlyGrow]=\"true\"\n [maxlength]=\"maxlength ? maxlength : 524288\"\n ></textarea>\n\n <span *ngIf=\"textError\" class=\"icon is-small is-right\">\n <i class=\"fal fa-times has-text-danger\"></i>\n </span>\n <span\n *ngIf=\"textInfo && (textError === null || textError === '')\"\n class=\"is-size-7 wac-text-area__info text-info\"\n [innerHtml]=\"textInfo\"\n ></span>\n <span *ngIf=\"textError\" class=\"is-size-7 wac-text-area__error has-text-danger\" [innerHtml]=\"textError\"></span>\n <span\n *ngIf=\"size && !progressBar\"\n class=\"is-size-7 wac-text-area__size\"\n [ngClass]=\"value && value.length > size ? 'has-text-danger' : ''\"\n >{{ value ? value.length : 0 }}/{{ size }}</span\n >\n </p>\n <wac-progress-bar *ngIf=\"progressBar && value\" [min]=\"min\" [max]=\"max\" [valueLength]=\"value.length\"></wac-progress-bar>\n </div>\n </div>\n</div>\n",
1647
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: TextAreaComponent, multi: true }]
1648
- },] }
1649
- ];
1650
- TextAreaComponent.propDecorators = {
1651
- label: [{ type: Input }],
1652
- value: [{ type: Input }],
1653
- placeholder: [{ type: Input }],
1654
- textInfo: [{ type: Input }],
1655
- textError: [{ type: Input }],
1656
- size: [{ type: Input }],
1657
- min: [{ type: Input }],
1658
- maxlength: [{ type: Input }],
1659
- max: [{ type: Input }],
1660
- dynamicSize: [{ type: Input }],
1661
- progressBar: [{ type: Input }],
1662
- disabled: [{ type: Input }]
1663
- };
1664
-
1665
- class H1Component {
1666
- constructor() {
1667
- this.annotation = '';
1668
- this.withImg = false;
1669
- this.center = false;
1670
- }
1671
- ngOnInit() { }
1672
- }
1673
- H1Component.decorators = [
1674
- { type: Component, args: [{
1675
- selector: 'wac-h1',
1676
- template: "<h1 class=\"wac-h1\" [ngClass]=\"{'with-img': withImg, 'center': center}\"><ng-content></ng-content><small *ngIf=\"annotation !== ''\">{{ annotation }}</small></h1>\n"
1677
- },] }
1678
- ];
1679
- H1Component.ctorParameters = () => [];
1680
- H1Component.propDecorators = {
1681
- annotation: [{ type: Input }],
1682
- withImg: [{ type: Input }],
1683
- center: [{ type: Input }]
1684
- };
1685
-
1686
- class H2Component {
1687
- constructor() { }
1688
- ngOnInit() { }
1689
- }
1690
- H2Component.decorators = [
1691
- { type: Component, args: [{
1692
- selector: 'wac-h2',
1693
- template: "<h2 class=\"wac-h2\"><ng-content></ng-content></h2>\n"
1694
- },] }
1695
- ];
1696
- H2Component.ctorParameters = () => [];
1697
-
1698
- class H3Component {
1699
- constructor() {
1700
- this.grey = false;
1701
- }
1702
- ngOnInit() { }
1703
- }
1704
- H3Component.decorators = [
1705
- { type: Component, args: [{
1706
- selector: 'wac-h3',
1707
- template: "<h3 class=\"wac-h3\" [ngClass]=\"{ grey: grey }\"><ng-content></ng-content></h3>\n"
1708
- },] }
1709
- ];
1710
- H3Component.ctorParameters = () => [];
1711
- H3Component.propDecorators = {
1712
- grey: [{ type: Input }]
1713
- };
1714
-
1715
- class HeaderPageComponent {
1716
- constructor() {
1717
- this.withImg = false;
1718
- this.center = false;
1719
- }
1720
- ngOnInit() { }
1721
- }
1722
- HeaderPageComponent.decorators = [
1723
- { type: Component, args: [{
1724
- selector: 'wac-header-page',
1725
- template: "<div class=\"wac-header-page\">\n <div class=\"wac-header-page__maxWidth\">\n <div class=\"wac-header-page__maxWidth__top\" [ngClass]=\"{'center':center}\">\n <div class=\"wac-header-page__maxWidth__top__left\" [ngClass]=\"{'fullsize':center}\">\n <!-- TODO Hard to use when only want a button and not a router link -->\n <a *ngIf=\"linkBack\" [routerLink]=\"linkBack\"><i class=\"fas fa-chevron-left\"></i></a>\n <wac-h1 [center]=\"center\" [withImg]=\"withImg\">{{ title }}<ng-content select=\"[role=header]\"></ng-content></wac-h1>\n </div>\n <div class=\"wac-header-page__maxWidth__top__right\" *ngIf=\"!center\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n</div>\n"
1726
- },] }
1727
- ];
1728
- HeaderPageComponent.ctorParameters = () => [];
1729
- HeaderPageComponent.propDecorators = {
1730
- title: [{ type: Input }],
1731
- linkBack: [{ type: Input }],
1732
- withImg: [{ type: Input }],
1733
- center: [{ type: Input }]
1734
- };
1735
-
1736
- class InputComponent {
1737
- constructor() {
1738
- this.label = '';
1739
- this.value = '';
1740
- this.type = 'text';
1741
- this.placeholder = '';
1742
- this.textInfo = null;
1743
- this.textError = null;
1744
- this.size = null;
1745
- this.isNumber = null;
1746
- this.withoutBlock = false;
1747
- this.icon = '';
1748
- this.big = false;
1749
- this.medium = false;
1750
- this.boldLabel = 'false';
1751
- this.min = null;
1752
- this.max = null;
1753
- this.disableMargin = false;
1754
- this.textPrepend = null;
1755
- this.textAppend = null;
1756
- this.progressBar = false;
1757
- this.extraClasses = '';
1758
- this.keyPreventDefault = [];
1759
- this.showTooltip = false;
1760
- this.textTooltip = '';
1761
- this.iconTooltip = '';
1762
- this.urlTooltip = '';
1763
- this.linkTooltip = '';
1764
- this.padding = false;
1765
- this.disabled = false;
1766
- this.indication = false;
1767
- this.success = false;
1768
- this.indicationLeft = false;
1769
- this.keypressEnter = new EventEmitter();
1770
- this.KEYPRESS_ENTER = "Enter";
1771
- this.id = 'wz-input_' +
1772
- Math.random()
1773
- .toString(36)
1774
- .substr(2, 9);
1775
- }
1776
- registerOnChange(fn) {
1777
- this._onChange = fn;
1778
- }
1779
- registerOnTouched(fn) {
1780
- this._onTouched = fn;
1781
- }
1782
- setDisabledState(isDisabled) {
1783
- this.disabled = isDisabled;
1784
- }
1785
- writeValue(obj) {
1786
- this.value = obj;
1787
- }
1788
- onChange(value) {
1789
- if (this._onChange) {
1790
- this._onChange(value);
1791
- }
1792
- }
1793
- onBlur() {
1794
- if (this._onTouched) {
1795
- this._onTouched();
1796
- }
1797
- }
1798
- checkNumberValue(value) {
1799
- if (this.min && this.min > value) {
1800
- this.value = this.min;
1801
- }
1802
- if (this.max && this.max < value) {
1803
- this.value = this.max;
1804
- }
1805
- }
1806
- onFocusOut() {
1807
- if (this.type === 'number') {
1808
- this.checkNumberValue(this.value);
1809
- }
1810
- }
1811
- keyPress(event) {
1812
- if (this.keyPreventDefault.includes(event.key)) {
1813
- event.preventDefault();
1814
- }
1815
- if (event.key === this.KEYPRESS_ENTER) {
1816
- this.keypressEnter.next(true);
1817
- }
1818
- }
1819
- }
1820
- InputComponent.decorators = [
1821
- { type: Component, args: [{
1822
- selector: 'wac-input',
1823
- template: "<div\n class=\"field wac-input\"\n [ngClass]=\"{ 'has-no-block': withoutBlock, 'is-big': big, 'is-medium': medium, 'with-padding': padding, 'indication-left': indicationLeft, 'with-progress-bar': progressBar }\"\n>\n <div class=\"field-label is-normal has-text-left\" *ngIf=\"!withoutBlock\">\n <label\n [ngClass]=\"[boldLabel == 'true' ? 'label has-text-weight-bold' : 'label has-text-weight-normal', showTooltip ? 'label-inline' : '']\"\n [innerHTML]=\"label\"\n [for]=\"id\"\n ></label>\n <wac-tooltip\n *ngIf=\"showTooltip\"\n [tooltipIcon]=\"iconTooltip\"\n [tooltipText]=\"textTooltip\"\n [tooltipLink]=\"linkTooltip\"\n [tooltipUrl]=\"urlTooltip\"\n ></wac-tooltip>\n <!-- Size -->\n <span *ngIf=\"value && size && !progressBar\" class=\"is-size-7 wac-input__size\">\n <strong>{{ value.toString().length }}</strong> / {{ size }}\n </span>\n </div>\n <div class=\"field-body\">\n <div class=\"field\">\n <p\n class=\"control\"\n [ngClass]=\"{ 'has-icons-right': textError || success, 'has-icons-left': icon !== '', 'has-input-group': textAppend || textPrepend }\"\n >\n <!-- Text Prepend -->\n <span *ngIf=\"textPrepend\" class=\"has-input-group\">\n <span class=\"has-input-group-text prepend\">{{ textPrepend }}</span>\n <span *ngIf=\"icon !== ''\" class=\"icon is-small is-left\">\n <i [class]=\"icon\"></i>\n </span>\n </span>\n\n <!-- Input -->\n <input\n [class]=\"'input ' + extraClasses\"\n [id]=\"id\"\n [ngClass]=\"{\n 'is-danger': textError,\n 'is-large': big,\n 'is-number': isNumber,\n 'remove-margin': disableMargin,\n 'text-append': textAppend\n }\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [attr.size]=\"size\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onChange($event)\"\n (blur)=\"onBlur()\"\n [disabled]=\"disabled\"\n (focusout)=\"onFocusOut()\"\n [min]=\"min\"\n [max]=\"max\"\n (keypress)=\"keyPress($event)\"\n />\n\n <!-- Indication at the end of the input -->\n <span class=\"indication\" *ngIf=\"indication\" [ngClass]=\"{'reverse': indicationLeft}\">\n <span [innerHTML]=\"indication\"></span>\n </span>\n\n <!-- Text Append -->\n <span *ngIf=\"textAppend && !indicationLeft\" class=\"has-input-group\">\n <span class=\"has-input-group-text append\">{{ textAppend }}</span>\n <!-- error if text append not empty -->\n <span *ngIf=\"textError\" class=\"icon is-small is-right\">\n <i class=\"fal fa-times has-text-danger\"></i>\n </span>\n </span>\n\n <!-- Icon Left -->\n <span *ngIf=\"icon !== '' && !textPrepend && !indicationLeft\" class=\"icon is-small is-left\">\n <i [class]=\"icon\"></i>\n </span>\n\n <!-- Icon error if textAppend empty -->\n <span *ngIf=\"textError && !textAppend && !indicationLeft\" class=\"icon is-small is-right\">\n <i class=\"fal fa-times has-text-danger\"></i>\n </span>\n\n <!-- Icon success -->\n <span *ngIf=\"success\" class=\"icon is-small is-right\">\n <i class=\"fas fa-check has-text-success\"></i>\n </span>\n\n <!-- Text Info -->\n <span\n *ngIf=\"textInfo && (textError === null || textError === '') && !progressBar && !indicationLeft\"\n class=\"is-size-7 wac-input__info text-info\"\n [innerHtml]=\"textInfo\"\n ></span>\n\n <!-- Text Error -->\n <span *ngIf=\"textError && !progressBar && !indicationLeft\" class=\"is-size-7 wac-input__error has-text-danger\" [innerHtml]=\"textError\"></span>\n </p>\n\n <!-- Progress Bar -->\n <wac-progress-bar *ngIf=\"progressBar && !indicationLeft\" [min]=\"min\" [max]=\"max\" [valueLength]=\"value.length\"></wac-progress-bar>\n </div>\n </div>\n</div>\n",
1824
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: InputComponent, multi: true }]
1825
- },] }
1826
- ];
1827
- InputComponent.propDecorators = {
1828
- label: [{ type: Input }],
1829
- value: [{ type: Input }],
1830
- type: [{ type: Input }],
1831
- placeholder: [{ type: Input }],
1832
- textInfo: [{ type: Input }],
1833
- textError: [{ type: Input }],
1834
- size: [{ type: Input }],
1835
- isNumber: [{ type: Input }],
1836
- withoutBlock: [{ type: Input }],
1837
- icon: [{ type: Input }],
1838
- big: [{ type: Input }],
1839
- medium: [{ type: Input }],
1840
- boldLabel: [{ type: Input }],
1841
- min: [{ type: Input }],
1842
- max: [{ type: Input }],
1843
- disableMargin: [{ type: Input }],
1844
- textPrepend: [{ type: Input }],
1845
- textAppend: [{ type: Input }],
1846
- progressBar: [{ type: Input }],
1847
- extraClasses: [{ type: Input }],
1848
- keyPreventDefault: [{ type: Input }],
1849
- showTooltip: [{ type: Input }],
1850
- textTooltip: [{ type: Input }],
1851
- iconTooltip: [{ type: Input }],
1852
- urlTooltip: [{ type: Input }],
1853
- linkTooltip: [{ type: Input }],
1854
- padding: [{ type: Input }],
1855
- disabled: [{ type: Input }],
1856
- indication: [{ type: Input }],
1857
- success: [{ type: Input }],
1858
- indicationLeft: [{ type: Input }],
1859
- keypressEnter: [{ type: Output }]
1860
- };
1861
-
1862
- class LinkComponent {
1863
- constructor(renderer2) {
1864
- this.renderer2 = renderer2;
1865
- this.target = '_self';
1866
- }
1867
- set href(link) {
1868
- this._link = link;
1869
- this.setAttributesLink();
1870
- }
1871
- get href() {
1872
- return this._link;
1873
- }
1874
- ngOnInit() { }
1875
- ngAfterViewInit() {
1876
- this.setAttributesLink();
1877
- }
1878
- setAttributesLink() {
1879
- if (!this.linkComponent) {
1880
- return;
1881
- }
1882
- if (this.href) {
1883
- this.renderer2.setAttribute(this.linkComponent.nativeElement, "href", this.href);
1884
- this.renderer2.setAttribute(this.linkComponent.nativeElement, "target", this.target);
1885
- }
1886
- else {
1887
- this.renderer2.removeAttribute(this.linkComponent.nativeElement, "href");
1888
- this.renderer2.removeAttribute(this.linkComponent.nativeElement, "target");
1889
- }
1890
- }
1891
- }
1892
- LinkComponent.decorators = [
1893
- { type: Component, args: [{
1894
- selector: 'wac-link',
1895
- template: "<a #linkComponent class=\"wac-link\" [ngClass]=\"{ class: class }\" [id]=\"{ id: id }\"><ng-content></ng-content></a>\n"
1896
- },] }
1897
- ];
1898
- LinkComponent.ctorParameters = () => [
1899
- { type: Renderer2 }
1900
- ];
1901
- LinkComponent.propDecorators = {
1902
- href: [{ type: Input }],
1903
- target: [{ type: Input }],
1904
- id: [{ type: Input }],
1905
- class: [{ type: Input }],
1906
- linkComponent: [{ type: ViewChild, args: ['linkComponent',] }]
1907
- };
1908
-
1909
- class ProgressBarComponent {
1910
- constructor(translateService) {
1911
- this.translateService = translateService;
1912
- this.valueLength = null;
1913
- this.min = null;
1914
- this.max = null;
1915
- }
1916
- progressBarClass(spanNumber = -1) {
1917
- const length = this.valueLength;
1918
- const min = this.min;
1919
- const max = this.max;
1920
- if (spanNumber === 1) {
1921
- return {
1922
- 'is-danger': length > max,
1923
- 'is-success': length >= min && length <= max
1924
- };
1925
- }
1926
- else if (spanNumber === 2) {
1927
- return {
1928
- 'is-success': length === max,
1929
- 'is-danger': length > max
1930
- };
1931
- }
1932
- else {
1933
- return {
1934
- 'is-warning': length < min,
1935
- 'is-danger': length > max,
1936
- 'is-success': length >= min && length <= max
1937
- };
1938
- }
1939
- }
1940
- progressBarSpanPosition(index) {
1941
- const min = this.min;
1942
- const max = this.max;
1943
- const maxSize = this.progressBarGetMaxSize(max);
1944
- const successMin = (min / maxSize) * 100;
1945
- const successMax = (max / maxSize) * 100;
1946
- return index === 1 ? successMin : successMax;
1947
- }
1948
- progressBarGetMaxSize(max) {
1949
- return max + max / 4;
1950
- }
1951
- progressBarGetTextInfo() {
1952
- const length = this.valueLength;
1953
- const min = this.min;
1954
- const max = this.max;
1955
- if (length < min) {
1956
- return this.translateService.instant('wac.input.progressbar.information.too.short');
1957
- }
1958
- else if (length > max) {
1959
- return this.translateService.instant('wac.input.progressbar.information.too.long');
1960
- }
1961
- else {
1962
- return this.translateService.instant('wac.input.progressbar.information.good');
1963
- }
1964
- }
1965
- }
1966
- ProgressBarComponent.decorators = [
1967
- { type: Component, args: [{
1968
- selector: 'wac-progress-bar',
1969
- template: "<div class=\"wac-progressBarContent\">\n <div class=\"progressBar\">\n <progress class=\"progress\" [ngClass]=\"progressBarClass()\" [max]=\"progressBarGetMaxSize(max)\" [value]=\"valueLength\"></progress>\n <span [ngClass]=\"progressBarClass(1)\" [ngStyle]=\"{ 'left.%': progressBarSpanPosition(1) }\"></span>\n <span [ngClass]=\"progressBarClass(2)\" [ngStyle]=\"{ 'left.%': progressBarSpanPosition(2) }\"></span>\n </div>\n <div class=\"size\">\n <span class=\"is-size-7 wac-input__size\">\n <span *ngIf=\"valueLength\">\n <span [ngClass]=\"progressBarClass()\">{{ progressBarGetTextInfo() }}</span> -\n </span>\n <strong>{{ valueLength }}</strong> / {{ max }}\n </span>\n </div>\n</div>\n"
1970
- },] }
1971
- ];
1972
- ProgressBarComponent.ctorParameters = () => [
1973
- { type: TranslateService }
1974
- ];
1975
- ProgressBarComponent.propDecorators = {
1976
- valueLength: [{ type: Input }],
1977
- min: [{ type: Input }],
1978
- max: [{ type: Input }]
1979
- };
1980
-
1981
- class SwitchComponent {
1982
- constructor() {
1983
- // todo add ngmodel and review texts display (textState is mandaoty in order to display textStateEnable and textStateDisable)
1984
- this.value = false;
1985
- this.textState = false;
1986
- this.textStateEnable = '';
1987
- this.textStateDisable = '';
1988
- this.showInput = false;
1989
- this.danger = false;
1990
- this.whiteSpace = false;
1991
- this.switchChange = new EventEmitter(); // todo set emitted type
1992
- this.changeInput = new EventEmitter(); // todo set emitted type
1993
- }
1994
- ngOnInit() {
1995
- this.id = 'switch-' + Math.floor(Math.random() * Math.floor(1000));
1996
- }
1997
- changeValue(event) {
1998
- this.switchChange.emit(event.target.checked);
1999
- }
2000
- triggerInput() {
2001
- this.changeInput.emit(this.valueInput);
2002
- }
2003
- }
2004
- SwitchComponent.decorators = [
2005
- { type: Component, args: [{
2006
- selector: 'wac-switch',
2007
- template: "<div class=\"wac-switch\">\n <input type=\"checkbox\" [checked]=\"value\" (change)=\"changeValue($event)\" [id]=\"id\" [ngClass]=\"{ danger: danger }\"/>\n <label [for]=\"id\" class=\"wac-switch__label\">\n <span class=\"wac-switch__label__text\"\n ><ng-content></ng-content\n ><span\n *ngIf=\"textState\"\n [ngStyle]=\"{'whiteSpace': whiteSpace ? 'nowrap' :'normal'}\"\n >{{ textState }} <strong class=\"disable\" *ngIf=\"textStateDisable\">{{ textStateDisable }}</strong>\n <strong class=\"enable\" *ngIf=\"textStateEnable\">{{ textStateEnable }}</strong></span\n ></span\n >\n </label>\n</div>\n<div class=\"wac-show-input\" *ngIf=\"showInput && value\">\n <input [placeholder]=\"placholderInput\" type=\"text\" [(ngModel)]=\"valueInput\" (blur)=\"triggerInput()\" />\n</div>\n"
2008
- },] }
2009
- ];
2010
- SwitchComponent.ctorParameters = () => [];
2011
- SwitchComponent.propDecorators = {
2012
- value: [{ type: Input }],
2013
- textState: [{ type: Input }],
2014
- textStateEnable: [{ type: Input }],
2015
- textStateDisable: [{ type: Input }],
2016
- showInput: [{ type: Input }],
2017
- placholderInput: [{ type: Input }],
2018
- danger: [{ type: Input }],
2019
- whiteSpace: [{ type: Input }],
2020
- switchChange: [{ type: Output }],
2021
- changeInput: [{ type: Output }]
2022
- };
2023
-
2024
- class TooltipComponent {
2025
- constructor() {
2026
- this.tooltipText = '';
2027
- this.tooltipLink = '';
2028
- this.tooltipUrl = '#';
2029
- }
2030
- ngOnInit() {
2031
- if (this.tooltipIcon === '') {
2032
- this.tooltipIcon = 'fas fa-info-circle';
2033
- }
2034
- }
2035
- }
2036
- TooltipComponent.decorators = [
2037
- { type: Component, args: [{
2038
- selector: 'wac-tooltip',
2039
- template: "<span class=\"wac-tooltip\">\n <i [class]=\"tooltipIcon\"></i>\n <span class=\"tooltip-content\"\n >{{ tooltipText }}\n <span *ngIf=\"tooltipUrl\"\n ><a [href]=\"tooltipUrl\" target=\"_blank\">{{ tooltipLink }}</a></span\n >\n </span>\n</span>\n"
2040
- },] }
2041
- ];
2042
- TooltipComponent.ctorParameters = () => [];
2043
- TooltipComponent.propDecorators = {
2044
- tooltipIcon: [{ type: Input }],
2045
- tooltipText: [{ type: Input }],
2046
- tooltipLink: [{ type: Input }],
2047
- tooltipUrl: [{ type: Input }]
2048
- };
2049
-
2050
- class AlertComponent {
2051
- constructor() {
2052
- this.icon = true;
2053
- this.warning = false;
2054
- this.success = false;
2055
- this.alert = false;
2056
- this.iconClass = 'fas fa-info';
2057
- }
2058
- ngOnInit() { }
2059
- }
2060
- AlertComponent.decorators = [
2061
- { type: Component, args: [{
2062
- selector: 'wac-alert',
2063
- template: "<div class=\"wac-alert\" [ngClass]=\"{ success: success, warning: warning, alert: alert }\">\n <i *ngIf=\"icon\" [ngClass]=\"iconClass\"></i>\n <p><ng-content></ng-content></p> <!-- ! Refacto : Remove p tag, attention \u00E0 wizi-admin -->\n</div>\n"
2064
- },] }
2065
- ];
2066
- AlertComponent.ctorParameters = () => [];
2067
- AlertComponent.propDecorators = {
2068
- icon: [{ type: Input }],
2069
- warning: [{ type: Input }],
2070
- success: [{ type: Input }],
2071
- alert: [{ type: Input }],
2072
- iconClass: [{ type: Input }]
2073
- };
2074
-
2075
- class TextComponent {
2076
- constructor() { }
2077
- ngOnInit() { }
2078
- }
2079
- TextComponent.decorators = [
2080
- { type: Component, args: [{
2081
- selector: 'wac-text',
2082
- template: "<div class=\"wac-text\" [class]=\"textClass\">\n <p><ng-content></ng-content></p>\n</div>\n"
2083
- },] }
2084
- ];
2085
- TextComponent.ctorParameters = () => [];
2086
- TextComponent.propDecorators = {
2087
- textClass: [{ type: Input }]
2088
- };
2089
-
2090
- class PagniationIsLastPage {
2091
- /**
2092
- * Return true, if the current page is the last page. Otherwise, return false.
2093
- * @param currentPage
2094
- * @param totalItems
2095
- * @param itemsPerPage
2096
- */
2097
- transform(currentPage, totalItems, itemsPerPage) {
2098
- if (!(currentPage >= 0 && totalItems >= 0 && itemsPerPage >= 0)) {
2099
- throw new Error('currentPage or totalItems or itemsPerPage is/are missing in PagniationIsLastPage pipe.');
2100
- }
2101
- return currentPage === Math.ceil(totalItems / itemsPerPage);
2102
- }
2103
- }
2104
- PagniationIsLastPage.decorators = [
2105
- { type: Pipe, args: [{
2106
- name: 'IsLastPage'
2107
- },] }
2108
- ];
2109
-
2110
- class PaginationComponent {
2111
- constructor() {
2112
- this.pageChange = new EventEmitter();
2113
- }
2114
- set pagination(pagination) {
2115
- this._pagination = pagination;
2116
- }
2117
- get pagination() {
2118
- return this._pagination;
2119
- }
2120
- decrementPage() {
2121
- if (this.pagination.currentPage <= 1) {
2122
- return;
2123
- }
2124
- this.pagination.currentPage--;
2125
- this.pageChange.emit(this.pagination);
2126
- }
2127
- incrementPage() {
2128
- const isLastPage = new PagniationIsLastPage().transform(this.pagination.currentPage, this.pagination.totalItems, this.pagination.itemsPerPage);
2129
- if (isLastPage) {
2130
- return;
2131
- }
2132
- this.pagination.currentPage++;
2133
- this.pageChange.emit(this.pagination);
2134
- }
2135
- onGotoPageChange(event) {
2136
- this.pagination.currentPage = parseInt(event.target.value);
2137
- this.pageChange.emit(this.pagination);
2138
- }
2139
- }
2140
- PaginationComponent.decorators = [
2141
- { type: Component, args: [{
2142
- selector: 'wac-pagination',
2143
- template: "<div class=\"wac-pagination\" *ngIf=\"pagination && pagination.itemsPerPage\">\n <div class=\"wac-pagination__wrapper\">\n <div class=\"wac-pagination__wrapper__page\">\n <p>{{ 'wac.PaginationComponent.page' | translate }}</p>\n\n <select name=\"page\" (change)=\"onGotoPageChange($event)\">\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 </div>\n\n <div class=\"wac-pagination__wrapper__elements\">\n <p>{{ pagination.currentPage | customPagniationText: pagination.totalItems:pagination.itemsPerPage | async}}</p>\n </div>\n\n <div class=\"wac-pagination__wrapper__arrows\">\n <div\n (click)=\"decrementPage()\"\n class=\"wac-pagination__wrapper__arrows__arrow wac-pagination__wrapper__arrows__arrow--left\"\n [ngClass]=\"{ 'wac-pagination__wrapper__arrows__arrow--disabled': pagination.currentPage === 1 }\"\n >\n <span class=\"wac-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n <div\n (click)=\"incrementPage()\"\n class=\"wac-pagination__wrapper__arrows__arrow wac-pagination__wrapper__arrows__arrow--right\"\n [ngClass]=\"{\n 'wac-pagination__wrapper__arrows__arrow--disabled':\n pagination.currentPage | IsLastPage: pagination.totalItems:pagination.itemsPerPage\n }\"\n >\n <span class=\"wac-pagination__wrapper__arrows__arrow__icon\"></span>\n </div>\n </div>\n </div>\n</div>\n"
2144
- },] }
2145
- ];
2146
- PaginationComponent.ctorParameters = () => [];
2147
- PaginationComponent.propDecorators = {
2148
- pagination: [{ type: Input }],
2149
- pageChange: [{ type: Output }]
2150
- };
2151
-
2152
- class PagniationArrayTotalPages {
2153
- /**
2154
- * Return an incremental array corresponding with the number page
2155
- * [ 1, 2, 3 ..., last page number ]
2156
- * @param totalItems
2157
- * @param itemsPerPage
2158
- */
2159
- transform(totalItems, itemsPerPage) {
2160
- if (!(totalItems >= 0 && itemsPerPage >= 0)) {
2161
- throw new Error('totalItems or itemsPerPage missing in ArrayTotalPages pipe.');
2162
- }
2163
- const arrayLength = Math.ceil(totalItems / itemsPerPage);
2164
- return Array.apply(null, { length: arrayLength })
2165
- .map(Number.call, Number)
2166
- .map(x => x + 1);
2167
- }
2168
- }
2169
- PagniationArrayTotalPages.decorators = [
2170
- { type: Pipe, args: [{
2171
- name: 'ArrayTotalPages'
2172
- },] }
2173
- ];
2174
-
2175
- class PagniationText {
2176
- constructor(translateService) {
2177
- this.translateService = translateService;
2178
- }
2179
- /**
2180
- * Update pagination text if at least one entrie change
2181
- * @param currentPage
2182
- * @param totalItems
2183
- * @param itemsPerPage
2184
- */
2185
- transform(currentPage, totalItems, itemsPerPage) {
2186
- let currentItemsLow = 0, currentItemsHigh = 0;
2187
- if (totalItems) {
2188
- currentItemsLow = (parseInt(currentPage) - 1) * parseInt(itemsPerPage) + 1;
2189
- currentItemsHigh = parseInt(currentPage) * parseInt(itemsPerPage);
2190
- }
2191
- if (currentItemsHigh > totalItems) {
2192
- currentItemsHigh = totalItems;
2193
- }
2194
- return this.translateService.get('wac.PaginationComponent.on', { low: currentItemsLow, high: currentItemsHigh, total: totalItems });
2195
- }
2196
- }
2197
- PagniationText.decorators = [
2198
- { type: Pipe, args: [{
2199
- name: 'customPagniationText'
2200
- },] }
2201
- ];
2202
- PagniationText.ctorParameters = () => [
2203
- { type: TranslateService }
2204
- ];
2205
-
2206
- const pipes = [PagniationArrayTotalPages, PagniationIsLastPage, PagniationText];
2207
- class PaginationModule {
2208
- }
2209
- PaginationModule.decorators = [
2210
- { type: NgModule, args: [{
2211
- imports: [
2212
- CommonModule,
2213
- FormsModule,
2214
- TranslateModule
2215
- ],
2216
- exports: [PaginationComponent],
2217
- declarations: [PaginationComponent, ...pipes],
2218
- providers: [],
2219
- },] }
2220
- ];
2221
-
2222
- class CheckboxModule {
2223
- }
2224
- CheckboxModule.decorators = [
2225
- { type: NgModule, args: [{
2226
- imports: [
2227
- CommonModule,
2228
- FormsModule,
2229
- ],
2230
- exports: [CheckboxComponent],
2231
- declarations: [CheckboxComponent],
2232
- providers: [],
2233
- },] }
2234
- ];
2235
-
2236
- class ProgressBarModule {
2237
- }
2238
- ProgressBarModule.decorators = [
2239
- { type: NgModule, args: [{
2240
- imports: [
2241
- CommonModule,
2242
- FormsModule,
2243
- ],
2244
- exports: [ProgressBarComponent],
2245
- declarations: [ProgressBarComponent],
2246
- providers: [],
2247
- },] }
2248
- ];
2249
-
2250
- class TooltipModule {
2251
- }
2252
- TooltipModule.decorators = [
2253
- { type: NgModule, args: [{
2254
- imports: [
2255
- CommonModule,
2256
- FormsModule
2257
- ],
2258
- exports: [TooltipComponent],
2259
- declarations: [TooltipComponent],
2260
- providers: [],
2261
- },] }
2262
- ];
2263
-
2264
- class InputModule {
2265
- }
2266
- InputModule.decorators = [
2267
- { type: NgModule, args: [{
2268
- imports: [
2269
- CommonModule,
2270
- FormsModule,
2271
- SharedDirectives,
2272
- TooltipModule,
2273
- ProgressBarModule
2274
- ],
2275
- exports: [InputComponent],
2276
- declarations: [InputComponent],
2277
- providers: [],
2278
- },] }
2279
- ];
2280
-
2281
- class InputSearchModule {
2282
- }
2283
- InputSearchModule.decorators = [
2284
- { type: NgModule, args: [{
2285
- imports: [
2286
- CommonModule,
2287
- FormsModule,
2288
- InputModule,
2289
- SharedDirectives
2290
- ],
2291
- exports: [InputSearchComponent],
2292
- declarations: [InputSearchComponent],
2293
- providers: [],
2294
- },] }
2295
- ];
2296
-
2297
- class LoaderModule {
2298
- }
2299
- LoaderModule.decorators = [
2300
- { type: NgModule, args: [{
2301
- imports: [
2302
- CommonModule,
2303
- FormsModule,
2304
- ],
2305
- exports: [LoaderComponent],
2306
- declarations: [LoaderComponent],
2307
- providers: [],
2308
- },] }
2309
- ];
2310
-
2311
- class TableColumn {
2312
- constructor(currentCell, renderer, document) {
2313
- this.currentCell = currentCell;
2314
- this.renderer = renderer;
2315
- this.document = document;
2316
- this.centerCellValue = ['left', 'center', 'right'];
2317
- }
2318
- ngAfterViewInit() {
2319
- this.applyCustomStylesOnCell();
2320
- }
2321
- applyCustomStylesOnCell() {
2322
- this.currentCell.nativeElement.style.flexGrow = typeof this.columnSize !== 'undefined' ? this.columnSize : '1';
2323
- this.renderer.addClass(this.currentCell.nativeElement, 'wac-table__body__line__cell');
2324
- if (this.centerCell) {
2325
- if (this.centerCellValue.indexOf(this.centerCell) === -1) {
2326
- throw 'Error : The centerCell directive has no matched value. The value must be one of the following : left, center, right.';
2327
- }
2328
- let className = 'wac-table__body__line__cell--center' + '--' + this.centerCell;
2329
- this.renderer.addClass(this.currentCell.nativeElement, className);
2330
- }
2331
- }
2332
- }
2333
- TableColumn.decorators = [
2334
- { type: Directive, args: [{
2335
- selector: '[tableColumn]'
2336
- },] }
2337
- ];
2338
- TableColumn.ctorParameters = () => [
2339
- { type: ElementRef },
2340
- { type: Renderer2 },
2341
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
2342
- ];
2343
- TableColumn.propDecorators = {
2344
- columnSize: [{ type: Input, args: ['columnSize',] }],
2345
- centerCell: [{ type: Input, args: ['centerCell',] }]
2346
- };
2347
-
2348
- class TableColumnHeader {
2349
- constructor(currentCell, renderer, document, filtersTableService) {
2350
- this.currentCell = currentCell;
2351
- this.renderer = renderer;
2352
- this.document = document;
2353
- this.filtersTableService = filtersTableService;
2354
- this._headerName = '';
2355
- this.filterRouting = false; // Optional. Set to true to use Filter Routing.
2356
- this.onSortChange = new EventEmitter(); // Emit the sort value (true, false, undefuned) of the current sort icon when clicking
2357
- this.tableFiltersChange = new EventEmitter();
2358
- this.centerCellValue = ['left', 'center', 'right'];
2359
- this.subscriptions = [];
2360
- }
2361
- set headerName(value) {
2362
- this._headerName = value;
2363
- this.setHeaderName();
2364
- }
2365
- get headerName() {
2366
- return this._headerName;
2367
- }
2368
- ngOnInit() {
2369
- if (this.tableName && this.sortName) {
2370
- if (this.filterRouting) {
2371
- this.handleSortRouting();
2372
- }
2373
- else {
2374
- this.handleSortBasic();
2375
- }
2376
- }
2377
- }
2378
- ngAfterViewInit() {
2379
- this.applyCustomStylesOnCell();
2380
- this.renderHeaderColumn();
2381
- }
2382
- handleSortRouting() {
2383
- this.filterGroup = this.filtersTableService.getTableFilterGroup(this.tableName);
2384
- const filterGroupChangeSub = this.filterGroup.valuesChange$.subscribe((filters) => {
2385
- if (!filters || !filters.length) {
2386
- return;
2387
- }
2388
- const filterSort = filters.filter(filter => filter.key === 'sort')[0];
2389
- if (this.sortName !== filterSort.value) {
2390
- this.resetSortIcon();
2391
- }
2392
- });
2393
- this.subscriptions.push(filterGroupChangeSub);
2394
- }
2395
- handleSortBasic() {
2396
- const sortChangeSub = this.filtersTableService.getSortChangeListner().subscribe(sort => {
2397
- if (this.tableName === sort.dataTableName && this.sortName !== sort.sortName) {
2398
- // Reset the current sort icon
2399
- this.resetSortIcon();
2400
- }
2401
- });
2402
- this.subscriptions.push(sortChangeSub);
2403
- }
2404
- resetSortIcon() {
2405
- // Replace current icon with default icon
2406
- this.contentHeader.className = this.contentHeader.className.replace(this.getCurrentSortIcon(), 'idle');
2407
- }
2408
- applyCustomStylesOnCell() {
2409
- this.currentCell.nativeElement.style.flexGrow = typeof this.columnSize !== 'undefined' ? this.columnSize : '1';
2410
- this.renderer.addClass(this.currentCell.nativeElement, 'wac-table__head__cell');
2411
- if (this.centerCell) {
2412
- if (this.centerCellValue.indexOf(this.centerCell) === -1) {
2413
- throw 'Error : The centerCell directive has no matched value. The value must be one of the following : left, center, right.';
2414
- }
2415
- let className = 'wac-table__head__cell--center' + '--' + this.centerCell;
2416
- this.renderer.addClass(this.currentCell.nativeElement, className);
2417
- }
2418
- }
2419
- renderHeaderColumn() {
2420
- this.createHeaderContent();
2421
- this.renderer.appendChild(this.currentCell.nativeElement, this.contentHeader);
2422
- }
2423
- createHeaderContent() {
2424
- this.contentHeader = document.createElement('a');
2425
- this.contentHeader.className = 'wac-table__head__cell__search';
2426
- this.setHeaderName();
2427
- if (this.tableName && this.sortName) {
2428
- this.handleSort();
2429
- }
2430
- }
2431
- setHeaderName() {
2432
- if (!this.contentHeader) {
2433
- return;
2434
- }
2435
- this.contentHeader.innerHTML = this.headerName;
2436
- }
2437
- handleSort() {
2438
- // Set icon in the header column cell
2439
- this.contentHeader.className += ' wac-table__head__cell__search--' + this.getInitialSortIcon();
2440
- // On click on the content header, change the icon and emit event
2441
- this.renderer.listen(this.contentHeader, 'click', () => {
2442
- const currentIcon = this.getCurrentSortIcon();
2443
- let newIcon;
2444
- let newSort, newOrder;
2445
- switch (currentIcon) {
2446
- case 'idle':
2447
- newIcon = 'up';
2448
- newSort = this.sortName;
2449
- newOrder = true;
2450
- break;
2451
- case 'up':
2452
- newIcon = 'down';
2453
- newSort = this.sortName;
2454
- newOrder = false;
2455
- break;
2456
- case 'down':
2457
- newIcon = 'idle';
2458
- break;
2459
- default:
2460
- newIcon = 'idle';
2461
- break;
2462
- }
2463
- // Replace the icon
2464
- this.contentHeader.className = this.contentHeader.className.replace(currentIcon, newIcon);
2465
- this.emitEvents(newSort, newOrder);
2466
- });
2467
- }
2468
- getInitialSortIcon() {
2469
- if (!this.filterRouting) {
2470
- return 'idle';
2471
- }
2472
- // Get Initial Sort Icon for Routing Filter
2473
- let initialSortIcon = 'idle';
2474
- if (this.filterGroup.get('sort') === this.sortName) {
2475
- initialSortIcon = this.filterGroup.get('order') == 'true' ? 'up' : 'down';
2476
- }
2477
- return initialSortIcon;
2478
- }
2479
- getCurrentSortIcon() {
2480
- const regexp = /wac-table__head__cell__search--(?<icon>\w+)/;
2481
- const { groups } = regexp.exec(this.contentHeader.className);
2482
- return groups.icon;
2483
- }
2484
- emitEvents(newSort, newOrder) {
2485
- if (this.filterRouting) {
2486
- // Will send the filter routing value has changes event
2487
- this.filterGroup.setValues({
2488
- sort: newSort,
2489
- order: newOrder,
2490
- currentPage: 1
2491
- });
2492
- }
2493
- else {
2494
- // Send the event sort change
2495
- this.filtersTableService.emitSortChange(this.tableName, this.sortName, newOrder);
2496
- }
2497
- if (this.tableFilters) {
2498
- this.tableFilters.sort = this.sortName;
2499
- this.tableFilters.order = newOrder;
2500
- this.tableFilters.currentPage = 1;
2501
- this.tableFiltersChange.emit(this.tableFilters);
2502
- }
2503
- this.onSortChange.emit(newOrder);
2504
- }
2505
- ngOnDestroy() {
2506
- this.subscriptions.forEach(subscription => {
2507
- subscription.unsubscribe();
2508
- });
2509
- }
2510
- }
2511
- TableColumnHeader.decorators = [
2512
- { type: Directive, args: [{
2513
- // The selector has the same name as the headerCell selector in table.component.html
2514
- selector: '[headerCell]'
2515
- },] }
2516
- ];
2517
- TableColumnHeader.ctorParameters = () => [
2518
- { type: ElementRef },
2519
- { type: Renderer2 },
2520
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
2521
- { type: FiltersTableService }
2522
- ];
2523
- TableColumnHeader.propDecorators = {
2524
- headerName: [{ type: Input, args: ['headerName',] }],
2525
- columnSize: [{ type: Input, args: ['columnSize',] }],
2526
- filterRouting: [{ type: Input, args: ['filterRouting',] }],
2527
- tableName: [{ type: Input, args: ['tableName',] }],
2528
- sortName: [{ type: Input, args: ['sortName',] }],
2529
- centerCell: [{ type: Input, args: ['centerCell',] }],
2530
- onSortChange: [{ type: Output }],
2531
- tableFilters: [{ type: Input }],
2532
- tableFiltersChange: [{ type: Output }]
2533
- };
2534
-
2535
- const directives$1 = [TableColumn, CheckBoxRow, TableColumnHeader, TableRow,];
2536
- class TableModule {
2537
- }
2538
- TableModule.decorators = [
2539
- { type: NgModule, args: [{
2540
- imports: [
2541
- CommonModule,
2542
- FormsModule,
2543
- InputSearchModule,
2544
- LoaderModule,
2545
- CheckboxModule,
2546
- PaginationModule
2547
- ],
2548
- exports: [TableComponent, ...directives$1],
2549
- declarations: [TableComponent, ...directives$1],
2550
- providers: [],
2551
- },] }
2552
- ];
2553
-
2554
- class UploadComponent {
2555
- constructor() {
2556
- this.label = 'Choisir les images à importer';
2557
- this.type = 'button';
2558
- this.icon = 'far fa-images';
2559
- this.image = 'assets/angular-components/images/upload/icon_picture.svg';
2560
- this.labelImage = 'Glisser-déposer votre image ici';
2561
- this.open = new EventEmitter();
2562
- }
2563
- ngOnInit() { }
2564
- triggerEvent(event) {
2565
- this.open.emit(event);
2566
- }
2567
- }
2568
- UploadComponent.decorators = [
2569
- { type: Component, args: [{
2570
- selector: 'wac-upload',
2571
- template: "<div class=\"wac-upload\" [ngClass]=\"{ portrait: type === 'portrait', landscape: type === 'landscape' }\">\n <div class=\"wac-upload__wrapper\">\n <div *ngIf=\"(type === 'portrait' || type === 'landscape') && image\" class=\"wac-upload__wrapper__visual\">\n <img [src]=\"image\" />\n <strong [innerHTML]=\"labelImage\"></strong>\n </div>\n <span *ngIf=\"(type === 'portrait' || type === 'landscape') && image\">ou</span>\n <button (click)=\"triggerEvent($event)\">\n <span *ngIf=\"icon\"><i [classList]=\"icon\"></i></span>\n <span [innerHTML]=\"label\"></span>\n </button>\n </div>\n</div>\n"
2572
- },] }
2573
- ];
2574
- UploadComponent.ctorParameters = () => [];
2575
- UploadComponent.propDecorators = {
2576
- label: [{ type: Input }],
2577
- type: [{ type: Input }],
2578
- icon: [{ type: Input }],
2579
- image: [{ type: Input }],
2580
- labelImage: [{ type: Input }],
2581
- open: [{ type: Output }]
2582
- };
2583
-
2584
- class H4Component {
2585
- constructor() {
2586
- this.grey = false;
2587
- }
2588
- ngOnInit() { }
2589
- }
2590
- H4Component.decorators = [
2591
- { type: Component, args: [{
2592
- selector: 'wac-h4',
2593
- template: "<h4 class=\"wac-h4\" [ngClass]=\"{ grey: grey }\"><ng-content></ng-content></h4>\n"
2594
- },] }
2595
- ];
2596
- H4Component.ctorParameters = () => [];
2597
- H4Component.propDecorators = {
2598
- grey: [{ type: Input }]
2599
- };
2600
-
2601
- class SelectInTextComponent {
2602
- constructor() {
2603
- this.type = 'default';
2604
- this.alwaysOpen = false;
2605
- this.openCategories = false;
2606
- this.currentLabel = '';
2607
- this.currentLabelIcon = '';
2608
- this.maxWidth = '100%';
2609
- this.selectValue = new EventEmitter();
2610
- this.clickOnCallToAction = new EventEmitter();
2611
- }
2612
- set items(items) {
2613
- this._items = items;
2614
- this.setInitialValues();
2615
- }
2616
- get items() {
2617
- return this._items;
2618
- }
2619
- ngOnInit() {
2620
- this.currentLabel = this.placeholder;
2621
- this.setInitialValues();
2622
- }
2623
- setInitialValues() {
2624
- if (!this.items.length) {
2625
- return;
2626
- }
2627
- const itemSelected = this.getItemSelected();
2628
- this.setCurrentItem(itemSelected);
2629
- }
2630
- onClose() {
2631
- this.openCategories = false;
2632
- }
2633
- customTB(item, index) {
2634
- return `${item.id}-${index}`;
2635
- }
2636
- onSelectItem(index) {
2637
- this.unselectAll();
2638
- const itemSelected = this.items[index];
2639
- this.setCurrentItem(itemSelected);
2640
- this.selectValue.emit(index);
2641
- }
2642
- onClickCallToAction() {
2643
- this.clickOnCallToAction.emit(this.callToAction.value);
2644
- }
2645
- getItemSelected() {
2646
- let itemSelected = null;
2647
- this.items.forEach(item => {
2648
- if (!item.selected) {
2649
- return;
2650
- }
2651
- itemSelected = item;
2652
- });
2653
- return itemSelected;
2654
- }
2655
- setCurrentItem(itemSelected) {
2656
- if (!itemSelected) {
2657
- return;
2658
- }
2659
- itemSelected.selected = true;
2660
- this.currentLabel = itemSelected.name;
2661
- this.currentLabelIcon = itemSelected.icon;
2662
- }
2663
- unselectAll() {
2664
- this.items.forEach(item => item.selected = false);
2665
- }
2666
- }
2667
- SelectInTextComponent.decorators = [
2668
- { type: Component, args: [{
2669
- selector: 'wac-select-in-text',
2670
- template: "<div class=\"wac-select-in-text\" wzAutoHide (clickOutside)=\"onClose()\" [ngStyle]=\"{ 'max-width': maxWidth }\" [zIndexToggle]=\"openCategories\">\n <div class=\"wac-select-in-text__prepend\" [innerHTML]=\"preText\" *ngIf=\"preText\"></div>\n <div #current class=\"wac-select-in-text__current\" (click)=\"openCategories = !openCategories\">\n <span>{{ currentLabel }}</span>\n <div\n class=\"wac-select-in-text__content\"\n [ngClass]=\"{ hidden: !openCategories && !alwaysOpen, open: type === 'open' }\"\n [ngStyle]=\"{ 'max-width': maxWidthItems }\"\n >\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"items.length > 0\">\n <div class=\"wac-select-in-text__content__item\" *ngFor=\"let item of items; trackBy: customTB; let index = index;\">\n <div [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(index)\">\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name }}\n </div>\n </div>\n </perfect-scrollbar>\n </div>\n </div>\n <div class=\"wac-select-in-text__after\" [innerHTML]=\"postText\" *ngIf=\"postText\"></div>\n</div>\n"
2671
- },] }
2672
- ];
2673
- SelectInTextComponent.ctorParameters = () => [];
2674
- SelectInTextComponent.propDecorators = {
2675
- items: [{ type: Input }],
2676
- placeholder: [{ type: Input }],
2677
- label: [{ type: Input }],
2678
- maxWidthItems: [{ type: Input }],
2679
- type: [{ type: Input }],
2680
- callToAction: [{ type: Input }],
2681
- preText: [{ type: Input }],
2682
- postText: [{ type: Input }],
2683
- alwaysOpen: [{ type: Input }],
2684
- maxWidth: [{ type: Input }],
2685
- selectValue: [{ type: Output }],
2686
- clickOnCallToAction: [{ type: Output }]
2687
- };
2688
-
2689
- class SelectComponent {
2690
- constructor(translateService) {
2691
- this.translateService = translateService;
2692
- this.search = false;
2693
- this.searchValue = '';
2694
- this.searchValueChange = new EventEmitter();
2695
- this.type = 'default';
2696
- this.maxWidth = '100%';
2697
- this.disabled = false;
2698
- this.selectValue = new EventEmitter(); // todo rename more explicit
2699
- this.clickOnCallToAction = new EventEmitter();
2700
- this.openCategories = false;
2701
- this.indexItemSelected = -1;
2702
- // ControlValueAccessor methods
2703
- this.onChange = () => { };
2704
- this.onTouch = () => { };
2705
- }
2706
- set items(items) {
2707
- this._items = items;
2708
- this.setIndexItemSelected();
2709
- }
2710
- get items() {
2711
- return this._items;
2712
- }
2713
- set callToAction(callToAction) {
2714
- this._calllToAction = callToAction;
2715
- }
2716
- get callToAction() {
2717
- return this._calllToAction;
2718
- }
2719
- ngOnInit() {
2720
- }
2721
- onClose() {
2722
- this.openCategories = false;
2723
- }
2724
- customTB(item, index) {
2725
- return `${item.id}-${index}`;
2726
- }
2727
- onSelectItem(id) {
2728
- this.unselectAll();
2729
- this.setIndexItemSelectedById(id);
2730
- const itemSelected = this.getItemSelected();
2731
- itemSelected.selected = true;
2732
- this.selectValue.emit(this.indexItemSelected);
2733
- this.onChange(itemSelected);
2734
- }
2735
- onClickCallToAction() {
2736
- this.onClose();
2737
- this.clickOnCallToAction.emit(this.callToAction.value);
2738
- }
2739
- onSearcheValueChange() {
2740
- this.searchValueChange.emit(this.searchValue);
2741
- }
2742
- getItemSelected() {
2743
- return this.items[this.indexItemSelected];
2744
- }
2745
- showCategories() {
2746
- this.openCategories = true;
2747
- setTimeout(() => {
2748
- var _a;
2749
- (_a = this.searchElement.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
2750
- }, 0);
2751
- }
2752
- unselectAll() {
2753
- this.items.forEach(item => item.selected = false);
2754
- }
2755
- setIndexItemSelectedById(id) {
2756
- this.indexItemSelected = this.items.findIndex(item => item.id === id);
2757
- }
2758
- setIndexItemSelected() {
2759
- this.indexItemSelected = this.items.findIndex(item => item.selected);
2760
- }
2761
- writeValue(selectItem) {
2762
- if (!selectItem) {
2763
- return;
2764
- }
2765
- this.unselectAll();
2766
- selectItem.selected = true;
2767
- this.setIndexItemSelectedById(selectItem.id);
2768
- }
2769
- registerOnChange(fn) {
2770
- this.onChange = fn;
2771
- }
2772
- registerOnTouched(fn) {
2773
- this.onTouch = fn;
2774
- }
2775
- }
2776
- SelectComponent.decorators = [
2777
- { type: Component, args: [{
2778
- selector: 'wac-select',
2779
- 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\"></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\" (ngModelChange)=\"onSearcheValueChange()\" (keypressEnter)=\"onClickCallToAction()\"/>\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 <perfect-scrollbar [config]=\"{ 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 [ngClass]=\"{ selected: item.selected }\" (click)=\"onSelectItem(item.id)\">\n <span class=\"icon\" [innerHTML]=\"item.icon\" *ngIf=\"item.icon\"></span>{{ item.name }}\n </div>\n </div>\n\n </perfect-scrollbar>\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>",
2780
- providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true }]
2781
- },] }
2782
- ];
2783
- SelectComponent.ctorParameters = () => [
2784
- { type: TranslateService }
2785
- ];
2786
- SelectComponent.propDecorators = {
2787
- items: [{ type: Input }],
2788
- placeholder: [{ type: Input }],
2789
- label: [{ type: Input }],
2790
- maxWidthItems: [{ type: Input }],
2791
- search: [{ type: Input }],
2792
- searchValue: [{ type: Input }],
2793
- searchValueChange: [{ type: Output }],
2794
- type: [{ type: Input }],
2795
- callToAction: [{ type: Input }],
2796
- maxWidth: [{ type: Input }],
2797
- disabled: [{ type: Input }],
2798
- selectValue: [{ type: Output }],
2799
- clickOnCallToAction: [{ type: Output }],
2800
- searchElement: [{ type: ViewChild, args: ['search',] }]
2801
- };
2802
-
2803
- class MultipleSearchComponent {
2804
- constructor(translateService) {
2805
- this.translateService = translateService;
2806
- this.options = {};
2807
- this.alwaysOpen = false;
2808
- this.label = '';
2809
- this.placeholder = '';
2810
- this.icon = '';
2811
- this.query = '';
2812
- this.search = '';
2813
- this.openSelect = false;
2814
- this.error = 'wac.simpleSearchComponent.error';
2815
- this.showError = false;
2816
- }
2817
- ngOnInit() {
2818
- this.setPlaceholder();
2819
- this.setLabel();
2820
- this.setQuery();
2821
- this.setIcon();
2822
- }
2823
- setSearchValueToQuery(value) {
2824
- if (value.code !== 'Enter') {
2825
- this.search = encodeURI(value.target.value);
2826
- }
2827
- else {
2828
- this.submitForm();
2829
- }
2830
- }
2831
- submitForm() {
2832
- if (this.search) {
2833
- if (this.search.length > 0) {
2834
- window.location.href = this.query.replace('{s}', this.search);
2835
- }
2836
- else {
2837
- this.displayError();
2838
- }
2839
- }
2840
- else {
2841
- this.displayError();
2842
- }
2843
- }
2844
- setPlaceholder(value) {
2845
- if (value) {
2846
- this.placeholder = this.options[value].placeholder;
2847
- }
2848
- else {
2849
- this.placeholder = this.options[0].placeholder;
2850
- }
2851
- }
2852
- setLabel(value) {
2853
- if (value) {
2854
- this.label = this.options[value].label;
2855
- }
2856
- else {
2857
- this.label = this.options[0].label;
2858
- }
2859
- }
2860
- setQuery(value) {
2861
- if (value) {
2862
- this.query = this.options[value].queries;
2863
- }
2864
- else {
2865
- this.query = this.options[0].queries;
2866
- }
2867
- }
2868
- displayError() {
2869
- this.showError = true;
2870
- setTimeout(() => {
2871
- this.hideError();
2872
- }, 2000);
2873
- }
2874
- hideError() {
2875
- this.showError = false;
2876
- }
2877
- setIcon(value) {
2878
- if (value) {
2879
- this.icon = this.options[value].icon;
2880
- }
2881
- else {
2882
- this.icon = this.options[0].icon;
2883
- }
2884
- }
2885
- openFuncSelect() {
2886
- this.openSelect = !this.openSelect;
2887
- }
2888
- closeSelect() {
2889
- this.openSelect = false;
2890
- }
2891
- resetAllVue(value) {
2892
- this.setPlaceholder(value);
2893
- this.setLabel(value);
2894
- this.setQuery(value);
2895
- this.setIcon(value);
2896
- this.search = '';
2897
- this.closeSelect();
2898
- }
2899
- }
2900
- MultipleSearchComponent.decorators = [
2901
- { type: Component, args: [{
2902
- selector: 'wac-multiple-search',
2903
- template: "<div class=\"wac-multiple-search\" [ngClass]=\"{ open: openSelect || alwaysOpen }\" [zIndexToggle]=\"openSelect\">\n <div class=\"wac-multiple-search__wrapper\">\n <div class=\"wac-multiple-search__wrapper__left\" [ngClass]=\"{ open: openSelect || alwaysOpen }\" wzAutoHide (clickOutside)=\"closeSelect()\">\n <span>{{ label }}</span>\n <i class=\"fal fa-chevron-down\"></i>\n <div class=\"wac-multiple-search__wrapper__left__background\" (click)=\"openFuncSelect()\"></div>\n <div class=\"wac-multiple-search__wrapper__left__select\" *ngIf=\"openSelect || alwaysOpen\">\n <div\n class=\"wac-multiple-search__wrapper__left__select__item\"\n *ngFor=\"let option of options; let i = index\"\n [attr.data-index]=\"i\"\n (click)=\"resetAllVue(i); inputSearch.value = ''\"\n >\n <i [ngClass]=\"option.icon\"></i>\n <span>{{ option.label }}</span>\n <input type=\"hidden\" value=\"\" />\n </div>\n </div>\n </div>\n <div class=\"wac-multiple-search__wrapper__right\">\n <form [action]=\"query\" method=\"get\">\n <button type=\"submit\" (click)=\"submitForm()\"><i class=\"fal fa-search\"></i></button>\n <input #inputSearch type=\"text\" required [placeholder]=\"placeholder\" (keyup)=\"setSearchValueToQuery($event)\" />\n </form>\n </div>\n </div>\n <div class=\"wac-multiple-search__error\" *ngIf=\"showError\">{{ error | translate}}</div>\n</div>\n"
2904
- },] }
2905
- ];
2906
- MultipleSearchComponent.ctorParameters = () => [
2907
- { type: TranslateService }
2908
- ];
2909
- MultipleSearchComponent.propDecorators = {
2910
- options: [{ type: Input }],
2911
- alwaysOpen: [{ type: Input }]
2912
- };
2913
-
2914
- class MultipleSearchPlusComponent {
2915
- constructor() {
2916
- this.label = '';
2917
- this.placeholder = '';
2918
- this.openSelect = false;
2919
- this.openSearchResults = false;
2920
- this.isLoading = true;
2921
- this.searchValue = new EventEmitter();
2922
- this.optionsChange = new EventEmitter();
2923
- }
2924
- ngOnInit() {
2925
- this.setCurrentOption();
2926
- this.setPlaceholder();
2927
- this.setLabel();
2928
- }
2929
- setSearchValue(value) {
2930
- if (value.target.value != '') {
2931
- this.openSearchResults = true;
2932
- }
2933
- else {
2934
- this.openSearchResults = false;
2935
- }
2936
- this.searchValue.emit({ currentOption: this.options[this.currentOption].code, value: value.target.value });
2937
- }
2938
- setCurrentOption(value) {
2939
- this.currentOption = value || 0;
2940
- }
2941
- setPlaceholder(value) {
2942
- this.placeholder = value ? this.options[value].placeholder : this.options[0].placeholder;
2943
- }
2944
- setLabel(value) {
2945
- this.label = value ? this.options[value].label : this.options[0].label;
2946
- }
2947
- onToggleSelect() {
2948
- this.openSelect = !this.openSelect;
2949
- }
2950
- closeSelect() {
2951
- this.openSelect = false;
2952
- }
2953
- closeSearchResults() {
2954
- this.openSearchResults = false;
2955
- }
2956
- resetAllVue(value) {
2957
- this.searchResults = undefined;
2958
- this.setCurrentOption(value);
2959
- this.setPlaceholder(value);
2960
- this.setLabel(value);
2961
- this.openSearchResults = false;
2962
- this.closeSelect();
2963
- }
2964
- addResult(index) {
2965
- let alreadyExist = false;
2966
- this.options[this.currentOption].table.forEach(elem => {
2967
- if (elem.id == this.searchResults[index].id) {
2968
- alreadyExist = true;
2969
- }
2970
- });
2971
- if (!alreadyExist) {
2972
- this.options[this.currentOption].table.push(this.searchResults[index]);
2973
- }
2974
- this.resetAllVue(this.currentOption);
2975
- this.optionsChange.emit({ currentOption: this.options[this.currentOption].code, action: 'add' });
2976
- }
2977
- deleteResult(indexItem, index) {
2978
- this.options[index].table.splice(indexItem, 1);
2979
- this.optionsChange.emit({ currentOption: this.options[index].code, action: 'delete' });
2980
- }
2981
- }
2982
- MultipleSearchPlusComponent.decorators = [
2983
- { type: Component, args: [{
2984
- selector: 'wac-multiple-search-plus',
2985
- template: "<div class=\"wac-multiple-search-plus\" [zIndexToggle]=\"openSelect || openSearchResults\">\n <!-- Multiple select with search input -->\n <div class=\"wac-multiple-search\" [ngClass]=\"{ open: openSelect }\">\n <div class=\"wac-multiple-search__wrapper\">\n <div class=\"wac-multiple-search__wrapper__left\" *ngIf=\"options.length > 1\" [ngClass]=\"{ open: openSelect }\" wzAutoHide (clickOutside)=\"closeSelect()\">\n <span>{{ label }}</span>\n <i class=\"fal fa-chevron-down\"></i>\n <div class=\"wac-multiple-search__wrapper__left__background\" (click)=\"onToggleSelect()\"></div>\n <div class=\"wac-multiple-search__wrapper__left__select\" *ngIf=\"openSelect\">\n <div\n class=\"wac-multiple-search__wrapper__left__select__item\"\n *ngFor=\"let option of options; let i = index\"\n [attr.data-index]=\"i\"\n (click)=\"resetAllVue(i); inputSearch.value = ''\"\n >\n <span>{{ option.label }}</span>\n <input type=\"hidden\" value=\"\" />\n </div>\n </div>\n </div>\n <div class=\"wac-multiple-search__wrapper__right\" wzAutoHide (clickOutside)=\"closeSearchResults()\">\n <button><i class=\"fal fa-search\"></i></button>\n <input\n #inputSearch\n type=\"text\"\n [placeholder]=\"placeholder\"\n debounceKeyUp\n [debounceTime]=\"500\"\n (onEventChange)=\"setSearchValue($event)\"\n />\n <div class=\"wac-multiple-search__wrapper__left__select\" *ngIf=\"openSearchResults\">\n <div\n class=\"wac-multiple-search__wrapper__left__select__item\"\n *ngFor=\"let res of searchResults; let i = index\"\n (click)=\"addResult(i); inputSearch.value = ''\"\n >\n <wac-image *ngIf=\"res.image\" [src]=\"res.image\"></wac-image>\n <wac-text>#{{ res.id }} {{ res.name }}</wac-text>\n </div>\n <div class=\"wac-table__body__loader\" *ngIf=\"isLoading && !searchResults\">\n <wac-loader [small]=\"true\"></wac-loader>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Results checked -->\n <div *ngFor=\"let option of options; let i = index\">\n <div class=\"wac-multiple-search-plus__wrapper\" *ngIf=\"option.table.length\">\n <wac-h3>{{ option.title }}</wac-h3>\n <div class=\"wac-multiple-search-plus__wrapper__block hover default\" *ngFor=\"let item of option.table; let indexItem = index\">\n <wac-image *ngIf=\"item.image\" [src]=\"item.image\"></wac-image>\n <wac-text>{{ item.name }}</wac-text>\n <span (click)=\"deleteResult(indexItem, i)\"><i class=\"fas fa-times\"></i></span>\n </div>\n </div>\n </div>\n</div>\n"
2986
- },] }
2987
- ];
2988
- MultipleSearchPlusComponent.ctorParameters = () => [];
2989
- MultipleSearchPlusComponent.propDecorators = {
2990
- options: [{ type: Input }],
2991
- searchResults: [{ type: Input }],
2992
- searchValue: [{ type: Output }],
2993
- optionsChange: [{ type: Output }]
2994
- };
2995
-
2996
- class InputWithSelectComponent {
2997
- constructor() {
2998
- this.showSelect = false;
2999
- this.inputValueChange = new EventEmitter();
3000
- this.selectValueChange = new EventEmitter();
3001
- }
3002
- ngOnInit() {
3003
- this.options.forEach((item) => {
3004
- if (item.active) {
3005
- this.currentLabel = item.label;
3006
- }
3007
- });
3008
- }
3009
- onClickItem(index) {
3010
- this.unActiveAll();
3011
- const optionSelected = this.options[index];
3012
- optionSelected.active = true;
3013
- this.currentLabel = optionSelected.label;
3014
- this.showSelect = false;
3015
- this.selectValueChange.emit(index);
3016
- }
3017
- onToggleSelect() {
3018
- this.showSelect = !this.showSelect;
3019
- }
3020
- onCloseSelect() {
3021
- this.showSelect = false;
3022
- }
3023
- onChangeInputValue(e) {
3024
- this.inputValueChange.emit(e.target.value);
3025
- }
3026
- unActiveAll() {
3027
- this.options.forEach((item) => {
3028
- item.active = false;
3029
- });
3030
- }
3031
- }
3032
- InputWithSelectComponent.decorators = [
3033
- { type: Component, args: [{
3034
- selector: 'wac-input-with-select',
3035
- template: "<div class=\"wac-input-with-select\" [zIndexToggle]=\"showSelect\">\n <label class=\"wac-input-with-select__label\" [for]=\"id\" [innerHTML]=\"label\"></label>\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\" wzAutoHide (clickOutside)=\"onCloseSelect()\">\n <input [id]=\"id\" type=\"text\" [placeholder]=\"placeholder\" (change)=\"onChangeInputValue($event)\" />\n <div class=\"wac-input-with-select__wrapper__left__current\">\n <span (click)=\"onToggleSelect()\">{{ currentLabel }}</span>\n </div>\n <div class=\"wac-input-with-select__wrapper__left__select\" *ngIf=\"showSelect\">\n <div class=\"wac-input-with-select__wrapper__left__select__item\" *ngFor=\"let option of options; let index = index\">\n <div (click)=\"onClickItem(index)\">{{ option.label }}</div>\n </div>\n </div>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <p [innerHTML]=\"text\"></p>\n </div>\n </div>\n</div>\n"
3036
- },] }
3037
- ];
3038
- InputWithSelectComponent.ctorParameters = () => [];
3039
- InputWithSelectComponent.propDecorators = {
3040
- label: [{ type: Input }],
3041
- text: [{ type: Input }],
3042
- options: [{ type: Input }],
3043
- placeholder: [{ type: Input }],
3044
- id: [{ type: Input }],
3045
- inputValueChange: [{ type: Output }],
3046
- selectValueChange: [{ type: Output }]
3047
- };
3048
-
3049
- class PopinComponent {
3050
- constructor(domService) {
3051
- this.domService = domService;
3052
- this.visible = false;
3053
- this.visibleChange = new EventEmitter();
3054
- this.response = new EventEmitter();
3055
- this.background = true;
3056
- this.firstOpen = true;
3057
- }
3058
- ngOnInit() {
3059
- this.domService.setDocumentEventListener();
3060
- }
3061
- validatePopin() {
3062
- this.response.emit(true);
3063
- this.closePopin();
3064
- }
3065
- refusePopin() {
3066
- this.response.emit(false);
3067
- this.closePopin();
3068
- }
3069
- closePopin() {
3070
- if (!this.firstOpen) { //trick for auto-hide directive that close immediatly the pop-in
3071
- this.visible = false;
3072
- this.visibleChange.emit(this.visible);
3073
- this.firstOpen = true;
3074
- }
3075
- else {
3076
- this.firstOpen = false;
3077
- }
3078
- }
3079
- }
3080
- PopinComponent.decorators = [
3081
- { type: Component, args: [{
3082
- selector: 'wac-popin',
3083
- template: "<div class=\"wac-free\" *ngIf=\"visible\">\n <div class=\"wac-free__wrapper\" wzAutoHide (clickOutside)=\"closePopin()\">\n <a class=\"wac-free__wrapper__button-close\" (click)=\"closePopin()\">\n <i class=\"fas fa-times\"></i>\n </a>\n <div class=\"wac-free__wrapper__content\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <img [src]=\"imgSrc\" alt=\"barre admin\" />\n\n <h2 class=\"wac-popin__wrapper__title\" [innerHTML]=\"title\"></h2>\n\n <p class=\"wac-popin__wrapper__text\" [innerHTML]=\"content\"></p>\n </perfect-scrollbar>\n </div>\n <div class=\"wac-free__wrapper__buttons\">\n <div class=\"wac-free__wrapper__buttons__button\" *ngIf=\"okButtonLabel\">\n <wac-button [extraClasses]=\"'is-success'\" [label]=\"okButtonLabel\" hasLoader=\"true\" (click)=\"validatePopin()\"></wac-button>\n </div>\n <div class=\"wac-free__wrapper__buttons__button\" *ngIf=\"koButtonLabel\">\n <wac-button [extraClasses]=\"'is-danger is-outlined'\" [label]=\"koButtonLabel\" hasLoader=\"true\" (click)=\"refusePopin()\"></wac-button>\n </div>\n </div>\n </div>\n <div class=\"wac-free__background\" *ngIf=\"background\"></div>\n</div>\n"
3084
- },] }
3085
- ];
3086
- PopinComponent.ctorParameters = () => [
3087
- { type: DomService }
3088
- ];
3089
- PopinComponent.propDecorators = {
3090
- title: [{ type: Input }],
3091
- content: [{ type: Input }],
3092
- imgSrc: [{ type: Input }],
3093
- okButtonLabel: [{ type: Input }],
3094
- koButtonLabel: [{ type: Input }],
3095
- okButtonClass: [{ type: Input }],
3096
- koButtonClass: [{ type: Input }],
3097
- visible: [{ type: Input }],
3098
- visibleChange: [{ type: Output }],
3099
- response: [{ type: Output }],
3100
- background: [{ type: Input }]
3101
- };
3102
-
3103
- class FreePopinComponent {
3104
- constructor(domService) {
3105
- this.domService = domService;
3106
- this.visible = false;
3107
- this.disableCloseOutside = false;
3108
- this.visibleChange = new EventEmitter();
3109
- this.response = new EventEmitter();
3110
- this.background = true;
3111
- this.zIndex = 9999;
3112
- this.firstOpen = true;
3113
- }
3114
- ngOnInit() {
3115
- this.domService.setDocumentEventListener();
3116
- }
3117
- validatePopin() {
3118
- this.response.emit(true);
3119
- this.closePopin();
3120
- }
3121
- refusePopin() {
3122
- this.response.emit(false);
3123
- this.closePopin();
3124
- }
3125
- closePopin() {
3126
- if (!this.firstOpen || this.disableCloseOutside) {
3127
- this.visible = false;
3128
- this.visibleChange.emit(this.visible);
3129
- this.firstOpen = true;
3130
- }
3131
- else {
3132
- this.firstOpen = false;
3133
- }
3134
- }
3135
- }
3136
- FreePopinComponent.decorators = [
3137
- { type: Component, args: [{
3138
- selector: 'wac-free-popin',
3139
- template: "<div class=\"wac-free-popin\" *ngIf=\"visible\" [ngStyle]=\"{'z-index': zIndex}\">\n <div class=\"wac-free-popin__wrapper\" wzAutoHide (clickOutside)=\"!disableCloseOutside ? closePopin() : ''\">\n <a class=\"wac-free-popin__wrapper__button-close\" (click)=\"closePopin()\">\n <i class=\"fas fa-times\"></i>\n </a>\n <div class=\"wac-free-popin__wrapper__content\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content></ng-content>\n </perfect-scrollbar>\n </div>\n <div class=\"wac-free-popin__wrapper__buttons\">\n <div class=\"wac-free-popin__wrapper__buttons__button\" *ngIf=\"okButtonLabel\">\n <wac-button [extraClasses]=\"'is-success'\" [label]=\"okButtonLabel\" hasLoader=\"true\" (click)=\"validatePopin()\"></wac-button>\n </div>\n <div class=\"wac-free-popin__wrapper__buttons__button\" *ngIf=\"koButtonLabel\">\n <wac-button [extraClasses]=\"'is-danger is-outlined'\" [label]=\"koButtonLabel\" hasLoader=\"true\" (click)=\"refusePopin()\"></wac-button>\n </div>\n </div>\n </div>\n <div class=\"wac-free-popin__background\" *ngIf=\"background\"></div>\n</div>\n"
3140
- },] }
3141
- ];
3142
- FreePopinComponent.ctorParameters = () => [
3143
- { type: DomService }
3144
- ];
3145
- FreePopinComponent.propDecorators = {
3146
- okButtonLabel: [{ type: Input }],
3147
- koButtonLabel: [{ type: Input }],
3148
- visible: [{ type: Input }],
3149
- disableCloseOutside: [{ type: Input }],
3150
- visibleChange: [{ type: Output }],
3151
- response: [{ type: Output }],
3152
- background: [{ type: Input }],
3153
- zIndex: [{ type: Input }]
3154
- };
3155
-
3156
- class BlockComponent {
3157
- constructor() {
3158
- this.titleBlock = ''; // Titre interne au block
3159
- this.titleExternalBlock = false; // Titre externe au block
3160
- this.sticky = false; // add sticky to block
3161
- this.simple = false;
3162
- this.noFullHeight = false; // not full height
3163
- this.icon = '';
3164
- this.titleUppercase = true;
3165
- this.borderRadius = false;
3166
- this.removePadding = false;
3167
- this.stretchHeight = false;
3168
- }
3169
- }
3170
- BlockComponent.decorators = [
3171
- { type: Component, args: [{
3172
- selector: 'wac-block',
3173
- template: "<div\n class=\"wac-block\"\n [ngClass]=\"{ 'wac-block__external': titleExternalBlock, sticky: sticky, noFullHeight: noFullHeight, 'stretch': stretchHeight, 'border-radius': borderRadius, 'no-padding' : removePadding }\"\n>\n <h2 *ngIf=\"titleBlock.length\" class=\"wac-block__title\" [ngClass]=\"{ 'is-simple': simple, 'no-uppercase': !titleUppercase }\">\n {{ titleBlock }} <i *ngIf=\"icon\" [ngClass]=\"icon\"></i>\n </h2>\n <div class=\"wac-block__content\">\n <ng-content></ng-content>\n </div>\n</div>\n"
3174
- },] }
3175
- ];
3176
- BlockComponent.ctorParameters = () => [];
3177
- BlockComponent.propDecorators = {
3178
- titleBlock: [{ type: Input }],
3179
- titleExternalBlock: [{ type: Input }],
3180
- sticky: [{ type: Input }],
3181
- simple: [{ type: Input }],
3182
- noFullHeight: [{ type: Input }],
3183
- icon: [{ type: Input }],
3184
- titleUppercase: [{ type: Input }],
3185
- borderRadius: [{ type: Input }],
3186
- removePadding: [{ type: Input }],
3187
- stretchHeight: [{ type: Input }]
3188
- };
3189
-
3190
- class WrapperComponent {
3191
- constructor() {
3192
- this.size = 'fullsize';
3193
- }
3194
- ngOnInit() { }
3195
- }
3196
- WrapperComponent.decorators = [
3197
- { type: Component, args: [{
3198
- selector: 'wac-wrapper',
3199
- template: "<div class=\"wac-wrapper\" [ngClass]=\"{ fullsize: size === 'fullsize', 'max-width': size === 'max-width' }\">\n <ng-content></ng-content>\n</div>\n"
3200
- },] }
3201
- ];
3202
- WrapperComponent.ctorParameters = () => [];
3203
- WrapperComponent.propDecorators = {
3204
- size: [{ type: Input }]
3205
- };
3206
-
3207
- class FiltersComponent {
3208
- constructor() {
3209
- this.labelRestart = 'Afficher toutes les catégories';
3210
- this.filterChange = new EventEmitter();
3211
- }
3212
- ngOnInit() {
3213
- this.options.forEach((item, index) => {
3214
- if (item.active) {
3215
- this.filterActiveIndex = '' + index;
3216
- }
3217
- });
3218
- }
3219
- activeFilter(index) {
3220
- this.options[index].active = true;
3221
- this.filterActiveIndex = '' + index;
3222
- this.filterChange.emit(index);
3223
- }
3224
- resetFilter() {
3225
- this.options.forEach((item) => {
3226
- item.active = false;
3227
- });
3228
- this.filterActiveIndex = null;
3229
- this.filterChange.emit(-1);
3230
- }
3231
- }
3232
- FiltersComponent.decorators = [
3233
- { type: Component, args: [{
3234
- selector: 'wac-filters',
3235
- template: "<div class=\"wac-filters\">\n <div class=\"wac-filters__wrapper\" *ngIf=\"!filterActiveIndex\">\n <button *ngFor=\"let option of options; let i = index\">\n <span class=\"event\" (click)=\"activeFilter(i)\"></span><span [innerHTML]=\"option.name\"></span>\n </button>\n </div>\n <div class=\"wac-filters__wrapper\" *ngIf=\"filterActiveIndex\">\n <button (click)=\"resetFilter()\" class=\"active\">\n <i class=\"fas fa-times\"></i><span [innerHTML]=\"options[filterActiveIndex].name\"></span>\n </button>\n <span (click)=\"resetFilter()\">{{ labelRestart }}</span>\n </div>\n</div>\n"
3236
- },] }
3237
- ];
3238
- FiltersComponent.ctorParameters = () => [];
3239
- FiltersComponent.propDecorators = {
3240
- options: [{ type: Input }],
3241
- labelRestart: [{ type: Input }],
3242
- filterChange: [{ type: Output }]
3243
- };
3244
-
3245
- class WrapperBlocsComponent {
3246
- constructor() {
3247
- this.sidebar = false;
3248
- }
3249
- ngOnInit() {
3250
- }
3251
- }
3252
- WrapperBlocsComponent.decorators = [
3253
- { type: Component, args: [{
3254
- selector: 'wac-wrapper-blocs',
3255
- template: "<div class=\"wac-wrapper-blocs\" [ngClass]=\"{'sidebar': sidebar}\">\n <ng-content></ng-content>\n</div>\n"
3256
- },] }
3257
- ];
3258
- WrapperBlocsComponent.ctorParameters = () => [];
3259
- WrapperBlocsComponent.propDecorators = {
3260
- sidebar: [{ type: Input }]
3261
- };
3262
-
3263
- class SnackbarComponent {
3264
- constructor() {
3265
- this.visible = false;
3266
- this.visibleChange = new EventEmitter();
3267
- this.response = new EventEmitter();
3268
- this.manualClose = false;
3269
- }
3270
- ngOnInit() {
3271
- if (this.duration > 0) {
3272
- this.timer = setTimeout(() => this.manualClose = true, this.duration);
3273
- }
3274
- }
3275
- validate() {
3276
- this.response.emit(true);
3277
- this.closeSnackbar();
3278
- this.manualClose = true;
3279
- }
3280
- refuse() {
3281
- this.response.emit(false);
3282
- this.closeSnackbar();
3283
- this.manualClose = true;
3284
- }
3285
- closeSnackbar() {
3286
- this.visible = false;
3287
- this.visibleChange.emit(this.visible);
3288
- }
3289
- }
3290
- SnackbarComponent.decorators = [
3291
- { type: Component, args: [{
3292
- selector: 'wac-snackbar',
3293
- template: "<div class=\"wac-snackbar\">\n <div [class]=\"'notification is-active ' + ((color) ? color : 'is-transparent')\"\n [@state]=\"visible ? 'active': 'inactive'\"\n >\n <div class=\"columns\">\n <div class=\"column notification--message\" [ngClass]=\"{'is-half': textButtonOk}\"\n [innerHTML]=\"message\">\n </div>\n <div class=\"column is-half\">\n <button [class]=\"'button ' + ((buttonColor) ? buttonColor : 'is-success')\"\n (click)=\"validate()\">{{textButtonOk}}\n </button>\n <button [class]=\"'button ' + ((buttonColor) ? buttonColor : 'is-success')\"\n (click)=\"refuse()\">{{textButtonKo}}\n </button>\n </div>\n </div>\n </div>\n</div>\n",
3294
- encapsulation: ViewEncapsulation.None,
3295
- animations: [
3296
- trigger('state', [
3297
- state('void', style({
3298
- bottom: '-100px'
3299
- })),
3300
- state('inactive', style({
3301
- bottom: '-100px'
3302
- })),
3303
- state('active', style({
3304
- bottom: '0px'
3305
- })),
3306
- transition('void => active', animate(300)),
3307
- transition('active => inactive', animate(300))
3308
- ])
3309
- ]
3310
- },] }
3311
- ];
3312
- SnackbarComponent.propDecorators = {
3313
- message: [{ type: Input }],
3314
- textButtonOk: [{ type: Input }],
3315
- textButtonKo: [{ type: Input }],
3316
- duration: [{ type: Input }],
3317
- color: [{ type: Input }],
3318
- buttonColor: [{ type: Input }],
3319
- visible: [{ type: Input }],
3320
- visibleChange: [{ type: Output }],
3321
- response: [{ type: Output }]
3322
- };
3323
-
3324
- class AlertPopupComponent {
3325
- constructor() {
3326
- /** Subject for notifying the user that the dialog has finished closing. */
3327
- this.afterClosedPopup = new Subject();
3328
- this.open = false;
3329
- }
3330
- ngOnInit() {
3331
- setTimeout(() => {
3332
- this.open = true;
3333
- }, 50);
3334
- if (this.config.duration > 0) {
3335
- this.timer = setTimeout(() => this.dismiss(), this.config.duration);
3336
- }
3337
- }
3338
- dismiss() {
3339
- this.open = false;
3340
- setTimeout(() => {
3341
- this.afterClosedPopup.next(true);
3342
- this.afterClosedPopup.complete();
3343
- }, 200);
3344
- }
3345
- /**
3346
- * Gets an observable that is notified when the dialog is finished closing.
3347
- */
3348
- afterClosed() {
3349
- return this.afterClosedPopup.asObservable();
3350
- }
3351
- }
3352
- AlertPopupComponent.decorators = [
3353
- { type: Component, args: [{
3354
- selector: 'wac-alert-popup',
3355
- template: "<div\n [class]=\"'alert ' + ((config.color) ? config.color : ' is-primary') + ((config.extraClasses) ? ' ' + config.extraClasses : '') + ((config.position) ? ' ' + config.position : '') + ((config.fullsize) ? ' fullsize' : '') + ((config.opacity) ? ' opacity-active' : '') + ((config.small) ? ' small' : '') + ((config.icon) ? ' with-icon' : '')\"\n [ngClass]=\"{'is-active': open}\"\n>\n <div class=\"alert--message\">\n <span class=\"icon\" *ngIf=\"config.icon\">\n <i [class]=\"config.icon\"></i>\n </span>\n <span (click)=\"dismiss()\" class=\"wac-alert-popup__close\"><i class=\"fas fa-times\"></i></span>\n <p *ngIf=\"config.title\" class=\"wac-alert-popup__title\" [innerHTML]=\"config.title\"></p>\n <p *ngIf=\"config.message\" class=\"wac-alert-popup__text\" [innerHTML]=\"config.message\"></p>\n </div>\n</div>\n",
3356
- host: {
3357
- class: 'wac-alert-popup'
3358
- },
3359
- encapsulation: ViewEncapsulation.None
3360
- },] }
3361
- ];
3362
-
3363
- class AlertPopupService {
3364
- constructor(domService) {
3365
- this.domService = domService;
3366
- }
3367
- open(config) {
3368
- const componentRef = this.getComponentRef(config);
3369
- return componentRef.instance;
3370
- }
3371
- getComponentRef(config) {
3372
- const componentRef = this.domService.attachComponentPortal(AlertPopupComponent);
3373
- config = Object.assign({
3374
- position: 'is-top'
3375
- }, config);
3376
- componentRef.instance.config = config;
3377
- componentRef.instance.afterClosed().subscribe(() => {
3378
- componentRef.destroy();
3379
- });
3380
- return componentRef;
3381
- }
3382
- }
3383
- AlertPopupService.decorators = [
3384
- { type: Injectable }
3385
- ];
3386
- AlertPopupService.ctorParameters = () => [
3387
- { type: DomService }
3388
- ];
3389
-
3390
- class AlertPopupModule {
3391
- }
3392
- AlertPopupModule.decorators = [
3393
- { type: NgModule, args: [{
3394
- imports: [CommonModule],
3395
- providers: [AlertPopupService],
3396
- entryComponents: [AlertPopupComponent],
3397
- declarations: [AlertPopupComponent],
3398
- exports: [AlertPopupComponent]
3399
- },] }
3400
- ];
3401
-
3402
- class SearchComponent {
3403
- constructor() {
3404
- this.alwaysOpen = false;
3405
- this.disableSearchIn = false;
3406
- this.emptyResult = '';
3407
- this.search = '';
3408
- this.openSelect = false;
3409
- this.selectValue = new EventEmitter();
3410
- this.searchKeyUp = new EventEmitter();
3411
- this.searchFocusOut = new EventEmitter();
3412
- }
3413
- ngOnInit() {
3414
- this.triggerOptions = this.options;
3415
- }
3416
- onClose() {
3417
- this.openSelect = false;
3418
- }
3419
- setSearchValueToQuery(value) {
3420
- this.search = value.target.value;
3421
- if (this.disableSearchIn) {
3422
- this.triggerOptions = this.options;
3423
- }
3424
- else {
3425
- if (this.search.length > 0) {
3426
- this.openSelect = true;
3427
- this.triggerOptions = this.options.filter(element => element.label.toLowerCase().indexOf(this.search.toLowerCase()) !== -1);
3428
- }
3429
- else {
3430
- this.triggerOptions = this.options;
3431
- }
3432
- }
3433
- this.searchKeyUp.emit(this.search);
3434
- }
3435
- sendEventFocusOut() {
3436
- this.searchFocusOut.emit(this.search);
3437
- }
3438
- closeSelect() {
3439
- this.openSelect = false;
3440
- }
3441
- onSelectItem(index, value, label) {
3442
- this.search = '';
3443
- this.openSelect = false;
3444
- if (this.disableSearchIn) {
3445
- this.selectValue.emit(index);
3446
- }
3447
- else {
3448
- const findInOption = this.options.findIndex(element => element.label === label && element.id === value);
3449
- this.selectValue.emit(findInOption);
3450
- }
3451
- }
3452
- resetAllVue() {
3453
- this.search = '';
3454
- this.closeSelect();
3455
- }
3456
- }
3457
- SearchComponent.decorators = [
3458
- { type: Component, args: [{
3459
- selector: 'wac-search',
3460
- template: "<div class=\"wac-search\" [ngClass]=\"{ open: openSelect || alwaysOpen }\" [zIndexToggle]=\"openSelect\" wzAutoHide (clickOutside)=\"closeSelect()\">\n <div class=\"wac-search__wrapper\">\n <button><i class=\"fal fa-search\"></i></button>\n <input [value]=\"search\" type=\"text\" required [placeholder]=\"placeholder\" (focus)=\"openSelect = true;\" (focusout)=\"sendEventFocusOut()\" (keyup)=\"setSearchValueToQuery($event)\" />\n </div>\n <div class=\"wac-search__absolute\" *ngIf=\"triggerOptions\" [ngClass]=\"{'hidden': !openSelect}\">\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\" *ngIf=\"triggerOptions.length > 0\">\n <div (click)=\"onClose()\" class=\"wac-select__content__item\" *ngFor=\"let item of triggerOptions; let index = index;\">\n <div [ngClass]=\"{ selected: item.checked }\" (click)=\"onSelectItem(index, item.id, item.label)\">\n {{ item.label }}\n </div>\n </div>\n </perfect-scrollbar>\n <div class=\"wac-select__content__empty\" *ngIf=\"triggerOptions.length === 0\">\n <span *ngIf=\"emptyResult\">{{emptyResult}}</span>\n </div>\n </div>\n</div>\n"
3461
- },] }
3462
- ];
3463
- SearchComponent.ctorParameters = () => [];
3464
- SearchComponent.propDecorators = {
3465
- placeholder: [{ type: Input }],
3466
- alwaysOpen: [{ type: Input }],
3467
- label: [{ type: Input }],
3468
- options: [{ type: Input }],
3469
- disableSearchIn: [{ type: Input }],
3470
- emptyResult: [{ type: Input }],
3471
- selectValue: [{ type: Output }],
3472
- searchKeyUp: [{ type: Output }],
3473
- searchFocusOut: [{ type: Output }]
3474
- };
3475
-
3476
- class SelectedListComponent {
3477
- constructor() {
3478
- this.options = [];
3479
- this.enableSelectAll = true;
3480
- this.selectedItemsIndex = new EventEmitter();
3481
- this.selectedItemsAll = new EventEmitter();
3482
- this.unSelectedItemsAll = new EventEmitter();
3483
- this.selectedOptionIndex = [];
3484
- }
3485
- ngOnInit() {
3486
- }
3487
- onSelectAll() {
3488
- this.selectedOptionIndex = this.options.map((option, index) => {
3489
- option.checked = true;
3490
- return index;
3491
- });
3492
- this.selectedItemsAll.emit(this.selectedOptionIndex);
3493
- }
3494
- onUnSelectAll() {
3495
- this.selectedOptionIndex = this.options.map((option, index) => {
3496
- option.checked = false;
3497
- return index;
3498
- });
3499
- this.unSelectedItemsAll.emit(this.selectedOptionIndex);
3500
- }
3501
- onSelectItem(index) {
3502
- this.options[index].checked = !this.options[index].checked;
3503
- this.selectedItemsIndex.emit(index);
3504
- }
3505
- areAllOptionsChecked() {
3506
- return !this.options.some(option => !option.checked);
3507
- }
3508
- }
3509
- SelectedListComponent.decorators = [
3510
- { type: Component, args: [{
3511
- selector: 'wac-selected-list',
3512
- template: "<div class=\"selected-list\">\n <div class=\"selected-list__wrapper\">\n <div class=\"selected-list__wrapper__head\">\n <p *ngIf=\"label\" [innerHTML]=\"label\"></p>\n <ng-container *ngVar=\"(options | areAllOptionsSelected) as areAllOptionsSelected\">\n <ng-container *ngIf=\"textSelectAll && !areAllOptionsSelected\">\n\n <div class=\"selected-list__wrapper__head__button\">\n\n <div class=\"selected-list__wrapper__head__button__notMobile\">\n <wac-button\n [label]=\"textSelectAll\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n <div class=\"selected-list__wrapper__head__button__mobile\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fad fa-check-double'\"\n (click)=\"onSelectAll()\"\n >\n </wac-button>\n </div>\n\n </div>\n\n </ng-container>\n\n <ng-container *ngIf=\"textUnSelectAll && areAllOptionsSelected\">\n\n <div class=\"selected-list__wrapper__head__button\">\n\n <div class=\"selected-list__wrapper__head__button__notMobile\">\n <wac-button\n [extraClasses]=\"'is-info'\"\n [label]=\"textUnSelectAll\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n\n <div class=\"selected-list__wrapper__head__button__mobile\">\n <wac-button\n [extraClasses]=\"'is-grey'\"\n [icon]=\"'fad fa-check-double'\"\n (click)=\"onUnSelectAll()\"\n >\n </wac-button>\n </div>\n\n </div>\n\n </ng-container>\n\n </ng-container>\n\n </div>\n <div class=\"selected-list__wrapper__content\">\n <div class=\"selected-list__wrapper__content__item\" *ngFor=\"let item of options;let i = index;\" [ngClass]=\"{'active': item.checked}\" (click)=\"onSelectItem(i)\">\n <span [innerHTML]=\"item.label\"></span>\n <i class=\"fas fa-check\"></i>\n </div>\n </div>\n </div>\n</div>\n"
3513
- },] }
3514
- ];
3515
- SelectedListComponent.propDecorators = {
3516
- options: [{ type: Input }],
3517
- label: [{ type: Input }],
3518
- textSelectAll: [{ type: Input }],
3519
- textUnSelectAll: [{ type: Input }],
3520
- enableSelectAll: [{ type: Input }],
3521
- selectedItemsIndex: [{ type: Output }],
3522
- selectedItemsAll: [{ type: Output }],
3523
- unSelectedItemsAll: [{ type: Output }]
3524
- };
3525
-
3526
- class TreeComponent {
3527
- constructor() {
3528
- this.treeDepth = 0;
3529
- }
3530
- ngOnInit() { }
3531
- }
3532
- TreeComponent.decorators = [
3533
- { type: Component, args: [{
3534
- selector: 'wac-tree',
3535
- template: "<div *ngFor=\"let item of items; index as i\" [ngClass]=\"['treeDepth-' + treeDepth]\">\n <ul>\n <li>\n\n <ng-template #defaultItem>\n {{ item?.treeLabel }}\n </ng-template>\n\n <ng-container\n [ngTemplateOutlet]=\"optionTemplate || defaultItem\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: i }\"\n >\n </ng-container>\n\n <wac-tree [optionTemplate]=\"optionTemplate\" [items]=\"item.treeChildren\" *ngIf=\"item.treeChildren?.length\" [treeDepth]=\"treeDepth + 1\">\n <!-- Todo maybe pass child template -->\n\n </wac-tree>\n </li>\n </ul>\n</div>"
3536
- },] }
3537
- ];
3538
- TreeComponent.ctorParameters = () => [];
3539
- TreeComponent.propDecorators = {
3540
- items: [{ type: Input }],
3541
- treeDepth: [{ type: Input }],
3542
- optionTemplate: [{ type: Input, args: ["optionTemplate",] }]
3543
- };
3544
-
3545
- class FormatObjectToRecursifTreePipe {
3546
- constructor() {
3547
- this.childrenProperties = [];
3548
- }
3549
- transform(objectList, childrenProperties) {
3550
- this.childrenProperties = childrenProperties;
3551
- const treeDepth = 0;
3552
- objectList.forEach(object => this.recursiveFormatObjectToRecursifTree(object, treeDepth));
3553
- return objectList;
3554
- }
3555
- recursiveFormatObjectToRecursifTree(object, treeDepth) {
3556
- for (const childrenProperty of this.childrenProperties) {
3557
- object.hasTreeChildren = true;
3558
- if (!object.hasOwnProperty(childrenProperty)) {
3559
- // No more chrildren
3560
- object.hasTreeChildren = false;
3561
- continue;
3562
- }
3563
- if (!Array.isArray(object[childrenProperty])) {
3564
- throw `Property : "${childrenProperty}", is not an array. it could not be transform to a recursive list.`;
3565
- }
3566
- // Add treeChildren property filled with name children property
3567
- object.treeChildren = object[childrenProperty];
3568
- // call this function recursively until no children can be generated
3569
- this.recursiveFormatObjectToRecursifTree(object.treeChildren, treeDepth++);
3570
- break;
3571
- }
3572
- object.treeDepth = treeDepth;
3573
- }
3574
- }
3575
- FormatObjectToRecursifTreePipe.decorators = [
3576
- { type: Pipe, args: [{
3577
- name: 'formatObjectToRecursifTree'
3578
- },] }
3579
- ];
3580
-
3581
- class FormatObjectToSimpleTreePipe {
3582
- constructor() {
3583
- this.childrenProperties = [];
3584
- this.labelProperties = [];
3585
- }
3586
- transform(objectList, childrenProperties, labelProperties) {
3587
- this.childrenProperties = childrenProperties;
3588
- this.labelProperties = labelProperties;
3589
- const treeDepth = 0;
3590
- objectList.forEach(object => this.recursiveFormatObjectToSimpleTree(object, treeDepth));
3591
- return objectList;
3592
- }
3593
- recursiveFormatObjectToSimpleTree(object, treeDepth) {
3594
- for (const property in object) {
3595
- if (!Object.prototype.hasOwnProperty.call(object, property)) {
3596
- continue;
3597
- }
3598
- if (this.labelProperties.includes(property)) {
3599
- object.treeLabel = object[property];
3600
- continue;
3601
- }
3602
- object.hasTreeChildren = true;
3603
- if (!this.childrenProperties.includes(property)) {
3604
- // No more chrildren
3605
- object.hasTreeChildren = false;
3606
- continue;
3607
- }
3608
- if (!Array.isArray(object[property])) {
3609
- throw `Property : "${property}", is not an array. it could not be transform to a recursive list.`;
3610
- }
3611
- // Add treeChildren property filled with name children property
3612
- object.treeChildren = object[property];
3613
- // call this function recursively until no children can be generated
3614
- this.recursiveFormatObjectToSimpleTree(object.treeChildren, treeDepth++);
3615
- break;
3616
- }
3617
- }
3618
- }
3619
- FormatObjectToSimpleTreePipe.decorators = [
3620
- { type: Pipe, args: [{
3621
- name: 'formatObjectToSimpleTree'
3622
- },] }
3623
- ];
3624
-
3625
- class SelectFiltersPipe {
3626
- transform(items, filterName) {
3627
- return items.filter(item => {
3628
- const regexp = new RegExp(filterName, 'i');
3629
- return regexp.test(item.name);
3630
- });
3631
- }
3632
- }
3633
- SelectFiltersPipe.decorators = [
3634
- { type: Pipe, args: [{
3635
- name: 'selectFilters'
3636
- },] }
3637
- ];
3638
-
3639
- class AreAllOptionsSelectedPipe {
3640
- transform(options) {
3641
- return !options.some(option => !option.checked);
3642
- }
3643
- }
3644
- AreAllOptionsSelectedPipe.decorators = [
3645
- { type: Pipe, args: [{
3646
- name: 'areAllOptionsSelected',
3647
- pure: false
3648
- },] }
3649
- ];
3650
-
3651
- const exportedPipes = [FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe];
3652
- const pipes$1 = [
3653
- SelectFiltersPipe,
3654
- AreAllOptionsSelectedPipe
3655
- ];
3656
- class SharedPipes {
3657
- }
3658
- SharedPipes.decorators = [
3659
- { type: NgModule, args: [{
3660
- imports: [CommonModule, FormsModule],
3661
- declarations: [...exportedPipes, ...pipes$1],
3662
- exports: [...exportedPipes, ...pipes$1]
3663
- },] }
3664
- ];
3665
-
3666
- class TreeModule {
3667
- }
3668
- TreeModule.decorators = [
3669
- { type: NgModule, args: [{
3670
- imports: [
3671
- CommonModule,
3672
- FormsModule,
3673
- SharedPipes
3674
- ],
3675
- exports: [TreeComponent],
3676
- declarations: [TreeComponent],
3677
- providers: [],
3678
- },] }
3679
- ];
3680
-
3681
- class WrapperSidebarComponent {
3682
- constructor() {
3683
- this.reverse = false;
3684
- }
3685
- ngOnInit() {
3686
- }
3687
- }
3688
- WrapperSidebarComponent.decorators = [
3689
- { type: Component, args: [{
3690
- selector: 'wac-wrapper-sidebar',
3691
- template: "<div class=\"wac-wrapper-sidebar\" [ngClass]=\"{'reverse': reverse}\">\n <div class=\"wac-wrapper-sidebar__left\">\n <ng-content select=\"[sidebar]\"></ng-content>\n </div>\n <div class=\"wac-wrapper-sidebar__right\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n</div>\n"
3692
- },] }
3693
- ];
3694
- WrapperSidebarComponent.ctorParameters = () => [];
3695
- WrapperSidebarComponent.propDecorators = {
3696
- reverse: [{ type: Input }]
3697
- };
3698
-
3699
- class BreadcrumbsComponent {
3700
- constructor() {
3701
- this.index = 0;
3702
- this.indexChange = new EventEmitter();
3703
- }
3704
- ngOnInit() {
3705
- }
3706
- valueChanged(i) {
3707
- this.index = i;
3708
- this.indexChange.emit(this.index);
3709
- }
3710
- }
3711
- BreadcrumbsComponent.decorators = [
3712
- { type: Component, args: [{
3713
- selector: 'wac-breadcrumbs',
3714
- template: "<div class=\"wac-breadcrumbs\">\n <div class=\"wac-breadcrumbs__wrapper\">\n <div class=\"wac-breadcrumbs__item\" *ngFor=\"let b of breadcrumbs; let i = index;\" [ngClass]=\"{'valid': b.valid, 'current': b['current']}\" (click)=\"valueChanged(i)\">\n <div class=\"round\" [ngClass]=\"{'valid': b.valid, 'current': b['current']}\"><span *ngIf=\"!b.valid\"><span *ngIf=\"i < 9\">0</span>{{ i + 1 }}</span><i class=\"fas fa-check\" *ngIf=\"b.valid\"></i></div>\n <div class=\"name\" [ngClass]=\"{'valid': b.valid, 'current': b['current']}\">{{ b.name }}</div>\n </div>\n </div>\n</div>\n"
3715
- },] }
3716
- ];
3717
- BreadcrumbsComponent.ctorParameters = () => [];
3718
- BreadcrumbsComponent.propDecorators = {
3719
- breadcrumbs: [{ type: Input }],
3720
- indexChange: [{ type: Output }]
3721
- };
3722
-
3723
- class CardPriceComponent {
3724
- constructor() {
3725
- this.disabled = false;
3726
- this.btnTextcolor = '#ffffff';
3727
- this.extraClasses = 'is-success';
3728
- this.hideButton = false;
3729
- this.click = new EventEmitter();
3730
- }
3731
- ngOnInit() {
3732
- }
3733
- triggerClick() {
3734
- this.click.emit(true);
3735
- }
3736
- }
3737
- CardPriceComponent.decorators = [
3738
- { type: Component, args: [{
3739
- selector: 'wac-card-price',
3740
- template: "<div class=\"wac-card-price\">\n <strong>{{amount}}</strong>\n <p>{{title}}</p>\n <div class=\"price\">\n <span class=\"amount\">{{price}} <span>{{currency}}</span></span><span class=\"month\">{{priceWording}}</span>\n </div>\n <div class=\"subtitle\">{{subtitle}}</div>\n <div class=\"cta\">\n <wac-button [label]=\"btnLabel\" [extraClasses]=\"extraClasses\" (click)=\"triggerClick()\" [disabled]=\"disabled\" [textcolor]=\"btnTextcolor\" *ngIf=\"!hideButton\"></wac-button>\n </div>\n</div>\n"
3741
- },] }
3742
- ];
3743
- CardPriceComponent.ctorParameters = () => [];
3744
- CardPriceComponent.propDecorators = {
3745
- amount: [{ type: Input }],
3746
- title: [{ type: Input }],
3747
- price: [{ type: Input }],
3748
- currency: [{ type: Input }],
3749
- priceWording: [{ type: Input }],
3750
- subtitle: [{ type: Input }],
3751
- btnLabel: [{ type: Input }],
3752
- disabled: [{ type: Input }],
3753
- btnTextcolor: [{ type: Input }],
3754
- extraClasses: [{ type: Input }],
3755
- hideButton: [{ type: Input }],
3756
- click: [{ type: Output }]
3757
- };
3758
-
3759
- class TokenCheckComponent {
3760
- constructor() {
3761
- this.warning = false;
3762
- }
3763
- ngOnInit() {
3764
- }
3765
- }
3766
- TokenCheckComponent.decorators = [
3767
- { type: Component, args: [{
3768
- selector: 'wac-token-check',
3769
- template: "<div class=\"wac-token-check\">\n <span [innerHTML]=\"label\"></span> : <span [innerHTML]=\"value\" [ngClass]=\"{'warning': value > max}\"></span> / <strong [innerHTML]=\"max\"></strong>\n</div>\n"
3770
- },] }
3771
- ];
3772
- TokenCheckComponent.ctorParameters = () => [];
3773
- TokenCheckComponent.propDecorators = {
3774
- label: [{ type: Input }],
3775
- value: [{ type: Input }],
3776
- max: [{ type: Input }]
3777
- };
3778
-
3779
- class BlockWithCheckboxComponent {
3780
- constructor() {
3781
- this.selected = false;
3782
- this.iconCopy = 'fa-solid fa-copy';
3783
- this.iconWorld = 'fa-thin fa-globe';
3784
- this.copyAction = new EventEmitter();
3785
- this.worldAction = new EventEmitter();
3786
- this.checkboxAction = new EventEmitter();
3787
- }
3788
- ngOnInit() {
3789
- }
3790
- eventSelected(event) {
3791
- this.selected = !this.selected;
3792
- console.log(this.selected);
3793
- this.checkboxAction.emit(this.selected);
3794
- }
3795
- eventCopy() {
3796
- this.copyAction.emit(true);
3797
- }
3798
- eventWorld() {
3799
- this.worldAction.emit(true);
3800
- }
3801
- }
3802
- BlockWithCheckboxComponent.decorators = [
3803
- { type: Component, args: [{
3804
- selector: 'wac-block-with-checkbox',
3805
- template: "<div class=\"block-with-checkbox\">\n <div class=\"block-with-checkbox__left\">\n <div class=\"wac-radio-block\">\n <div class=\"wac-radio__row\">\n <input type=\"checkbox\" [value]=\"selected\" (click)=\"eventSelected($event)\" id=\"radioBlock\">\n <label for=\"radioBlock\"></label>\n </div>\n </div>\n </div>\n <div class=\"block-with-checkbox__center\">\n <ng-content></ng-content>\n </div>\n <div class=\"block-with-checkbox__right\">\n <div><wac-button extraClasses=\"is-blue opacity static-width\" [iconFontSize]=\"18\" [icon]=\"iconCopy\" (click)=\"eventCopy()\"></wac-button></div>\n <div><wac-button extraClasses=\"is-green opacity static-width\" [iconFontSize]=\"18\" [icon]=\"iconWorld\" (click)=\"eventWorld()\"></wac-button></div>\n </div>\n</div>\n"
3806
- },] }
3807
- ];
3808
- BlockWithCheckboxComponent.ctorParameters = () => [];
3809
- BlockWithCheckboxComponent.propDecorators = {
3810
- selected: [{ type: Input }],
3811
- iconCopy: [{ type: Input }],
3812
- iconWorld: [{ type: Input }],
3813
- copyAction: [{ type: Output }],
3814
- worldAction: [{ type: Output }],
3815
- checkboxAction: [{ type: Output }]
3816
- };
3817
-
3818
- class ConfirmDeleteComponent {
3819
- constructor() {
3820
- this.open = false;
3821
- this.confirm = new EventEmitter();
3822
- this.backgroundColor = '#fff';
3823
- this.borderRadius = '0px';
3824
- }
3825
- ngOnInit() {
3826
- }
3827
- eventCancel(event) {
3828
- this.confirm.emit(false);
3829
- this.open = false;
3830
- }
3831
- eventConfirm(event) {
3832
- this.confirm.emit(true);
3833
- this.open = false;
3834
- }
3835
- }
3836
- ConfirmDeleteComponent.decorators = [
3837
- { type: Component, args: [{
3838
- selector: 'wac-confirm-delete',
3839
- template: "<div class=\"wac-confirm-delete\" [ngClass]=\"{'is-open': open}\" [style.backgroundColor]=\"backgroundColor\" [style.borderRadius]=\"borderRadius\">\n <div>\n <span [innerHTML]=\"label\"></span>\n </div>\n <div>\n <div><wac-button [label]=\"labelCancel\" [extraClasses]=\"'is-outlined is-grey'\" (click)=\"eventCancel($event)\"></wac-button></div>\n <div><wac-button [label]=\"labelConfirm\" [extraClasses]=\"'is-danger'\" (click)=\"eventConfirm($event)\"></wac-button></div>\n </div>\n</div>\n"
3840
- },] }
3841
- ];
3842
- ConfirmDeleteComponent.ctorParameters = () => [];
3843
- ConfirmDeleteComponent.propDecorators = {
3844
- open: [{ type: Input }],
3845
- label: [{ type: Input }],
3846
- labelCancel: [{ type: Input }],
3847
- labelConfirm: [{ type: Input }],
3848
- confirm: [{ type: Output }],
3849
- backgroundColor: [{ type: Input }],
3850
- borderRadius: [{ type: Input }]
3851
- };
3852
-
3853
- class MosaicComponent {
3854
- constructor() {
3855
- this.isLoading = true;
3856
- }
3857
- ngOnInit() {
3858
- if (this.items) {
3859
- const splitItems = this.sliceIntoChunks(this.items, (this.items.length / 3));
3860
- this.columnLeft = splitItems[0];
3861
- this.columnCenter = splitItems[1];
3862
- this.columnRight = splitItems[2];
3863
- }
3864
- this.isLoading = false;
3865
- }
3866
- sliceIntoChunks(arr, chunkSize) {
3867
- const res = [];
3868
- for (let i = 0; i < arr.length; i += chunkSize) {
3869
- const chunk = arr.slice(i, i + chunkSize);
3870
- res.push(chunk);
3871
- }
3872
- return res;
3873
- }
3874
- }
3875
- MosaicComponent.decorators = [
3876
- { type: Component, args: [{
3877
- selector: 'wac-mosaic',
3878
- template: "<div class=\"wac-mosaic__loader\" *ngIf=\"isLoading\">\n <wac-loader></wac-loader>\n</div>\n<div class=\"wac-mosaic\" *ngIf=\"!isLoading\">\n <div class=\"wac-mosaic__wrapper\">\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnLeft\">\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnLeft; let i = index;\">\n <img [src]=\"img\" />\n </div>\n </div>\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnCenter\" >\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnCenter; let i = index;\">\n <img [src]=\"img\" />\n </div>\n </div>\n <div class=\"wac-mosaic__wrapper__column\" *ngIf=\"columnRight\">\n <div class=\"wac-mosaic__wrapper__column__item\" *ngFor=\"let img of columnRight; let i = index;\">\n <img [src]=\"img\" />\n </div>\n </div>\n </div>\n</div>\n"
3879
- },] }
3880
- ];
3881
- MosaicComponent.ctorParameters = () => [];
3882
- MosaicComponent.propDecorators = {
3883
- items: [{ type: Input }]
3884
- };
3885
-
3886
- const components = [
3887
- TagComponent,
3888
- TabComponent,
3889
- ButtonComponent,
3890
- InfoComponent,
3891
- SettingsComponent,
3892
- DeleteComponent,
3893
- DropdownComponent,
3894
- ImageComponent,
3895
- BackComponent,
3896
- SeparatorComponent,
3897
- LogoComponent,
3898
- RadioComponent,
3899
- StateComponent,
3900
- LabelComponent,
3901
- CalendarComponent,
3902
- WzEditInPlaceComponent,
3903
- AlertComponent,
3904
- HeaderPageComponent,
3905
- SwitchComponent,
3906
- LinkComponent,
3907
- H1Component,
3908
- H2Component,
3909
- H3Component,
3910
- H4Component,
3911
- TextComponent,
3912
- TextAreaComponent,
3913
- UploadComponent,
3914
- SelectInTextComponent,
3915
- SelectComponent,
3916
- MultipleSearchComponent,
3917
- MultipleSearchPlusComponent,
3918
- InputWithSelectComponent,
3919
- PopinComponent,
3920
- FreePopinComponent,
3921
- BlockComponent,
3922
- WrapperComponent,
3923
- FiltersComponent,
3924
- WrapperBlocsComponent,
3925
- SnackbarComponent,
3926
- SearchComponent,
3927
- SelectedListComponent,
3928
- WrapperSidebarComponent,
3929
- BreadcrumbsComponent,
3930
- CardPriceComponent,
3931
- TokenCheckComponent,
3932
- BlockWithCheckboxComponent,
3933
- ConfirmDeleteComponent,
3934
- MosaicComponent
3935
- ];
3936
- const exportsFromModule = [
3937
- PaginationComponent,
3938
- TableComponent,
3939
- TableColumn,
3940
- CheckBoxRow,
3941
- TableColumnHeader,
3942
- TableRow,
3943
- InputSearchComponent,
3944
- InputComponent,
3945
- TooltipComponent,
3946
- CheckboxComponent,
3947
- LoaderComponent,
3948
- ProgressBarComponent,
3949
- TreeComponent
3950
- ];
3951
- class SharedComponentsModule {
3952
- }
3953
- SharedComponentsModule.decorators = [
3954
- { type: NgModule, args: [{
3955
- imports: [
3956
- CommonModule,
3957
- FormsModule,
3958
- NwbAllModule,
3959
- TranslateModule.forChild(),
3960
- ReactiveFormsModule,
3961
- SharedDirectives,
3962
- SharedPipes,
3963
- CdkTableModule,
3964
- TagInputModule,
3965
- PaginationModule,
3966
- TableModule,
3967
- InputSearchModule,
3968
- TooltipModule,
3969
- CheckboxModule,
3970
- InputModule,
3971
- LoaderModule,
3972
- ProgressBarModule,
3973
- PerfectScrollbarModule,
3974
- AlertPopupModule,
3975
- RouterModule,
3976
- AutosizeModule,
3977
- TreeModule
3978
- ],
3979
- declarations: components,
3980
- exports: [...components, ...exportsFromModule]
3981
- },] }
3982
- ];
3983
-
3984
- class WiziComponentsModule {
3985
- }
3986
- WiziComponentsModule.decorators = [
3987
- { type: NgModule, args: [{
3988
- imports: [
3989
- CommonModule,
3990
- SharedComponentsModule,
3991
- SharedDirectives,
3992
- SharedPipes,
3993
- NwbAllModule
3994
- ],
3995
- exports: [SharedComponentsModule, SharedDirectives, SharedPipes]
3996
- },] }
3997
- ];
3998
-
3999
- class TableFiltersGroup extends NwbFilterGroup {
4000
- set(key, value) {
4001
- super.set(key, value);
4002
- }
4003
- resetToFirstPage() {
4004
- this.set("currentPage", 1);
4005
- }
4006
- }
4007
-
4008
- /*
4009
- * Public API Surface of angular-components
4010
- */
4011
-
4012
- /**
4013
- * Generated bundle index. Do not edit.
4014
- */
4015
-
4016
- export { AbstractDebounceDirective, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AreAllOptionsSelectedPipe, AutoHideDirective, BackComponent, BlockComponent, BlockWithCheckboxComponent, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CardPriceComponent, CheckBoxRow, CheckboxComponent, ConfirmDeleteComponent, DebounceKeyupDirective, DeleteComponent, DropdownComponent, FiltersComponent, FiltersTableService, FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FreePopinComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, KeypressEnterDirective, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MosaicComponent, MultipleSearchComponent, MultipleSearchPlusComponent, PaginationComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectFiltersPipe, SelectInTextComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableFiltersGroup, TableRow, TagComponent, TextAreaComponent, TextComponent, TokenCheckComponent, TooltipComponent, TreeComponent, TreeModule, UploadComponent, VarDirective, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WrapperSidebarComponent, WzEditInPlaceComponent, ZindexToggleDirective, DomService as ɵa, PaginationModule as ɵb, PagniationArrayTotalPages as ɵc, PagniationIsLastPage as ɵd, PagniationText as ɵe, TableModule as ɵf, InputSearchModule as ɵg, InputModule as ɵh, TooltipModule as ɵi, ProgressBarModule as ɵj, LoaderModule as ɵk, CheckboxModule as ɵl, inOutY as ɵm, TableCheckboxIdService as ɵn, MultiSelectionService as ɵo, inOutX as ɵp };
4017
- //# sourceMappingURL=wizishop-angular-components.js.map