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

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