@pepperi-addons/ngx-lib 0.4.0-angular14.36 → 0.4.0-angular14.39

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 (732) hide show
  1. package/address/address.component.d.ts +30 -30
  2. package/address/address.module.d.ts +15 -15
  3. package/address/index.d.ts +5 -5
  4. package/address/public-api.d.ts +2 -2
  5. package/attachment/attachment.component.d.ts +85 -85
  6. package/attachment/attachment.module.d.ts +14 -14
  7. package/attachment/index.d.ts +5 -5
  8. package/attachment/public-api.d.ts +2 -2
  9. package/bread-crumbs/bread-crumbs.component.d.ts +27 -27
  10. package/bread-crumbs/bread-crumbs.model.d.ts +11 -11
  11. package/bread-crumbs/bread-crumbs.module.d.ts +15 -15
  12. package/bread-crumbs/index.d.ts +5 -5
  13. package/bread-crumbs/public-api.d.ts +3 -3
  14. package/button/button.component.d.ts +102 -102
  15. package/button/button.model.d.ts +14 -14
  16. package/button/button.module.d.ts +13 -13
  17. package/button/index.d.ts +5 -5
  18. package/button/public-api.d.ts +3 -3
  19. package/carousel/carousel-item.directive.d.ts +12 -12
  20. package/carousel/carousel.component.d.ts +148 -148
  21. package/carousel/carousel.module.d.ts +8 -8
  22. package/carousel/index.d.ts +5 -5
  23. package/carousel/public-api.d.ts +3 -3
  24. package/checkbox/checkbox.component.d.ts +50 -50
  25. package/checkbox/checkbox.module.d.ts +19 -19
  26. package/checkbox/index.d.ts +5 -5
  27. package/checkbox/public-api.d.ts +2 -2
  28. package/chip/chip.component.d.ts +18 -0
  29. package/chip/chip.module.d.ts +19 -0
  30. package/chip/index.d.ts +5 -0
  31. package/chip/public-api.d.ts +2 -0
  32. package/color/color-picker.component.d.ts +57 -57
  33. package/color/color.component.d.ts +30 -30
  34. package/color/color.model.d.ts +1 -1
  35. package/color/color.module.d.ts +26 -26
  36. package/color/index.d.ts +5 -5
  37. package/color/public-api.d.ts +3 -3
  38. package/core/clipboard/clipboard.directive.d.ts +5 -5
  39. package/core/clipboard/clipboard.service.d.ts +5 -5
  40. package/core/clipboard/index.d.ts +1 -1
  41. package/core/clipboard/public-api.d.ts +2 -2
  42. package/core/common/directives/auto-width.directive.d.ts +19 -19
  43. package/core/common/directives/button-blur.directive.d.ts +9 -9
  44. package/core/common/directives/button-loader.directive.d.ts +26 -26
  45. package/core/common/directives/data-qa.directive.d.ts +11 -11
  46. package/core/common/directives/index.d.ts +1 -1
  47. package/core/common/directives/menu-blur.directive.d.ts +10 -10
  48. package/core/common/directives/prevent-multi-click.directive.d.ts +7 -7
  49. package/core/common/directives/print.directive.d.ts +75 -75
  50. package/core/common/directives/public-api.d.ts +7 -7
  51. package/core/common/index.d.ts +1 -1
  52. package/core/common/model/index.d.ts +1 -1
  53. package/core/common/model/papi.model.d.ts +2 -2
  54. package/core/common/model/public-api.d.ts +3 -3
  55. package/core/common/model/utilities.model.d.ts +5 -5
  56. package/core/common/model/wapi.model.d.ts +200 -200
  57. package/core/common/pipes/common-pipes.d.ts +57 -57
  58. package/core/common/pipes/date-ago.pipe.d.ts +11 -11
  59. package/core/common/pipes/index.d.ts +1 -1
  60. package/core/common/pipes/public-api.d.ts +2 -2
  61. package/core/common/public-api.d.ts +4 -4
  62. package/core/common/services/addon.service.d.ts +38 -38
  63. package/core/common/services/color.service.d.ts +51 -51
  64. package/core/common/services/cookie.service.d.ts +53 -53
  65. package/core/common/services/data-convertor.service.d.ts +44 -44
  66. package/core/common/services/file.service.d.ts +27 -27
  67. package/core/common/services/index.d.ts +1 -1
  68. package/core/common/services/jwt-helper.service.d.ts +13 -13
  69. package/core/common/services/public-api.d.ts +11 -11
  70. package/core/common/services/session.service.d.ts +18 -18
  71. package/core/common/services/translate.service.d.ts +12 -12
  72. package/core/common/services/utilities.service.d.ts +37 -37
  73. package/core/common/services/validator.service.d.ts +31 -31
  74. package/core/common/services/window-scrolling.service.d.ts +10 -10
  75. package/core/customization/customization.model.d.ts +266 -266
  76. package/core/customization/customization.service.d.ts +159 -159
  77. package/core/customization/index.d.ts +1 -1
  78. package/core/customization/public-api.d.ts +2 -2
  79. package/core/http/index.d.ts +1 -1
  80. package/core/http/interceptors/error.interceptor.d.ts +8 -8
  81. package/core/http/interceptors/index.d.ts +11 -11
  82. package/core/http/interceptors/loader.interceptor.d.ts +11 -11
  83. package/core/http/interceptors/profiler.interceptor.d.ts +8 -8
  84. package/core/http/public-api.d.ts +2 -2
  85. package/core/http/services/http.service.d.ts +28 -28
  86. package/core/http/services/loader.service.d.ts +13 -13
  87. package/core/index.d.ts +1 -1
  88. package/core/layout/index.d.ts +1 -1
  89. package/core/layout/layout.service.d.ts +36 -36
  90. package/core/layout/public-api.d.ts +2 -2
  91. package/core/layout/rtl.directive.d.ts +21 -21
  92. package/core/portal/attach.directive.d.ts +13 -13
  93. package/core/portal/index.d.ts +1 -1
  94. package/core/portal/portal.service.d.ts +12 -12
  95. package/core/portal/public-api.d.ts +3 -3
  96. package/core/portal/target.directive.d.ts +12 -12
  97. package/core/public-api.d.ts +7 -7
  98. package/core/scroll-to/index.d.ts +1 -1
  99. package/core/scroll-to/public-api.d.ts +1 -1
  100. package/core/scroll-to/scroll-to.service.d.ts +11 -11
  101. package/date/date.component.d.ts +69 -69
  102. package/date/date.model.d.ts +31 -31
  103. package/date/date.module.d.ts +23 -23
  104. package/date/index.d.ts +5 -5
  105. package/date/public-api.d.ts +2 -2
  106. package/dialog/default-dialog.component.d.ts +12 -12
  107. package/dialog/dialog.component.d.ts +13 -13
  108. package/dialog/dialog.model.d.ts +31 -31
  109. package/dialog/dialog.module.d.ts +18 -18
  110. package/dialog/dialog.service.d.ts +27 -27
  111. package/dialog/index.d.ts +5 -5
  112. package/dialog/public-api.d.ts +4 -4
  113. package/draggable-items/draggable-item/draggable-item.component.d.ts +11 -11
  114. package/draggable-items/draggable-items.component.d.ts +36 -36
  115. package/draggable-items/draggable-items.model.d.ts +11 -11
  116. package/draggable-items/draggable-items.module.d.ts +18 -18
  117. package/draggable-items/index.d.ts +5 -5
  118. package/draggable-items/public-api.d.ts +4 -4
  119. package/esm2020/address/address.component.mjs +108 -108
  120. package/esm2020/address/address.module.mjs +53 -53
  121. package/esm2020/address/pepperi-addons-ngx-lib-address.mjs +4 -4
  122. package/esm2020/address/public-api.mjs +5 -5
  123. package/esm2020/attachment/attachment.component.mjs +219 -219
  124. package/esm2020/attachment/attachment.module.mjs +49 -49
  125. package/esm2020/attachment/pepperi-addons-ngx-lib-attachment.mjs +4 -4
  126. package/esm2020/attachment/public-api.mjs +5 -5
  127. package/esm2020/bread-crumbs/bread-crumbs.component.mjs +84 -84
  128. package/esm2020/bread-crumbs/bread-crumbs.model.mjs +6 -6
  129. package/esm2020/bread-crumbs/bread-crumbs.module.mjs +49 -49
  130. package/esm2020/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.mjs +4 -4
  131. package/esm2020/bread-crumbs/public-api.mjs +6 -6
  132. package/esm2020/button/button.component.mjs +137 -137
  133. package/esm2020/button/button.model.mjs +5 -5
  134. package/esm2020/button/button.module.mjs +45 -45
  135. package/esm2020/button/pepperi-addons-ngx-lib-button.mjs +4 -4
  136. package/esm2020/button/public-api.mjs +6 -6
  137. package/esm2020/carousel/carousel-item.directive.mjs +32 -32
  138. package/esm2020/carousel/carousel.component.mjs +736 -736
  139. package/esm2020/carousel/carousel.module.mjs +16 -16
  140. package/esm2020/carousel/pepperi-addons-ngx-lib-carousel.mjs +4 -4
  141. package/esm2020/carousel/public-api.mjs +7 -7
  142. package/esm2020/checkbox/checkbox.component.mjs +167 -167
  143. package/esm2020/checkbox/checkbox.module.mjs +62 -62
  144. package/esm2020/checkbox/pepperi-addons-ngx-lib-checkbox.mjs +4 -4
  145. package/esm2020/checkbox/public-api.mjs +5 -5
  146. package/esm2020/chip/chip.component.mjs +36 -0
  147. package/esm2020/chip/chip.module.mjs +60 -0
  148. package/esm2020/chip/pepperi-addons-ngx-lib-chip.mjs +5 -0
  149. package/esm2020/chip/public-api.mjs +6 -0
  150. package/esm2020/color/color-picker.component.mjs +198 -198
  151. package/esm2020/color/color.component.mjs +89 -89
  152. package/esm2020/color/color.model.mjs +1 -1
  153. package/esm2020/color/color.module.mjs +92 -92
  154. package/esm2020/color/pepperi-addons-ngx-lib-color.mjs +4 -4
  155. package/esm2020/color/public-api.mjs +6 -6
  156. package/esm2020/core/clipboard/clipboard.directive.mjs +23 -23
  157. package/esm2020/core/clipboard/clipboard.service.mjs +13 -13
  158. package/esm2020/core/clipboard/index.mjs +4 -4
  159. package/esm2020/core/clipboard/public-api.mjs +5 -5
  160. package/esm2020/core/common/directives/auto-width.directive.mjs +76 -76
  161. package/esm2020/core/common/directives/button-blur.directive.mjs +23 -23
  162. package/esm2020/core/common/directives/button-loader.directive.mjs +111 -111
  163. package/esm2020/core/common/directives/data-qa.directive.mjs +22 -22
  164. package/esm2020/core/common/directives/index.mjs +4 -4
  165. package/esm2020/core/common/directives/menu-blur.directive.mjs +31 -31
  166. package/esm2020/core/common/directives/prevent-multi-click.directive.mjs +26 -26
  167. package/esm2020/core/common/directives/print.directive.mjs +144 -144
  168. package/esm2020/core/common/directives/public-api.mjs +11 -11
  169. package/esm2020/core/common/index.mjs +4 -4
  170. package/esm2020/core/common/model/index.mjs +4 -4
  171. package/esm2020/core/common/model/papi.model.mjs +2 -2
  172. package/esm2020/core/common/model/public-api.mjs +6 -6
  173. package/esm2020/core/common/model/utilities.model.mjs +56 -56
  174. package/esm2020/core/common/model/wapi.model.mjs +155 -155
  175. package/esm2020/core/common/pipes/common-pipes.mjs +166 -166
  176. package/esm2020/core/common/pipes/date-ago.pipe.mjs +45 -45
  177. package/esm2020/core/common/pipes/index.mjs +4 -4
  178. package/esm2020/core/common/pipes/public-api.mjs +5 -5
  179. package/esm2020/core/common/public-api.mjs +7 -7
  180. package/esm2020/core/common/services/addon.service.mjs +153 -151
  181. package/esm2020/core/common/services/color.service.mjs +358 -358
  182. package/esm2020/core/common/services/cookie.service.mjs +152 -152
  183. package/esm2020/core/common/services/data-convertor.service.mjs +118 -118
  184. package/esm2020/core/common/services/file.service.mjs +212 -212
  185. package/esm2020/core/common/services/index.mjs +4 -4
  186. package/esm2020/core/common/services/jwt-helper.service.mjs +105 -105
  187. package/esm2020/core/common/services/public-api.mjs +14 -14
  188. package/esm2020/core/common/services/session.service.mjs +70 -70
  189. package/esm2020/core/common/services/translate.service.mjs +45 -45
  190. package/esm2020/core/common/services/utilities.service.mjs +253 -253
  191. package/esm2020/core/common/services/validator.service.mjs +271 -271
  192. package/esm2020/core/common/services/window-scrolling.service.mjs +31 -31
  193. package/esm2020/core/customization/customization.model.mjs +289 -289
  194. package/esm2020/core/customization/customization.service.mjs +770 -770
  195. package/esm2020/core/customization/index.mjs +4 -4
  196. package/esm2020/core/customization/public-api.mjs +5 -5
  197. package/esm2020/core/http/index.mjs +4 -4
  198. package/esm2020/core/http/interceptors/error.interceptor.mjs +26 -26
  199. package/esm2020/core/http/interceptors/index.mjs +23 -23
  200. package/esm2020/core/http/interceptors/loader.interceptor.mjs +31 -31
  201. package/esm2020/core/http/interceptors/profiler.interceptor.mjs +31 -31
  202. package/esm2020/core/http/public-api.mjs +5 -5
  203. package/esm2020/core/http/services/http.service.mjs +154 -154
  204. package/esm2020/core/http/services/loader.service.mjs +49 -49
  205. package/esm2020/core/index.mjs +4 -4
  206. package/esm2020/core/layout/index.mjs +4 -4
  207. package/esm2020/core/layout/layout.service.mjs +167 -167
  208. package/esm2020/core/layout/public-api.mjs +5 -5
  209. package/esm2020/core/layout/rtl.directive.mjs +43 -43
  210. package/esm2020/core/portal/attach.directive.mjs +26 -26
  211. package/esm2020/core/portal/index.mjs +4 -4
  212. package/esm2020/core/portal/portal.service.mjs +35 -35
  213. package/esm2020/core/portal/public-api.mjs +6 -6
  214. package/esm2020/core/portal/target.directive.mjs +23 -23
  215. package/esm2020/core/public-api.mjs +10 -10
  216. package/esm2020/core/scroll-to/index.mjs +4 -4
  217. package/esm2020/core/scroll-to/public-api.mjs +5 -5
  218. package/esm2020/core/scroll-to/scroll-to.service.mjs +83 -83
  219. package/esm2020/date/date.component.mjs +294 -294
  220. package/esm2020/date/date.model.mjs +53 -53
  221. package/esm2020/date/date.module.mjs +87 -87
  222. package/esm2020/date/pepperi-addons-ngx-lib-date.mjs +4 -4
  223. package/esm2020/date/public-api.mjs +5 -5
  224. package/esm2020/dialog/default-dialog.component.mjs +36 -36
  225. package/esm2020/dialog/dialog.component.mjs +35 -35
  226. package/esm2020/dialog/dialog.model.mjs +32 -32
  227. package/esm2020/dialog/dialog.module.mjs +58 -58
  228. package/esm2020/dialog/dialog.service.mjs +81 -81
  229. package/esm2020/dialog/pepperi-addons-ngx-lib-dialog.mjs +4 -4
  230. package/esm2020/dialog/public-api.mjs +7 -7
  231. package/esm2020/draggable-items/draggable-item/draggable-item.component.mjs +26 -26
  232. package/esm2020/draggable-items/draggable-items.component.mjs +101 -101
  233. package/esm2020/draggable-items/draggable-items.model.mjs +1 -1
  234. package/esm2020/draggable-items/draggable-items.module.mjs +59 -59
  235. package/esm2020/draggable-items/pepperi-addons-ngx-lib-draggable-items.mjs +4 -4
  236. package/esm2020/draggable-items/public-api.mjs +7 -7
  237. package/esm2020/field-title/field-title.component.mjs +41 -41
  238. package/esm2020/field-title/field-title.module.mjs +46 -46
  239. package/esm2020/field-title/pepperi-addons-ngx-lib-field-title.mjs +4 -4
  240. package/esm2020/field-title/public-api.mjs +5 -5
  241. package/esm2020/files-uploader/files-uploader.component.mjs +240 -240
  242. package/esm2020/files-uploader/files-uploader.module.mjs +78 -78
  243. package/esm2020/files-uploader/pepperi-addons-ngx-lib-files-uploader.mjs +4 -4
  244. package/esm2020/files-uploader/public-api.mjs +5 -5
  245. package/esm2020/form/field-generator.component.mjs +152 -152
  246. package/esm2020/form/form.component.mjs +1224 -1224
  247. package/esm2020/form/form.model.mjs +1 -1
  248. package/esm2020/form/form.module.mjs +175 -175
  249. package/esm2020/form/indicators.component.mjs +22 -22
  250. package/esm2020/form/internal-button.component.mjs +183 -183
  251. package/esm2020/form/internal-carusel.component.mjs +116 -116
  252. package/esm2020/form/internal-carusel.service.mjs +31 -31
  253. package/esm2020/form/internal-field-generator.component.mjs +146 -146
  254. package/esm2020/form/internal-form.component.mjs +1213 -1213
  255. package/esm2020/form/internal-list.component.mjs +509 -509
  256. package/esm2020/form/internal-menu.component.mjs +65 -65
  257. package/esm2020/form/internal-page.component.mjs +361 -361
  258. package/esm2020/form/internal-page.service.mjs +119 -119
  259. package/esm2020/form/pepperi-addons-ngx-lib-form.mjs +4 -4
  260. package/esm2020/form/public-api.mjs +6 -6
  261. package/esm2020/group-buttons/group-buttons.component.mjs +71 -71
  262. package/esm2020/group-buttons/group-buttons.module.mjs +58 -58
  263. package/esm2020/group-buttons/pepperi-addons-ngx-lib-group-buttons.mjs +4 -4
  264. package/esm2020/group-buttons/public-api.mjs +5 -5
  265. package/esm2020/icon/icon-generated-all.model.mjs +107 -105
  266. package/esm2020/icon/icon-generated.model.mjs +414 -406
  267. package/esm2020/icon/icon-registry.service.mjs +24 -24
  268. package/esm2020/icon/icon.component.mjs +90 -90
  269. package/esm2020/icon/icon.module.mjs +19 -19
  270. package/esm2020/icon/icon.service.mjs +30 -30
  271. package/esm2020/icon/pepperi-addons-ngx-lib-icon.mjs +4 -4
  272. package/esm2020/icon/public-api.mjs +10 -10
  273. package/esm2020/image/image.component.mjs +246 -246
  274. package/esm2020/image/image.module.mjs +73 -73
  275. package/esm2020/image/image.service.mjs +51 -51
  276. package/esm2020/image/pepperi-addons-ngx-lib-image.mjs +4 -4
  277. package/esm2020/image/public-api.mjs +6 -6
  278. package/esm2020/images-filmstrip/images-filmstrip.component.mjs +336 -336
  279. package/esm2020/images-filmstrip/images-filmstrip.module.mjs +82 -82
  280. package/esm2020/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.mjs +4 -4
  281. package/esm2020/images-filmstrip/public-api.mjs +5 -5
  282. package/esm2020/link/link.component.mjs +338 -338
  283. package/esm2020/link/link.module.mjs +79 -79
  284. package/esm2020/link/link.pipes.mjs +17 -17
  285. package/esm2020/link/pepperi-addons-ngx-lib-link.mjs +4 -4
  286. package/esm2020/link/public-api.mjs +5 -5
  287. package/esm2020/list/list-actions.component.mjs +43 -43
  288. package/esm2020/list/list-carousel.component.mjs +106 -106
  289. package/esm2020/list/list-chooser.component.mjs +63 -63
  290. package/esm2020/list/list-pager.component.mjs +119 -119
  291. package/esm2020/list/list-sorting.component.mjs +60 -60
  292. package/esm2020/list/list-total.component.mjs +29 -29
  293. package/esm2020/list/list-views.component.mjs +84 -84
  294. package/esm2020/list/list.component.mjs +1159 -1159
  295. package/esm2020/list/list.model.mjs +3 -3
  296. package/esm2020/list/list.module.mjs +143 -143
  297. package/esm2020/list/list.pipes.mjs +46 -46
  298. package/esm2020/list/pepperi-addons-ngx-lib-list.mjs +4 -4
  299. package/esm2020/list/public-api.mjs +14 -14
  300. package/esm2020/list/virtual-scroller.mjs +1060 -1060
  301. package/esm2020/menu/menu-item.component.mjs +114 -114
  302. package/esm2020/menu/menu.component.mjs +204 -204
  303. package/esm2020/menu/menu.model.mjs +18 -18
  304. package/esm2020/menu/menu.module.mjs +58 -58
  305. package/esm2020/menu/pepperi-addons-ngx-lib-menu.mjs +4 -4
  306. package/esm2020/menu/public-api.mjs +6 -6
  307. package/esm2020/ngx-lib.module.mjs +157 -157
  308. package/esm2020/page-layout/page-layout.component.mjs +34 -34
  309. package/esm2020/page-layout/page-layout.module.mjs +33 -33
  310. package/esm2020/page-layout/pepperi-addons-ngx-lib-page-layout.mjs +4 -4
  311. package/esm2020/page-layout/public-api.mjs +5 -5
  312. package/esm2020/pepperi-addons-ngx-lib.mjs +4 -4
  313. package/esm2020/plugin/pepperi-addons-ngx-lib-plugin.mjs +4 -4
  314. package/esm2020/plugin/plugin-proxy.component.mjs +93 -93
  315. package/esm2020/plugin/plugin.model.mjs +1 -1
  316. package/esm2020/plugin/public-api.mjs +5 -5
  317. package/esm2020/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.mjs +4 -4
  318. package/esm2020/profile-data-views-list/profile-data-view/profile-data-view.component.mjs +44 -44
  319. package/esm2020/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.mjs +64 -64
  320. package/esm2020/profile-data-views-list/profile-data-views-list.component.mjs +94 -94
  321. package/esm2020/profile-data-views-list/profile-data-views-list.model.mjs +1 -1
  322. package/esm2020/profile-data-views-list/profile-data-views-list.module.mjs +87 -87
  323. package/esm2020/profile-data-views-list/public-api.mjs +8 -8
  324. package/esm2020/public-api.mjs +5 -5
  325. package/esm2020/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.mjs +4 -4
  326. package/esm2020/quantity-selector/public-api.mjs +5 -5
  327. package/esm2020/quantity-selector/quantity-selector-validation.directive.mjs +46 -46
  328. package/esm2020/quantity-selector/quantity-selector.component.mjs +510 -510
  329. package/esm2020/quantity-selector/quantity-selector.module.mjs +81 -81
  330. package/esm2020/quantity-selector/quantity-selector.pipes.mjs +22 -22
  331. package/esm2020/query-builder/common/model/field.mjs +1 -1
  332. package/esm2020/query-builder/common/model/filter.mjs +1 -1
  333. package/esm2020/query-builder/common/model/legacy.mjs +1 -1
  334. package/esm2020/query-builder/common/model/operator-unit.mjs +41 -41
  335. package/esm2020/query-builder/common/model/operator.mjs +265 -265
  336. package/esm2020/query-builder/common/model/structure.mjs +1 -1
  337. package/esm2020/query-builder/common/model/type-map.mjs +26 -26
  338. package/esm2020/query-builder/common/model/type.mjs +5 -5
  339. package/esm2020/query-builder/common/services/output-query.service.mjs +113 -113
  340. package/esm2020/query-builder/common/services/query-structure.service.mjs +225 -225
  341. package/esm2020/query-builder/common/services/type-convertor.service.mjs +41 -41
  342. package/esm2020/query-builder/pepperi-addons-ngx-lib-query-builder.mjs +4 -4
  343. package/esm2020/query-builder/public-api.mjs +8 -8
  344. package/esm2020/query-builder/query-builder-item/query-builder-item.component.mjs +124 -124
  345. package/esm2020/query-builder/query-builder-section/query-builder-section.component.mjs +70 -70
  346. package/esm2020/query-builder/query-builder.component.mjs +109 -109
  347. package/esm2020/query-builder/query-builder.module.mjs +58 -58
  348. package/esm2020/query-builder/query-builder.service.mjs +101 -101
  349. package/esm2020/remote-loader/addon-block-loader.component.mjs +83 -83
  350. package/esm2020/remote-loader/addon-block-loader.service.mjs +59 -59
  351. package/esm2020/remote-loader/pepperi-addons-ngx-lib-remote-loader.mjs +4 -4
  352. package/esm2020/remote-loader/public-api.mjs +9 -9
  353. package/esm2020/remote-loader/remote-loader.component.mjs +105 -105
  354. package/esm2020/remote-loader/remote-loader.model.mjs +1 -1
  355. package/esm2020/remote-loader/remote-loader.module.mjs +59 -59
  356. package/esm2020/remote-loader/remote-loader.service.mjs +57 -57
  357. package/esm2020/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.mjs +4 -4
  358. package/esm2020/rich-html-textarea/public-api.mjs +5 -5
  359. package/esm2020/rich-html-textarea/rich-html-textarea.component.mjs +244 -244
  360. package/esm2020/rich-html-textarea/rich-html-textarea.module.mjs +94 -94
  361. package/esm2020/search/pepperi-addons-ngx-lib-search.mjs +4 -4
  362. package/esm2020/search/public-api.mjs +6 -6
  363. package/esm2020/search/search.component.mjs +316 -316
  364. package/esm2020/search/search.model.mjs +1 -1
  365. package/esm2020/search/search.module.mjs +69 -69
  366. package/esm2020/select/pepperi-addons-ngx-lib-select.mjs +4 -4
  367. package/esm2020/select/public-api.mjs +5 -5
  368. package/esm2020/select/select.component.mjs +263 -263
  369. package/esm2020/select/select.module.mjs +69 -69
  370. package/esm2020/separator/pepperi-addons-ngx-lib-separator.mjs +4 -4
  371. package/esm2020/separator/public-api.mjs +5 -5
  372. package/esm2020/separator/separator.component.mjs +62 -62
  373. package/esm2020/separator/separator.module.mjs +17 -17
  374. package/esm2020/side-bar/pepperi-addons-ngx-lib-side-bar.mjs +4 -4
  375. package/esm2020/side-bar/public-api.mjs +6 -6
  376. package/esm2020/side-bar/side-bar.component.mjs +121 -121
  377. package/esm2020/side-bar/side-bar.model.mjs +1 -1
  378. package/esm2020/side-bar/side-bar.module.mjs +54 -54
  379. package/esm2020/signature/pepperi-addons-ngx-lib-signature.mjs +4 -4
  380. package/esm2020/signature/public-api.mjs +5 -5
  381. package/esm2020/signature/signature.component.mjs +253 -253
  382. package/esm2020/signature/signature.module.mjs +89 -89
  383. package/esm2020/size-detector/pepperi-addons-ngx-lib-size-detector.mjs +4 -4
  384. package/esm2020/size-detector/public-api.mjs +5 -5
  385. package/esm2020/size-detector/size-detector.component.mjs +91 -91
  386. package/esm2020/size-detector/size-detector.module.mjs +34 -34
  387. package/esm2020/slider/pepperi-addons-ngx-lib-slider.mjs +4 -4
  388. package/esm2020/slider/public-api.mjs +5 -5
  389. package/esm2020/slider/slider.component.mjs +100 -100
  390. package/esm2020/slider/slider.module.mjs +41 -41
  391. package/esm2020/smart-filters/boolean-filter/boolean-filter.component.mjs +74 -74
  392. package/esm2020/smart-filters/common/filter-actions.component.mjs +28 -28
  393. package/esm2020/smart-filters/common/model/base-filter-component.mjs +294 -294
  394. package/esm2020/smart-filters/common/model/creator.mjs +75 -75
  395. package/esm2020/smart-filters/common/model/field.mjs +116 -116
  396. package/esm2020/smart-filters/common/model/filter.mjs +1 -1
  397. package/esm2020/smart-filters/common/model/operator.mjs +270 -270
  398. package/esm2020/smart-filters/common/model/type.mjs +1 -1
  399. package/esm2020/smart-filters/date-filter/date-filter.component.mjs +171 -171
  400. package/esm2020/smart-filters/multi-select-filter/multi-select-filter.component.mjs +199 -199
  401. package/esm2020/smart-filters/number-filter/number-filter.component.mjs +115 -115
  402. package/esm2020/smart-filters/pepperi-addons-ngx-lib-smart-filters.mjs +4 -4
  403. package/esm2020/smart-filters/public-api.mjs +18 -18
  404. package/esm2020/smart-filters/smart-filters.component.mjs +140 -140
  405. package/esm2020/smart-filters/smart-filters.module.mjs +157 -157
  406. package/esm2020/smart-filters/text-filter/text-filter.component.mjs +91 -91
  407. package/esm2020/snack-bar/default-snack-bar.component.mjs +28 -28
  408. package/esm2020/snack-bar/pepperi-addons-ngx-lib-snack-bar.mjs +4 -4
  409. package/esm2020/snack-bar/public-api.mjs +7 -7
  410. package/esm2020/snack-bar/snack-bar.component.mjs +25 -25
  411. package/esm2020/snack-bar/snack-bar.model.mjs +6 -6
  412. package/esm2020/snack-bar/snack-bar.module.mjs +62 -62
  413. package/esm2020/snack-bar/snack-bar.service.mjs +59 -59
  414. package/esm2020/textarea/pepperi-addons-ngx-lib-textarea.mjs +4 -4
  415. package/esm2020/textarea/public-api.mjs +5 -5
  416. package/esm2020/textarea/textarea.component.mjs +181 -181
  417. package/esm2020/textarea/textarea.module.mjs +81 -81
  418. package/esm2020/textbox/pepperi-addons-ngx-lib-textbox.mjs +4 -4
  419. package/esm2020/textbox/public-api.mjs +5 -5
  420. package/esm2020/textbox/textbox-validation.directive.mjs +88 -88
  421. package/esm2020/textbox/textbox.component.mjs +448 -442
  422. package/esm2020/textbox/textbox.module.mjs +71 -71
  423. package/esm2020/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.mjs +4 -4
  424. package/esm2020/textbox-icon/public-api.mjs +5 -5
  425. package/esm2020/textbox-icon/textbox-icon.component.mjs +47 -47
  426. package/esm2020/textbox-icon/textbox-icon.module.mjs +63 -63
  427. package/esm2020/top-bar/pepperi-addons-ngx-lib-top-bar.mjs +4 -4
  428. package/esm2020/top-bar/public-api.mjs +6 -6
  429. package/esm2020/top-bar/top-bar.component.mjs +111 -111
  430. package/esm2020/top-bar/top-bar.model.mjs +1 -1
  431. package/esm2020/top-bar/top-bar.module.mjs +61 -61
  432. package/fesm2015/pepperi-addons-ngx-lib-address.mjs +143 -143
  433. package/fesm2015/pepperi-addons-ngx-lib-address.mjs.map +1 -1
  434. package/fesm2015/pepperi-addons-ngx-lib-attachment.mjs +253 -253
  435. package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.mjs +122 -122
  436. package/fesm2015/pepperi-addons-ngx-lib-button.mjs +171 -171
  437. package/fesm2015/pepperi-addons-ngx-lib-carousel.mjs +780 -780
  438. package/fesm2015/pepperi-addons-ngx-lib-checkbox.mjs +206 -206
  439. package/fesm2015/pepperi-addons-ngx-lib-chip.mjs +104 -0
  440. package/fesm2015/pepperi-addons-ngx-lib-chip.mjs.map +1 -0
  441. package/fesm2015/pepperi-addons-ngx-lib-color.mjs +336 -336
  442. package/fesm2015/pepperi-addons-ngx-lib-color.mjs.map +1 -1
  443. package/fesm2015/pepperi-addons-ngx-lib-date.mjs +397 -397
  444. package/fesm2015/pepperi-addons-ngx-lib-dialog.mjs +207 -207
  445. package/fesm2015/pepperi-addons-ngx-lib-draggable-items.mjs +163 -163
  446. package/fesm2015/pepperi-addons-ngx-lib-field-title.mjs +73 -73
  447. package/fesm2015/pepperi-addons-ngx-lib-files-uploader.mjs +291 -291
  448. package/fesm2015/pepperi-addons-ngx-lib-form.mjs +4112 -4112
  449. package/fesm2015/pepperi-addons-ngx-lib-form.mjs.map +1 -1
  450. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs +109 -109
  451. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -1
  452. package/fesm2015/pepperi-addons-ngx-lib-icon.mjs +668 -658
  453. package/fesm2015/pepperi-addons-ngx-lib-icon.mjs.map +1 -1
  454. package/fesm2015/pepperi-addons-ngx-lib-image.mjs +340 -340
  455. package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.mjs +390 -390
  456. package/fesm2015/pepperi-addons-ngx-lib-link.mjs +401 -401
  457. package/fesm2015/pepperi-addons-ngx-lib-list.mjs +2822 -2822
  458. package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -1
  459. package/fesm2015/pepperi-addons-ngx-lib-menu.mjs +360 -360
  460. package/fesm2015/pepperi-addons-ngx-lib-page-layout.mjs +59 -59
  461. package/fesm2015/pepperi-addons-ngx-lib-plugin.mjs +97 -97
  462. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.mjs +254 -254
  463. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.mjs +620 -620
  464. package/fesm2015/pepperi-addons-ngx-lib-query-builder.mjs +1119 -1119
  465. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.mjs +342 -342
  466. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.mjs +300 -300
  467. package/fesm2015/pepperi-addons-ngx-lib-search.mjs +356 -356
  468. package/fesm2015/pepperi-addons-ngx-lib-select.mjs +305 -305
  469. package/fesm2015/pepperi-addons-ngx-lib-separator.mjs +73 -73
  470. package/fesm2015/pepperi-addons-ngx-lib-side-bar.mjs +158 -158
  471. package/fesm2015/pepperi-addons-ngx-lib-signature.mjs +311 -311
  472. package/fesm2015/pepperi-addons-ngx-lib-size-detector.mjs +114 -114
  473. package/fesm2015/pepperi-addons-ngx-lib-slider.mjs +130 -130
  474. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs +1602 -1602
  475. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -1
  476. package/fesm2015/pepperi-addons-ngx-lib-snack-bar.mjs +152 -152
  477. package/fesm2015/pepperi-addons-ngx-lib-textarea.mjs +232 -232
  478. package/fesm2015/pepperi-addons-ngx-lib-textbox-icon.mjs +95 -95
  479. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs +573 -567
  480. package/fesm2015/pepperi-addons-ngx-lib-textbox.mjs.map +1 -1
  481. package/fesm2015/pepperi-addons-ngx-lib-top-bar.mjs +155 -155
  482. package/fesm2015/pepperi-addons-ngx-lib.mjs +4452 -4448
  483. package/fesm2015/pepperi-addons-ngx-lib.mjs.map +1 -1
  484. package/fesm2020/pepperi-addons-ngx-lib-address.mjs +143 -143
  485. package/fesm2020/pepperi-addons-ngx-lib-address.mjs.map +1 -1
  486. package/fesm2020/pepperi-addons-ngx-lib-attachment.mjs +253 -253
  487. package/fesm2020/pepperi-addons-ngx-lib-bread-crumbs.mjs +122 -122
  488. package/fesm2020/pepperi-addons-ngx-lib-button.mjs +171 -171
  489. package/fesm2020/pepperi-addons-ngx-lib-carousel.mjs +776 -776
  490. package/fesm2020/pepperi-addons-ngx-lib-checkbox.mjs +206 -206
  491. package/fesm2020/pepperi-addons-ngx-lib-chip.mjs +104 -0
  492. package/fesm2020/pepperi-addons-ngx-lib-chip.mjs.map +1 -0
  493. package/fesm2020/pepperi-addons-ngx-lib-color.mjs +333 -333
  494. package/fesm2020/pepperi-addons-ngx-lib-color.mjs.map +1 -1
  495. package/fesm2020/pepperi-addons-ngx-lib-date.mjs +393 -393
  496. package/fesm2020/pepperi-addons-ngx-lib-dialog.mjs +203 -203
  497. package/fesm2020/pepperi-addons-ngx-lib-draggable-items.mjs +162 -162
  498. package/fesm2020/pepperi-addons-ngx-lib-field-title.mjs +73 -73
  499. package/fesm2020/pepperi-addons-ngx-lib-files-uploader.mjs +288 -288
  500. package/fesm2020/pepperi-addons-ngx-lib-form.mjs +4111 -4111
  501. package/fesm2020/pepperi-addons-ngx-lib-form.mjs.map +1 -1
  502. package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs +109 -109
  503. package/fesm2020/pepperi-addons-ngx-lib-group-buttons.mjs.map +1 -1
  504. package/fesm2020/pepperi-addons-ngx-lib-icon.mjs +666 -656
  505. package/fesm2020/pepperi-addons-ngx-lib-icon.mjs.map +1 -1
  506. package/fesm2020/pepperi-addons-ngx-lib-image.mjs +338 -338
  507. package/fesm2020/pepperi-addons-ngx-lib-images-filmstrip.mjs +387 -387
  508. package/fesm2020/pepperi-addons-ngx-lib-link.mjs +401 -401
  509. package/fesm2020/pepperi-addons-ngx-lib-list.mjs +2808 -2808
  510. package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -1
  511. package/fesm2020/pepperi-addons-ngx-lib-menu.mjs +360 -360
  512. package/fesm2020/pepperi-addons-ngx-lib-page-layout.mjs +59 -59
  513. package/fesm2020/pepperi-addons-ngx-lib-plugin.mjs +92 -92
  514. package/fesm2020/pepperi-addons-ngx-lib-profile-data-views-list.mjs +253 -253
  515. package/fesm2020/pepperi-addons-ngx-lib-quantity-selector.mjs +619 -619
  516. package/fesm2020/pepperi-addons-ngx-lib-query-builder.mjs +1108 -1108
  517. package/fesm2020/pepperi-addons-ngx-lib-remote-loader.mjs +332 -332
  518. package/fesm2020/pepperi-addons-ngx-lib-rich-html-textarea.mjs +300 -300
  519. package/fesm2020/pepperi-addons-ngx-lib-search.mjs +355 -355
  520. package/fesm2020/pepperi-addons-ngx-lib-select.mjs +305 -305
  521. package/fesm2020/pepperi-addons-ngx-lib-separator.mjs +73 -73
  522. package/fesm2020/pepperi-addons-ngx-lib-side-bar.mjs +158 -158
  523. package/fesm2020/pepperi-addons-ngx-lib-signature.mjs +311 -311
  524. package/fesm2020/pepperi-addons-ngx-lib-size-detector.mjs +114 -114
  525. package/fesm2020/pepperi-addons-ngx-lib-slider.mjs +129 -129
  526. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs +1595 -1595
  527. package/fesm2020/pepperi-addons-ngx-lib-smart-filters.mjs.map +1 -1
  528. package/fesm2020/pepperi-addons-ngx-lib-snack-bar.mjs +149 -149
  529. package/fesm2020/pepperi-addons-ngx-lib-textarea.mjs +231 -231
  530. package/fesm2020/pepperi-addons-ngx-lib-textbox-icon.mjs +95 -95
  531. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs +573 -567
  532. package/fesm2020/pepperi-addons-ngx-lib-textbox.mjs.map +1 -1
  533. package/fesm2020/pepperi-addons-ngx-lib-top-bar.mjs +154 -154
  534. package/fesm2020/pepperi-addons-ngx-lib.mjs +4432 -4430
  535. package/fesm2020/pepperi-addons-ngx-lib.mjs.map +1 -1
  536. package/field-title/field-title.component.d.ts +14 -14
  537. package/field-title/field-title.module.d.ts +15 -15
  538. package/field-title/index.d.ts +5 -5
  539. package/field-title/public-api.d.ts +2 -2
  540. package/files-uploader/files-uploader.component.d.ts +57 -57
  541. package/files-uploader/files-uploader.module.d.ts +21 -21
  542. package/files-uploader/index.d.ts +5 -5
  543. package/files-uploader/public-api.d.ts +2 -2
  544. package/form/field-generator.component.d.ts +39 -39
  545. package/form/form.component.d.ts +93 -93
  546. package/form/form.model.d.ts +20 -20
  547. package/form/form.module.d.ts +49 -49
  548. package/form/index.d.ts +5 -5
  549. package/form/indicators.component.d.ts +10 -10
  550. package/form/internal-button.component.d.ts +42 -42
  551. package/form/internal-carusel.component.d.ts +39 -39
  552. package/form/internal-carusel.service.d.ts +10 -10
  553. package/form/internal-field-generator.component.d.ts +35 -35
  554. package/form/internal-form.component.d.ts +89 -89
  555. package/form/internal-list.component.d.ts +95 -95
  556. package/form/internal-menu.component.d.ts +19 -19
  557. package/form/internal-page.component.d.ts +73 -73
  558. package/form/internal-page.service.d.ts +22 -22
  559. package/form/public-api.d.ts +3 -3
  560. package/group-buttons/group-buttons.component.d.ts +24 -24
  561. package/group-buttons/group-buttons.module.d.ts +18 -18
  562. package/group-buttons/index.d.ts +5 -5
  563. package/group-buttons/public-api.d.ts +2 -2
  564. package/icon/icon-generated-all.model.d.ts +105 -103
  565. package/icon/icon-generated.model.d.ts +418 -410
  566. package/icon/icon-registry.service.d.ts +9 -9
  567. package/icon/icon.component.d.ts +49 -49
  568. package/icon/icon.module.d.ts +7 -7
  569. package/icon/icon.service.d.ts +13 -13
  570. package/icon/index.d.ts +5 -5
  571. package/icon/public-api.d.ts +6 -6
  572. package/image/image.component.d.ts +66 -66
  573. package/image/image.module.d.ts +20 -20
  574. package/image/image.service.d.ts +14 -14
  575. package/image/index.d.ts +5 -5
  576. package/image/public-api.d.ts +3 -3
  577. package/images-filmstrip/images-filmstrip.component.d.ts +87 -87
  578. package/images-filmstrip/images-filmstrip.module.d.ts +22 -22
  579. package/images-filmstrip/index.d.ts +5 -5
  580. package/images-filmstrip/public-api.d.ts +2 -2
  581. package/index.d.ts +5 -5
  582. package/link/index.d.ts +5 -5
  583. package/link/link.component.d.ts +133 -133
  584. package/link/link.module.d.ts +22 -22
  585. package/link/link.pipes.d.ts +7 -7
  586. package/link/public-api.d.ts +2 -2
  587. package/list/index.d.ts +5 -5
  588. package/list/list-actions.component.d.ts +18 -18
  589. package/list/list-carousel.component.d.ts +40 -40
  590. package/list/list-chooser.component.d.ts +29 -29
  591. package/list/list-pager.component.d.ts +39 -39
  592. package/list/list-sorting.component.d.ts +30 -30
  593. package/list/list-total.component.d.ts +11 -11
  594. package/list/list-views.component.d.ts +35 -35
  595. package/list/list.component.d.ts +164 -164
  596. package/list/list.model.d.ts +31 -31
  597. package/list/list.module.d.ts +34 -34
  598. package/list/list.pipes.d.ts +16 -16
  599. package/list/public-api.d.ts +10 -10
  600. package/list/virtual-scroller.d.ts +183 -183
  601. package/menu/index.d.ts +5 -5
  602. package/menu/menu-item.component.d.ts +28 -28
  603. package/menu/menu.component.d.ts +46 -46
  604. package/menu/menu.model.d.ts +25 -25
  605. package/menu/menu.module.d.ts +18 -18
  606. package/menu/public-api.d.ts +3 -3
  607. package/ngx-lib.module.d.ts +23 -23
  608. package/package.json +9 -1
  609. package/page-layout/index.d.ts +5 -5
  610. package/page-layout/page-layout.component.d.ts +19 -19
  611. package/page-layout/page-layout.module.d.ts +10 -10
  612. package/page-layout/public-api.d.ts +2 -2
  613. package/plugin/index.d.ts +5 -5
  614. package/plugin/plugin-proxy.component.d.ts +25 -25
  615. package/plugin/plugin.model.d.ts +6 -6
  616. package/plugin/public-api.d.ts +2 -2
  617. package/profile-data-views-list/index.d.ts +5 -5
  618. package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +18 -18
  619. package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +24 -24
  620. package/profile-data-views-list/profile-data-views-list.component.d.ts +35 -35
  621. package/profile-data-views-list/profile-data-views-list.model.d.ts +18 -18
  622. package/profile-data-views-list/profile-data-views-list.module.d.ts +23 -23
  623. package/profile-data-views-list/public-api.d.ts +5 -5
  624. package/public-api.d.ts +2 -2
  625. package/quantity-selector/index.d.ts +5 -5
  626. package/quantity-selector/public-api.d.ts +2 -2
  627. package/quantity-selector/quantity-selector-validation.directive.d.ts +16 -16
  628. package/quantity-selector/quantity-selector.component.d.ts +101 -101
  629. package/quantity-selector/quantity-selector.module.d.ts +23 -23
  630. package/quantity-selector/quantity-selector.pipes.d.ts +7 -7
  631. package/query-builder/common/model/field.d.ts +8 -8
  632. package/query-builder/common/model/filter.d.ts +6 -6
  633. package/query-builder/common/model/legacy.d.ts +29 -29
  634. package/query-builder/common/model/operator-unit.d.ts +13 -13
  635. package/query-builder/common/model/operator.d.ts +21 -21
  636. package/query-builder/common/model/structure.d.ts +4 -4
  637. package/query-builder/common/model/type-map.d.ts +12 -12
  638. package/query-builder/common/model/type.d.ts +4 -4
  639. package/query-builder/common/services/output-query.service.d.ts +47 -47
  640. package/query-builder/common/services/query-structure.service.d.ts +82 -82
  641. package/query-builder/common/services/type-convertor.service.d.ts +13 -13
  642. package/query-builder/index.d.ts +5 -5
  643. package/query-builder/public-api.d.ts +5 -5
  644. package/query-builder/query-builder-item/query-builder-item.component.d.ts +41 -41
  645. package/query-builder/query-builder-section/query-builder-section.component.d.ts +30 -30
  646. package/query-builder/query-builder.component.d.ts +39 -39
  647. package/query-builder/query-builder.module.d.ts +16 -16
  648. package/query-builder/query-builder.service.d.ts +30 -30
  649. package/remote-loader/addon-block-loader.component.d.ts +32 -32
  650. package/remote-loader/addon-block-loader.service.d.ts +15 -15
  651. package/remote-loader/index.d.ts +5 -5
  652. package/remote-loader/public-api.d.ts +6 -6
  653. package/remote-loader/remote-loader.component.d.ts +25 -25
  654. package/remote-loader/remote-loader.model.d.ts +37 -37
  655. package/remote-loader/remote-loader.module.d.ts +13 -13
  656. package/remote-loader/remote-loader.service.d.ts +17 -17
  657. package/rich-html-textarea/index.d.ts +5 -5
  658. package/rich-html-textarea/public-api.d.ts +2 -2
  659. package/rich-html-textarea/rich-html-textarea.component.d.ts +78 -78
  660. package/rich-html-textarea/rich-html-textarea.module.d.ts +25 -25
  661. package/search/index.d.ts +5 -5
  662. package/search/public-api.d.ts +3 -3
  663. package/search/search.component.d.ts +65 -65
  664. package/search/search.model.d.ts +14 -14
  665. package/search/search.module.d.ts +20 -20
  666. package/select/index.d.ts +5 -5
  667. package/select/public-api.d.ts +2 -2
  668. package/select/select.component.d.ts +59 -59
  669. package/select/select.module.d.ts +20 -20
  670. package/separator/index.d.ts +5 -5
  671. package/separator/public-api.d.ts +2 -2
  672. package/separator/separator.component.d.ts +22 -22
  673. package/separator/separator.module.d.ts +8 -8
  674. package/side-bar/index.d.ts +5 -5
  675. package/side-bar/public-api.d.ts +3 -3
  676. package/side-bar/side-bar.component.d.ts +42 -42
  677. package/side-bar/side-bar.model.d.ts +4 -4
  678. package/side-bar/side-bar.module.d.ts +16 -16
  679. package/signature/index.d.ts +5 -5
  680. package/signature/public-api.d.ts +2 -2
  681. package/signature/signature.component.d.ts +68 -68
  682. package/signature/signature.module.d.ts +24 -24
  683. package/size-detector/index.d.ts +5 -5
  684. package/size-detector/public-api.d.ts +2 -2
  685. package/size-detector/size-detector.component.d.ts +29 -29
  686. package/size-detector/size-detector.module.d.ts +11 -11
  687. package/slider/index.d.ts +5 -5
  688. package/slider/public-api.d.ts +2 -2
  689. package/slider/slider.component.d.ts +39 -39
  690. package/slider/slider.module.d.ts +12 -12
  691. package/smart-filters/boolean-filter/boolean-filter.component.d.ts +28 -28
  692. package/smart-filters/common/filter-actions.component.d.ts +12 -12
  693. package/smart-filters/common/model/base-filter-component.d.ts +73 -73
  694. package/smart-filters/common/model/creator.d.ts +6 -6
  695. package/smart-filters/common/model/field.d.ts +69 -69
  696. package/smart-filters/common/model/filter.d.ts +11 -11
  697. package/smart-filters/common/model/operator.d.ts +51 -51
  698. package/smart-filters/common/model/type.d.ts +4 -4
  699. package/smart-filters/date-filter/date-filter.component.d.ts +59 -59
  700. package/smart-filters/index.d.ts +5 -5
  701. package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +56 -56
  702. package/smart-filters/number-filter/number-filter.component.d.ts +51 -51
  703. package/smart-filters/public-api.d.ts +14 -14
  704. package/smart-filters/smart-filters.component.d.ts +35 -35
  705. package/smart-filters/smart-filters.module.d.ts +37 -37
  706. package/smart-filters/text-filter/text-filter.component.d.ts +28 -28
  707. package/snack-bar/default-snack-bar.component.d.ts +13 -13
  708. package/snack-bar/index.d.ts +5 -5
  709. package/snack-bar/public-api.d.ts +4 -4
  710. package/snack-bar/snack-bar.component.d.ts +12 -12
  711. package/snack-bar/snack-bar.model.d.ts +8 -8
  712. package/snack-bar/snack-bar.module.d.ts +19 -19
  713. package/snack-bar/snack-bar.service.d.ts +24 -24
  714. package/src/core/style/components/checkbox.scss +1 -1
  715. package/textarea/index.d.ts +5 -5
  716. package/textarea/public-api.d.ts +2 -2
  717. package/textarea/textarea.component.d.ts +54 -54
  718. package/textarea/textarea.module.d.ts +23 -23
  719. package/textbox/index.d.ts +5 -5
  720. package/textbox/public-api.d.ts +2 -2
  721. package/textbox/textbox-validation.directive.d.ts +21 -21
  722. package/textbox/textbox.component.d.ts +145 -143
  723. package/textbox/textbox.module.d.ts +22 -22
  724. package/textbox-icon/index.d.ts +5 -5
  725. package/textbox-icon/public-api.d.ts +2 -2
  726. package/textbox-icon/textbox-icon.component.d.ts +13 -13
  727. package/textbox-icon/textbox-icon.module.d.ts +16 -16
  728. package/top-bar/index.d.ts +5 -5
  729. package/top-bar/public-api.d.ts +3 -3
  730. package/top-bar/top-bar.component.d.ts +39 -39
  731. package/top-bar/top-bar.model.d.ts +4 -4
  732. package/top-bar/top-bar.module.d.ts +18 -18
@@ -42,1634 +42,1634 @@ import * as i2$1 from '@ngx-translate/core';
42
42
  import * as i3$1 from '@angular/flex-layout/flex';
43
43
  import * as i4$2 from '@angular/flex-layout/extended';
44
44
 
45
- class IPepSmartFilterOperator {
46
- }
47
- const Equals = {
48
- id: 'eq',
49
- name: 'EQUAL',
50
- short: '=',
51
- componentType: [
52
- 'number',
53
- 'boolean',
54
- // 'multi-select',
55
- // 'date',
56
- 'text',
57
- // 'auto-complete',
58
- // 'select',
59
- ],
60
- };
61
- const NotEqual = {
62
- id: 'neq',
63
- name: 'NOT_EQUAL',
64
- short: '<>',
65
- componentType: [
66
- 'number',
67
- // 'multi-select',
68
- // 'date',
69
- 'text',
70
- // 'auto-complete',
71
- // 'select',
72
- ],
73
- };
74
- const LessThan = {
75
- id: 'lt',
76
- name: 'LESS_THEN',
77
- short: '<',
78
- componentType: ['number'],
79
- };
80
- // const LessThanOrEquals: IPepSmartFilterOperator = {
81
- // id: 'ltoe',
82
- // name: 'LESS_THEN_OR_EQUAL',
83
- // short: '<=',
84
- // type: ['number'],
85
- // };
86
- const GreaterThan = {
87
- id: 'gt',
88
- name: 'GREATER_THEN',
89
- short: '>',
90
- componentType: ['number'],
91
- };
92
- // const GreaterThanOrEquals: IPepSmartFilterOperator = {
93
- // id: 'gtoe',
94
- // name: 'GREATER_THEN_OR_EQUAL',
95
- // short: '>=',
96
- // type: ['number'],
97
- // };
98
- const NumberRange = {
99
- id: 'numberRange',
100
- name: 'NUMBER_RANGE',
101
- short: 'Range',
102
- componentType: ['number'],
103
- };
104
- const Contains = {
105
- id: 'contains',
106
- name: 'CONTAINS',
107
- short: 'Contains',
108
- componentType: ['text'],
109
- };
110
- const BeginsWith = {
111
- id: 'beginsWith',
112
- name: 'BEGINS_WITH',
113
- short: 'Begins With',
114
- componentType: ['text'],
115
- };
116
- const EndsWith = {
117
- id: 'endsWith',
118
- name: 'ENDS_WITH',
119
- short: 'End With',
120
- componentType: ['text'],
121
- };
122
- // const After: Operator = {
123
- // id: 'after',
124
- // name: 'After',
125
- // short: 'After',
126
- // type: ['date'],
127
- // };
128
- // const Before: Operator = {
129
- // id: 'before',
130
- // name: 'Before',
131
- // short: 'Before',
132
- // type: ['date'],
133
- // };
134
- const InTheLast = {
135
- id: 'inTheLast',
136
- name: 'IN_THE_LAST',
137
- short: 'In the last',
138
- componentType: ['date'],
139
- };
140
- const Today = {
141
- id: 'today',
142
- name: 'TODAY',
143
- short: 'Today',
144
- componentType: ['date'],
145
- };
146
- const ThisWeek = {
147
- id: 'thisWeek',
148
- name: 'THIS_WEEK',
149
- short: 'This week',
150
- componentType: ['date'],
151
- };
152
- const ThisMonth = {
153
- id: 'thisMonth',
154
- name: 'THIS_MONTH',
155
- short: 'This month',
156
- componentType: ['date'],
157
- };
158
- const DateRange = {
159
- id: 'dateRange',
160
- name: 'DATE_RANGE',
161
- short: 'Range',
162
- componentType: ['date'],
163
- };
164
- const DueIn = {
165
- id: 'dueIn',
166
- name: 'DUE_IN',
167
- short: 'Due in',
168
- componentType: ['date'],
169
- };
170
- const On = {
171
- id: 'on',
172
- name: 'ON',
173
- short: 'On',
174
- componentType: ['date'],
175
- };
176
- const NotInTheLast = {
177
- id: 'notInTheLast',
178
- name: 'NOT_IN_THE_LAST',
179
- short: 'Not in the last',
180
- componentType: ['date'],
181
- };
182
- const NotDueIn = {
183
- id: 'notDueIn',
184
- name: 'NOT_DUE_IN',
185
- short: 'Not due in',
186
- componentType: ['date'],
187
- };
188
- const IsEmpty = {
189
- id: 'isEmpty',
190
- name: 'IS_EMPTY',
191
- short: 'Is empty',
192
- componentType: ['date'],
193
- };
194
- const IsNotEmpty = {
195
- id: 'isNotEmpty',
196
- name: 'IS_NOT_EMPTY',
197
- short: 'Is not empty',
198
- componentType: ['date'],
199
- };
200
- const In = {
201
- id: 'in',
202
- name: 'IN',
203
- short: 'In',
204
- componentType: ['multi-select'],
205
- };
206
- const PepSmartFilterOperators = {
207
- Equals: Equals,
208
- NotEqual: NotEqual,
209
- LessThan: LessThan,
210
- // LessThanOrEquals: LessThanOrEquals,
211
- GreaterThan: GreaterThan,
212
- // GreaterThanOrEquals: GreaterThanOrEquals,
213
- NumberRange: NumberRange,
214
- Contains: Contains,
215
- BeginsWith: BeginsWith,
216
- EndsWith: EndsWith,
217
- // After: After,
218
- // Before: Before,
219
- InTheLast: InTheLast,
220
- Today: Today,
221
- ThisWeek: ThisWeek,
222
- ThisMonth: ThisMonth,
223
- DateRange: DateRange,
224
- DueIn: DueIn,
225
- On: On,
226
- NotInTheLast: NotInTheLast,
227
- NotDueIn: NotDueIn,
228
- IsEmpty: IsEmpty,
229
- IsNotEmpty: IsNotEmpty,
230
- In: In,
231
- };
232
- //additional operators to be added upon input flag
233
- const InTheLastCalendar = {
234
- id: 'inTheLastCalendar',
235
- name: 'IN_THE_LAST_CALENDAR',
236
- short: 'In the last (calendar)',
237
- componentType: ['date'],
238
- };
239
- const NotInTheLastCalendar = {
240
- id: 'notInTheLastCalendar',
241
- name: 'NOT_IN_THE_LAST_CALENDAR',
242
- short: 'Not in the last (calendar)',
243
- componentType: ['date'],
244
- };
245
- const PepSmartFilterAdditionalOperators = {
246
- InTheLastCalendar: InTheLastCalendar,
247
- NotInTheLastCalendar: NotInTheLastCalendar
248
- };
249
- //additional variable operators to be added upon input variable fields
250
- const EqualsToVariable = {
251
- id: 'eqv',
252
- name: 'EQUAL_TO_VARIABLE',
253
- short: '=',
254
- componentType: ['text', 'number', 'boolean', 'multi-select']
255
- };
256
- const NotEqualsToVariable = {
257
- id: 'neqv',
258
- name: 'NOT_EQUAL_TO_VARIABLE',
259
- short: '<>',
260
- componentType: ['boolean', 'multi-select']
261
- };
262
- const LessThanVariable = {
263
- id: 'ltv',
264
- name: 'LESS_THAN_VARIABLE',
265
- short: '<',
266
- componentType: ['number'],
267
- };
268
- const GreaterThanVariable = {
269
- id: 'gtv',
270
- name: 'GREATER_THAN_VARIABLE',
271
- short: '>',
272
- componentType: ['number'],
273
- };
274
- const DateRangeVariable = {
275
- id: 'dateRangeVariable',
276
- name: 'DATE_RANGE_VARIABLE',
277
- short: 'Range Variable',
278
- componentType: ['date'],
279
- };
280
- const PepSmartFilterVariableOperators = {
281
- EqualsToVariable: EqualsToVariable,
282
- NotEqualsToVariable: NotEqualsToVariable,
283
- LessThanVariable: LessThanVariable,
284
- GreaterThanVariable: GreaterThanVariable,
285
- DateRangeVariable: DateRangeVariable
286
- };
287
- class IPepSmartFilterOperatorUnit {
288
- }
289
- const Days = {
290
- id: 'days',
291
- name: 'DAYS',
292
- componentType: ['date'],
293
- };
294
- const Weeks = {
295
- id: 'weeks',
296
- name: 'WEEKS',
297
- componentType: ['date'],
298
- };
299
- const Months = {
300
- id: 'months',
301
- name: 'MONTHS',
302
- componentType: ['date'],
303
- };
304
- const Years = {
305
- id: 'years',
306
- name: 'YEARS',
307
- componentType: ['date'],
308
- };
309
- const PepSmartFilterOperatorUnits = {
310
- Days: Days,
311
- Weeks: Weeks,
312
- Months: Months,
313
- Years: Years,
45
+ class IPepSmartFilterOperator {
46
+ }
47
+ const Equals = {
48
+ id: 'eq',
49
+ name: 'EQUAL',
50
+ short: '=',
51
+ componentType: [
52
+ 'number',
53
+ 'boolean',
54
+ // 'multi-select',
55
+ // 'date',
56
+ 'text',
57
+ // 'auto-complete',
58
+ // 'select',
59
+ ],
60
+ };
61
+ const NotEqual = {
62
+ id: 'neq',
63
+ name: 'NOT_EQUAL',
64
+ short: '<>',
65
+ componentType: [
66
+ 'number',
67
+ // 'multi-select',
68
+ // 'date',
69
+ 'text',
70
+ // 'auto-complete',
71
+ // 'select',
72
+ ],
73
+ };
74
+ const LessThan = {
75
+ id: 'lt',
76
+ name: 'LESS_THEN',
77
+ short: '<',
78
+ componentType: ['number'],
79
+ };
80
+ // const LessThanOrEquals: IPepSmartFilterOperator = {
81
+ // id: 'ltoe',
82
+ // name: 'LESS_THEN_OR_EQUAL',
83
+ // short: '<=',
84
+ // type: ['number'],
85
+ // };
86
+ const GreaterThan = {
87
+ id: 'gt',
88
+ name: 'GREATER_THEN',
89
+ short: '>',
90
+ componentType: ['number'],
91
+ };
92
+ // const GreaterThanOrEquals: IPepSmartFilterOperator = {
93
+ // id: 'gtoe',
94
+ // name: 'GREATER_THEN_OR_EQUAL',
95
+ // short: '>=',
96
+ // type: ['number'],
97
+ // };
98
+ const NumberRange = {
99
+ id: 'numberRange',
100
+ name: 'NUMBER_RANGE',
101
+ short: 'Range',
102
+ componentType: ['number'],
103
+ };
104
+ const Contains = {
105
+ id: 'contains',
106
+ name: 'CONTAINS',
107
+ short: 'Contains',
108
+ componentType: ['text'],
109
+ };
110
+ const BeginsWith = {
111
+ id: 'beginsWith',
112
+ name: 'BEGINS_WITH',
113
+ short: 'Begins With',
114
+ componentType: ['text'],
115
+ };
116
+ const EndsWith = {
117
+ id: 'endsWith',
118
+ name: 'ENDS_WITH',
119
+ short: 'End With',
120
+ componentType: ['text'],
121
+ };
122
+ // const After: Operator = {
123
+ // id: 'after',
124
+ // name: 'After',
125
+ // short: 'After',
126
+ // type: ['date'],
127
+ // };
128
+ // const Before: Operator = {
129
+ // id: 'before',
130
+ // name: 'Before',
131
+ // short: 'Before',
132
+ // type: ['date'],
133
+ // };
134
+ const InTheLast = {
135
+ id: 'inTheLast',
136
+ name: 'IN_THE_LAST',
137
+ short: 'In the last',
138
+ componentType: ['date'],
139
+ };
140
+ const Today = {
141
+ id: 'today',
142
+ name: 'TODAY',
143
+ short: 'Today',
144
+ componentType: ['date'],
145
+ };
146
+ const ThisWeek = {
147
+ id: 'thisWeek',
148
+ name: 'THIS_WEEK',
149
+ short: 'This week',
150
+ componentType: ['date'],
151
+ };
152
+ const ThisMonth = {
153
+ id: 'thisMonth',
154
+ name: 'THIS_MONTH',
155
+ short: 'This month',
156
+ componentType: ['date'],
157
+ };
158
+ const DateRange = {
159
+ id: 'dateRange',
160
+ name: 'DATE_RANGE',
161
+ short: 'Range',
162
+ componentType: ['date'],
163
+ };
164
+ const DueIn = {
165
+ id: 'dueIn',
166
+ name: 'DUE_IN',
167
+ short: 'Due in',
168
+ componentType: ['date'],
169
+ };
170
+ const On = {
171
+ id: 'on',
172
+ name: 'ON',
173
+ short: 'On',
174
+ componentType: ['date'],
175
+ };
176
+ const NotInTheLast = {
177
+ id: 'notInTheLast',
178
+ name: 'NOT_IN_THE_LAST',
179
+ short: 'Not in the last',
180
+ componentType: ['date'],
181
+ };
182
+ const NotDueIn = {
183
+ id: 'notDueIn',
184
+ name: 'NOT_DUE_IN',
185
+ short: 'Not due in',
186
+ componentType: ['date'],
187
+ };
188
+ const IsEmpty = {
189
+ id: 'isEmpty',
190
+ name: 'IS_EMPTY',
191
+ short: 'Is empty',
192
+ componentType: ['date'],
193
+ };
194
+ const IsNotEmpty = {
195
+ id: 'isNotEmpty',
196
+ name: 'IS_NOT_EMPTY',
197
+ short: 'Is not empty',
198
+ componentType: ['date'],
199
+ };
200
+ const In = {
201
+ id: 'in',
202
+ name: 'IN',
203
+ short: 'In',
204
+ componentType: ['multi-select'],
205
+ };
206
+ const PepSmartFilterOperators = {
207
+ Equals: Equals,
208
+ NotEqual: NotEqual,
209
+ LessThan: LessThan,
210
+ // LessThanOrEquals: LessThanOrEquals,
211
+ GreaterThan: GreaterThan,
212
+ // GreaterThanOrEquals: GreaterThanOrEquals,
213
+ NumberRange: NumberRange,
214
+ Contains: Contains,
215
+ BeginsWith: BeginsWith,
216
+ EndsWith: EndsWith,
217
+ // After: After,
218
+ // Before: Before,
219
+ InTheLast: InTheLast,
220
+ Today: Today,
221
+ ThisWeek: ThisWeek,
222
+ ThisMonth: ThisMonth,
223
+ DateRange: DateRange,
224
+ DueIn: DueIn,
225
+ On: On,
226
+ NotInTheLast: NotInTheLast,
227
+ NotDueIn: NotDueIn,
228
+ IsEmpty: IsEmpty,
229
+ IsNotEmpty: IsNotEmpty,
230
+ In: In,
231
+ };
232
+ //additional operators to be added upon input flag
233
+ const InTheLastCalendar = {
234
+ id: 'inTheLastCalendar',
235
+ name: 'IN_THE_LAST_CALENDAR',
236
+ short: 'In the last (calendar)',
237
+ componentType: ['date'],
238
+ };
239
+ const NotInTheLastCalendar = {
240
+ id: 'notInTheLastCalendar',
241
+ name: 'NOT_IN_THE_LAST_CALENDAR',
242
+ short: 'Not in the last (calendar)',
243
+ componentType: ['date'],
244
+ };
245
+ const PepSmartFilterAdditionalOperators = {
246
+ InTheLastCalendar: InTheLastCalendar,
247
+ NotInTheLastCalendar: NotInTheLastCalendar
248
+ };
249
+ //additional variable operators to be added upon input variable fields
250
+ const EqualsToVariable = {
251
+ id: 'eqv',
252
+ name: 'EQUAL_TO_VARIABLE',
253
+ short: '=',
254
+ componentType: ['text', 'number', 'boolean', 'multi-select']
255
+ };
256
+ const NotEqualsToVariable = {
257
+ id: 'neqv',
258
+ name: 'NOT_EQUAL_TO_VARIABLE',
259
+ short: '<>',
260
+ componentType: ['boolean', 'multi-select']
261
+ };
262
+ const LessThanVariable = {
263
+ id: 'ltv',
264
+ name: 'LESS_THAN_VARIABLE',
265
+ short: '<',
266
+ componentType: ['number'],
267
+ };
268
+ const GreaterThanVariable = {
269
+ id: 'gtv',
270
+ name: 'GREATER_THAN_VARIABLE',
271
+ short: '>',
272
+ componentType: ['number'],
273
+ };
274
+ const DateRangeVariable = {
275
+ id: 'dateRangeVariable',
276
+ name: 'DATE_RANGE_VARIABLE',
277
+ short: 'Range Variable',
278
+ componentType: ['date'],
279
+ };
280
+ const PepSmartFilterVariableOperators = {
281
+ EqualsToVariable: EqualsToVariable,
282
+ NotEqualsToVariable: NotEqualsToVariable,
283
+ LessThanVariable: LessThanVariable,
284
+ GreaterThanVariable: GreaterThanVariable,
285
+ DateRangeVariable: DateRangeVariable
286
+ };
287
+ class IPepSmartFilterOperatorUnit {
288
+ }
289
+ const Days = {
290
+ id: 'days',
291
+ name: 'DAYS',
292
+ componentType: ['date'],
293
+ };
294
+ const Weeks = {
295
+ id: 'weeks',
296
+ name: 'WEEKS',
297
+ componentType: ['date'],
298
+ };
299
+ const Months = {
300
+ id: 'months',
301
+ name: 'MONTHS',
302
+ componentType: ['date'],
303
+ };
304
+ const Years = {
305
+ id: 'years',
306
+ name: 'YEARS',
307
+ componentType: ['date'],
308
+ };
309
+ const PepSmartFilterOperatorUnits = {
310
+ Days: Days,
311
+ Weeks: Weeks,
312
+ Months: Months,
313
+ Years: Years,
314
314
  };
315
315
 
316
- class PepFilterActionsComponent {
317
- constructor() {
318
- this.clearClick = new EventEmitter();
319
- this.applyClick = new EventEmitter();
320
- }
321
- clear() {
322
- this.clearClick.emit();
323
- }
324
- apply() {
325
- this.applyClick.emit();
326
- }
327
- }
328
- PepFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
329
- PepFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepFilterActionsComponent, selector: "pep-filter-actions", inputs: { form: "form" }, outputs: { clearClick: "clearClick", applyClick: "applyClick" }, ngImport: i0, template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, decorators: [{
331
- type: Component,
332
- args: [{ selector: 'pep-filter-actions', template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"] }]
333
- }], propDecorators: { form: [{
334
- type: Input
335
- }], clearClick: [{
336
- type: Output
337
- }], applyClick: [{
338
- type: Output
316
+ class PepFilterActionsComponent {
317
+ constructor() {
318
+ this.clearClick = new EventEmitter();
319
+ this.applyClick = new EventEmitter();
320
+ }
321
+ clear() {
322
+ this.clearClick.emit();
323
+ }
324
+ apply() {
325
+ this.applyClick.emit();
326
+ }
327
+ }
328
+ PepFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
329
+ PepFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepFilterActionsComponent, selector: "pep-filter-actions", inputs: { form: "form" }, outputs: { clearClick: "clearClick", applyClick: "applyClick" }, ngImport: i0, template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
330
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, decorators: [{
331
+ type: Component,
332
+ args: [{ selector: 'pep-filter-actions', template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"] }]
333
+ }], propDecorators: { form: [{
334
+ type: Input
335
+ }], clearClick: [{
336
+ type: Output
337
+ }], applyClick: [{
338
+ type: Output
339
339
  }] } });
340
340
 
341
- class BaseFilterComponent {
342
- constructor(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
343
- this.viewContainerRef = viewContainerRef;
344
- this.injector = injector;
345
- this.resolver = resolver;
346
- this.builder = builder;
347
- this.translate = translate;
348
- this.validator = validator;
349
- this.renderer = renderer;
350
- this._fieldIdWithNoDots = '';
351
- this.variableFieldOptions = [];
352
- this.emitOnChange = false;
353
- this.inline = false;
354
- this.showActionButtons = true;
355
- this.renderTitle = true;
356
- this.showAdditionalOperators = false;
357
- this.filterClear = new EventEmitter();
358
- this.filterChange = new EventEmitter();
359
- this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
360
- this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
361
- this._destroyed = new Subject();
362
- }
363
- set field(value) {
364
- this._field = value;
365
- this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
366
- this.setupForm();
367
- }
368
- get field() {
369
- return this._field;
370
- }
371
- set variableField(list) {
372
- if (list === null || list === void 0 ? void 0 : list.length) {
373
- this.variableFieldOptions = list.map(item => {
374
- return {
375
- key: item,
376
- value: item
377
- };
378
- });
379
- }
380
- }
381
- set filter(value) {
382
- this._filter = value;
383
- this.setupFilter();
384
- }
385
- get filter() {
386
- return this._filter;
387
- }
388
- set parentForm(form) {
389
- this._parentForm = form;
390
- this.updateParentForm();
391
- }
392
- set operator(operator) {
393
- var _a;
394
- if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
395
- // Validate operator
396
- const index = this.operators.findIndex((o) => o.id === operator.id);
397
- if (index >= 0) {
398
- this._operator = this.operators[index];
399
- }
400
- else {
401
- this._operator = this.operators[0];
402
- }
403
- this.form.reset();
404
- this.updateValidity();
405
- }
406
- }
407
- get operator() {
408
- return this._operator;
409
- }
410
- set operatorUnit(operatorUnit) {
411
- // Validate operator unit
412
- if (operatorUnit) {
413
- const index = this.operatorUnits.findIndex((ou) => ou.id === operatorUnit.id);
414
- if (index >= 0) {
415
- this._operatorUnit = this.operatorUnits[index];
416
- }
417
- else {
418
- this._operatorUnit = this.operatorUnits[0];
419
- }
420
- }
421
- else {
422
- this._operatorUnit = undefined;
423
- }
424
- }
425
- get operatorUnit() {
426
- return this._operatorUnit;
427
- }
428
- get firstControlKey() {
429
- return this.field ? `${this._fieldIdWithNoDots}_first` : 'first';
430
- }
431
- get firstControl() {
432
- return this.form.get(this.firstControlKey);
433
- }
434
- get secondControlKey() {
435
- return this.field ? `${this._fieldIdWithNoDots}_second` : 'second';
436
- }
437
- get secondControl() {
438
- return this.form.get(this.secondControlKey);
439
- }
440
- createActionsComponent() {
441
- const factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
442
- this.actionsContainerRef = factory.create(this.injector);
443
- this.actionsContainerRef.instance.form = this.form;
444
- this.actionsContainerRef.instance.applyClick.subscribe(() => this.applyFilter());
445
- this.actionsContainerRef.instance.clearClick.subscribe(() => this.clearFilter());
446
- this.viewContainerRef.insert(this.actionsContainerRef.hostView);
447
- }
448
- setupForm() {
449
- const formValue = {};
450
- formValue[this.firstControlKey] = [];
451
- formValue[this.secondControlKey] = [];
452
- // this.form.patchValue(formValue);
453
- this.form = this.builder.group(formValue);
454
- // this.form[this.firstControlKey] = [];
455
- // this.form[this.secondControlKey] = [];
456
- this.setupOperators();
457
- if (this.showActionButtons) {
458
- this.createActionsComponent();
459
- }
460
- }
461
- setupOperators() {
462
- var _a, _b, _c;
463
- // Get the operators by componentType.
464
- this.operators = Object.keys(PepSmartFilterOperators)
465
- .filter((key) => {
466
- return PepSmartFilterOperators[key].componentType.includes(this.field.componentType);
467
- })
468
- .map((key) => PepSmartFilterOperators[key]);
469
- // Add additional operators
470
- if (this.showAdditionalOperators) {
471
- const additional = Object.keys(PepSmartFilterAdditionalOperators)
472
- .filter((key) => {
473
- return PepSmartFilterAdditionalOperators[key].componentType.includes(this.field.componentType);
474
- })
475
- .map((key) => PepSmartFilterAdditionalOperators[key]);
476
- this.operators = [...this.operators, ...additional];
477
- }
478
- //add variable operators
479
- if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
480
- const variables = Object.keys(PepSmartFilterVariableOperators)
481
- .filter((key) => {
482
- return PepSmartFilterVariableOperators[key].componentType.includes(this.field.componentType);
483
- })
484
- .map((key) => PepSmartFilterVariableOperators[key]);
485
- this.operators = [...this.operators, ...variables];
486
- }
487
- // Filter by from field.operators input if exist.
488
- if (((_b = this.field.operators) === null || _b === void 0 ? void 0 : _b.length) > 0) {
489
- this.operators = this.operators.filter((o1) => this.field.operators.some((o2) => o1.id === o2));
490
- }
491
- // Get the operator units by componentType.
492
- this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
493
- .filter((key) => {
494
- return PepSmartFilterOperatorUnits[key].componentType.includes(this.field.componentType);
495
- })
496
- .map((key) => PepSmartFilterOperatorUnits[key]);
497
- // Filter by from field.operatorsUnits input if exist.
498
- if (((_c = this.field.operatorUnits) === null || _c === void 0 ? void 0 : _c.length) > 0) {
499
- this.operatorUnits = this.operatorUnits.filter((o1) => this.field.operatorUnits.some((o2) => o1.id === o2));
500
- }
501
- // Load translation before get the options in the children.
502
- this.translate.get('SMART_FILTERS.TITLE').subscribe((res) => {
503
- this.loadOperatorsOptions();
504
- });
505
- }
506
- setupFilter() {
507
- if (this.filter) {
508
- this.operator = this.filter.operator;
509
- this.operatorUnit = this.filter.operatorUnit;
510
- const formValue = {};
511
- formValue[this.firstControlKey] = this.filter.value.first;
512
- formValue[this.secondControlKey] = this.filter.value.second;
513
- this.form.patchValue(formValue);
514
- }
515
- else {
516
- this.operator = this.getDefaultOperator();
517
- this.operatorUnit = this.getDefaultOperatorUnit();
518
- this.clearFilter(false);
519
- }
520
- }
521
- updateParentForm() {
522
- this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
523
- this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
524
- this._parentForm.setControl('operator', this.builder.control(this.operator));
525
- this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
526
- this._parentForm.setControl('values', this.builder.group({
527
- first: this.firstControl,
528
- second: this.secondControl
529
- }));
530
- }
531
- getDestroyer() {
532
- return takeUntil(this._destroyed);
533
- }
534
- updateValidity() {
535
- this.setFieldsStateAndValidators();
536
- this.firstControl.updateValueAndValidity();
537
- this.secondControl.updateValueAndValidity();
538
- }
539
- // Load the operators options from the translation.
540
- loadOperatorsOptions() {
541
- // Not implemented in the base
542
- }
543
- // Set default validators - some childs override this.
544
- setFieldsStateAndValidators() {
545
- this.firstControl.setValidators(Validators.required);
546
- this.secondControl.setValidators(Validators.required);
547
- this.secondControl.disable();
548
- }
549
- // Return undefined - some childs override this.
550
- getDefaultOperatorUnit() {
551
- return undefined;
552
- }
553
- initFilter() {
554
- // Not implemented in the base
555
- }
556
- clearFilter(emitEvent = true) {
557
- this._filter = null;
558
- this.form.reset();
559
- this.initFilter();
560
- if (emitEvent) {
561
- this.filterClear.emit();
562
- }
563
- }
564
- applyFilter() {
565
- const filterValue = this.getFilterValue();
566
- // If the filter is not null declare it, else - clear it.
567
- if (filterValue) {
568
- const filter = {
569
- fieldId: this.field.id,
570
- operator: this.operator,
571
- operatorUnit: this.operatorUnit,
572
- value: filterValue,
573
- };
574
- this._filter = filter;
575
- this.filterChange.emit(filter);
576
- }
577
- else {
578
- this.clearFilter();
579
- }
580
- }
581
- ngOnInit() {
582
- if (this.form) {
583
- this.updateValidity();
584
- }
585
- }
586
- ngOnChanges() {
587
- // if (this.form) {
588
- // this.updateValidity();
589
- // }
590
- }
591
- ngOnDestroy() {
592
- this._destroyed.next();
593
- this._destroyed.complete();
594
- if (this.showActionButtons) {
595
- this.actionsContainerRef.destroy();
596
- }
597
- }
598
- }
599
- BaseFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }, { token: i2.FormBuilder }, { token: i2$1.TranslateService }, { token: i3.PepValidatorService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
600
- BaseFilterComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: BaseFilterComponent, inputs: { field: "field", variableField: "variableField", filter: "filter", parentForm: "parentForm", emitOnChange: "emitOnChange", inline: "inline", showActionButtons: "showActionButtons", renderTitle: "renderTitle", showAdditionalOperators: "showAdditionalOperators" }, outputs: { filterClear: "filterClear", filterChange: "filterChange" }, usesOnChanges: true, ngImport: i0 });
601
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, decorators: [{
602
- type: Directive,
603
- args: [{}]
604
- }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i2.FormBuilder }, { type: i2$1.TranslateService }, { type: i3.PepValidatorService }, { type: i0.Renderer2 }]; }, propDecorators: { field: [{
605
- type: Input
606
- }], variableField: [{
607
- type: Input
608
- }], filter: [{
609
- type: Input
610
- }], parentForm: [{
611
- type: Input
612
- }], emitOnChange: [{
613
- type: Input
614
- }], inline: [{
615
- type: Input
616
- }], showActionButtons: [{
617
- type: Input
618
- }], renderTitle: [{
619
- type: Input
620
- }], showAdditionalOperators: [{
621
- type: Input
622
- }], filterClear: [{
623
- type: Output
624
- }], filterChange: [{
625
- type: Output
341
+ class BaseFilterComponent {
342
+ constructor(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
343
+ this.viewContainerRef = viewContainerRef;
344
+ this.injector = injector;
345
+ this.resolver = resolver;
346
+ this.builder = builder;
347
+ this.translate = translate;
348
+ this.validator = validator;
349
+ this.renderer = renderer;
350
+ this._fieldIdWithNoDots = '';
351
+ this.variableFieldOptions = [];
352
+ this.emitOnChange = false;
353
+ this.inline = false;
354
+ this.showActionButtons = true;
355
+ this.renderTitle = true;
356
+ this.showAdditionalOperators = false;
357
+ this.filterClear = new EventEmitter();
358
+ this.filterChange = new EventEmitter();
359
+ this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
360
+ this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
361
+ this._destroyed = new Subject();
362
+ }
363
+ set field(value) {
364
+ this._field = value;
365
+ this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
366
+ this.setupForm();
367
+ }
368
+ get field() {
369
+ return this._field;
370
+ }
371
+ set variableField(list) {
372
+ if (list === null || list === void 0 ? void 0 : list.length) {
373
+ this.variableFieldOptions = list.map(item => {
374
+ return {
375
+ key: item,
376
+ value: item
377
+ };
378
+ });
379
+ }
380
+ }
381
+ set filter(value) {
382
+ this._filter = value;
383
+ this.setupFilter();
384
+ }
385
+ get filter() {
386
+ return this._filter;
387
+ }
388
+ set parentForm(form) {
389
+ this._parentForm = form;
390
+ this.updateParentForm();
391
+ }
392
+ set operator(operator) {
393
+ var _a;
394
+ if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
395
+ // Validate operator
396
+ const index = this.operators.findIndex((o) => o.id === operator.id);
397
+ if (index >= 0) {
398
+ this._operator = this.operators[index];
399
+ }
400
+ else {
401
+ this._operator = this.operators[0];
402
+ }
403
+ this.form.reset();
404
+ this.updateValidity();
405
+ }
406
+ }
407
+ get operator() {
408
+ return this._operator;
409
+ }
410
+ set operatorUnit(operatorUnit) {
411
+ // Validate operator unit
412
+ if (operatorUnit) {
413
+ const index = this.operatorUnits.findIndex((ou) => ou.id === operatorUnit.id);
414
+ if (index >= 0) {
415
+ this._operatorUnit = this.operatorUnits[index];
416
+ }
417
+ else {
418
+ this._operatorUnit = this.operatorUnits[0];
419
+ }
420
+ }
421
+ else {
422
+ this._operatorUnit = undefined;
423
+ }
424
+ }
425
+ get operatorUnit() {
426
+ return this._operatorUnit;
427
+ }
428
+ get firstControlKey() {
429
+ return this.field ? `${this._fieldIdWithNoDots}_first` : 'first';
430
+ }
431
+ get firstControl() {
432
+ return this.form.get(this.firstControlKey);
433
+ }
434
+ get secondControlKey() {
435
+ return this.field ? `${this._fieldIdWithNoDots}_second` : 'second';
436
+ }
437
+ get secondControl() {
438
+ return this.form.get(this.secondControlKey);
439
+ }
440
+ createActionsComponent() {
441
+ const factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
442
+ this.actionsContainerRef = factory.create(this.injector);
443
+ this.actionsContainerRef.instance.form = this.form;
444
+ this.actionsContainerRef.instance.applyClick.subscribe(() => this.applyFilter());
445
+ this.actionsContainerRef.instance.clearClick.subscribe(() => this.clearFilter());
446
+ this.viewContainerRef.insert(this.actionsContainerRef.hostView);
447
+ }
448
+ setupForm() {
449
+ const formValue = {};
450
+ formValue[this.firstControlKey] = [];
451
+ formValue[this.secondControlKey] = [];
452
+ // this.form.patchValue(formValue);
453
+ this.form = this.builder.group(formValue);
454
+ // this.form[this.firstControlKey] = [];
455
+ // this.form[this.secondControlKey] = [];
456
+ this.setupOperators();
457
+ if (this.showActionButtons) {
458
+ this.createActionsComponent();
459
+ }
460
+ }
461
+ setupOperators() {
462
+ var _a, _b, _c;
463
+ // Get the operators by componentType.
464
+ this.operators = Object.keys(PepSmartFilterOperators)
465
+ .filter((key) => {
466
+ return PepSmartFilterOperators[key].componentType.includes(this.field.componentType);
467
+ })
468
+ .map((key) => PepSmartFilterOperators[key]);
469
+ // Add additional operators
470
+ if (this.showAdditionalOperators) {
471
+ const additional = Object.keys(PepSmartFilterAdditionalOperators)
472
+ .filter((key) => {
473
+ return PepSmartFilterAdditionalOperators[key].componentType.includes(this.field.componentType);
474
+ })
475
+ .map((key) => PepSmartFilterAdditionalOperators[key]);
476
+ this.operators = [...this.operators, ...additional];
477
+ }
478
+ //add variable operators
479
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
480
+ const variables = Object.keys(PepSmartFilterVariableOperators)
481
+ .filter((key) => {
482
+ return PepSmartFilterVariableOperators[key].componentType.includes(this.field.componentType);
483
+ })
484
+ .map((key) => PepSmartFilterVariableOperators[key]);
485
+ this.operators = [...this.operators, ...variables];
486
+ }
487
+ // Filter by from field.operators input if exist.
488
+ if (((_b = this.field.operators) === null || _b === void 0 ? void 0 : _b.length) > 0) {
489
+ this.operators = this.operators.filter((o1) => this.field.operators.some((o2) => o1.id === o2));
490
+ }
491
+ // Get the operator units by componentType.
492
+ this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
493
+ .filter((key) => {
494
+ return PepSmartFilterOperatorUnits[key].componentType.includes(this.field.componentType);
495
+ })
496
+ .map((key) => PepSmartFilterOperatorUnits[key]);
497
+ // Filter by from field.operatorsUnits input if exist.
498
+ if (((_c = this.field.operatorUnits) === null || _c === void 0 ? void 0 : _c.length) > 0) {
499
+ this.operatorUnits = this.operatorUnits.filter((o1) => this.field.operatorUnits.some((o2) => o1.id === o2));
500
+ }
501
+ // Load translation before get the options in the children.
502
+ this.translate.get('SMART_FILTERS.TITLE').subscribe((res) => {
503
+ this.loadOperatorsOptions();
504
+ });
505
+ }
506
+ setupFilter() {
507
+ if (this.filter) {
508
+ this.operator = this.filter.operator;
509
+ this.operatorUnit = this.filter.operatorUnit;
510
+ const formValue = {};
511
+ formValue[this.firstControlKey] = this.filter.value.first;
512
+ formValue[this.secondControlKey] = this.filter.value.second;
513
+ this.form.patchValue(formValue);
514
+ }
515
+ else {
516
+ this.operator = this.getDefaultOperator();
517
+ this.operatorUnit = this.getDefaultOperatorUnit();
518
+ this.clearFilter(false);
519
+ }
520
+ }
521
+ updateParentForm() {
522
+ this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
523
+ this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
524
+ this._parentForm.setControl('operator', this.builder.control(this.operator));
525
+ this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
526
+ this._parentForm.setControl('values', this.builder.group({
527
+ first: this.firstControl,
528
+ second: this.secondControl
529
+ }));
530
+ }
531
+ getDestroyer() {
532
+ return takeUntil(this._destroyed);
533
+ }
534
+ updateValidity() {
535
+ this.setFieldsStateAndValidators();
536
+ this.firstControl.updateValueAndValidity();
537
+ this.secondControl.updateValueAndValidity();
538
+ }
539
+ // Load the operators options from the translation.
540
+ loadOperatorsOptions() {
541
+ // Not implemented in the base
542
+ }
543
+ // Set default validators - some childs override this.
544
+ setFieldsStateAndValidators() {
545
+ this.firstControl.setValidators(Validators.required);
546
+ this.secondControl.setValidators(Validators.required);
547
+ this.secondControl.disable();
548
+ }
549
+ // Return undefined - some childs override this.
550
+ getDefaultOperatorUnit() {
551
+ return undefined;
552
+ }
553
+ initFilter() {
554
+ // Not implemented in the base
555
+ }
556
+ clearFilter(emitEvent = true) {
557
+ this._filter = null;
558
+ this.form.reset();
559
+ this.initFilter();
560
+ if (emitEvent) {
561
+ this.filterClear.emit();
562
+ }
563
+ }
564
+ applyFilter() {
565
+ const filterValue = this.getFilterValue();
566
+ // If the filter is not null declare it, else - clear it.
567
+ if (filterValue) {
568
+ const filter = {
569
+ fieldId: this.field.id,
570
+ operator: this.operator,
571
+ operatorUnit: this.operatorUnit,
572
+ value: filterValue,
573
+ };
574
+ this._filter = filter;
575
+ this.filterChange.emit(filter);
576
+ }
577
+ else {
578
+ this.clearFilter();
579
+ }
580
+ }
581
+ ngOnInit() {
582
+ if (this.form) {
583
+ this.updateValidity();
584
+ }
585
+ }
586
+ ngOnChanges() {
587
+ // if (this.form) {
588
+ // this.updateValidity();
589
+ // }
590
+ }
591
+ ngOnDestroy() {
592
+ this._destroyed.next();
593
+ this._destroyed.complete();
594
+ if (this.showActionButtons) {
595
+ this.actionsContainerRef.destroy();
596
+ }
597
+ }
598
+ }
599
+ BaseFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }, { token: i2.FormBuilder }, { token: i2$1.TranslateService }, { token: i3.PepValidatorService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
600
+ BaseFilterComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: BaseFilterComponent, inputs: { field: "field", variableField: "variableField", filter: "filter", parentForm: "parentForm", emitOnChange: "emitOnChange", inline: "inline", showActionButtons: "showActionButtons", renderTitle: "renderTitle", showAdditionalOperators: "showAdditionalOperators" }, outputs: { filterClear: "filterClear", filterChange: "filterChange" }, usesOnChanges: true, ngImport: i0 });
601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, decorators: [{
602
+ type: Directive,
603
+ args: [{}]
604
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i2.FormBuilder }, { type: i2$1.TranslateService }, { type: i3.PepValidatorService }, { type: i0.Renderer2 }]; }, propDecorators: { field: [{
605
+ type: Input
606
+ }], variableField: [{
607
+ type: Input
608
+ }], filter: [{
609
+ type: Input
610
+ }], parentForm: [{
611
+ type: Input
612
+ }], emitOnChange: [{
613
+ type: Input
614
+ }], inline: [{
615
+ type: Input
616
+ }], showActionButtons: [{
617
+ type: Input
618
+ }], renderTitle: [{
619
+ type: Input
620
+ }], showAdditionalOperators: [{
621
+ type: Input
622
+ }], filterClear: [{
623
+ type: Output
624
+ }], filterChange: [{
625
+ type: Output
626
626
  }] } });
627
627
 
628
- class PepTextFilterComponent extends BaseFilterComponent {
629
- constructor() {
630
- super(...arguments);
631
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
632
- this.chooseTypeOptions = [];
633
- this.operatorWidth = '38%';
634
- this.firstControlWidth = '62%';
635
- }
636
- ngOnInit() {
637
- this.firstControl.valueChanges
638
- .pipe(this.getDestroyer(), distinctUntilChanged())
639
- .subscribe(() => {
640
- this.setFieldsStateAndValidators();
641
- });
642
- }
643
- // Override
644
- getDefaultOperator() {
645
- return PepSmartFilterOperators.Equals;
646
- }
647
- // Override
648
- getFilterValue() {
649
- const filterValue = {
650
- first: this.firstControl.value,
651
- };
652
- if (this.operator === PepSmartFilterOperators.NumberRange) {
653
- filterValue['second'] = this.secondControl.value;
654
- }
655
- return filterValue;
656
- }
657
- // Override
658
- loadOperatorsOptions() {
659
- this.chooseTypeOptions = this.operators.map((operator) => {
660
- return {
661
- key: operator.id,
662
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
663
- };
664
- });
665
- }
666
- // Override
667
- setFieldsStateAndValidators() {
668
- if (this.operator === PepSmartFilterOperators.NumberRange) {
669
- const firstValidators = [Validators.required];
670
- if (this.secondControl.value) {
671
- firstValidators.push(this.validator.isLessThan(this.secondControl));
672
- }
673
- this.firstControl.setValidators(firstValidators);
674
- }
675
- else {
676
- super.setFieldsStateAndValidators();
677
- }
678
- }
679
- onOperatorChanged(value) {
680
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
681
- this.operator = operator;
682
- if (this._parentForm) {
683
- this.updateParentForm();
684
- }
685
- if (this.emitOnChange) {
686
- this.applyFilter();
687
- }
688
- }
689
- onVariableChanged(value) {
690
- this.firstControl.setValue(value);
691
- if (this.emitOnChange) {
692
- this.applyFilter();
693
- }
694
- }
695
- onValueChanged() {
696
- if (this.emitOnChange) {
697
- this.applyFilter();
698
- }
699
- }
700
- }
701
- PepTextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
702
- PepTextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextFilterComponent, selector: "pep-text-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
703
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, decorators: [{
704
- type: Component,
705
- args: [{ selector: 'pep-text-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>" }]
628
+ class PepTextFilterComponent extends BaseFilterComponent {
629
+ constructor() {
630
+ super(...arguments);
631
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
632
+ this.chooseTypeOptions = [];
633
+ this.operatorWidth = '38%';
634
+ this.firstControlWidth = '62%';
635
+ }
636
+ ngOnInit() {
637
+ this.firstControl.valueChanges
638
+ .pipe(this.getDestroyer(), distinctUntilChanged())
639
+ .subscribe(() => {
640
+ this.setFieldsStateAndValidators();
641
+ });
642
+ }
643
+ // Override
644
+ getDefaultOperator() {
645
+ return PepSmartFilterOperators.Equals;
646
+ }
647
+ // Override
648
+ getFilterValue() {
649
+ const filterValue = {
650
+ first: this.firstControl.value,
651
+ };
652
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
653
+ filterValue['second'] = this.secondControl.value;
654
+ }
655
+ return filterValue;
656
+ }
657
+ // Override
658
+ loadOperatorsOptions() {
659
+ this.chooseTypeOptions = this.operators.map((operator) => {
660
+ return {
661
+ key: operator.id,
662
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
663
+ };
664
+ });
665
+ }
666
+ // Override
667
+ setFieldsStateAndValidators() {
668
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
669
+ const firstValidators = [Validators.required];
670
+ if (this.secondControl.value) {
671
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
672
+ }
673
+ this.firstControl.setValidators(firstValidators);
674
+ }
675
+ else {
676
+ super.setFieldsStateAndValidators();
677
+ }
678
+ }
679
+ onOperatorChanged(value) {
680
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
681
+ this.operator = operator;
682
+ if (this._parentForm) {
683
+ this.updateParentForm();
684
+ }
685
+ if (this.emitOnChange) {
686
+ this.applyFilter();
687
+ }
688
+ }
689
+ onVariableChanged(value) {
690
+ this.firstControl.setValue(value);
691
+ if (this.emitOnChange) {
692
+ this.applyFilter();
693
+ }
694
+ }
695
+ onValueChanged() {
696
+ if (this.emitOnChange) {
697
+ this.applyFilter();
698
+ }
699
+ }
700
+ }
701
+ PepTextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
702
+ PepTextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextFilterComponent, selector: "pep-text-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, decorators: [{
704
+ type: Component,
705
+ args: [{ selector: 'pep-text-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>" }]
706
706
  }] });
707
707
 
708
- class PepBooleanFilterComponent extends BaseFilterComponent {
709
- constructor() {
710
- super(...arguments);
711
- this.options = [];
712
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
713
- this.chooseTypeOptions = [];
714
- }
715
- ngOnInit() {
716
- if (this.inline) {
717
- this.setControlsWidth();
718
- }
719
- }
720
- // Override
721
- getDefaultOperator() {
722
- return PepSmartFilterOperators.Equals;
723
- }
724
- // Override
725
- getFilterValue() {
726
- const filterValue = { first: this.firstControl.value || false };
727
- return filterValue;
728
- }
729
- // Override
730
- loadOperatorsOptions() {
731
- this.chooseTypeOptions = this.operators.map((operator) => {
732
- return {
733
- key: operator.id,
734
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
735
- };
736
- });
737
- }
738
- setControlsWidth() {
739
- var _a;
740
- if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
741
- this.operatorWidth = '38%';
742
- this.valueWidth = '62%';
743
- }
744
- else {
745
- this.valueWidth = '100%';
746
- }
747
- }
748
- onOperatorChanged(value) {
749
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
750
- this.operator = operator;
751
- if (this._parentForm) {
752
- this.updateParentForm();
753
- }
754
- if (this.emitOnChange) {
755
- this.applyFilter();
756
- }
757
- }
758
- onValueChanged(value) {
759
- this.firstControl.setValue(value);
760
- if (this.emitOnChange) {
761
- this.applyFilter();
762
- }
763
- }
764
- }
765
- PepBooleanFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
766
- PepBooleanFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: { options: "options" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n </div>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i4$1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
767
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, decorators: [{
768
- type: Component,
769
- args: [{ selector: 'pep-boolean-filter', template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n </div>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"] }]
770
- }], propDecorators: { options: [{
771
- type: Input
708
+ class PepBooleanFilterComponent extends BaseFilterComponent {
709
+ constructor() {
710
+ super(...arguments);
711
+ this.options = [];
712
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
713
+ this.chooseTypeOptions = [];
714
+ }
715
+ ngOnInit() {
716
+ if (this.inline) {
717
+ this.setControlsWidth();
718
+ }
719
+ }
720
+ // Override
721
+ getDefaultOperator() {
722
+ return PepSmartFilterOperators.Equals;
723
+ }
724
+ // Override
725
+ getFilterValue() {
726
+ const filterValue = { first: this.firstControl.value || false };
727
+ return filterValue;
728
+ }
729
+ // Override
730
+ loadOperatorsOptions() {
731
+ this.chooseTypeOptions = this.operators.map((operator) => {
732
+ return {
733
+ key: operator.id,
734
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
735
+ };
736
+ });
737
+ }
738
+ setControlsWidth() {
739
+ var _a;
740
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
741
+ this.operatorWidth = '38%';
742
+ this.valueWidth = '62%';
743
+ }
744
+ else {
745
+ this.valueWidth = '100%';
746
+ }
747
+ }
748
+ onOperatorChanged(value) {
749
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
750
+ this.operator = operator;
751
+ if (this._parentForm) {
752
+ this.updateParentForm();
753
+ }
754
+ if (this.emitOnChange) {
755
+ this.applyFilter();
756
+ }
757
+ }
758
+ onValueChanged(value) {
759
+ this.firstControl.setValue(value);
760
+ if (this.emitOnChange) {
761
+ this.applyFilter();
762
+ }
763
+ }
764
+ }
765
+ PepBooleanFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
766
+ PepBooleanFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: { options: "options" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n </div>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i4$1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
767
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, decorators: [{
768
+ type: Component,
769
+ args: [{ selector: 'pep-boolean-filter', template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"!inline\" [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group\" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n {{ 'CHECKBOX.TRUE' | translate }}\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n {{ 'CHECKBOX.FALSE' | translate }}\n </mat-radio-button>\n </mat-radio-group>\n </div>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"] }]
770
+ }], propDecorators: { options: [{
771
+ type: Input
772
772
  }] } });
773
773
 
774
- class PepDateFilterComponent extends BaseFilterComponent {
775
- constructor() {
776
- super(...arguments);
777
- this.PepSmartFilterOperators = PepSmartFilterOperators;
778
- this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
779
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
780
- this.chooseTimeOptions = [];
781
- this.chooseTimeUnitOptions = [];
782
- }
783
- ngOnInit() {
784
- if (this.inline) {
785
- this.setControlsWidth();
786
- }
787
- }
788
- // Override
789
- getDefaultOperator() {
790
- return PepSmartFilterOperators.InTheLast;
791
- }
792
- // Override
793
- getDefaultOperatorUnit() {
794
- if (this.operator === PepSmartFilterOperators.InTheLast ||
795
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
796
- this.operator === PepSmartFilterOperators.NotInTheLast ||
797
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
798
- this.operator === PepSmartFilterOperators.DueIn ||
799
- this.operator === PepSmartFilterOperators.NotDueIn) {
800
- return PepSmartFilterOperatorUnits.Months;
801
- }
802
- else {
803
- return undefined;
804
- }
805
- }
806
- // Override
807
- getFilterValue() {
808
- const filterValue = {
809
- first: this.firstControl.value,
810
- };
811
- if (this.operator === PepSmartFilterOperators.DateRange ||
812
- PepSmartFilterVariableOperators.DateRangeVariable) {
813
- filterValue['second'] = this.secondControl.value;
814
- }
815
- return filterValue;
816
- }
817
- // Override
818
- loadOperatorsOptions() {
819
- this.chooseTimeOptions = this.operators.map((operator) => {
820
- return {
821
- key: operator.id,
822
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
823
- };
824
- });
825
- this.chooseTimeUnitOptions = this.operatorUnits.map((operatorUnit) => {
826
- return {
827
- key: operatorUnit.id,
828
- value: this.translate.instant(`${this.OPERATOR_UNITS_TRANSLATION_PREFIX}.${operatorUnit.name}`),
829
- };
830
- });
831
- }
832
- // Override
833
- setFieldsStateAndValidators() {
834
- this.firstControl.enable();
835
- if (this.operator === PepSmartFilterOperators.DateRange ||
836
- this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
837
- this.firstControl.setValidators(Validators.required);
838
- this.secondControl.enable();
839
- this.secondControl.setValidators(Validators.required);
840
- }
841
- else if (this.operator === PepSmartFilterOperators.InTheLast ||
842
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
843
- this.operator === PepSmartFilterOperators.NotInTheLast ||
844
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
845
- this.operator === PepSmartFilterOperators.DueIn ||
846
- this.operator === PepSmartFilterOperators.NotDueIn) {
847
- this.firstControl.setValidators([
848
- Validators.required,
849
- this.validator.numberValidator(),
850
- ]);
851
- this.secondControl.disable();
852
- }
853
- else {
854
- // Disable 'first' field.
855
- if (this.operator === PepSmartFilterOperators.Today ||
856
- this.operator === PepSmartFilterOperators.ThisWeek ||
857
- this.operator === PepSmartFilterOperators.ThisMonth ||
858
- this.operator === PepSmartFilterOperators.IsEmpty ||
859
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
860
- this.firstControl.disable();
861
- }
862
- // Default disable 'second' field.
863
- super.setFieldsStateAndValidators();
864
- }
865
- }
866
- setControlsWidth() {
867
- if (this.operator === PepSmartFilterOperators.Today ||
868
- this.operator === PepSmartFilterOperators.ThisWeek ||
869
- this.operator === PepSmartFilterOperators.ThisMonth ||
870
- this.operator === PepSmartFilterOperators.IsEmpty ||
871
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
872
- this.operatorWidth = 'auto';
873
- this.fieldsWidth = '0%';
874
- }
875
- else if (this.operator === PepSmartFilterOperators.On) {
876
- this.operatorWidth = '38%';
877
- this.fieldsWidth = '62%';
878
- }
879
- else {
880
- this.operatorWidth = '30%';
881
- this.fieldsWidth = '70%';
882
- }
883
- }
884
- onOperatorChanged(value) {
885
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
886
- this.operator = operator;
887
- this.operatorUnit = this.getDefaultOperatorUnit();
888
- if (this.inline) {
889
- this.setControlsWidth();
890
- }
891
- if (this._parentForm) {
892
- this.updateParentForm();
893
- }
894
- if (this.emitOnChange) {
895
- this.applyFilter();
896
- }
897
- }
898
- onTimeUnitChanged(value) {
899
- const operatorUnit = Object.values(PepSmartFilterOperatorUnits).find((operatorUnit) => operatorUnit.id === value);
900
- this.operatorUnit = operatorUnit;
901
- if (this._parentForm) {
902
- this.updateParentForm();
903
- }
904
- if (this.emitOnChange) {
905
- this.applyFilter();
906
- }
907
- }
908
- onVariableChanged(value) {
909
- this.firstControl.setValue(value);
910
- if (this.emitOnChange) {
911
- this.applyFilter();
912
- }
913
- }
914
- onSecondVariableChanged(value) {
915
- this.secondControl.setValue(value);
916
- if (this.emitOnChange) {
917
- this.applyFilter();
918
- }
919
- }
920
- onDateValueChanged() {
921
- if (this.emitOnChange) {
922
- this.applyFilter();
923
- }
924
- }
925
- }
926
- PepDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
927
- PepDateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepDateFilterComponent, selector: "pep-date-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.PepRtlDirectionDirective, selector: "[pepRtlDirection]" }, { kind: "component", type: i5$1.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "formattedValue", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
928
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, decorators: [{
929
- type: Component,
930
- args: [{ selector: 'pep-date-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n" }]
774
+ class PepDateFilterComponent extends BaseFilterComponent {
775
+ constructor() {
776
+ super(...arguments);
777
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
778
+ this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
779
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
780
+ this.chooseTimeOptions = [];
781
+ this.chooseTimeUnitOptions = [];
782
+ }
783
+ ngOnInit() {
784
+ if (this.inline) {
785
+ this.setControlsWidth();
786
+ }
787
+ }
788
+ // Override
789
+ getDefaultOperator() {
790
+ return PepSmartFilterOperators.InTheLast;
791
+ }
792
+ // Override
793
+ getDefaultOperatorUnit() {
794
+ if (this.operator === PepSmartFilterOperators.InTheLast ||
795
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
796
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
797
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
798
+ this.operator === PepSmartFilterOperators.DueIn ||
799
+ this.operator === PepSmartFilterOperators.NotDueIn) {
800
+ return PepSmartFilterOperatorUnits.Months;
801
+ }
802
+ else {
803
+ return undefined;
804
+ }
805
+ }
806
+ // Override
807
+ getFilterValue() {
808
+ const filterValue = {
809
+ first: this.firstControl.value,
810
+ };
811
+ if (this.operator === PepSmartFilterOperators.DateRange ||
812
+ PepSmartFilterVariableOperators.DateRangeVariable) {
813
+ filterValue['second'] = this.secondControl.value;
814
+ }
815
+ return filterValue;
816
+ }
817
+ // Override
818
+ loadOperatorsOptions() {
819
+ this.chooseTimeOptions = this.operators.map((operator) => {
820
+ return {
821
+ key: operator.id,
822
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
823
+ };
824
+ });
825
+ this.chooseTimeUnitOptions = this.operatorUnits.map((operatorUnit) => {
826
+ return {
827
+ key: operatorUnit.id,
828
+ value: this.translate.instant(`${this.OPERATOR_UNITS_TRANSLATION_PREFIX}.${operatorUnit.name}`),
829
+ };
830
+ });
831
+ }
832
+ // Override
833
+ setFieldsStateAndValidators() {
834
+ this.firstControl.enable();
835
+ if (this.operator === PepSmartFilterOperators.DateRange ||
836
+ this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
837
+ this.firstControl.setValidators(Validators.required);
838
+ this.secondControl.enable();
839
+ this.secondControl.setValidators(Validators.required);
840
+ }
841
+ else if (this.operator === PepSmartFilterOperators.InTheLast ||
842
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
843
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
844
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
845
+ this.operator === PepSmartFilterOperators.DueIn ||
846
+ this.operator === PepSmartFilterOperators.NotDueIn) {
847
+ this.firstControl.setValidators([
848
+ Validators.required,
849
+ this.validator.numberValidator(),
850
+ ]);
851
+ this.secondControl.disable();
852
+ }
853
+ else {
854
+ // Disable 'first' field.
855
+ if (this.operator === PepSmartFilterOperators.Today ||
856
+ this.operator === PepSmartFilterOperators.ThisWeek ||
857
+ this.operator === PepSmartFilterOperators.ThisMonth ||
858
+ this.operator === PepSmartFilterOperators.IsEmpty ||
859
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
860
+ this.firstControl.disable();
861
+ }
862
+ // Default disable 'second' field.
863
+ super.setFieldsStateAndValidators();
864
+ }
865
+ }
866
+ setControlsWidth() {
867
+ if (this.operator === PepSmartFilterOperators.Today ||
868
+ this.operator === PepSmartFilterOperators.ThisWeek ||
869
+ this.operator === PepSmartFilterOperators.ThisMonth ||
870
+ this.operator === PepSmartFilterOperators.IsEmpty ||
871
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
872
+ this.operatorWidth = 'auto';
873
+ this.fieldsWidth = '0%';
874
+ }
875
+ else if (this.operator === PepSmartFilterOperators.On) {
876
+ this.operatorWidth = '38%';
877
+ this.fieldsWidth = '62%';
878
+ }
879
+ else {
880
+ this.operatorWidth = '30%';
881
+ this.fieldsWidth = '70%';
882
+ }
883
+ }
884
+ onOperatorChanged(value) {
885
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
886
+ this.operator = operator;
887
+ this.operatorUnit = this.getDefaultOperatorUnit();
888
+ if (this.inline) {
889
+ this.setControlsWidth();
890
+ }
891
+ if (this._parentForm) {
892
+ this.updateParentForm();
893
+ }
894
+ if (this.emitOnChange) {
895
+ this.applyFilter();
896
+ }
897
+ }
898
+ onTimeUnitChanged(value) {
899
+ const operatorUnit = Object.values(PepSmartFilterOperatorUnits).find((operatorUnit) => operatorUnit.id === value);
900
+ this.operatorUnit = operatorUnit;
901
+ if (this._parentForm) {
902
+ this.updateParentForm();
903
+ }
904
+ if (this.emitOnChange) {
905
+ this.applyFilter();
906
+ }
907
+ }
908
+ onVariableChanged(value) {
909
+ this.firstControl.setValue(value);
910
+ if (this.emitOnChange) {
911
+ this.applyFilter();
912
+ }
913
+ }
914
+ onSecondVariableChanged(value) {
915
+ this.secondControl.setValue(value);
916
+ if (this.emitOnChange) {
917
+ this.applyFilter();
918
+ }
919
+ }
920
+ onDateValueChanged() {
921
+ if (this.emitOnChange) {
922
+ this.applyFilter();
923
+ }
924
+ }
925
+ }
926
+ PepDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
927
+ PepDateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepDateFilterComponent, selector: "pep-date-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i3.PepRtlDirectionDirective, selector: "[pepRtlDirection]" }, { kind: "component", type: i5$1.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "formattedValue", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, decorators: [{
929
+ type: Component,
930
+ args: [{ selector: 'pep-date-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n" }]
931
931
  }] });
932
932
 
933
- class PepMultiSelectFilterOption {
934
- constructor() {
935
- this.selected = false;
936
- }
937
- }
938
- class PepMultiSelectFilterComponent extends BaseFilterComponent {
939
- constructor() {
940
- super(...arguments);
941
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
942
- this.options = [];
943
- this.chooseTypeOptions = [];
944
- this.searchControl = new FormControl();
945
- //inline props
946
- this.selected = '';
947
- this.inlineOptions = [];
948
- this.MAX_OPTIONS_TO_SHOW = 6.35;
949
- this.numberOptionsToShowSearch = 10;
950
- }
951
- ngOnInit() {
952
- super.ngOnInit;
953
- if (this.inline) {
954
- this.inlineControlInit();
955
- this.setControlsWidth();
956
- }
957
- else {
958
- this.noneInlineControlInit();
959
- }
960
- }
961
- ngAfterViewInit() {
962
- // Calc for the first time.
963
- this.calcOptionsHeight(this.options.length);
964
- }
965
- inlineControlInit() {
966
- var _a, _b, _c;
967
- //load options from field
968
- this.inlineOptions = ((_b = (_a = this.field) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this.field.options : [];
969
- // init the selected values from first value.
970
- if (((_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) && Array.isArray(this.firstControl.value)) {
971
- this.selected = this.firstControl.value.join(';');
972
- }
973
- }
974
- noneInlineControlInit() {
975
- var _a;
976
- if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
977
- this.options = this.field.options.map((opt) => {
978
- return { value: opt.value, count: opt.count, selected: false };
979
- });
980
- }
981
- else {
982
- this.searchControl.disable();
983
- }
984
- // Init the selected values from first value.
985
- const firstControl = this.firstControl;
986
- if (firstControl.value) {
987
- this.initOptionsSelectedValues(firstControl.value);
988
- }
989
- // Add subscription for the first value change to set the selected options.
990
- firstControl.valueChanges
991
- .pipe(this.getDestroyer(), distinctUntilChanged())
992
- .subscribe((selectedValues) => {
993
- this.initOptionsSelectedValues(selectedValues);
994
- });
995
- // Filter the options by the search control.
996
- this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), startWith(''), map((option) => typeof option === 'string' ? option : option && option.value), map((value) => (value ? this.filterOptions(value) : this.options)));
997
- // Each time the filter change.
998
- this.filteredOptions$.subscribe((filterdOptions) => {
999
- this.calcOptionsHeight(filterdOptions.length);
1000
- setTimeout(() => {
1001
- // 8 is the padding top of the multi-select-options
1002
- this.virtualScroller.scrollToPosition(-8);
1003
- }, 125);
1004
- });
1005
- }
1006
- initOptionsSelectedValues(selectedValues) {
1007
- this.options.forEach((opt) => {
1008
- const isValueSelected = selectedValues && selectedValues.includes(opt.value);
1009
- opt.selected = isValueSelected;
1010
- });
1011
- }
1012
- calcOptionsHeight(optionsCount) {
1013
- if (this.optionsContainer) {
1014
- const optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1015
- ? this.MAX_OPTIONS_TO_SHOW
1016
- : optionsCount;
1017
- // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1018
- const optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1019
- this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1020
- }
1021
- }
1022
- filterOptions(value) {
1023
- const filterValue = value.toLowerCase();
1024
- return this.options.filter((opt) => opt.value &&
1025
- opt.value.toLowerCase().includes(filterValue.toLowerCase()));
1026
- }
1027
- // Override
1028
- getDefaultOperator() {
1029
- return PepSmartFilterOperators.In;
1030
- }
1031
- // Override
1032
- getFilterValue() {
1033
- if (this.inline) {
1034
- return {
1035
- first: this.firstControl.value
1036
- };
1037
- }
1038
- else {
1039
- const selectedValues = this.options
1040
- .filter((opt) => opt.selected)
1041
- .map((opt) => opt.value);
1042
- const filterValue = {
1043
- first: selectedValues,
1044
- };
1045
- return selectedValues.length > 0 ? filterValue : null;
1046
- }
1047
- }
1048
- // Override
1049
- loadOperatorsOptions() {
1050
- this.chooseTypeOptions = this.operators.map((operator) => {
1051
- return {
1052
- key: operator.id,
1053
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1054
- };
1055
- });
1056
- }
1057
- setControlsWidth() {
1058
- var _a;
1059
- if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1060
- this.operatorWidth = '38%';
1061
- this.valueWidth = '62%';
1062
- }
1063
- else {
1064
- this.valueWidth = '100%';
1065
- }
1066
- }
1067
- onOperatorChanged(value) {
1068
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
1069
- this.operator = operator;
1070
- if (this._parentForm) {
1071
- this.updateParentForm();
1072
- }
1073
- if (this.emitOnChange) {
1074
- this.applyFilter();
1075
- }
1076
- }
1077
- // Override
1078
- initFilter() {
1079
- this.options.forEach((opt) => (opt.selected = false));
1080
- this.searchControl.setValue('');
1081
- }
1082
- onOptionChange(option, event) {
1083
- option.selected = event.checked;
1084
- this.firstControl.setValue(this.options.filter((opt) => opt.selected).map((opt) => opt.value), { emitEvent: false });
1085
- }
1086
- onMultiSelectChanged(value) {
1087
- if (value) {
1088
- const selected = value.split(';');
1089
- this.firstControl.setValue(selected);
1090
- }
1091
- else {
1092
- this.firstControl.setValue(null);
1093
- }
1094
- if (this.emitOnChange) {
1095
- this.applyFilter();
1096
- }
1097
- }
1098
- onValueChanged(value) {
1099
- this.firstControl.setValue(value);
1100
- if (this.emitOnChange) {
1101
- this.applyFilter();
1102
- }
1103
- }
1104
- }
1105
- PepMultiSelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1106
- PepMultiSelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter", viewQueries: [{ propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true }, { propertyName: "virtualScroller", first: true, predicate: VirtualScrollerComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i4$2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i5$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i6.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "RTL", "useMarginInsteadOfTranslate", "ssrViewportWidth", "ssrViewportHeight", "compareItems", "checkResizeInterval", "modifyOverflowStyleOfParentScroll", "resizeBypassRefreshThreshold", "scrollAnimationTime", "scrollDebounceTime", "scrollThrottlingTime", "scrollbarHeight", "scrollbarWidth", "stripedTable", "horizontal", "enableUnequalChildrenSizes", "bufferAmount", "items", "parentScroll", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "directive", type: i3.PepRtlClassDirective, selector: "[pepRtlClass]" }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i9.PepSearchComponent, selector: "pep-search", inputs: ["triggerOn", "autoCompleteTop", "autoCompleteValues", "shrink", "value", "searchControl", "useAsWebComponent", "sizeType"], outputs: ["search", "autocompleteChange", "stateChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, decorators: [{
1108
- type: Component,
1109
- args: [{ selector: 'pep-multi-select-filter', template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"] }]
1110
- }], propDecorators: { optionsContainer: [{
1111
- type: ViewChild,
1112
- args: ['optionsContainer']
1113
- }], virtualScroller: [{
1114
- type: ViewChild,
1115
- args: [VirtualScrollerComponent]
933
+ class PepMultiSelectFilterOption {
934
+ constructor() {
935
+ this.selected = false;
936
+ }
937
+ }
938
+ class PepMultiSelectFilterComponent extends BaseFilterComponent {
939
+ constructor() {
940
+ super(...arguments);
941
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
942
+ this.options = [];
943
+ this.chooseTypeOptions = [];
944
+ this.searchControl = new FormControl();
945
+ //inline props
946
+ this.selected = '';
947
+ this.inlineOptions = [];
948
+ this.MAX_OPTIONS_TO_SHOW = 6.35;
949
+ this.numberOptionsToShowSearch = 10;
950
+ }
951
+ ngOnInit() {
952
+ super.ngOnInit;
953
+ if (this.inline) {
954
+ this.inlineControlInit();
955
+ this.setControlsWidth();
956
+ }
957
+ else {
958
+ this.noneInlineControlInit();
959
+ }
960
+ }
961
+ ngAfterViewInit() {
962
+ // Calc for the first time.
963
+ this.calcOptionsHeight(this.options.length);
964
+ }
965
+ inlineControlInit() {
966
+ var _a, _b, _c;
967
+ //load options from field
968
+ this.inlineOptions = ((_b = (_a = this.field) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this.field.options : [];
969
+ // init the selected values from first value.
970
+ if (((_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) && Array.isArray(this.firstControl.value)) {
971
+ this.selected = this.firstControl.value.join(';');
972
+ }
973
+ }
974
+ noneInlineControlInit() {
975
+ var _a;
976
+ if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
977
+ this.options = this.field.options.map((opt) => {
978
+ return { value: opt.value, count: opt.count, selected: false };
979
+ });
980
+ }
981
+ else {
982
+ this.searchControl.disable();
983
+ }
984
+ // Init the selected values from first value.
985
+ const firstControl = this.firstControl;
986
+ if (firstControl.value) {
987
+ this.initOptionsSelectedValues(firstControl.value);
988
+ }
989
+ // Add subscription for the first value change to set the selected options.
990
+ firstControl.valueChanges
991
+ .pipe(this.getDestroyer(), distinctUntilChanged())
992
+ .subscribe((selectedValues) => {
993
+ this.initOptionsSelectedValues(selectedValues);
994
+ });
995
+ // Filter the options by the search control.
996
+ this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), startWith(''), map((option) => typeof option === 'string' ? option : option && option.value), map((value) => (value ? this.filterOptions(value) : this.options)));
997
+ // Each time the filter change.
998
+ this.filteredOptions$.subscribe((filterdOptions) => {
999
+ this.calcOptionsHeight(filterdOptions.length);
1000
+ setTimeout(() => {
1001
+ // 8 is the padding top of the multi-select-options
1002
+ this.virtualScroller.scrollToPosition(-8);
1003
+ }, 125);
1004
+ });
1005
+ }
1006
+ initOptionsSelectedValues(selectedValues) {
1007
+ this.options.forEach((opt) => {
1008
+ const isValueSelected = selectedValues && selectedValues.includes(opt.value);
1009
+ opt.selected = isValueSelected;
1010
+ });
1011
+ }
1012
+ calcOptionsHeight(optionsCount) {
1013
+ if (this.optionsContainer) {
1014
+ const optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1015
+ ? this.MAX_OPTIONS_TO_SHOW
1016
+ : optionsCount;
1017
+ // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1018
+ const optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1019
+ this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1020
+ }
1021
+ }
1022
+ filterOptions(value) {
1023
+ const filterValue = value.toLowerCase();
1024
+ return this.options.filter((opt) => opt.value &&
1025
+ opt.value.toLowerCase().includes(filterValue.toLowerCase()));
1026
+ }
1027
+ // Override
1028
+ getDefaultOperator() {
1029
+ return PepSmartFilterOperators.In;
1030
+ }
1031
+ // Override
1032
+ getFilterValue() {
1033
+ if (this.inline) {
1034
+ return {
1035
+ first: this.firstControl.value
1036
+ };
1037
+ }
1038
+ else {
1039
+ const selectedValues = this.options
1040
+ .filter((opt) => opt.selected)
1041
+ .map((opt) => opt.value);
1042
+ const filterValue = {
1043
+ first: selectedValues,
1044
+ };
1045
+ return selectedValues.length > 0 ? filterValue : null;
1046
+ }
1047
+ }
1048
+ // Override
1049
+ loadOperatorsOptions() {
1050
+ this.chooseTypeOptions = this.operators.map((operator) => {
1051
+ return {
1052
+ key: operator.id,
1053
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1054
+ };
1055
+ });
1056
+ }
1057
+ setControlsWidth() {
1058
+ var _a;
1059
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1060
+ this.operatorWidth = '38%';
1061
+ this.valueWidth = '62%';
1062
+ }
1063
+ else {
1064
+ this.valueWidth = '100%';
1065
+ }
1066
+ }
1067
+ onOperatorChanged(value) {
1068
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1069
+ this.operator = operator;
1070
+ if (this._parentForm) {
1071
+ this.updateParentForm();
1072
+ }
1073
+ if (this.emitOnChange) {
1074
+ this.applyFilter();
1075
+ }
1076
+ }
1077
+ // Override
1078
+ initFilter() {
1079
+ this.options.forEach((opt) => (opt.selected = false));
1080
+ this.searchControl.setValue('');
1081
+ }
1082
+ onOptionChange(option, event) {
1083
+ option.selected = event.checked;
1084
+ this.firstControl.setValue(this.options.filter((opt) => opt.selected).map((opt) => opt.value), { emitEvent: false });
1085
+ }
1086
+ onMultiSelectChanged(value) {
1087
+ if (value) {
1088
+ const selected = value.split(';');
1089
+ this.firstControl.setValue(selected);
1090
+ }
1091
+ else {
1092
+ this.firstControl.setValue(null);
1093
+ }
1094
+ if (this.emitOnChange) {
1095
+ this.applyFilter();
1096
+ }
1097
+ }
1098
+ onValueChanged(value) {
1099
+ this.firstControl.setValue(value);
1100
+ if (this.emitOnChange) {
1101
+ this.applyFilter();
1102
+ }
1103
+ }
1104
+ }
1105
+ PepMultiSelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1106
+ PepMultiSelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter", viewQueries: [{ propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true }, { propertyName: "virtualScroller", first: true, predicate: VirtualScrollerComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "directive", type: i4$2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i5$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i6.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "RTL", "useMarginInsteadOfTranslate", "ssrViewportWidth", "ssrViewportHeight", "compareItems", "checkResizeInterval", "modifyOverflowStyleOfParentScroll", "resizeBypassRefreshThreshold", "scrollAnimationTime", "scrollDebounceTime", "scrollThrottlingTime", "scrollbarHeight", "scrollbarWidth", "stripedTable", "horizontal", "enableUnequalChildrenSizes", "bufferAmount", "items", "parentScroll", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "directive", type: i3.PepRtlClassDirective, selector: "[pepRtlClass]" }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i9.PepSearchComponent, selector: "pep-search", inputs: ["triggerOn", "autoCompleteTop", "autoCompleteValues", "shrink", "value", "searchControl", "useAsWebComponent", "sizeType"], outputs: ["search", "autocompleteChange", "stateChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, decorators: [{
1108
+ type: Component,
1109
+ args: [{ selector: 'pep-multi-select-filter', template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"] }]
1110
+ }], propDecorators: { optionsContainer: [{
1111
+ type: ViewChild,
1112
+ args: ['optionsContainer']
1113
+ }], virtualScroller: [{
1114
+ type: ViewChild,
1115
+ args: [VirtualScrollerComponent]
1116
1116
  }] } });
1117
1117
 
1118
- class PepNumberFilterComponent extends BaseFilterComponent {
1119
- constructor() {
1120
- super(...arguments);
1121
- this.PepSmartFilterOperators = PepSmartFilterOperators;
1122
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1123
- this.chooseTypeOptions = [];
1124
- this.operatorWidth = '38%';
1125
- this.fieldsWidth = '70%';
1126
- }
1127
- ngOnInit() {
1128
- this.firstControl.valueChanges
1129
- .pipe(this.getDestroyer(), distinctUntilChanged())
1130
- .subscribe(() => {
1131
- this.setFieldsStateAndValidators();
1132
- });
1133
- this.secondControl.valueChanges
1134
- .pipe(this.getDestroyer(), distinctUntilChanged())
1135
- .subscribe(() => {
1136
- this.setFieldsStateAndValidators();
1137
- });
1138
- this.setControlsWidth();
1139
- }
1140
- // Override
1141
- getDefaultOperator() {
1142
- return PepSmartFilterOperators.Equals;
1143
- }
1144
- // Override
1145
- getFilterValue() {
1146
- const filterValue = {
1147
- first: this.firstControl.value,
1148
- };
1149
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1150
- filterValue['second'] = this.secondControl.value;
1151
- }
1152
- return filterValue;
1153
- }
1154
- // Override
1155
- loadOperatorsOptions() {
1156
- this.chooseTypeOptions = this.operators.map((operator) => {
1157
- return {
1158
- key: operator.id,
1159
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1160
- };
1161
- });
1162
- }
1163
- // Override
1164
- setFieldsStateAndValidators() {
1165
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1166
- const firstValidators = [Validators.required];
1167
- if (this.secondControl.value) {
1168
- firstValidators.push(this.validator.isLessThan(this.secondControl));
1169
- }
1170
- this.firstControl.setValidators(firstValidators);
1171
- this.secondControl.enable();
1172
- const secondValidators = [Validators.required];
1173
- if (this.firstControl.value) {
1174
- secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1175
- }
1176
- this.secondControl.setValidators(secondValidators);
1177
- }
1178
- else {
1179
- super.setFieldsStateAndValidators();
1180
- }
1181
- }
1182
- setControlsWidth() {
1183
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1184
- this.operatorWidth = '30%';
1185
- this.fieldsWidth = '70%';
1186
- }
1187
- else {
1188
- this.operatorWidth = '38%';
1189
- this.fieldsWidth = '62%';
1190
- }
1191
- }
1192
- onOperatorChanged(value) {
1193
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
1194
- this.operator = operator;
1195
- if (this._parentForm) {
1196
- this.updateParentForm();
1197
- }
1198
- if (this.emitOnChange) {
1199
- this.applyFilter();
1200
- }
1201
- this.setControlsWidth();
1202
- }
1203
- onVariableChanged(value) {
1204
- this.firstControl.setValue(value);
1205
- if (this.emitOnChange) {
1206
- this.applyFilter();
1207
- }
1208
- }
1209
- onValueChanged() {
1210
- if (this.emitOnChange) {
1211
- this.applyFilter();
1212
- }
1213
- }
1214
- }
1215
- PepNumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1216
- PepNumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepNumberFilterComponent, selector: "pep-number-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, decorators: [{
1218
- type: Component,
1219
- args: [{ selector: 'pep-number-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>" }]
1118
+ class PepNumberFilterComponent extends BaseFilterComponent {
1119
+ constructor() {
1120
+ super(...arguments);
1121
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
1122
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1123
+ this.chooseTypeOptions = [];
1124
+ this.operatorWidth = '38%';
1125
+ this.fieldsWidth = '70%';
1126
+ }
1127
+ ngOnInit() {
1128
+ this.firstControl.valueChanges
1129
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1130
+ .subscribe(() => {
1131
+ this.setFieldsStateAndValidators();
1132
+ });
1133
+ this.secondControl.valueChanges
1134
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1135
+ .subscribe(() => {
1136
+ this.setFieldsStateAndValidators();
1137
+ });
1138
+ this.setControlsWidth();
1139
+ }
1140
+ // Override
1141
+ getDefaultOperator() {
1142
+ return PepSmartFilterOperators.Equals;
1143
+ }
1144
+ // Override
1145
+ getFilterValue() {
1146
+ const filterValue = {
1147
+ first: this.firstControl.value,
1148
+ };
1149
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1150
+ filterValue['second'] = this.secondControl.value;
1151
+ }
1152
+ return filterValue;
1153
+ }
1154
+ // Override
1155
+ loadOperatorsOptions() {
1156
+ this.chooseTypeOptions = this.operators.map((operator) => {
1157
+ return {
1158
+ key: operator.id,
1159
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1160
+ };
1161
+ });
1162
+ }
1163
+ // Override
1164
+ setFieldsStateAndValidators() {
1165
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1166
+ const firstValidators = [Validators.required];
1167
+ if (this.secondControl.value) {
1168
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
1169
+ }
1170
+ this.firstControl.setValidators(firstValidators);
1171
+ this.secondControl.enable();
1172
+ const secondValidators = [Validators.required];
1173
+ if (this.firstControl.value) {
1174
+ secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1175
+ }
1176
+ this.secondControl.setValidators(secondValidators);
1177
+ }
1178
+ else {
1179
+ super.setFieldsStateAndValidators();
1180
+ }
1181
+ }
1182
+ setControlsWidth() {
1183
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1184
+ this.operatorWidth = '30%';
1185
+ this.fieldsWidth = '70%';
1186
+ }
1187
+ else {
1188
+ this.operatorWidth = '38%';
1189
+ this.fieldsWidth = '62%';
1190
+ }
1191
+ }
1192
+ onOperatorChanged(value) {
1193
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1194
+ this.operator = operator;
1195
+ if (this._parentForm) {
1196
+ this.updateParentForm();
1197
+ }
1198
+ if (this.emitOnChange) {
1199
+ this.applyFilter();
1200
+ }
1201
+ this.setControlsWidth();
1202
+ }
1203
+ onVariableChanged(value) {
1204
+ this.firstControl.setValue(value);
1205
+ if (this.emitOnChange) {
1206
+ this.applyFilter();
1207
+ }
1208
+ }
1209
+ onValueChanged() {
1210
+ if (this.emitOnChange) {
1211
+ this.applyFilter();
1212
+ }
1213
+ }
1214
+ }
1215
+ PepNumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1216
+ PepNumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepNumberFilterComponent, selector: "pep-number-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i3$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i4.PepSelectComponent, selector: "pep-select", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "xAlignment", "rowSpan", "options", "visible", "emptyOption", "form", "layoutType", "parentFieldKey", "isActive", "showTitle", "renderTitle"], outputs: ["valueChange", "formValidationChange"] }, { kind: "component", type: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "formattedValue", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey"], outputs: ["valueChange", "formValidationChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, decorators: [{
1218
+ type: Component,
1219
+ args: [{ selector: 'pep-number-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>" }]
1220
1220
  }] });
1221
1221
 
1222
- class PepSmartFiltersComponent {
1223
- constructor(hostElement, layoutService) {
1224
- this.hostElement = hostElement;
1225
- this.layoutService = layoutService;
1226
- this.title = '';
1227
- this.filtersDataMap = new Map();
1228
- this._filters = [];
1229
- this._fields = [];
1230
- this._useAsWebComponent = false;
1231
- // @Output()
1232
- // filtersClear: EventEmitter<void> = new EventEmitter<void>();
1233
- this.filtersChange = new EventEmitter();
1234
- this.fieldToggleChange = new EventEmitter();
1235
- this.expansionPanelHeaderHeight = '*';
1236
- }
1237
- set filters(value) {
1238
- this._filters = value;
1239
- this.setupFilters(value);
1240
- }
1241
- get filters() {
1242
- this._filters = [...this.filtersDataMap.keys()]
1243
- // .filter((key) => this.filtersDataMap.get(key) !== null)
1244
- .map((key) => {
1245
- if (key) {
1246
- return this.filtersDataMap.get(key);
1247
- }
1248
- });
1249
- return this._filters;
1250
- }
1251
- set fields(value) {
1252
- this._fields = value;
1253
- }
1254
- get fields() {
1255
- return this._fields;
1256
- }
1257
- set useAsWebComponent(value) {
1258
- if (value) {
1259
- this.exportFunctionsOnHostElement();
1260
- }
1261
- }
1262
- get useAsWebComponent() {
1263
- return this._useAsWebComponent;
1264
- }
1265
- exportFunctionsOnHostElement() {
1266
- // This is for web component usage for use those functions.
1267
- this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
1268
- this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
1269
- this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
1270
- }
1271
- setupFilters(value) {
1272
- this.filtersDataMap.clear();
1273
- if (value) {
1274
- value.forEach((filter) => {
1275
- // Validate before add the filter into the map.
1276
- let currentField = null;
1277
- if (this.fields && this.fields.length > 0) {
1278
- currentField = this.fields.find((field) => field.id === filter.fieldId);
1279
- }
1280
- if (currentField) {
1281
- // Only if the operator is from the same type
1282
- if (filter.operator.componentType.includes(currentField.componentType)) {
1283
- let isOperatorUnitValid = true;
1284
- if (filter.operatorUnit) {
1285
- // Only if the operator unit is not from the same type
1286
- if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
1287
- isOperatorUnitValid = false;
1288
- }
1289
- }
1290
- // Add the filter.
1291
- if (isOperatorUnitValid) {
1292
- this.filtersDataMap.set(filter.fieldId, filter);
1293
- }
1294
- }
1295
- }
1296
- });
1297
- }
1298
- }
1299
- raiseFiltersChange() {
1300
- this.filtersChange.emit(this.filters);
1301
- }
1302
- toggleField(index, isOpen) {
1303
- this.fields[index].isOpen = isOpen;
1304
- this.fieldToggleChange.emit(this.fields[index]);
1305
- }
1306
- clearFilters() {
1307
- this.filtersDataMap.clear();
1308
- }
1309
- clearFilter(fieldId) {
1310
- this.filtersDataMap.delete(fieldId);
1311
- }
1312
- // Clear all the filters and raise event that filters has change.
1313
- onFiltersClear() {
1314
- this.clearFilters();
1315
- this.raiseFiltersChange();
1316
- }
1317
- // Clear the filter and raise event that filters has change.
1318
- onFilterClear(field) {
1319
- this.clearFilter(field.id);
1320
- this.raiseFiltersChange();
1321
- }
1322
- // Set the filter and raise event that filters has change.
1323
- onFilterChange(field, filterData) {
1324
- this.clearFilter(field.id);
1325
- this.filtersDataMap.set(field.id, filterData);
1326
- this.raiseFiltersChange();
1327
- }
1328
- }
1329
- PepSmartFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, deps: [{ token: i0.ElementRef }, { token: i3.PepLayoutService }], target: i0.ɵɵFactoryTarget.Component });
1330
- PepSmartFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepSmartFiltersComponent, selector: "pep-smart-filters", inputs: { title: "title", filters: "filters", fields: "fields", useAsWebComponent: "useAsWebComponent" }, outputs: { filtersChange: "filtersChange", fieldToggleChange: "fieldToggleChange" }, ngImport: i0, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$2.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "directive", type: i4$3.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i5$3.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i5$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i5$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: PepTextFilterComponent, selector: "pep-text-filter" }, { kind: "component", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: ["options"] }, { kind: "component", type: PepDateFilterComponent, selector: "pep-date-filter" }, { kind: "component", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter" }, { kind: "component", type: PepNumberFilterComponent, selector: "pep-number-filter" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1331
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, decorators: [{
1332
- type: Component,
1333
- args: [{ selector: 'pep-smart-filters', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"] }]
1334
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.PepLayoutService }]; }, propDecorators: { title: [{
1335
- type: Input
1336
- }], filters: [{
1337
- type: Input
1338
- }], fields: [{
1339
- type: Input
1340
- }], useAsWebComponent: [{
1341
- type: Input
1342
- }], filtersChange: [{
1343
- type: Output
1344
- }], fieldToggleChange: [{
1345
- type: Output
1222
+ class PepSmartFiltersComponent {
1223
+ constructor(hostElement, layoutService) {
1224
+ this.hostElement = hostElement;
1225
+ this.layoutService = layoutService;
1226
+ this.title = '';
1227
+ this.filtersDataMap = new Map();
1228
+ this._filters = [];
1229
+ this._fields = [];
1230
+ this._useAsWebComponent = false;
1231
+ // @Output()
1232
+ // filtersClear: EventEmitter<void> = new EventEmitter<void>();
1233
+ this.filtersChange = new EventEmitter();
1234
+ this.fieldToggleChange = new EventEmitter();
1235
+ this.expansionPanelHeaderHeight = '*';
1236
+ }
1237
+ set filters(value) {
1238
+ this._filters = value;
1239
+ this.setupFilters(value);
1240
+ }
1241
+ get filters() {
1242
+ this._filters = [...this.filtersDataMap.keys()]
1243
+ // .filter((key) => this.filtersDataMap.get(key) !== null)
1244
+ .map((key) => {
1245
+ if (key) {
1246
+ return this.filtersDataMap.get(key);
1247
+ }
1248
+ });
1249
+ return this._filters;
1250
+ }
1251
+ set fields(value) {
1252
+ this._fields = value;
1253
+ }
1254
+ get fields() {
1255
+ return this._fields;
1256
+ }
1257
+ set useAsWebComponent(value) {
1258
+ if (value) {
1259
+ this.exportFunctionsOnHostElement();
1260
+ }
1261
+ }
1262
+ get useAsWebComponent() {
1263
+ return this._useAsWebComponent;
1264
+ }
1265
+ exportFunctionsOnHostElement() {
1266
+ // This is for web component usage for use those functions.
1267
+ this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
1268
+ this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
1269
+ this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
1270
+ }
1271
+ setupFilters(value) {
1272
+ this.filtersDataMap.clear();
1273
+ if (value) {
1274
+ value.forEach((filter) => {
1275
+ // Validate before add the filter into the map.
1276
+ let currentField = null;
1277
+ if (this.fields && this.fields.length > 0) {
1278
+ currentField = this.fields.find((field) => field.id === filter.fieldId);
1279
+ }
1280
+ if (currentField) {
1281
+ // Only if the operator is from the same type
1282
+ if (filter.operator.componentType.includes(currentField.componentType)) {
1283
+ let isOperatorUnitValid = true;
1284
+ if (filter.operatorUnit) {
1285
+ // Only if the operator unit is not from the same type
1286
+ if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
1287
+ isOperatorUnitValid = false;
1288
+ }
1289
+ }
1290
+ // Add the filter.
1291
+ if (isOperatorUnitValid) {
1292
+ this.filtersDataMap.set(filter.fieldId, filter);
1293
+ }
1294
+ }
1295
+ }
1296
+ });
1297
+ }
1298
+ }
1299
+ raiseFiltersChange() {
1300
+ this.filtersChange.emit(this.filters);
1301
+ }
1302
+ toggleField(index, isOpen) {
1303
+ this.fields[index].isOpen = isOpen;
1304
+ this.fieldToggleChange.emit(this.fields[index]);
1305
+ }
1306
+ clearFilters() {
1307
+ this.filtersDataMap.clear();
1308
+ }
1309
+ clearFilter(fieldId) {
1310
+ this.filtersDataMap.delete(fieldId);
1311
+ }
1312
+ // Clear all the filters and raise event that filters has change.
1313
+ onFiltersClear() {
1314
+ this.clearFilters();
1315
+ this.raiseFiltersChange();
1316
+ }
1317
+ // Clear the filter and raise event that filters has change.
1318
+ onFilterClear(field) {
1319
+ this.clearFilter(field.id);
1320
+ this.raiseFiltersChange();
1321
+ }
1322
+ // Set the filter and raise event that filters has change.
1323
+ onFilterChange(field, filterData) {
1324
+ this.clearFilter(field.id);
1325
+ this.filtersDataMap.set(field.id, filterData);
1326
+ this.raiseFiltersChange();
1327
+ }
1328
+ }
1329
+ PepSmartFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, deps: [{ token: i0.ElementRef }, { token: i3.PepLayoutService }], target: i0.ɵɵFactoryTarget.Component });
1330
+ PepSmartFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepSmartFiltersComponent, selector: "pep-smart-filters", inputs: { title: "title", filters: "filters", fields: "fields", useAsWebComponent: "useAsWebComponent" }, outputs: { filtersChange: "filtersChange", fieldToggleChange: "fieldToggleChange" }, ngImport: i0, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$2.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "directive", type: i4$3.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i5$3.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i5$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i5$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: PepTextFilterComponent, selector: "pep-text-filter" }, { kind: "component", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: ["options"] }, { kind: "component", type: PepDateFilterComponent, selector: "pep-date-filter" }, { kind: "component", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter" }, { kind: "component", type: PepNumberFilterComponent, selector: "pep-number-filter" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, decorators: [{
1332
+ type: Component,
1333
+ args: [{ selector: 'pep-smart-filters', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"] }]
1334
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.PepLayoutService }]; }, propDecorators: { title: [{
1335
+ type: Input
1336
+ }], filters: [{
1337
+ type: Input
1338
+ }], fields: [{
1339
+ type: Input
1340
+ }], useAsWebComponent: [{
1341
+ type: Input
1342
+ }], filtersChange: [{
1343
+ type: Output
1344
+ }], fieldToggleChange: [{
1345
+ type: Output
1346
1346
  }] } });
1347
1347
 
1348
- class PepSmartFiltersModule {
1349
- constructor(pepIconRegistry) {
1350
- this.pepIconRegistry = pepIconRegistry;
1351
- this.pepIconRegistry.registerIcons([
1352
- pepIconNumberMinus,
1353
- pepIconNumberPlus,
1354
- ]);
1355
- }
1356
- }
1357
- PepSmartFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
1358
- PepSmartFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, declarations: [
1359
- // BaseFilterComponent,
1360
- PepSmartFiltersComponent,
1361
- PepFilterActionsComponent,
1362
- PepTextFilterComponent,
1363
- PepBooleanFilterComponent,
1364
- PepDateFilterComponent,
1365
- PepMultiSelectFilterComponent,
1366
- PepNumberFilterComponent
1367
- ], imports: [CommonModule,
1368
- ReactiveFormsModule,
1369
- FlexLayoutModule,
1370
- // Material modules
1371
- MatCommonModule,
1372
- MatCheckboxModule,
1373
- MatChipsModule,
1374
- MatExpansionModule,
1375
- MatIconModule,
1376
- MatFormFieldModule,
1377
- MatInputModule,
1378
- MatRadioModule,
1379
- // External modules
1380
- VirtualScrollerModule,
1381
- // ngx-lib modules
1382
- PepNgxLibModule,
1383
- PepCheckboxModule,
1384
- PepDateModule,
1385
- PepSelectModule,
1386
- PepTextboxModule,
1387
- PepSearchModule,
1388
- PepIconModule,
1389
- PepButtonModule,
1390
- PepGroupButtonsModule], exports: [PepSmartFiltersComponent,
1391
- PepTextFilterComponent,
1392
- PepBooleanFilterComponent,
1393
- PepDateFilterComponent,
1394
- PepMultiSelectFilterComponent,
1395
- PepNumberFilterComponent] });
1396
- PepSmartFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, providers: [
1397
- FormBuilder
1398
- ], imports: [CommonModule,
1399
- ReactiveFormsModule,
1400
- FlexLayoutModule,
1401
- // Material modules
1402
- MatCommonModule,
1403
- MatCheckboxModule,
1404
- MatChipsModule,
1405
- MatExpansionModule,
1406
- MatIconModule,
1407
- MatFormFieldModule,
1408
- MatInputModule,
1409
- MatRadioModule,
1410
- // External modules
1411
- VirtualScrollerModule,
1412
- // ngx-lib modules
1413
- PepNgxLibModule,
1414
- PepCheckboxModule,
1415
- PepDateModule,
1416
- PepSelectModule,
1417
- PepTextboxModule,
1418
- PepSearchModule,
1419
- PepIconModule,
1420
- PepButtonModule,
1421
- PepGroupButtonsModule] });
1422
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, decorators: [{
1423
- type: NgModule,
1424
- args: [{
1425
- imports: [
1426
- CommonModule,
1427
- ReactiveFormsModule,
1428
- FlexLayoutModule,
1429
- // Material modules
1430
- MatCommonModule,
1431
- MatCheckboxModule,
1432
- MatChipsModule,
1433
- MatExpansionModule,
1434
- MatIconModule,
1435
- MatFormFieldModule,
1436
- MatInputModule,
1437
- MatRadioModule,
1438
- // External modules
1439
- VirtualScrollerModule,
1440
- // ngx-lib modules
1441
- PepNgxLibModule,
1442
- PepCheckboxModule,
1443
- PepDateModule,
1444
- PepSelectModule,
1445
- PepTextboxModule,
1446
- PepSearchModule,
1447
- PepIconModule,
1448
- PepButtonModule,
1449
- PepGroupButtonsModule
1450
- ],
1451
- exports: [
1452
- PepSmartFiltersComponent,
1453
- PepTextFilterComponent,
1454
- PepBooleanFilterComponent,
1455
- PepDateFilterComponent,
1456
- PepMultiSelectFilterComponent,
1457
- PepNumberFilterComponent
1458
- ],
1459
- declarations: [
1460
- // BaseFilterComponent,
1461
- PepSmartFiltersComponent,
1462
- PepFilterActionsComponent,
1463
- PepTextFilterComponent,
1464
- PepBooleanFilterComponent,
1465
- PepDateFilterComponent,
1466
- PepMultiSelectFilterComponent,
1467
- PepNumberFilterComponent
1468
- ],
1469
- providers: [
1470
- FormBuilder
1471
- ]
1472
- }]
1348
+ class PepSmartFiltersModule {
1349
+ constructor(pepIconRegistry) {
1350
+ this.pepIconRegistry = pepIconRegistry;
1351
+ this.pepIconRegistry.registerIcons([
1352
+ pepIconNumberMinus,
1353
+ pepIconNumberPlus,
1354
+ ]);
1355
+ }
1356
+ }
1357
+ PepSmartFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
1358
+ PepSmartFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, declarations: [
1359
+ // BaseFilterComponent,
1360
+ PepSmartFiltersComponent,
1361
+ PepFilterActionsComponent,
1362
+ PepTextFilterComponent,
1363
+ PepBooleanFilterComponent,
1364
+ PepDateFilterComponent,
1365
+ PepMultiSelectFilterComponent,
1366
+ PepNumberFilterComponent
1367
+ ], imports: [CommonModule,
1368
+ ReactiveFormsModule,
1369
+ FlexLayoutModule,
1370
+ // Material modules
1371
+ MatCommonModule,
1372
+ MatCheckboxModule,
1373
+ MatChipsModule,
1374
+ MatExpansionModule,
1375
+ MatIconModule,
1376
+ MatFormFieldModule,
1377
+ MatInputModule,
1378
+ MatRadioModule,
1379
+ // External modules
1380
+ VirtualScrollerModule,
1381
+ // ngx-lib modules
1382
+ PepNgxLibModule,
1383
+ PepCheckboxModule,
1384
+ PepDateModule,
1385
+ PepSelectModule,
1386
+ PepTextboxModule,
1387
+ PepSearchModule,
1388
+ PepIconModule,
1389
+ PepButtonModule,
1390
+ PepGroupButtonsModule], exports: [PepSmartFiltersComponent,
1391
+ PepTextFilterComponent,
1392
+ PepBooleanFilterComponent,
1393
+ PepDateFilterComponent,
1394
+ PepMultiSelectFilterComponent,
1395
+ PepNumberFilterComponent] });
1396
+ PepSmartFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, providers: [
1397
+ FormBuilder
1398
+ ], imports: [CommonModule,
1399
+ ReactiveFormsModule,
1400
+ FlexLayoutModule,
1401
+ // Material modules
1402
+ MatCommonModule,
1403
+ MatCheckboxModule,
1404
+ MatChipsModule,
1405
+ MatExpansionModule,
1406
+ MatIconModule,
1407
+ MatFormFieldModule,
1408
+ MatInputModule,
1409
+ MatRadioModule,
1410
+ // External modules
1411
+ VirtualScrollerModule,
1412
+ // ngx-lib modules
1413
+ PepNgxLibModule,
1414
+ PepCheckboxModule,
1415
+ PepDateModule,
1416
+ PepSelectModule,
1417
+ PepTextboxModule,
1418
+ PepSearchModule,
1419
+ PepIconModule,
1420
+ PepButtonModule,
1421
+ PepGroupButtonsModule] });
1422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, decorators: [{
1423
+ type: NgModule,
1424
+ args: [{
1425
+ imports: [
1426
+ CommonModule,
1427
+ ReactiveFormsModule,
1428
+ FlexLayoutModule,
1429
+ // Material modules
1430
+ MatCommonModule,
1431
+ MatCheckboxModule,
1432
+ MatChipsModule,
1433
+ MatExpansionModule,
1434
+ MatIconModule,
1435
+ MatFormFieldModule,
1436
+ MatInputModule,
1437
+ MatRadioModule,
1438
+ // External modules
1439
+ VirtualScrollerModule,
1440
+ // ngx-lib modules
1441
+ PepNgxLibModule,
1442
+ PepCheckboxModule,
1443
+ PepDateModule,
1444
+ PepSelectModule,
1445
+ PepTextboxModule,
1446
+ PepSearchModule,
1447
+ PepIconModule,
1448
+ PepButtonModule,
1449
+ PepGroupButtonsModule
1450
+ ],
1451
+ exports: [
1452
+ PepSmartFiltersComponent,
1453
+ PepTextFilterComponent,
1454
+ PepBooleanFilterComponent,
1455
+ PepDateFilterComponent,
1456
+ PepMultiSelectFilterComponent,
1457
+ PepNumberFilterComponent
1458
+ ],
1459
+ declarations: [
1460
+ // BaseFilterComponent,
1461
+ PepSmartFiltersComponent,
1462
+ PepFilterActionsComponent,
1463
+ PepTextFilterComponent,
1464
+ PepBooleanFilterComponent,
1465
+ PepDateFilterComponent,
1466
+ PepMultiSelectFilterComponent,
1467
+ PepNumberFilterComponent
1468
+ ],
1469
+ providers: [
1470
+ FormBuilder
1471
+ ]
1472
+ }]
1473
1473
  }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
1474
1474
 
1475
- // Base field
1476
- // ------------------------------
1477
- class PepSmartFilterBaseField {
1478
- constructor(field) {
1479
- this.id = field.id;
1480
- this.name = field.name;
1481
- this.isOpen = field.isOpen;
1482
- this.options = field.options;
1483
- this.operators = field.operators;
1484
- this.operatorUnits = field.operatorUnits;
1485
- this._type = this.getType();
1486
- }
1487
- get componentType() {
1488
- return this._componentType;
1489
- }
1490
- get type() {
1491
- return this._type;
1492
- }
1493
- }
1494
- // Text field
1495
- // ------------------------------
1496
- class PepSmartFilterTextField extends PepSmartFilterBaseField {
1497
- constructor(field) {
1498
- super(field);
1499
- this._componentType = 'text';
1500
- }
1501
- getType() {
1502
- return 'text';
1503
- }
1504
- }
1505
- // Boolean field
1506
- // ------------------------------
1507
- class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
1508
- constructor(field) {
1509
- super(field);
1510
- this._componentType = 'boolean';
1511
- }
1512
- getType() {
1513
- return 'boolean';
1514
- }
1515
- }
1516
- // Date fields
1517
- // ------------------------------
1518
- class PepSmartFilterDateBaseField extends PepSmartFilterBaseField {
1519
- constructor(field) {
1520
- super(field);
1521
- this._componentType = 'date';
1522
- }
1523
- }
1524
- class PepSmartFilterDateField extends PepSmartFilterDateBaseField {
1525
- constructor(field) {
1526
- super(field);
1527
- }
1528
- getType() {
1529
- return 'date';
1530
- }
1531
- }
1532
- class PepSmartFilterDateTimeField extends PepSmartFilterDateBaseField {
1533
- constructor(field) {
1534
- super(field);
1535
- }
1536
- getType() {
1537
- return 'date-time';
1538
- }
1539
- }
1540
- // Multi select field
1541
- // ------------------------------
1542
- class PepSmartFilterMultiSelectField extends PepSmartFilterBaseField {
1543
- constructor(field) {
1544
- super(field);
1545
- this._componentType = 'multi-select';
1546
- }
1547
- getType() {
1548
- return 'multi-select';
1549
- }
1550
- }
1551
- // Number fields
1552
- // ------------------------------
1553
- class PepSmartFilterNumberBaseField extends PepSmartFilterBaseField {
1554
- constructor(field) {
1555
- super(field);
1556
- this._componentType = 'number';
1557
- }
1558
- }
1559
- class PepSmartFilterIntField extends PepSmartFilterNumberBaseField {
1560
- constructor(field) {
1561
- super(field);
1562
- }
1563
- getType() {
1564
- return 'int';
1565
- }
1566
- }
1567
- class PepSmartFilterRealField extends PepSmartFilterNumberBaseField {
1568
- constructor(field) {
1569
- super(field);
1570
- }
1571
- getType() {
1572
- return 'real';
1573
- }
1574
- }
1575
- class PepSmartFilterCurrencyField extends PepSmartFilterNumberBaseField {
1576
- constructor(field) {
1577
- super(field);
1578
- }
1579
- getType() {
1580
- return 'currency';
1581
- }
1582
- }
1583
- class PepSmartFilterPercentageField extends PepSmartFilterNumberBaseField {
1584
- constructor(field) {
1585
- super(field);
1586
- }
1587
- getType() {
1588
- return 'percentage';
1589
- }
1475
+ // Base field
1476
+ // ------------------------------
1477
+ class PepSmartFilterBaseField {
1478
+ constructor(field) {
1479
+ this.id = field.id;
1480
+ this.name = field.name;
1481
+ this.isOpen = field.isOpen;
1482
+ this.options = field.options;
1483
+ this.operators = field.operators;
1484
+ this.operatorUnits = field.operatorUnits;
1485
+ this._type = this.getType();
1486
+ }
1487
+ get componentType() {
1488
+ return this._componentType;
1489
+ }
1490
+ get type() {
1491
+ return this._type;
1492
+ }
1493
+ }
1494
+ // Text field
1495
+ // ------------------------------
1496
+ class PepSmartFilterTextField extends PepSmartFilterBaseField {
1497
+ constructor(field) {
1498
+ super(field);
1499
+ this._componentType = 'text';
1500
+ }
1501
+ getType() {
1502
+ return 'text';
1503
+ }
1504
+ }
1505
+ // Boolean field
1506
+ // ------------------------------
1507
+ class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
1508
+ constructor(field) {
1509
+ super(field);
1510
+ this._componentType = 'boolean';
1511
+ }
1512
+ getType() {
1513
+ return 'boolean';
1514
+ }
1515
+ }
1516
+ // Date fields
1517
+ // ------------------------------
1518
+ class PepSmartFilterDateBaseField extends PepSmartFilterBaseField {
1519
+ constructor(field) {
1520
+ super(field);
1521
+ this._componentType = 'date';
1522
+ }
1523
+ }
1524
+ class PepSmartFilterDateField extends PepSmartFilterDateBaseField {
1525
+ constructor(field) {
1526
+ super(field);
1527
+ }
1528
+ getType() {
1529
+ return 'date';
1530
+ }
1531
+ }
1532
+ class PepSmartFilterDateTimeField extends PepSmartFilterDateBaseField {
1533
+ constructor(field) {
1534
+ super(field);
1535
+ }
1536
+ getType() {
1537
+ return 'date-time';
1538
+ }
1539
+ }
1540
+ // Multi select field
1541
+ // ------------------------------
1542
+ class PepSmartFilterMultiSelectField extends PepSmartFilterBaseField {
1543
+ constructor(field) {
1544
+ super(field);
1545
+ this._componentType = 'multi-select';
1546
+ }
1547
+ getType() {
1548
+ return 'multi-select';
1549
+ }
1550
+ }
1551
+ // Number fields
1552
+ // ------------------------------
1553
+ class PepSmartFilterNumberBaseField extends PepSmartFilterBaseField {
1554
+ constructor(field) {
1555
+ super(field);
1556
+ this._componentType = 'number';
1557
+ }
1558
+ }
1559
+ class PepSmartFilterIntField extends PepSmartFilterNumberBaseField {
1560
+ constructor(field) {
1561
+ super(field);
1562
+ }
1563
+ getType() {
1564
+ return 'int';
1565
+ }
1566
+ }
1567
+ class PepSmartFilterRealField extends PepSmartFilterNumberBaseField {
1568
+ constructor(field) {
1569
+ super(field);
1570
+ }
1571
+ getType() {
1572
+ return 'real';
1573
+ }
1574
+ }
1575
+ class PepSmartFilterCurrencyField extends PepSmartFilterNumberBaseField {
1576
+ constructor(field) {
1577
+ super(field);
1578
+ }
1579
+ getType() {
1580
+ return 'currency';
1581
+ }
1582
+ }
1583
+ class PepSmartFilterPercentageField extends PepSmartFilterNumberBaseField {
1584
+ constructor(field) {
1585
+ super(field);
1586
+ }
1587
+ getType() {
1588
+ return 'percentage';
1589
+ }
1590
1590
  }
1591
1591
 
1592
- function createTextSmartFilterField(data) {
1593
- return new PepSmartFilterTextField(data);
1594
- }
1595
- function createBooleanSmartFilterField(data) {
1596
- return new PepSmartFilterBooleanField(data);
1597
- }
1598
- function createDateSmartFilterField(data) {
1599
- return new PepSmartFilterDateField(data);
1600
- }
1601
- function createDateTimeSmartFilterField(data) {
1602
- return new PepSmartFilterDateTimeField(data);
1603
- }
1604
- function createMultiSelectSmartFilterField(data) {
1605
- return new PepSmartFilterMultiSelectField(data);
1606
- }
1607
- function createIntSmartFilterField(data) {
1608
- return new PepSmartFilterIntField(data);
1609
- }
1610
- function createRealSmartFilterField(data) {
1611
- return new PepSmartFilterRealField(data);
1612
- }
1613
- function createCurrencySmartFilterField(data) {
1614
- return new PepSmartFilterCurrencyField(data);
1615
- }
1616
- function createPercentageSmartFilterField(data) {
1617
- return new PepSmartFilterPercentageField(data);
1618
- }
1619
- function createSmartFilterField(data, type) {
1620
- let field;
1621
- switch (type) {
1622
- case 'text':
1623
- field = createTextSmartFilterField(data);
1624
- break;
1625
- case 'boolean':
1626
- field = createBooleanSmartFilterField(data);
1627
- break;
1628
- case 'date':
1629
- field = createDateSmartFilterField(data);
1630
- break;
1631
- case 'date-time':
1632
- field = createDateTimeSmartFilterField(data);
1633
- break;
1634
- case 'multi-select':
1635
- field = createMultiSelectSmartFilterField(data);
1636
- break;
1637
- case 'int':
1638
- field = createIntSmartFilterField(data);
1639
- break;
1640
- case 'real':
1641
- field = createRealSmartFilterField(data);
1642
- break;
1643
- case 'currency':
1644
- field = createCurrencySmartFilterField(data);
1645
- break;
1646
- case 'percentage':
1647
- field = createPercentageSmartFilterField(data);
1648
- break;
1649
- default:
1650
- field = createMultiSelectSmartFilterField(data);
1651
- break;
1652
- }
1653
- return field;
1654
- }
1655
- function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1656
- return {
1657
- fieldId: fieldId,
1658
- operator: operator,
1659
- operatorUnit: operatorUnit,
1660
- value: {
1661
- first: first,
1662
- second: second,
1663
- },
1664
- };
1592
+ function createTextSmartFilterField(data) {
1593
+ return new PepSmartFilterTextField(data);
1594
+ }
1595
+ function createBooleanSmartFilterField(data) {
1596
+ return new PepSmartFilterBooleanField(data);
1597
+ }
1598
+ function createDateSmartFilterField(data) {
1599
+ return new PepSmartFilterDateField(data);
1600
+ }
1601
+ function createDateTimeSmartFilterField(data) {
1602
+ return new PepSmartFilterDateTimeField(data);
1603
+ }
1604
+ function createMultiSelectSmartFilterField(data) {
1605
+ return new PepSmartFilterMultiSelectField(data);
1606
+ }
1607
+ function createIntSmartFilterField(data) {
1608
+ return new PepSmartFilterIntField(data);
1609
+ }
1610
+ function createRealSmartFilterField(data) {
1611
+ return new PepSmartFilterRealField(data);
1612
+ }
1613
+ function createCurrencySmartFilterField(data) {
1614
+ return new PepSmartFilterCurrencyField(data);
1615
+ }
1616
+ function createPercentageSmartFilterField(data) {
1617
+ return new PepSmartFilterPercentageField(data);
1618
+ }
1619
+ function createSmartFilterField(data, type) {
1620
+ let field;
1621
+ switch (type) {
1622
+ case 'text':
1623
+ field = createTextSmartFilterField(data);
1624
+ break;
1625
+ case 'boolean':
1626
+ field = createBooleanSmartFilterField(data);
1627
+ break;
1628
+ case 'date':
1629
+ field = createDateSmartFilterField(data);
1630
+ break;
1631
+ case 'date-time':
1632
+ field = createDateTimeSmartFilterField(data);
1633
+ break;
1634
+ case 'multi-select':
1635
+ field = createMultiSelectSmartFilterField(data);
1636
+ break;
1637
+ case 'int':
1638
+ field = createIntSmartFilterField(data);
1639
+ break;
1640
+ case 'real':
1641
+ field = createRealSmartFilterField(data);
1642
+ break;
1643
+ case 'currency':
1644
+ field = createCurrencySmartFilterField(data);
1645
+ break;
1646
+ case 'percentage':
1647
+ field = createPercentageSmartFilterField(data);
1648
+ break;
1649
+ default:
1650
+ field = createMultiSelectSmartFilterField(data);
1651
+ break;
1652
+ }
1653
+ return field;
1654
+ }
1655
+ function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1656
+ return {
1657
+ fieldId: fieldId,
1658
+ operator: operator,
1659
+ operatorUnit: operatorUnit,
1660
+ value: {
1661
+ first: first,
1662
+ second: second,
1663
+ },
1664
+ };
1665
1665
  }
1666
1666
 
1667
- /*
1668
- * Public API Surface of ngx-lib/smart-filters
1667
+ /*
1668
+ * Public API Surface of ngx-lib/smart-filters
1669
1669
  */
1670
1670
 
1671
- /**
1672
- * Generated bundle index. Do not edit.
1671
+ /**
1672
+ * Generated bundle index. Do not edit.
1673
1673
  */
1674
1674
 
1675
1675
  export { BaseFilterComponent, IPepSmartFilterOperator, IPepSmartFilterOperatorUnit, PepBooleanFilterComponent, PepDateFilterComponent, PepFilterActionsComponent, PepMultiSelectFilterComponent, PepNumberFilterComponent, PepSmartFilterAdditionalOperators, PepSmartFilterBaseField, PepSmartFilterBooleanField, PepSmartFilterCurrencyField, PepSmartFilterDateBaseField, PepSmartFilterDateField, PepSmartFilterDateTimeField, PepSmartFilterIntField, PepSmartFilterMultiSelectField, PepSmartFilterNumberBaseField, PepSmartFilterOperatorUnits, PepSmartFilterOperators, PepSmartFilterPercentageField, PepSmartFilterRealField, PepSmartFilterTextField, PepSmartFilterVariableOperators, PepSmartFiltersComponent, PepSmartFiltersModule, PepTextFilterComponent, createSmartFilter, createSmartFilterField };