@pepperi-addons/ngx-lib 0.3.15-beta.19 → 0.3.15-beta.21

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