monkey-front-components 0.0.384 → 0.0.387

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 (276) hide show
  1. package/esm2020/lib/components/base/base-component.mjs +322 -0
  2. package/esm2020/lib/components/base/base-dynamic-array.mjs +221 -0
  3. package/esm2020/lib/components/base/base-dynamic.mjs +99 -0
  4. package/esm2020/lib/components/base/base-scroll-component.mjs +55 -0
  5. package/esm2020/lib/components/base/base-validators.mjs +19 -0
  6. package/esm2020/lib/components/base/index.mjs +6 -0
  7. package/esm2020/lib/components/dynamic/button/button.component.mjs +52 -0
  8. package/esm2020/lib/components/dynamic/button/index.mjs +2 -0
  9. package/esm2020/lib/components/dynamic/dynamic-directive.mjs +95 -0
  10. package/esm2020/lib/components/dynamic/dynamic.module.mjs +84 -0
  11. package/esm2020/lib/components/dynamic/file-upload/file-upload.component.mjs +52 -0
  12. package/esm2020/lib/components/dynamic/file-upload/index.mjs +2 -0
  13. package/esm2020/lib/components/dynamic/form/dynamic-form-array.component.mjs +72 -0
  14. package/esm2020/lib/components/dynamic/form/dynamic-form.component.mjs +46 -0
  15. package/esm2020/lib/components/dynamic/form/index.mjs +3 -0
  16. package/esm2020/lib/components/dynamic/index.mjs +9 -0
  17. package/esm2020/lib/components/dynamic/input/index.mjs +2 -0
  18. package/esm2020/lib/components/dynamic/input/input.component.mjs +65 -0
  19. package/esm2020/lib/components/dynamic/input-phone/index.mjs +2 -0
  20. package/esm2020/lib/components/dynamic/input-phone/input-phone.component.mjs +65 -0
  21. package/esm2020/lib/components/dynamic/radio/index.mjs +2 -0
  22. package/esm2020/lib/components/dynamic/radio/radio.component.mjs +33 -0
  23. package/esm2020/lib/components/dynamic/select/index.mjs +2 -0
  24. package/esm2020/lib/components/dynamic/select/select.component.mjs +80 -0
  25. package/esm2020/lib/components/dynamic/select-search/index.mjs +2 -0
  26. package/esm2020/lib/components/dynamic/select-search/select-search.component.mjs +80 -0
  27. package/esm2020/lib/components/index.mjs +4 -0
  28. package/esm2020/lib/components/shared/filter/filter.component.mjs +119 -0
  29. package/esm2020/lib/components/shared/filter/filter.module.mjs +63 -0
  30. package/esm2020/lib/components/shared/filter/index.mjs +3 -0
  31. package/esm2020/lib/components/shared/filter/menu/index.mjs +2 -0
  32. package/esm2020/lib/components/shared/filter/menu/menu.component.mjs +120 -0
  33. package/esm2020/lib/components/shared/filter/menu/menu.module.mjs +70 -0
  34. package/esm2020/lib/components/shared/filter/options/children/children.component.mjs +50 -0
  35. package/esm2020/lib/components/shared/filter/options/children/index.mjs +2 -0
  36. package/esm2020/lib/components/shared/filter/options/currency/currency.component.mjs +46 -0
  37. package/esm2020/lib/components/shared/filter/options/currency/index.mjs +2 -0
  38. package/esm2020/lib/components/shared/filter/options/date-range/date-range.component.mjs +65 -0
  39. package/esm2020/lib/components/shared/filter/options/date-range/index.mjs +2 -0
  40. package/esm2020/lib/components/shared/filter/options/index.mjs +2 -0
  41. package/esm2020/lib/components/shared/filter/options/input/index.mjs +2 -0
  42. package/esm2020/lib/components/shared/filter/options/input/input.component.mjs +46 -0
  43. package/esm2020/lib/components/shared/filter/options/options.component.mjs +68 -0
  44. package/esm2020/lib/components/shared/filter/options/options.module.mjs +95 -0
  45. package/esm2020/lib/components/shared/filter/options/status/index.mjs +2 -0
  46. package/esm2020/lib/components/shared/filter/options/status/status.component.mjs +66 -0
  47. package/esm2020/lib/components/shared/filter/selected/index.mjs +2 -0
  48. package/esm2020/lib/components/shared/filter/selected/item/children/children.component.mjs +57 -0
  49. package/esm2020/lib/components/shared/filter/selected/item/children/index.mjs +2 -0
  50. package/esm2020/lib/components/shared/filter/selected/item/currency/currency.component.mjs +29 -0
  51. package/esm2020/lib/components/shared/filter/selected/item/currency/index.mjs +2 -0
  52. package/esm2020/lib/components/shared/filter/selected/item/date-range/date-range.component.mjs +42 -0
  53. package/esm2020/lib/components/shared/filter/selected/item/date-range/index.mjs +2 -0
  54. package/esm2020/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.mjs +33 -0
  55. package/esm2020/lib/components/shared/filter/selected/item/date-with-action/index.mjs +2 -0
  56. package/esm2020/lib/components/shared/filter/selected/item/index.mjs +8 -0
  57. package/esm2020/lib/components/shared/filter/selected/item/input/index.mjs +2 -0
  58. package/esm2020/lib/components/shared/filter/selected/item/input/input.component.mjs +28 -0
  59. package/esm2020/lib/components/shared/filter/selected/item/item.component.mjs +74 -0
  60. package/esm2020/lib/components/shared/filter/selected/item/status/index.mjs +2 -0
  61. package/esm2020/lib/components/shared/filter/selected/item/status/status.component.mjs +39 -0
  62. package/esm2020/lib/components/shared/filter/selected/selected.component.mjs +80 -0
  63. package/esm2020/lib/components/shared/filter/selected/selected.module.mjs +90 -0
  64. package/esm2020/lib/components/shared/index.mjs +5 -0
  65. package/esm2020/lib/components/shared/password-strength/index.mjs +3 -0
  66. package/esm2020/lib/components/shared/password-strength/password-strength.component.mjs +85 -0
  67. package/esm2020/lib/components/shared/password-strength/password-strength.mjs +2 -0
  68. package/esm2020/lib/components/shared/password-strength/password-strength.module.mjs +50 -0
  69. package/esm2020/lib/components/shared/products/filter/filter.component.mjs +36 -0
  70. package/esm2020/lib/components/shared/products/index.mjs +3 -0
  71. package/esm2020/lib/components/shared/products/products.component.mjs +91 -0
  72. package/esm2020/lib/components/shared/products/products.module.mjs +22 -0
  73. package/esm2020/lib/components/shared/products/providers/index.mjs +2 -0
  74. package/esm2020/lib/components/shared/products/providers/products.model.mjs +38 -0
  75. package/esm2020/lib/components/shared/progress-bar/index.mjs +4 -0
  76. package/esm2020/lib/components/shared/progress-bar/progress-bar.component.mjs +28 -0
  77. package/esm2020/lib/components/shared/progress-bar/progress-bar.module.mjs +18 -0
  78. package/esm2020/lib/components/shared/progress-bar/progress-bar.service.mjs +49 -0
  79. package/esm2020/lib/interfaces/field-config.mjs +2 -0
  80. package/esm2020/lib/interfaces/index.mjs +2 -0
  81. package/esm2020/monkey-front-components.mjs +5 -0
  82. package/esm2020/public-api.mjs +5 -0
  83. package/fesm2015/monkey-front-components.mjs +2877 -0
  84. package/fesm2015/monkey-front-components.mjs.map +1 -0
  85. package/fesm2020/monkey-front-components.mjs +2859 -0
  86. package/fesm2020/monkey-front-components.mjs.map +1 -0
  87. package/lib/components/base/base-component.d.ts +50 -0
  88. package/lib/components/base/base-dynamic-array.d.ts +34 -0
  89. package/lib/components/base/base-dynamic.d.ts +24 -0
  90. package/lib/components/base/base-scroll-component.d.ts +16 -0
  91. package/lib/components/base/base-validators.d.ts +1 -0
  92. package/{src/lib/components/base/index.ts → lib/components/base/index.d.ts} +5 -5
  93. package/lib/components/dynamic/button/button.component.d.ts +17 -0
  94. package/{src/lib/components/dynamic/button/index.ts → lib/components/dynamic/button/index.d.ts} +1 -1
  95. package/lib/components/dynamic/dynamic-directive.d.ts +22 -0
  96. package/lib/components/dynamic/dynamic.module.d.ts +20 -0
  97. package/lib/components/dynamic/file-upload/file-upload.component.d.ts +17 -0
  98. package/{src/lib/components/dynamic/file-upload/index.ts → lib/components/dynamic/file-upload/index.d.ts} +1 -1
  99. package/lib/components/dynamic/form/dynamic-form-array.component.d.ts +16 -0
  100. package/lib/components/dynamic/form/dynamic-form.component.d.ts +14 -0
  101. package/{src/lib/components/dynamic/form/index.ts → lib/components/dynamic/form/index.d.ts} +2 -2
  102. package/{src/lib/components/dynamic/index.ts → lib/components/dynamic/index.d.ts} +8 -8
  103. package/{src/lib/components/dynamic/input/index.ts → lib/components/dynamic/input/index.d.ts} +1 -1
  104. package/lib/components/dynamic/input/input.component.d.ts +20 -0
  105. package/{src/lib/components/dynamic/input-phone/index.ts → lib/components/dynamic/input-phone/index.d.ts} +1 -1
  106. package/lib/components/dynamic/input-phone/input-phone.component.d.ts +20 -0
  107. package/{src/lib/components/dynamic/radio/index.ts → lib/components/dynamic/radio/index.d.ts} +1 -1
  108. package/lib/components/dynamic/radio/radio.component.d.ts +11 -0
  109. package/{src/lib/components/dynamic/select/index.ts → lib/components/dynamic/select/index.d.ts} +1 -1
  110. package/lib/components/dynamic/select/select.component.d.ts +16 -0
  111. package/{src/lib/components/dynamic/select-search/index.ts → lib/components/dynamic/select-search/index.d.ts} +1 -1
  112. package/lib/components/dynamic/select-search/select-search.component.d.ts +16 -0
  113. package/{src/lib/components/index.ts → lib/components/index.d.ts} +3 -3
  114. package/lib/components/shared/filter/filter.component.d.ts +32 -0
  115. package/lib/components/shared/filter/filter.module.d.ts +14 -0
  116. package/{src/lib/components/shared/filter/index.ts → lib/components/shared/filter/index.d.ts} +2 -2
  117. package/{src/lib/components/shared/filter/menu/index.ts → lib/components/shared/filter/menu/index.d.ts} +1 -1
  118. package/lib/components/shared/filter/menu/menu.component.d.ts +24 -0
  119. package/lib/components/shared/filter/menu/menu.module.d.ts +14 -0
  120. package/lib/components/shared/filter/options/children/children.component.d.ts +17 -0
  121. package/{src/lib/components/shared/filter/options/children/index.ts → lib/components/shared/filter/options/children/index.d.ts} +1 -1
  122. package/lib/components/shared/filter/options/currency/currency.component.d.ts +17 -0
  123. package/{src/lib/components/shared/filter/options/currency/index.ts → lib/components/shared/filter/options/currency/index.d.ts} +1 -1
  124. package/lib/components/shared/filter/options/date-range/date-range.component.d.ts +24 -0
  125. package/{src/lib/components/shared/filter/options/date-range/index.ts → lib/components/shared/filter/options/date-range/index.d.ts} +1 -1
  126. package/{src/lib/components/shared/filter/options/index.ts → lib/components/shared/filter/options/index.d.ts} +1 -1
  127. package/{src/lib/components/shared/filter/options/input/index.ts → lib/components/shared/filter/options/input/index.d.ts} +1 -1
  128. package/lib/components/shared/filter/options/input/input.component.d.ts +17 -0
  129. package/lib/components/shared/filter/options/options.component.d.ts +20 -0
  130. package/lib/components/shared/filter/options/options.module.d.ts +18 -0
  131. package/{src/lib/components/shared/filter/options/status/index.ts → lib/components/shared/filter/options/status/index.d.ts} +1 -1
  132. package/lib/components/shared/filter/options/status/status.component.d.ts +19 -0
  133. package/{src/lib/components/shared/filter/selected/index.ts → lib/components/shared/filter/selected/index.d.ts} +1 -1
  134. package/lib/components/shared/filter/selected/item/children/children.component.d.ts +16 -0
  135. package/{src/lib/components/shared/filter/selected/item/children/index.ts → lib/components/shared/filter/selected/item/children/index.d.ts} +1 -1
  136. package/lib/components/shared/filter/selected/item/currency/currency.component.d.ts +11 -0
  137. package/{src/lib/components/shared/filter/selected/item/currency/index.ts → lib/components/shared/filter/selected/item/currency/index.d.ts} +1 -1
  138. package/lib/components/shared/filter/selected/item/date-range/date-range.component.d.ts +12 -0
  139. package/{src/lib/components/shared/filter/selected/item/date-range/index.ts → lib/components/shared/filter/selected/item/date-range/index.d.ts} +1 -1
  140. package/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.d.ts +11 -0
  141. package/{src/lib/components/shared/filter/selected/item/date-with-action/index.ts → lib/components/shared/filter/selected/item/date-with-action/index.d.ts} +1 -1
  142. package/{src/lib/components/shared/filter/selected/item/index.ts → lib/components/shared/filter/selected/item/index.d.ts} +7 -7
  143. package/{src/lib/components/shared/filter/selected/item/input/index.ts → lib/components/shared/filter/selected/item/input/index.d.ts} +1 -1
  144. package/lib/components/shared/filter/selected/item/input/input.component.d.ts +11 -0
  145. package/lib/components/shared/filter/selected/item/item.component.d.ts +20 -0
  146. package/{src/lib/components/shared/filter/selected/item/status/index.ts → lib/components/shared/filter/selected/item/status/index.d.ts} +1 -1
  147. package/lib/components/shared/filter/selected/item/status/status.component.d.ts +13 -0
  148. package/lib/components/shared/filter/selected/selected.component.d.ts +18 -0
  149. package/lib/components/shared/filter/selected/selected.module.d.ts +21 -0
  150. package/{src/lib/components/shared/index.ts → lib/components/shared/index.d.ts} +4 -4
  151. package/{src/lib/components/shared/password-strength/index.ts → lib/components/shared/password-strength/index.d.ts} +2 -2
  152. package/lib/components/shared/password-strength/password-strength.component.d.ts +23 -0
  153. package/lib/components/shared/password-strength/password-strength.d.ts +5 -0
  154. package/lib/components/shared/password-strength/password-strength.module.d.ts +12 -0
  155. package/lib/components/shared/products/filter/filter.component.d.ts +12 -0
  156. package/{src/lib/components/shared/products/index.ts → lib/components/shared/products/index.d.ts} +2 -2
  157. package/lib/components/shared/products/products.component.d.ts +20 -0
  158. package/lib/components/shared/products/products.module.d.ts +11 -0
  159. package/{src/lib/components/shared/products/providers/index.ts → lib/components/shared/products/providers/index.d.ts} +1 -1
  160. package/lib/components/shared/products/providers/products.model.d.ts +13 -0
  161. package/{src/lib/components/shared/progress-bar/index.ts → lib/components/shared/progress-bar/index.d.ts} +3 -3
  162. package/lib/components/shared/progress-bar/progress-bar.component.d.ts +12 -0
  163. package/lib/components/shared/progress-bar/progress-bar.module.d.ts +8 -0
  164. package/lib/components/shared/progress-bar/progress-bar.service.d.ts +14 -0
  165. package/lib/interfaces/field-config.d.ts +54 -0
  166. package/{src/lib/interfaces/index.ts → lib/interfaces/index.d.ts} +1 -1
  167. package/monkey-front-components-0.0.387.tgz +0 -0
  168. package/monkey-front-components.d.ts +5 -0
  169. package/package.json +25 -5
  170. package/public-api.d.ts +1 -0
  171. package/karma.conf.js +0 -44
  172. package/monkey-front-components-0.0.384.tgz +0 -0
  173. package/ng-package.json +0 -10
  174. package/src/lib/components/base/base-component.ts +0 -359
  175. package/src/lib/components/base/base-dynamic-array.ts +0 -233
  176. package/src/lib/components/base/base-dynamic.ts +0 -90
  177. package/src/lib/components/base/base-scroll-component.ts +0 -52
  178. package/src/lib/components/base/base-validators.ts +0 -19
  179. package/src/lib/components/dynamic/button/button.component.html +0 -4
  180. package/src/lib/components/dynamic/button/button.component.scss +0 -7
  181. package/src/lib/components/dynamic/button/button.component.ts +0 -47
  182. package/src/lib/components/dynamic/dynamic-directive.ts +0 -102
  183. package/src/lib/components/dynamic/dynamic.module.ts +0 -53
  184. package/src/lib/components/dynamic/file-upload/file-upload.component.html +0 -10
  185. package/src/lib/components/dynamic/file-upload/file-upload.component.ts +0 -46
  186. package/src/lib/components/dynamic/form/dynamic-form-array.component.html +0 -19
  187. package/src/lib/components/dynamic/form/dynamic-form-array.component.scss +0 -10
  188. package/src/lib/components/dynamic/form/dynamic-form-array.component.ts +0 -75
  189. package/src/lib/components/dynamic/form/dynamic-form.component.html +0 -7
  190. package/src/lib/components/dynamic/form/dynamic-form.component.ts +0 -49
  191. package/src/lib/components/dynamic/input/input.component.html +0 -9
  192. package/src/lib/components/dynamic/input/input.component.ts +0 -58
  193. package/src/lib/components/dynamic/input-phone/input-phone.component.html +0 -7
  194. package/src/lib/components/dynamic/input-phone/input-phone.component.ts +0 -58
  195. package/src/lib/components/dynamic/radio/radio.component.html +0 -8
  196. package/src/lib/components/dynamic/radio/radio.component.ts +0 -22
  197. package/src/lib/components/dynamic/select/select.component.html +0 -14
  198. package/src/lib/components/dynamic/select/select.component.ts +0 -75
  199. package/src/lib/components/dynamic/select-search/select-search.component.html +0 -15
  200. package/src/lib/components/dynamic/select-search/select-search.component.ts +0 -76
  201. package/src/lib/components/shared/filter/filter.component.html +0 -51
  202. package/src/lib/components/shared/filter/filter.component.scss +0 -79
  203. package/src/lib/components/shared/filter/filter.component.ts +0 -117
  204. package/src/lib/components/shared/filter/filter.module.ts +0 -36
  205. package/src/lib/components/shared/filter/menu/menu.component.html +0 -28
  206. package/src/lib/components/shared/filter/menu/menu.component.scss +0 -62
  207. package/src/lib/components/shared/filter/menu/menu.component.ts +0 -122
  208. package/src/lib/components/shared/filter/menu/menu.module.ts +0 -41
  209. package/src/lib/components/shared/filter/options/children/children.component.html +0 -6
  210. package/src/lib/components/shared/filter/options/children/children.component.scss +0 -30
  211. package/src/lib/components/shared/filter/options/children/children.component.ts +0 -58
  212. package/src/lib/components/shared/filter/options/currency/currency.component.html +0 -3
  213. package/src/lib/components/shared/filter/options/currency/currency.component.scss +0 -19
  214. package/src/lib/components/shared/filter/options/currency/currency.component.ts +0 -52
  215. package/src/lib/components/shared/filter/options/date-range/date-range.component.html +0 -3
  216. package/src/lib/components/shared/filter/options/date-range/date-range.component.scss +0 -34
  217. package/src/lib/components/shared/filter/options/date-range/date-range.component.ts +0 -72
  218. package/src/lib/components/shared/filter/options/input/input.component.html +0 -3
  219. package/src/lib/components/shared/filter/options/input/input.component.scss +0 -19
  220. package/src/lib/components/shared/filter/options/input/input.component.ts +0 -52
  221. package/src/lib/components/shared/filter/options/options.component.html +0 -43
  222. package/src/lib/components/shared/filter/options/options.component.scss +0 -56
  223. package/src/lib/components/shared/filter/options/options.component.ts +0 -58
  224. package/src/lib/components/shared/filter/options/options.module.ts +0 -58
  225. package/src/lib/components/shared/filter/options/status/status.component.html +0 -4
  226. package/src/lib/components/shared/filter/options/status/status.component.scss +0 -29
  227. package/src/lib/components/shared/filter/options/status/status.component.ts +0 -73
  228. package/src/lib/components/shared/filter/selected/item/children/children.component.html +0 -19
  229. package/src/lib/components/shared/filter/selected/item/children/children.component.scss +0 -68
  230. package/src/lib/components/shared/filter/selected/item/children/children.component.ts +0 -49
  231. package/src/lib/components/shared/filter/selected/item/currency/currency.component.html +0 -1
  232. package/src/lib/components/shared/filter/selected/item/currency/currency.component.scss +0 -4
  233. package/src/lib/components/shared/filter/selected/item/currency/currency.component.ts +0 -26
  234. package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.html +0 -2
  235. package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.scss +0 -4
  236. package/src/lib/components/shared/filter/selected/item/date-range/date-range.component.ts +0 -39
  237. package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.html +0 -1
  238. package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.scss +0 -4
  239. package/src/lib/components/shared/filter/selected/item/date-with-action/date-with-action.component.ts +0 -29
  240. package/src/lib/components/shared/filter/selected/item/input/input.component.html +0 -1
  241. package/src/lib/components/shared/filter/selected/item/input/input.component.scss +0 -4
  242. package/src/lib/components/shared/filter/selected/item/input/input.component.ts +0 -26
  243. package/src/lib/components/shared/filter/selected/item/item.component.html +0 -38
  244. package/src/lib/components/shared/filter/selected/item/item.component.scss +0 -72
  245. package/src/lib/components/shared/filter/selected/item/item.component.ts +0 -71
  246. package/src/lib/components/shared/filter/selected/item/status/status.component.html +0 -1
  247. package/src/lib/components/shared/filter/selected/item/status/status.component.scss +0 -4
  248. package/src/lib/components/shared/filter/selected/item/status/status.component.ts +0 -36
  249. package/src/lib/components/shared/filter/selected/selected.component.html +0 -3
  250. package/src/lib/components/shared/filter/selected/selected.component.scss +0 -9
  251. package/src/lib/components/shared/filter/selected/selected.component.ts +0 -76
  252. package/src/lib/components/shared/filter/selected/selected.module.ts +0 -60
  253. package/src/lib/components/shared/password-strength/password-strength.component.html +0 -50
  254. package/src/lib/components/shared/password-strength/password-strength.component.scss +0 -70
  255. package/src/lib/components/shared/password-strength/password-strength.component.ts +0 -89
  256. package/src/lib/components/shared/password-strength/password-strength.module.ts +0 -24
  257. package/src/lib/components/shared/password-strength/password-strength.ts +0 -5
  258. package/src/lib/components/shared/products/filter/filter.component.html +0 -6
  259. package/src/lib/components/shared/products/filter/filter.component.scss +0 -20
  260. package/src/lib/components/shared/products/filter/filter.component.ts +0 -34
  261. package/src/lib/components/shared/products/products.component.html +0 -15
  262. package/src/lib/components/shared/products/products.component.scss +0 -70
  263. package/src/lib/components/shared/products/products.component.ts +0 -104
  264. package/src/lib/components/shared/products/products.module.ts +0 -13
  265. package/src/lib/components/shared/products/providers/products.model.ts +0 -60
  266. package/src/lib/components/shared/progress-bar/progress-bar.component.html +0 -3
  267. package/src/lib/components/shared/progress-bar/progress-bar.component.scss +0 -6
  268. package/src/lib/components/shared/progress-bar/progress-bar.component.ts +0 -27
  269. package/src/lib/components/shared/progress-bar/progress-bar.module.ts +0 -10
  270. package/src/lib/components/shared/progress-bar/progress-bar.service.ts +0 -59
  271. package/src/lib/interfaces/field-config.ts +0 -58
  272. package/src/public-api.ts +0 -5
  273. package/src/test.ts +0 -26
  274. package/tsconfig.lib.json +0 -20
  275. package/tsconfig.lib.prod.json +0 -10
  276. package/tsconfig.spec.json +0 -17
@@ -0,0 +1,2877 @@
1
+ import { Subject, BehaviorSubject } from 'rxjs';
2
+ import * as i0 from '@angular/core';
3
+ import { Directive, EventEmitter, Input, Output, Component, ViewEncapsulation, HostBinding, ViewChild, NgModule, Injectable } from '@angular/core';
4
+ import { takeUntil, debounceTime, filter } from 'rxjs/operators';
5
+ import * as i1$2 from 'monkey-style-guide';
6
+ import { MonkeyUtils, MonkeyInputModule, MonkeySelectModule, MonkeyRadioButtonModule, MonkeyOptionModule, MonkeyFileUploadModule, MonkeyButtonModule, MonkeyInputPhoneModule, MonkeyBadgeModule, MonkeyCheckboxModule, MonkeyDateRangePickerModule, MonkeyIconModule } from 'monkey-style-guide';
7
+ import * as i1$4 from 'monkey-front-core';
8
+ import { MonkeyEcxCommonsService, ValidateUtils, Validators as Validators$1, MonkeyEcxUtils, MonkeyEcxDirectivesModule, MonkeyEcxPipesModule } from 'monkey-front-core';
9
+ import * as i1 from '@angular/forms';
10
+ import { Validators, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
11
+ import * as i3 from '@angular/common';
12
+ import { isPlatformBrowser, CommonModule } from '@angular/common';
13
+ import * as i1$1 from '@angular/router';
14
+ import { NavigationStart, NavigationEnd, RouterModule, NavigationError, NavigationCancel } from '@angular/router';
15
+ import * as i1$3 from '@ngx-translate/core';
16
+ import { TranslateModule } from '@ngx-translate/core';
17
+
18
+ class BaseComponent {
19
+ constructor() {
20
+ this.__paginationOptions = null;
21
+ this.__isMobile = this.isMobile();
22
+ this.__locales = ['pt-BR', 'es-CL'];
23
+ this.__unsubscribeAll = new Subject();
24
+ }
25
+ isMobile() {
26
+ const isMobileWidth = (window.screen.width <= 640) ||
27
+ (window.matchMedia &&
28
+ window.matchMedia('only screen and (max-width: 640px)').matches);
29
+ return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile/i.test(navigator.userAgent)) || isMobileWidth;
30
+ }
31
+ handlePagination(create = true) {
32
+ const { __paginationOptions } = this;
33
+ if (__paginationOptions) {
34
+ const { mainElement, service } = __paginationOptions;
35
+ const element = document.getElementById(mainElement);
36
+ if (element) {
37
+ element.scroll = null;
38
+ element.onscroll = null;
39
+ element.removeEventListener('scroll', element.eventListeners('scroll'));
40
+ element.removeEventListener('scroll', element.eventListeners('scroll')[0]);
41
+ if (create) {
42
+ element.addEventListener('scroll', () => {
43
+ const { scrollTop, scrollHeight, offsetHeight } = element;
44
+ const contentHeight = scrollHeight - offsetHeight;
45
+ if (contentHeight <= scrollTop) {
46
+ service.doPagination();
47
+ }
48
+ });
49
+ }
50
+ }
51
+ }
52
+ }
53
+ handleSupport(supportControls) {
54
+ const { service, show } = supportControls;
55
+ const method = show ? 'show' : 'hide';
56
+ service[method.toLowerCase()]();
57
+ }
58
+ handleTranslate(translateOptions) {
59
+ const { service } = translateOptions;
60
+ service.__oni18nDataChanged$
61
+ .pipe(takeUntil(this.__unsubscribeAll))
62
+ .subscribe(() => {
63
+ const data = service.__i18n;
64
+ if (data) {
65
+ this.__i18n = data;
66
+ }
67
+ });
68
+ }
69
+ handleViewScroll(options) {
70
+ var _a;
71
+ const { elementId, service } = options;
72
+ if (elementId === ((_a = service === null || service === void 0 ? void 0 : service.__savedState) === null || _a === void 0 ? void 0 : _a.scrollElementId)) {
73
+ this.goScroll(elementId);
74
+ service.__savedState.scrollElementId = null;
75
+ }
76
+ }
77
+ getErrorFirstMessageTranslated(formControl = null) {
78
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('required'))
79
+ return 'FIELD-REQUIRED';
80
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalid'))
81
+ return 'FIELD-INVALID';
82
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('email'))
83
+ return 'INVALID-EMAIL';
84
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('minlength'))
85
+ return 'MIN-LENGTH';
86
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('maxlength'))
87
+ return 'MAX-LENGTH';
88
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('max'))
89
+ return 'MAX';
90
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('min'))
91
+ return 'MIN';
92
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('passwordsNotMatching'))
93
+ return 'MATCH-PASSWORD';
94
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidDate'))
95
+ return 'INVALID-DATE';
96
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidTrue'))
97
+ return 'INVALID-TRUE';
98
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidCpfCnpj'))
99
+ return 'INVALID-DOCUMENT';
100
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidZipCode'))
101
+ return 'INVALID-ZIPCODE';
102
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidCombo'))
103
+ return 'INVALID-COMBO';
104
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidUrl'))
105
+ return 'INVALID-URL';
106
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidUnlockRegister')) {
107
+ return 'INVALID-UNLOCK-REGISTER';
108
+ }
109
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('dateStartMustBeLessThanAnd')) {
110
+ return 'DATE-START-MUST-BE-LESS-THAN-AND';
111
+ }
112
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('dateEndMustBeGreaterThanStart')) {
113
+ return 'DATE-END-MUST-BE-GREATER-THAN-SART';
114
+ }
115
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('phone'))
116
+ return 'INVALID-PHONE';
117
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('invalidValueGreaterThanZero'))
118
+ return 'INVALID-GREATER-THAN-ZERO';
119
+ return 'FIELD-INVALID';
120
+ }
121
+ getErrorLastMessageNotTranslated(formControl = null) {
122
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('minlength')) {
123
+ return `${formControl === null || formControl === void 0 ? void 0 : formControl.getError('minlength').requiredLength} caracteres.`;
124
+ }
125
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('maxlength')) {
126
+ return `${formControl === null || formControl === void 0 ? void 0 : formControl.getError('maxlength').requiredLength} caracteres.`;
127
+ }
128
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('max')) {
129
+ return `${formControl === null || formControl === void 0 ? void 0 : formControl.getError('max').max}`;
130
+ }
131
+ if (formControl === null || formControl === void 0 ? void 0 : formControl.hasError('min')) {
132
+ return `${formControl === null || formControl === void 0 ? void 0 : formControl.getError('min').min}`;
133
+ }
134
+ return '';
135
+ }
136
+ validateFormWithTranslate(f, index) {
137
+ const formErrors = f.value;
138
+ if (f.status === 'VALID')
139
+ return true;
140
+ if (!formErrors)
141
+ return true;
142
+ Object.entries(formErrors).forEach(([key, value]) => {
143
+ const control = f.get(key);
144
+ formErrors[key] = '';
145
+ if (control && !control.valid) {
146
+ const msg = {
147
+ first: `ERRORS.${this.getErrorFirstMessageTranslated(f.get(key))}`,
148
+ last: this.getErrorLastMessageNotTranslated(f.get(key))
149
+ };
150
+ formErrors[key] = msg;
151
+ }
152
+ });
153
+ if (MonkeyUtils.persistNullEmptyUndefined(index)) {
154
+ this.__monkeyecxFormErrors[index || 0] = formErrors;
155
+ }
156
+ else {
157
+ this.__monkeyecxFormErrors = formErrors;
158
+ }
159
+ return false;
160
+ }
161
+ copyToClipboard(val) {
162
+ const selBox = document.createElement('textarea');
163
+ selBox.style.position = 'fixed';
164
+ selBox.style.left = '0';
165
+ selBox.style.top = '0';
166
+ selBox.style.opacity = '0';
167
+ selBox.value = val;
168
+ document.body.appendChild(selBox);
169
+ selBox.focus();
170
+ selBox.select();
171
+ document.execCommand('copy');
172
+ document.body.removeChild(selBox);
173
+ }
174
+ validateForm(f, index, alias) {
175
+ const formErrors = f.value;
176
+ if (f.status === 'VALID')
177
+ return true;
178
+ if (!formErrors)
179
+ return true;
180
+ Object.entries(formErrors).forEach(([key, value]) => {
181
+ const control = f.get(key);
182
+ formErrors[key] = '';
183
+ if (control && !control.valid) {
184
+ const msg = {
185
+ firstMessage: `ERRORS.${this.getErrorFirstMessageTranslated(f.get(key))}`,
186
+ lastMessage: this.getErrorLastMessageNotTranslated(f.get(key))
187
+ };
188
+ formErrors[key] = msg;
189
+ }
190
+ });
191
+ if (MonkeyUtils.persistNullEmptyUndefined(index)) {
192
+ this.__monkeyecxFormErrors[index || 0] = formErrors;
193
+ }
194
+ else {
195
+ let obj;
196
+ if (alias) {
197
+ obj = {
198
+ [alias]: Object.assign({}, formErrors)
199
+ };
200
+ }
201
+ else {
202
+ obj = formErrors;
203
+ }
204
+ this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), obj);
205
+ }
206
+ f.markAllAsTouched();
207
+ return false;
208
+ }
209
+ clearAllServiceData(clearData) {
210
+ const context = this;
211
+ Object.values(context).forEach((ctx) => {
212
+ if (ctx instanceof MonkeyEcxCommonsService) {
213
+ ctx.clear(clearData);
214
+ }
215
+ });
216
+ }
217
+ ngOnInit(args) {
218
+ if (args === null || args === void 0 ? void 0 : args.paginationOptions) {
219
+ this.__paginationOptions = args === null || args === void 0 ? void 0 : args.paginationOptions;
220
+ this.handlePagination();
221
+ }
222
+ if (args === null || args === void 0 ? void 0 : args.supportControls) {
223
+ this.handleSupport(args === null || args === void 0 ? void 0 : args.supportControls);
224
+ }
225
+ if (args === null || args === void 0 ? void 0 : args.translateOptions) {
226
+ this.handleTranslate(args === null || args === void 0 ? void 0 : args.translateOptions);
227
+ }
228
+ if (args === null || args === void 0 ? void 0 : args.scrollOptions) {
229
+ this.handleViewScroll(args.scrollOptions);
230
+ }
231
+ }
232
+ ngOnDestroy(clearData = true) {
233
+ this.__unsubscribeAll.next();
234
+ this.__unsubscribeAll.complete();
235
+ this.clearAllServiceData(clearData);
236
+ this.handlePagination(false);
237
+ }
238
+ handleErrorFromServices(error, f) {
239
+ this.__monkeyecxFormErrors = null;
240
+ if (error.type === 'Parameter_Error') {
241
+ Object.entries(f.value).forEach(([key, value]) => {
242
+ error.notifications.forEach((_) => {
243
+ const field = _.split(':')[0];
244
+ const description = _.split(':')[1];
245
+ if (field === key) {
246
+ const msg = {
247
+ firstMessage: '',
248
+ lastMessage: description
249
+ };
250
+ this.__monkeyecxFormErrors = Object.assign(Object.assign({}, this.__monkeyecxFormErrors), { [key]: msg });
251
+ f.controls[key].setErrors({
252
+ incorrect: true
253
+ });
254
+ }
255
+ });
256
+ });
257
+ }
258
+ f.markAllAsTouched();
259
+ }
260
+ goBack() {
261
+ window.history.back();
262
+ }
263
+ goScroll(id) {
264
+ const element = document.getElementById(id);
265
+ if (element)
266
+ element.scrollIntoView();
267
+ }
268
+ getEmbeddedData(data, field) {
269
+ const { _embedded } = data;
270
+ return _embedded ? _embedded[field] : null;
271
+ }
272
+ openWindow(url) {
273
+ window.open(`${url}`, '_blank');
274
+ }
275
+ fillI18n(data) {
276
+ this.__i18n = data;
277
+ }
278
+ getCountryPrefix(country) {
279
+ return {
280
+ br: 55,
281
+ cl: 56
282
+ }[country];
283
+ }
284
+ getCountryCurrencyChartFormat(country) {
285
+ return {
286
+ br: 'R$ #,###,##0.00',
287
+ cl: 'CLP #,###,##0'
288
+ }[country];
289
+ }
290
+ getCountryValidators(country) {
291
+ return {
292
+ br: {
293
+ governmentId: ValidateUtils.DocumentValidator
294
+ },
295
+ cl: {
296
+ governmentId: ValidateUtils.DocumentRutValidator
297
+ }
298
+ }[country];
299
+ }
300
+ isAbleToHandlePagination() {
301
+ const { __paginationOptions } = this;
302
+ if (__paginationOptions) {
303
+ const { service } = __paginationOptions;
304
+ const links = service.__links;
305
+ if (links && (links === null || links === void 0 ? void 0 : links.next))
306
+ return true;
307
+ }
308
+ return false;
309
+ }
310
+ onHandlePagination() {
311
+ const { __paginationOptions } = this;
312
+ if (__paginationOptions) {
313
+ const { service } = __paginationOptions;
314
+ service.doPagination();
315
+ }
316
+ }
317
+ }
318
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
319
+ BaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: BaseComponent, selector: "[baseComponent]", ngImport: i0 });
320
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseComponent, decorators: [{
321
+ type: Directive,
322
+ args: [{
323
+ selector: '[baseComponent]'
324
+ }]
325
+ }], ctorParameters: function () { return []; } });
326
+
327
+ const validators = {
328
+ required: Validators.required,
329
+ email: Validators$1.email,
330
+ governmentId: Validators$1.documentBR,
331
+ governmentIdRut: Validators$1.documentCL,
332
+ documentBR: Validators$1.documentBR,
333
+ documentCL: Validators$1.documentCL,
334
+ date: Validators$1.date,
335
+ zipCode: Validators$1.zipCode,
336
+ minLength: (param) => {
337
+ return Validators.minLength(param);
338
+ },
339
+ maxLength: (param) => {
340
+ return Validators.maxLength(param);
341
+ }
342
+ };
343
+
344
+ class BaseDynamicArray extends BaseComponent {
345
+ constructor(fb) {
346
+ super();
347
+ this.fb = fb;
348
+ this.onHandleSubmit = new EventEmitter();
349
+ this.onHandleUpdateForm = new EventEmitter();
350
+ this.onHandleSubmitFormReady = new EventEmitter();
351
+ this.fields = [];
352
+ this.qtd = 1;
353
+ this.disabled = false;
354
+ this._form = null;
355
+ // eslint-disable-next-line object-curly-newline
356
+ this._plusValidations = [];
357
+ this.changesUnsubscribe = new Subject();
358
+ this.formBase = () => {
359
+ // return this.fb.group(this.createControl());
360
+ return this.createControl();
361
+ };
362
+ }
363
+ handleInternalPlusValidation(mainField, data) {
364
+ const { operator, field, value } = mainField;
365
+ const validators = {
366
+ e: (val1, val2) => { return val1 === val2; },
367
+ lt: (val1, val2) => { return val1 < val2; },
368
+ gt: (val1, val2) => { return val1 > val2; }
369
+ };
370
+ return validators[operator]((data === null || data === void 0 ? void 0 : data[field]) || data, value);
371
+ }
372
+ makeInternalPlusValidation(data, sourceField, settings, rowIndex) {
373
+ const changeFields = (show) => {
374
+ const saved = [...this.fields];
375
+ saved.map((val) => {
376
+ var _a;
377
+ const valSaved = Object.assign({}, val);
378
+ if (val.name === sourceField) {
379
+ this._plusValidations[rowIndex] = {
380
+ [sourceField]: Object.assign(Object.assign({}, valSaved), { alwaysShow: show })
381
+ };
382
+ this.createOneControl(val.name, (_a = this.formValues) === null || _a === void 0 ? void 0 : _a.controls[rowIndex], show);
383
+ }
384
+ else {
385
+ this._plusValidations[rowIndex] = Object.assign({}, valSaved);
386
+ }
387
+ return null;
388
+ });
389
+ };
390
+ const validated = this.handleInternalPlusValidation(settings, data);
391
+ changeFields(validated);
392
+ }
393
+ createOneControl(fieldName, ctrl, create = true) {
394
+ const { fields } = this;
395
+ if (!fields)
396
+ return;
397
+ fields.forEach((field) => {
398
+ const { fieldType, validations, name, disabled } = field;
399
+ if (name !== fieldName)
400
+ return;
401
+ let { value } = field;
402
+ if (fieldType === 'button')
403
+ return;
404
+ if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
405
+ value = '';
406
+ }
407
+ if (create) {
408
+ const control = this.fb.control(value, this.bindValidations(validations || []));
409
+ if (disabled || this.disabled)
410
+ control.disable();
411
+ ctrl.addControl(name, control);
412
+ }
413
+ else {
414
+ ctrl.removeControl(name);
415
+ }
416
+ });
417
+ }
418
+ createControl(data) {
419
+ const { fields } = this;
420
+ if (!fields)
421
+ return null;
422
+ // eslint-disable-next-line object-curly-newline
423
+ const group = this.fb.group({});
424
+ fields.forEach((field) => {
425
+ const { fieldType, validations, name, disabled, alwaysShow } = field;
426
+ let { value } = field;
427
+ if (field.alwaysShowPlusValidation) {
428
+ if (!this.handleInternalPlusValidation(field.alwaysShowPlusValidation, data))
429
+ return;
430
+ }
431
+ else if (!alwaysShow)
432
+ return;
433
+ if (fieldType === 'button')
434
+ return;
435
+ if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
436
+ value = '';
437
+ }
438
+ const control = this.fb.control(value, this.bindValidations(validations || []));
439
+ if (disabled || this.disabled)
440
+ control.disable();
441
+ group.addControl(name, control);
442
+ });
443
+ return group;
444
+ }
445
+ bindValidations(validations) {
446
+ if (validations.length > 0) {
447
+ const validList = [];
448
+ validations.forEach((valid) => {
449
+ const validated = valid.param
450
+ ? validators[valid.name](valid.param)
451
+ : validators[valid.name];
452
+ validList.push(validated);
453
+ });
454
+ return Validators.compose(validList);
455
+ }
456
+ return null;
457
+ }
458
+ buildForm() {
459
+ var _a;
460
+ const form = this.fb.group({
461
+ fields: this.fb.array([])
462
+ });
463
+ (_a = form === null || form === void 0 ? void 0 : form.controls.fields) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe((_) => {
464
+ this.watchForChanges();
465
+ });
466
+ return form;
467
+ }
468
+ watchForChanges() {
469
+ var _a, _b;
470
+ const { fields, changesUnsubscribe } = this;
471
+ changesUnsubscribe.next();
472
+ (_b = (_a = this.formValues) === null || _a === void 0 ? void 0 : _a.controls) === null || _b === void 0 ? void 0 : _b.map((control, index) => {
473
+ fields.forEach((fieldConfig) => {
474
+ var _a;
475
+ const { name, alwaysShowPlusValidation } = fieldConfig;
476
+ if (!alwaysShowPlusValidation)
477
+ return;
478
+ const { field } = alwaysShowPlusValidation;
479
+ if (field) {
480
+ (_a = control.controls[field]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(takeUntil(changesUnsubscribe)).subscribe((_) => {
481
+ this.makeInternalPlusValidation(_, name, alwaysShowPlusValidation, index);
482
+ });
483
+ }
484
+ });
485
+ return null;
486
+ });
487
+ }
488
+ get formValues() {
489
+ return this._form ? this._form.get('fields') : null;
490
+ }
491
+ fillValues() {
492
+ const { data, qtd } = this;
493
+ if ((!this._form) && qtd)
494
+ return;
495
+ if (qtd > 0) {
496
+ Array(qtd)
497
+ .fill(null)
498
+ .map((_, index) => {
499
+ var _a;
500
+ let form = this.createControl();
501
+ if (data && data[index]) {
502
+ form = this.createControl(data[index]);
503
+ const handledData = data[index];
504
+ Object.entries(handledData).forEach(([key, value]) => {
505
+ if (MonkeyUtils.persistNullEmptyUndefined(value) && (form === null || form === void 0 ? void 0 : form.controls[key])) {
506
+ form === null || form === void 0 ? void 0 : form.controls[key].setValue(value);
507
+ }
508
+ });
509
+ }
510
+ (_a = this.formValues) === null || _a === void 0 ? void 0 : _a.push(form);
511
+ return null;
512
+ });
513
+ }
514
+ }
515
+ ngOnInit() {
516
+ this._form = this.buildForm();
517
+ this.fillValues();
518
+ this.onHandleUpdateForm.subscribe(() => {
519
+ this.fillValues();
520
+ });
521
+ }
522
+ ngOnChanges() {
523
+ if (!this._form) {
524
+ this._form = this.buildForm();
525
+ }
526
+ this.fillValues();
527
+ }
528
+ }
529
+ BaseDynamicArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseDynamicArray, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Directive });
530
+ BaseDynamicArray.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: BaseDynamicArray, selector: "[baseDynamicArray]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", qtd: "qtd", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
531
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseDynamicArray, decorators: [{
532
+ type: Directive,
533
+ args: [{
534
+ selector: '[baseDynamicArray]'
535
+ }]
536
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
537
+ type: Input
538
+ }], onHandleUpdateForm: [{
539
+ type: Input
540
+ }], onHandleSubmitFormReady: [{
541
+ type: Output
542
+ }], self: [{
543
+ type: Input
544
+ }], fields: [{
545
+ type: Input
546
+ }], data: [{
547
+ type: Input
548
+ }], qtd: [{
549
+ type: Input
550
+ }], disabled: [{
551
+ type: Input
552
+ }] } });
553
+
554
+ class BaseDynamic extends BaseComponent {
555
+ constructor(fb) {
556
+ super();
557
+ this.fb = fb;
558
+ this.onHandleSubmit = new EventEmitter();
559
+ this.onHandleUpdateForm = new EventEmitter();
560
+ this.onHandleSubmitFormReady = new EventEmitter();
561
+ this.fields = [];
562
+ this.disabled = false;
563
+ this._form = null;
564
+ }
565
+ createControl() {
566
+ const { fields } = this;
567
+ if (!fields)
568
+ return null;
569
+ // eslint-disable-next-line object-curly-newline
570
+ const group = this.fb.group({});
571
+ fields.forEach((field) => {
572
+ const { fieldType, validations, name, disabled } = field;
573
+ let { value } = field;
574
+ if (fieldType === 'button')
575
+ return;
576
+ if (fieldType === 'radiobutton' || fieldType === 'checkbox' || fieldType === 'select') {
577
+ value = '';
578
+ }
579
+ const control = this.fb.control(value, this.bindValidations(validations || []));
580
+ if (disabled || this.disabled)
581
+ control.disable();
582
+ group.addControl(name, control);
583
+ });
584
+ return group;
585
+ }
586
+ bindValidations(validations) {
587
+ if (validations.length > 0) {
588
+ const validList = [];
589
+ validations.forEach((valid) => {
590
+ const validated = valid.param
591
+ ? validators[valid.name](valid.param)
592
+ : validators[valid.name];
593
+ validList.push(validated);
594
+ });
595
+ return Validators.compose(validList);
596
+ }
597
+ return null;
598
+ }
599
+ fillValues() {
600
+ const { data } = this;
601
+ if (!data || !this._form)
602
+ return;
603
+ Object.entries(data).forEach(([key, value]) => {
604
+ var _a, _b, _c;
605
+ if (MonkeyUtils.persistNullEmptyUndefined(value) && ((_a = this._form) === null || _a === void 0 ? void 0 : _a.controls[key])) {
606
+ (_c = (_b = this._form) === null || _b === void 0 ? void 0 : _b.controls[key]) === null || _c === void 0 ? void 0 : _c.setValue(value);
607
+ }
608
+ });
609
+ }
610
+ ngOnInit() {
611
+ this._form = this.createControl();
612
+ this.fillValues();
613
+ this.onHandleUpdateForm.subscribe(() => {
614
+ this.fillValues();
615
+ });
616
+ }
617
+ ngOnChanges() {
618
+ if (!this._form) {
619
+ this._form = this.createControl();
620
+ }
621
+ this.fillValues();
622
+ }
623
+ }
624
+ BaseDynamic.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseDynamic, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Directive });
625
+ BaseDynamic.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: BaseDynamic, selector: "[baseDynamic]", inputs: { onHandleSubmit: "onHandleSubmit", onHandleUpdateForm: "onHandleUpdateForm", self: "self", fields: "fields", data: "data", disabled: "disabled" }, outputs: { onHandleSubmitFormReady: "onHandleSubmitFormReady" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseDynamic, decorators: [{
627
+ type: Directive,
628
+ args: [{
629
+ selector: '[baseDynamic]'
630
+ }]
631
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }]; }, propDecorators: { onHandleSubmit: [{
632
+ type: Input
633
+ }], onHandleUpdateForm: [{
634
+ type: Input
635
+ }], onHandleSubmitFormReady: [{
636
+ type: Output
637
+ }], self: [{
638
+ type: Input
639
+ }], fields: [{
640
+ type: Input
641
+ }], data: [{
642
+ type: Input
643
+ }], disabled: [{
644
+ type: Input
645
+ }] } });
646
+
647
+ class BaseScrollComponent extends BaseComponent {
648
+ constructor(_pId, _rt) {
649
+ super();
650
+ this._pId = _pId;
651
+ this._rt = _rt;
652
+ this.routeScrollPositions = {};
653
+ }
654
+ saveScroll(url) {
655
+ const element = document.getElementById('container-3');
656
+ this.routeScrollPositions[url] = element.scrollTop;
657
+ }
658
+ restoreScroll(url) {
659
+ const savedScroll = this.routeScrollPositions[url];
660
+ const element = document.getElementById('container-3');
661
+ if (!savedScroll) {
662
+ return;
663
+ }
664
+ element.scrollTop = savedScroll;
665
+ }
666
+ addScrollTopListeners() {
667
+ if ('scrollRestoration' in history) {
668
+ history.scrollRestoration = 'manual';
669
+ }
670
+ this._rt.events.subscribe(event => {
671
+ if (event instanceof NavigationStart) {
672
+ this.saveScroll(this._rt.url);
673
+ }
674
+ else if (event instanceof NavigationEnd) {
675
+ setTimeout(() => {
676
+ this.restoreScroll(event.url);
677
+ });
678
+ }
679
+ });
680
+ }
681
+ ngOnInit() {
682
+ if (isPlatformBrowser(this._pId)) {
683
+ this.addScrollTopListeners();
684
+ }
685
+ }
686
+ }
687
+ BaseScrollComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseScrollComponent, deps: [{ token: Object }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Directive });
688
+ BaseScrollComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: BaseScrollComponent, selector: "[baseScrollComponent]", usesInheritance: true, ngImport: i0 });
689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseScrollComponent, decorators: [{
690
+ type: Directive,
691
+ args: [{
692
+ selector: '[baseScrollComponent]'
693
+ }]
694
+ }], ctorParameters: function () { return [{ type: Object }, { type: i1$1.Router }]; } });
695
+
696
+ class MECXDynamicFileUploadComponent {
697
+ constructor(cdr) {
698
+ this.cdr = cdr;
699
+ // eslint-disable-next-line object-curly-newline
700
+ this._formErrors = {};
701
+ this._function = (file, callback) => {
702
+ var _a, _b, _c, _d, _e;
703
+ if ((_a = this._form) === null || _a === void 0 ? void 0 : _a.disabled)
704
+ return;
705
+ if (!((_c = (_b = this._field) === null || _b === void 0 ? void 0 : _b.functions) === null || _c === void 0 ? void 0 : _c.onHandleUpload)) {
706
+ console.error('onHandleUpload not declared');
707
+ return;
708
+ }
709
+ const { func, type } = (_e = (_d = this._field) === null || _d === void 0 ? void 0 : _d.functions) === null || _e === void 0 ? void 0 : _e.onHandleUpload;
710
+ if (!func || !this.self[func]) {
711
+ console.error('onHandleUpload not declared');
712
+ return;
713
+ }
714
+ this.self[func](file, type, callback);
715
+ };
716
+ // not to do
717
+ }
718
+ get className() {
719
+ var _a, _b;
720
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
721
+ }
722
+ ngOnChanges() {
723
+ this.cdr.detectChanges();
724
+ }
725
+ }
726
+ MECXDynamicFileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFileUploadComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
727
+ MECXDynamicFileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicFileUploadComponent, selector: "mecx-dynamic-file-upload", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, template: "<monkey-file-upload\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [icon]=\"_field?.icon\" [formControl]=\"_form.controls[_field?.name]\"\n [placeholder]=\"_field?.placeholder | translate\"\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\n [maxSize]=\"_field?.maxSize || 5242880\" [fileUpload]=\"_function\"\n [maxSizeErrorMessage]=\"'FIELD.FILE.MAX-FILE' | translate\"\n [allowedExtensionErrorMessage]=\"'FIELD.FILE.ALLOWED-EXTENSION' | translate\"\n [allowedExtensions]=\"_field?.allowedExtensions || []\" *ngIf=\"_field\">\n</monkey-file-upload>", components: [{ type: i1$2.MonkeyFileUploadComponent, selector: "monkey-file-upload", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "infoMessage", "uploadOngoingMessage", "errorMessage", "listenFiles", "maxSize", "allowedExtensions", "maxSizeErrorMessage", "allowedExtensionErrorMessage", "fileUpload", "value"], outputs: ["onChange", "onHandleFilesReady"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFileUploadComponent, decorators: [{
729
+ type: Component,
730
+ args: [{ selector: 'mecx-dynamic-file-upload', encapsulation: ViewEncapsulation.None, template: "<monkey-file-upload\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [icon]=\"_field?.icon\" [formControl]=\"_form.controls[_field?.name]\"\n [placeholder]=\"_field?.placeholder | translate\"\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\n [maxSize]=\"_field?.maxSize || 5242880\" [fileUpload]=\"_function\"\n [maxSizeErrorMessage]=\"'FIELD.FILE.MAX-FILE' | translate\"\n [allowedExtensionErrorMessage]=\"'FIELD.FILE.ALLOWED-EXTENSION' | translate\"\n [allowedExtensions]=\"_field?.allowedExtensions || []\" *ngIf=\"_field\">\n</monkey-file-upload>" }]
731
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
732
+ type: Input
733
+ }], _form: [{
734
+ type: Input
735
+ }], _formErrors: [{
736
+ type: Input
737
+ }], self: [{
738
+ type: Input
739
+ }], className: [{
740
+ type: HostBinding,
741
+ args: ['class']
742
+ }] } });
743
+
744
+ class MECXDynamicButtonComponent {
745
+ constructor(cdr) {
746
+ this.cdr = cdr;
747
+ this._field = null;
748
+ this._form = null;
749
+ // eslint-disable-next-line object-curly-newline
750
+ this._formErrors = {};
751
+ // not to do
752
+ }
753
+ get className() {
754
+ var _a, _b;
755
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
756
+ }
757
+ ngOnChanges() {
758
+ this.cdr.detectChanges();
759
+ }
760
+ onClick() {
761
+ var _a;
762
+ const { _form, _field, self } = this;
763
+ if ((_form === null || _form === void 0 ? void 0 : _form.disabled) || !_field)
764
+ return;
765
+ const { name, value } = _field;
766
+ const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onClick;
767
+ if (func) {
768
+ self[func]({
769
+ name,
770
+ value,
771
+ form: _form
772
+ });
773
+ }
774
+ }
775
+ }
776
+ MECXDynamicButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
777
+ MECXDynamicButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicButtonComponent, selector: "mecx-dynamic-button", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, usesOnChanges: true, ngImport: i0, template: "<monkey-button [icon]=\"_field?.icon\" [type]=\"_field?.type\" [color]=\"_field?.color\"\n (click)=\"onClick()\">\n {{ _field?.label | translate }}\n</monkey-button>", styles: ["mecx-dynamic-button monkey-button button{height:40px}\n"], components: [{ type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
778
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicButtonComponent, decorators: [{
779
+ type: Component,
780
+ args: [{ selector: 'mecx-dynamic-button', encapsulation: ViewEncapsulation.None, template: "<monkey-button [icon]=\"_field?.icon\" [type]=\"_field?.type\" [color]=\"_field?.color\"\n (click)=\"onClick()\">\n {{ _field?.label | translate }}\n</monkey-button>", styles: ["mecx-dynamic-button monkey-button button{height:40px}\n"] }]
781
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
782
+ type: Input
783
+ }], _form: [{
784
+ type: Input
785
+ }], _formErrors: [{
786
+ type: Input
787
+ }], self: [{
788
+ type: Input
789
+ }], className: [{
790
+ type: HostBinding,
791
+ args: ['class']
792
+ }] } });
793
+
794
+ class MECXDynamicInputComponent {
795
+ constructor(cdr) {
796
+ this.cdr = cdr;
797
+ this._field = null;
798
+ this._form = null;
799
+ // eslint-disable-next-line object-curly-newline
800
+ this._formErrors = {};
801
+ this.inputElement = null;
802
+ // not to do
803
+ }
804
+ get className() {
805
+ var _a, _b;
806
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
807
+ }
808
+ ngOnInit() {
809
+ this.cdr.detectChanges();
810
+ }
811
+ ngOnChanges() {
812
+ this.cdr.detectChanges();
813
+ }
814
+ onChange(event) {
815
+ var _a, _b, _c;
816
+ const { _form, _field, self } = this;
817
+ if (!_field || !_form)
818
+ return;
819
+ const { name } = _field;
820
+ const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
821
+ const isValid = (_b = _form === null || _form === void 0 ? void 0 : _form.get(_field === null || _field === void 0 ? void 0 : _field.name)) === null || _b === void 0 ? void 0 : _b.valid;
822
+ if (func) {
823
+ self[func]({
824
+ name,
825
+ isValid,
826
+ event,
827
+ ctrl: _form.get((_c = this._field) === null || _c === void 0 ? void 0 : _c.name),
828
+ form: _form
829
+ });
830
+ }
831
+ }
832
+ }
833
+ MECXDynamicInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
834
+ MECXDynamicInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicInputComponent, selector: "mecx-dynamic-input", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<monkey-input\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [mask]=\"_field?.mask\" [prefix]=\"_field?.prefix\" [name]=\"_field?.name\"\r\n [formControl]=\"_form.controls[_field?.name]\" [placeholder]=\"_field?.placeholder | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\r\n [type]=\"_field?.type\" #inputElement (onChange)=\"onChange($event)\"\r\n [onlyNumber]=\"_field?.onlyNumber\" [currency]=\"_field?.currency\" [maxLength]=\"_field?.maxLength\"\r\n [maxDateToday]=\"_field?.maxDateToday\">\r\n</monkey-input>", components: [{ type: i1$2.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "maxLength", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent", "maxDateToday", "value"], outputs: ["onChange"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
835
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicInputComponent, decorators: [{
836
+ type: Component,
837
+ args: [{ selector: 'mecx-dynamic-input', encapsulation: ViewEncapsulation.None, template: "<monkey-input\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [mask]=\"_field?.mask\" [prefix]=\"_field?.prefix\" [name]=\"_field?.name\"\r\n [formControl]=\"_form.controls[_field?.name]\" [placeholder]=\"_field?.placeholder | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\" [label]=\"_field?.label | translate\"\r\n [type]=\"_field?.type\" #inputElement (onChange)=\"onChange($event)\"\r\n [onlyNumber]=\"_field?.onlyNumber\" [currency]=\"_field?.currency\" [maxLength]=\"_field?.maxLength\"\r\n [maxDateToday]=\"_field?.maxDateToday\">\r\n</monkey-input>" }]
838
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
839
+ type: Input
840
+ }], _form: [{
841
+ type: Input
842
+ }], _formErrors: [{
843
+ type: Input
844
+ }], self: [{
845
+ type: Input
846
+ }], inputElement: [{
847
+ type: ViewChild,
848
+ args: ['inputElement', {
849
+ static: true
850
+ }]
851
+ }], className: [{
852
+ type: HostBinding,
853
+ args: ['class']
854
+ }] } });
855
+
856
+ class MECXDynamicInputPhoneComponent {
857
+ constructor(cdr) {
858
+ this.cdr = cdr;
859
+ this._field = null;
860
+ this._form = null;
861
+ // eslint-disable-next-line object-curly-newline
862
+ this._formErrors = {};
863
+ this.inputElement = null;
864
+ // not to do
865
+ }
866
+ get className() {
867
+ var _a, _b;
868
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
869
+ }
870
+ ngOnInit() {
871
+ this.cdr.detectChanges();
872
+ }
873
+ ngOnChanges() {
874
+ this.cdr.detectChanges();
875
+ }
876
+ onChange(event) {
877
+ var _a, _b, _c;
878
+ const { _form, _field, self } = this;
879
+ if (!_field || !_form)
880
+ return;
881
+ const { name } = _field;
882
+ const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
883
+ const isValid = (_b = _form === null || _form === void 0 ? void 0 : _form.get(_field === null || _field === void 0 ? void 0 : _field.name)) === null || _b === void 0 ? void 0 : _b.valid;
884
+ if (func) {
885
+ self[func]({
886
+ name,
887
+ isValid,
888
+ event,
889
+ ctrl: _form.get((_c = this._field) === null || _c === void 0 ? void 0 : _c.name),
890
+ form: _form
891
+ });
892
+ }
893
+ }
894
+ }
895
+ MECXDynamicInputPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicInputPhoneComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
896
+ MECXDynamicInputPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicInputPhoneComponent, selector: "mecx-dynamic-input-phone", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, viewQueries: [{ propertyName: "inputElement", first: true, predicate: ["inputElement"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<monkey-input-phone [name]=\"_field?.name\" [label]=\"_field?.label | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\"\r\n [placeholder]=\"_field?.placeholder | translate\" [icon]=\"_field?.icon\"\r\n (onChange)=\"onChange($event)\" [internationalNumber]=\"_field?.internationalNumber\"\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [maxLength]=\"_field?.maxLength\" [formControl]=\"_form.controls[_field?.name]\" #inputElement>\r\n</monkey-input-phone>", components: [{ type: i1$2.MonkeyInputPhoneComponent, selector: "monkey-input-phone", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "maxLength", "internationalNumber", "value"], outputs: ["onChange"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicInputPhoneComponent, decorators: [{
898
+ type: Component,
899
+ args: [{ selector: 'mecx-dynamic-input-phone', encapsulation: ViewEncapsulation.None, template: "<monkey-input-phone [name]=\"_field?.name\" [label]=\"_field?.label | translate\"\r\n [helperMessage]=\"_field?.helperMessage | translate\"\r\n [placeholder]=\"_field?.placeholder | translate\" [icon]=\"_field?.icon\"\r\n (onChange)=\"onChange($event)\" [internationalNumber]=\"_field?.internationalNumber\"\r\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\r\n [maxLength]=\"_field?.maxLength\" [formControl]=\"_form.controls[_field?.name]\" #inputElement>\r\n</monkey-input-phone>" }]
900
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { _field: [{
901
+ type: Input
902
+ }], _form: [{
903
+ type: Input
904
+ }], _formErrors: [{
905
+ type: Input
906
+ }], self: [{
907
+ type: Input
908
+ }], inputElement: [{
909
+ type: ViewChild,
910
+ args: ['inputElement', {
911
+ static: true
912
+ }]
913
+ }], className: [{
914
+ type: HostBinding,
915
+ args: ['class']
916
+ }] } });
917
+
918
+ class MECXDynamicRadioComponent {
919
+ constructor() {
920
+ this._field = null;
921
+ this._form = null;
922
+ // eslint-disable-next-line object-curly-newline
923
+ this._formErrors = {};
924
+ }
925
+ get className() {
926
+ var _a, _b;
927
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
928
+ }
929
+ }
930
+ MECXDynamicRadioComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
931
+ MECXDynamicRadioComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicRadioComponent, selector: "mecx-dynamic-radio", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<monkey-radiobutton\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\">\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-radiobutton>", components: [{ type: i1$2.MonkeyRadioButtonComponent, selector: "monkey-radiobutton", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "value"], outputs: ["onChange"] }, { type: i1$2.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
932
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicRadioComponent, decorators: [{
933
+ type: Component,
934
+ args: [{ selector: 'mecx-dynamic-radio', encapsulation: ViewEncapsulation.None, template: "<monkey-radiobutton\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\">\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-radiobutton>" }]
935
+ }], propDecorators: { _field: [{
936
+ type: Input
937
+ }], _form: [{
938
+ type: Input
939
+ }], _formErrors: [{
940
+ type: Input
941
+ }], className: [{
942
+ type: HostBinding,
943
+ args: ['class']
944
+ }] } });
945
+
946
+ class MECXDynamicSelectComponent {
947
+ constructor() {
948
+ this._field = null;
949
+ this._form = null;
950
+ // eslint-disable-next-line object-curly-newline
951
+ this._formErrors = {};
952
+ this._onHandleOptions = new EventEmitter();
953
+ }
954
+ get className() {
955
+ var _a, _b;
956
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
957
+ }
958
+ onHandleGenericLoad() {
959
+ var _a, _b, _c;
960
+ const { _form, _field, self } = this;
961
+ if ((_form === null || _form === void 0 ? void 0 : _form.disabled) || !_field || !((_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onHandleGenericLoad))
962
+ return;
963
+ const { name } = _field;
964
+ if ((_b = _field === null || _field === void 0 ? void 0 : _field.value) === null || _b === void 0 ? void 0 : _b.length)
965
+ return;
966
+ const { func, url } = (_c = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _c === void 0 ? void 0 : _c.onHandleGenericLoad;
967
+ if (!func || !self[func]) {
968
+ console.error('onHandleGenericLoad not declared');
969
+ return;
970
+ }
971
+ _form === null || _form === void 0 ? void 0 : _form.disable();
972
+ self[func]({
973
+ name,
974
+ url,
975
+ form: _form,
976
+ callback: (data) => {
977
+ var _a;
978
+ if (this._field) {
979
+ this._field.value = data;
980
+ }
981
+ (_a = this._form) === null || _a === void 0 ? void 0 : _a.enable();
982
+ this._onHandleOptions.next(null);
983
+ }
984
+ });
985
+ }
986
+ onChange(event) {
987
+ var _a, _b, _c;
988
+ const { _form, _field, self } = this;
989
+ if (!_field || !_form)
990
+ return;
991
+ const { name } = _field;
992
+ const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
993
+ const isValid = (_b = _form === null || _form === void 0 ? void 0 : _form.get(_field.name)) === null || _b === void 0 ? void 0 : _b.valid;
994
+ if (func) {
995
+ self[func]({
996
+ name,
997
+ isValid,
998
+ event,
999
+ ctrl: _form === null || _form === void 0 ? void 0 : _form.get((_c = this._field) === null || _c === void 0 ? void 0 : _c.name),
1000
+ form: _form,
1001
+ value: _field.value
1002
+ });
1003
+ }
1004
+ }
1005
+ }
1006
+ MECXDynamicSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1007
+ MECXDynamicSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicSelectComponent, selector: "mecx-dynamic-select", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<monkey-select\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select>", components: [{ type: i1$2.MonkeySelectComponent, selector: "monkey-select", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "onHandleOptions", "value"], outputs: ["onChange"] }, { type: i1$2.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicSelectComponent, decorators: [{
1009
+ type: Component,
1010
+ args: [{ selector: 'mecx-dynamic-select', encapsulation: ViewEncapsulation.None, template: "<monkey-select\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select>" }]
1011
+ }], propDecorators: { _field: [{
1012
+ type: Input
1013
+ }], _form: [{
1014
+ type: Input
1015
+ }], _formErrors: [{
1016
+ type: Input
1017
+ }], self: [{
1018
+ type: Input
1019
+ }], className: [{
1020
+ type: HostBinding,
1021
+ args: ['class']
1022
+ }] } });
1023
+
1024
+ class MECXDynamicSelectSearchComponent {
1025
+ constructor() {
1026
+ this._field = null;
1027
+ this._form = null;
1028
+ // eslint-disable-next-line object-curly-newline
1029
+ this._formErrors = {};
1030
+ this._onHandleOptions = new EventEmitter();
1031
+ }
1032
+ get className() {
1033
+ var _a, _b;
1034
+ return (_b = (_a = this._field) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.class;
1035
+ }
1036
+ onHandleGenericLoad() {
1037
+ var _a, _b;
1038
+ const { _form, _field, self } = this;
1039
+ if ((_form === null || _form === void 0 ? void 0 : _form.disabled) || !_field || !((_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onHandleGenericLoad))
1040
+ return;
1041
+ const { name } = _field;
1042
+ const { func, url } = ((_b = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _b === void 0 ? void 0 : _b.onHandleGenericLoad) || {
1043
+ func: null, url: ''
1044
+ };
1045
+ if (!func || !self[func]) {
1046
+ console.error('onHandleGenericLoad not declared');
1047
+ return;
1048
+ }
1049
+ _form === null || _form === void 0 ? void 0 : _form.disable();
1050
+ self[func]({
1051
+ name,
1052
+ url,
1053
+ form: _form,
1054
+ callback: (data) => {
1055
+ var _a;
1056
+ if (this._field) {
1057
+ this._field.value = data;
1058
+ }
1059
+ (_a = this._form) === null || _a === void 0 ? void 0 : _a.enable();
1060
+ this._onHandleOptions.next(null);
1061
+ }
1062
+ });
1063
+ }
1064
+ onChange(event) {
1065
+ var _a, _b, _c;
1066
+ const { _form, _field, self } = this;
1067
+ if (!_field || !_form)
1068
+ return;
1069
+ const { name } = _field;
1070
+ const func = (_a = _field === null || _field === void 0 ? void 0 : _field.functions) === null || _a === void 0 ? void 0 : _a.onChange;
1071
+ const isValid = (_b = _form === null || _form === void 0 ? void 0 : _form.get(_field === null || _field === void 0 ? void 0 : _field.name)) === null || _b === void 0 ? void 0 : _b.valid;
1072
+ if (func) {
1073
+ self[func]({
1074
+ name,
1075
+ isValid,
1076
+ event,
1077
+ ctrl: _form.get((_c = this._field) === null || _c === void 0 ? void 0 : _c.name),
1078
+ form: _form,
1079
+ value: _field.value
1080
+ });
1081
+ }
1082
+ }
1083
+ }
1084
+ MECXDynamicSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicSelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1085
+ MECXDynamicSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicSelectSearchComponent, selector: "mecx-dynamic-select-search", inputs: { _field: "_field", _form: "_form", _formErrors: "_formErrors", self: "self" }, host: { properties: { "class": "this.className" } }, ngImport: i0, template: "<monkey-select-search\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [fieldToCompare]=\"_field?.fieldToCompare\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select-search>", components: [{ type: i1$2.MonkeySelectSearchComponent, selector: "monkey-select-search", inputs: ["label", "helperMessage", "placeholder", "icon", "infoMessage", "errorMessage", "labelSelect", "fieldToCompare", "onHandleOptions", "value"], outputs: ["onChange", "onSearch"] }, { type: i1$2.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1086
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicSelectSearchComponent, decorators: [{
1087
+ type: Component,
1088
+ args: [{ selector: 'mecx-dynamic-select-search', encapsulation: ViewEncapsulation.None, template: "<monkey-select-search\n errorMessage=\"{{ _formErrors[_field?.name]?.firstMessage | translate }} {{ _formErrors[_field?.name]?.lastMessage }}\"\n [formControl]=\"_form.controls[_field?.name]\" [helperMessage]=\"_field?.helperMessage | translate\"\n [label]=\"_field?.label | translate\" (click)=\"onHandleGenericLoad()\"\n [onHandleOptions]=\"_onHandleOptions\" (onChange)=\"onChange($event)\"\n [fieldToCompare]=\"_field?.fieldToCompare\"\n [labelSelect]=\"_form.get(_field?.name).value || ('FIELD.SELECT' | translate)\"\n [placeholder]=\"_field?.placeholder | translate\">\n <monkey-option [label]=\"'FIELD.LOADING' | translate\" *ngIf=\"!_field?.value?.length\"\n enableClick=\"false\">\n </monkey-option>\n <monkey-option *ngFor=\"let value of _field?.value\" [label]=\"value.description | translate\"\n [value]=\"value.value\">\n </monkey-option>\n</monkey-select-search>" }]
1089
+ }], propDecorators: { _field: [{
1090
+ type: Input
1091
+ }], _form: [{
1092
+ type: Input
1093
+ }], _formErrors: [{
1094
+ type: Input
1095
+ }], self: [{
1096
+ type: Input
1097
+ }], className: [{
1098
+ type: HostBinding,
1099
+ args: ['class']
1100
+ }] } });
1101
+
1102
+ const componentMapper = {
1103
+ input: MECXDynamicInputComponent,
1104
+ 'input-phone': MECXDynamicInputPhoneComponent,
1105
+ radiobutton: MECXDynamicRadioComponent,
1106
+ select: MECXDynamicSelectComponent,
1107
+ 'select-search': MECXDynamicSelectSearchComponent,
1108
+ 'file-upload': MECXDynamicFileUploadComponent,
1109
+ button: MECXDynamicButtonComponent
1110
+ };
1111
+ class MECXDynamicDirective {
1112
+ constructor(resolver, container, cdr) {
1113
+ this.resolver = resolver;
1114
+ this.container = container;
1115
+ this.cdr = cdr;
1116
+ this.field = null;
1117
+ this.form = null;
1118
+ // not to do
1119
+ }
1120
+ handleInternalPlusValidation() {
1121
+ var _a, _b, _c, _d;
1122
+ if (!((_a = this.field) === null || _a === void 0 ? void 0 : _a.alwaysShowPlusValidation))
1123
+ return false;
1124
+ const { operator, value, field } = (_b = this.field) === null || _b === void 0 ? void 0 : _b.alwaysShowPlusValidation;
1125
+ const validators = {
1126
+ e: (val1, val2) => { return val1 === val2; },
1127
+ lt: (val1, val2) => { return val1 < val2; },
1128
+ gt: (val1, val2) => { return val1 > val2; }
1129
+ };
1130
+ const data = (_d = (_c = this.form) === null || _c === void 0 ? void 0 : _c.controls[field]) === null || _d === void 0 ? void 0 : _d.value;
1131
+ return validators[operator](data, value);
1132
+ }
1133
+ buildComponent() {
1134
+ var _a, _b;
1135
+ if ((_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.instance)
1136
+ return;
1137
+ const factory = this.resolver.resolveComponentFactory(componentMapper[(_b = this.field) === null || _b === void 0 ? void 0 : _b.fieldType]);
1138
+ this.componentRef = this.container.createComponent(factory);
1139
+ this.componentRef.instance._field = this.field;
1140
+ this.componentRef.instance._form = this.form;
1141
+ // eslint-disable-next-line object-curly-newline
1142
+ this.componentRef.instance._formErrors = this.formErrors || {};
1143
+ this.componentRef.instance.self = this.self;
1144
+ }
1145
+ ngOnInit() {
1146
+ var _a;
1147
+ if (!((_a = this.field) === null || _a === void 0 ? void 0 : _a.alwaysShow) && !this.handleInternalPlusValidation())
1148
+ return;
1149
+ this.buildComponent();
1150
+ }
1151
+ ngOnChanges() {
1152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1153
+ if (this.plusValidations && this.plusValidations[(_a = this.field) === null || _a === void 0 ? void 0 : _a.name]) {
1154
+ if (!((_b = this.field) === null || _b === void 0 ? void 0 : _b.alwaysShow) && this.plusValidations[(_c = this.field) === null || _c === void 0 ? void 0 : _c.name].alwaysShow) {
1155
+ setTimeout(() => {
1156
+ this.buildComponent();
1157
+ this.cdr.detectChanges();
1158
+ }, 1);
1159
+ }
1160
+ if (((_d = this.componentRef) === null || _d === void 0 ? void 0 : _d.instance) &&
1161
+ !this.plusValidations[(_e = this.field) === null || _e === void 0 ? void 0 : _e.name].alwaysShow) {
1162
+ this.componentRef.destroy();
1163
+ this.componentRef = null;
1164
+ (_h = (_f = this.form) === null || _f === void 0 ? void 0 : _f.controls[(_g = this.field) === null || _g === void 0 ? void 0 : _g.name]) === null || _h === void 0 ? void 0 : _h.setValue(null);
1165
+ (_l = (_j = this.form) === null || _j === void 0 ? void 0 : _j.controls[(_k = this.field) === null || _k === void 0 ? void 0 : _k.name]) === null || _l === void 0 ? void 0 : _l.clearValidators();
1166
+ }
1167
+ }
1168
+ if (!((_m = this.componentRef) === null || _m === void 0 ? void 0 : _m.instance))
1169
+ return;
1170
+ this.componentRef.instance._formErrors = this.formErrors || {};
1171
+ }
1172
+ }
1173
+ MECXDynamicDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicDirective, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1174
+ MECXDynamicDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: { field: "field", form: "form", formErrors: "formErrors", self: "self", plusValidations: "plusValidations" }, usesOnChanges: true, ngImport: i0 });
1175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicDirective, decorators: [{
1176
+ type: Directive,
1177
+ args: [{
1178
+ selector: '[MECXDynamic]'
1179
+ }]
1180
+ }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { field: [{
1181
+ type: Input
1182
+ }], form: [{
1183
+ type: Input
1184
+ }], formErrors: [{
1185
+ type: Input
1186
+ }], self: [{
1187
+ type: Input
1188
+ }], plusValidations: [{
1189
+ type: Input
1190
+ }] } });
1191
+
1192
+ class MECXDynamicFormComponent extends BaseDynamic {
1193
+ constructor(fb, cdr) {
1194
+ super(fb);
1195
+ this.cdr = cdr;
1196
+ this.unsubscribeAll = new Subject();
1197
+ }
1198
+ ngOnInit() {
1199
+ super.ngOnInit();
1200
+ this.onHandleSubmit.pipe(takeUntil(this.unsubscribeAll)).subscribe((func) => {
1201
+ this.onSubmit(func);
1202
+ });
1203
+ }
1204
+ ngOnDestroy() {
1205
+ this.unsubscribeAll.next();
1206
+ this.unsubscribeAll.complete();
1207
+ }
1208
+ onSubmit(callback) {
1209
+ const { _form } = this;
1210
+ // eslint-disable-next-line object-curly-newline
1211
+ this.__monkeyecxFormErrors = {};
1212
+ const isValid = this.validateForm(_form);
1213
+ this.cdr.detectChanges();
1214
+ this.onHandleSubmitFormReady.next({
1215
+ validate: {
1216
+ isValid
1217
+ },
1218
+ callback,
1219
+ form: _form
1220
+ });
1221
+ }
1222
+ }
1223
+ MECXDynamicFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFormComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1224
+ MECXDynamicFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicFormComponent, selector: "mecx-dynamic-form", usesInheritance: true, ngImport: i0, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div class=\"row\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"_form\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors\" [style.display]=\"'none'\">\n </div>\n </div>\n</form>", directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], encapsulation: i0.ViewEncapsulation.None });
1225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFormComponent, decorators: [{
1226
+ type: Component,
1227
+ args: [{ selector: 'mecx-dynamic-form', styles: [], encapsulation: ViewEncapsulation.None, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div class=\"row\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"_form\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors\" [style.display]=\"'none'\">\n </div>\n </div>\n</form>" }]
1228
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; } });
1229
+
1230
+ class MECXDynamicFormArrayComponent extends BaseDynamicArray {
1231
+ constructor(fb, cdr) {
1232
+ super(fb);
1233
+ this.cdr = cdr;
1234
+ this.unsubscribeAll = new Subject();
1235
+ this.__monkeyecxFormErrors = [];
1236
+ }
1237
+ ngOnInit() {
1238
+ super.ngOnInit();
1239
+ this.onHandleSubmit.pipe(takeUntil(this.unsubscribeAll)).subscribe((func) => {
1240
+ this.onSubmit(func);
1241
+ });
1242
+ }
1243
+ ngOnDestroy() {
1244
+ this.unsubscribeAll.next();
1245
+ this.unsubscribeAll.complete();
1246
+ }
1247
+ onSubmit(callback) {
1248
+ const { _form } = this;
1249
+ // eslint-disable-next-line object-curly-newline
1250
+ this.__monkeyecxFormErrors = [];
1251
+ let validate = {
1252
+ isValid: false
1253
+ };
1254
+ let hasErrors = false;
1255
+ if (this.formValues) {
1256
+ this.__monkeyecxFormErrors = [this.formValues.length];
1257
+ this.formValues.controls.forEach((item, index) => {
1258
+ if (item instanceof FormGroup) {
1259
+ if (!this.validateForm(item, index)) {
1260
+ hasErrors = true;
1261
+ }
1262
+ }
1263
+ });
1264
+ }
1265
+ validate = {
1266
+ isValid: !hasErrors
1267
+ };
1268
+ this.cdr.detectChanges();
1269
+ this.onHandleSubmitFormReady.next({
1270
+ validate,
1271
+ callback,
1272
+ form: _form
1273
+ });
1274
+ }
1275
+ onHandleAdd() {
1276
+ var _a;
1277
+ (_a = this.formValues) === null || _a === void 0 ? void 0 : _a.push(this.formBase());
1278
+ this.cdr.detectChanges();
1279
+ }
1280
+ onHandleRemove(index) {
1281
+ var _a;
1282
+ (_a = this.formValues) === null || _a === void 0 ? void 0 : _a.removeAt(index);
1283
+ this._plusValidations.splice(index, 1);
1284
+ }
1285
+ }
1286
+ MECXDynamicFormArrayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFormArrayComponent, deps: [{ token: i1.FormBuilder }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1287
+ MECXDynamicFormArrayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXDynamicFormArrayComponent, selector: "mecx-dynamic-form-array", usesInheritance: true, ngImport: i0, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div formArrayName=\"fields\">\n <div *ngFor=\"let item of formValues.controls; let indForm=index\" [formGroupName]=\"indForm\">\n <monkey-button type=\"secondary\" color=\"error\" icon=\"close-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.REMOVE' | translate\" (click)=\"onHandleRemove(indForm)\"\n *ngIf=\"formValues.controls.length > 1 && !disabled\">\n </monkey-button>\n <div class=\"row mt-3\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"item\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\" [style.display]=\"'none'\">\n </div>\n </div>\n </div>\n </div>\n</form>\n<monkey-button type=\"secondary\" color=\"theme\" icon=\"more-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.ADD' | translate\" (click)=\"onHandleAdd()\" *ngIf=\"!disabled\">\n</monkey-button>", styles: ["mecx-dynamic-form-array monkey-button{width:100%}mecx-dynamic-form-array monkey-button button{width:100%;height:40px}\n"], components: [{ type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { type: MECXDynamicDirective, selector: "[MECXDynamic]", inputs: ["field", "form", "formErrors", "self", "plusValidations"] }], pipes: { "translate": i1$3.TranslatePipe }, encapsulation: i0.ViewEncapsulation.None });
1288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicFormArrayComponent, decorators: [{
1289
+ type: Component,
1290
+ args: [{ selector: 'mecx-dynamic-form-array', encapsulation: ViewEncapsulation.None, template: "<form name=\"form\" [formGroup]=\"_form\" *ngIf=\"_form\">\n <div formArrayName=\"fields\">\n <div *ngFor=\"let item of formValues.controls; let indForm=index\" [formGroupName]=\"indForm\">\n <monkey-button type=\"secondary\" color=\"error\" icon=\"close-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.REMOVE' | translate\" (click)=\"onHandleRemove(indForm)\"\n *ngIf=\"formValues.controls.length > 1 && !disabled\">\n </monkey-button>\n <div class=\"row mt-3\">\n <div *ngFor=\"let field of fields;\" MECXDynamic [field]=\"field\" [form]=\"item\" [self]=\"self\"\n [formErrors]=\"__monkeyecxFormErrors[indForm]\"\n [plusValidations]=\"_plusValidations[indForm]\" [style.display]=\"'none'\">\n </div>\n </div>\n </div>\n </div>\n</form>\n<monkey-button type=\"secondary\" color=\"theme\" icon=\"more-20\" iconPosition=\"right\"\n [label]=\"'BUTTONS.ADD' | translate\" (click)=\"onHandleAdd()\" *ngIf=\"!disabled\">\n</monkey-button>", styles: ["mecx-dynamic-form-array monkey-button{width:100%}mecx-dynamic-form-array monkey-button button{width:100%;height:40px}\n"] }]
1291
+ }], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i0.ChangeDetectorRef }]; } });
1292
+
1293
+ class MECXDynamicModule {
1294
+ }
1295
+ MECXDynamicModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1296
+ MECXDynamicModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicModule, declarations: [MECXDynamicButtonComponent,
1297
+ MECXDynamicFileUploadComponent,
1298
+ MECXDynamicFormComponent,
1299
+ MECXDynamicFormArrayComponent,
1300
+ MECXDynamicInputComponent,
1301
+ MECXDynamicInputPhoneComponent,
1302
+ MECXDynamicRadioComponent,
1303
+ MECXDynamicSelectComponent,
1304
+ MECXDynamicSelectSearchComponent,
1305
+ MECXDynamicDirective], imports: [CommonModule,
1306
+ FormsModule,
1307
+ ReactiveFormsModule,
1308
+ MonkeyInputModule,
1309
+ MonkeySelectModule,
1310
+ MonkeyRadioButtonModule,
1311
+ MonkeyOptionModule,
1312
+ MonkeyFileUploadModule,
1313
+ MonkeyButtonModule,
1314
+ MonkeyInputPhoneModule, i1$3.TranslateModule], exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent] });
1315
+ MECXDynamicModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicModule, imports: [[
1316
+ CommonModule,
1317
+ FormsModule,
1318
+ ReactiveFormsModule,
1319
+ MonkeyInputModule,
1320
+ MonkeySelectModule,
1321
+ MonkeyRadioButtonModule,
1322
+ MonkeyOptionModule,
1323
+ MonkeyFileUploadModule,
1324
+ MonkeyButtonModule,
1325
+ MonkeyInputPhoneModule,
1326
+ TranslateModule.forChild()
1327
+ ]] });
1328
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXDynamicModule, decorators: [{
1329
+ type: NgModule,
1330
+ args: [{
1331
+ declarations: [
1332
+ MECXDynamicButtonComponent,
1333
+ MECXDynamicFileUploadComponent,
1334
+ MECXDynamicFormComponent,
1335
+ MECXDynamicFormArrayComponent,
1336
+ MECXDynamicInputComponent,
1337
+ MECXDynamicInputPhoneComponent,
1338
+ MECXDynamicRadioComponent,
1339
+ MECXDynamicSelectComponent,
1340
+ MECXDynamicSelectSearchComponent,
1341
+ MECXDynamicDirective
1342
+ ],
1343
+ imports: [
1344
+ CommonModule,
1345
+ FormsModule,
1346
+ ReactiveFormsModule,
1347
+ MonkeyInputModule,
1348
+ MonkeySelectModule,
1349
+ MonkeyRadioButtonModule,
1350
+ MonkeyOptionModule,
1351
+ MonkeyFileUploadModule,
1352
+ MonkeyButtonModule,
1353
+ MonkeyInputPhoneModule,
1354
+ TranslateModule.forChild()
1355
+ ],
1356
+ exports: [MECXDynamicDirective, MECXDynamicFormComponent, MECXDynamicFormArrayComponent],
1357
+ entryComponents: [MECXDynamicInputComponent]
1358
+ }]
1359
+ }] });
1360
+
1361
+ class MECXFilterSelectedItemDateWithActionComponent {
1362
+ constructor() {
1363
+ this.option = null;
1364
+ this._date = '';
1365
+ }
1366
+ onHandleSelectedValue({ field, getValue }) {
1367
+ var _a;
1368
+ const value = (_a = getValue()) === null || _a === void 0 ? void 0 : _a[field];
1369
+ if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
1370
+ this._date = value;
1371
+ }
1372
+ }
1373
+ ngOnChanges(changes) {
1374
+ if (changes.option) {
1375
+ const { currentValue } = changes.option;
1376
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1377
+ this.onHandleSelectedValue(currentValue);
1378
+ }
1379
+ }
1380
+ }
1381
+ }
1382
+ MECXFilterSelectedItemDateWithActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemDateWithActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1383
+ MECXFilterSelectedItemDateWithActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemDateWithActionComponent, selector: "mecx-filter-selected-item-date-with-action", inputs: { option: "option" }, usesOnChanges: true, ngImport: i0, template: "{{ _date | monkeyecxFormatDateTimelapse: false }}", styles: [""], pipes: { "monkeyecxFormatDateTimelapse": i1$4.MonkeyEcxFormatDateTimelapsePipe } });
1384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemDateWithActionComponent, decorators: [{
1385
+ type: Component,
1386
+ args: [{ selector: 'mecx-filter-selected-item-date-with-action', template: "{{ _date | monkeyecxFormatDateTimelapse: false }}", styles: [""] }]
1387
+ }], propDecorators: { option: [{
1388
+ type: Input
1389
+ }] } });
1390
+
1391
+ class MECXFilterSelectedItemDateRangeComponent {
1392
+ constructor() {
1393
+ this.option = null;
1394
+ this._startDate = '';
1395
+ this._endDate = '';
1396
+ }
1397
+ onHandleSelectedValue({ field, value, getValue }) {
1398
+ var _a;
1399
+ try {
1400
+ value = value || ((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
1401
+ if (value && JSON.stringify(value) !== '{}') {
1402
+ const objDates = JSON.parse(value);
1403
+ this._startDate = objDates === null || objDates === void 0 ? void 0 : objDates.startDate;
1404
+ this._endDate = objDates === null || objDates === void 0 ? void 0 : objDates.endDate;
1405
+ }
1406
+ }
1407
+ catch (e) {
1408
+ const objDates = JSON.parse(value === null || value === void 0 ? void 0 : value.dates);
1409
+ this._startDate = objDates === null || objDates === void 0 ? void 0 : objDates.startDate;
1410
+ this._endDate = objDates === null || objDates === void 0 ? void 0 : objDates.endDate;
1411
+ }
1412
+ }
1413
+ ngOnChanges(changes) {
1414
+ if (changes.option) {
1415
+ const { currentValue } = changes.option;
1416
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1417
+ this.onHandleSelectedValue(currentValue);
1418
+ }
1419
+ }
1420
+ }
1421
+ }
1422
+ MECXFilterSelectedItemDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1423
+ MECXFilterSelectedItemDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemDateRangeComponent, selector: "mecx-filter-selected-item-date-range", inputs: { option: "option" }, usesOnChanges: true, ngImport: i0, template: "{{ _startDate | monkeyecxFormatDateTimelapse: false }} -\n{{ _endDate | monkeyecxFormatDateTimelapse: false }}", styles: [""], pipes: { "monkeyecxFormatDateTimelapse": i1$4.MonkeyEcxFormatDateTimelapsePipe } });
1424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemDateRangeComponent, decorators: [{
1425
+ type: Component,
1426
+ args: [{ selector: 'mecx-filter-selected-item-date-range', template: "{{ _startDate | monkeyecxFormatDateTimelapse: false }} -\n{{ _endDate | monkeyecxFormatDateTimelapse: false }}", styles: [""] }]
1427
+ }], propDecorators: { option: [{
1428
+ type: Input
1429
+ }] } });
1430
+
1431
+ class MECXFilterSelectedItemChildrenComponent {
1432
+ constructor(elRef) {
1433
+ this.elRef = elRef;
1434
+ this.option = null;
1435
+ this.onShow = new EventEmitter();
1436
+ this.onRemove = new EventEmitter();
1437
+ this._child = null;
1438
+ // not to do
1439
+ }
1440
+ validateValue(value) {
1441
+ if (!value)
1442
+ return false;
1443
+ if (typeof value === 'object') {
1444
+ return value && JSON.stringify(value) !== '{}';
1445
+ }
1446
+ return MonkeyEcxUtils.persistNullEmptyUndefined(value);
1447
+ }
1448
+ onHandleSelectedValue({ children }) {
1449
+ const found = children.find(({ field, getValue }) => {
1450
+ var _a;
1451
+ return this.validateValue((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
1452
+ });
1453
+ if (!found) {
1454
+ this.elRef.nativeElement.remove();
1455
+ return;
1456
+ }
1457
+ this._child = found;
1458
+ }
1459
+ ngOnChanges(changes) {
1460
+ if (changes.option) {
1461
+ const { currentValue } = changes.option;
1462
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1463
+ this.onHandleSelectedValue(currentValue);
1464
+ }
1465
+ }
1466
+ }
1467
+ }
1468
+ MECXFilterSelectedItemChildrenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemChildrenComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1469
+ MECXFilterSelectedItemChildrenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemChildrenComponent, selector: "mecx-filter-selected-item-children", inputs: { option: "option" }, outputs: { onShow: "onShow", onRemove: "onRemove" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"box\">\n <div class=\"data\">\n {{ option.label | translate }}\n </div>\n <div class=\"value\" [id]=\"'mecx-filter-selected-item-'+option?.field\" (click)=\"onShow.next()\">\n <ng-container *ngIf=\"option?.type as type\">\n <ng-container [ngSwitch]=\"type+'-'+_child?.type\">\n <mecx-filter-selected-item-date-with-action *ngSwitchCase=\"'date-with-action'\"\n [option]=\"_child\">\n </mecx-filter-selected-item-date-with-action>\n <mecx-filter-selected-item-date-range *ngSwitchCase=\"'date-date-range'\" [option]=\"_child\">\n </mecx-filter-selected-item-date-range>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"action\" (click)=\"onShow.next()\">\n <monkey-icon icon=\"arrow-right-14\" color=\"#4B4A53\"></monkey-icon>\n </div>\n</div>", styles: [":host{display:flex}:host .box{display:flex;justify-content:space-between;align-items:center;background:#ffffff;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:120px;height:40px}:host .box .data{display:flex;align-items:center;padding-left:12px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e}:host .box .value{cursor:pointer;display:flex;align-items:center;padding:12px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e;background-color:#6d6d6d0a}:host .box .value:hover{background-color:#6d6d6d0c;font-weight:400;text-decoration:underline}:host .box .action{cursor:pointer;border-left:1px solid #d6d6d6;padding:12px;color:#908e9d;font-weight:500;font-size:18px;height:40px;align-items:center;display:flex}:host .box .action:hover{background-color:#6d6d6d0c;border-top-right-radius:120px;border-bottom-right-radius:120px}\n"], components: [{ type: MECXFilterSelectedItemDateWithActionComponent, selector: "mecx-filter-selected-item-date-with-action", inputs: ["option"] }, { type: MECXFilterSelectedItemDateRangeComponent, selector: "mecx-filter-selected-item-date-range", inputs: ["option"] }, { type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], pipes: { "translate": i1$3.TranslatePipe } });
1470
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemChildrenComponent, decorators: [{
1471
+ type: Component,
1472
+ args: [{ selector: 'mecx-filter-selected-item-children', template: "<div class=\"box\">\n <div class=\"data\">\n {{ option.label | translate }}\n </div>\n <div class=\"value\" [id]=\"'mecx-filter-selected-item-'+option?.field\" (click)=\"onShow.next()\">\n <ng-container *ngIf=\"option?.type as type\">\n <ng-container [ngSwitch]=\"type+'-'+_child?.type\">\n <mecx-filter-selected-item-date-with-action *ngSwitchCase=\"'date-with-action'\"\n [option]=\"_child\">\n </mecx-filter-selected-item-date-with-action>\n <mecx-filter-selected-item-date-range *ngSwitchCase=\"'date-date-range'\" [option]=\"_child\">\n </mecx-filter-selected-item-date-range>\n </ng-container>\n </ng-container>\n </div>\n <div class=\"action\" (click)=\"onShow.next()\">\n <monkey-icon icon=\"arrow-right-14\" color=\"#4B4A53\"></monkey-icon>\n </div>\n</div>", styles: [":host{display:flex}:host .box{display:flex;justify-content:space-between;align-items:center;background:#ffffff;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:120px;height:40px}:host .box .data{display:flex;align-items:center;padding-left:12px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e}:host .box .value{cursor:pointer;display:flex;align-items:center;padding:12px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e;background-color:#6d6d6d0a}:host .box .value:hover{background-color:#6d6d6d0c;font-weight:400;text-decoration:underline}:host .box .action{cursor:pointer;border-left:1px solid #d6d6d6;padding:12px;color:#908e9d;font-weight:500;font-size:18px;height:40px;align-items:center;display:flex}:host .box .action:hover{background-color:#6d6d6d0c;border-top-right-radius:120px;border-bottom-right-radius:120px}\n"] }]
1473
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { option: [{
1474
+ type: Input
1475
+ }], onShow: [{
1476
+ type: Output
1477
+ }], onRemove: [{
1478
+ type: Output
1479
+ }] } });
1480
+
1481
+ class MECXFilterSelectedItemCurrencyComponent {
1482
+ constructor() {
1483
+ this.option = null;
1484
+ this._value = null;
1485
+ }
1486
+ onHandleSelectedValue({ value }) {
1487
+ this._value = value;
1488
+ }
1489
+ ngOnChanges(changes) {
1490
+ if (changes.option) {
1491
+ const { currentValue } = changes.option;
1492
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1493
+ this.onHandleSelectedValue(currentValue);
1494
+ }
1495
+ }
1496
+ }
1497
+ }
1498
+ MECXFilterSelectedItemCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1499
+ MECXFilterSelectedItemCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemCurrencyComponent, selector: "mecx-filter-selected-item-currency", inputs: { option: "option" }, usesOnChanges: true, ngImport: i0, template: "{{ _value | monkeyecxFormatCurrency }}", styles: [""], pipes: { "monkeyecxFormatCurrency": i1$4.MonkeyEcxFormatCurrencyPipe } });
1500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemCurrencyComponent, decorators: [{
1501
+ type: Component,
1502
+ args: [{ selector: 'mecx-filter-selected-item-currency', template: "{{ _value | monkeyecxFormatCurrency }}", styles: [""] }]
1503
+ }], propDecorators: { option: [{
1504
+ type: Input
1505
+ }] } });
1506
+
1507
+ class MECXFilterSelectedItemInputComponent {
1508
+ constructor() {
1509
+ this.option = null;
1510
+ this._value = null;
1511
+ }
1512
+ onHandleSelectedValue({ value }) {
1513
+ this._value = value;
1514
+ }
1515
+ ngOnChanges(changes) {
1516
+ if (changes.option) {
1517
+ const { currentValue } = changes.option;
1518
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1519
+ this.onHandleSelectedValue(currentValue);
1520
+ }
1521
+ }
1522
+ }
1523
+ }
1524
+ MECXFilterSelectedItemInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1525
+ MECXFilterSelectedItemInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemInputComponent, selector: "mecx-filter-selected-item-input", inputs: { option: "option" }, usesOnChanges: true, ngImport: i0, template: "{{ _value }}", styles: [""] });
1526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemInputComponent, decorators: [{
1527
+ type: Component,
1528
+ args: [{ selector: 'mecx-filter-selected-item-input', template: "{{ _value }}", styles: [""] }]
1529
+ }], propDecorators: { option: [{
1530
+ type: Input
1531
+ }] } });
1532
+
1533
+ class MECXFilterSelectedItemStatusComponent {
1534
+ constructor() {
1535
+ this.option = null;
1536
+ this._selectedValue = '';
1537
+ this._labelMoreValues = '';
1538
+ }
1539
+ onHandleSelectedValue({ value, i18n }) {
1540
+ const { labelMoreValues } = this;
1541
+ const selected = `${value}`.split(',');
1542
+ this._selectedValue = `${i18n}${selected[0]}`.trim();
1543
+ if (selected.length >= 2) {
1544
+ this._labelMoreValues = `, ${labelMoreValues} ${selected.length - 1}`;
1545
+ }
1546
+ else
1547
+ this._labelMoreValues = '';
1548
+ }
1549
+ ngOnChanges(changes) {
1550
+ if (changes.option) {
1551
+ const { currentValue } = changes.option;
1552
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1553
+ this.onHandleSelectedValue(currentValue);
1554
+ }
1555
+ }
1556
+ }
1557
+ }
1558
+ MECXFilterSelectedItemStatusComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1559
+ MECXFilterSelectedItemStatusComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemStatusComponent, selector: "mecx-filter-selected-item-status", inputs: { option: "option", labelMoreValues: "labelMoreValues" }, usesOnChanges: true, ngImport: i0, template: "{{ _selectedValue | translate }}{{ _labelMoreValues }}", styles: [""], pipes: { "translate": i1$3.TranslatePipe } });
1560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemStatusComponent, decorators: [{
1561
+ type: Component,
1562
+ args: [{ selector: 'mecx-filter-selected-item-status', template: "{{ _selectedValue | translate }}{{ _labelMoreValues }}", styles: [""] }]
1563
+ }], propDecorators: { option: [{
1564
+ type: Input
1565
+ }], labelMoreValues: [{
1566
+ type: Input
1567
+ }] } });
1568
+
1569
+ class MECXFilterOptionsChildrenComponent {
1570
+ constructor() {
1571
+ this.option = null;
1572
+ this.onSubmit = new EventEmitter();
1573
+ this.onShow = new EventEmitter();
1574
+ this.eventHandle = new EventEmitter();
1575
+ // not to do
1576
+ }
1577
+ ngOnInit() {
1578
+ const { eventHandle, onSubmit, option: { field } } = this;
1579
+ this.eventSubscription = eventHandle.pipe(debounceTime(100)).subscribe((value) => {
1580
+ onSubmit.next({ [field]: value });
1581
+ });
1582
+ }
1583
+ ngOnDestroy() {
1584
+ this.eventSubscription.unsubscribe();
1585
+ }
1586
+ onHandleChildrenAction(child) {
1587
+ const { field, type, action } = child;
1588
+ if (type === 'with-action') {
1589
+ this.eventHandle.next(JSON.stringify({
1590
+ [field]: action()
1591
+ }));
1592
+ }
1593
+ else {
1594
+ this.onShow.next(child);
1595
+ }
1596
+ }
1597
+ onHandleValidateSelected({ field, getValue }) {
1598
+ var _a;
1599
+ return !!((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
1600
+ }
1601
+ }
1602
+ MECXFilterOptionsChildrenComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsChildrenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1603
+ MECXFilterOptionsChildrenComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsChildrenComponent, selector: "mecx-filter-options-children", inputs: { option: "option" }, outputs: { onSubmit: "onSubmit", onShow: "onShow" }, ngImport: i0, template: "<ng-container *ngFor=\"let child of option?.children\">\n <div class=\"item\" (click)=\"onHandleChildrenAction(child)\"\n [class.selected]=\"onHandleValidateSelected(child)\">\n {{ child.label | translate }}\n </div>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;min-width:180px}:host .item{cursor:pointer;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#72717e;padding:8px 24px}:host .item.selected{cursor:not-allowed!important;background-color:var(--mecx-color-theme-400)!important;color:var(--mecx-color-theme-contrast-main)!important;font-weight:400}:host .item:hover{background-color:var(--mecx-color-theme-100)!important;color:#72717e!important;font-weight:400}\n"], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe } });
1604
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsChildrenComponent, decorators: [{
1605
+ type: Component,
1606
+ args: [{ selector: 'mecx-filter-options-children', template: "<ng-container *ngFor=\"let child of option?.children\">\n <div class=\"item\" (click)=\"onHandleChildrenAction(child)\"\n [class.selected]=\"onHandleValidateSelected(child)\">\n {{ child.label | translate }}\n </div>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;min-width:180px}:host .item{cursor:pointer;font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#72717e;padding:8px 24px}:host .item.selected{cursor:not-allowed!important;background-color:var(--mecx-color-theme-400)!important;color:var(--mecx-color-theme-contrast-main)!important;font-weight:400}:host .item:hover{background-color:var(--mecx-color-theme-100)!important;color:#72717e!important;font-weight:400}\n"] }]
1607
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1608
+ type: Input
1609
+ }], onSubmit: [{
1610
+ type: Output
1611
+ }], onShow: [{
1612
+ type: Output
1613
+ }] } });
1614
+
1615
+ class MECXFilterOptionsStatusComponent {
1616
+ constructor() {
1617
+ this.option = null;
1618
+ this.onSubmit = new EventEmitter();
1619
+ this._value = '';
1620
+ this.eventHandle = new EventEmitter();
1621
+ // not to do
1622
+ }
1623
+ verifySelected(value) {
1624
+ var _a;
1625
+ return (_a = this._value) === null || _a === void 0 ? void 0 : _a.includes(value);
1626
+ }
1627
+ ngOnInit() {
1628
+ const { eventHandle, onSubmit, option: { field } } = this;
1629
+ this.eventSubscription = eventHandle
1630
+ .pipe(debounceTime(800))
1631
+ .subscribe((value) => {
1632
+ onSubmit.next({ [field]: value });
1633
+ });
1634
+ }
1635
+ ngOnDestroy() {
1636
+ this.eventSubscription.unsubscribe();
1637
+ }
1638
+ ngOnChanges(changes) {
1639
+ if (changes.option) {
1640
+ const { currentValue } = changes.option;
1641
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1642
+ this._value = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value;
1643
+ }
1644
+ }
1645
+ }
1646
+ onHandleChecked(cmp) {
1647
+ var _a;
1648
+ const { _value } = this;
1649
+ return ((_a = `${_value}`.split(',')) === null || _a === void 0 ? void 0 : _a.indexOf(cmp)) >= 0;
1650
+ }
1651
+ onChangeFilter(event, value) {
1652
+ var _a;
1653
+ event.preventDefault();
1654
+ event.stopPropagation();
1655
+ const selected = !this.verifySelected(value);
1656
+ const filters = ((_a = this._value) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
1657
+ if (!selected) {
1658
+ filters.splice(filters.indexOf(value), 1);
1659
+ }
1660
+ else {
1661
+ filters.push(value);
1662
+ }
1663
+ this._value = (filters === null || filters === void 0 ? void 0 : filters.length) ? filters.join(',') : null;
1664
+ this.eventHandle.next(this._value);
1665
+ }
1666
+ }
1667
+ MECXFilterOptionsStatusComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1668
+ MECXFilterOptionsStatusComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsStatusComponent, selector: "mecx-filter-options-status", inputs: { option: "option" }, outputs: { onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<monkey-checkbox type=\"multiple\" *ngFor=\"let op of option?.values\"\n [description]=\"op?.description | translate\" [value]=\"onHandleChecked(op?.value)\"\n (click)=\"onChangeFilter($event, op?.value)\">\n</monkey-checkbox>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;max-height:500px;padding:12px 12px 8px;color:#72717e;overflow:auto}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox{padding:0!important}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox .mecx-check-container{height:unset!important}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox .mecx-check-container .mecx-check-mark{top:50%;transform:translateY(-50%)}:host ::ng-deep monkey-checkbox{margin:6px 0!important}\n"], components: [{ type: i1$2.MonkeyCheckboxComponent, selector: "monkey-checkbox", inputs: ["label", "type", "helperMessage", "infoMessage", "errorMessage", "description", "value"], outputs: ["onChange"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe } });
1669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsStatusComponent, decorators: [{
1670
+ type: Component,
1671
+ args: [{ selector: 'mecx-filter-options-status', template: "<monkey-checkbox type=\"multiple\" *ngFor=\"let op of option?.values\"\n [description]=\"op?.description | translate\" [value]=\"onHandleChecked(op?.value)\"\n (click)=\"onChangeFilter($event, op?.value)\">\n</monkey-checkbox>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;max-height:500px;padding:12px 12px 8px;color:#72717e;overflow:auto}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox{padding:0!important}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox .mecx-check-container{height:unset!important}:host ::ng-deep mecx-form-field mecx-form-field-body.checkbox .mecx-check-container .mecx-check-mark{top:50%;transform:translateY(-50%)}:host ::ng-deep monkey-checkbox{margin:6px 0!important}\n"] }]
1672
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1673
+ type: Input
1674
+ }], onSubmit: [{
1675
+ type: Output
1676
+ }] } });
1677
+
1678
+ class MECXFilterOptionsDateRangeComponent {
1679
+ constructor() {
1680
+ this.option = null;
1681
+ this.onSubmit = new EventEmitter();
1682
+ this._value = {
1683
+ startDate: null,
1684
+ endDate: null
1685
+ };
1686
+ this._moveDaysForward = true;
1687
+ this.eventHandle = new EventEmitter();
1688
+ // not to do
1689
+ }
1690
+ onHandleSelectedValue({ field, value, getValue }) {
1691
+ var _a;
1692
+ try {
1693
+ value = value || ((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
1694
+ if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
1695
+ this._value = JSON.parse(value);
1696
+ }
1697
+ }
1698
+ catch (e) {
1699
+ // not to do
1700
+ }
1701
+ }
1702
+ ngOnInit() {
1703
+ const { eventHandle, onSubmit, option: { field } } = this;
1704
+ this.eventSubscription = eventHandle
1705
+ .pipe(debounceTime(800))
1706
+ .subscribe((value) => {
1707
+ onSubmit.next({ [field]: value });
1708
+ });
1709
+ }
1710
+ ngOnDestroy() {
1711
+ this.eventSubscription.unsubscribe();
1712
+ }
1713
+ ngOnChanges(changes) {
1714
+ if (changes.option) {
1715
+ const { currentValue } = changes.option;
1716
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1717
+ this.onHandleSelectedValue(currentValue);
1718
+ }
1719
+ }
1720
+ }
1721
+ onChangeFilter(value) {
1722
+ if (!(value === null || value === void 0 ? void 0 : value.endDate))
1723
+ return;
1724
+ this.eventHandle.next(JSON.stringify(value));
1725
+ }
1726
+ }
1727
+ MECXFilterOptionsDateRangeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsDateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1728
+ MECXFilterOptionsDateRangeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsDateRangeComponent, selector: "mecx-filter-options-date-range", inputs: { option: "option" }, outputs: { onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<monkey-date-range-picker [(value)]=\"_value\" [i18n]=\"'CALENDAR' | translate\"\n [moveDaysForward]=\"_moveDaysForward\" (onChange)=\"onChangeFilter($event)\">\n</monkey-date-range-picker>", styles: [":host{display:flex;flex-direction:column;padding:12px 12px 8px}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}:host ::ng-deep mecx-date-range-picker-group-action{display:none}:host ::ng-deep monkey-date-range-picker mecx-date-range-picker-group mecx-date-range-picker-group-info{display:none}:host ::ng-deep monkey-date-range-picker mecx-date-range-picker-group mecx-date-range-picker-group-header{display:none}\n"], components: [{ type: i1$2.MonkeyDateRangePickerComponent, selector: "monkey-date-range-picker", inputs: ["label", "helperMessage", "i18n", "infoMessage", "errorMessage", "moveDaysForward", "minDate", "value"], outputs: ["onChange"] }], pipes: { "translate": i1$3.TranslatePipe } });
1729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsDateRangeComponent, decorators: [{
1730
+ type: Component,
1731
+ args: [{ selector: 'mecx-filter-options-date-range', template: "<monkey-date-range-picker [(value)]=\"_value\" [i18n]=\"'CALENDAR' | translate\"\n [moveDaysForward]=\"_moveDaysForward\" (onChange)=\"onChangeFilter($event)\">\n</monkey-date-range-picker>", styles: [":host{display:flex;flex-direction:column;padding:12px 12px 8px}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}:host ::ng-deep mecx-date-range-picker-group-action{display:none}:host ::ng-deep monkey-date-range-picker mecx-date-range-picker-group mecx-date-range-picker-group-info{display:none}:host ::ng-deep monkey-date-range-picker mecx-date-range-picker-group mecx-date-range-picker-group-header{display:none}\n"] }]
1732
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1733
+ type: Input
1734
+ }], onSubmit: [{
1735
+ type: Output
1736
+ }] } });
1737
+
1738
+ class MECXFilterOptionsCurrencyComponent {
1739
+ constructor() {
1740
+ this.option = null;
1741
+ this.onSubmit = new EventEmitter();
1742
+ this._value = 0;
1743
+ this.eventHandle = new EventEmitter();
1744
+ // not to do
1745
+ }
1746
+ ngOnInit() {
1747
+ const { eventHandle, onSubmit, option: { field } } = this;
1748
+ this.eventSubscription = eventHandle
1749
+ .pipe(debounceTime(800))
1750
+ .subscribe((value) => {
1751
+ onSubmit.next({ [field]: value });
1752
+ });
1753
+ }
1754
+ ngOnDestroy() {
1755
+ this.eventSubscription.unsubscribe();
1756
+ }
1757
+ ngOnChanges(changes) {
1758
+ if (changes.option) {
1759
+ const { currentValue } = changes.option;
1760
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1761
+ this._value = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value;
1762
+ }
1763
+ }
1764
+ }
1765
+ onChangeFilter(value) {
1766
+ this.eventHandle.next(value);
1767
+ }
1768
+ }
1769
+ MECXFilterOptionsCurrencyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsCurrencyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1770
+ MECXFilterOptionsCurrencyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsCurrencyComponent, selector: "mecx-filter-options-currency", inputs: { option: "option" }, outputs: { onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<monkey-input currency=\"true\" type=\"text\" maxLength=\"25\" [(value)]=\"_value\"\n (onChange)=\"onChangeFilter($event)\">\n</monkey-input>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;padding:12px 12px 8px;color:#72717e}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}\n"], components: [{ type: i1$2.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "maxLength", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent", "maxDateToday", "value"], outputs: ["onChange"] }] });
1771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsCurrencyComponent, decorators: [{
1772
+ type: Component,
1773
+ args: [{ selector: 'mecx-filter-options-currency', template: "<monkey-input currency=\"true\" type=\"text\" maxLength=\"25\" [(value)]=\"_value\"\n (onChange)=\"onChangeFilter($event)\">\n</monkey-input>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;padding:12px 12px 8px;color:#72717e}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}\n"] }]
1774
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1775
+ type: Input
1776
+ }], onSubmit: [{
1777
+ type: Output
1778
+ }] } });
1779
+
1780
+ class MECXFilterOptionsInputComponent {
1781
+ constructor() {
1782
+ this.option = null;
1783
+ this.onSubmit = new EventEmitter();
1784
+ this._value = '';
1785
+ this.eventHandle = new EventEmitter();
1786
+ // not to do
1787
+ }
1788
+ ngOnInit() {
1789
+ const { eventHandle, onSubmit, option: { field } } = this;
1790
+ this.eventSubscription = eventHandle
1791
+ .pipe(debounceTime(800))
1792
+ .subscribe((value) => {
1793
+ onSubmit.next({ [field]: value });
1794
+ });
1795
+ }
1796
+ ngOnDestroy() {
1797
+ this.eventSubscription.unsubscribe();
1798
+ }
1799
+ ngOnChanges(changes) {
1800
+ if (changes.option) {
1801
+ const { currentValue } = changes.option;
1802
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1803
+ this._value = currentValue === null || currentValue === void 0 ? void 0 : currentValue.value;
1804
+ }
1805
+ }
1806
+ }
1807
+ onChangeFilter(value) {
1808
+ this.eventHandle.next(value);
1809
+ }
1810
+ }
1811
+ MECXFilterOptionsInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1812
+ MECXFilterOptionsInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsInputComponent, selector: "mecx-filter-options-input", inputs: { option: "option" }, outputs: { onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<monkey-input type=\"text\" maxLength=\"255\" [(value)]=\"_value\"\n (onChange)=\"onChangeFilter($event)\">\n</monkey-input>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;padding:12px 12px 8px;color:#72717e}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}\n"], components: [{ type: i1$2.MonkeyInputComponent, selector: "monkey-input", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "maxLength", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "percent", "maxDateToday", "value"], outputs: ["onChange"] }] });
1813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsInputComponent, decorators: [{
1814
+ type: Component,
1815
+ args: [{ selector: 'mecx-filter-options-input', template: "<monkey-input type=\"text\" maxLength=\"255\" [(value)]=\"_value\"\n (onChange)=\"onChangeFilter($event)\">\n</monkey-input>", styles: [":host{display:flex;flex-direction:column;max-width:232px;min-width:180px;padding:12px 12px 8px;color:#72717e}:host .title{color:#4b4a53;font-size:18px;line-height:21px;font-weight:500;text-align:left;margin-bottom:4px}\n"] }]
1816
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1817
+ type: Input
1818
+ }], onSubmit: [{
1819
+ type: Output
1820
+ }] } });
1821
+
1822
+ class MECXFilterOptionsComponent {
1823
+ constructor() {
1824
+ this.option = null;
1825
+ this.closeDirectly = false;
1826
+ this.onClose = new EventEmitter();
1827
+ this.onRemove = new EventEmitter();
1828
+ this.onSubmit = new EventEmitter();
1829
+ this.onShowFromChildren = new EventEmitter();
1830
+ this._showMenu = false;
1831
+ this.closeMenu = () => {
1832
+ this._showMenu = false;
1833
+ };
1834
+ // not to do
1835
+ }
1836
+ onHandleChildrenAction(child) {
1837
+ const { option } = this;
1838
+ const { field, action } = child;
1839
+ this.onSubmit.next({
1840
+ [option.field]: {
1841
+ [field]: action()
1842
+ }
1843
+ });
1844
+ }
1845
+ onHandleSubmitChildren(event) {
1846
+ this.onSubmit.next(event);
1847
+ }
1848
+ onHandleSubmit(event) {
1849
+ this.onSubmit.next(event);
1850
+ }
1851
+ onHandleShowMenu() {
1852
+ const { closeDirectly } = this;
1853
+ if (closeDirectly) {
1854
+ this.onClose.next();
1855
+ return;
1856
+ }
1857
+ this._showMenu = true;
1858
+ }
1859
+ }
1860
+ MECXFilterOptionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1861
+ MECXFilterOptionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterOptionsComponent, selector: "mecx-filter-options", inputs: { option: "option", closeDirectly: "closeDirectly" }, outputs: { onClose: "onClose", onRemove: "onRemove", onSubmit: "onSubmit", onShowFromChildren: "onShowFromChildren" }, ngImport: i0, template: "<div class=\"d-flex justify-content-between header\">\n <span class=\"title\">\n {{ option?.label | translate }}\n </span>\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\n </div>\n</div>\n<ng-container *ngIf=\"option?.type as type\">\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\n (onShow)=\"onShowFromChildren.next($event)\">\n </mecx-filter-options-children>\n </ng-container>\n <ng-template #withoutChildren>\n <ng-container [ngSwitch]=\"type\">\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-status>\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-date-range>\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-currency>\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-input>\n </ng-container>\n </ng-template>\n</ng-container>\n\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\n <div class=\"close-menu\">\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\n {{ 'BUTTONS.REMOVE' | translate }}\n </monkey-button>\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\n {{ 'BUTTONS.CLOSE' | translate }}\n </monkey-button>\n </div>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"], components: [{ type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }, { type: MECXFilterOptionsChildrenComponent, selector: "mecx-filter-options-children", inputs: ["option"], outputs: ["onSubmit", "onShow"] }, { type: MECXFilterOptionsStatusComponent, selector: "mecx-filter-options-status", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsDateRangeComponent, selector: "mecx-filter-options-date-range", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsCurrencyComponent, selector: "mecx-filter-options-currency", inputs: ["option"], outputs: ["onSubmit"] }, { type: MECXFilterOptionsInputComponent, selector: "mecx-filter-options-input", inputs: ["option"], outputs: ["onSubmit"] }, { type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }], pipes: { "translate": i1$3.TranslatePipe } });
1862
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsComponent, decorators: [{
1863
+ type: Component,
1864
+ args: [{ selector: 'mecx-filter-options', template: "<div class=\"d-flex justify-content-between header\">\n <span class=\"title\">\n {{ option?.label | translate }}\n </span>\n <div class=\"close\" #actionElement (click)=\"onHandleShowMenu()\">\n <monkey-icon icon=\"close-12\" color=\"#474747\"></monkey-icon>\n </div>\n</div>\n<ng-container *ngIf=\"option?.type as type\">\n <ng-container *ngIf=\"option?.children; else withoutChildren\">\n <mecx-filter-options-children [option]=\"option\" (onSubmit)=\"onHandleSubmitChildren($event)\"\n (onShow)=\"onShowFromChildren.next($event)\">\n </mecx-filter-options-children>\n </ng-container>\n <ng-template #withoutChildren>\n <ng-container [ngSwitch]=\"type\">\n <mecx-filter-options-status *ngSwitchCase=\"'status'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-status>\n <mecx-filter-options-date-range *ngSwitchCase=\"'date-range'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-date-range>\n <mecx-filter-options-currency *ngSwitchCase=\"'currency'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-currency>\n <mecx-filter-options-input *ngSwitchCase=\"'input'\" [option]=\"option\"\n (onSubmit)=\"onHandleSubmit($event)\">\n </mecx-filter-options-input>\n </ng-container>\n </ng-template>\n</ng-container>\n\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'ltr'\">\n <div class=\"close-menu\">\n <monkey-button type=\"tertiary\" color=\"error\" (click)=\"onRemove.next()\" size=\"sm\">\n {{ 'BUTTONS.REMOVE' | translate }}\n </monkey-button>\n <monkey-button type=\"tertiary\" color=\"theme\" (click)=\"onClose.next()\" size=\"sm\">\n {{ 'BUTTONS.CLOSE' | translate }}\n </monkey-button>\n </div>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px}:host .header{border-bottom:1px solid #d6d6d6;padding:8px}:host .header .title{color:#4b4a53;font-style:normal;font-size:14px;line-height:16px;font-weight:500;text-align:left}:host .header .close{cursor:pointer;border-radius:120px;padding:4px}:host .header .close:hover{background-color:#6d6d6d0c}.close-menu{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:8px!important;margin:0 8px;padding:8px}.close-menu ::ng-deep monkey-button{width:100%}.close-menu ::ng-deep monkey-button button{width:100%}\n"] }]
1865
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1866
+ type: Input
1867
+ }], closeDirectly: [{
1868
+ type: Input
1869
+ }], onClose: [{
1870
+ type: Output
1871
+ }], onRemove: [{
1872
+ type: Output
1873
+ }], onSubmit: [{
1874
+ type: Output
1875
+ }], onShowFromChildren: [{
1876
+ type: Output
1877
+ }] } });
1878
+
1879
+ class MECXFilterSelectedItemComponent {
1880
+ constructor() {
1881
+ this.onClose = new EventEmitter();
1882
+ this.onSubmit = new EventEmitter();
1883
+ this._option = null;
1884
+ this._showMenu = false;
1885
+ this._actionElement = null;
1886
+ this.closeMenu = () => {
1887
+ this._showMenu = false;
1888
+ };
1889
+ // not to do
1890
+ }
1891
+ set option(value) {
1892
+ this._option = value;
1893
+ }
1894
+ onHandleShowMenu() {
1895
+ const { _option } = this;
1896
+ this._actionElement = document.getElementById(`mecx-filter-selected-item-${_option === null || _option === void 0 ? void 0 : _option.field}`);
1897
+ setTimeout(() => {
1898
+ this._showMenu = true;
1899
+ }, 0);
1900
+ }
1901
+ onHandleClose() {
1902
+ this._showMenu = false;
1903
+ this.onClose.next();
1904
+ }
1905
+ onHandleSubmit(event) {
1906
+ this.onSubmit.next(event);
1907
+ }
1908
+ onHandleRemove() {
1909
+ const { _option } = this;
1910
+ const { field } = _option;
1911
+ this.onSubmit.next({ [field]: null });
1912
+ }
1913
+ onHandleShowFromChildren(event) {
1914
+ const { _option } = this;
1915
+ const { label } = _option;
1916
+ this.onHandleShowMenu();
1917
+ this.onHandleSubmit = (event) => {
1918
+ this.onSubmit.next({
1919
+ [_option.field]: JSON.stringify(event)
1920
+ });
1921
+ };
1922
+ this._option = Object.assign(Object.assign({}, event), { label });
1923
+ }
1924
+ }
1925
+ MECXFilterSelectedItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1926
+ MECXFilterSelectedItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedItemComponent, selector: "mecx-filter-selected-item", inputs: { option: "option" }, outputs: { onClose: "onClose", onSubmit: "onSubmit" }, ngImport: i0, template: "<ng-container *ngIf=\"_option?.type as type\">\n <ng-container *ngIf=\"_option?.children; else withoutChildren\">\n <mecx-filter-selected-item-children [option]=\"_option\" (onShow)=\"onHandleShowMenu()\"\n (onRemove)=\"onHandleRemove()\">\n </mecx-filter-selected-item-children>\n </ng-container>\n <ng-template #withoutChildren>\n <div class=\"box\">\n <div class=\"data\">\n {{ _option.label | translate }}\n </div>\n <div class=\"value\" [id]=\"'mecx-filter-selected-item-'+_option?.field\"\n (click)=\"onHandleShowMenu()\">\n <ng-container [ngSwitch]=\"type\">\n <mecx-filter-selected-item-currency *ngSwitchCase=\"'currency'\" [option]=\"_option\">\n </mecx-filter-selected-item-currency>\n <mecx-filter-selected-item-input *ngSwitchCase=\"'input'\" [option]=\"_option\">\n </mecx-filter-selected-item-input>\n <mecx-filter-selected-item-date-range *ngSwitchCase=\"'date-range'\" [option]=\"_option\">\n </mecx-filter-selected-item-date-range>\n <mecx-filter-selected-item-status *ngSwitchCase=\"'status'\" [option]=\"_option\"\n [labelMoreValues]=\"'FIELD.AND-MORE' | translate\">\n </mecx-filter-selected-item-status>\n </ng-container>\n </div>\n <div class=\"action\" (click)=\"onHandleShowMenu()\">\n <monkey-icon icon=\"arrow-right-14\" color=\"#4B4A53\"></monkey-icon>\n </div>\n </div>\n </ng-template>\n</ng-container>\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(_actionElement); closed: closeMenu; dir: 'ltr'\">\n <mecx-filter-options [option]=\"_option\" (onClose)=\"onHandleClose()\"\n (onRemove)=\"onHandleRemove()\" (onSubmit)=\"onHandleSubmit($event)\"\n (onShowFromChildren)=\"onHandleShowFromChildren($event)\">\n </mecx-filter-options>\n</ng-container>", styles: [":host{display:flex}:host .box{display:flex;justify-content:space-between;align-items:center;background:#ffffff;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:120px;height:40px}:host .box .data{display:flex;align-items:center;padding:12px 8px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e}:host .box .value{cursor:pointer;display:flex;align-items:center;padding:12px 8px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e;background-color:#6d6d6d0a}:host .box .value:hover{background-color:#6d6d6d0c;font-weight:400;text-decoration:underline}:host .box .action{cursor:pointer;border-left:1px solid #d6d6d6;padding:8px;color:#908e9d;font-weight:500;font-size:18px;height:40px;align-items:center;display:flex}:host .box .action:hover{background-color:#6d6d6d0c;border-top-right-radius:120px;border-bottom-right-radius:120px}mecx-filter-options{margin:4px 0}\n"], components: [{ type: MECXFilterSelectedItemChildrenComponent, selector: "mecx-filter-selected-item-children", inputs: ["option"], outputs: ["onShow", "onRemove"] }, { type: MECXFilterSelectedItemCurrencyComponent, selector: "mecx-filter-selected-item-currency", inputs: ["option"] }, { type: MECXFilterSelectedItemInputComponent, selector: "mecx-filter-selected-item-input", inputs: ["option"] }, { type: MECXFilterSelectedItemDateRangeComponent, selector: "mecx-filter-selected-item-date-range", inputs: ["option"] }, { type: MECXFilterSelectedItemStatusComponent, selector: "mecx-filter-selected-item-status", inputs: ["option", "labelMoreValues"] }, { type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }, { type: MECXFilterOptionsComponent, selector: "mecx-filter-options", inputs: ["option", "closeDirectly"], outputs: ["onClose", "onRemove", "onSubmit", "onShowFromChildren"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }], pipes: { "translate": i1$3.TranslatePipe } });
1927
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedItemComponent, decorators: [{
1928
+ type: Component,
1929
+ args: [{ selector: 'mecx-filter-selected-item', template: "<ng-container *ngIf=\"_option?.type as type\">\n <ng-container *ngIf=\"_option?.children; else withoutChildren\">\n <mecx-filter-selected-item-children [option]=\"_option\" (onShow)=\"onHandleShowMenu()\"\n (onRemove)=\"onHandleRemove()\">\n </mecx-filter-selected-item-children>\n </ng-container>\n <ng-template #withoutChildren>\n <div class=\"box\">\n <div class=\"data\">\n {{ _option.label | translate }}\n </div>\n <div class=\"value\" [id]=\"'mecx-filter-selected-item-'+_option?.field\"\n (click)=\"onHandleShowMenu()\">\n <ng-container [ngSwitch]=\"type\">\n <mecx-filter-selected-item-currency *ngSwitchCase=\"'currency'\" [option]=\"_option\">\n </mecx-filter-selected-item-currency>\n <mecx-filter-selected-item-input *ngSwitchCase=\"'input'\" [option]=\"_option\">\n </mecx-filter-selected-item-input>\n <mecx-filter-selected-item-date-range *ngSwitchCase=\"'date-range'\" [option]=\"_option\">\n </mecx-filter-selected-item-date-range>\n <mecx-filter-selected-item-status *ngSwitchCase=\"'status'\" [option]=\"_option\"\n [labelMoreValues]=\"'FIELD.AND-MORE' | translate\">\n </mecx-filter-selected-item-status>\n </ng-container>\n </div>\n <div class=\"action\" (click)=\"onHandleShowMenu()\">\n <monkey-icon icon=\"arrow-right-14\" color=\"#4B4A53\"></monkey-icon>\n </div>\n </div>\n </ng-template>\n</ng-container>\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(_actionElement); closed: closeMenu; dir: 'ltr'\">\n <mecx-filter-options [option]=\"_option\" (onClose)=\"onHandleClose()\"\n (onRemove)=\"onHandleRemove()\" (onSubmit)=\"onHandleSubmit($event)\"\n (onShowFromChildren)=\"onHandleShowFromChildren($event)\">\n </mecx-filter-options>\n</ng-container>", styles: [":host{display:flex}:host .box{display:flex;justify-content:space-between;align-items:center;background:#ffffff;border:1px solid #d6d6d6;box-sizing:border-box;border-radius:120px;height:40px}:host .box .data{display:flex;align-items:center;padding:12px 8px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e}:host .box .value{cursor:pointer;display:flex;align-items:center;padding:12px 8px;height:100%;font-style:normal;font-weight:400;font-size:14px;line-height:24px;text-align:center;color:#72717e;background-color:#6d6d6d0a}:host .box .value:hover{background-color:#6d6d6d0c;font-weight:400;text-decoration:underline}:host .box .action{cursor:pointer;border-left:1px solid #d6d6d6;padding:8px;color:#908e9d;font-weight:500;font-size:18px;height:40px;align-items:center;display:flex}:host .box .action:hover{background-color:#6d6d6d0c;border-top-right-radius:120px;border-bottom-right-radius:120px}mecx-filter-options{margin:4px 0}\n"] }]
1930
+ }], ctorParameters: function () { return []; }, propDecorators: { option: [{
1931
+ type: Input
1932
+ }], onClose: [{
1933
+ type: Output
1934
+ }], onSubmit: [{
1935
+ type: Output
1936
+ }] } });
1937
+
1938
+ class MECXFilterSelectedComponent {
1939
+ constructor() {
1940
+ this.model = [];
1941
+ this.onOpenFilters = new EventEmitter();
1942
+ this.onClose = new EventEmitter();
1943
+ this.onSubmit = new EventEmitter();
1944
+ this._model = [];
1945
+ // not to do
1946
+ }
1947
+ validateValue({ field, value, getValue }) {
1948
+ var _a;
1949
+ try {
1950
+ value = value || ((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
1951
+ if (!value)
1952
+ return false;
1953
+ if (typeof value === 'object') {
1954
+ return value && JSON.stringify(value) !== '{}';
1955
+ }
1956
+ return MonkeyEcxUtils.persistNullEmptyUndefined(value);
1957
+ }
1958
+ catch (e) {
1959
+ // not to do
1960
+ }
1961
+ return false;
1962
+ }
1963
+ onHandleSelectedValue(value) {
1964
+ var _a;
1965
+ this._model = (_a = value === null || value === void 0 ? void 0 : value.map((_) => {
1966
+ const { children } = _;
1967
+ let obj = null;
1968
+ if (children) {
1969
+ obj = Object.assign(Object.assign({}, _), { children });
1970
+ }
1971
+ else if (this.validateValue(_)) {
1972
+ obj = Object.assign(Object.assign({}, _), obj || {});
1973
+ }
1974
+ return obj;
1975
+ })) === null || _a === void 0 ? void 0 : _a.filter((_) => {
1976
+ return _;
1977
+ });
1978
+ }
1979
+ ngOnChanges(changes) {
1980
+ if (changes.model) {
1981
+ const { currentValue } = changes.model;
1982
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
1983
+ this.onHandleSelectedValue(currentValue);
1984
+ }
1985
+ }
1986
+ }
1987
+ onHandleClose() {
1988
+ this.onClose.next();
1989
+ }
1990
+ onHandleSubmit(event) {
1991
+ this.onSubmit.next(event);
1992
+ }
1993
+ }
1994
+ MECXFilterSelectedComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1995
+ MECXFilterSelectedComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterSelectedComponent, selector: "mecx-filter-selected", inputs: { model: "model" }, outputs: { onOpenFilters: "onOpenFilters", onClose: "onClose", onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<mecx-filter-selected-item *ngFor=\"let option of _model\" (onSubmit)=\"onHandleSubmit($event)\"\n (onClose)=\"onHandleClose()\" [option]=\"option\">\n</mecx-filter-selected-item>", styles: [":host{display:flex}:host ::ng-deep mecx-filter-selected-item{margin-right:8px}\n"], components: [{ type: MECXFilterSelectedItemComponent, selector: "mecx-filter-selected-item", inputs: ["option"], outputs: ["onClose", "onSubmit"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
1996
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedComponent, decorators: [{
1997
+ type: Component,
1998
+ args: [{ selector: 'mecx-filter-selected', template: "<mecx-filter-selected-item *ngFor=\"let option of _model\" (onSubmit)=\"onHandleSubmit($event)\"\n (onClose)=\"onHandleClose()\" [option]=\"option\">\n</mecx-filter-selected-item>", styles: [":host{display:flex}:host ::ng-deep mecx-filter-selected-item{margin-right:8px}\n"] }]
1999
+ }], ctorParameters: function () { return []; }, propDecorators: { model: [{
2000
+ type: Input
2001
+ }], onOpenFilters: [{
2002
+ type: Output
2003
+ }], onClose: [{
2004
+ type: Output
2005
+ }], onSubmit: [{
2006
+ type: Output
2007
+ }] } });
2008
+
2009
+ class MECXFilterMenuComponent {
2010
+ constructor() {
2011
+ this.model = [];
2012
+ this.onClose = new EventEmitter();
2013
+ this.onSubmit = new EventEmitter();
2014
+ this._onHandleSubmit = null;
2015
+ this._model = [];
2016
+ this._showMenu = false;
2017
+ this._menuOption = null;
2018
+ this.closeMenu = () => {
2019
+ this._showMenu = false;
2020
+ };
2021
+ // not to do
2022
+ }
2023
+ validateValue({ field, value, getValue }) {
2024
+ var _a;
2025
+ try {
2026
+ value = value || ((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
2027
+ if (!value)
2028
+ return false;
2029
+ if (typeof value === 'object') {
2030
+ return value && JSON.stringify(value) !== '{}';
2031
+ }
2032
+ return MonkeyEcxUtils.persistNullEmptyUndefined(value);
2033
+ }
2034
+ catch (e) {
2035
+ // not to do
2036
+ }
2037
+ return false;
2038
+ }
2039
+ onHandleSubmitValue(value) {
2040
+ this.onSubmit.next(value);
2041
+ this.onHandleClose();
2042
+ }
2043
+ onHandleMenus(value) {
2044
+ var _a, _b;
2045
+ this._model = (_a = value === null || value === void 0 ? void 0 : value.map((_) => {
2046
+ const { children } = _;
2047
+ let obj = null;
2048
+ if (children) {
2049
+ obj = Object.assign(Object.assign({}, _), { children: children === null || children === void 0 ? void 0 : children.filter((_) => {
2050
+ return !this.validateValue(_);
2051
+ }) });
2052
+ }
2053
+ else if (!this.validateValue(_)) {
2054
+ obj = Object.assign(Object.assign({}, _), obj || {});
2055
+ }
2056
+ return obj;
2057
+ })) === null || _a === void 0 ? void 0 : _a.filter((_) => {
2058
+ return _;
2059
+ });
2060
+ this._model = (_b = this._model) === null || _b === void 0 ? void 0 : _b.sort((a, b) => {
2061
+ const groupA = `${a === null || a === void 0 ? void 0 : a.group}`.toLowerCase();
2062
+ const groupB = `${b === null || b === void 0 ? void 0 : b.group}`.toLowerCase();
2063
+ return groupA !== groupB ? 1 : -1;
2064
+ });
2065
+ }
2066
+ ngOnChanges(changes) {
2067
+ if (changes.model) {
2068
+ const { currentValue } = changes.model;
2069
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
2070
+ this.onHandleMenus(currentValue);
2071
+ }
2072
+ }
2073
+ }
2074
+ onHandleChildrenAction(option, child) {
2075
+ const { field, type, action } = child;
2076
+ if (type === 'with-action') {
2077
+ this.onHandleSubmitValue({
2078
+ [option.field]: JSON.stringify({
2079
+ [field]: action()
2080
+ })
2081
+ });
2082
+ }
2083
+ else {
2084
+ this._showMenu = true;
2085
+ this._menuOption = child;
2086
+ this.onHandleSubmit = (event) => {
2087
+ this.onHandleSubmitValue({
2088
+ [option.field]: JSON.stringify(event)
2089
+ });
2090
+ };
2091
+ }
2092
+ }
2093
+ onHandleShowMenu(option) {
2094
+ this._showMenu = true;
2095
+ this._menuOption = option;
2096
+ }
2097
+ onHandleClose() {
2098
+ this._showMenu = false;
2099
+ this.onClose.next();
2100
+ }
2101
+ onHandleSubmit(event) {
2102
+ this.onHandleSubmitValue(event);
2103
+ }
2104
+ }
2105
+ MECXFilterMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2106
+ MECXFilterMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterMenuComponent, selector: "mecx-filter-menu", inputs: { model: "model" }, outputs: { onClose: "onClose", onSubmit: "onSubmit" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex flex-column\" #actionElement>\n <ng-container *ngFor=\"let menu of _model; let index = index\">\n <ng-container *ngIf=\"menu?.children; else withoutChildren\">\n <div class=\"item no-action\">\n {{ menu.label | translate }}\n </div>\n <div class=\"separator\"></div>\n <ng-container *ngFor=\"let child of menu?.children\">\n <div class=\"item children\" (click)=\"onHandleChildrenAction(menu, child)\">\n {{ child.label | translate }}\n </div>\n </ng-container>\n </ng-container>\n <ng-template #withoutChildren>\n <div class=\"item\" (click)=\"onHandleShowMenu(menu)\">\n {{ menu.label | translate }}\n </div>\n </ng-template>\n <ng-container *ngIf=\"_model[index+1]?.group as next; _model[index]?.group as current\">\n <div class=\"separator\" *ngIf=\"next !== current\"></div>\n </ng-container>\n </ng-container>\n</div>\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'rt'\">\n <mecx-filter-options [option]=\"_menuOption\" (onClose)=\"onHandleClose()\"\n (onSubmit)=\"onHandleSubmit($event)\" [closeDirectly]=\"true\"></mecx-filter-options>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:16px!important;min-width:192px;margin:4px 8px;overflow:auto;max-height:500px}:host ::ng-deep monkey-button{width:100%}:host ::ng-deep monkey-button button{justify-content:flex-start!important;width:100%}:host .item{font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#72717e;padding:8px 24px}:host .item.no-action{cursor:not-allowed;padding:8px;margin:0!important;font-weight:500}:host .item:first-child{margin:12px 0 0}:host .item:last-child{margin:0 0 12px}:host .item:not(.no-action){cursor:pointer}:host .item:not(.no-action):hover{background-color:var(--mecx-color-theme-200)!important;color:var(--mecx-color-theme-main)!important;font-weight:400}:host .separator{border-bottom:1px solid #ebebeb}\n"], components: [{ type: MECXFilterOptionsComponent, selector: "mecx-filter-options", inputs: ["option", "closeDirectly"], outputs: ["onClose", "onRemove", "onSubmit", "onShowFromChildren"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }], pipes: { "translate": i1$3.TranslatePipe } });
2107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuComponent, decorators: [{
2108
+ type: Component,
2109
+ args: [{ selector: 'mecx-filter-menu', template: "<div class=\"d-flex flex-column\" #actionElement>\n <ng-container *ngFor=\"let menu of _model; let index = index\">\n <ng-container *ngIf=\"menu?.children; else withoutChildren\">\n <div class=\"item no-action\">\n {{ menu.label | translate }}\n </div>\n <div class=\"separator\"></div>\n <ng-container *ngFor=\"let child of menu?.children\">\n <div class=\"item children\" (click)=\"onHandleChildrenAction(menu, child)\">\n {{ child.label | translate }}\n </div>\n </ng-container>\n </ng-container>\n <ng-template #withoutChildren>\n <div class=\"item\" (click)=\"onHandleShowMenu(menu)\">\n {{ menu.label | translate }}\n </div>\n </ng-template>\n <ng-container *ngIf=\"_model[index+1]?.group as next; _model[index]?.group as current\">\n <div class=\"separator\" *ngIf=\"next !== current\"></div>\n </ng-container>\n </ng-container>\n</div>\n<ng-container\n *monkeyecxPopover=\"_showMenu; target: $any(actionElement); closed: closeMenu; dir: 'rt'\">\n <mecx-filter-options [option]=\"_menuOption\" (onClose)=\"onHandleClose()\"\n (onSubmit)=\"onHandleSubmit($event)\" [closeDirectly]=\"true\"></mecx-filter-options>\n</ng-container>", styles: [":host{display:flex;flex-direction:column;background:#fafafa;border:1px solid #d6d6d6;box-sizing:border-box;box-shadow:0 4px 36px -8px #6d6d6d3a;border-radius:16px!important;min-width:192px;margin:4px 8px;overflow:auto;max-height:500px}:host ::ng-deep monkey-button{width:100%}:host ::ng-deep monkey-button button{justify-content:flex-start!important;width:100%}:host .item{font-style:normal;font-weight:400;font-size:16px;line-height:24px;color:#72717e;padding:8px 24px}:host .item.no-action{cursor:not-allowed;padding:8px;margin:0!important;font-weight:500}:host .item:first-child{margin:12px 0 0}:host .item:last-child{margin:0 0 12px}:host .item:not(.no-action){cursor:pointer}:host .item:not(.no-action):hover{background-color:var(--mecx-color-theme-200)!important;color:var(--mecx-color-theme-main)!important;font-weight:400}:host .separator{border-bottom:1px solid #ebebeb}\n"] }]
2110
+ }], ctorParameters: function () { return []; }, propDecorators: { model: [{
2111
+ type: Input
2112
+ }], onClose: [{
2113
+ type: Output
2114
+ }], onSubmit: [{
2115
+ type: Output
2116
+ }] } });
2117
+
2118
+ class MECXFilterComponent {
2119
+ constructor() {
2120
+ this.searchPlaceholder = '';
2121
+ this.orderPlaceholder = '';
2122
+ this.menus = [];
2123
+ this.orders = [];
2124
+ this.enableSearch = true;
2125
+ this.isLoading = false;
2126
+ this.onFilter = new EventEmitter();
2127
+ this._order = null;
2128
+ this._search = '';
2129
+ this._showMenu = false;
2130
+ this._hasFilterByMenu = false;
2131
+ this._actionElement = null;
2132
+ this.closeMenu = () => {
2133
+ this._showMenu = false;
2134
+ };
2135
+ // not to do
2136
+ }
2137
+ set search(value) {
2138
+ this._search = value;
2139
+ }
2140
+ set order(value) {
2141
+ this._order = value;
2142
+ }
2143
+ validateValue({ field, value, getValue }) {
2144
+ var _a;
2145
+ try {
2146
+ value = value || ((_a = getValue()) === null || _a === void 0 ? void 0 : _a[field]);
2147
+ if (!value)
2148
+ return false;
2149
+ if (typeof value === 'object') {
2150
+ return value && JSON.stringify(value) !== '{}';
2151
+ }
2152
+ return MonkeyEcxUtils.persistNullEmptyUndefined(value);
2153
+ }
2154
+ catch (e) {
2155
+ // not to do
2156
+ }
2157
+ return false;
2158
+ }
2159
+ handleFilters() {
2160
+ const { menus } = this;
2161
+ let found = menus.find((_) => {
2162
+ return this.validateValue(_);
2163
+ });
2164
+ if (!found) {
2165
+ found = menus.find(({ children }) => {
2166
+ var _a;
2167
+ return (_a = (children || [])) === null || _a === void 0 ? void 0 : _a.find((_) => {
2168
+ return this.validateValue(_);
2169
+ });
2170
+ });
2171
+ }
2172
+ this._hasFilterByMenu = !!found;
2173
+ }
2174
+ ngOnChanges(changes) {
2175
+ if (changes.menus) {
2176
+ const { currentValue } = changes.menus;
2177
+ if (currentValue && JSON.stringify(currentValue) !== '{}') {
2178
+ this.handleFilters();
2179
+ }
2180
+ }
2181
+ }
2182
+ onSearchFilter(event) {
2183
+ this.onFilter.next({ search: event });
2184
+ }
2185
+ onClearFilter() {
2186
+ this._search = '';
2187
+ this.onFilter.next({ search: null });
2188
+ }
2189
+ onHandleSubmit(event) {
2190
+ this.onFilter.next(event);
2191
+ }
2192
+ onHandleShowMenu() {
2193
+ this._actionElement = document.getElementById('mecx-filters-add-filter');
2194
+ setTimeout(() => {
2195
+ this._showMenu = true;
2196
+ }, 0);
2197
+ }
2198
+ onHandleClose() {
2199
+ this._showMenu = false;
2200
+ }
2201
+ onHandleOrder(event) {
2202
+ this.onFilter.next({ sort: event });
2203
+ }
2204
+ }
2205
+ MECXFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2206
+ MECXFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXFilterComponent, selector: "mecx-filter", inputs: { searchPlaceholder: "searchPlaceholder", orderPlaceholder: "orderPlaceholder", menus: "menus", orders: "orders", enableSearch: "enableSearch", search: "search", order: "order", isLoading: "isLoading" }, outputs: { onFilter: "onFilter" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"d-flex flex-column full-width\">\n <div class=\"d-flex flex-column flex-md-row justify-content-between\">\n <div class=\"d-flex full-width\">\n <ng-container *ngIf=\"enableSearch\">\n <monkey-input-filter [placeholder]=\"searchPlaceholder | translate\"\n (onChange)=\"onSearchFilter($event)\" icon=\"search-16\" iconPosition=\"left\"\n [(value)]=\"_search\">\n </monkey-input-filter>\n </ng-container>\n <ng-container *ngIf=\"!_hasFilterByMenu\">\n <div class=\"d-flex actions\" id=\"mecx-filters-add-filter\">\n <monkey-button type=\"filter\" color=\"border\" (click)=\"onHandleShowMenu()\" icon=\"more-16\"\n iconPosition=\"right\">\n {{ 'BUTTONS.ADD-FILTER' | translate }}\n </monkey-button>\n </div>\n </ng-container>\n </div>\n <div class=\"order hidden-sm hidden-xs\">\n <ng-container *ngTemplateOutlet=\"orderBy\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"_hasFilterByMenu\">\n <div class=\"separator\"></div>\n <div class=\"d-flex full-width\">\n <mecx-filter-selected (onSubmit)=\"onHandleSubmit($event)\" (onClose)=\"onHandleClose()\"\n [model]=\"menus\"></mecx-filter-selected>\n <div class=\"more-filters\">\n <monkey-button type=\"filter\" color=\"border\" icon=\"more-16\" id=\"mecx-filters-add-filter\"\n (click)=\"onHandleShowMenu()\">\n </monkey-button>\n </div>\n </div>\n </ng-container>\n <div class=\"order hidden-md hidden-lg\">\n <ng-container *ngTemplateOutlet=\"orderBy\"></ng-container>\n </div>\n</div>\n\n<mecx-filter-menu\n *monkeyecxPopover=\"_showMenu; target: $any(_actionElement); closed: closeMenu; dir: 'ltr'\"\n (onSubmit)=\"onHandleSubmit($event)\" (onClose)=\"onHandleClose()\" [model]=\"menus\">\n</mecx-filter-menu>\n\n<ng-template #orderBy>\n <monkey-select-filter (onChange)=\"onHandleOrder($event)\" [placeholder]=\"orderPlaceholder | translate\" type=\"none\"\n [(value)]=\"_order\">\n <monkey-option *ngFor=\"let ordBy of orders\" [label]=\"ordBy?.label | translate\" [value]=\"ordBy?.value\">\n </monkey-option>\n </monkey-select-filter>\n</ng-template>", styles: [":host{display:flex;width:100%;align-items:center}@media screen and (max-width: 959px){:host{flex-direction:column;max-width:100%}:host ::ng-deep monkey-input-filter{width:100%}:host ::ng-deep monkey-select-filter{width:100%}:host ::ng-deep monkey-button{width:100%}:host ::ng-deep monkey-button button{width:100%}}@media screen and (min-width: 960px){:host .actions ::ng-deep monkey-button{margin-left:8px}:host .actions ::ng-deep monkey-button button{width:170px}}:host .more-filters ::ng-deep monkey-button monkey-icon{margin-right:unset!important}@media screen and (min-width: 960px){:host .order{width:230px}}@media screen and (max-width: 959px){:host .order{margin-top:8px}}:host ::ng-deep monkey-button{margin-bottom:0}:host ::ng-deep mecx-form-field-filter mecx-form-field-body{height:40px;margin:0}@media screen and (min-width: 960px){:host ::ng-deep monkey-input-filter{width:464px}}:host .separator{border-bottom:1px solid #ebebeb;margin-top:16px;margin-bottom:16px}\n"], components: [{ type: i1$2.MonkeyInputFilterComponent, selector: "monkey-input-filter", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "iconPosition", "value"], outputs: ["onChange"] }, { type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }, { type: MECXFilterSelectedComponent, selector: "mecx-filter-selected", inputs: ["model"], outputs: ["onOpenFilters", "onClose", "onSubmit"] }, { type: MECXFilterMenuComponent, selector: "mecx-filter-menu", inputs: ["model"], outputs: ["onClose", "onSubmit"] }, { type: i1$2.MonkeySelectFilterComponent, selector: "monkey-select-filter", inputs: ["placeholder", "icon", "type", "value"], outputs: ["onChange"] }, { type: i1$2.MonkeyOptionComponent, selector: "monkey-option", inputs: ["type", "label", "value", "selectAll", "selected", "enableClick"], outputs: ["onSelectOption"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1$4.MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: ["monkeyecxPopover", "monkeyecxPopoverClosed", "monkeyecxPopoverTarget", "monkeyecxPopoverMinwidth", "monkeyecxPopoverBackdrop", "monkeyecxPopoverWatch", "monkeyecxPopoverDir", "monkeyecxPopoverContextmenu", "monkeyecxPopoverHeight"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i1$3.TranslatePipe } });
2207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterComponent, decorators: [{
2208
+ type: Component,
2209
+ args: [{ selector: 'mecx-filter', template: "<div class=\"d-flex flex-column full-width\">\n <div class=\"d-flex flex-column flex-md-row justify-content-between\">\n <div class=\"d-flex full-width\">\n <ng-container *ngIf=\"enableSearch\">\n <monkey-input-filter [placeholder]=\"searchPlaceholder | translate\"\n (onChange)=\"onSearchFilter($event)\" icon=\"search-16\" iconPosition=\"left\"\n [(value)]=\"_search\">\n </monkey-input-filter>\n </ng-container>\n <ng-container *ngIf=\"!_hasFilterByMenu\">\n <div class=\"d-flex actions\" id=\"mecx-filters-add-filter\">\n <monkey-button type=\"filter\" color=\"border\" (click)=\"onHandleShowMenu()\" icon=\"more-16\"\n iconPosition=\"right\">\n {{ 'BUTTONS.ADD-FILTER' | translate }}\n </monkey-button>\n </div>\n </ng-container>\n </div>\n <div class=\"order hidden-sm hidden-xs\">\n <ng-container *ngTemplateOutlet=\"orderBy\"></ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"_hasFilterByMenu\">\n <div class=\"separator\"></div>\n <div class=\"d-flex full-width\">\n <mecx-filter-selected (onSubmit)=\"onHandleSubmit($event)\" (onClose)=\"onHandleClose()\"\n [model]=\"menus\"></mecx-filter-selected>\n <div class=\"more-filters\">\n <monkey-button type=\"filter\" color=\"border\" icon=\"more-16\" id=\"mecx-filters-add-filter\"\n (click)=\"onHandleShowMenu()\">\n </monkey-button>\n </div>\n </div>\n </ng-container>\n <div class=\"order hidden-md hidden-lg\">\n <ng-container *ngTemplateOutlet=\"orderBy\"></ng-container>\n </div>\n</div>\n\n<mecx-filter-menu\n *monkeyecxPopover=\"_showMenu; target: $any(_actionElement); closed: closeMenu; dir: 'ltr'\"\n (onSubmit)=\"onHandleSubmit($event)\" (onClose)=\"onHandleClose()\" [model]=\"menus\">\n</mecx-filter-menu>\n\n<ng-template #orderBy>\n <monkey-select-filter (onChange)=\"onHandleOrder($event)\" [placeholder]=\"orderPlaceholder | translate\" type=\"none\"\n [(value)]=\"_order\">\n <monkey-option *ngFor=\"let ordBy of orders\" [label]=\"ordBy?.label | translate\" [value]=\"ordBy?.value\">\n </monkey-option>\n </monkey-select-filter>\n</ng-template>", styles: [":host{display:flex;width:100%;align-items:center}@media screen and (max-width: 959px){:host{flex-direction:column;max-width:100%}:host ::ng-deep monkey-input-filter{width:100%}:host ::ng-deep monkey-select-filter{width:100%}:host ::ng-deep monkey-button{width:100%}:host ::ng-deep monkey-button button{width:100%}}@media screen and (min-width: 960px){:host .actions ::ng-deep monkey-button{margin-left:8px}:host .actions ::ng-deep monkey-button button{width:170px}}:host .more-filters ::ng-deep monkey-button monkey-icon{margin-right:unset!important}@media screen and (min-width: 960px){:host .order{width:230px}}@media screen and (max-width: 959px){:host .order{margin-top:8px}}:host ::ng-deep monkey-button{margin-bottom:0}:host ::ng-deep mecx-form-field-filter mecx-form-field-body{height:40px;margin:0}@media screen and (min-width: 960px){:host ::ng-deep monkey-input-filter{width:464px}}:host .separator{border-bottom:1px solid #ebebeb;margin-top:16px;margin-bottom:16px}\n"] }]
2210
+ }], ctorParameters: function () { return []; }, propDecorators: { searchPlaceholder: [{
2211
+ type: Input
2212
+ }], orderPlaceholder: [{
2213
+ type: Input
2214
+ }], menus: [{
2215
+ type: Input
2216
+ }], orders: [{
2217
+ type: Input
2218
+ }], enableSearch: [{
2219
+ type: Input
2220
+ }], search: [{
2221
+ type: Input
2222
+ }], order: [{
2223
+ type: Input
2224
+ }], isLoading: [{
2225
+ type: Input
2226
+ }], onFilter: [{
2227
+ type: Output
2228
+ }] } });
2229
+
2230
+ class MECXFilterOptionsModule {
2231
+ }
2232
+ MECXFilterOptionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2233
+ MECXFilterOptionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsModule, declarations: [MECXFilterOptionsChildrenComponent,
2234
+ MECXFilterOptionsComponent,
2235
+ MECXFilterOptionsCurrencyComponent,
2236
+ MECXFilterOptionsDateRangeComponent,
2237
+ MECXFilterOptionsInputComponent,
2238
+ MECXFilterOptionsStatusComponent], imports: [CommonModule,
2239
+ FormsModule,
2240
+ MonkeyBadgeModule,
2241
+ MonkeyButtonModule,
2242
+ MonkeyCheckboxModule,
2243
+ MonkeyDateRangePickerModule,
2244
+ MonkeyEcxDirectivesModule,
2245
+ MonkeyIconModule,
2246
+ MonkeyInputModule,
2247
+ MonkeyOptionModule,
2248
+ MonkeySelectModule,
2249
+ ReactiveFormsModule,
2250
+ RouterModule, i1$3.TranslateModule], exports: [MECXFilterOptionsChildrenComponent,
2251
+ MECXFilterOptionsComponent,
2252
+ MECXFilterOptionsCurrencyComponent,
2253
+ MECXFilterOptionsDateRangeComponent,
2254
+ MECXFilterOptionsInputComponent,
2255
+ MECXFilterOptionsStatusComponent] });
2256
+ MECXFilterOptionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsModule, imports: [[
2257
+ CommonModule,
2258
+ FormsModule,
2259
+ MonkeyBadgeModule,
2260
+ MonkeyButtonModule,
2261
+ MonkeyCheckboxModule,
2262
+ MonkeyDateRangePickerModule,
2263
+ MonkeyEcxDirectivesModule,
2264
+ MonkeyIconModule,
2265
+ MonkeyInputModule,
2266
+ MonkeyOptionModule,
2267
+ MonkeySelectModule,
2268
+ ReactiveFormsModule,
2269
+ RouterModule,
2270
+ TranslateModule.forChild()
2271
+ ]] });
2272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterOptionsModule, decorators: [{
2273
+ type: NgModule,
2274
+ args: [{
2275
+ declarations: [
2276
+ MECXFilterOptionsChildrenComponent,
2277
+ MECXFilterOptionsComponent,
2278
+ MECXFilterOptionsCurrencyComponent,
2279
+ MECXFilterOptionsDateRangeComponent,
2280
+ MECXFilterOptionsInputComponent,
2281
+ MECXFilterOptionsStatusComponent
2282
+ ],
2283
+ imports: [
2284
+ CommonModule,
2285
+ FormsModule,
2286
+ MonkeyBadgeModule,
2287
+ MonkeyButtonModule,
2288
+ MonkeyCheckboxModule,
2289
+ MonkeyDateRangePickerModule,
2290
+ MonkeyEcxDirectivesModule,
2291
+ MonkeyIconModule,
2292
+ MonkeyInputModule,
2293
+ MonkeyOptionModule,
2294
+ MonkeySelectModule,
2295
+ ReactiveFormsModule,
2296
+ RouterModule,
2297
+ TranslateModule.forChild()
2298
+ ],
2299
+ exports: [
2300
+ MECXFilterOptionsChildrenComponent,
2301
+ MECXFilterOptionsComponent,
2302
+ MECXFilterOptionsCurrencyComponent,
2303
+ MECXFilterOptionsDateRangeComponent,
2304
+ MECXFilterOptionsInputComponent,
2305
+ MECXFilterOptionsStatusComponent
2306
+ ]
2307
+ }]
2308
+ }] });
2309
+
2310
+ class MECXFilterMenuModule {
2311
+ }
2312
+ MECXFilterMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2313
+ MECXFilterMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuModule, declarations: [MECXFilterMenuComponent], imports: [CommonModule,
2314
+ FormsModule,
2315
+ ReactiveFormsModule,
2316
+ MonkeyEcxDirectivesModule,
2317
+ MonkeyButtonModule,
2318
+ MonkeyBadgeModule,
2319
+ MonkeyIconModule,
2320
+ MonkeyInputModule,
2321
+ MonkeyCheckboxModule,
2322
+ MonkeySelectModule,
2323
+ MonkeyOptionModule,
2324
+ MonkeyDateRangePickerModule,
2325
+ RouterModule,
2326
+ MECXFilterOptionsModule, i1$3.TranslateModule], exports: [MECXFilterMenuComponent] });
2327
+ MECXFilterMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuModule, imports: [[
2328
+ CommonModule,
2329
+ FormsModule,
2330
+ ReactiveFormsModule,
2331
+ MonkeyEcxDirectivesModule,
2332
+ MonkeyButtonModule,
2333
+ MonkeyBadgeModule,
2334
+ MonkeyIconModule,
2335
+ MonkeyInputModule,
2336
+ MonkeyCheckboxModule,
2337
+ MonkeySelectModule,
2338
+ MonkeyOptionModule,
2339
+ MonkeyDateRangePickerModule,
2340
+ RouterModule,
2341
+ MECXFilterOptionsModule,
2342
+ TranslateModule.forChild()
2343
+ ]] });
2344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterMenuModule, decorators: [{
2345
+ type: NgModule,
2346
+ args: [{
2347
+ declarations: [MECXFilterMenuComponent],
2348
+ imports: [
2349
+ CommonModule,
2350
+ FormsModule,
2351
+ ReactiveFormsModule,
2352
+ MonkeyEcxDirectivesModule,
2353
+ MonkeyButtonModule,
2354
+ MonkeyBadgeModule,
2355
+ MonkeyIconModule,
2356
+ MonkeyInputModule,
2357
+ MonkeyCheckboxModule,
2358
+ MonkeySelectModule,
2359
+ MonkeyOptionModule,
2360
+ MonkeyDateRangePickerModule,
2361
+ RouterModule,
2362
+ MECXFilterOptionsModule,
2363
+ TranslateModule.forChild()
2364
+ ],
2365
+ exports: [MECXFilterMenuComponent]
2366
+ }]
2367
+ }] });
2368
+
2369
+ class MECXFilterSelectedModule {
2370
+ }
2371
+ MECXFilterSelectedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2372
+ MECXFilterSelectedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedModule, declarations: [MECXFilterSelectedComponent,
2373
+ MECXFilterSelectedItemChildrenComponent,
2374
+ MECXFilterSelectedItemComponent,
2375
+ MECXFilterSelectedItemCurrencyComponent,
2376
+ MECXFilterSelectedItemDateRangeComponent,
2377
+ MECXFilterSelectedItemDateWithActionComponent,
2378
+ MECXFilterSelectedItemInputComponent,
2379
+ MECXFilterSelectedItemStatusComponent], imports: [CommonModule,
2380
+ FormsModule,
2381
+ MECXFilterOptionsModule,
2382
+ MonkeyBadgeModule,
2383
+ MonkeyButtonModule,
2384
+ MonkeyCheckboxModule,
2385
+ MonkeyDateRangePickerModule,
2386
+ MonkeyEcxDirectivesModule,
2387
+ MonkeyEcxPipesModule,
2388
+ MonkeyIconModule,
2389
+ MonkeyInputModule,
2390
+ MonkeyOptionModule,
2391
+ MonkeySelectModule,
2392
+ ReactiveFormsModule,
2393
+ RouterModule, i1$3.TranslateModule], exports: [MECXFilterSelectedComponent] });
2394
+ MECXFilterSelectedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedModule, imports: [[
2395
+ CommonModule,
2396
+ FormsModule,
2397
+ MECXFilterOptionsModule,
2398
+ MonkeyBadgeModule,
2399
+ MonkeyButtonModule,
2400
+ MonkeyCheckboxModule,
2401
+ MonkeyDateRangePickerModule,
2402
+ MonkeyEcxDirectivesModule,
2403
+ MonkeyEcxPipesModule,
2404
+ MonkeyIconModule,
2405
+ MonkeyInputModule,
2406
+ MonkeyOptionModule,
2407
+ MonkeySelectModule,
2408
+ ReactiveFormsModule,
2409
+ RouterModule,
2410
+ TranslateModule.forChild()
2411
+ ]] });
2412
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterSelectedModule, decorators: [{
2413
+ type: NgModule,
2414
+ args: [{
2415
+ declarations: [
2416
+ MECXFilterSelectedComponent,
2417
+ MECXFilterSelectedItemChildrenComponent,
2418
+ MECXFilterSelectedItemComponent,
2419
+ MECXFilterSelectedItemCurrencyComponent,
2420
+ MECXFilterSelectedItemDateRangeComponent,
2421
+ MECXFilterSelectedItemDateWithActionComponent,
2422
+ MECXFilterSelectedItemInputComponent,
2423
+ MECXFilterSelectedItemStatusComponent
2424
+ ],
2425
+ imports: [
2426
+ CommonModule,
2427
+ FormsModule,
2428
+ MECXFilterOptionsModule,
2429
+ MonkeyBadgeModule,
2430
+ MonkeyButtonModule,
2431
+ MonkeyCheckboxModule,
2432
+ MonkeyDateRangePickerModule,
2433
+ MonkeyEcxDirectivesModule,
2434
+ MonkeyEcxPipesModule,
2435
+ MonkeyIconModule,
2436
+ MonkeyInputModule,
2437
+ MonkeyOptionModule,
2438
+ MonkeySelectModule,
2439
+ ReactiveFormsModule,
2440
+ RouterModule,
2441
+ TranslateModule.forChild()
2442
+ ],
2443
+ exports: [MECXFilterSelectedComponent]
2444
+ }]
2445
+ }] });
2446
+
2447
+ class MECXFilterModule {
2448
+ }
2449
+ MECXFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2450
+ MECXFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterModule, declarations: [MECXFilterComponent], imports: [MonkeyEcxDirectivesModule,
2451
+ MonkeyEcxPipesModule,
2452
+ MonkeyButtonModule,
2453
+ MonkeyInputModule,
2454
+ MonkeyIconModule,
2455
+ MonkeySelectModule,
2456
+ MonkeyOptionModule, i1$3.TranslateModule, MECXFilterMenuModule,
2457
+ MECXFilterSelectedModule,
2458
+ CommonModule,
2459
+ FormsModule,
2460
+ ReactiveFormsModule], exports: [MECXFilterComponent] });
2461
+ MECXFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterModule, imports: [[
2462
+ MonkeyEcxDirectivesModule,
2463
+ MonkeyEcxPipesModule,
2464
+ MonkeyButtonModule,
2465
+ MonkeyInputModule,
2466
+ MonkeyIconModule,
2467
+ MonkeySelectModule,
2468
+ MonkeyOptionModule,
2469
+ TranslateModule.forChild(),
2470
+ MECXFilterMenuModule,
2471
+ MECXFilterSelectedModule,
2472
+ CommonModule,
2473
+ FormsModule,
2474
+ ReactiveFormsModule
2475
+ ]] });
2476
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXFilterModule, decorators: [{
2477
+ type: NgModule,
2478
+ args: [{
2479
+ declarations: [MECXFilterComponent],
2480
+ imports: [
2481
+ MonkeyEcxDirectivesModule,
2482
+ MonkeyEcxPipesModule,
2483
+ MonkeyButtonModule,
2484
+ MonkeyInputModule,
2485
+ MonkeyIconModule,
2486
+ MonkeySelectModule,
2487
+ MonkeyOptionModule,
2488
+ TranslateModule.forChild(),
2489
+ MECXFilterMenuModule,
2490
+ MECXFilterSelectedModule,
2491
+ CommonModule,
2492
+ FormsModule,
2493
+ ReactiveFormsModule
2494
+ ],
2495
+ exports: [MECXFilterComponent]
2496
+ }]
2497
+ }] });
2498
+
2499
+ class MECXPasswordStrengthComponent {
2500
+ constructor(configService) {
2501
+ this.configService = configService;
2502
+ this.passwordToCheck = null;
2503
+ this.i18n = null;
2504
+ this.onHandleSubmitReady = new EventEmitter();
2505
+ this._validatorsPasswordPass = [];
2506
+ this._stepPassword = 0;
2507
+ this.validatorsPassword = new Map();
2508
+ // not do
2509
+ }
2510
+ handleColor(score) {
2511
+ let idx = 0;
2512
+ if (score > 50)
2513
+ idx = 1;
2514
+ if (score === 100)
2515
+ idx = 2;
2516
+ this._stepPassword = idx;
2517
+ }
2518
+ passwordStrengthValidator(pass) {
2519
+ this._validatorsPasswordPass = [];
2520
+ let score = 0;
2521
+ this.validatorsPassword.forEach((key, value) => {
2522
+ this._validatorsPasswordPass.push({
2523
+ regex: `${value}`,
2524
+ validate: `${key.VALIDATE}` === String(RegExp(`${key.REGEX}`).test(pass)),
2525
+ percent: 100 / this.validatorsPassword.size
2526
+ });
2527
+ });
2528
+ this._validatorsPasswordPass.forEach((check) => {
2529
+ if (check.validate) {
2530
+ score += check.percent;
2531
+ }
2532
+ });
2533
+ return Math.trunc(score);
2534
+ }
2535
+ onHandleReady() {
2536
+ var _a;
2537
+ const validate = (_a = this._validatorsPasswordPass) === null || _a === void 0 ? void 0 : _a.find(({ validate }) => { return !validate; });
2538
+ this.onHandleSubmitReady.next(!validate);
2539
+ }
2540
+ onHandleChages() {
2541
+ const password = this.passwordToCheck;
2542
+ this.handleColor(this.passwordStrengthValidator(password));
2543
+ this.onHandleReady();
2544
+ }
2545
+ onHandlePasswordStrengthKeys(params) {
2546
+ var _a, _b, _c;
2547
+ const ps = (_c = (_b = (_a = params === null || params === void 0 ? void 0 : params.program) === null || _a === void 0 ? void 0 : _a.screens) === null || _b === void 0 ? void 0 : _b.login) === null || _c === void 0 ? void 0 : _c.passwordStrength;
2548
+ if (ps) {
2549
+ Object.entries(ps)
2550
+ .forEach(([key, value]) => {
2551
+ if (MonkeyEcxUtils.persistNullEmptyUndefined(value)) {
2552
+ this.validatorsPassword.set(key, value);
2553
+ }
2554
+ });
2555
+ this.onHandleChages();
2556
+ }
2557
+ }
2558
+ ngOnInit() {
2559
+ this.configService.config().subscribe((_) => {
2560
+ this.onHandlePasswordStrengthKeys(_);
2561
+ });
2562
+ }
2563
+ ngOnChanges() {
2564
+ this.onHandleChages();
2565
+ }
2566
+ }
2567
+ MECXPasswordStrengthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthComponent, deps: [{ token: i1$4.MonkeyEcxConfigService }], target: i0.ɵɵFactoryTarget.Component });
2568
+ MECXPasswordStrengthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXPasswordStrengthComponent, selector: "mecx-password-strength", inputs: { passwordToCheck: "passwordToCheck", i18n: "i18n" }, outputs: { onHandleSubmitReady: "onHandleSubmitReady" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"_validatorsPasswordPass?.length\">\n <div id=\"strength\" class=\"d-flex full-width flex-column justify-content-center align-items-center\"\n #strength>\n <div id=\"strengthBar\" class=\"strength-bar d-flex full-width flex-row\">\n <div class=\"d-flex full-width align-items-center\">\n <div class=\"bar-label\">\n <small>{{ i18n?.TITLE }}</small>\n </div>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.error]=\"_stepPassword === 0\"\n [class.warning]=\"_stepPassword === 1\"\n [class.success]=\"_stepPassword === 2\">\n </div>\n <ng-container *ngIf=\"_stepPassword === 0\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.warning]=\"_stepPassword === 1\"\n [class.success]=\"_stepPassword === 2\"></div>\n <ng-container *ngIf=\"_stepPassword === 1\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.success]=\"_stepPassword === 2\"></div>\n <ng-container *ngIf=\"_stepPassword === 2\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"callbacks mt-2 row\">\n <div class=\"col-sm-6 mt-2 d-flex justify-content-start\"\n *ngFor=\"let validators of _validatorsPasswordPass\">\n <monkey-icon *ngIf=\"validators.validate\" icon=\"check-circle-20\"></monkey-icon>\n <monkey-icon *ngIf=\"!validators.validate\" icon=\"error-20\"></monkey-icon>\n <span class=\"ml-2\">\n {{ i18n?.TYPES?.[validators.regex] }}\n </span>\n </div>\n </div>\n</ng-container>\n<ng-template #stepPasswordLabel>\n <div class=\"name-point mt-1\" [class.error]=\"_stepPassword === 0\"\n [class.warning]=\"_stepPassword === 1\" [class.success]=\"_stepPassword === 2\">\n {{ i18n?.LABELS?.[_stepPassword] }}\n </div>\n</ng-template>", styles: ["mecx-password-strength{margin-bottom:8px}mecx-password-strength .strength-bar{display:inline;list-style:none;padding:0;vertical-align:2px;gap:.5rem}mecx-password-strength .strength-bar .bar-label{font-style:normal;font-weight:400;font-size:14px;line-height:16px;color:#4b4a53;text-align:left}mecx-password-strength .strength-bar .point:last-child{margin:0}mecx-password-strength .callbacks{font-style:normal;font-weight:400;font-size:14px;line-height:16px;color:#72717e;text-align:left}mecx-password-strength .point{background:#ebebeb;border-radius:8px;display:inline-block;height:8px;margin-right:4px;width:100%}mecx-password-strength .point.success{background:var(--mecx-color-success-main)}mecx-password-strength .point.warning{background:var(--mecx-color-warning-main)}mecx-password-strength .point.error{background:var(--mecx-color-error-main)}mecx-password-strength .name-point.success{color:var(--mecx-color-success-main)}mecx-password-strength .name-point.warning{color:var(--mecx-color-warning-main)}mecx-password-strength .name-point.error{color:var(--mecx-color-error-main)}\n"], components: [{ type: i1$2.MonkeyIconComponent, selector: "monkey-icon", inputs: ["icon", "color", "contrast", "disabled"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], encapsulation: i0.ViewEncapsulation.None });
2569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthComponent, decorators: [{
2570
+ type: Component,
2571
+ args: [{ selector: 'mecx-password-strength', encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"_validatorsPasswordPass?.length\">\n <div id=\"strength\" class=\"d-flex full-width flex-column justify-content-center align-items-center\"\n #strength>\n <div id=\"strengthBar\" class=\"strength-bar d-flex full-width flex-row\">\n <div class=\"d-flex full-width align-items-center\">\n <div class=\"bar-label\">\n <small>{{ i18n?.TITLE }}</small>\n </div>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.error]=\"_stepPassword === 0\"\n [class.warning]=\"_stepPassword === 1\"\n [class.success]=\"_stepPassword === 2\">\n </div>\n <ng-container *ngIf=\"_stepPassword === 0\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.warning]=\"_stepPassword === 1\"\n [class.success]=\"_stepPassword === 2\"></div>\n <ng-container *ngIf=\"_stepPassword === 1\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n <div class=\"d-flex full-width align-items-center flex-column\">\n <div class=\"point\" [class.success]=\"_stepPassword === 2\"></div>\n <ng-container *ngIf=\"_stepPassword === 2\">\n <ng-container *ngTemplateOutlet=\"stepPasswordLabel\"></ng-container>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"callbacks mt-2 row\">\n <div class=\"col-sm-6 mt-2 d-flex justify-content-start\"\n *ngFor=\"let validators of _validatorsPasswordPass\">\n <monkey-icon *ngIf=\"validators.validate\" icon=\"check-circle-20\"></monkey-icon>\n <monkey-icon *ngIf=\"!validators.validate\" icon=\"error-20\"></monkey-icon>\n <span class=\"ml-2\">\n {{ i18n?.TYPES?.[validators.regex] }}\n </span>\n </div>\n </div>\n</ng-container>\n<ng-template #stepPasswordLabel>\n <div class=\"name-point mt-1\" [class.error]=\"_stepPassword === 0\"\n [class.warning]=\"_stepPassword === 1\" [class.success]=\"_stepPassword === 2\">\n {{ i18n?.LABELS?.[_stepPassword] }}\n </div>\n</ng-template>", styles: ["mecx-password-strength{margin-bottom:8px}mecx-password-strength .strength-bar{display:inline;list-style:none;padding:0;vertical-align:2px;gap:.5rem}mecx-password-strength .strength-bar .bar-label{font-style:normal;font-weight:400;font-size:14px;line-height:16px;color:#4b4a53;text-align:left}mecx-password-strength .strength-bar .point:last-child{margin:0}mecx-password-strength .callbacks{font-style:normal;font-weight:400;font-size:14px;line-height:16px;color:#72717e;text-align:left}mecx-password-strength .point{background:#ebebeb;border-radius:8px;display:inline-block;height:8px;margin-right:4px;width:100%}mecx-password-strength .point.success{background:var(--mecx-color-success-main)}mecx-password-strength .point.warning{background:var(--mecx-color-warning-main)}mecx-password-strength .point.error{background:var(--mecx-color-error-main)}mecx-password-strength .name-point.success{color:var(--mecx-color-success-main)}mecx-password-strength .name-point.warning{color:var(--mecx-color-warning-main)}mecx-password-strength .name-point.error{color:var(--mecx-color-error-main)}\n"] }]
2572
+ }], ctorParameters: function () { return [{ type: i1$4.MonkeyEcxConfigService }]; }, propDecorators: { passwordToCheck: [{
2573
+ type: Input
2574
+ }], i18n: [{
2575
+ type: Input
2576
+ }], onHandleSubmitReady: [{
2577
+ type: Output
2578
+ }] } });
2579
+
2580
+ class MECXPasswordStrengthModule {
2581
+ }
2582
+ MECXPasswordStrengthModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2583
+ MECXPasswordStrengthModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthModule, declarations: [MECXPasswordStrengthComponent], imports: [CommonModule,
2584
+ FormsModule,
2585
+ ReactiveFormsModule,
2586
+ MonkeyEcxPipesModule,
2587
+ MonkeyEcxDirectivesModule,
2588
+ MonkeyButtonModule,
2589
+ MonkeyInputModule,
2590
+ MonkeyIconModule, i1$3.TranslateModule], exports: [MECXPasswordStrengthComponent] });
2591
+ MECXPasswordStrengthModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthModule, imports: [[
2592
+ CommonModule,
2593
+ FormsModule,
2594
+ ReactiveFormsModule,
2595
+ MonkeyEcxPipesModule,
2596
+ MonkeyEcxDirectivesModule,
2597
+ MonkeyButtonModule,
2598
+ MonkeyInputModule,
2599
+ MonkeyIconModule,
2600
+ TranslateModule.forChild()
2601
+ ]] });
2602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXPasswordStrengthModule, decorators: [{
2603
+ type: NgModule,
2604
+ args: [{
2605
+ declarations: [MECXPasswordStrengthComponent],
2606
+ imports: [
2607
+ CommonModule,
2608
+ FormsModule,
2609
+ ReactiveFormsModule,
2610
+ MonkeyEcxPipesModule,
2611
+ MonkeyEcxDirectivesModule,
2612
+ MonkeyButtonModule,
2613
+ MonkeyInputModule,
2614
+ MonkeyIconModule,
2615
+ TranslateModule.forChild()
2616
+ ],
2617
+ exports: [MECXPasswordStrengthComponent]
2618
+ }]
2619
+ }] });
2620
+
2621
+ class MECXProgressBarService {
2622
+ constructor(router) {
2623
+ this.router = router;
2624
+ this.visible = new BehaviorSubject(false);
2625
+ this.init();
2626
+ }
2627
+ init() {
2628
+ this.router.events
2629
+ .pipe(filter((event) => {
2630
+ return event instanceof NavigationStart;
2631
+ }))
2632
+ .subscribe(() => {
2633
+ this.show();
2634
+ });
2635
+ this.router.events
2636
+ .pipe(filter((event) => {
2637
+ return (event instanceof NavigationEnd ||
2638
+ event instanceof NavigationError ||
2639
+ event instanceof NavigationCancel);
2640
+ }))
2641
+ .subscribe(() => {
2642
+ this.hide();
2643
+ });
2644
+ }
2645
+ show() {
2646
+ this.visible.next(true);
2647
+ }
2648
+ hide() {
2649
+ this.visible.next(false);
2650
+ }
2651
+ visibleConfig() {
2652
+ return this.visible.asObservable();
2653
+ }
2654
+ }
2655
+ MECXProgressBarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2656
+ MECXProgressBarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarService, providedIn: 'root' });
2657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarService, decorators: [{
2658
+ type: Injectable,
2659
+ args: [{
2660
+ providedIn: 'root'
2661
+ }]
2662
+ }], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
2663
+
2664
+ class MECXProgressBarComponent extends BaseComponent {
2665
+ constructor(progressBarService) {
2666
+ super();
2667
+ this.progressBarService = progressBarService;
2668
+ this.visible = false;
2669
+ }
2670
+ ngOnInit() {
2671
+ this.progressBarService
2672
+ .visibleConfig()
2673
+ .pipe(takeUntil(this.__unsubscribeAll))
2674
+ .subscribe((visible) => {
2675
+ this.visible = visible;
2676
+ });
2677
+ }
2678
+ }
2679
+ MECXProgressBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarComponent, deps: [{ token: MECXProgressBarService }], target: i0.ɵɵFactoryTarget.Component });
2680
+ MECXProgressBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXProgressBarComponent, selector: "mecx-progress-bar", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>", styles: ["app-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
2681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarComponent, decorators: [{
2682
+ type: Component,
2683
+ args: [{ selector: 'mecx-progress-bar', encapsulation: ViewEncapsulation.None, template: "<ng-container *ngIf=\"visible\">\n <progress class=\"monkey-progress monkey-progress__theme\"></progress>\n</ng-container>", styles: ["app-progress-bar{position:absolute;width:100%;margin-top:-9.5px;z-index:99998}\n"] }]
2684
+ }], ctorParameters: function () { return [{ type: MECXProgressBarService }]; } });
2685
+
2686
+ class MECXProgressBarModule {
2687
+ }
2688
+ MECXProgressBarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2689
+ MECXProgressBarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarModule, declarations: [MECXProgressBarComponent], imports: [CommonModule], exports: [MECXProgressBarComponent] });
2690
+ MECXProgressBarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarModule, imports: [[CommonModule]] });
2691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProgressBarModule, decorators: [{
2692
+ type: NgModule,
2693
+ args: [{
2694
+ declarations: [MECXProgressBarComponent],
2695
+ imports: [CommonModule],
2696
+ exports: [MECXProgressBarComponent]
2697
+ }]
2698
+ }] });
2699
+
2700
+ class ProductsModel {
2701
+ constructor(data) {
2702
+ this.url = data === null || data === void 0 ? void 0 : data.url;
2703
+ this.token = data === null || data === void 0 ? void 0 : data.token;
2704
+ this.username = data === null || data === void 0 ? void 0 : data.username;
2705
+ this.ownerGovernmentId = data === null || data === void 0 ? void 0 : data.ownerGovernmentId;
2706
+ this.ownerName = data === null || data === void 0 ? void 0 : data.ownerName;
2707
+ this.product = data === null || data === void 0 ? void 0 : data.product;
2708
+ this.name = data === null || data === void 0 ? void 0 : data.name;
2709
+ this.type = data === null || data === void 0 ? void 0 : data.type;
2710
+ this.handleLogo();
2711
+ }
2712
+ handleLogo() {
2713
+ const { product, token, url } = this;
2714
+ if (!url)
2715
+ return;
2716
+ const sufix = {
2717
+ SALES_FINANCE: 'SF_',
2718
+ SPIKE: 'SF_',
2719
+ SUPPLY_CHAIN: 'SF_'
2720
+ }[product];
2721
+ const { hostname } = new URL(url);
2722
+ const lastDot = hostname === null || hostname === void 0 ? void 0 : hostname.lastIndexOf('.');
2723
+ const previousLastDot = hostname === null || hostname === void 0 ? void 0 : hostname.lastIndexOf('.', lastDot - 1);
2724
+ const domain = hostname === null || hostname === void 0 ? void 0 : hostname.substring(previousLastDot + 1, hostname === null || hostname === void 0 ? void 0 : hostname.length);
2725
+ const handledToken = token === null || token === void 0 ? void 0 : token.replace(sufix, '');
2726
+ const path = {
2727
+ 'monkeyecx.com': 'scf/br',
2728
+ 'monkey.exchange': 'scf/br',
2729
+ 'monkeyexchange.cl': 'scf/cl',
2730
+ 'sales.finance': 'sf',
2731
+ 'spike.cash': 'spike',
2732
+ 'monkey.credit': 'credit'
2733
+ }[domain];
2734
+ this.logo = `https://assets.monkey.exchange/${path}/wl/${handledToken}/login.svg`.toLowerCase();
2735
+ }
2736
+ }
2737
+
2738
+ class MECXProductsFilterComponent {
2739
+ constructor() {
2740
+ this.isLoading = false;
2741
+ this.onChangeFilter = new EventEmitter();
2742
+ this._search = '';
2743
+ // not to do
2744
+ }
2745
+ onSearchFilter(event) {
2746
+ this._search = event;
2747
+ if (!event) {
2748
+ this.onChangeFilter.next('');
2749
+ return;
2750
+ }
2751
+ event = `${event}`.toLowerCase();
2752
+ this.onChangeFilter.next(event);
2753
+ }
2754
+ onClearFilter() {
2755
+ this._search = '';
2756
+ this.onChangeFilter.next(this._search);
2757
+ }
2758
+ }
2759
+ MECXProductsFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsFilterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2760
+ MECXProductsFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXProductsFilterComponent, selector: "mecx-products-filter", inputs: { isLoading: "isLoading" }, outputs: { onChangeFilter: "onChangeFilter" }, ngImport: i0, template: "<monkey-input-filter [placeholder]=\"'SIDEBAR-ACTIONS.PROFILE.FILTER.SEARCH-INPUT' | translate\"\n (onChange)=\"onSearchFilter($event)\" icon=\"search-16\" [(value)]=\"_search\">\n</monkey-input-filter>\n<monkey-button type=\"filter\" color=\"border\" (click)=\"onClearFilter()\">\n Limpar\n</monkey-button>", styles: [":host{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}:host ::ng-deep mecx-form-field-filter mecx-form-field-body{height:44px}:host ::ng-deep monkey-input-filter{width:100%}@media screen and (min-width: 960px){:host ::ng-deep monkey-input-filter{margin-right:8px}}\n"], components: [{ type: i1$2.MonkeyInputFilterComponent, selector: "monkey-input-filter", inputs: ["name", "label", "helperMessage", "placeholder", "icon", "type", "infoMessage", "errorMessage", "mask", "prefix", "onlyNumber", "onlyAlphaNumeric", "upperCase", "lowerCase", "capitalize", "currency", "iconPosition", "value"], outputs: ["onChange"] }, { type: i1$2.MonkeyButtonComponent, selector: "monkey-button", inputs: ["label", "icon", "iconPosition", "type", "color", "disabled", "size"] }], pipes: { "translate": i1$3.TranslatePipe } });
2761
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsFilterComponent, decorators: [{
2762
+ type: Component,
2763
+ args: [{ selector: 'mecx-products-filter', template: "<monkey-input-filter [placeholder]=\"'SIDEBAR-ACTIONS.PROFILE.FILTER.SEARCH-INPUT' | translate\"\n (onChange)=\"onSearchFilter($event)\" icon=\"search-16\" [(value)]=\"_search\">\n</monkey-input-filter>\n<monkey-button type=\"filter\" color=\"border\" (click)=\"onClearFilter()\">\n Limpar\n</monkey-button>", styles: [":host{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}:host ::ng-deep mecx-form-field-filter mecx-form-field-body{height:44px}:host ::ng-deep monkey-input-filter{width:100%}@media screen and (min-width: 960px){:host ::ng-deep monkey-input-filter{margin-right:8px}}\n"] }]
2764
+ }], ctorParameters: function () { return []; }, propDecorators: { isLoading: [{
2765
+ type: Input
2766
+ }], onChangeFilter: [{
2767
+ type: Output
2768
+ }] } });
2769
+
2770
+ class MECXProductsComponent extends BaseComponent {
2771
+ constructor(tokenStorage) {
2772
+ super();
2773
+ this.tokenStorage = tokenStorage;
2774
+ this.onAccess = new EventEmitter();
2775
+ this._filter = '';
2776
+ this._hasMoreProducts = false;
2777
+ }
2778
+ onImgError(img) {
2779
+ const index = Math.floor(Math.random() * (6 - 1 + 1)) + 1;
2780
+ img.src = `https://assets.monkeyecx.com/icons/icon-${index}.svg`;
2781
+ img.className = 'no-image';
2782
+ }
2783
+ onHandleProducts() {
2784
+ const { _filter } = this;
2785
+ this._filteredProducts = this._products.map(({ name, items }) => {
2786
+ const found = items === null || items === void 0 ? void 0 : items.filter((_) => {
2787
+ const cmpA = `${_.name}`.toLowerCase();
2788
+ const cmpB = `${_filter}`.toLowerCase();
2789
+ return cmpA.includes(cmpB);
2790
+ });
2791
+ if (found && found.length) {
2792
+ return {
2793
+ name,
2794
+ items: found
2795
+ };
2796
+ }
2797
+ return null;
2798
+ }).filter((_) => { return _; });
2799
+ }
2800
+ onHandleMe() {
2801
+ var _a, _b, _c;
2802
+ const programs = (_b = (_a = this.tokenStorage.getMe()) === null || _a === void 0 ? void 0 : _a.programs) === null || _b === void 0 ? void 0 : _b.map((_) => {
2803
+ return new ProductsModel(_);
2804
+ });
2805
+ const onlyUnique = (value, index, self) => {
2806
+ return self.indexOf(value) === index;
2807
+ };
2808
+ const products = programs.map(({ product }) => {
2809
+ return product;
2810
+ }).filter(onlyUnique);
2811
+ this._hasMoreProducts = ((products === null || products === void 0 ? void 0 : products.length) || 0) > 1;
2812
+ this._products = (_c = Object.entries(products).map(([key, value]) => {
2813
+ var _a;
2814
+ const found = (_a = programs.filter(({ product }) => {
2815
+ return `${product}` === `${value}`;
2816
+ })) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
2817
+ const groupA = `${a === null || a === void 0 ? void 0 : a.name}`.toLowerCase();
2818
+ const groupB = `${b === null || b === void 0 ? void 0 : b.name}`.toLowerCase();
2819
+ return groupA !== groupB ? 1 : -1;
2820
+ });
2821
+ return {
2822
+ name: value,
2823
+ items: found
2824
+ };
2825
+ })) === null || _c === void 0 ? void 0 : _c.sort((a, b) => {
2826
+ const groupA = `${a === null || a === void 0 ? void 0 : a.name}`.toLowerCase();
2827
+ const groupB = `${b === null || b === void 0 ? void 0 : b.name}`.toLowerCase();
2828
+ return groupA !== groupB ? -1 : 1;
2829
+ });
2830
+ this._filteredProducts = this._products;
2831
+ }
2832
+ ngOnInit() {
2833
+ this.tokenStorage
2834
+ .meHasChanged()
2835
+ .pipe(takeUntil(this.__unsubscribeAll))
2836
+ .subscribe(() => {
2837
+ this.onHandleMe();
2838
+ });
2839
+ }
2840
+ onHandleChangeFilter(event) {
2841
+ this._filter = event;
2842
+ this.onHandleProducts();
2843
+ }
2844
+ }
2845
+ MECXProductsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsComponent, deps: [{ token: i1$4.MonkeyEcxTokenStorageService }], target: i0.ɵɵFactoryTarget.Component });
2846
+ MECXProductsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: MECXProductsComponent, selector: "mecx-products", outputs: { onAccess: "onAccess" }, usesInheritance: true, ngImport: i0, template: "<mecx-products-filter (onChangeFilter)=\"onHandleChangeFilter($event)\"></mecx-products-filter>\r\n<div class=\"products-list\">\r\n <div *ngFor=\"let product of _filteredProducts\" class=\"product\">\r\n <span class=\"title\" *ngIf=\"_hasMoreProducts\">{{ 'PRODUCTS.'+product.name | translate }}</span>\r\n <div class=\"items\">\r\n <div *ngFor=\"let item of product.items\" class=\"item\"\r\n (click)=\"onAccess.next(item)\">\r\n <div class=\"icon\">\r\n <img [src]=\"item.logo\" #img (error)=\"onImgError(img)\">\r\n </div>\r\n <span class=\"name\">{{ item.name }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [":host{display:flex;flex-direction:column;overflow:hidden}:host .products-list{display:flex;flex-direction:column;overflow:auto}:host .product{display:flex;flex-direction:column}:host .product .title{font-style:normal;font-weight:600;font-size:24px;line-height:32px;letter-spacing:.04em;color:#4b4a53;margin:32px 0}:host .product .items{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px}:host .product .items .item{cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100px;padding:12px}:host .product .items .item .icon{margin:12px 0}:host .product .items .item .icon img{width:100%;max-width:140px}:host .product .items .item .icon .no-image{width:52px;height:52px}:host .product .items .item .name{font-style:normal;font-weight:400;font-size:18px;line-height:24px;color:#72717e;margin-top:8px}:host .product .items .item:hover{box-shadow:0 25px 52px 8px #eaeaeae0}\n"], components: [{ type: MECXProductsFilterComponent, selector: "mecx-products-filter", inputs: ["isLoading"], outputs: ["onChangeFilter"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i1$3.TranslatePipe } });
2847
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsComponent, decorators: [{
2848
+ type: Component,
2849
+ args: [{ selector: 'mecx-products', template: "<mecx-products-filter (onChangeFilter)=\"onHandleChangeFilter($event)\"></mecx-products-filter>\r\n<div class=\"products-list\">\r\n <div *ngFor=\"let product of _filteredProducts\" class=\"product\">\r\n <span class=\"title\" *ngIf=\"_hasMoreProducts\">{{ 'PRODUCTS.'+product.name | translate }}</span>\r\n <div class=\"items\">\r\n <div *ngFor=\"let item of product.items\" class=\"item\"\r\n (click)=\"onAccess.next(item)\">\r\n <div class=\"icon\">\r\n <img [src]=\"item.logo\" #img (error)=\"onImgError(img)\">\r\n </div>\r\n <span class=\"name\">{{ item.name }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [":host{display:flex;flex-direction:column;overflow:hidden}:host .products-list{display:flex;flex-direction:column;overflow:auto}:host .product{display:flex;flex-direction:column}:host .product .title{font-style:normal;font-weight:600;font-size:24px;line-height:32px;letter-spacing:.04em;color:#4b4a53;margin:32px 0}:host .product .items{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px}:host .product .items .item{cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100px;padding:12px}:host .product .items .item .icon{margin:12px 0}:host .product .items .item .icon img{width:100%;max-width:140px}:host .product .items .item .icon .no-image{width:52px;height:52px}:host .product .items .item .name{font-style:normal;font-weight:400;font-size:18px;line-height:24px;color:#72717e;margin-top:8px}:host .product .items .item:hover{box-shadow:0 25px 52px 8px #eaeaeae0}\n"] }]
2850
+ }], ctorParameters: function () { return [{ type: i1$4.MonkeyEcxTokenStorageService }]; }, propDecorators: { onAccess: [{
2851
+ type: Output
2852
+ }] } });
2853
+
2854
+ class MECXProductsModule {
2855
+ }
2856
+ MECXProductsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2857
+ MECXProductsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsModule, declarations: [MECXProductsComponent, MECXProductsFilterComponent], imports: [CommonModule, i1$3.TranslateModule, MonkeyInputModule, MonkeyButtonModule], exports: [MECXProductsComponent] });
2858
+ MECXProductsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsModule, imports: [[CommonModule, TranslateModule.forChild(), MonkeyInputModule, MonkeyButtonModule]] });
2859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MECXProductsModule, decorators: [{
2860
+ type: NgModule,
2861
+ args: [{
2862
+ declarations: [MECXProductsComponent, MECXProductsFilterComponent],
2863
+ imports: [CommonModule, TranslateModule.forChild(), MonkeyInputModule, MonkeyButtonModule],
2864
+ exports: [MECXProductsComponent]
2865
+ }]
2866
+ }] });
2867
+
2868
+ /*
2869
+ * Public API Surface of monkey-front-components
2870
+ */
2871
+
2872
+ /**
2873
+ * Generated bundle index. Do not edit.
2874
+ */
2875
+
2876
+ export { BaseComponent, BaseDynamic, BaseDynamicArray, BaseScrollComponent, MECXDynamicDirective, MECXDynamicFileUploadComponent, MECXDynamicFormArrayComponent, MECXDynamicFormComponent, MECXDynamicInputComponent, MECXDynamicInputPhoneComponent, MECXDynamicModule, MECXDynamicRadioComponent, MECXDynamicSelectComponent, MECXFilterComponent, MECXFilterModule, MECXPasswordStrengthComponent, MECXPasswordStrengthModule, MECXProductsComponent, MECXProductsModule, MECXProgressBarComponent, MECXProgressBarModule, MECXProgressBarService, validators };
2877
+ //# sourceMappingURL=monkey-front-components.mjs.map