@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,1659 +42,1659 @@ 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?.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
- if (operator?.id != this._operator?.id) {
395
- // Validate operator
396
- const index = this.operators.findIndex((o) => o.id === operator.id);
397
- if (index >= 0) {
398
- this._operator = this.operators[index];
399
- }
400
- else {
401
- this._operator = this.operators[0];
402
- }
403
- this.form.reset();
404
- this.updateValidity();
405
- }
406
- }
407
- get operator() {
408
- return this._operator;
409
- }
410
- set operatorUnit(operatorUnit) {
411
- // Validate operator unit
412
- if (operatorUnit) {
413
- const index = this.operatorUnits.findIndex((ou) => ou.id === operatorUnit.id);
414
- if (index >= 0) {
415
- this._operatorUnit = this.operatorUnits[index];
416
- }
417
- else {
418
- this._operatorUnit = this.operatorUnits[0];
419
- }
420
- }
421
- else {
422
- this._operatorUnit = undefined;
423
- }
424
- }
425
- get operatorUnit() {
426
- return this._operatorUnit;
427
- }
428
- get firstControlKey() {
429
- return this.field ? `${this._fieldIdWithNoDots}_first` : 'first';
430
- }
431
- get firstControl() {
432
- return this.form.get(this.firstControlKey);
433
- }
434
- get secondControlKey() {
435
- return this.field ? `${this._fieldIdWithNoDots}_second` : 'second';
436
- }
437
- get secondControl() {
438
- return this.form.get(this.secondControlKey);
439
- }
440
- createActionsComponent() {
441
- const factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
442
- this.actionsContainerRef = factory.create(this.injector);
443
- this.actionsContainerRef.instance.form = this.form;
444
- this.actionsContainerRef.instance.applyClick.subscribe(() => this.applyFilter());
445
- this.actionsContainerRef.instance.clearClick.subscribe(() => this.clearFilter());
446
- this.viewContainerRef.insert(this.actionsContainerRef.hostView);
447
- }
448
- setupForm() {
449
- const formValue = {};
450
- formValue[this.firstControlKey] = [];
451
- formValue[this.secondControlKey] = [];
452
- // this.form.patchValue(formValue);
453
- this.form = this.builder.group(formValue);
454
- // this.form[this.firstControlKey] = [];
455
- // this.form[this.secondControlKey] = [];
456
- this.setupOperators();
457
- if (this.showActionButtons) {
458
- this.createActionsComponent();
459
- }
460
- }
461
- setupOperators() {
462
- // Get the operators by componentType.
463
- this.operators = Object.keys(PepSmartFilterOperators)
464
- .filter((key) => {
465
- return PepSmartFilterOperators[key].componentType.includes(this.field.componentType);
466
- })
467
- .map((key) => PepSmartFilterOperators[key]);
468
- // Add additional operators
469
- if (this.showAdditionalOperators) {
470
- const additional = Object.keys(PepSmartFilterAdditionalOperators)
471
- .filter((key) => {
472
- return PepSmartFilterAdditionalOperators[key].componentType.includes(this.field.componentType);
473
- })
474
- .map((key) => PepSmartFilterAdditionalOperators[key]);
475
- this.operators = [...this.operators, ...additional];
476
- }
477
- //add variable operators
478
- if (this.variableFieldOptions?.length) {
479
- const variables = Object.keys(PepSmartFilterVariableOperators)
480
- .filter((key) => {
481
- return PepSmartFilterVariableOperators[key].componentType.includes(this.field.componentType);
482
- })
483
- .map((key) => PepSmartFilterVariableOperators[key]);
484
- this.operators = [...this.operators, ...variables];
485
- }
486
- // Filter by from field.operators input if exist.
487
- if (this.field.operators?.length > 0) {
488
- this.operators = this.operators.filter((o1) => this.field.operators.some((o2) => o1.id === o2));
489
- }
490
- // Get the operator units by componentType.
491
- this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
492
- .filter((key) => {
493
- return PepSmartFilterOperatorUnits[key].componentType.includes(this.field.componentType);
494
- })
495
- .map((key) => PepSmartFilterOperatorUnits[key]);
496
- // Filter by from field.operatorsUnits input if exist.
497
- if (this.field.operatorUnits?.length > 0) {
498
- this.operatorUnits = this.operatorUnits.filter((o1) => this.field.operatorUnits.some((o2) => o1.id === o2));
499
- }
500
- // Load translation before get the options in the children.
501
- this.translate.get('SMART_FILTERS.TITLE').subscribe((res) => {
502
- this.loadOperatorsOptions();
503
- });
504
- }
505
- setupFilter() {
506
- if (this._filter) {
507
- this.operator = this._filter.operator;
508
- this.operatorUnit = this._filter.operatorUnit;
509
- const formValue = {};
510
- formValue[this.firstControlKey] = this._filter.value.first;
511
- formValue[this.secondControlKey] = this._filter.value.second;
512
- this.form.patchValue(formValue);
513
- }
514
- else {
515
- this.operator = this.getDefaultOperator();
516
- this.operatorUnit = this.getDefaultOperatorUnit();
517
- this.clearFilter(false);
518
- }
519
- }
520
- updateParentForm() {
521
- this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
522
- this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
523
- this._parentForm.setControl('operator', this.builder.control(this.operator));
524
- this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
525
- this._parentForm.setControl('values', this.builder.group({
526
- first: this.firstControl,
527
- second: this.secondControl
528
- }));
529
- }
530
- getDestroyer() {
531
- return takeUntil(this._destroyed);
532
- }
533
- updateValidity() {
534
- this.setFieldsStateAndValidators();
535
- this.firstControl.updateValueAndValidity();
536
- this.secondControl.updateValueAndValidity();
537
- }
538
- // Load the operators options from the translation.
539
- loadOperatorsOptions() {
540
- // Not implemented in the base
541
- }
542
- // Set default validators - some childs override this.
543
- setFieldsStateAndValidators() {
544
- this.firstControl.setValidators(Validators.required);
545
- this.secondControl.setValidators(Validators.required);
546
- this.secondControl.disable();
547
- }
548
- // Return undefined - some childs override this.
549
- getDefaultOperatorUnit() {
550
- return undefined;
551
- }
552
- initFilter() {
553
- // Not implemented in the base
554
- }
555
- clearFilter(emitEvent = true) {
556
- this._filter = null;
557
- this.form.reset();
558
- this.initFilter();
559
- if (emitEvent) {
560
- this.filterClear.emit();
561
- }
562
- }
563
- applyFilter() {
564
- const filterValue = this.getFilterValue();
565
- // If the filter is not null declare it, else - clear it.
566
- if (filterValue) {
567
- const filter = {
568
- fieldId: this.field.id,
569
- operator: this.operator,
570
- operatorUnit: this.operatorUnit,
571
- value: filterValue,
572
- };
573
- this._filter = filter;
574
- this.filterChange.emit(filter);
575
- }
576
- else {
577
- this.clearFilter();
578
- }
579
- }
580
- ngOnInit() {
581
- if (this.form) {
582
- this.updateValidity();
583
- }
584
- }
585
- ngOnChanges() {
586
- // if (this.form) {
587
- // this.updateValidity();
588
- // }
589
- }
590
- ngOnDestroy() {
591
- this._destroyed.next();
592
- this._destroyed.complete();
593
- if (this.showActionButtons) {
594
- this.actionsContainerRef.destroy();
595
- }
596
- }
597
- }
598
- 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 });
599
- 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 });
600
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, decorators: [{
601
- type: Directive,
602
- args: [{}]
603
- }], 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: [{
604
- type: Input
605
- }], variableField: [{
606
- type: Input
607
- }], filter: [{
608
- type: Input
609
- }], parentForm: [{
610
- type: Input
611
- }], emitOnChange: [{
612
- type: Input
613
- }], inline: [{
614
- type: Input
615
- }], showActionButtons: [{
616
- type: Input
617
- }], renderTitle: [{
618
- type: Input
619
- }], showAdditionalOperators: [{
620
- type: Input
621
- }], filterClear: [{
622
- type: Output
623
- }], filterChange: [{
624
- 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?.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
+ if (operator?.id != this._operator?.id) {
395
+ // Validate operator
396
+ const index = this.operators.findIndex((o) => o.id === operator.id);
397
+ if (index >= 0) {
398
+ this._operator = this.operators[index];
399
+ }
400
+ else {
401
+ this._operator = this.operators[0];
402
+ }
403
+ this.form.reset();
404
+ this.updateValidity();
405
+ }
406
+ }
407
+ get operator() {
408
+ return this._operator;
409
+ }
410
+ set operatorUnit(operatorUnit) {
411
+ // Validate operator unit
412
+ if (operatorUnit) {
413
+ const index = this.operatorUnits.findIndex((ou) => ou.id === operatorUnit.id);
414
+ if (index >= 0) {
415
+ this._operatorUnit = this.operatorUnits[index];
416
+ }
417
+ else {
418
+ this._operatorUnit = this.operatorUnits[0];
419
+ }
420
+ }
421
+ else {
422
+ this._operatorUnit = undefined;
423
+ }
424
+ }
425
+ get operatorUnit() {
426
+ return this._operatorUnit;
427
+ }
428
+ get firstControlKey() {
429
+ return this.field ? `${this._fieldIdWithNoDots}_first` : 'first';
430
+ }
431
+ get firstControl() {
432
+ return this.form.get(this.firstControlKey);
433
+ }
434
+ get secondControlKey() {
435
+ return this.field ? `${this._fieldIdWithNoDots}_second` : 'second';
436
+ }
437
+ get secondControl() {
438
+ return this.form.get(this.secondControlKey);
439
+ }
440
+ createActionsComponent() {
441
+ const factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
442
+ this.actionsContainerRef = factory.create(this.injector);
443
+ this.actionsContainerRef.instance.form = this.form;
444
+ this.actionsContainerRef.instance.applyClick.subscribe(() => this.applyFilter());
445
+ this.actionsContainerRef.instance.clearClick.subscribe(() => this.clearFilter());
446
+ this.viewContainerRef.insert(this.actionsContainerRef.hostView);
447
+ }
448
+ setupForm() {
449
+ const formValue = {};
450
+ formValue[this.firstControlKey] = [];
451
+ formValue[this.secondControlKey] = [];
452
+ // this.form.patchValue(formValue);
453
+ this.form = this.builder.group(formValue);
454
+ // this.form[this.firstControlKey] = [];
455
+ // this.form[this.secondControlKey] = [];
456
+ this.setupOperators();
457
+ if (this.showActionButtons) {
458
+ this.createActionsComponent();
459
+ }
460
+ }
461
+ setupOperators() {
462
+ // Get the operators by componentType.
463
+ this.operators = Object.keys(PepSmartFilterOperators)
464
+ .filter((key) => {
465
+ return PepSmartFilterOperators[key].componentType.includes(this.field.componentType);
466
+ })
467
+ .map((key) => PepSmartFilterOperators[key]);
468
+ // Add additional operators
469
+ if (this.showAdditionalOperators) {
470
+ const additional = Object.keys(PepSmartFilterAdditionalOperators)
471
+ .filter((key) => {
472
+ return PepSmartFilterAdditionalOperators[key].componentType.includes(this.field.componentType);
473
+ })
474
+ .map((key) => PepSmartFilterAdditionalOperators[key]);
475
+ this.operators = [...this.operators, ...additional];
476
+ }
477
+ //add variable operators
478
+ if (this.variableFieldOptions?.length) {
479
+ const variables = Object.keys(PepSmartFilterVariableOperators)
480
+ .filter((key) => {
481
+ return PepSmartFilterVariableOperators[key].componentType.includes(this.field.componentType);
482
+ })
483
+ .map((key) => PepSmartFilterVariableOperators[key]);
484
+ this.operators = [...this.operators, ...variables];
485
+ }
486
+ // Filter by from field.operators input if exist.
487
+ if (this.field.operators?.length > 0) {
488
+ this.operators = this.operators.filter((o1) => this.field.operators.some((o2) => o1.id === o2));
489
+ }
490
+ // Get the operator units by componentType.
491
+ this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
492
+ .filter((key) => {
493
+ return PepSmartFilterOperatorUnits[key].componentType.includes(this.field.componentType);
494
+ })
495
+ .map((key) => PepSmartFilterOperatorUnits[key]);
496
+ // Filter by from field.operatorsUnits input if exist.
497
+ if (this.field.operatorUnits?.length > 0) {
498
+ this.operatorUnits = this.operatorUnits.filter((o1) => this.field.operatorUnits.some((o2) => o1.id === o2));
499
+ }
500
+ // Load translation before get the options in the children.
501
+ this.translate.get('SMART_FILTERS.TITLE').subscribe((res) => {
502
+ this.loadOperatorsOptions();
503
+ });
504
+ }
505
+ setupFilter() {
506
+ if (this._filter) {
507
+ this.operator = this._filter.operator;
508
+ this.operatorUnit = this._filter.operatorUnit;
509
+ const formValue = {};
510
+ formValue[this.firstControlKey] = this._filter.value.first;
511
+ formValue[this.secondControlKey] = this._filter.value.second;
512
+ this.form.patchValue(formValue);
513
+ }
514
+ else {
515
+ this.operator = this.getDefaultOperator();
516
+ this.operatorUnit = this.getDefaultOperatorUnit();
517
+ this.clearFilter(false);
518
+ }
519
+ }
520
+ updateParentForm() {
521
+ this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
522
+ this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
523
+ this._parentForm.setControl('operator', this.builder.control(this.operator));
524
+ this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
525
+ this._parentForm.setControl('values', this.builder.group({
526
+ first: this.firstControl,
527
+ second: this.secondControl
528
+ }));
529
+ }
530
+ getDestroyer() {
531
+ return takeUntil(this._destroyed);
532
+ }
533
+ updateValidity() {
534
+ this.setFieldsStateAndValidators();
535
+ this.firstControl.updateValueAndValidity();
536
+ this.secondControl.updateValueAndValidity();
537
+ }
538
+ // Load the operators options from the translation.
539
+ loadOperatorsOptions() {
540
+ // Not implemented in the base
541
+ }
542
+ // Set default validators - some childs override this.
543
+ setFieldsStateAndValidators() {
544
+ this.firstControl.setValidators(Validators.required);
545
+ this.secondControl.setValidators(Validators.required);
546
+ this.secondControl.disable();
547
+ }
548
+ // Return undefined - some childs override this.
549
+ getDefaultOperatorUnit() {
550
+ return undefined;
551
+ }
552
+ initFilter() {
553
+ // Not implemented in the base
554
+ }
555
+ clearFilter(emitEvent = true) {
556
+ this._filter = null;
557
+ this.form.reset();
558
+ this.initFilter();
559
+ if (emitEvent) {
560
+ this.filterClear.emit();
561
+ }
562
+ }
563
+ applyFilter() {
564
+ const filterValue = this.getFilterValue();
565
+ // If the filter is not null declare it, else - clear it.
566
+ if (filterValue) {
567
+ const filter = {
568
+ fieldId: this.field.id,
569
+ operator: this.operator,
570
+ operatorUnit: this.operatorUnit,
571
+ value: filterValue,
572
+ };
573
+ this._filter = filter;
574
+ this.filterChange.emit(filter);
575
+ }
576
+ else {
577
+ this.clearFilter();
578
+ }
579
+ }
580
+ ngOnInit() {
581
+ if (this.form) {
582
+ this.updateValidity();
583
+ }
584
+ }
585
+ ngOnChanges() {
586
+ // if (this.form) {
587
+ // this.updateValidity();
588
+ // }
589
+ }
590
+ ngOnDestroy() {
591
+ this._destroyed.next();
592
+ this._destroyed.complete();
593
+ if (this.showActionButtons) {
594
+ this.actionsContainerRef.destroy();
595
+ }
596
+ }
597
+ }
598
+ 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 });
599
+ 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 });
600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, decorators: [{
601
+ type: Directive,
602
+ args: [{}]
603
+ }], 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: [{
604
+ type: Input
605
+ }], variableField: [{
606
+ type: Input
607
+ }], filter: [{
608
+ type: Input
609
+ }], parentForm: [{
610
+ type: Input
611
+ }], emitOnChange: [{
612
+ type: Input
613
+ }], inline: [{
614
+ type: Input
615
+ }], showActionButtons: [{
616
+ type: Input
617
+ }], renderTitle: [{
618
+ type: Input
619
+ }], showAdditionalOperators: [{
620
+ type: Input
621
+ }], filterClear: [{
622
+ type: Output
623
+ }], filterChange: [{
624
+ type: Output
625
625
  }] } });
626
626
 
627
- class PepTextFilterComponent extends BaseFilterComponent {
628
- constructor() {
629
- super(...arguments);
630
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
631
- this.chooseTypeOptions = [];
632
- this.operatorWidth = '38%';
633
- this.firstControlWidth = '62%';
634
- }
635
- ngOnInit() {
636
- this.firstControl.valueChanges
637
- .pipe(this.getDestroyer(), distinctUntilChanged())
638
- .subscribe(() => {
639
- this.setFieldsStateAndValidators();
640
- });
641
- }
642
- // Override
643
- getDefaultOperator() {
644
- return PepSmartFilterOperators.Equals;
645
- }
646
- // Override
647
- getFilterValue() {
648
- const filterValue = {
649
- first: this.firstControl.value,
650
- };
651
- if (this.operator === PepSmartFilterOperators.NumberRange) {
652
- filterValue['second'] = this.secondControl.value;
653
- }
654
- return filterValue;
655
- }
656
- // Override
657
- loadOperatorsOptions() {
658
- this.chooseTypeOptions = this.operators.map((operator) => {
659
- return {
660
- key: operator.id,
661
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
662
- };
663
- });
664
- }
665
- // Override
666
- setFieldsStateAndValidators() {
667
- if (this.operator === PepSmartFilterOperators.NumberRange) {
668
- const firstValidators = [Validators.required];
669
- if (this.secondControl.value) {
670
- firstValidators.push(this.validator.isLessThan(this.secondControl));
671
- }
672
- this.firstControl.setValidators(firstValidators);
673
- this.firstControl.updateValueAndValidity();
674
- }
675
- else {
676
- super.setFieldsStateAndValidators();
677
- }
678
- }
679
- onOperatorChanged(value) {
680
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
681
- this.operator = operator;
682
- if (this._parentForm) {
683
- this.updateParentForm();
684
- }
685
- if (this.emitOnChange) {
686
- this.applyFilter();
687
- }
688
- }
689
- onVariableChanged(value) {
690
- this.firstControl.setValue(value);
691
- if (this.emitOnChange) {
692
- this.applyFilter();
693
- }
694
- }
695
- onValueChanged() {
696
- if (this.emitOnChange) {
697
- this.applyFilter();
698
- }
699
- }
700
- }
701
- PepTextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
702
- PepTextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextFilterComponent, selector: "pep-text-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [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" }] });
703
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, decorators: [{
704
- type: Component,
705
- args: [{ selector: 'pep-text-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [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>" }]
627
+ class PepTextFilterComponent extends BaseFilterComponent {
628
+ constructor() {
629
+ super(...arguments);
630
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
631
+ this.chooseTypeOptions = [];
632
+ this.operatorWidth = '38%';
633
+ this.firstControlWidth = '62%';
634
+ }
635
+ ngOnInit() {
636
+ this.firstControl.valueChanges
637
+ .pipe(this.getDestroyer(), distinctUntilChanged())
638
+ .subscribe(() => {
639
+ this.setFieldsStateAndValidators();
640
+ });
641
+ }
642
+ // Override
643
+ getDefaultOperator() {
644
+ return PepSmartFilterOperators.Equals;
645
+ }
646
+ // Override
647
+ getFilterValue() {
648
+ const filterValue = {
649
+ first: this.firstControl.value,
650
+ };
651
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
652
+ filterValue['second'] = this.secondControl.value;
653
+ }
654
+ return filterValue;
655
+ }
656
+ // Override
657
+ loadOperatorsOptions() {
658
+ this.chooseTypeOptions = this.operators.map((operator) => {
659
+ return {
660
+ key: operator.id,
661
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
662
+ };
663
+ });
664
+ }
665
+ // Override
666
+ setFieldsStateAndValidators() {
667
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
668
+ const firstValidators = [Validators.required];
669
+ if (this.secondControl.value) {
670
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
671
+ }
672
+ this.firstControl.setValidators(firstValidators);
673
+ this.firstControl.updateValueAndValidity();
674
+ }
675
+ else {
676
+ super.setFieldsStateAndValidators();
677
+ }
678
+ }
679
+ onOperatorChanged(value) {
680
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
681
+ this.operator = operator;
682
+ if (this._parentForm) {
683
+ this.updateParentForm();
684
+ }
685
+ if (this.emitOnChange) {
686
+ this.applyFilter();
687
+ }
688
+ }
689
+ onVariableChanged(value) {
690
+ this.firstControl.setValue(value);
691
+ if (this.emitOnChange) {
692
+ this.applyFilter();
693
+ }
694
+ }
695
+ onValueChanged() {
696
+ if (this.emitOnChange) {
697
+ this.applyFilter();
698
+ }
699
+ }
700
+ }
701
+ PepTextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
702
+ PepTextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextFilterComponent, selector: "pep-text-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [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" }] });
703
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, decorators: [{
704
+ type: Component,
705
+ args: [{ selector: 'pep-text-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>" }]
706
706
  }] });
707
707
 
708
- class PepBooleanFilterComponent extends BaseFilterComponent {
709
- constructor() {
710
- super(...arguments);
711
- this.options = [];
712
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
713
- this.chooseTypeOptions = [];
714
- }
715
- ngOnInit() {
716
- if (this.inline) {
717
- this.setControlsWidth();
718
- }
719
- }
720
- // Override
721
- getDefaultOperator() {
722
- return PepSmartFilterOperators.Equals;
723
- }
724
- // Override
725
- getFilterValue() {
726
- const filterValue = { first: this.firstControl.value || false };
727
- return filterValue;
728
- }
729
- // Override
730
- loadOperatorsOptions() {
731
- this.chooseTypeOptions = this.operators.map((operator) => {
732
- return {
733
- key: operator.id,
734
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
735
- };
736
- });
737
- }
738
- setControlsWidth() {
739
- if (this.variableFieldOptions?.length) {
740
- this.operatorWidth = '38%';
741
- this.valueWidth = '62%';
742
- }
743
- else {
744
- this.valueWidth = '100%';
745
- }
746
- }
747
- onOperatorChanged(value) {
748
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
749
- this.operator = operator;
750
- if (this._parentForm) {
751
- this.updateParentForm();
752
- }
753
- if (this.emitOnChange) {
754
- this.applyFilter();
755
- }
756
- }
757
- onValueChanged(value) {
758
- this.firstControl.setValue(value);
759
- if (this.emitOnChange) {
760
- this.applyFilter();
761
- }
762
- }
763
- }
764
- PepBooleanFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
765
- 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" }] });
766
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, decorators: [{
767
- type: Component,
768
- 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"] }]
769
- }], propDecorators: { options: [{
770
- type: Input
708
+ class PepBooleanFilterComponent extends BaseFilterComponent {
709
+ constructor() {
710
+ super(...arguments);
711
+ this.options = [];
712
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
713
+ this.chooseTypeOptions = [];
714
+ }
715
+ ngOnInit() {
716
+ if (this.inline) {
717
+ this.setControlsWidth();
718
+ }
719
+ }
720
+ // Override
721
+ getDefaultOperator() {
722
+ return PepSmartFilterOperators.Equals;
723
+ }
724
+ // Override
725
+ getFilterValue() {
726
+ const filterValue = { first: this.firstControl.value || false };
727
+ return filterValue;
728
+ }
729
+ // Override
730
+ loadOperatorsOptions() {
731
+ this.chooseTypeOptions = this.operators.map((operator) => {
732
+ return {
733
+ key: operator.id,
734
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
735
+ };
736
+ });
737
+ }
738
+ setControlsWidth() {
739
+ if (this.variableFieldOptions?.length) {
740
+ this.operatorWidth = '38%';
741
+ this.valueWidth = '62%';
742
+ }
743
+ else {
744
+ this.valueWidth = '100%';
745
+ }
746
+ }
747
+ onOperatorChanged(value) {
748
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
749
+ this.operator = operator;
750
+ if (this._parentForm) {
751
+ this.updateParentForm();
752
+ }
753
+ if (this.emitOnChange) {
754
+ this.applyFilter();
755
+ }
756
+ }
757
+ onValueChanged(value) {
758
+ this.firstControl.setValue(value);
759
+ if (this.emitOnChange) {
760
+ this.applyFilter();
761
+ }
762
+ }
763
+ }
764
+ PepBooleanFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
765
+ 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" }] });
766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, decorators: [{
767
+ type: Component,
768
+ 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"] }]
769
+ }], propDecorators: { options: [{
770
+ type: Input
771
771
  }] } });
772
772
 
773
- class PepDateFilterComponent extends BaseFilterComponent {
774
- constructor() {
775
- super(...arguments);
776
- this.PepSmartFilterOperators = PepSmartFilterOperators;
777
- this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
778
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
779
- this.chooseTimeOptions = [];
780
- this.chooseTimeUnitOptions = [];
781
- }
782
- ngOnInit() {
783
- if (this.inline) {
784
- this.setControlsWidth();
785
- }
786
- }
787
- // Override
788
- getDefaultOperator() {
789
- return PepSmartFilterOperators.InTheLast;
790
- }
791
- // Override
792
- getDefaultOperatorUnit() {
793
- if (this.operator === PepSmartFilterOperators.InTheLast ||
794
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
795
- this.operator === PepSmartFilterOperators.NotInTheLast ||
796
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
797
- this.operator === PepSmartFilterOperators.DueIn ||
798
- this.operator === PepSmartFilterOperators.NotDueIn) {
799
- return PepSmartFilterOperatorUnits.Months;
800
- }
801
- else {
802
- return undefined;
803
- }
804
- }
805
- // Override
806
- getFilterValue() {
807
- const filterValue = {
808
- first: this.firstControl.value,
809
- };
810
- if (this.operator === PepSmartFilterOperators.DateRange ||
811
- this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
812
- filterValue['second'] = this.secondControl.value;
813
- }
814
- return filterValue;
815
- }
816
- // Override
817
- initFilter() {
818
- setTimeout(() => {
819
- if (this.emitOnChange) {
820
- this.applyFilter();
821
- }
822
- }, 0);
823
- }
824
- // Override
825
- loadOperatorsOptions() {
826
- this.chooseTimeOptions = this.operators.map((operator) => {
827
- return {
828
- key: operator.id,
829
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
830
- };
831
- });
832
- this.chooseTimeUnitOptions = this.operatorUnits.map((operatorUnit) => {
833
- return {
834
- key: operatorUnit.id,
835
- value: this.translate.instant(`${this.OPERATOR_UNITS_TRANSLATION_PREFIX}.${operatorUnit.name}`),
836
- };
837
- });
838
- }
839
- // Override
840
- setFieldsStateAndValidators() {
841
- this.firstControl.enable();
842
- if (this.operator === PepSmartFilterOperators.DateRange ||
843
- this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
844
- this.firstControl.setValidators(Validators.required);
845
- this.secondControl.enable();
846
- this.secondControl.setValidators(Validators.required);
847
- }
848
- else if (this.operator === PepSmartFilterOperators.InTheLast ||
849
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
850
- this.operator === PepSmartFilterOperators.NotInTheLast ||
851
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
852
- this.operator === PepSmartFilterOperators.DueIn ||
853
- this.operator === PepSmartFilterOperators.NotDueIn) {
854
- this.firstControl.setValidators([
855
- Validators.required,
856
- this.validator.numberValidator(),
857
- ]);
858
- this.secondControl.disable();
859
- }
860
- else {
861
- // Disable 'first' field.
862
- if (this.operator === PepSmartFilterOperators.Today ||
863
- this.operator === PepSmartFilterOperators.ThisWeek ||
864
- this.operator === PepSmartFilterOperators.ThisMonth ||
865
- this.operator === PepSmartFilterOperators.IsEmpty ||
866
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
867
- this.firstControl.disable();
868
- }
869
- // Default disable 'second' field.
870
- super.setFieldsStateAndValidators();
871
- }
872
- }
873
- setControlsWidth() {
874
- if (this.operator === PepSmartFilterOperators.Today ||
875
- this.operator === PepSmartFilterOperators.ThisWeek ||
876
- this.operator === PepSmartFilterOperators.ThisMonth ||
877
- this.operator === PepSmartFilterOperators.IsEmpty ||
878
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
879
- this.operatorWidth = 'auto';
880
- this.fieldsWidth = '0%';
881
- }
882
- else if (this.operator === PepSmartFilterOperators.On) {
883
- this.operatorWidth = '38%';
884
- this.fieldsWidth = '62%';
885
- }
886
- else {
887
- this.operatorWidth = '30%';
888
- this.fieldsWidth = '70%';
889
- }
890
- }
891
- onOperatorChanged(value) {
892
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
893
- this.operator = operator;
894
- this.operatorUnit = this.getDefaultOperatorUnit();
895
- if (this.inline) {
896
- this.setControlsWidth();
897
- }
898
- if (this._parentForm) {
899
- this.updateParentForm();
900
- }
901
- setTimeout(() => {
902
- if (this.emitOnChange) {
903
- this.applyFilter();
904
- }
905
- }, 0);
906
- }
907
- onTimeUnitChanged(value) {
908
- const operatorUnit = Object.values(PepSmartFilterOperatorUnits).find((operatorUnit) => operatorUnit.id === value);
909
- this.operatorUnit = operatorUnit;
910
- if (this._parentForm) {
911
- this.updateParentForm();
912
- }
913
- if (this.emitOnChange) {
914
- this.applyFilter();
915
- }
916
- }
917
- onVariableChanged(value) {
918
- this.firstControl.setValue(value);
919
- if (this.emitOnChange) {
920
- this.applyFilter();
921
- }
922
- }
923
- onSecondVariableChanged(value) {
924
- this.secondControl.setValue(value);
925
- if (this.emitOnChange) {
926
- this.applyFilter();
927
- }
928
- }
929
- onDateValueChanged() {
930
- if (this.emitOnChange) {
931
- this.applyFilter();
932
- }
933
- }
934
- }
935
- PepDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
936
- 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" }] });
937
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, decorators: [{
938
- type: Component,
939
- 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" }]
773
+ class PepDateFilterComponent extends BaseFilterComponent {
774
+ constructor() {
775
+ super(...arguments);
776
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
777
+ this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
778
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
779
+ this.chooseTimeOptions = [];
780
+ this.chooseTimeUnitOptions = [];
781
+ }
782
+ ngOnInit() {
783
+ if (this.inline) {
784
+ this.setControlsWidth();
785
+ }
786
+ }
787
+ // Override
788
+ getDefaultOperator() {
789
+ return PepSmartFilterOperators.InTheLast;
790
+ }
791
+ // Override
792
+ getDefaultOperatorUnit() {
793
+ if (this.operator === PepSmartFilterOperators.InTheLast ||
794
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
795
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
796
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
797
+ this.operator === PepSmartFilterOperators.DueIn ||
798
+ this.operator === PepSmartFilterOperators.NotDueIn) {
799
+ return PepSmartFilterOperatorUnits.Months;
800
+ }
801
+ else {
802
+ return undefined;
803
+ }
804
+ }
805
+ // Override
806
+ getFilterValue() {
807
+ const filterValue = {
808
+ first: this.firstControl.value,
809
+ };
810
+ if (this.operator === PepSmartFilterOperators.DateRange ||
811
+ this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
812
+ filterValue['second'] = this.secondControl.value;
813
+ }
814
+ return filterValue;
815
+ }
816
+ // Override
817
+ initFilter() {
818
+ setTimeout(() => {
819
+ if (this.emitOnChange) {
820
+ this.applyFilter();
821
+ }
822
+ }, 0);
823
+ }
824
+ // Override
825
+ loadOperatorsOptions() {
826
+ this.chooseTimeOptions = this.operators.map((operator) => {
827
+ return {
828
+ key: operator.id,
829
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
830
+ };
831
+ });
832
+ this.chooseTimeUnitOptions = this.operatorUnits.map((operatorUnit) => {
833
+ return {
834
+ key: operatorUnit.id,
835
+ value: this.translate.instant(`${this.OPERATOR_UNITS_TRANSLATION_PREFIX}.${operatorUnit.name}`),
836
+ };
837
+ });
838
+ }
839
+ // Override
840
+ setFieldsStateAndValidators() {
841
+ this.firstControl.enable();
842
+ if (this.operator === PepSmartFilterOperators.DateRange ||
843
+ this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
844
+ this.firstControl.setValidators(Validators.required);
845
+ this.secondControl.enable();
846
+ this.secondControl.setValidators(Validators.required);
847
+ }
848
+ else if (this.operator === PepSmartFilterOperators.InTheLast ||
849
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
850
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
851
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
852
+ this.operator === PepSmartFilterOperators.DueIn ||
853
+ this.operator === PepSmartFilterOperators.NotDueIn) {
854
+ this.firstControl.setValidators([
855
+ Validators.required,
856
+ this.validator.numberValidator(),
857
+ ]);
858
+ this.secondControl.disable();
859
+ }
860
+ else {
861
+ // Disable 'first' field.
862
+ if (this.operator === PepSmartFilterOperators.Today ||
863
+ this.operator === PepSmartFilterOperators.ThisWeek ||
864
+ this.operator === PepSmartFilterOperators.ThisMonth ||
865
+ this.operator === PepSmartFilterOperators.IsEmpty ||
866
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
867
+ this.firstControl.disable();
868
+ }
869
+ // Default disable 'second' field.
870
+ super.setFieldsStateAndValidators();
871
+ }
872
+ }
873
+ setControlsWidth() {
874
+ if (this.operator === PepSmartFilterOperators.Today ||
875
+ this.operator === PepSmartFilterOperators.ThisWeek ||
876
+ this.operator === PepSmartFilterOperators.ThisMonth ||
877
+ this.operator === PepSmartFilterOperators.IsEmpty ||
878
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
879
+ this.operatorWidth = 'auto';
880
+ this.fieldsWidth = '0%';
881
+ }
882
+ else if (this.operator === PepSmartFilterOperators.On) {
883
+ this.operatorWidth = '38%';
884
+ this.fieldsWidth = '62%';
885
+ }
886
+ else {
887
+ this.operatorWidth = '30%';
888
+ this.fieldsWidth = '70%';
889
+ }
890
+ }
891
+ onOperatorChanged(value) {
892
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
893
+ this.operator = operator;
894
+ this.operatorUnit = this.getDefaultOperatorUnit();
895
+ if (this.inline) {
896
+ this.setControlsWidth();
897
+ }
898
+ if (this._parentForm) {
899
+ this.updateParentForm();
900
+ }
901
+ setTimeout(() => {
902
+ if (this.emitOnChange) {
903
+ this.applyFilter();
904
+ }
905
+ }, 0);
906
+ }
907
+ onTimeUnitChanged(value) {
908
+ const operatorUnit = Object.values(PepSmartFilterOperatorUnits).find((operatorUnit) => operatorUnit.id === value);
909
+ this.operatorUnit = operatorUnit;
910
+ if (this._parentForm) {
911
+ this.updateParentForm();
912
+ }
913
+ if (this.emitOnChange) {
914
+ this.applyFilter();
915
+ }
916
+ }
917
+ onVariableChanged(value) {
918
+ this.firstControl.setValue(value);
919
+ if (this.emitOnChange) {
920
+ this.applyFilter();
921
+ }
922
+ }
923
+ onSecondVariableChanged(value) {
924
+ this.secondControl.setValue(value);
925
+ if (this.emitOnChange) {
926
+ this.applyFilter();
927
+ }
928
+ }
929
+ onDateValueChanged() {
930
+ if (this.emitOnChange) {
931
+ this.applyFilter();
932
+ }
933
+ }
934
+ }
935
+ PepDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
936
+ 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" }] });
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, decorators: [{
938
+ type: Component,
939
+ 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" }]
940
940
  }] });
941
941
 
942
- class PepMultiSelectFilterOption {
943
- constructor() {
944
- this.selected = false;
945
- }
946
- }
947
- class PepMultiSelectFilterComponent extends BaseFilterComponent {
948
- constructor() {
949
- super(...arguments);
950
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
951
- this.options = [];
952
- this.chooseTypeOptions = [];
953
- this.searchControl = new FormControl();
954
- //inline props
955
- this.selected = '';
956
- this.inlineOptions = [];
957
- this.MAX_OPTIONS_TO_SHOW = 6.35;
958
- this.numberOptionsToShowSearch = 10;
959
- }
960
- ngOnInit() {
961
- super.ngOnInit;
962
- if (this.inline) {
963
- this.inlineControlInit();
964
- this.setControlsWidth();
965
- }
966
- else {
967
- this.noneInlineControlInit();
968
- }
969
- }
970
- ngAfterViewInit() {
971
- // Calc for the first time.
972
- this.calcOptionsHeight(this.options.length);
973
- }
974
- inlineControlInit() {
975
- //load options from field
976
- this.inlineOptions = this.field?.options?.length > 0 ? this.field.options : [];
977
- // init the selected values from first value.
978
- if (this.firstControl?.value && Array.isArray(this.firstControl.value)) {
979
- this.selected = this.firstControl.value.join(';');
980
- }
981
- }
982
- noneInlineControlInit() {
983
- if (this.field.options?.length > 0) {
984
- this.options = this.field.options.map((opt) => {
985
- return { value: opt.value, count: opt.count, selected: false };
986
- });
987
- }
988
- else {
989
- this.searchControl.disable();
990
- }
991
- // Init the selected values from first value.
992
- const firstControl = this.firstControl;
993
- if (firstControl.value) {
994
- this.initOptionsSelectedValues(firstControl.value);
995
- }
996
- // Add subscription for the first value change to set the selected options.
997
- firstControl.valueChanges
998
- .pipe(this.getDestroyer(), distinctUntilChanged())
999
- .subscribe((selectedValues) => {
1000
- this.initOptionsSelectedValues(selectedValues);
1001
- });
1002
- // Filter the options by the search control.
1003
- 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)));
1004
- // Each time the filter change.
1005
- this.filteredOptions$.subscribe((filterdOptions) => {
1006
- this.calcOptionsHeight(filterdOptions.length);
1007
- setTimeout(() => {
1008
- // 8 is the padding top of the multi-select-options
1009
- this.virtualScroller.scrollToPosition(-8);
1010
- }, 125);
1011
- });
1012
- }
1013
- initOptionsSelectedValues(selectedValues) {
1014
- this.options.forEach((opt) => {
1015
- const isValueSelected = selectedValues && selectedValues.includes(opt.value);
1016
- opt.selected = isValueSelected;
1017
- });
1018
- }
1019
- calcOptionsHeight(optionsCount) {
1020
- if (this.optionsContainer) {
1021
- const optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1022
- ? this.MAX_OPTIONS_TO_SHOW
1023
- : optionsCount;
1024
- // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1025
- const optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1026
- this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1027
- }
1028
- }
1029
- filterOptions(value) {
1030
- const filterValue = value.toLowerCase();
1031
- return this.options.filter((opt) => opt.value &&
1032
- opt.value.toLowerCase().includes(filterValue.toLowerCase()));
1033
- }
1034
- // Override
1035
- getDefaultOperator() {
1036
- return PepSmartFilterOperators.In;
1037
- }
1038
- // Override
1039
- getFilterValue() {
1040
- if (this.inline) {
1041
- return {
1042
- first: this.firstControl.value
1043
- };
1044
- }
1045
- else {
1046
- const selectedValues = this.options
1047
- .filter((opt) => opt.selected)
1048
- .map((opt) => opt.value);
1049
- const filterValue = {
1050
- first: selectedValues,
1051
- };
1052
- return selectedValues.length > 0 ? filterValue : null;
1053
- }
1054
- }
1055
- // Override
1056
- loadOperatorsOptions() {
1057
- this.chooseTypeOptions = this.operators.map((operator) => {
1058
- return {
1059
- key: operator.id,
1060
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1061
- };
1062
- });
1063
- }
1064
- setControlsWidth() {
1065
- if (this.variableFieldOptions?.length) {
1066
- this.operatorWidth = '38%';
1067
- this.valueWidth = '62%';
1068
- }
1069
- else {
1070
- this.valueWidth = '100%';
1071
- }
1072
- }
1073
- onOperatorChanged(value) {
1074
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
1075
- this.operator = operator;
1076
- if (this._parentForm) {
1077
- this.updateParentForm();
1078
- }
1079
- if (this.emitOnChange) {
1080
- this.applyFilter();
1081
- }
1082
- }
1083
- // Override
1084
- initFilter() {
1085
- this.options.forEach((opt) => (opt.selected = false));
1086
- this.searchControl.setValue('');
1087
- }
1088
- onOptionChange(option, event) {
1089
- option.selected = event.checked;
1090
- this.firstControl.setValue(this.options.filter((opt) => opt.selected).map((opt) => opt.value), { emitEvent: false });
1091
- }
1092
- onMultiSelectChanged(value) {
1093
- if (value) {
1094
- const selected = value.split(';');
1095
- this.firstControl.setValue(selected);
1096
- }
1097
- else {
1098
- this.firstControl.setValue(null);
1099
- }
1100
- if (this.emitOnChange) {
1101
- this.applyFilter();
1102
- }
1103
- }
1104
- onValueChanged(value) {
1105
- this.firstControl.setValue(value);
1106
- if (this.emitOnChange) {
1107
- this.applyFilter();
1108
- }
1109
- }
1110
- }
1111
- PepMultiSelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1112
- 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" }] });
1113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, decorators: [{
1114
- type: Component,
1115
- 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"] }]
1116
- }], propDecorators: { optionsContainer: [{
1117
- type: ViewChild,
1118
- args: ['optionsContainer']
1119
- }], virtualScroller: [{
1120
- type: ViewChild,
1121
- args: [VirtualScrollerComponent]
942
+ class PepMultiSelectFilterOption {
943
+ constructor() {
944
+ this.selected = false;
945
+ }
946
+ }
947
+ class PepMultiSelectFilterComponent extends BaseFilterComponent {
948
+ constructor() {
949
+ super(...arguments);
950
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
951
+ this.options = [];
952
+ this.chooseTypeOptions = [];
953
+ this.searchControl = new FormControl();
954
+ //inline props
955
+ this.selected = '';
956
+ this.inlineOptions = [];
957
+ this.MAX_OPTIONS_TO_SHOW = 6.35;
958
+ this.numberOptionsToShowSearch = 10;
959
+ }
960
+ ngOnInit() {
961
+ super.ngOnInit;
962
+ if (this.inline) {
963
+ this.inlineControlInit();
964
+ this.setControlsWidth();
965
+ }
966
+ else {
967
+ this.noneInlineControlInit();
968
+ }
969
+ }
970
+ ngAfterViewInit() {
971
+ // Calc for the first time.
972
+ this.calcOptionsHeight(this.options.length);
973
+ }
974
+ inlineControlInit() {
975
+ //load options from field
976
+ this.inlineOptions = this.field?.options?.length > 0 ? this.field.options : [];
977
+ // init the selected values from first value.
978
+ if (this.firstControl?.value && Array.isArray(this.firstControl.value)) {
979
+ this.selected = this.firstControl.value.join(';');
980
+ }
981
+ }
982
+ noneInlineControlInit() {
983
+ if (this.field.options?.length > 0) {
984
+ this.options = this.field.options.map((opt) => {
985
+ return { value: opt.value, count: opt.count, selected: false };
986
+ });
987
+ }
988
+ else {
989
+ this.searchControl.disable();
990
+ }
991
+ // Init the selected values from first value.
992
+ const firstControl = this.firstControl;
993
+ if (firstControl.value) {
994
+ this.initOptionsSelectedValues(firstControl.value);
995
+ }
996
+ // Add subscription for the first value change to set the selected options.
997
+ firstControl.valueChanges
998
+ .pipe(this.getDestroyer(), distinctUntilChanged())
999
+ .subscribe((selectedValues) => {
1000
+ this.initOptionsSelectedValues(selectedValues);
1001
+ });
1002
+ // Filter the options by the search control.
1003
+ 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)));
1004
+ // Each time the filter change.
1005
+ this.filteredOptions$.subscribe((filterdOptions) => {
1006
+ this.calcOptionsHeight(filterdOptions.length);
1007
+ setTimeout(() => {
1008
+ // 8 is the padding top of the multi-select-options
1009
+ this.virtualScroller.scrollToPosition(-8);
1010
+ }, 125);
1011
+ });
1012
+ }
1013
+ initOptionsSelectedValues(selectedValues) {
1014
+ this.options.forEach((opt) => {
1015
+ const isValueSelected = selectedValues && selectedValues.includes(opt.value);
1016
+ opt.selected = isValueSelected;
1017
+ });
1018
+ }
1019
+ calcOptionsHeight(optionsCount) {
1020
+ if (this.optionsContainer) {
1021
+ const optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1022
+ ? this.MAX_OPTIONS_TO_SHOW
1023
+ : optionsCount;
1024
+ // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1025
+ const optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1026
+ this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1027
+ }
1028
+ }
1029
+ filterOptions(value) {
1030
+ const filterValue = value.toLowerCase();
1031
+ return this.options.filter((opt) => opt.value &&
1032
+ opt.value.toLowerCase().includes(filterValue.toLowerCase()));
1033
+ }
1034
+ // Override
1035
+ getDefaultOperator() {
1036
+ return PepSmartFilterOperators.In;
1037
+ }
1038
+ // Override
1039
+ getFilterValue() {
1040
+ if (this.inline) {
1041
+ return {
1042
+ first: this.firstControl.value
1043
+ };
1044
+ }
1045
+ else {
1046
+ const selectedValues = this.options
1047
+ .filter((opt) => opt.selected)
1048
+ .map((opt) => opt.value);
1049
+ const filterValue = {
1050
+ first: selectedValues,
1051
+ };
1052
+ return selectedValues.length > 0 ? filterValue : null;
1053
+ }
1054
+ }
1055
+ // Override
1056
+ loadOperatorsOptions() {
1057
+ this.chooseTypeOptions = this.operators.map((operator) => {
1058
+ return {
1059
+ key: operator.id,
1060
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1061
+ };
1062
+ });
1063
+ }
1064
+ setControlsWidth() {
1065
+ if (this.variableFieldOptions?.length) {
1066
+ this.operatorWidth = '38%';
1067
+ this.valueWidth = '62%';
1068
+ }
1069
+ else {
1070
+ this.valueWidth = '100%';
1071
+ }
1072
+ }
1073
+ onOperatorChanged(value) {
1074
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1075
+ this.operator = operator;
1076
+ if (this._parentForm) {
1077
+ this.updateParentForm();
1078
+ }
1079
+ if (this.emitOnChange) {
1080
+ this.applyFilter();
1081
+ }
1082
+ }
1083
+ // Override
1084
+ initFilter() {
1085
+ this.options.forEach((opt) => (opt.selected = false));
1086
+ this.searchControl.setValue('');
1087
+ }
1088
+ onOptionChange(option, event) {
1089
+ option.selected = event.checked;
1090
+ this.firstControl.setValue(this.options.filter((opt) => opt.selected).map((opt) => opt.value), { emitEvent: false });
1091
+ }
1092
+ onMultiSelectChanged(value) {
1093
+ if (value) {
1094
+ const selected = value.split(';');
1095
+ this.firstControl.setValue(selected);
1096
+ }
1097
+ else {
1098
+ this.firstControl.setValue(null);
1099
+ }
1100
+ if (this.emitOnChange) {
1101
+ this.applyFilter();
1102
+ }
1103
+ }
1104
+ onValueChanged(value) {
1105
+ this.firstControl.setValue(value);
1106
+ if (this.emitOnChange) {
1107
+ this.applyFilter();
1108
+ }
1109
+ }
1110
+ }
1111
+ PepMultiSelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1112
+ 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" }] });
1113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, decorators: [{
1114
+ type: Component,
1115
+ 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"] }]
1116
+ }], propDecorators: { optionsContainer: [{
1117
+ type: ViewChild,
1118
+ args: ['optionsContainer']
1119
+ }], virtualScroller: [{
1120
+ type: ViewChild,
1121
+ args: [VirtualScrollerComponent]
1122
1122
  }] } });
1123
1123
 
1124
- class PepNumberFilterComponent extends BaseFilterComponent {
1125
- constructor() {
1126
- super(...arguments);
1127
- this.PepSmartFilterOperators = PepSmartFilterOperators;
1128
- this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1129
- this.chooseTypeOptions = [];
1130
- this.operatorWidth = '38%';
1131
- this.fieldsWidth = '70%';
1132
- }
1133
- ngOnInit() {
1134
- this.firstControl.valueChanges
1135
- // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1136
- // .pipe(this.getDestroyer(), distinctUntilChanged((pre: any, curr: any) =>
1137
- // this.utilitiesService.isEqualNumber(pre, curr)
1138
- // ))
1139
- .pipe(this.getDestroyer(), distinctUntilChanged())
1140
- .subscribe(() => {
1141
- console.log(`firstControl.valueChanges - ${this.firstControl.value}`);
1142
- this.setFieldsStateAndValidators();
1143
- });
1144
- this.secondControl.valueChanges
1145
- .pipe(this.getDestroyer(), distinctUntilChanged())
1146
- // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1147
- .subscribe(() => {
1148
- this.setFieldsStateAndValidators();
1149
- });
1150
- this.setControlsWidth();
1151
- }
1152
- // Override
1153
- getDefaultOperator() {
1154
- return PepSmartFilterOperators.Equals;
1155
- }
1156
- // Override
1157
- getFilterValue() {
1158
- const filterValue = {
1159
- first: this.firstControl.value,
1160
- };
1161
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1162
- filterValue['second'] = this.secondControl.value;
1163
- }
1164
- return filterValue;
1165
- }
1166
- // Override
1167
- initFilter() {
1168
- setTimeout(() => {
1169
- if (this.emitOnChange) {
1170
- this.applyFilter();
1171
- }
1172
- }, 0);
1173
- }
1174
- // Override
1175
- loadOperatorsOptions() {
1176
- this.chooseTypeOptions = this.operators.map((operator) => {
1177
- return {
1178
- key: operator.id,
1179
- value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1180
- };
1181
- });
1182
- }
1183
- // Override
1184
- setFieldsStateAndValidators() {
1185
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1186
- const firstValidators = [Validators.required];
1187
- if (this.secondControl.value) {
1188
- firstValidators.push(this.validator.isLessThan(this.secondControl));
1189
- }
1190
- this.firstControl.setValidators(firstValidators);
1191
- this.firstControl.updateValueAndValidity();
1192
- this.secondControl.enable();
1193
- const secondValidators = [Validators.required];
1194
- if (this.firstControl.value) {
1195
- secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1196
- }
1197
- this.secondControl.setValidators(secondValidators);
1198
- this.secondControl.updateValueAndValidity();
1199
- }
1200
- else {
1201
- super.setFieldsStateAndValidators();
1202
- }
1203
- }
1204
- setControlsWidth() {
1205
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1206
- this.operatorWidth = '30%';
1207
- this.fieldsWidth = '70%';
1208
- }
1209
- else {
1210
- this.operatorWidth = '38%';
1211
- this.fieldsWidth = '62%';
1212
- }
1213
- }
1214
- onOperatorChanged(value) {
1215
- const operator = Object.values(this.operators).find((operator) => operator.id === value);
1216
- this.operator = operator;
1217
- if (this._parentForm) {
1218
- this.updateParentForm();
1219
- }
1220
- this.setControlsWidth();
1221
- setTimeout(() => {
1222
- if (this.emitOnChange) {
1223
- this.applyFilter();
1224
- }
1225
- }, 0);
1226
- }
1227
- onVariableChanged(value) {
1228
- this.firstControl.setValue(value);
1229
- if (this.emitOnChange) {
1230
- this.applyFilter();
1231
- }
1232
- }
1233
- onValueChanged() {
1234
- // this.firstControl.setValue(value);
1235
- console.log(`onValueChanged ${this.firstControl.value}`);
1236
- if (this.emitOnChange) {
1237
- this.applyFilter();
1238
- }
1239
- }
1240
- }
1241
- PepNumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1242
- 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" }] });
1243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, decorators: [{
1244
- type: Component,
1245
- 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>" }]
1124
+ class PepNumberFilterComponent extends BaseFilterComponent {
1125
+ constructor() {
1126
+ super(...arguments);
1127
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
1128
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1129
+ this.chooseTypeOptions = [];
1130
+ this.operatorWidth = '38%';
1131
+ this.fieldsWidth = '70%';
1132
+ }
1133
+ ngOnInit() {
1134
+ this.firstControl.valueChanges
1135
+ // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1136
+ // .pipe(this.getDestroyer(), distinctUntilChanged((pre: any, curr: any) =>
1137
+ // this.utilitiesService.isEqualNumber(pre, curr)
1138
+ // ))
1139
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1140
+ .subscribe(() => {
1141
+ console.log(`firstControl.valueChanges - ${this.firstControl.value}`);
1142
+ this.setFieldsStateAndValidators();
1143
+ });
1144
+ this.secondControl.valueChanges
1145
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1146
+ // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1147
+ .subscribe(() => {
1148
+ this.setFieldsStateAndValidators();
1149
+ });
1150
+ this.setControlsWidth();
1151
+ }
1152
+ // Override
1153
+ getDefaultOperator() {
1154
+ return PepSmartFilterOperators.Equals;
1155
+ }
1156
+ // Override
1157
+ getFilterValue() {
1158
+ const filterValue = {
1159
+ first: this.firstControl.value,
1160
+ };
1161
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1162
+ filterValue['second'] = this.secondControl.value;
1163
+ }
1164
+ return filterValue;
1165
+ }
1166
+ // Override
1167
+ initFilter() {
1168
+ setTimeout(() => {
1169
+ if (this.emitOnChange) {
1170
+ this.applyFilter();
1171
+ }
1172
+ }, 0);
1173
+ }
1174
+ // Override
1175
+ loadOperatorsOptions() {
1176
+ this.chooseTypeOptions = this.operators.map((operator) => {
1177
+ return {
1178
+ key: operator.id,
1179
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1180
+ };
1181
+ });
1182
+ }
1183
+ // Override
1184
+ setFieldsStateAndValidators() {
1185
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1186
+ const firstValidators = [Validators.required];
1187
+ if (this.secondControl.value) {
1188
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
1189
+ }
1190
+ this.firstControl.setValidators(firstValidators);
1191
+ this.firstControl.updateValueAndValidity();
1192
+ this.secondControl.enable();
1193
+ const secondValidators = [Validators.required];
1194
+ if (this.firstControl.value) {
1195
+ secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1196
+ }
1197
+ this.secondControl.setValidators(secondValidators);
1198
+ this.secondControl.updateValueAndValidity();
1199
+ }
1200
+ else {
1201
+ super.setFieldsStateAndValidators();
1202
+ }
1203
+ }
1204
+ setControlsWidth() {
1205
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1206
+ this.operatorWidth = '30%';
1207
+ this.fieldsWidth = '70%';
1208
+ }
1209
+ else {
1210
+ this.operatorWidth = '38%';
1211
+ this.fieldsWidth = '62%';
1212
+ }
1213
+ }
1214
+ onOperatorChanged(value) {
1215
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1216
+ this.operator = operator;
1217
+ if (this._parentForm) {
1218
+ this.updateParentForm();
1219
+ }
1220
+ this.setControlsWidth();
1221
+ setTimeout(() => {
1222
+ if (this.emitOnChange) {
1223
+ this.applyFilter();
1224
+ }
1225
+ }, 0);
1226
+ }
1227
+ onVariableChanged(value) {
1228
+ this.firstControl.setValue(value);
1229
+ if (this.emitOnChange) {
1230
+ this.applyFilter();
1231
+ }
1232
+ }
1233
+ onValueChanged() {
1234
+ // this.firstControl.setValue(value);
1235
+ console.log(`onValueChanged ${this.firstControl.value}`);
1236
+ if (this.emitOnChange) {
1237
+ this.applyFilter();
1238
+ }
1239
+ }
1240
+ }
1241
+ PepNumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1242
+ 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" }] });
1243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, decorators: [{
1244
+ type: Component,
1245
+ 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>" }]
1246
1246
  }] });
1247
1247
 
1248
- class PepSmartFiltersComponent {
1249
- constructor(hostElement, layoutService) {
1250
- this.hostElement = hostElement;
1251
- this.layoutService = layoutService;
1252
- this.title = '';
1253
- this.filtersDataMap = new Map();
1254
- this._filters = [];
1255
- this._fields = [];
1256
- this._useAsWebComponent = false;
1257
- // @Output()
1258
- // filtersClear: EventEmitter<void> = new EventEmitter<void>();
1259
- this.filtersChange = new EventEmitter();
1260
- this.fieldToggleChange = new EventEmitter();
1261
- this.expansionPanelHeaderHeight = '*';
1262
- }
1263
- set filters(value) {
1264
- this._filters = value;
1265
- this.setupFilters(value);
1266
- }
1267
- get filters() {
1268
- this._filters = [...this.filtersDataMap.keys()]
1269
- // .filter((key) => this.filtersDataMap.get(key) !== null)
1270
- .map((key) => {
1271
- if (key) {
1272
- return this.filtersDataMap.get(key);
1273
- }
1274
- });
1275
- return this._filters;
1276
- }
1277
- set fields(value) {
1278
- this._fields = value;
1279
- }
1280
- get fields() {
1281
- return this._fields;
1282
- }
1283
- set useAsWebComponent(value) {
1284
- if (value) {
1285
- this.exportFunctionsOnHostElement();
1286
- }
1287
- }
1288
- get useAsWebComponent() {
1289
- return this._useAsWebComponent;
1290
- }
1291
- exportFunctionsOnHostElement() {
1292
- // This is for web component usage for use those functions.
1293
- this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
1294
- this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
1295
- this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
1296
- }
1297
- setupFilters(value) {
1298
- this.filtersDataMap.clear();
1299
- if (value) {
1300
- value.forEach((filter) => {
1301
- // Validate before add the filter into the map.
1302
- let currentField = null;
1303
- if (this.fields && this.fields.length > 0) {
1304
- currentField = this.fields.find((field) => field.id === filter.fieldId);
1305
- }
1306
- if (currentField) {
1307
- // Only if the operator is from the same type
1308
- if (filter.operator.componentType.includes(currentField.componentType)) {
1309
- let isOperatorUnitValid = true;
1310
- if (filter.operatorUnit) {
1311
- // Only if the operator unit is not from the same type
1312
- if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
1313
- isOperatorUnitValid = false;
1314
- }
1315
- }
1316
- // Add the filter.
1317
- if (isOperatorUnitValid) {
1318
- this.filtersDataMap.set(filter.fieldId, filter);
1319
- }
1320
- }
1321
- }
1322
- });
1323
- }
1324
- }
1325
- raiseFiltersChange() {
1326
- this.filtersChange.emit(this.filters);
1327
- }
1328
- toggleField(index, isOpen) {
1329
- this.fields[index].isOpen = isOpen;
1330
- this.fieldToggleChange.emit(this.fields[index]);
1331
- }
1332
- clearFilters() {
1333
- this.filtersDataMap.clear();
1334
- }
1335
- clearFilter(fieldId) {
1336
- this.filtersDataMap.delete(fieldId);
1337
- }
1338
- // Clear all the filters and raise event that filters has change.
1339
- onFiltersClear() {
1340
- this.clearFilters();
1341
- this.raiseFiltersChange();
1342
- }
1343
- // Clear the filter and raise event that filters has change.
1344
- onFilterClear(field) {
1345
- this.clearFilter(field.id);
1346
- this.raiseFiltersChange();
1347
- }
1348
- // Set the filter and raise event that filters has change.
1349
- onFilterChange(field, filterData) {
1350
- this.clearFilter(field.id);
1351
- this.filtersDataMap.set(field.id, filterData);
1352
- this.raiseFiltersChange();
1353
- }
1354
- }
1355
- 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 });
1356
- 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 });
1357
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, decorators: [{
1358
- type: Component,
1359
- 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"] }]
1360
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.PepLayoutService }]; }, propDecorators: { title: [{
1361
- type: Input
1362
- }], filters: [{
1363
- type: Input
1364
- }], fields: [{
1365
- type: Input
1366
- }], useAsWebComponent: [{
1367
- type: Input
1368
- }], filtersChange: [{
1369
- type: Output
1370
- }], fieldToggleChange: [{
1371
- type: Output
1248
+ class PepSmartFiltersComponent {
1249
+ constructor(hostElement, layoutService) {
1250
+ this.hostElement = hostElement;
1251
+ this.layoutService = layoutService;
1252
+ this.title = '';
1253
+ this.filtersDataMap = new Map();
1254
+ this._filters = [];
1255
+ this._fields = [];
1256
+ this._useAsWebComponent = false;
1257
+ // @Output()
1258
+ // filtersClear: EventEmitter<void> = new EventEmitter<void>();
1259
+ this.filtersChange = new EventEmitter();
1260
+ this.fieldToggleChange = new EventEmitter();
1261
+ this.expansionPanelHeaderHeight = '*';
1262
+ }
1263
+ set filters(value) {
1264
+ this._filters = value;
1265
+ this.setupFilters(value);
1266
+ }
1267
+ get filters() {
1268
+ this._filters = [...this.filtersDataMap.keys()]
1269
+ // .filter((key) => this.filtersDataMap.get(key) !== null)
1270
+ .map((key) => {
1271
+ if (key) {
1272
+ return this.filtersDataMap.get(key);
1273
+ }
1274
+ });
1275
+ return this._filters;
1276
+ }
1277
+ set fields(value) {
1278
+ this._fields = value;
1279
+ }
1280
+ get fields() {
1281
+ return this._fields;
1282
+ }
1283
+ set useAsWebComponent(value) {
1284
+ if (value) {
1285
+ this.exportFunctionsOnHostElement();
1286
+ }
1287
+ }
1288
+ get useAsWebComponent() {
1289
+ return this._useAsWebComponent;
1290
+ }
1291
+ exportFunctionsOnHostElement() {
1292
+ // This is for web component usage for use those functions.
1293
+ this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
1294
+ this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
1295
+ this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
1296
+ }
1297
+ setupFilters(value) {
1298
+ this.filtersDataMap.clear();
1299
+ if (value) {
1300
+ value.forEach((filter) => {
1301
+ // Validate before add the filter into the map.
1302
+ let currentField = null;
1303
+ if (this.fields && this.fields.length > 0) {
1304
+ currentField = this.fields.find((field) => field.id === filter.fieldId);
1305
+ }
1306
+ if (currentField) {
1307
+ // Only if the operator is from the same type
1308
+ if (filter.operator.componentType.includes(currentField.componentType)) {
1309
+ let isOperatorUnitValid = true;
1310
+ if (filter.operatorUnit) {
1311
+ // Only if the operator unit is not from the same type
1312
+ if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
1313
+ isOperatorUnitValid = false;
1314
+ }
1315
+ }
1316
+ // Add the filter.
1317
+ if (isOperatorUnitValid) {
1318
+ this.filtersDataMap.set(filter.fieldId, filter);
1319
+ }
1320
+ }
1321
+ }
1322
+ });
1323
+ }
1324
+ }
1325
+ raiseFiltersChange() {
1326
+ this.filtersChange.emit(this.filters);
1327
+ }
1328
+ toggleField(index, isOpen) {
1329
+ this.fields[index].isOpen = isOpen;
1330
+ this.fieldToggleChange.emit(this.fields[index]);
1331
+ }
1332
+ clearFilters() {
1333
+ this.filtersDataMap.clear();
1334
+ }
1335
+ clearFilter(fieldId) {
1336
+ this.filtersDataMap.delete(fieldId);
1337
+ }
1338
+ // Clear all the filters and raise event that filters has change.
1339
+ onFiltersClear() {
1340
+ this.clearFilters();
1341
+ this.raiseFiltersChange();
1342
+ }
1343
+ // Clear the filter and raise event that filters has change.
1344
+ onFilterClear(field) {
1345
+ this.clearFilter(field.id);
1346
+ this.raiseFiltersChange();
1347
+ }
1348
+ // Set the filter and raise event that filters has change.
1349
+ onFilterChange(field, filterData) {
1350
+ this.clearFilter(field.id);
1351
+ this.filtersDataMap.set(field.id, filterData);
1352
+ this.raiseFiltersChange();
1353
+ }
1354
+ }
1355
+ 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 });
1356
+ 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 });
1357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, decorators: [{
1358
+ type: Component,
1359
+ 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"] }]
1360
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.PepLayoutService }]; }, propDecorators: { title: [{
1361
+ type: Input
1362
+ }], filters: [{
1363
+ type: Input
1364
+ }], fields: [{
1365
+ type: Input
1366
+ }], useAsWebComponent: [{
1367
+ type: Input
1368
+ }], filtersChange: [{
1369
+ type: Output
1370
+ }], fieldToggleChange: [{
1371
+ type: Output
1372
1372
  }] } });
1373
1373
 
1374
- class PepSmartFiltersModule {
1375
- constructor(pepIconRegistry) {
1376
- this.pepIconRegistry = pepIconRegistry;
1377
- this.pepIconRegistry.registerIcons([
1378
- pepIconNumberMinus,
1379
- pepIconNumberPlus,
1380
- ]);
1381
- }
1382
- }
1383
- 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 });
1384
- PepSmartFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, declarations: [
1385
- // BaseFilterComponent,
1386
- PepSmartFiltersComponent,
1387
- PepFilterActionsComponent,
1388
- PepTextFilterComponent,
1389
- PepBooleanFilterComponent,
1390
- PepDateFilterComponent,
1391
- PepMultiSelectFilterComponent,
1392
- PepNumberFilterComponent], imports: [CommonModule,
1393
- ReactiveFormsModule,
1394
- FlexLayoutModule,
1395
- // Material modules
1396
- MatCommonModule,
1397
- MatCheckboxModule,
1398
- MatChipsModule,
1399
- MatExpansionModule,
1400
- MatIconModule,
1401
- MatFormFieldModule,
1402
- MatInputModule,
1403
- MatRadioModule,
1404
- // External modules
1405
- VirtualScrollerModule,
1406
- // ngx-lib modules
1407
- PepNgxLibModule,
1408
- PepCheckboxModule,
1409
- PepDateModule,
1410
- PepSelectModule,
1411
- PepTextboxModule,
1412
- PepSearchModule,
1413
- PepIconModule,
1414
- PepButtonModule,
1415
- PepGroupButtonsModule], exports: [PepSmartFiltersComponent,
1416
- PepTextFilterComponent,
1417
- PepBooleanFilterComponent,
1418
- PepDateFilterComponent,
1419
- PepMultiSelectFilterComponent,
1420
- PepNumberFilterComponent] });
1421
- PepSmartFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, providers: [
1422
- FormBuilder
1423
- ], imports: [CommonModule,
1424
- ReactiveFormsModule,
1425
- FlexLayoutModule,
1426
- // Material modules
1427
- MatCommonModule,
1428
- MatCheckboxModule,
1429
- MatChipsModule,
1430
- MatExpansionModule,
1431
- MatIconModule,
1432
- MatFormFieldModule,
1433
- MatInputModule,
1434
- MatRadioModule,
1435
- // External modules
1436
- VirtualScrollerModule,
1437
- // ngx-lib modules
1438
- PepNgxLibModule,
1439
- PepCheckboxModule,
1440
- PepDateModule,
1441
- PepSelectModule,
1442
- PepTextboxModule,
1443
- PepSearchModule,
1444
- PepIconModule,
1445
- PepButtonModule,
1446
- PepGroupButtonsModule] });
1447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, decorators: [{
1448
- type: NgModule,
1449
- args: [{
1450
- imports: [
1451
- CommonModule,
1452
- ReactiveFormsModule,
1453
- FlexLayoutModule,
1454
- // Material modules
1455
- MatCommonModule,
1456
- MatCheckboxModule,
1457
- MatChipsModule,
1458
- MatExpansionModule,
1459
- MatIconModule,
1460
- MatFormFieldModule,
1461
- MatInputModule,
1462
- MatRadioModule,
1463
- // External modules
1464
- VirtualScrollerModule,
1465
- // ngx-lib modules
1466
- PepNgxLibModule,
1467
- PepCheckboxModule,
1468
- PepDateModule,
1469
- PepSelectModule,
1470
- PepTextboxModule,
1471
- PepSearchModule,
1472
- PepIconModule,
1473
- PepButtonModule,
1474
- PepGroupButtonsModule
1475
- ],
1476
- exports: [
1477
- PepSmartFiltersComponent,
1478
- PepTextFilterComponent,
1479
- PepBooleanFilterComponent,
1480
- PepDateFilterComponent,
1481
- PepMultiSelectFilterComponent,
1482
- PepNumberFilterComponent
1483
- ],
1484
- declarations: [
1485
- // BaseFilterComponent,
1486
- PepSmartFiltersComponent,
1487
- PepFilterActionsComponent,
1488
- PepTextFilterComponent,
1489
- PepBooleanFilterComponent,
1490
- PepDateFilterComponent,
1491
- PepMultiSelectFilterComponent,
1492
- PepNumberFilterComponent
1493
- ],
1494
- providers: [
1495
- FormBuilder
1496
- ]
1497
- }]
1374
+ class PepSmartFiltersModule {
1375
+ constructor(pepIconRegistry) {
1376
+ this.pepIconRegistry = pepIconRegistry;
1377
+ this.pepIconRegistry.registerIcons([
1378
+ pepIconNumberMinus,
1379
+ pepIconNumberPlus,
1380
+ ]);
1381
+ }
1382
+ }
1383
+ 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 });
1384
+ PepSmartFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, declarations: [
1385
+ // BaseFilterComponent,
1386
+ PepSmartFiltersComponent,
1387
+ PepFilterActionsComponent,
1388
+ PepTextFilterComponent,
1389
+ PepBooleanFilterComponent,
1390
+ PepDateFilterComponent,
1391
+ PepMultiSelectFilterComponent,
1392
+ PepNumberFilterComponent], imports: [CommonModule,
1393
+ ReactiveFormsModule,
1394
+ FlexLayoutModule,
1395
+ // Material modules
1396
+ MatCommonModule,
1397
+ MatCheckboxModule,
1398
+ MatChipsModule,
1399
+ MatExpansionModule,
1400
+ MatIconModule,
1401
+ MatFormFieldModule,
1402
+ MatInputModule,
1403
+ MatRadioModule,
1404
+ // External modules
1405
+ VirtualScrollerModule,
1406
+ // ngx-lib modules
1407
+ PepNgxLibModule,
1408
+ PepCheckboxModule,
1409
+ PepDateModule,
1410
+ PepSelectModule,
1411
+ PepTextboxModule,
1412
+ PepSearchModule,
1413
+ PepIconModule,
1414
+ PepButtonModule,
1415
+ PepGroupButtonsModule], exports: [PepSmartFiltersComponent,
1416
+ PepTextFilterComponent,
1417
+ PepBooleanFilterComponent,
1418
+ PepDateFilterComponent,
1419
+ PepMultiSelectFilterComponent,
1420
+ PepNumberFilterComponent] });
1421
+ PepSmartFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, providers: [
1422
+ FormBuilder
1423
+ ], imports: [CommonModule,
1424
+ ReactiveFormsModule,
1425
+ FlexLayoutModule,
1426
+ // Material modules
1427
+ MatCommonModule,
1428
+ MatCheckboxModule,
1429
+ MatChipsModule,
1430
+ MatExpansionModule,
1431
+ MatIconModule,
1432
+ MatFormFieldModule,
1433
+ MatInputModule,
1434
+ MatRadioModule,
1435
+ // External modules
1436
+ VirtualScrollerModule,
1437
+ // ngx-lib modules
1438
+ PepNgxLibModule,
1439
+ PepCheckboxModule,
1440
+ PepDateModule,
1441
+ PepSelectModule,
1442
+ PepTextboxModule,
1443
+ PepSearchModule,
1444
+ PepIconModule,
1445
+ PepButtonModule,
1446
+ PepGroupButtonsModule] });
1447
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, decorators: [{
1448
+ type: NgModule,
1449
+ args: [{
1450
+ imports: [
1451
+ CommonModule,
1452
+ ReactiveFormsModule,
1453
+ FlexLayoutModule,
1454
+ // Material modules
1455
+ MatCommonModule,
1456
+ MatCheckboxModule,
1457
+ MatChipsModule,
1458
+ MatExpansionModule,
1459
+ MatIconModule,
1460
+ MatFormFieldModule,
1461
+ MatInputModule,
1462
+ MatRadioModule,
1463
+ // External modules
1464
+ VirtualScrollerModule,
1465
+ // ngx-lib modules
1466
+ PepNgxLibModule,
1467
+ PepCheckboxModule,
1468
+ PepDateModule,
1469
+ PepSelectModule,
1470
+ PepTextboxModule,
1471
+ PepSearchModule,
1472
+ PepIconModule,
1473
+ PepButtonModule,
1474
+ PepGroupButtonsModule
1475
+ ],
1476
+ exports: [
1477
+ PepSmartFiltersComponent,
1478
+ PepTextFilterComponent,
1479
+ PepBooleanFilterComponent,
1480
+ PepDateFilterComponent,
1481
+ PepMultiSelectFilterComponent,
1482
+ PepNumberFilterComponent
1483
+ ],
1484
+ declarations: [
1485
+ // BaseFilterComponent,
1486
+ PepSmartFiltersComponent,
1487
+ PepFilterActionsComponent,
1488
+ PepTextFilterComponent,
1489
+ PepBooleanFilterComponent,
1490
+ PepDateFilterComponent,
1491
+ PepMultiSelectFilterComponent,
1492
+ PepNumberFilterComponent
1493
+ ],
1494
+ providers: [
1495
+ FormBuilder
1496
+ ]
1497
+ }]
1498
1498
  }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
1499
1499
 
1500
- // Base field
1501
- // ------------------------------
1502
- class PepSmartFilterBaseField {
1503
- constructor(field) {
1504
- this.id = field.id;
1505
- this.name = field.name;
1506
- this.isOpen = field.isOpen;
1507
- this.options = field.options;
1508
- this.operators = field.operators;
1509
- this.operatorUnits = field.operatorUnits;
1510
- this._type = this.getType();
1511
- }
1512
- get componentType() {
1513
- return this._componentType;
1514
- }
1515
- get type() {
1516
- return this._type;
1517
- }
1518
- }
1519
- // Text field
1520
- // ------------------------------
1521
- class PepSmartFilterTextField extends PepSmartFilterBaseField {
1522
- constructor(field) {
1523
- super(field);
1524
- this._componentType = 'text';
1525
- }
1526
- getType() {
1527
- return 'text';
1528
- }
1529
- }
1530
- // Boolean field
1531
- // ------------------------------
1532
- class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
1533
- constructor(field) {
1534
- super(field);
1535
- this._componentType = 'boolean';
1536
- }
1537
- getType() {
1538
- return 'boolean';
1539
- }
1540
- }
1541
- // Date fields
1542
- // ------------------------------
1543
- class PepSmartFilterDateBaseField extends PepSmartFilterBaseField {
1544
- constructor(field) {
1545
- super(field);
1546
- this._componentType = 'date';
1547
- }
1548
- }
1549
- class PepSmartFilterDateField extends PepSmartFilterDateBaseField {
1550
- constructor(field) {
1551
- super(field);
1552
- }
1553
- getType() {
1554
- return 'date';
1555
- }
1556
- }
1557
- class PepSmartFilterDateTimeField extends PepSmartFilterDateBaseField {
1558
- constructor(field) {
1559
- super(field);
1560
- }
1561
- getType() {
1562
- return 'date-time';
1563
- }
1564
- }
1565
- // Multi select field
1566
- // ------------------------------
1567
- class PepSmartFilterMultiSelectField extends PepSmartFilterBaseField {
1568
- constructor(field) {
1569
- super(field);
1570
- this._componentType = 'multi-select';
1571
- }
1572
- getType() {
1573
- return 'multi-select';
1574
- }
1575
- }
1576
- // Number fields
1577
- // ------------------------------
1578
- class PepSmartFilterNumberBaseField extends PepSmartFilterBaseField {
1579
- constructor(field) {
1580
- super(field);
1581
- this._componentType = 'number';
1582
- }
1583
- }
1584
- class PepSmartFilterIntField extends PepSmartFilterNumberBaseField {
1585
- constructor(field) {
1586
- super(field);
1587
- }
1588
- getType() {
1589
- return 'int';
1590
- }
1591
- }
1592
- class PepSmartFilterRealField extends PepSmartFilterNumberBaseField {
1593
- constructor(field) {
1594
- super(field);
1595
- }
1596
- getType() {
1597
- return 'real';
1598
- }
1599
- }
1600
- class PepSmartFilterCurrencyField extends PepSmartFilterNumberBaseField {
1601
- constructor(field) {
1602
- super(field);
1603
- }
1604
- getType() {
1605
- return 'currency';
1606
- }
1607
- }
1608
- class PepSmartFilterPercentageField extends PepSmartFilterNumberBaseField {
1609
- constructor(field) {
1610
- super(field);
1611
- }
1612
- getType() {
1613
- return 'percentage';
1614
- }
1500
+ // Base field
1501
+ // ------------------------------
1502
+ class PepSmartFilterBaseField {
1503
+ constructor(field) {
1504
+ this.id = field.id;
1505
+ this.name = field.name;
1506
+ this.isOpen = field.isOpen;
1507
+ this.options = field.options;
1508
+ this.operators = field.operators;
1509
+ this.operatorUnits = field.operatorUnits;
1510
+ this._type = this.getType();
1511
+ }
1512
+ get componentType() {
1513
+ return this._componentType;
1514
+ }
1515
+ get type() {
1516
+ return this._type;
1517
+ }
1518
+ }
1519
+ // Text field
1520
+ // ------------------------------
1521
+ class PepSmartFilterTextField extends PepSmartFilterBaseField {
1522
+ constructor(field) {
1523
+ super(field);
1524
+ this._componentType = 'text';
1525
+ }
1526
+ getType() {
1527
+ return 'text';
1528
+ }
1529
+ }
1530
+ // Boolean field
1531
+ // ------------------------------
1532
+ class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
1533
+ constructor(field) {
1534
+ super(field);
1535
+ this._componentType = 'boolean';
1536
+ }
1537
+ getType() {
1538
+ return 'boolean';
1539
+ }
1540
+ }
1541
+ // Date fields
1542
+ // ------------------------------
1543
+ class PepSmartFilterDateBaseField extends PepSmartFilterBaseField {
1544
+ constructor(field) {
1545
+ super(field);
1546
+ this._componentType = 'date';
1547
+ }
1548
+ }
1549
+ class PepSmartFilterDateField extends PepSmartFilterDateBaseField {
1550
+ constructor(field) {
1551
+ super(field);
1552
+ }
1553
+ getType() {
1554
+ return 'date';
1555
+ }
1556
+ }
1557
+ class PepSmartFilterDateTimeField extends PepSmartFilterDateBaseField {
1558
+ constructor(field) {
1559
+ super(field);
1560
+ }
1561
+ getType() {
1562
+ return 'date-time';
1563
+ }
1564
+ }
1565
+ // Multi select field
1566
+ // ------------------------------
1567
+ class PepSmartFilterMultiSelectField extends PepSmartFilterBaseField {
1568
+ constructor(field) {
1569
+ super(field);
1570
+ this._componentType = 'multi-select';
1571
+ }
1572
+ getType() {
1573
+ return 'multi-select';
1574
+ }
1575
+ }
1576
+ // Number fields
1577
+ // ------------------------------
1578
+ class PepSmartFilterNumberBaseField extends PepSmartFilterBaseField {
1579
+ constructor(field) {
1580
+ super(field);
1581
+ this._componentType = 'number';
1582
+ }
1583
+ }
1584
+ class PepSmartFilterIntField extends PepSmartFilterNumberBaseField {
1585
+ constructor(field) {
1586
+ super(field);
1587
+ }
1588
+ getType() {
1589
+ return 'int';
1590
+ }
1591
+ }
1592
+ class PepSmartFilterRealField extends PepSmartFilterNumberBaseField {
1593
+ constructor(field) {
1594
+ super(field);
1595
+ }
1596
+ getType() {
1597
+ return 'real';
1598
+ }
1599
+ }
1600
+ class PepSmartFilterCurrencyField extends PepSmartFilterNumberBaseField {
1601
+ constructor(field) {
1602
+ super(field);
1603
+ }
1604
+ getType() {
1605
+ return 'currency';
1606
+ }
1607
+ }
1608
+ class PepSmartFilterPercentageField extends PepSmartFilterNumberBaseField {
1609
+ constructor(field) {
1610
+ super(field);
1611
+ }
1612
+ getType() {
1613
+ return 'percentage';
1614
+ }
1615
1615
  }
1616
1616
 
1617
- function createTextSmartFilterField(data) {
1618
- return new PepSmartFilterTextField(data);
1619
- }
1620
- function createBooleanSmartFilterField(data) {
1621
- return new PepSmartFilterBooleanField(data);
1622
- }
1623
- function createDateSmartFilterField(data) {
1624
- return new PepSmartFilterDateField(data);
1625
- }
1626
- function createDateTimeSmartFilterField(data) {
1627
- return new PepSmartFilterDateTimeField(data);
1628
- }
1629
- function createMultiSelectSmartFilterField(data) {
1630
- return new PepSmartFilterMultiSelectField(data);
1631
- }
1632
- function createIntSmartFilterField(data) {
1633
- return new PepSmartFilterIntField(data);
1634
- }
1635
- function createRealSmartFilterField(data) {
1636
- return new PepSmartFilterRealField(data);
1637
- }
1638
- function createCurrencySmartFilterField(data) {
1639
- return new PepSmartFilterCurrencyField(data);
1640
- }
1641
- function createPercentageSmartFilterField(data) {
1642
- return new PepSmartFilterPercentageField(data);
1643
- }
1644
- function createSmartFilterField(data, type) {
1645
- let field;
1646
- switch (type) {
1647
- case 'text':
1648
- field = createTextSmartFilterField(data);
1649
- break;
1650
- case 'boolean':
1651
- field = createBooleanSmartFilterField(data);
1652
- break;
1653
- case 'date':
1654
- field = createDateSmartFilterField(data);
1655
- break;
1656
- case 'date-time':
1657
- field = createDateTimeSmartFilterField(data);
1658
- break;
1659
- case 'multi-select':
1660
- field = createMultiSelectSmartFilterField(data);
1661
- break;
1662
- case 'int':
1663
- field = createIntSmartFilterField(data);
1664
- break;
1665
- case 'real':
1666
- field = createRealSmartFilterField(data);
1667
- break;
1668
- case 'currency':
1669
- field = createCurrencySmartFilterField(data);
1670
- break;
1671
- case 'percentage':
1672
- field = createPercentageSmartFilterField(data);
1673
- break;
1674
- default:
1675
- field = createMultiSelectSmartFilterField(data);
1676
- break;
1677
- }
1678
- return field;
1679
- }
1680
- function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1681
- return {
1682
- fieldId: fieldId,
1683
- operator: operator,
1684
- operatorUnit: operatorUnit,
1685
- value: {
1686
- first: first,
1687
- second: second,
1688
- },
1689
- };
1617
+ function createTextSmartFilterField(data) {
1618
+ return new PepSmartFilterTextField(data);
1619
+ }
1620
+ function createBooleanSmartFilterField(data) {
1621
+ return new PepSmartFilterBooleanField(data);
1622
+ }
1623
+ function createDateSmartFilterField(data) {
1624
+ return new PepSmartFilterDateField(data);
1625
+ }
1626
+ function createDateTimeSmartFilterField(data) {
1627
+ return new PepSmartFilterDateTimeField(data);
1628
+ }
1629
+ function createMultiSelectSmartFilterField(data) {
1630
+ return new PepSmartFilterMultiSelectField(data);
1631
+ }
1632
+ function createIntSmartFilterField(data) {
1633
+ return new PepSmartFilterIntField(data);
1634
+ }
1635
+ function createRealSmartFilterField(data) {
1636
+ return new PepSmartFilterRealField(data);
1637
+ }
1638
+ function createCurrencySmartFilterField(data) {
1639
+ return new PepSmartFilterCurrencyField(data);
1640
+ }
1641
+ function createPercentageSmartFilterField(data) {
1642
+ return new PepSmartFilterPercentageField(data);
1643
+ }
1644
+ function createSmartFilterField(data, type) {
1645
+ let field;
1646
+ switch (type) {
1647
+ case 'text':
1648
+ field = createTextSmartFilterField(data);
1649
+ break;
1650
+ case 'boolean':
1651
+ field = createBooleanSmartFilterField(data);
1652
+ break;
1653
+ case 'date':
1654
+ field = createDateSmartFilterField(data);
1655
+ break;
1656
+ case 'date-time':
1657
+ field = createDateTimeSmartFilterField(data);
1658
+ break;
1659
+ case 'multi-select':
1660
+ field = createMultiSelectSmartFilterField(data);
1661
+ break;
1662
+ case 'int':
1663
+ field = createIntSmartFilterField(data);
1664
+ break;
1665
+ case 'real':
1666
+ field = createRealSmartFilterField(data);
1667
+ break;
1668
+ case 'currency':
1669
+ field = createCurrencySmartFilterField(data);
1670
+ break;
1671
+ case 'percentage':
1672
+ field = createPercentageSmartFilterField(data);
1673
+ break;
1674
+ default:
1675
+ field = createMultiSelectSmartFilterField(data);
1676
+ break;
1677
+ }
1678
+ return field;
1679
+ }
1680
+ function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1681
+ return {
1682
+ fieldId: fieldId,
1683
+ operator: operator,
1684
+ operatorUnit: operatorUnit,
1685
+ value: {
1686
+ first: first,
1687
+ second: second,
1688
+ },
1689
+ };
1690
1690
  }
1691
1691
 
1692
- /*
1693
- * Public API Surface of ngx-lib/smart-filters
1692
+ /*
1693
+ * Public API Surface of ngx-lib/smart-filters
1694
1694
  */
1695
1695
 
1696
- /**
1697
- * Generated bundle index. Do not edit.
1696
+ /**
1697
+ * Generated bundle index. Do not edit.
1698
1698
  */
1699
1699
 
1700
1700
  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 };