@pepperi-addons/ngx-lib 0.4.1-beta.54 → 0.4.1-beta.56

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