@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
@@ -4,1972 +4,2008 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['pepperi-addons'] = global['pepperi-addons'] || {}, global['pepperi-addons']['ngx-lib'] = global['pepperi-addons']['ngx-lib'] || {}, global['pepperi-addons']['ngx-lib']['smart-filters'] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.flexLayout, global.ng.material.core, global.ng.material.checkbox, global.ng.material.chips, global.ng.material.expansion, global.ng.material.icon, global.ng.material.formField, global.ng.material.input, global.ng.material.radio, global.ngxVirtualScroller, global['pepperi-addons']['ngx-lib'], global['pepperi-addons']['ngx-lib'].checkbox, global['pepperi-addons']['ngx-lib'].date, global['pepperi-addons']['ngx-lib'].select, global['pepperi-addons']['ngx-lib'].textbox, global['pepperi-addons']['ngx-lib'].search, global['pepperi-addons']['ngx-lib'].button, global['pepperi-addons']['ngx-lib'].icon, global['pepperi-addons']['ngx-lib']['group-buttons'], global.rxjs.operators, global.rxjs, global.translate));
5
5
  }(this, (function (exports, core, common, forms, flexLayout, core$2, checkbox, chips, expansion, icon$1, formField, input, radio, ngxVirtualScroller, ngxLib, checkbox$1, date, select, textbox, search, button, icon, groupButtons, operators, rxjs, core$1) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
- var __assign = function () {
38
- __assign = Object.assign || function __assign(t) {
39
- for (var s, i = 1, n = arguments.length; i < n; i++) {
40
- s = arguments[i];
41
- for (var p in s)
42
- if (Object.prototype.hasOwnProperty.call(s, p))
43
- t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s)
52
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
- t[p] = s[p];
54
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
- t[p[i]] = s[p[i]];
58
- }
59
- return t;
60
- }
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
- r = Reflect.decorate(decorators, target, key, desc);
65
- else
66
- for (var i = decorators.length - 1; i >= 0; i--)
67
- if (d = decorators[i])
68
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
- return c > 3 && r && Object.defineProperty(target, key, r), r;
70
- }
71
- function __param(paramIndex, decorator) {
72
- return function (target, key) { decorator(target, key, paramIndex); };
73
- }
74
- function __metadata(metadataKey, metadataValue) {
75
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76
- return Reflect.metadata(metadataKey, metadataValue);
77
- }
78
- function __awaiter(thisArg, _arguments, P, generator) {
79
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
- return new (P || (P = Promise))(function (resolve, reject) {
81
- function fulfilled(value) { try {
82
- step(generator.next(value));
83
- }
84
- catch (e) {
85
- reject(e);
86
- } }
87
- function rejected(value) { try {
88
- step(generator["throw"](value));
89
- }
90
- catch (e) {
91
- reject(e);
92
- } }
93
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94
- step((generator = generator.apply(thisArg, _arguments || [])).next());
95
- });
96
- }
97
- function __generator(thisArg, body) {
98
- var _ = { label: 0, sent: function () { if (t[0] & 1)
99
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101
- function verb(n) { return function (v) { return step([n, v]); }; }
102
- function step(op) {
103
- if (f)
104
- throw new TypeError("Generator is already executing.");
105
- while (_)
106
- try {
107
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108
- return t;
109
- if (y = 0, t)
110
- op = [op[0] & 2, t.value];
111
- switch (op[0]) {
112
- case 0:
113
- case 1:
114
- t = op;
115
- break;
116
- case 4:
117
- _.label++;
118
- return { value: op[1], done: false };
119
- case 5:
120
- _.label++;
121
- y = op[1];
122
- op = [0];
123
- continue;
124
- case 7:
125
- op = _.ops.pop();
126
- _.trys.pop();
127
- continue;
128
- default:
129
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130
- _ = 0;
131
- continue;
132
- }
133
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134
- _.label = op[1];
135
- break;
136
- }
137
- if (op[0] === 6 && _.label < t[1]) {
138
- _.label = t[1];
139
- t = op;
140
- break;
141
- }
142
- if (t && _.label < t[2]) {
143
- _.label = t[2];
144
- _.ops.push(op);
145
- break;
146
- }
147
- if (t[2])
148
- _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- }
152
- op = body.call(thisArg, _);
153
- }
154
- catch (e) {
155
- op = [6, e];
156
- y = 0;
157
- }
158
- finally {
159
- f = t = 0;
160
- }
161
- if (op[0] & 5)
162
- throw op[1];
163
- return { value: op[0] ? op[1] : void 0, done: true };
164
- }
165
- }
166
- var __createBinding = Object.create ? (function (o, m, k, k2) {
167
- if (k2 === undefined)
168
- k2 = k;
169
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170
- }) : (function (o, m, k, k2) {
171
- if (k2 === undefined)
172
- k2 = k;
173
- o[k2] = m[k];
174
- });
175
- function __exportStar(m, o) {
176
- for (var p in m)
177
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178
- __createBinding(o, m, p);
179
- }
180
- function __values(o) {
181
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182
- if (m)
183
- return m.call(o);
184
- if (o && typeof o.length === "number")
185
- return {
186
- next: function () {
187
- if (o && i >= o.length)
188
- o = void 0;
189
- return { value: o && o[i++], done: !o };
190
- }
191
- };
192
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193
- }
194
- function __read(o, n) {
195
- var m = typeof Symbol === "function" && o[Symbol.iterator];
196
- if (!m)
197
- return o;
198
- var i = m.call(o), r, ar = [], e;
199
- try {
200
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201
- ar.push(r.value);
202
- }
203
- catch (error) {
204
- e = { error: error };
205
- }
206
- finally {
207
- try {
208
- if (r && !r.done && (m = i["return"]))
209
- m.call(i);
210
- }
211
- finally {
212
- if (e)
213
- throw e.error;
214
- }
215
- }
216
- return ar;
217
- }
218
- /** @deprecated */
219
- function __spread() {
220
- for (var ar = [], i = 0; i < arguments.length; i++)
221
- ar = ar.concat(__read(arguments[i]));
222
- return ar;
223
- }
224
- /** @deprecated */
225
- function __spreadArrays() {
226
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
- s += arguments[i].length;
228
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
- r[k] = a[j];
231
- return r;
232
- }
233
- function __spreadArray(to, from) {
234
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
- to[j] = from[i];
236
- return to;
237
- }
238
- function __await(v) {
239
- return this instanceof __await ? (this.v = v, this) : new __await(v);
240
- }
241
- function __asyncGenerator(thisArg, _arguments, generator) {
242
- if (!Symbol.asyncIterator)
243
- throw new TypeError("Symbol.asyncIterator is not defined.");
244
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
245
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
246
- function verb(n) { if (g[n])
247
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
248
- function resume(n, v) { try {
249
- step(g[n](v));
250
- }
251
- catch (e) {
252
- settle(q[0][3], e);
253
- } }
254
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
255
- function fulfill(value) { resume("next", value); }
256
- function reject(value) { resume("throw", value); }
257
- function settle(f, v) { if (f(v), q.shift(), q.length)
258
- resume(q[0][0], q[0][1]); }
259
- }
260
- function __asyncDelegator(o) {
261
- var i, p;
262
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
263
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
264
- }
265
- function __asyncValues(o) {
266
- if (!Symbol.asyncIterator)
267
- throw new TypeError("Symbol.asyncIterator is not defined.");
268
- var m = o[Symbol.asyncIterator], i;
269
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
270
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
271
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
272
- }
273
- function __makeTemplateObject(cooked, raw) {
274
- if (Object.defineProperty) {
275
- Object.defineProperty(cooked, "raw", { value: raw });
276
- }
277
- else {
278
- cooked.raw = raw;
279
- }
280
- return cooked;
281
- }
282
- ;
283
- var __setModuleDefault = Object.create ? (function (o, v) {
284
- Object.defineProperty(o, "default", { enumerable: true, value: v });
285
- }) : function (o, v) {
286
- o["default"] = v;
287
- };
288
- function __importStar(mod) {
289
- if (mod && mod.__esModule)
290
- return mod;
291
- var result = {};
292
- if (mod != null)
293
- for (var k in mod)
294
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
295
- __createBinding(result, mod, k);
296
- __setModuleDefault(result, mod);
297
- return result;
298
- }
299
- function __importDefault(mod) {
300
- return (mod && mod.__esModule) ? mod : { default: mod };
301
- }
302
- function __classPrivateFieldGet(receiver, state, kind, f) {
303
- if (kind === "a" && !f)
304
- throw new TypeError("Private accessor was defined without a getter");
305
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
306
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
307
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
308
- }
309
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
310
- if (kind === "m")
311
- throw new TypeError("Private method is not writable");
312
- if (kind === "a" && !f)
313
- throw new TypeError("Private accessor was defined without a setter");
314
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
315
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
316
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+ var extendStatics = function (d, b) {
23
+ extendStatics = Object.setPrototypeOf ||
24
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
+ function (d, b) { for (var p in b)
26
+ if (Object.prototype.hasOwnProperty.call(b, p))
27
+ d[p] = b[p]; };
28
+ return extendStatics(d, b);
29
+ };
30
+ function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
+ extendStatics(d, b);
34
+ function __() { this.constructor = d; }
35
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
+ }
37
+ var __assign = function () {
38
+ __assign = Object.assign || function __assign(t) {
39
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
40
+ s = arguments[i];
41
+ for (var p in s)
42
+ if (Object.prototype.hasOwnProperty.call(s, p))
43
+ t[p] = s[p];
44
+ }
45
+ return t;
46
+ };
47
+ return __assign.apply(this, arguments);
48
+ };
49
+ function __rest(s, e) {
50
+ var t = {};
51
+ for (var p in s)
52
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
+ t[p] = s[p];
54
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
+ t[p[i]] = s[p[i]];
58
+ }
59
+ return t;
60
+ }
61
+ function __decorate(decorators, target, key, desc) {
62
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
+ r = Reflect.decorate(decorators, target, key, desc);
65
+ else
66
+ for (var i = decorators.length - 1; i >= 0; i--)
67
+ if (d = decorators[i])
68
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
70
+ }
71
+ function __param(paramIndex, decorator) {
72
+ return function (target, key) { decorator(target, key, paramIndex); };
73
+ }
74
+ function __metadata(metadataKey, metadataValue) {
75
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76
+ return Reflect.metadata(metadataKey, metadataValue);
77
+ }
78
+ function __awaiter(thisArg, _arguments, P, generator) {
79
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
+ return new (P || (P = Promise))(function (resolve, reject) {
81
+ function fulfilled(value) { try {
82
+ step(generator.next(value));
83
+ }
84
+ catch (e) {
85
+ reject(e);
86
+ } }
87
+ function rejected(value) { try {
88
+ step(generator["throw"](value));
89
+ }
90
+ catch (e) {
91
+ reject(e);
92
+ } }
93
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
95
+ });
96
+ }
97
+ function __generator(thisArg, body) {
98
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
99
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101
+ function verb(n) { return function (v) { return step([n, v]); }; }
102
+ function step(op) {
103
+ if (f)
104
+ throw new TypeError("Generator is already executing.");
105
+ while (_)
106
+ try {
107
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108
+ return t;
109
+ if (y = 0, t)
110
+ op = [op[0] & 2, t.value];
111
+ switch (op[0]) {
112
+ case 0:
113
+ case 1:
114
+ t = op;
115
+ break;
116
+ case 4:
117
+ _.label++;
118
+ return { value: op[1], done: false };
119
+ case 5:
120
+ _.label++;
121
+ y = op[1];
122
+ op = [0];
123
+ continue;
124
+ case 7:
125
+ op = _.ops.pop();
126
+ _.trys.pop();
127
+ continue;
128
+ default:
129
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130
+ _ = 0;
131
+ continue;
132
+ }
133
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134
+ _.label = op[1];
135
+ break;
136
+ }
137
+ if (op[0] === 6 && _.label < t[1]) {
138
+ _.label = t[1];
139
+ t = op;
140
+ break;
141
+ }
142
+ if (t && _.label < t[2]) {
143
+ _.label = t[2];
144
+ _.ops.push(op);
145
+ break;
146
+ }
147
+ if (t[2])
148
+ _.ops.pop();
149
+ _.trys.pop();
150
+ continue;
151
+ }
152
+ op = body.call(thisArg, _);
153
+ }
154
+ catch (e) {
155
+ op = [6, e];
156
+ y = 0;
157
+ }
158
+ finally {
159
+ f = t = 0;
160
+ }
161
+ if (op[0] & 5)
162
+ throw op[1];
163
+ return { value: op[0] ? op[1] : void 0, done: true };
164
+ }
165
+ }
166
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
167
+ if (k2 === undefined)
168
+ k2 = k;
169
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170
+ }) : (function (o, m, k, k2) {
171
+ if (k2 === undefined)
172
+ k2 = k;
173
+ o[k2] = m[k];
174
+ });
175
+ function __exportStar(m, o) {
176
+ for (var p in m)
177
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178
+ __createBinding(o, m, p);
179
+ }
180
+ function __values(o) {
181
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182
+ if (m)
183
+ return m.call(o);
184
+ if (o && typeof o.length === "number")
185
+ return {
186
+ next: function () {
187
+ if (o && i >= o.length)
188
+ o = void 0;
189
+ return { value: o && o[i++], done: !o };
190
+ }
191
+ };
192
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193
+ }
194
+ function __read(o, n) {
195
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
196
+ if (!m)
197
+ return o;
198
+ var i = m.call(o), r, ar = [], e;
199
+ try {
200
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201
+ ar.push(r.value);
202
+ }
203
+ catch (error) {
204
+ e = { error: error };
205
+ }
206
+ finally {
207
+ try {
208
+ if (r && !r.done && (m = i["return"]))
209
+ m.call(i);
210
+ }
211
+ finally {
212
+ if (e)
213
+ throw e.error;
214
+ }
215
+ }
216
+ return ar;
217
+ }
218
+ /** @deprecated */
219
+ function __spread() {
220
+ for (var ar = [], i = 0; i < arguments.length; i++)
221
+ ar = ar.concat(__read(arguments[i]));
222
+ return ar;
223
+ }
224
+ /** @deprecated */
225
+ function __spreadArrays() {
226
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
+ s += arguments[i].length;
228
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
+ r[k] = a[j];
231
+ return r;
232
+ }
233
+ function __spreadArray(to, from) {
234
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
+ to[j] = from[i];
236
+ return to;
237
+ }
238
+ function __await(v) {
239
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
240
+ }
241
+ function __asyncGenerator(thisArg, _arguments, generator) {
242
+ if (!Symbol.asyncIterator)
243
+ throw new TypeError("Symbol.asyncIterator is not defined.");
244
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
245
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
246
+ function verb(n) { if (g[n])
247
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
248
+ function resume(n, v) { try {
249
+ step(g[n](v));
250
+ }
251
+ catch (e) {
252
+ settle(q[0][3], e);
253
+ } }
254
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
255
+ function fulfill(value) { resume("next", value); }
256
+ function reject(value) { resume("throw", value); }
257
+ function settle(f, v) { if (f(v), q.shift(), q.length)
258
+ resume(q[0][0], q[0][1]); }
259
+ }
260
+ function __asyncDelegator(o) {
261
+ var i, p;
262
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
263
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
264
+ }
265
+ function __asyncValues(o) {
266
+ if (!Symbol.asyncIterator)
267
+ throw new TypeError("Symbol.asyncIterator is not defined.");
268
+ var m = o[Symbol.asyncIterator], i;
269
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
270
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
271
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
272
+ }
273
+ function __makeTemplateObject(cooked, raw) {
274
+ if (Object.defineProperty) {
275
+ Object.defineProperty(cooked, "raw", { value: raw });
276
+ }
277
+ else {
278
+ cooked.raw = raw;
279
+ }
280
+ return cooked;
281
+ }
282
+ ;
283
+ var __setModuleDefault = Object.create ? (function (o, v) {
284
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
285
+ }) : function (o, v) {
286
+ o["default"] = v;
287
+ };
288
+ function __importStar(mod) {
289
+ if (mod && mod.__esModule)
290
+ return mod;
291
+ var result = {};
292
+ if (mod != null)
293
+ for (var k in mod)
294
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
295
+ __createBinding(result, mod, k);
296
+ __setModuleDefault(result, mod);
297
+ return result;
298
+ }
299
+ function __importDefault(mod) {
300
+ return (mod && mod.__esModule) ? mod : { default: mod };
301
+ }
302
+ function __classPrivateFieldGet(receiver, state, kind, f) {
303
+ if (kind === "a" && !f)
304
+ throw new TypeError("Private accessor was defined without a getter");
305
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
306
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
307
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
308
+ }
309
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
310
+ if (kind === "m")
311
+ throw new TypeError("Private method is not writable");
312
+ if (kind === "a" && !f)
313
+ throw new TypeError("Private accessor was defined without a setter");
314
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
315
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
316
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
317
317
  }
318
318
 
319
- var PepSmartFiltersComponent = /** @class */ (function () {
320
- function PepSmartFiltersComponent(hostElement, layoutService) {
321
- this.hostElement = hostElement;
322
- this.layoutService = layoutService;
323
- this.title = '';
324
- this.filtersDataMap = new Map();
325
- this._filters = [];
326
- this._fields = [];
327
- this._useAsWebComponent = false;
328
- // @Output()
329
- // filtersClear: EventEmitter<void> = new EventEmitter<void>();
330
- this.filtersChange = new core.EventEmitter();
331
- this.fieldToggleChange = new core.EventEmitter();
332
- this.expansionPanelHeaderHeight = '*';
333
- }
334
- Object.defineProperty(PepSmartFiltersComponent.prototype, "filters", {
335
- get: function () {
336
- var _this = this;
337
- this._filters = __spreadArray([], __read(this.filtersDataMap.keys())).map(function (key) {
338
- if (key) {
339
- return _this.filtersDataMap.get(key);
340
- }
341
- });
342
- return this._filters;
343
- },
344
- set: function (value) {
345
- this._filters = value;
346
- this.setupFilters(value);
347
- },
348
- enumerable: false,
349
- configurable: true
350
- });
351
- Object.defineProperty(PepSmartFiltersComponent.prototype, "fields", {
352
- get: function () {
353
- return this._fields;
354
- },
355
- set: function (value) {
356
- this._fields = value;
357
- },
358
- enumerable: false,
359
- configurable: true
360
- });
361
- Object.defineProperty(PepSmartFiltersComponent.prototype, "useAsWebComponent", {
362
- get: function () {
363
- return this._useAsWebComponent;
364
- },
365
- set: function (value) {
366
- if (value) {
367
- this.exportFunctionsOnHostElement();
368
- }
369
- },
370
- enumerable: false,
371
- configurable: true
372
- });
373
- PepSmartFiltersComponent.prototype.exportFunctionsOnHostElement = function () {
374
- // This is for web component usage for use those functions.
375
- this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
376
- this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
377
- this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
378
- };
379
- PepSmartFiltersComponent.prototype.setupFilters = function (value) {
380
- var _this = this;
381
- this.filtersDataMap.clear();
382
- if (value) {
383
- value.forEach(function (filter) {
384
- // Validate before add the filter into the map.
385
- var currentField = null;
386
- if (_this.fields && _this.fields.length > 0) {
387
- currentField = _this.fields.find(function (field) { return field.id === filter.fieldId; });
388
- }
389
- if (currentField) {
390
- // Only if the operator is from the same type
391
- if (filter.operator.componentType.includes(currentField.componentType)) {
392
- var isOperatorUnitValid = true;
393
- if (filter.operatorUnit) {
394
- // Only if the operator unit is not from the same type
395
- if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
396
- isOperatorUnitValid = false;
397
- }
398
- }
399
- // Add the filter.
400
- if (isOperatorUnitValid) {
401
- _this.filtersDataMap.set(filter.fieldId, filter);
402
- }
403
- }
404
- }
405
- });
406
- }
407
- };
408
- PepSmartFiltersComponent.prototype.raiseFiltersChange = function () {
409
- this.filtersChange.emit(this.filters);
410
- };
411
- PepSmartFiltersComponent.prototype.toggleField = function (index, isOpen) {
412
- this.fields[index].isOpen = isOpen;
413
- this.fieldToggleChange.emit(this.fields[index]);
414
- };
415
- PepSmartFiltersComponent.prototype.clearFilters = function () {
416
- this.filtersDataMap.clear();
417
- };
418
- PepSmartFiltersComponent.prototype.clearFilter = function (fieldId) {
419
- this.filtersDataMap.delete(fieldId);
420
- };
421
- // Clear all the filters and raise event that filters has change.
422
- PepSmartFiltersComponent.prototype.onFiltersClear = function () {
423
- this.clearFilters();
424
- this.raiseFiltersChange();
425
- };
426
- // Clear the filter and raise event that filters has change.
427
- PepSmartFiltersComponent.prototype.onFilterClear = function (field) {
428
- this.clearFilter(field.id);
429
- this.raiseFiltersChange();
430
- };
431
- // Set the filter and raise event that filters has change.
432
- PepSmartFiltersComponent.prototype.onFilterChange = function (field, filterData) {
433
- this.clearFilter(field.id);
434
- this.filtersDataMap.set(field.id, filterData);
435
- this.raiseFiltersChange();
436
- };
437
- return PepSmartFiltersComponent;
438
- }());
439
- PepSmartFiltersComponent.decorators = [
440
- { type: core.Component, args: [{
441
- selector: 'pep-smart-filters',
442
- 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>",
443
- changeDetection: core.ChangeDetectionStrategy.OnPush,
444
- 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)}"]
445
- },] }
446
- ];
447
- PepSmartFiltersComponent.ctorParameters = function () { return [
448
- { type: core.ElementRef },
449
- { type: ngxLib.PepLayoutService }
450
- ]; };
451
- PepSmartFiltersComponent.propDecorators = {
452
- title: [{ type: core.Input }],
453
- filters: [{ type: core.Input }],
454
- fields: [{ type: core.Input }],
455
- useAsWebComponent: [{ type: core.Input }],
456
- filtersChange: [{ type: core.Output }],
457
- fieldToggleChange: [{ type: core.Output }]
319
+ var PepSmartFiltersComponent = /** @class */ (function () {
320
+ function PepSmartFiltersComponent(hostElement, layoutService) {
321
+ this.hostElement = hostElement;
322
+ this.layoutService = layoutService;
323
+ this.title = '';
324
+ this.filtersDataMap = new Map();
325
+ this._filters = [];
326
+ this._fields = [];
327
+ this._useAsWebComponent = false;
328
+ // @Output()
329
+ // filtersClear: EventEmitter<void> = new EventEmitter<void>();
330
+ this.filtersChange = new core.EventEmitter();
331
+ this.fieldToggleChange = new core.EventEmitter();
332
+ this.expansionPanelHeaderHeight = '*';
333
+ }
334
+ Object.defineProperty(PepSmartFiltersComponent.prototype, "filters", {
335
+ get: function () {
336
+ var _this = this;
337
+ this._filters = __spreadArray([], __read(this.filtersDataMap.keys())).map(function (key) {
338
+ if (key) {
339
+ return _this.filtersDataMap.get(key);
340
+ }
341
+ });
342
+ return this._filters;
343
+ },
344
+ set: function (value) {
345
+ this._filters = value;
346
+ this.setupFilters(value);
347
+ },
348
+ enumerable: false,
349
+ configurable: true
350
+ });
351
+ Object.defineProperty(PepSmartFiltersComponent.prototype, "fields", {
352
+ get: function () {
353
+ return this._fields;
354
+ },
355
+ set: function (value) {
356
+ this._fields = value;
357
+ },
358
+ enumerable: false,
359
+ configurable: true
360
+ });
361
+ Object.defineProperty(PepSmartFiltersComponent.prototype, "useAsWebComponent", {
362
+ get: function () {
363
+ return this._useAsWebComponent;
364
+ },
365
+ set: function (value) {
366
+ if (value) {
367
+ this.exportFunctionsOnHostElement();
368
+ }
369
+ },
370
+ enumerable: false,
371
+ configurable: true
372
+ });
373
+ PepSmartFiltersComponent.prototype.exportFunctionsOnHostElement = function () {
374
+ // This is for web component usage for use those functions.
375
+ this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
376
+ this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
377
+ this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
378
+ };
379
+ PepSmartFiltersComponent.prototype.setupFilters = function (value) {
380
+ var _this = this;
381
+ this.filtersDataMap.clear();
382
+ if (value) {
383
+ value.forEach(function (filter) {
384
+ // Validate before add the filter into the map.
385
+ var currentField = null;
386
+ if (_this.fields && _this.fields.length > 0) {
387
+ currentField = _this.fields.find(function (field) { return field.id === filter.fieldId; });
388
+ }
389
+ if (currentField) {
390
+ // Only if the operator is from the same type
391
+ if (filter.operator.componentType.includes(currentField.componentType)) {
392
+ var isOperatorUnitValid = true;
393
+ if (filter.operatorUnit) {
394
+ // Only if the operator unit is not from the same type
395
+ if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
396
+ isOperatorUnitValid = false;
397
+ }
398
+ }
399
+ // Add the filter.
400
+ if (isOperatorUnitValid) {
401
+ _this.filtersDataMap.set(filter.fieldId, filter);
402
+ }
403
+ }
404
+ }
405
+ });
406
+ }
407
+ };
408
+ PepSmartFiltersComponent.prototype.raiseFiltersChange = function () {
409
+ this.filtersChange.emit(this.filters);
410
+ };
411
+ PepSmartFiltersComponent.prototype.toggleField = function (index, isOpen) {
412
+ this.fields[index].isOpen = isOpen;
413
+ this.fieldToggleChange.emit(this.fields[index]);
414
+ };
415
+ PepSmartFiltersComponent.prototype.clearFilters = function () {
416
+ this.filtersDataMap.clear();
417
+ };
418
+ PepSmartFiltersComponent.prototype.clearFilter = function (fieldId) {
419
+ this.filtersDataMap.delete(fieldId);
420
+ };
421
+ // Clear all the filters and raise event that filters has change.
422
+ PepSmartFiltersComponent.prototype.onFiltersClear = function () {
423
+ this.clearFilters();
424
+ this.raiseFiltersChange();
425
+ };
426
+ // Clear the filter and raise event that filters has change.
427
+ PepSmartFiltersComponent.prototype.onFilterClear = function (field) {
428
+ this.clearFilter(field.id);
429
+ this.raiseFiltersChange();
430
+ };
431
+ // Set the filter and raise event that filters has change.
432
+ PepSmartFiltersComponent.prototype.onFilterChange = function (field, filterData) {
433
+ this.clearFilter(field.id);
434
+ this.filtersDataMap.set(field.id, filterData);
435
+ this.raiseFiltersChange();
436
+ };
437
+ return PepSmartFiltersComponent;
438
+ }());
439
+ PepSmartFiltersComponent.decorators = [
440
+ { type: core.Component, args: [{
441
+ selector: 'pep-smart-filters',
442
+ 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>",
443
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
444
+ 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)}"]
445
+ },] }
446
+ ];
447
+ PepSmartFiltersComponent.ctorParameters = function () { return [
448
+ { type: core.ElementRef },
449
+ { type: ngxLib.PepLayoutService }
450
+ ]; };
451
+ PepSmartFiltersComponent.propDecorators = {
452
+ title: [{ type: core.Input }],
453
+ filters: [{ type: core.Input }],
454
+ fields: [{ type: core.Input }],
455
+ useAsWebComponent: [{ type: core.Input }],
456
+ filtersChange: [{ type: core.Output }],
457
+ fieldToggleChange: [{ type: core.Output }]
458
458
  };
459
459
 
460
- var PepFilterActionsComponent = /** @class */ (function () {
461
- function PepFilterActionsComponent() {
462
- this.clearClick = new core.EventEmitter();
463
- this.applyClick = new core.EventEmitter();
464
- }
465
- PepFilterActionsComponent.prototype.clear = function () {
466
- this.clearClick.emit();
467
- };
468
- PepFilterActionsComponent.prototype.apply = function () {
469
- this.applyClick.emit();
470
- };
471
- return PepFilterActionsComponent;
472
- }());
473
- PepFilterActionsComponent.decorators = [
474
- { type: core.Component, args: [{
475
- selector: 'pep-filter-actions',
476
- 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>",
477
- 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}"]
478
- },] }
479
- ];
480
- PepFilterActionsComponent.propDecorators = {
481
- form: [{ type: core.Input }],
482
- clearClick: [{ type: core.Output }],
483
- applyClick: [{ type: core.Output }]
460
+ var PepFilterActionsComponent = /** @class */ (function () {
461
+ function PepFilterActionsComponent() {
462
+ this.clearClick = new core.EventEmitter();
463
+ this.applyClick = new core.EventEmitter();
464
+ }
465
+ PepFilterActionsComponent.prototype.clear = function () {
466
+ this.clearClick.emit();
467
+ };
468
+ PepFilterActionsComponent.prototype.apply = function () {
469
+ this.applyClick.emit();
470
+ };
471
+ return PepFilterActionsComponent;
472
+ }());
473
+ PepFilterActionsComponent.decorators = [
474
+ { type: core.Component, args: [{
475
+ selector: 'pep-filter-actions',
476
+ 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>",
477
+ 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}"]
478
+ },] }
479
+ ];
480
+ PepFilterActionsComponent.propDecorators = {
481
+ form: [{ type: core.Input }],
482
+ clearClick: [{ type: core.Output }],
483
+ applyClick: [{ type: core.Output }]
484
484
  };
485
485
 
486
- var IPepSmartFilterOperator = /** @class */ (function () {
487
- function IPepSmartFilterOperator() {
488
- }
489
- return IPepSmartFilterOperator;
490
- }());
491
- var Equals = {
492
- id: 'eq',
493
- name: 'EQUAL',
494
- short: '=',
495
- componentType: [
496
- 'number',
497
- 'boolean'
498
- // 'multi-select',
499
- // 'date',
500
- // 'text',
501
- // 'auto-complete',
502
- // 'select',
503
- ],
504
- };
505
- var NotEqual = {
506
- id: 'neq',
507
- name: 'NOT_EQUAL',
508
- short: '<>',
509
- componentType: [
510
- 'number',
511
- // 'multi-select',
512
- // 'date',
513
- // 'text',
514
- // 'auto-complete',
515
- // 'select',
516
- ],
517
- };
518
- var LessThan = {
519
- id: 'lt',
520
- name: 'LESS_THEN',
521
- short: '<',
522
- componentType: ['number'],
523
- };
524
- // const LessThanOrEquals: IPepSmartFilterOperator = {
525
- // id: 'ltoe',
526
- // name: 'LESS_THEN_OR_EQUAL',
527
- // short: '<=',
528
- // type: ['number'],
529
- // };
530
- var GreaterThan = {
531
- id: 'gt',
532
- name: 'GREATER_THEN',
533
- short: '>',
534
- componentType: ['number'],
535
- };
536
- // const GreaterThanOrEquals: IPepSmartFilterOperator = {
537
- // id: 'gtoe',
538
- // name: 'GREATER_THEN_OR_EQUAL',
539
- // short: '>=',
540
- // type: ['number'],
541
- // };
542
- var NumberRange = {
543
- id: 'numberRange',
544
- name: 'NUMBER_RANGE',
545
- short: 'Range',
546
- componentType: ['number'],
547
- };
548
- var Contains = {
549
- id: 'contains',
550
- name: 'CONTAINS',
551
- short: 'Contains',
552
- componentType: ['text'],
553
- };
554
- // const BeginsWith: Operator = {
555
- // id: 'beginsWith',
556
- // name: 'Begins With',
557
- // short: 'Begins With',
558
- // type: ['text'],
559
- // };
560
- // const EndsWith: Operator = {
561
- // id: 'endsWith',
562
- // name: 'Ends With',
563
- // short: 'End With',
564
- // type: ['text'],
565
- // };
566
- // const After: Operator = {
567
- // id: 'after',
568
- // name: 'After',
569
- // short: 'After',
570
- // type: ['date'],
571
- // };
572
- // const Before: Operator = {
573
- // id: 'before',
574
- // name: 'Before',
575
- // short: 'Before',
576
- // type: ['date'],
577
- // };
578
- var InTheLast = {
579
- id: 'inTheLast',
580
- name: 'IN_THE_LAST',
581
- short: 'In the last',
582
- componentType: ['date'],
583
- };
584
- var Today = {
585
- id: 'today',
586
- name: 'TODAY',
587
- short: 'Today',
588
- componentType: ['date'],
589
- };
590
- var ThisWeek = {
591
- id: 'thisWeek',
592
- name: 'THIS_WEEK',
593
- short: 'This week',
594
- componentType: ['date'],
595
- };
596
- var ThisMonth = {
597
- id: 'thisMonth',
598
- name: 'THIS_MONTH',
599
- short: 'This month',
600
- componentType: ['date'],
601
- };
602
- var DateRange = {
603
- id: 'dateRange',
604
- name: 'DATE_RANGE',
605
- short: 'Range',
606
- componentType: ['date'],
607
- };
608
- var DueIn = {
609
- id: 'dueIn',
610
- name: 'DUE_IN',
611
- short: 'Due in',
612
- componentType: ['date'],
613
- };
614
- var On = {
615
- id: 'on',
616
- name: 'ON',
617
- short: 'On',
618
- componentType: ['date'],
619
- };
620
- var NotInTheLast = {
621
- id: 'notInTheLast',
622
- name: 'NOT_IN_THE_LAST',
623
- short: 'Not in the last',
624
- componentType: ['date'],
625
- };
626
- var NotDueIn = {
627
- id: 'notDueIn',
628
- name: 'NOT_DUE_IN',
629
- short: 'Not due in',
630
- componentType: ['date'],
631
- };
632
- var IsEmpty = {
633
- id: 'isEmpty',
634
- name: 'IS_EMPTY',
635
- short: 'Is empty',
636
- componentType: ['date'],
637
- };
638
- var IsNotEmpty = {
639
- id: 'isNotEmpty',
640
- name: 'IS_NOT_EMPTY',
641
- short: 'Is not empty',
642
- componentType: ['date'],
643
- };
644
- var In = {
645
- id: 'in',
646
- name: 'IN',
647
- short: 'In',
648
- componentType: ['multi-select'],
649
- };
650
- var PepSmartFilterOperators = {
651
- Equals: Equals,
652
- NotEqual: NotEqual,
653
- LessThan: LessThan,
654
- // LessThanOrEquals: LessThanOrEquals,
655
- GreaterThan: GreaterThan,
656
- // GreaterThanOrEquals: GreaterThanOrEquals,
657
- NumberRange: NumberRange,
658
- Contains: Contains,
659
- // BeginsWith: BeginsWith,
660
- // EndsWith: EndsWith,
661
- // After: After,
662
- // Before: Before,
663
- InTheLast: InTheLast,
664
- Today: Today,
665
- ThisWeek: ThisWeek,
666
- ThisMonth: ThisMonth,
667
- DateRange: DateRange,
668
- DueIn: DueIn,
669
- On: On,
670
- NotInTheLast: NotInTheLast,
671
- NotDueIn: NotDueIn,
672
- IsEmpty: IsEmpty,
673
- IsNotEmpty: IsNotEmpty,
674
- In: In,
675
- };
676
- //additional operators to be added upon input flag
677
- var InTheLastCalendar = {
678
- id: 'inTheLastCalendar',
679
- name: 'IN_THE_LAST_CALENDAR',
680
- short: 'In the last (calendar)',
681
- componentType: ['date'],
682
- };
683
- var NotInTheLastCalendar = {
684
- id: 'notInTheLastCalendar',
685
- name: 'NOT_IN_THE_LAST_CALENDAR',
686
- short: 'Not in the last (calendar)',
687
- componentType: ['date'],
688
- };
689
- var PepSmartFilterAdditionalOperators = {
690
- InTheLastCalendar: InTheLastCalendar,
691
- NotInTheLastCalendar: NotInTheLastCalendar
692
- };
693
- //additional variable operators to be added upon input variable fields
694
- var EqualsToVariable = {
695
- id: 'eqv',
696
- name: 'EQUAL_TO_VARIABLE',
697
- short: '=',
698
- componentType: [
699
- 'text',
700
- 'number',
701
- 'boolean'
702
- ]
703
- };
704
- var NotEqualsToVariable = {
705
- id: 'neqv',
706
- name: 'NOT_EQUAL_TO_VARIABLE',
707
- short: '<>',
708
- componentType: ['boolean']
709
- };
710
- var LessThanVariable = {
711
- id: 'ltv',
712
- name: 'LESS_THAN_VARIABLE',
713
- short: '<',
714
- componentType: ['number'],
715
- };
716
- var GreaterThanVariable = {
717
- id: 'gtv',
718
- name: 'GREATER_THAN_VARIABLE',
719
- short: '>',
720
- componentType: ['number'],
721
- };
722
- var InTheLastVariable = {
723
- id: 'inTheLastVariable',
724
- name: 'IN_THE_LAST_VARIABLE',
725
- short: 'In the last Variable',
726
- componentType: ['date'],
727
- };
728
- var DateRangeVariable = {
729
- id: 'dateRangeVariable',
730
- name: 'DATE_RANGE_VARIABLE',
731
- short: 'Range Variable',
732
- componentType: ['date'],
733
- };
734
- var PepSmartFilterVariableOperators = {
735
- EqualsToVariable: EqualsToVariable,
736
- NotEqualsToVariable: NotEqualsToVariable,
737
- LessThanVariable: LessThanVariable,
738
- GreaterThanVariable: GreaterThanVariable,
739
- DateRangeVariable: DateRangeVariable,
740
- InTheLastVariable: InTheLastVariable
741
- };
742
- var IPepSmartFilterOperatorUnit = /** @class */ (function () {
743
- function IPepSmartFilterOperatorUnit() {
744
- }
745
- return IPepSmartFilterOperatorUnit;
746
- }());
747
- var Days = {
748
- id: 'days',
749
- name: 'DAYS',
750
- componentType: ['date'],
751
- };
752
- var Weeks = {
753
- id: 'weeks',
754
- name: 'WEEKS',
755
- componentType: ['date'],
756
- };
757
- var Months = {
758
- id: 'months',
759
- name: 'MONTHS',
760
- componentType: ['date'],
761
- };
762
- var Years = {
763
- id: 'years',
764
- name: 'YEARS',
765
- componentType: ['date'],
766
- };
767
- var PepSmartFilterOperatorUnits = {
768
- Days: Days,
769
- Weeks: Weeks,
770
- Months: Months,
771
- Years: Years,
486
+ var IPepSmartFilterOperator = /** @class */ (function () {
487
+ function IPepSmartFilterOperator() {
488
+ }
489
+ return IPepSmartFilterOperator;
490
+ }());
491
+ var Equals = {
492
+ id: 'eq',
493
+ name: 'EQUAL',
494
+ short: '=',
495
+ componentType: [
496
+ 'number',
497
+ 'boolean',
498
+ // 'multi-select',
499
+ // 'date',
500
+ 'text',
501
+ // 'auto-complete',
502
+ // 'select',
503
+ ],
504
+ };
505
+ var NotEqual = {
506
+ id: 'neq',
507
+ name: 'NOT_EQUAL',
508
+ short: '<>',
509
+ componentType: [
510
+ 'number',
511
+ // 'multi-select',
512
+ // 'date',
513
+ 'text',
514
+ // 'auto-complete',
515
+ // 'select',
516
+ ],
517
+ };
518
+ var LessThan = {
519
+ id: 'lt',
520
+ name: 'LESS_THEN',
521
+ short: '<',
522
+ componentType: ['number'],
523
+ };
524
+ // const LessThanOrEquals: IPepSmartFilterOperator = {
525
+ // id: 'ltoe',
526
+ // name: 'LESS_THEN_OR_EQUAL',
527
+ // short: '<=',
528
+ // type: ['number'],
529
+ // };
530
+ var GreaterThan = {
531
+ id: 'gt',
532
+ name: 'GREATER_THEN',
533
+ short: '>',
534
+ componentType: ['number'],
535
+ };
536
+ // const GreaterThanOrEquals: IPepSmartFilterOperator = {
537
+ // id: 'gtoe',
538
+ // name: 'GREATER_THEN_OR_EQUAL',
539
+ // short: '>=',
540
+ // type: ['number'],
541
+ // };
542
+ var NumberRange = {
543
+ id: 'numberRange',
544
+ name: 'NUMBER_RANGE',
545
+ short: 'Range',
546
+ componentType: ['number'],
547
+ };
548
+ var Contains = {
549
+ id: 'contains',
550
+ name: 'CONTAINS',
551
+ short: 'Contains',
552
+ componentType: ['text'],
553
+ };
554
+ var BeginsWith = {
555
+ id: 'beginsWith',
556
+ name: 'BEGINS_WITH',
557
+ short: 'Begins With',
558
+ componentType: ['text'],
559
+ };
560
+ var EndsWith = {
561
+ id: 'endsWith',
562
+ name: 'ENDS_WITH',
563
+ short: 'End With',
564
+ componentType: ['text'],
565
+ };
566
+ // const After: Operator = {
567
+ // id: 'after',
568
+ // name: 'After',
569
+ // short: 'After',
570
+ // type: ['date'],
571
+ // };
572
+ // const Before: Operator = {
573
+ // id: 'before',
574
+ // name: 'Before',
575
+ // short: 'Before',
576
+ // type: ['date'],
577
+ // };
578
+ var InTheLast = {
579
+ id: 'inTheLast',
580
+ name: 'IN_THE_LAST',
581
+ short: 'In the last',
582
+ componentType: ['date'],
583
+ };
584
+ var Today = {
585
+ id: 'today',
586
+ name: 'TODAY',
587
+ short: 'Today',
588
+ componentType: ['date'],
589
+ };
590
+ var ThisWeek = {
591
+ id: 'thisWeek',
592
+ name: 'THIS_WEEK',
593
+ short: 'This week',
594
+ componentType: ['date'],
595
+ };
596
+ var ThisMonth = {
597
+ id: 'thisMonth',
598
+ name: 'THIS_MONTH',
599
+ short: 'This month',
600
+ componentType: ['date'],
601
+ };
602
+ var DateRange = {
603
+ id: 'dateRange',
604
+ name: 'DATE_RANGE',
605
+ short: 'Range',
606
+ componentType: ['date'],
607
+ };
608
+ var DueIn = {
609
+ id: 'dueIn',
610
+ name: 'DUE_IN',
611
+ short: 'Due in',
612
+ componentType: ['date'],
613
+ };
614
+ var On = {
615
+ id: 'on',
616
+ name: 'ON',
617
+ short: 'On',
618
+ componentType: ['date'],
619
+ };
620
+ var NotInTheLast = {
621
+ id: 'notInTheLast',
622
+ name: 'NOT_IN_THE_LAST',
623
+ short: 'Not in the last',
624
+ componentType: ['date'],
625
+ };
626
+ var NotDueIn = {
627
+ id: 'notDueIn',
628
+ name: 'NOT_DUE_IN',
629
+ short: 'Not due in',
630
+ componentType: ['date'],
631
+ };
632
+ var IsEmpty = {
633
+ id: 'isEmpty',
634
+ name: 'IS_EMPTY',
635
+ short: 'Is empty',
636
+ componentType: ['date'],
637
+ };
638
+ var IsNotEmpty = {
639
+ id: 'isNotEmpty',
640
+ name: 'IS_NOT_EMPTY',
641
+ short: 'Is not empty',
642
+ componentType: ['date'],
643
+ };
644
+ var In = {
645
+ id: 'in',
646
+ name: 'IN',
647
+ short: 'In',
648
+ componentType: ['multi-select'],
649
+ };
650
+ var PepSmartFilterOperators = {
651
+ Equals: Equals,
652
+ NotEqual: NotEqual,
653
+ LessThan: LessThan,
654
+ // LessThanOrEquals: LessThanOrEquals,
655
+ GreaterThan: GreaterThan,
656
+ // GreaterThanOrEquals: GreaterThanOrEquals,
657
+ NumberRange: NumberRange,
658
+ Contains: Contains,
659
+ BeginsWith: BeginsWith,
660
+ EndsWith: EndsWith,
661
+ // After: After,
662
+ // Before: Before,
663
+ InTheLast: InTheLast,
664
+ Today: Today,
665
+ ThisWeek: ThisWeek,
666
+ ThisMonth: ThisMonth,
667
+ DateRange: DateRange,
668
+ DueIn: DueIn,
669
+ On: On,
670
+ NotInTheLast: NotInTheLast,
671
+ NotDueIn: NotDueIn,
672
+ IsEmpty: IsEmpty,
673
+ IsNotEmpty: IsNotEmpty,
674
+ In: In,
675
+ };
676
+ //additional operators to be added upon input flag
677
+ var InTheLastCalendar = {
678
+ id: 'inTheLastCalendar',
679
+ name: 'IN_THE_LAST_CALENDAR',
680
+ short: 'In the last (calendar)',
681
+ componentType: ['date'],
682
+ };
683
+ var NotInTheLastCalendar = {
684
+ id: 'notInTheLastCalendar',
685
+ name: 'NOT_IN_THE_LAST_CALENDAR',
686
+ short: 'Not in the last (calendar)',
687
+ componentType: ['date'],
688
+ };
689
+ var PepSmartFilterAdditionalOperators = {
690
+ InTheLastCalendar: InTheLastCalendar,
691
+ NotInTheLastCalendar: NotInTheLastCalendar
692
+ };
693
+ //additional variable operators to be added upon input variable fields
694
+ var EqualsToVariable = {
695
+ id: 'eqv',
696
+ name: 'EQUAL_TO_VARIABLE',
697
+ short: '=',
698
+ componentType: ['text', 'number', 'boolean', 'multi-select']
699
+ };
700
+ var NotEqualsToVariable = {
701
+ id: 'neqv',
702
+ name: 'NOT_EQUAL_TO_VARIABLE',
703
+ short: '<>',
704
+ componentType: ['boolean', 'multi-select']
705
+ };
706
+ var LessThanVariable = {
707
+ id: 'ltv',
708
+ name: 'LESS_THAN_VARIABLE',
709
+ short: '<',
710
+ componentType: ['number'],
711
+ };
712
+ var GreaterThanVariable = {
713
+ id: 'gtv',
714
+ name: 'GREATER_THAN_VARIABLE',
715
+ short: '>',
716
+ componentType: ['number'],
717
+ };
718
+ var DateRangeVariable = {
719
+ id: 'dateRangeVariable',
720
+ name: 'DATE_RANGE_VARIABLE',
721
+ short: 'Range Variable',
722
+ componentType: ['date'],
723
+ };
724
+ var PepSmartFilterVariableOperators = {
725
+ EqualsToVariable: EqualsToVariable,
726
+ NotEqualsToVariable: NotEqualsToVariable,
727
+ LessThanVariable: LessThanVariable,
728
+ GreaterThanVariable: GreaterThanVariable,
729
+ DateRangeVariable: DateRangeVariable
730
+ };
731
+ var IPepSmartFilterOperatorUnit = /** @class */ (function () {
732
+ function IPepSmartFilterOperatorUnit() {
733
+ }
734
+ return IPepSmartFilterOperatorUnit;
735
+ }());
736
+ var Days = {
737
+ id: 'days',
738
+ name: 'DAYS',
739
+ componentType: ['date'],
740
+ };
741
+ var Weeks = {
742
+ id: 'weeks',
743
+ name: 'WEEKS',
744
+ componentType: ['date'],
745
+ };
746
+ var Months = {
747
+ id: 'months',
748
+ name: 'MONTHS',
749
+ componentType: ['date'],
750
+ };
751
+ var Years = {
752
+ id: 'years',
753
+ name: 'YEARS',
754
+ componentType: ['date'],
755
+ };
756
+ var PepSmartFilterOperatorUnits = {
757
+ Days: Days,
758
+ Weeks: Weeks,
759
+ Months: Months,
760
+ Years: Years,
772
761
  };
773
762
 
774
- var BaseFilterComponent = /** @class */ (function () {
775
- function BaseFilterComponent(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
776
- this.viewContainerRef = viewContainerRef;
777
- this.injector = injector;
778
- this.resolver = resolver;
779
- this.builder = builder;
780
- this.translate = translate;
781
- this.validator = validator;
782
- this.renderer = renderer;
783
- this._fieldIdWithNoDots = '';
784
- this.variableFieldOptions = [];
785
- this.emitOnChange = false;
786
- this.inline = false;
787
- this.showActionButtons = true;
788
- this.renderTitle = true;
789
- this.showAdditionalOperators = false;
790
- this.filterClear = new core.EventEmitter();
791
- this.filterChange = new core.EventEmitter();
792
- this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
793
- this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
794
- this._destroyed = new rxjs.Subject();
795
- }
796
- Object.defineProperty(BaseFilterComponent.prototype, "field", {
797
- get: function () {
798
- return this._field;
799
- },
800
- set: function (value) {
801
- this._field = value;
802
- this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
803
- this.setupForm();
804
- },
805
- enumerable: false,
806
- configurable: true
807
- });
808
- Object.defineProperty(BaseFilterComponent.prototype, "variableField", {
809
- set: function (list) {
810
- if (list === null || list === void 0 ? void 0 : list.length) {
811
- this.variableFieldOptions = list.map(function (item) {
812
- return {
813
- key: item,
814
- value: item
815
- };
816
- });
817
- }
818
- },
819
- enumerable: false,
820
- configurable: true
821
- });
822
- Object.defineProperty(BaseFilterComponent.prototype, "filter", {
823
- get: function () {
824
- return this._filter;
825
- },
826
- set: function (value) {
827
- this._filter = value;
828
- this.setupFilter();
829
- },
830
- enumerable: false,
831
- configurable: true
832
- });
833
- Object.defineProperty(BaseFilterComponent.prototype, "parentForm", {
834
- set: function (form) {
835
- this._parentForm = form;
836
- this.updateParentForm();
837
- },
838
- enumerable: false,
839
- configurable: true
840
- });
841
- Object.defineProperty(BaseFilterComponent.prototype, "operator", {
842
- get: function () {
843
- return this._operator;
844
- },
845
- set: function (operator) {
846
- var _a;
847
- if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
848
- // Validate operator
849
- var index = this.operators.findIndex(function (o) { return o.id === operator.id; });
850
- if (index >= 0) {
851
- this._operator = this.operators[index];
852
- }
853
- else {
854
- this._operator = this.operators[0];
855
- }
856
- this.form.reset();
857
- this.updateValidity();
858
- }
859
- },
860
- enumerable: false,
861
- configurable: true
862
- });
863
- Object.defineProperty(BaseFilterComponent.prototype, "operatorUnit", {
864
- get: function () {
865
- return this._operatorUnit;
866
- },
867
- set: function (operatorUnit) {
868
- // Validate operator unit
869
- if (operatorUnit) {
870
- var index = this.operatorUnits.findIndex(function (ou) { return ou.id === operatorUnit.id; });
871
- if (index >= 0) {
872
- this._operatorUnit = this.operatorUnits[index];
873
- }
874
- else {
875
- this._operatorUnit = this.operatorUnits[0];
876
- }
877
- }
878
- else {
879
- this._operatorUnit = undefined;
880
- }
881
- },
882
- enumerable: false,
883
- configurable: true
884
- });
885
- Object.defineProperty(BaseFilterComponent.prototype, "firstControlKey", {
886
- get: function () {
887
- return this.field ? this._fieldIdWithNoDots + "_first" : 'first';
888
- },
889
- enumerable: false,
890
- configurable: true
891
- });
892
- Object.defineProperty(BaseFilterComponent.prototype, "firstControl", {
893
- get: function () {
894
- return this.form.get(this.firstControlKey);
895
- },
896
- enumerable: false,
897
- configurable: true
898
- });
899
- Object.defineProperty(BaseFilterComponent.prototype, "secondControlKey", {
900
- get: function () {
901
- return this.field ? this._fieldIdWithNoDots + "_second" : 'second';
902
- },
903
- enumerable: false,
904
- configurable: true
905
- });
906
- Object.defineProperty(BaseFilterComponent.prototype, "secondControl", {
907
- get: function () {
908
- return this.form.get(this.secondControlKey);
909
- },
910
- enumerable: false,
911
- configurable: true
912
- });
913
- BaseFilterComponent.prototype.createActionsComponent = function () {
914
- var _this = this;
915
- var factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
916
- this.actionsContainerRef = factory.create(this.injector);
917
- this.actionsContainerRef.instance.form = this.form;
918
- this.actionsContainerRef.instance.applyClick.subscribe(function () { return _this.applyFilter(); });
919
- this.actionsContainerRef.instance.clearClick.subscribe(function () { return _this.clearFilter(); });
920
- this.viewContainerRef.insert(this.actionsContainerRef.hostView);
921
- };
922
- BaseFilterComponent.prototype.setupForm = function () {
923
- var formValue = {};
924
- formValue[this.firstControlKey] = [];
925
- formValue[this.secondControlKey] = [];
926
- // this.form.patchValue(formValue);
927
- this.form = this.builder.group(formValue);
928
- // this.form[this.firstControlKey] = [];
929
- // this.form[this.secondControlKey] = [];
930
- this.setupOperators();
931
- if (this.showActionButtons) {
932
- this.createActionsComponent();
933
- }
934
- };
935
- BaseFilterComponent.prototype.setupOperators = function () {
936
- var _this = this;
937
- var _a, _b, _c;
938
- // Get the operators by componentType.
939
- this.operators = Object.keys(PepSmartFilterOperators)
940
- .filter(function (key) {
941
- return PepSmartFilterOperators[key].componentType.includes(_this.field.componentType);
942
- })
943
- .map(function (key) { return PepSmartFilterOperators[key]; });
944
- // Add additional operators
945
- if (this.showAdditionalOperators) {
946
- var additional = Object.keys(PepSmartFilterAdditionalOperators)
947
- .filter(function (key) {
948
- return PepSmartFilterAdditionalOperators[key].componentType.includes(_this.field.componentType);
949
- })
950
- .map(function (key) { return PepSmartFilterAdditionalOperators[key]; });
951
- this.operators = __spreadArray(__spreadArray([], __read(this.operators)), __read(additional));
952
- }
953
- //add variable operators
954
- if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
955
- var variables = Object.keys(PepSmartFilterVariableOperators)
956
- .filter(function (key) {
957
- return PepSmartFilterVariableOperators[key].componentType.includes(_this.field.componentType);
958
- })
959
- .map(function (key) { return PepSmartFilterVariableOperators[key]; });
960
- this.operators = __spreadArray(__spreadArray([], __read(this.operators)), __read(variables));
961
- }
962
- // Filter by from field.operators input if exist.
963
- if (((_b = this.field.operators) === null || _b === void 0 ? void 0 : _b.length) > 0) {
964
- this.operators = this.operators.filter(function (o1) { return _this.field.operators.some(function (o2) { return o1.id === o2; }); });
965
- }
966
- // Get the operator units by componentType.
967
- this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
968
- .filter(function (key) {
969
- return PepSmartFilterOperatorUnits[key].componentType.includes(_this.field.componentType);
970
- })
971
- .map(function (key) { return PepSmartFilterOperatorUnits[key]; });
972
- // Filter by from field.operatorsUnits input if exist.
973
- if (((_c = this.field.operatorUnits) === null || _c === void 0 ? void 0 : _c.length) > 0) {
974
- this.operatorUnits = this.operatorUnits.filter(function (o1) { return _this.field.operatorUnits.some(function (o2) { return o1.id === o2; }); });
975
- }
976
- // Load translation before get the options in the children.
977
- this.translate.get('SMART_FILTERS.TITLE').subscribe(function (res) {
978
- _this.loadOperatorsOptions();
979
- });
980
- };
981
- BaseFilterComponent.prototype.setupFilter = function () {
982
- if (this.filter) {
983
- this.operator = this.filter.operator;
984
- this.operatorUnit = this.filter.operatorUnit;
985
- var formValue = {};
986
- formValue[this.firstControlKey] = this.filter.value.first;
987
- formValue[this.secondControlKey] = this.filter.value.second;
988
- this.form.patchValue(formValue);
989
- }
990
- else {
991
- this.operator = this.getDefaultOperator();
992
- this.operatorUnit = this.getDefaultOperatorUnit();
993
- this.clearFilter(false);
994
- }
995
- };
996
- BaseFilterComponent.prototype.updateParentForm = function () {
997
- this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
998
- this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
999
- this._parentForm.setControl('operator', this.builder.control(this.operator));
1000
- this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
1001
- this._parentForm.setControl('values', this.builder.group({
1002
- first: this.firstControl,
1003
- second: this.secondControl
1004
- }));
1005
- };
1006
- BaseFilterComponent.prototype.getDestroyer = function () {
1007
- return operators.takeUntil(this._destroyed);
1008
- };
1009
- BaseFilterComponent.prototype.updateValidity = function () {
1010
- this.setFieldsStateAndValidators();
1011
- this.firstControl.updateValueAndValidity();
1012
- this.secondControl.updateValueAndValidity();
1013
- };
1014
- // Load the operators options from the translation.
1015
- BaseFilterComponent.prototype.loadOperatorsOptions = function () {
1016
- // Not implemented in the base
1017
- };
1018
- // Set default validators - some childs override this.
1019
- BaseFilterComponent.prototype.setFieldsStateAndValidators = function () {
1020
- this.firstControl.setValidators(forms.Validators.required);
1021
- this.secondControl.setValidators(forms.Validators.required);
1022
- this.secondControl.disable();
1023
- };
1024
- // Return undefined - some childs override this.
1025
- BaseFilterComponent.prototype.getDefaultOperatorUnit = function () {
1026
- return undefined;
1027
- };
1028
- BaseFilterComponent.prototype.initFilter = function () {
1029
- // Not implemented in the base
1030
- };
1031
- BaseFilterComponent.prototype.clearFilter = function (emitEvent) {
1032
- if (emitEvent === void 0) { emitEvent = true; }
1033
- this._filter = null;
1034
- this.form.reset();
1035
- this.initFilter();
1036
- if (emitEvent) {
1037
- this.filterClear.emit();
1038
- }
1039
- };
1040
- BaseFilterComponent.prototype.applyFilter = function () {
1041
- var filterValue = this.getFilterValue();
1042
- // If the filter is not null declare it, else - clear it.
1043
- if (filterValue) {
1044
- var filter = {
1045
- fieldId: this.field.id,
1046
- operator: this.operator,
1047
- operatorUnit: this.operatorUnit,
1048
- value: filterValue,
1049
- };
1050
- this._filter = filter;
1051
- this.filterChange.emit(filter);
1052
- }
1053
- else {
1054
- this.clearFilter();
1055
- }
1056
- };
1057
- BaseFilterComponent.prototype.ngOnInit = function () {
1058
- if (this.form) {
1059
- this.updateValidity();
1060
- }
1061
- };
1062
- BaseFilterComponent.prototype.ngOnChanges = function () {
1063
- // if (this.form) {
1064
- // this.updateValidity();
1065
- // }
1066
- };
1067
- BaseFilterComponent.prototype.ngOnDestroy = function () {
1068
- this._destroyed.next();
1069
- this._destroyed.complete();
1070
- if (this.showActionButtons) {
1071
- this.actionsContainerRef.destroy();
1072
- }
1073
- };
1074
- return BaseFilterComponent;
1075
- }());
1076
- BaseFilterComponent.decorators = [
1077
- { type: core.Directive, args: [{},] }
1078
- ];
1079
- BaseFilterComponent.ctorParameters = function () { return [
1080
- { type: core.ViewContainerRef },
1081
- { type: core.Injector },
1082
- { type: core.ComponentFactoryResolver },
1083
- { type: forms.FormBuilder },
1084
- { type: core$1.TranslateService },
1085
- { type: ngxLib.PepValidatorService },
1086
- { type: core.Renderer2 }
1087
- ]; };
1088
- BaseFilterComponent.propDecorators = {
1089
- field: [{ type: core.Input }],
1090
- variableField: [{ type: core.Input }],
1091
- filter: [{ type: core.Input }],
1092
- parentForm: [{ type: core.Input }],
1093
- emitOnChange: [{ type: core.Input }],
1094
- inline: [{ type: core.Input }],
1095
- showActionButtons: [{ type: core.Input }],
1096
- renderTitle: [{ type: core.Input }],
1097
- showAdditionalOperators: [{ type: core.Input }],
1098
- filterClear: [{ type: core.Output }],
1099
- filterChange: [{ type: core.Output }]
763
+ var BaseFilterComponent = /** @class */ (function () {
764
+ function BaseFilterComponent(viewContainerRef, injector, resolver, builder, translate, validator, renderer) {
765
+ this.viewContainerRef = viewContainerRef;
766
+ this.injector = injector;
767
+ this.resolver = resolver;
768
+ this.builder = builder;
769
+ this.translate = translate;
770
+ this.validator = validator;
771
+ this.renderer = renderer;
772
+ this._fieldIdWithNoDots = '';
773
+ this.variableFieldOptions = [];
774
+ this.emitOnChange = false;
775
+ this.inline = false;
776
+ this.showActionButtons = true;
777
+ this.renderTitle = true;
778
+ this.showAdditionalOperators = false;
779
+ this.filterClear = new core.EventEmitter();
780
+ this.filterChange = new core.EventEmitter();
781
+ this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
782
+ this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
783
+ this._destroyed = new rxjs.Subject();
784
+ }
785
+ Object.defineProperty(BaseFilterComponent.prototype, "field", {
786
+ get: function () {
787
+ return this._field;
788
+ },
789
+ set: function (value) {
790
+ this._field = value;
791
+ this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
792
+ this.setupForm();
793
+ },
794
+ enumerable: false,
795
+ configurable: true
796
+ });
797
+ Object.defineProperty(BaseFilterComponent.prototype, "variableField", {
798
+ set: function (list) {
799
+ if (list === null || list === void 0 ? void 0 : list.length) {
800
+ this.variableFieldOptions = list.map(function (item) {
801
+ return {
802
+ key: item,
803
+ value: item
804
+ };
805
+ });
806
+ }
807
+ },
808
+ enumerable: false,
809
+ configurable: true
810
+ });
811
+ Object.defineProperty(BaseFilterComponent.prototype, "filter", {
812
+ get: function () {
813
+ return this._filter;
814
+ },
815
+ set: function (value) {
816
+ this._filter = value;
817
+ this.setupFilter();
818
+ },
819
+ enumerable: false,
820
+ configurable: true
821
+ });
822
+ Object.defineProperty(BaseFilterComponent.prototype, "parentForm", {
823
+ set: function (form) {
824
+ this._parentForm = form;
825
+ this.updateParentForm();
826
+ },
827
+ enumerable: false,
828
+ configurable: true
829
+ });
830
+ Object.defineProperty(BaseFilterComponent.prototype, "operator", {
831
+ get: function () {
832
+ return this._operator;
833
+ },
834
+ set: function (operator) {
835
+ var _a;
836
+ if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
837
+ // Validate operator
838
+ var index = this.operators.findIndex(function (o) { return o.id === operator.id; });
839
+ if (index >= 0) {
840
+ this._operator = this.operators[index];
841
+ }
842
+ else {
843
+ this._operator = this.operators[0];
844
+ }
845
+ this.form.reset();
846
+ this.updateValidity();
847
+ }
848
+ },
849
+ enumerable: false,
850
+ configurable: true
851
+ });
852
+ Object.defineProperty(BaseFilterComponent.prototype, "operatorUnit", {
853
+ get: function () {
854
+ return this._operatorUnit;
855
+ },
856
+ set: function (operatorUnit) {
857
+ // Validate operator unit
858
+ if (operatorUnit) {
859
+ var index = this.operatorUnits.findIndex(function (ou) { return ou.id === operatorUnit.id; });
860
+ if (index >= 0) {
861
+ this._operatorUnit = this.operatorUnits[index];
862
+ }
863
+ else {
864
+ this._operatorUnit = this.operatorUnits[0];
865
+ }
866
+ }
867
+ else {
868
+ this._operatorUnit = undefined;
869
+ }
870
+ },
871
+ enumerable: false,
872
+ configurable: true
873
+ });
874
+ Object.defineProperty(BaseFilterComponent.prototype, "firstControlKey", {
875
+ get: function () {
876
+ return this.field ? this._fieldIdWithNoDots + "_first" : 'first';
877
+ },
878
+ enumerable: false,
879
+ configurable: true
880
+ });
881
+ Object.defineProperty(BaseFilterComponent.prototype, "firstControl", {
882
+ get: function () {
883
+ return this.form.get(this.firstControlKey);
884
+ },
885
+ enumerable: false,
886
+ configurable: true
887
+ });
888
+ Object.defineProperty(BaseFilterComponent.prototype, "secondControlKey", {
889
+ get: function () {
890
+ return this.field ? this._fieldIdWithNoDots + "_second" : 'second';
891
+ },
892
+ enumerable: false,
893
+ configurable: true
894
+ });
895
+ Object.defineProperty(BaseFilterComponent.prototype, "secondControl", {
896
+ get: function () {
897
+ return this.form.get(this.secondControlKey);
898
+ },
899
+ enumerable: false,
900
+ configurable: true
901
+ });
902
+ BaseFilterComponent.prototype.createActionsComponent = function () {
903
+ var _this = this;
904
+ var factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
905
+ this.actionsContainerRef = factory.create(this.injector);
906
+ this.actionsContainerRef.instance.form = this.form;
907
+ this.actionsContainerRef.instance.applyClick.subscribe(function () { return _this.applyFilter(); });
908
+ this.actionsContainerRef.instance.clearClick.subscribe(function () { return _this.clearFilter(); });
909
+ this.viewContainerRef.insert(this.actionsContainerRef.hostView);
910
+ };
911
+ BaseFilterComponent.prototype.setupForm = function () {
912
+ var formValue = {};
913
+ formValue[this.firstControlKey] = [];
914
+ formValue[this.secondControlKey] = [];
915
+ // this.form.patchValue(formValue);
916
+ this.form = this.builder.group(formValue);
917
+ // this.form[this.firstControlKey] = [];
918
+ // this.form[this.secondControlKey] = [];
919
+ this.setupOperators();
920
+ if (this.showActionButtons) {
921
+ this.createActionsComponent();
922
+ }
923
+ };
924
+ BaseFilterComponent.prototype.setupOperators = function () {
925
+ var _this = this;
926
+ var _a, _b, _c;
927
+ // Get the operators by componentType.
928
+ this.operators = Object.keys(PepSmartFilterOperators)
929
+ .filter(function (key) {
930
+ return PepSmartFilterOperators[key].componentType.includes(_this.field.componentType);
931
+ })
932
+ .map(function (key) { return PepSmartFilterOperators[key]; });
933
+ // Add additional operators
934
+ if (this.showAdditionalOperators) {
935
+ var additional = Object.keys(PepSmartFilterAdditionalOperators)
936
+ .filter(function (key) {
937
+ return PepSmartFilterAdditionalOperators[key].componentType.includes(_this.field.componentType);
938
+ })
939
+ .map(function (key) { return PepSmartFilterAdditionalOperators[key]; });
940
+ this.operators = __spreadArray(__spreadArray([], __read(this.operators)), __read(additional));
941
+ }
942
+ //add variable operators
943
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
944
+ var variables = Object.keys(PepSmartFilterVariableOperators)
945
+ .filter(function (key) {
946
+ return PepSmartFilterVariableOperators[key].componentType.includes(_this.field.componentType);
947
+ })
948
+ .map(function (key) { return PepSmartFilterVariableOperators[key]; });
949
+ this.operators = __spreadArray(__spreadArray([], __read(this.operators)), __read(variables));
950
+ }
951
+ // Filter by from field.operators input if exist.
952
+ if (((_b = this.field.operators) === null || _b === void 0 ? void 0 : _b.length) > 0) {
953
+ this.operators = this.operators.filter(function (o1) { return _this.field.operators.some(function (o2) { return o1.id === o2; }); });
954
+ }
955
+ // Get the operator units by componentType.
956
+ this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
957
+ .filter(function (key) {
958
+ return PepSmartFilterOperatorUnits[key].componentType.includes(_this.field.componentType);
959
+ })
960
+ .map(function (key) { return PepSmartFilterOperatorUnits[key]; });
961
+ // Filter by from field.operatorsUnits input if exist.
962
+ if (((_c = this.field.operatorUnits) === null || _c === void 0 ? void 0 : _c.length) > 0) {
963
+ this.operatorUnits = this.operatorUnits.filter(function (o1) { return _this.field.operatorUnits.some(function (o2) { return o1.id === o2; }); });
964
+ }
965
+ // Load translation before get the options in the children.
966
+ this.translate.get('SMART_FILTERS.TITLE').subscribe(function (res) {
967
+ _this.loadOperatorsOptions();
968
+ });
969
+ };
970
+ BaseFilterComponent.prototype.setupFilter = function () {
971
+ if (this.filter) {
972
+ this.operator = this.filter.operator;
973
+ this.operatorUnit = this.filter.operatorUnit;
974
+ var formValue = {};
975
+ formValue[this.firstControlKey] = this.filter.value.first;
976
+ formValue[this.secondControlKey] = this.filter.value.second;
977
+ this.form.patchValue(formValue);
978
+ }
979
+ else {
980
+ this.operator = this.getDefaultOperator();
981
+ this.operatorUnit = this.getDefaultOperatorUnit();
982
+ this.clearFilter(false);
983
+ }
984
+ };
985
+ BaseFilterComponent.prototype.updateParentForm = function () {
986
+ this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
987
+ this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
988
+ this._parentForm.setControl('operator', this.builder.control(this.operator));
989
+ this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
990
+ this._parentForm.setControl('values', this.builder.group({
991
+ first: this.firstControl,
992
+ second: this.secondControl
993
+ }));
994
+ };
995
+ BaseFilterComponent.prototype.getDestroyer = function () {
996
+ return operators.takeUntil(this._destroyed);
997
+ };
998
+ BaseFilterComponent.prototype.updateValidity = function () {
999
+ this.setFieldsStateAndValidators();
1000
+ this.firstControl.updateValueAndValidity();
1001
+ this.secondControl.updateValueAndValidity();
1002
+ };
1003
+ // Load the operators options from the translation.
1004
+ BaseFilterComponent.prototype.loadOperatorsOptions = function () {
1005
+ // Not implemented in the base
1006
+ };
1007
+ // Set default validators - some childs override this.
1008
+ BaseFilterComponent.prototype.setFieldsStateAndValidators = function () {
1009
+ this.firstControl.setValidators(forms.Validators.required);
1010
+ this.secondControl.setValidators(forms.Validators.required);
1011
+ this.secondControl.disable();
1012
+ };
1013
+ // Return undefined - some childs override this.
1014
+ BaseFilterComponent.prototype.getDefaultOperatorUnit = function () {
1015
+ return undefined;
1016
+ };
1017
+ BaseFilterComponent.prototype.initFilter = function () {
1018
+ // Not implemented in the base
1019
+ };
1020
+ BaseFilterComponent.prototype.clearFilter = function (emitEvent) {
1021
+ if (emitEvent === void 0) { emitEvent = true; }
1022
+ this._filter = null;
1023
+ this.form.reset();
1024
+ this.initFilter();
1025
+ if (emitEvent) {
1026
+ this.filterClear.emit();
1027
+ }
1028
+ };
1029
+ BaseFilterComponent.prototype.applyFilter = function () {
1030
+ var filterValue = this.getFilterValue();
1031
+ // If the filter is not null declare it, else - clear it.
1032
+ if (filterValue) {
1033
+ var filter = {
1034
+ fieldId: this.field.id,
1035
+ operator: this.operator,
1036
+ operatorUnit: this.operatorUnit,
1037
+ value: filterValue,
1038
+ };
1039
+ this._filter = filter;
1040
+ this.filterChange.emit(filter);
1041
+ }
1042
+ else {
1043
+ this.clearFilter();
1044
+ }
1045
+ };
1046
+ BaseFilterComponent.prototype.ngOnInit = function () {
1047
+ if (this.form) {
1048
+ this.updateValidity();
1049
+ }
1050
+ };
1051
+ BaseFilterComponent.prototype.ngOnChanges = function () {
1052
+ // if (this.form) {
1053
+ // this.updateValidity();
1054
+ // }
1055
+ };
1056
+ BaseFilterComponent.prototype.ngOnDestroy = function () {
1057
+ this._destroyed.next();
1058
+ this._destroyed.complete();
1059
+ if (this.showActionButtons) {
1060
+ this.actionsContainerRef.destroy();
1061
+ }
1062
+ };
1063
+ return BaseFilterComponent;
1064
+ }());
1065
+ BaseFilterComponent.decorators = [
1066
+ { type: core.Directive, args: [{},] }
1067
+ ];
1068
+ BaseFilterComponent.ctorParameters = function () { return [
1069
+ { type: core.ViewContainerRef },
1070
+ { type: core.Injector },
1071
+ { type: core.ComponentFactoryResolver },
1072
+ { type: forms.FormBuilder },
1073
+ { type: core$1.TranslateService },
1074
+ { type: ngxLib.PepValidatorService },
1075
+ { type: core.Renderer2 }
1076
+ ]; };
1077
+ BaseFilterComponent.propDecorators = {
1078
+ field: [{ type: core.Input }],
1079
+ variableField: [{ type: core.Input }],
1080
+ filter: [{ type: core.Input }],
1081
+ parentForm: [{ type: core.Input }],
1082
+ emitOnChange: [{ type: core.Input }],
1083
+ inline: [{ type: core.Input }],
1084
+ showActionButtons: [{ type: core.Input }],
1085
+ renderTitle: [{ type: core.Input }],
1086
+ showAdditionalOperators: [{ type: core.Input }],
1087
+ filterClear: [{ type: core.Output }],
1088
+ filterChange: [{ type: core.Output }]
1100
1089
  };
1101
1090
 
1102
- var PepTextFilterComponent = /** @class */ (function (_super) {
1103
- __extends(PepTextFilterComponent, _super);
1104
- function PepTextFilterComponent() {
1105
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1106
- _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1107
- _this.chooseTypeOptions = [];
1108
- _this.operatorWidth = '38%';
1109
- _this.firstControlWidth = '62%';
1110
- return _this;
1111
- }
1112
- PepTextFilterComponent.prototype.ngOnInit = function () {
1113
- var _this = this;
1114
- this.firstControl.valueChanges
1115
- .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1116
- .subscribe(function () {
1117
- _this.setFieldsStateAndValidators();
1118
- });
1119
- };
1120
- // Override
1121
- PepTextFilterComponent.prototype.getDefaultOperator = function () {
1122
- return PepSmartFilterOperators.Equals;
1123
- };
1124
- // Override
1125
- PepTextFilterComponent.prototype.getFilterValue = function () {
1126
- var filterValue = {
1127
- first: this.firstControl.value,
1128
- };
1129
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1130
- filterValue['second'] = this.secondControl.value;
1131
- }
1132
- return filterValue;
1133
- };
1134
- // Override
1135
- PepTextFilterComponent.prototype.loadOperatorsOptions = function () {
1136
- var _this = this;
1137
- this.chooseTypeOptions = this.operators.map(function (operator) {
1138
- return {
1139
- key: operator.id,
1140
- value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1141
- };
1142
- });
1143
- };
1144
- // Override
1145
- PepTextFilterComponent.prototype.setFieldsStateAndValidators = function () {
1146
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1147
- var firstValidators = [forms.Validators.required];
1148
- if (this.secondControl.value) {
1149
- firstValidators.push(this.validator.isLessThan(this.secondControl));
1150
- }
1151
- this.firstControl.setValidators(firstValidators);
1152
- }
1153
- else {
1154
- _super.prototype.setFieldsStateAndValidators.call(this);
1155
- }
1156
- };
1157
- PepTextFilterComponent.prototype.onOperatorChanged = function (value) {
1158
- var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1159
- this.operator = operator;
1160
- if (this._parentForm) {
1161
- this.updateParentForm();
1162
- }
1163
- if (this.emitOnChange) {
1164
- this.applyFilter();
1165
- }
1166
- };
1167
- PepTextFilterComponent.prototype.onVariableChanged = function (value) {
1168
- this.firstControl.setValue(value);
1169
- if (this.emitOnChange) {
1170
- this.applyFilter();
1171
- }
1172
- };
1173
- PepTextFilterComponent.prototype.onValueChanged = function () {
1174
- if (this.emitOnChange) {
1175
- this.applyFilter();
1176
- }
1177
- };
1178
- return PepTextFilterComponent;
1179
- }(BaseFilterComponent));
1180
- PepTextFilterComponent.decorators = [
1181
- { type: core.Component, args: [{
1182
- selector: 'pep-text-filter',
1183
- 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>",
1184
- styles: [""]
1185
- },] }
1091
+ var PepTextFilterComponent = /** @class */ (function (_super) {
1092
+ __extends(PepTextFilterComponent, _super);
1093
+ function PepTextFilterComponent() {
1094
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1095
+ _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1096
+ _this.chooseTypeOptions = [];
1097
+ _this.operatorWidth = '38%';
1098
+ _this.firstControlWidth = '62%';
1099
+ return _this;
1100
+ }
1101
+ PepTextFilterComponent.prototype.ngOnInit = function () {
1102
+ var _this = this;
1103
+ this.firstControl.valueChanges
1104
+ .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1105
+ .subscribe(function () {
1106
+ _this.setFieldsStateAndValidators();
1107
+ });
1108
+ };
1109
+ // Override
1110
+ PepTextFilterComponent.prototype.getDefaultOperator = function () {
1111
+ return PepSmartFilterOperators.Equals;
1112
+ };
1113
+ // Override
1114
+ PepTextFilterComponent.prototype.getFilterValue = function () {
1115
+ var filterValue = {
1116
+ first: this.firstControl.value,
1117
+ };
1118
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1119
+ filterValue['second'] = this.secondControl.value;
1120
+ }
1121
+ return filterValue;
1122
+ };
1123
+ // Override
1124
+ PepTextFilterComponent.prototype.loadOperatorsOptions = function () {
1125
+ var _this = this;
1126
+ this.chooseTypeOptions = this.operators.map(function (operator) {
1127
+ return {
1128
+ key: operator.id,
1129
+ value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1130
+ };
1131
+ });
1132
+ };
1133
+ // Override
1134
+ PepTextFilterComponent.prototype.setFieldsStateAndValidators = function () {
1135
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1136
+ var firstValidators = [forms.Validators.required];
1137
+ if (this.secondControl.value) {
1138
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
1139
+ }
1140
+ this.firstControl.setValidators(firstValidators);
1141
+ }
1142
+ else {
1143
+ _super.prototype.setFieldsStateAndValidators.call(this);
1144
+ }
1145
+ };
1146
+ PepTextFilterComponent.prototype.onOperatorChanged = function (value) {
1147
+ var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1148
+ this.operator = operator;
1149
+ if (this._parentForm) {
1150
+ this.updateParentForm();
1151
+ }
1152
+ if (this.emitOnChange) {
1153
+ this.applyFilter();
1154
+ }
1155
+ };
1156
+ PepTextFilterComponent.prototype.onVariableChanged = function (value) {
1157
+ this.firstControl.setValue(value);
1158
+ if (this.emitOnChange) {
1159
+ this.applyFilter();
1160
+ }
1161
+ };
1162
+ PepTextFilterComponent.prototype.onValueChanged = function () {
1163
+ if (this.emitOnChange) {
1164
+ this.applyFilter();
1165
+ }
1166
+ };
1167
+ return PepTextFilterComponent;
1168
+ }(BaseFilterComponent));
1169
+ PepTextFilterComponent.decorators = [
1170
+ { type: core.Component, args: [{
1171
+ selector: 'pep-text-filter',
1172
+ 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>",
1173
+ styles: [""]
1174
+ },] }
1186
1175
  ];
1187
1176
 
1188
- var PepBooleanFilterComponent = /** @class */ (function (_super) {
1189
- __extends(PepBooleanFilterComponent, _super);
1190
- function PepBooleanFilterComponent() {
1191
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1192
- _this.options = [];
1193
- _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1194
- _this.chooseTypeOptions = [];
1195
- return _this;
1196
- }
1197
- PepBooleanFilterComponent.prototype.ngOnInit = function () {
1198
- if (this.inline) {
1199
- this.setControlsWidth();
1200
- }
1201
- };
1202
- // Override
1203
- PepBooleanFilterComponent.prototype.getDefaultOperator = function () {
1204
- return PepSmartFilterOperators.Equals;
1205
- };
1206
- // Override
1207
- PepBooleanFilterComponent.prototype.getFilterValue = function () {
1208
- var filterValue = { first: this.firstControl.value || false };
1209
- return filterValue;
1210
- };
1211
- // Override
1212
- PepBooleanFilterComponent.prototype.loadOperatorsOptions = function () {
1213
- var _this = this;
1214
- this.chooseTypeOptions = this.operators.map(function (operator) {
1215
- return {
1216
- key: operator.id,
1217
- value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1218
- };
1219
- });
1220
- };
1221
- PepBooleanFilterComponent.prototype.setControlsWidth = function () {
1222
- var _a;
1223
- if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1224
- this.operatorWidth = '38%';
1225
- this.valueWidth = '62%';
1226
- }
1227
- else {
1228
- this.valueWidth = '100%';
1229
- }
1230
- };
1231
- PepBooleanFilterComponent.prototype.onOperatorChanged = function (value) {
1232
- var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1233
- this.operator = operator;
1234
- if (this._parentForm) {
1235
- this.updateParentForm();
1236
- }
1237
- if (this.emitOnChange) {
1238
- this.applyFilter();
1239
- }
1240
- };
1241
- PepBooleanFilterComponent.prototype.onValueChanged = function (value) {
1242
- this.firstControl.setValue(value);
1243
- if (this.emitOnChange) {
1244
- this.applyFilter();
1245
- }
1246
- };
1247
- return PepBooleanFilterComponent;
1248
- }(BaseFilterComponent));
1249
- PepBooleanFilterComponent.decorators = [
1250
- { type: core.Component, args: [{
1251
- selector: 'pep-boolean-filter',
1252
- 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>",
1253
- styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}"]
1254
- },] }
1255
- ];
1256
- PepBooleanFilterComponent.propDecorators = {
1257
- options: [{ type: core.Input }]
1177
+ var PepBooleanFilterComponent = /** @class */ (function (_super) {
1178
+ __extends(PepBooleanFilterComponent, _super);
1179
+ function PepBooleanFilterComponent() {
1180
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1181
+ _this.options = [];
1182
+ _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1183
+ _this.chooseTypeOptions = [];
1184
+ return _this;
1185
+ }
1186
+ PepBooleanFilterComponent.prototype.ngOnInit = function () {
1187
+ if (this.inline) {
1188
+ this.setControlsWidth();
1189
+ }
1190
+ };
1191
+ // Override
1192
+ PepBooleanFilterComponent.prototype.getDefaultOperator = function () {
1193
+ return PepSmartFilterOperators.Equals;
1194
+ };
1195
+ // Override
1196
+ PepBooleanFilterComponent.prototype.getFilterValue = function () {
1197
+ var filterValue = { first: this.firstControl.value || false };
1198
+ return filterValue;
1199
+ };
1200
+ // Override
1201
+ PepBooleanFilterComponent.prototype.loadOperatorsOptions = function () {
1202
+ var _this = this;
1203
+ this.chooseTypeOptions = this.operators.map(function (operator) {
1204
+ return {
1205
+ key: operator.id,
1206
+ value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1207
+ };
1208
+ });
1209
+ };
1210
+ PepBooleanFilterComponent.prototype.setControlsWidth = function () {
1211
+ var _a;
1212
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1213
+ this.operatorWidth = '38%';
1214
+ this.valueWidth = '62%';
1215
+ }
1216
+ else {
1217
+ this.valueWidth = '100%';
1218
+ }
1219
+ };
1220
+ PepBooleanFilterComponent.prototype.onOperatorChanged = function (value) {
1221
+ var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1222
+ this.operator = operator;
1223
+ if (this._parentForm) {
1224
+ this.updateParentForm();
1225
+ }
1226
+ if (this.emitOnChange) {
1227
+ this.applyFilter();
1228
+ }
1229
+ };
1230
+ PepBooleanFilterComponent.prototype.onValueChanged = function (value) {
1231
+ this.firstControl.setValue(value);
1232
+ if (this.emitOnChange) {
1233
+ this.applyFilter();
1234
+ }
1235
+ };
1236
+ return PepBooleanFilterComponent;
1237
+ }(BaseFilterComponent));
1238
+ PepBooleanFilterComponent.decorators = [
1239
+ { type: core.Component, args: [{
1240
+ selector: 'pep-boolean-filter',
1241
+ 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>",
1242
+ styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}"]
1243
+ },] }
1244
+ ];
1245
+ PepBooleanFilterComponent.propDecorators = {
1246
+ options: [{ type: core.Input }]
1258
1247
  };
1259
1248
 
1260
- var PepDateFilterComponent = /** @class */ (function (_super) {
1261
- __extends(PepDateFilterComponent, _super);
1262
- function PepDateFilterComponent() {
1263
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1264
- _this.PepSmartFilterOperators = PepSmartFilterOperators;
1265
- _this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
1266
- _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1267
- _this.chooseTimeOptions = [];
1268
- _this.chooseTimeUnitOptions = [];
1269
- return _this;
1270
- }
1271
- PepDateFilterComponent.prototype.ngOnInit = function () {
1272
- if (this.inline) {
1273
- this.setControlsWidth();
1274
- }
1275
- };
1276
- // Override
1277
- PepDateFilterComponent.prototype.getDefaultOperator = function () {
1278
- return PepSmartFilterOperators.InTheLast;
1279
- };
1280
- // Override
1281
- PepDateFilterComponent.prototype.getDefaultOperatorUnit = function () {
1282
- if (this.operator === PepSmartFilterOperators.InTheLast ||
1283
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
1284
- this.operator === PepSmartFilterOperators.NotInTheLast ||
1285
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
1286
- this.operator === PepSmartFilterOperators.DueIn ||
1287
- this.operator === PepSmartFilterOperators.NotDueIn) {
1288
- return PepSmartFilterOperatorUnits.Months;
1289
- }
1290
- else {
1291
- return undefined;
1292
- }
1293
- };
1294
- // Override
1295
- PepDateFilterComponent.prototype.getFilterValue = function () {
1296
- var filterValue = {
1297
- first: this.firstControl.value,
1298
- };
1299
- if (this.operator === PepSmartFilterOperators.DateRange) {
1300
- filterValue['second'] = this.secondControl.value;
1301
- }
1302
- return filterValue;
1303
- };
1304
- // Override
1305
- PepDateFilterComponent.prototype.loadOperatorsOptions = function () {
1306
- var _this = this;
1307
- this.chooseTimeOptions = this.operators.map(function (operator) {
1308
- return {
1309
- key: operator.id,
1310
- value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1311
- };
1312
- });
1313
- this.chooseTimeUnitOptions = this.operatorUnits.map(function (operatorUnit) {
1314
- return {
1315
- key: operatorUnit.id,
1316
- value: _this.translate.instant(_this.OPERATOR_UNITS_TRANSLATION_PREFIX + "." + operatorUnit.name),
1317
- };
1318
- });
1319
- };
1320
- // Override
1321
- PepDateFilterComponent.prototype.setFieldsStateAndValidators = function () {
1322
- this.firstControl.enable();
1323
- if (this.operator === PepSmartFilterOperators.DateRange) {
1324
- this.firstControl.setValidators(forms.Validators.required);
1325
- this.secondControl.enable();
1326
- this.secondControl.setValidators(forms.Validators.required);
1327
- }
1328
- else if (this.operator === PepSmartFilterOperators.InTheLast ||
1329
- this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
1330
- this.operator === PepSmartFilterOperators.NotInTheLast ||
1331
- this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
1332
- this.operator === PepSmartFilterOperators.DueIn ||
1333
- this.operator === PepSmartFilterOperators.NotDueIn) {
1334
- this.firstControl.setValidators([
1335
- forms.Validators.required,
1336
- this.validator.numberValidator(),
1337
- ]);
1338
- this.secondControl.disable();
1339
- }
1340
- else {
1341
- // Disable 'first' field.
1342
- if (this.operator === PepSmartFilterOperators.Today ||
1343
- this.operator === PepSmartFilterOperators.ThisWeek ||
1344
- this.operator === PepSmartFilterOperators.ThisMonth ||
1345
- this.operator === PepSmartFilterOperators.IsEmpty ||
1346
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
1347
- this.firstControl.disable();
1348
- }
1349
- // Default disable 'second' field.
1350
- _super.prototype.setFieldsStateAndValidators.call(this);
1351
- }
1352
- };
1353
- PepDateFilterComponent.prototype.setControlsWidth = function () {
1354
- if (this.operator === PepSmartFilterOperators.Today ||
1355
- this.operator === PepSmartFilterOperators.ThisWeek ||
1356
- this.operator === PepSmartFilterOperators.ThisMonth ||
1357
- this.operator === PepSmartFilterOperators.IsEmpty ||
1358
- this.operator === PepSmartFilterOperators.IsNotEmpty) {
1359
- this.operatorWidth = 'auto';
1360
- this.fieldsWidth = '0%';
1361
- }
1362
- else if (this.operator === PepSmartFilterOperators.On) {
1363
- this.operatorWidth = '38%';
1364
- this.fieldsWidth = '62%';
1365
- }
1366
- else {
1367
- this.operatorWidth = '30%';
1368
- this.fieldsWidth = '70%';
1369
- }
1370
- };
1371
- PepDateFilterComponent.prototype.onOperatorChanged = function (value) {
1372
- var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1373
- this.operator = operator;
1374
- this.operatorUnit = this.getDefaultOperatorUnit();
1375
- if (this.inline) {
1376
- this.setControlsWidth();
1377
- }
1378
- if (this._parentForm) {
1379
- this.updateParentForm();
1380
- }
1381
- if (this.emitOnChange) {
1382
- this.applyFilter();
1383
- }
1384
- };
1385
- PepDateFilterComponent.prototype.onTimeUnitChanged = function (value) {
1386
- var operatorUnit = Object.values(PepSmartFilterOperatorUnits).find(function (operatorUnit) { return operatorUnit.id === value; });
1387
- this.operatorUnit = operatorUnit;
1388
- if (this._parentForm) {
1389
- this.updateParentForm();
1390
- }
1391
- if (this.emitOnChange) {
1392
- this.applyFilter();
1393
- }
1394
- };
1395
- PepDateFilterComponent.prototype.onVariableChanged = function (value) {
1396
- this.firstControl.setValue(value);
1397
- if (this.emitOnChange) {
1398
- this.applyFilter();
1399
- }
1400
- };
1401
- PepDateFilterComponent.prototype.onDateValueChanged = function () {
1402
- if (this.emitOnChange) {
1403
- this.applyFilter();
1404
- }
1405
- };
1406
- return PepDateFilterComponent;
1407
- }(BaseFilterComponent));
1408
- PepDateFilterComponent.decorators = [
1409
- { type: core.Component, args: [{
1410
- selector: 'pep-date-filter',
1411
- 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>",
1412
- styles: [""]
1413
- },] }
1249
+ var PepDateFilterComponent = /** @class */ (function (_super) {
1250
+ __extends(PepDateFilterComponent, _super);
1251
+ function PepDateFilterComponent() {
1252
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1253
+ _this.PepSmartFilterOperators = PepSmartFilterOperators;
1254
+ _this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
1255
+ _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1256
+ _this.chooseTimeOptions = [];
1257
+ _this.chooseTimeUnitOptions = [];
1258
+ return _this;
1259
+ }
1260
+ PepDateFilterComponent.prototype.ngOnInit = function () {
1261
+ if (this.inline) {
1262
+ this.setControlsWidth();
1263
+ }
1264
+ };
1265
+ // Override
1266
+ PepDateFilterComponent.prototype.getDefaultOperator = function () {
1267
+ return PepSmartFilterOperators.InTheLast;
1268
+ };
1269
+ // Override
1270
+ PepDateFilterComponent.prototype.getDefaultOperatorUnit = function () {
1271
+ if (this.operator === PepSmartFilterOperators.InTheLast ||
1272
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
1273
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
1274
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
1275
+ this.operator === PepSmartFilterOperators.DueIn ||
1276
+ this.operator === PepSmartFilterOperators.NotDueIn) {
1277
+ return PepSmartFilterOperatorUnits.Months;
1278
+ }
1279
+ else {
1280
+ return undefined;
1281
+ }
1282
+ };
1283
+ // Override
1284
+ PepDateFilterComponent.prototype.getFilterValue = function () {
1285
+ var filterValue = {
1286
+ first: this.firstControl.value,
1287
+ };
1288
+ if (this.operator === PepSmartFilterOperators.DateRange ||
1289
+ PepSmartFilterVariableOperators.DateRangeVariable) {
1290
+ filterValue['second'] = this.secondControl.value;
1291
+ }
1292
+ return filterValue;
1293
+ };
1294
+ // Override
1295
+ PepDateFilterComponent.prototype.loadOperatorsOptions = function () {
1296
+ var _this = this;
1297
+ this.chooseTimeOptions = this.operators.map(function (operator) {
1298
+ return {
1299
+ key: operator.id,
1300
+ value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1301
+ };
1302
+ });
1303
+ this.chooseTimeUnitOptions = this.operatorUnits.map(function (operatorUnit) {
1304
+ return {
1305
+ key: operatorUnit.id,
1306
+ value: _this.translate.instant(_this.OPERATOR_UNITS_TRANSLATION_PREFIX + "." + operatorUnit.name),
1307
+ };
1308
+ });
1309
+ };
1310
+ // Override
1311
+ PepDateFilterComponent.prototype.setFieldsStateAndValidators = function () {
1312
+ this.firstControl.enable();
1313
+ if (this.operator === PepSmartFilterOperators.DateRange ||
1314
+ PepSmartFilterVariableOperators.DateRangeVariable) {
1315
+ this.firstControl.setValidators(forms.Validators.required);
1316
+ this.secondControl.enable();
1317
+ this.secondControl.setValidators(forms.Validators.required);
1318
+ }
1319
+ else if (this.operator === PepSmartFilterOperators.InTheLast ||
1320
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
1321
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
1322
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
1323
+ this.operator === PepSmartFilterOperators.DueIn ||
1324
+ this.operator === PepSmartFilterOperators.NotDueIn) {
1325
+ this.firstControl.setValidators([
1326
+ forms.Validators.required,
1327
+ this.validator.numberValidator(),
1328
+ ]);
1329
+ this.secondControl.disable();
1330
+ }
1331
+ else {
1332
+ // Disable 'first' field.
1333
+ if (this.operator === PepSmartFilterOperators.Today ||
1334
+ this.operator === PepSmartFilterOperators.ThisWeek ||
1335
+ this.operator === PepSmartFilterOperators.ThisMonth ||
1336
+ this.operator === PepSmartFilterOperators.IsEmpty ||
1337
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
1338
+ this.firstControl.disable();
1339
+ }
1340
+ // Default disable 'second' field.
1341
+ _super.prototype.setFieldsStateAndValidators.call(this);
1342
+ }
1343
+ };
1344
+ PepDateFilterComponent.prototype.setControlsWidth = function () {
1345
+ if (this.operator === PepSmartFilterOperators.Today ||
1346
+ this.operator === PepSmartFilterOperators.ThisWeek ||
1347
+ this.operator === PepSmartFilterOperators.ThisMonth ||
1348
+ this.operator === PepSmartFilterOperators.IsEmpty ||
1349
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
1350
+ this.operatorWidth = 'auto';
1351
+ this.fieldsWidth = '0%';
1352
+ }
1353
+ else if (this.operator === PepSmartFilterOperators.On) {
1354
+ this.operatorWidth = '38%';
1355
+ this.fieldsWidth = '62%';
1356
+ }
1357
+ else {
1358
+ this.operatorWidth = '30%';
1359
+ this.fieldsWidth = '70%';
1360
+ }
1361
+ };
1362
+ PepDateFilterComponent.prototype.onOperatorChanged = function (value) {
1363
+ var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1364
+ this.operator = operator;
1365
+ this.operatorUnit = this.getDefaultOperatorUnit();
1366
+ if (this.inline) {
1367
+ this.setControlsWidth();
1368
+ }
1369
+ if (this._parentForm) {
1370
+ this.updateParentForm();
1371
+ }
1372
+ if (this.emitOnChange) {
1373
+ this.applyFilter();
1374
+ }
1375
+ };
1376
+ PepDateFilterComponent.prototype.onTimeUnitChanged = function (value) {
1377
+ var operatorUnit = Object.values(PepSmartFilterOperatorUnits).find(function (operatorUnit) { return operatorUnit.id === value; });
1378
+ this.operatorUnit = operatorUnit;
1379
+ if (this._parentForm) {
1380
+ this.updateParentForm();
1381
+ }
1382
+ if (this.emitOnChange) {
1383
+ this.applyFilter();
1384
+ }
1385
+ };
1386
+ PepDateFilterComponent.prototype.onVariableChanged = function (value) {
1387
+ this.firstControl.setValue(value);
1388
+ if (this.emitOnChange) {
1389
+ this.applyFilter();
1390
+ }
1391
+ };
1392
+ PepDateFilterComponent.prototype.onSecondVariableChanged = function (value) {
1393
+ this.secondControl.setValue(value);
1394
+ if (this.emitOnChange) {
1395
+ this.applyFilter();
1396
+ }
1397
+ };
1398
+ PepDateFilterComponent.prototype.onDateValueChanged = function () {
1399
+ if (this.emitOnChange) {
1400
+ this.applyFilter();
1401
+ }
1402
+ };
1403
+ return PepDateFilterComponent;
1404
+ }(BaseFilterComponent));
1405
+ PepDateFilterComponent.decorators = [
1406
+ { type: core.Component, args: [{
1407
+ selector: 'pep-date-filter',
1408
+ 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",
1409
+ styles: [""]
1410
+ },] }
1414
1411
  ];
1415
1412
 
1416
- var PepMultiSelectFilterOption = /** @class */ (function () {
1417
- function PepMultiSelectFilterOption() {
1418
- this.selected = false;
1419
- }
1420
- return PepMultiSelectFilterOption;
1421
- }());
1422
- var PepMultiSelectFilterComponent = /** @class */ (function (_super) {
1423
- __extends(PepMultiSelectFilterComponent, _super);
1424
- function PepMultiSelectFilterComponent() {
1425
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1426
- _this.options = [];
1427
- _this.searchControl = new forms.FormControl();
1428
- //inline props
1429
- _this.selected = '';
1430
- _this.inlineOptions = [];
1431
- _this.MAX_OPTIONS_TO_SHOW = 6.35;
1432
- _this.numberOptionsToShowSearch = 10;
1433
- return _this;
1434
- }
1435
- PepMultiSelectFilterComponent.prototype.ngOnInit = function () {
1436
- _super.prototype.ngOnInit;
1437
- if (this.inline) {
1438
- this.inlineControlInit();
1439
- }
1440
- else {
1441
- this.noneInlineControlInit();
1442
- }
1443
- };
1444
- PepMultiSelectFilterComponent.prototype.ngAfterViewInit = function () {
1445
- // Calc for the first time.
1446
- this.calcOptionsHeight(this.options.length);
1447
- };
1448
- PepMultiSelectFilterComponent.prototype.inlineControlInit = function () {
1449
- var _a, _b, _c, _d;
1450
- //load options from field
1451
- 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 : [];
1452
- // Init the selected values from first value.
1453
- if (((_d = (_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.length) > 0) {
1454
- this.selected = this.firstControl.value.join(';');
1455
- }
1456
- };
1457
- PepMultiSelectFilterComponent.prototype.noneInlineControlInit = function () {
1458
- var _this = this;
1459
- var _a;
1460
- if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1461
- this.options = this.field.options.map(function (opt) {
1462
- return { value: opt.value, count: opt.count, selected: false };
1463
- });
1464
- }
1465
- else {
1466
- this.searchControl.disable();
1467
- }
1468
- // Init the selected values from first value.
1469
- var firstControl = this.firstControl;
1470
- if (firstControl.value) {
1471
- this.initOptionsSelectedValues(firstControl.value);
1472
- }
1473
- // Add subscription for the first value change to set the selected options.
1474
- firstControl.valueChanges
1475
- .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1476
- .subscribe(function (selectedValues) {
1477
- _this.initOptionsSelectedValues(selectedValues);
1478
- });
1479
- // Filter the options by the search control.
1480
- this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), operators.startWith(''), operators.map(function (option) { return typeof option === 'string' ? option : option && option.value; }), operators.map(function (value) { return (value ? _this.filterOptions(value) : _this.options); }));
1481
- // Each time the filter change.
1482
- this.filteredOptions$.subscribe(function (filterdOptions) {
1483
- _this.calcOptionsHeight(filterdOptions.length);
1484
- setTimeout(function () {
1485
- // 8 is the padding top of the multi-select-options
1486
- _this.virtualScroller.scrollToPosition(-8);
1487
- }, 125);
1488
- });
1489
- };
1490
- PepMultiSelectFilterComponent.prototype.initOptionsSelectedValues = function (selectedValues) {
1491
- this.options.forEach(function (opt) {
1492
- var isValueSelected = selectedValues && selectedValues.includes(opt.value);
1493
- opt.selected = isValueSelected;
1494
- });
1495
- };
1496
- PepMultiSelectFilterComponent.prototype.calcOptionsHeight = function (optionsCount) {
1497
- if (this.optionsContainer) {
1498
- var optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1499
- ? this.MAX_OPTIONS_TO_SHOW
1500
- : optionsCount;
1501
- // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1502
- var optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1503
- this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1504
- }
1505
- };
1506
- PepMultiSelectFilterComponent.prototype.filterOptions = function (value) {
1507
- var filterValue = value.toLowerCase();
1508
- return this.options.filter(function (opt) { return opt.value &&
1509
- opt.value.toLowerCase().includes(filterValue.toLowerCase()); });
1510
- };
1511
- // Override
1512
- PepMultiSelectFilterComponent.prototype.getDefaultOperator = function () {
1513
- return PepSmartFilterOperators.In;
1514
- };
1515
- // Override
1516
- PepMultiSelectFilterComponent.prototype.getFilterValue = function () {
1517
- if (this.inline) {
1518
- return {
1519
- first: this.firstControl.value
1520
- };
1521
- }
1522
- else {
1523
- var selectedValues = this.options
1524
- .filter(function (opt) { return opt.selected; })
1525
- .map(function (opt) { return opt.value; });
1526
- var filterValue = {
1527
- first: selectedValues,
1528
- };
1529
- return selectedValues.length > 0 ? filterValue : null;
1530
- }
1531
- };
1532
- // Override
1533
- PepMultiSelectFilterComponent.prototype.initFilter = function () {
1534
- this.options.forEach(function (opt) { return (opt.selected = false); });
1535
- this.searchControl.setValue('');
1536
- };
1537
- PepMultiSelectFilterComponent.prototype.onOptionChange = function (option, event) {
1538
- option.selected = event.checked;
1539
- this.firstControl.setValue(this.options.filter(function (opt) { return opt.selected; }).map(function (opt) { return opt.value; }), { emitEvent: false });
1540
- };
1541
- PepMultiSelectFilterComponent.prototype.onMultiSelectChanged = function (value) {
1542
- if (value) {
1543
- var selected = value.split(';');
1544
- this.firstControl.setValue(selected);
1545
- }
1546
- else {
1547
- this.firstControl.setValue(null);
1548
- }
1549
- if (this.emitOnChange) {
1550
- this.applyFilter();
1551
- }
1552
- };
1553
- return PepMultiSelectFilterComponent;
1554
- }(BaseFilterComponent));
1555
- PepMultiSelectFilterComponent.decorators = [
1556
- { type: core.Component, args: [{
1557
- selector: 'pep-multi-select-filter',
1558
- 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>",
1559
- 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)}"]
1560
- },] }
1561
- ];
1562
- PepMultiSelectFilterComponent.propDecorators = {
1563
- optionsContainer: [{ type: core.ViewChild, args: ['optionsContainer',] }],
1564
- virtualScroller: [{ type: core.ViewChild, args: [ngxVirtualScroller.VirtualScrollerComponent,] }]
1413
+ var PepMultiSelectFilterOption = /** @class */ (function () {
1414
+ function PepMultiSelectFilterOption() {
1415
+ this.selected = false;
1416
+ }
1417
+ return PepMultiSelectFilterOption;
1418
+ }());
1419
+ var PepMultiSelectFilterComponent = /** @class */ (function (_super) {
1420
+ __extends(PepMultiSelectFilterComponent, _super);
1421
+ function PepMultiSelectFilterComponent() {
1422
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1423
+ _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1424
+ _this.options = [];
1425
+ _this.chooseTypeOptions = [];
1426
+ _this.searchControl = new forms.FormControl();
1427
+ //inline props
1428
+ _this.selected = '';
1429
+ _this.inlineOptions = [];
1430
+ _this.MAX_OPTIONS_TO_SHOW = 6.35;
1431
+ _this.numberOptionsToShowSearch = 10;
1432
+ return _this;
1433
+ }
1434
+ PepMultiSelectFilterComponent.prototype.ngOnInit = function () {
1435
+ _super.prototype.ngOnInit;
1436
+ if (this.inline) {
1437
+ this.inlineControlInit();
1438
+ this.setControlsWidth();
1439
+ }
1440
+ else {
1441
+ this.noneInlineControlInit();
1442
+ }
1443
+ };
1444
+ PepMultiSelectFilterComponent.prototype.ngAfterViewInit = function () {
1445
+ // Calc for the first time.
1446
+ this.calcOptionsHeight(this.options.length);
1447
+ };
1448
+ PepMultiSelectFilterComponent.prototype.inlineControlInit = function () {
1449
+ var _a, _b, _c;
1450
+ //load options from field
1451
+ 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 : [];
1452
+ // init the selected values from first value.
1453
+ if (((_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) && Array.isArray(this.firstControl.value)) {
1454
+ this.selected = this.firstControl.value.join(';');
1455
+ }
1456
+ };
1457
+ PepMultiSelectFilterComponent.prototype.noneInlineControlInit = function () {
1458
+ var _this = this;
1459
+ var _a;
1460
+ if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1461
+ this.options = this.field.options.map(function (opt) {
1462
+ return { value: opt.value, count: opt.count, selected: false };
1463
+ });
1464
+ }
1465
+ else {
1466
+ this.searchControl.disable();
1467
+ }
1468
+ // Init the selected values from first value.
1469
+ var firstControl = this.firstControl;
1470
+ if (firstControl.value) {
1471
+ this.initOptionsSelectedValues(firstControl.value);
1472
+ }
1473
+ // Add subscription for the first value change to set the selected options.
1474
+ firstControl.valueChanges
1475
+ .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1476
+ .subscribe(function (selectedValues) {
1477
+ _this.initOptionsSelectedValues(selectedValues);
1478
+ });
1479
+ // Filter the options by the search control.
1480
+ this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), operators.startWith(''), operators.map(function (option) { return typeof option === 'string' ? option : option && option.value; }), operators.map(function (value) { return (value ? _this.filterOptions(value) : _this.options); }));
1481
+ // Each time the filter change.
1482
+ this.filteredOptions$.subscribe(function (filterdOptions) {
1483
+ _this.calcOptionsHeight(filterdOptions.length);
1484
+ setTimeout(function () {
1485
+ // 8 is the padding top of the multi-select-options
1486
+ _this.virtualScroller.scrollToPosition(-8);
1487
+ }, 125);
1488
+ });
1489
+ };
1490
+ PepMultiSelectFilterComponent.prototype.initOptionsSelectedValues = function (selectedValues) {
1491
+ this.options.forEach(function (opt) {
1492
+ var isValueSelected = selectedValues && selectedValues.includes(opt.value);
1493
+ opt.selected = isValueSelected;
1494
+ });
1495
+ };
1496
+ PepMultiSelectFilterComponent.prototype.calcOptionsHeight = function (optionsCount) {
1497
+ if (this.optionsContainer) {
1498
+ var optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1499
+ ? this.MAX_OPTIONS_TO_SHOW
1500
+ : optionsCount;
1501
+ // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1502
+ var optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1503
+ this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1504
+ }
1505
+ };
1506
+ PepMultiSelectFilterComponent.prototype.filterOptions = function (value) {
1507
+ var filterValue = value.toLowerCase();
1508
+ return this.options.filter(function (opt) { return opt.value &&
1509
+ opt.value.toLowerCase().includes(filterValue.toLowerCase()); });
1510
+ };
1511
+ // Override
1512
+ PepMultiSelectFilterComponent.prototype.getDefaultOperator = function () {
1513
+ return PepSmartFilterOperators.In;
1514
+ };
1515
+ // Override
1516
+ PepMultiSelectFilterComponent.prototype.getFilterValue = function () {
1517
+ if (this.inline) {
1518
+ return {
1519
+ first: this.firstControl.value
1520
+ };
1521
+ }
1522
+ else {
1523
+ var selectedValues = this.options
1524
+ .filter(function (opt) { return opt.selected; })
1525
+ .map(function (opt) { return opt.value; });
1526
+ var filterValue = {
1527
+ first: selectedValues,
1528
+ };
1529
+ return selectedValues.length > 0 ? filterValue : null;
1530
+ }
1531
+ };
1532
+ // Override
1533
+ PepMultiSelectFilterComponent.prototype.loadOperatorsOptions = function () {
1534
+ var _this = this;
1535
+ this.chooseTypeOptions = this.operators.map(function (operator) {
1536
+ return {
1537
+ key: operator.id,
1538
+ value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1539
+ };
1540
+ });
1541
+ };
1542
+ PepMultiSelectFilterComponent.prototype.setControlsWidth = function () {
1543
+ var _a;
1544
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1545
+ this.operatorWidth = '38%';
1546
+ this.valueWidth = '62%';
1547
+ }
1548
+ else {
1549
+ this.valueWidth = '100%';
1550
+ }
1551
+ };
1552
+ PepMultiSelectFilterComponent.prototype.onOperatorChanged = function (value) {
1553
+ var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1554
+ this.operator = operator;
1555
+ if (this._parentForm) {
1556
+ this.updateParentForm();
1557
+ }
1558
+ if (this.emitOnChange) {
1559
+ this.applyFilter();
1560
+ }
1561
+ };
1562
+ // Override
1563
+ PepMultiSelectFilterComponent.prototype.initFilter = function () {
1564
+ this.options.forEach(function (opt) { return (opt.selected = false); });
1565
+ this.searchControl.setValue('');
1566
+ };
1567
+ PepMultiSelectFilterComponent.prototype.onOptionChange = function (option, event) {
1568
+ option.selected = event.checked;
1569
+ this.firstControl.setValue(this.options.filter(function (opt) { return opt.selected; }).map(function (opt) { return opt.value; }), { emitEvent: false });
1570
+ };
1571
+ PepMultiSelectFilterComponent.prototype.onMultiSelectChanged = function (value) {
1572
+ if (value) {
1573
+ var selected = value.split(';');
1574
+ this.firstControl.setValue(selected);
1575
+ }
1576
+ else {
1577
+ this.firstControl.setValue(null);
1578
+ }
1579
+ if (this.emitOnChange) {
1580
+ this.applyFilter();
1581
+ }
1582
+ };
1583
+ PepMultiSelectFilterComponent.prototype.onValueChanged = function (value) {
1584
+ this.firstControl.setValue(value);
1585
+ if (this.emitOnChange) {
1586
+ this.applyFilter();
1587
+ }
1588
+ };
1589
+ return PepMultiSelectFilterComponent;
1590
+ }(BaseFilterComponent));
1591
+ PepMultiSelectFilterComponent.decorators = [
1592
+ { type: core.Component, args: [{
1593
+ selector: 'pep-multi-select-filter',
1594
+ 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>",
1595
+ 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)}"]
1596
+ },] }
1597
+ ];
1598
+ PepMultiSelectFilterComponent.propDecorators = {
1599
+ optionsContainer: [{ type: core.ViewChild, args: ['optionsContainer',] }],
1600
+ virtualScroller: [{ type: core.ViewChild, args: [ngxVirtualScroller.VirtualScrollerComponent,] }]
1565
1601
  };
1566
1602
 
1567
- var PepNumberFilterComponent = /** @class */ (function (_super) {
1568
- __extends(PepNumberFilterComponent, _super);
1569
- function PepNumberFilterComponent() {
1570
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1571
- _this.PepSmartFilterOperators = PepSmartFilterOperators;
1572
- _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1573
- _this.chooseTypeOptions = [];
1574
- _this.operatorWidth = '38%';
1575
- _this.fieldsWidth = '70%';
1576
- return _this;
1577
- }
1578
- PepNumberFilterComponent.prototype.ngOnInit = function () {
1579
- var _this = this;
1580
- this.firstControl.valueChanges
1581
- .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1582
- .subscribe(function () {
1583
- _this.setFieldsStateAndValidators();
1584
- });
1585
- this.secondControl.valueChanges
1586
- .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1587
- .subscribe(function () {
1588
- _this.setFieldsStateAndValidators();
1589
- });
1590
- this.setControlsWidth();
1591
- };
1592
- // Override
1593
- PepNumberFilterComponent.prototype.getDefaultOperator = function () {
1594
- return PepSmartFilterOperators.Equals;
1595
- };
1596
- // Override
1597
- PepNumberFilterComponent.prototype.getFilterValue = function () {
1598
- var filterValue = {
1599
- first: this.firstControl.value,
1600
- };
1601
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1602
- filterValue['second'] = this.secondControl.value;
1603
- }
1604
- return filterValue;
1605
- };
1606
- // Override
1607
- PepNumberFilterComponent.prototype.loadOperatorsOptions = function () {
1608
- var _this = this;
1609
- this.chooseTypeOptions = this.operators.map(function (operator) {
1610
- return {
1611
- key: operator.id,
1612
- value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1613
- };
1614
- });
1615
- };
1616
- // Override
1617
- PepNumberFilterComponent.prototype.setFieldsStateAndValidators = function () {
1618
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1619
- var firstValidators = [forms.Validators.required];
1620
- if (this.secondControl.value) {
1621
- firstValidators.push(this.validator.isLessThan(this.secondControl));
1622
- }
1623
- this.firstControl.setValidators(firstValidators);
1624
- this.secondControl.enable();
1625
- var secondValidators = [forms.Validators.required];
1626
- if (this.firstControl.value) {
1627
- secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1628
- }
1629
- this.secondControl.setValidators(secondValidators);
1630
- }
1631
- else {
1632
- _super.prototype.setFieldsStateAndValidators.call(this);
1633
- }
1634
- };
1635
- PepNumberFilterComponent.prototype.setControlsWidth = function () {
1636
- if (this.operator === PepSmartFilterOperators.NumberRange) {
1637
- this.operatorWidth = '30%';
1638
- this.fieldsWidth = '70%';
1639
- }
1640
- else {
1641
- this.operatorWidth = '38%';
1642
- this.fieldsWidth = '62%';
1643
- }
1644
- };
1645
- PepNumberFilterComponent.prototype.onOperatorChanged = function (value) {
1646
- var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1647
- this.operator = operator;
1648
- if (this._parentForm) {
1649
- this.updateParentForm();
1650
- }
1651
- if (this.emitOnChange) {
1652
- this.applyFilter();
1653
- }
1654
- this.setControlsWidth();
1655
- };
1656
- PepNumberFilterComponent.prototype.onVariableChanged = function (value) {
1657
- this.firstControl.setValue(value);
1658
- if (this.emitOnChange) {
1659
- this.applyFilter();
1660
- }
1661
- };
1662
- PepNumberFilterComponent.prototype.onValueChanged = function () {
1663
- if (this.emitOnChange) {
1664
- this.applyFilter();
1665
- }
1666
- };
1667
- return PepNumberFilterComponent;
1668
- }(BaseFilterComponent));
1669
- PepNumberFilterComponent.decorators = [
1670
- { type: core.Component, args: [{
1671
- selector: 'pep-number-filter',
1672
- 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>",
1673
- styles: [""]
1674
- },] }
1603
+ var PepNumberFilterComponent = /** @class */ (function (_super) {
1604
+ __extends(PepNumberFilterComponent, _super);
1605
+ function PepNumberFilterComponent() {
1606
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
1607
+ _this.PepSmartFilterOperators = PepSmartFilterOperators;
1608
+ _this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1609
+ _this.chooseTypeOptions = [];
1610
+ _this.operatorWidth = '38%';
1611
+ _this.fieldsWidth = '70%';
1612
+ return _this;
1613
+ }
1614
+ PepNumberFilterComponent.prototype.ngOnInit = function () {
1615
+ var _this = this;
1616
+ this.firstControl.valueChanges
1617
+ .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1618
+ .subscribe(function () {
1619
+ _this.setFieldsStateAndValidators();
1620
+ });
1621
+ this.secondControl.valueChanges
1622
+ .pipe(this.getDestroyer(), operators.distinctUntilChanged())
1623
+ .subscribe(function () {
1624
+ _this.setFieldsStateAndValidators();
1625
+ });
1626
+ this.setControlsWidth();
1627
+ };
1628
+ // Override
1629
+ PepNumberFilterComponent.prototype.getDefaultOperator = function () {
1630
+ return PepSmartFilterOperators.Equals;
1631
+ };
1632
+ // Override
1633
+ PepNumberFilterComponent.prototype.getFilterValue = function () {
1634
+ var filterValue = {
1635
+ first: this.firstControl.value,
1636
+ };
1637
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1638
+ filterValue['second'] = this.secondControl.value;
1639
+ }
1640
+ return filterValue;
1641
+ };
1642
+ // Override
1643
+ PepNumberFilterComponent.prototype.loadOperatorsOptions = function () {
1644
+ var _this = this;
1645
+ this.chooseTypeOptions = this.operators.map(function (operator) {
1646
+ return {
1647
+ key: operator.id,
1648
+ value: _this.translate.instant(_this.OPERATORS_TRANSLATION_PREFIX + "." + operator.name),
1649
+ };
1650
+ });
1651
+ };
1652
+ // Override
1653
+ PepNumberFilterComponent.prototype.setFieldsStateAndValidators = function () {
1654
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1655
+ var firstValidators = [forms.Validators.required];
1656
+ if (this.secondControl.value) {
1657
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
1658
+ }
1659
+ this.firstControl.setValidators(firstValidators);
1660
+ this.secondControl.enable();
1661
+ var secondValidators = [forms.Validators.required];
1662
+ if (this.firstControl.value) {
1663
+ secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1664
+ }
1665
+ this.secondControl.setValidators(secondValidators);
1666
+ }
1667
+ else {
1668
+ _super.prototype.setFieldsStateAndValidators.call(this);
1669
+ }
1670
+ };
1671
+ PepNumberFilterComponent.prototype.setControlsWidth = function () {
1672
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1673
+ this.operatorWidth = '30%';
1674
+ this.fieldsWidth = '70%';
1675
+ }
1676
+ else {
1677
+ this.operatorWidth = '38%';
1678
+ this.fieldsWidth = '62%';
1679
+ }
1680
+ };
1681
+ PepNumberFilterComponent.prototype.onOperatorChanged = function (value) {
1682
+ var operator = Object.values(this.operators).find(function (operator) { return operator.id === value; });
1683
+ this.operator = operator;
1684
+ if (this._parentForm) {
1685
+ this.updateParentForm();
1686
+ }
1687
+ if (this.emitOnChange) {
1688
+ this.applyFilter();
1689
+ }
1690
+ this.setControlsWidth();
1691
+ };
1692
+ PepNumberFilterComponent.prototype.onVariableChanged = function (value) {
1693
+ this.firstControl.setValue(value);
1694
+ if (this.emitOnChange) {
1695
+ this.applyFilter();
1696
+ }
1697
+ };
1698
+ PepNumberFilterComponent.prototype.onValueChanged = function () {
1699
+ if (this.emitOnChange) {
1700
+ this.applyFilter();
1701
+ }
1702
+ };
1703
+ return PepNumberFilterComponent;
1704
+ }(BaseFilterComponent));
1705
+ PepNumberFilterComponent.decorators = [
1706
+ { type: core.Component, args: [{
1707
+ selector: 'pep-number-filter',
1708
+ 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>",
1709
+ styles: [""]
1710
+ },] }
1675
1711
  ];
1676
1712
 
1677
- var PepSmartFiltersModule = /** @class */ (function () {
1678
- function PepSmartFiltersModule(pepIconRegistry) {
1679
- this.pepIconRegistry = pepIconRegistry;
1680
- this.pepIconRegistry.registerIcons([
1681
- icon.pepIconNumberMinus,
1682
- icon.pepIconNumberPlus,
1683
- ]);
1684
- }
1685
- return PepSmartFiltersModule;
1686
- }());
1687
- PepSmartFiltersModule.decorators = [
1688
- { type: core.NgModule, args: [{
1689
- imports: [
1690
- common.CommonModule,
1691
- forms.ReactiveFormsModule,
1692
- flexLayout.FlexLayoutModule,
1693
- // Material modules
1694
- core$2.MatCommonModule,
1695
- checkbox.MatCheckboxModule,
1696
- chips.MatChipsModule,
1697
- expansion.MatExpansionModule,
1698
- icon$1.MatIconModule,
1699
- formField.MatFormFieldModule,
1700
- input.MatInputModule,
1701
- radio.MatRadioModule,
1702
- // External modules
1703
- ngxVirtualScroller.VirtualScrollerModule,
1704
- // ngx-lib modules
1705
- ngxLib.PepNgxLibModule,
1706
- checkbox$1.PepCheckboxModule,
1707
- date.PepDateModule,
1708
- select.PepSelectModule,
1709
- textbox.PepTextboxModule,
1710
- search.PepSearchModule,
1711
- icon.PepIconModule,
1712
- button.PepButtonModule,
1713
- groupButtons.PepGroupButtonsModule
1714
- ],
1715
- exports: [
1716
- PepSmartFiltersComponent,
1717
- PepTextFilterComponent,
1718
- PepBooleanFilterComponent,
1719
- PepDateFilterComponent,
1720
- PepMultiSelectFilterComponent,
1721
- PepNumberFilterComponent
1722
- ],
1723
- declarations: [
1724
- // BaseFilterComponent,
1725
- PepSmartFiltersComponent,
1726
- PepFilterActionsComponent,
1727
- PepTextFilterComponent,
1728
- PepBooleanFilterComponent,
1729
- PepDateFilterComponent,
1730
- PepMultiSelectFilterComponent,
1731
- PepNumberFilterComponent
1732
- ],
1733
- },] }
1734
- ];
1735
- PepSmartFiltersModule.ctorParameters = function () { return [
1736
- { type: icon.PepIconRegistry }
1713
+ var PepSmartFiltersModule = /** @class */ (function () {
1714
+ function PepSmartFiltersModule(pepIconRegistry) {
1715
+ this.pepIconRegistry = pepIconRegistry;
1716
+ this.pepIconRegistry.registerIcons([
1717
+ icon.pepIconNumberMinus,
1718
+ icon.pepIconNumberPlus,
1719
+ ]);
1720
+ }
1721
+ return PepSmartFiltersModule;
1722
+ }());
1723
+ PepSmartFiltersModule.decorators = [
1724
+ { type: core.NgModule, args: [{
1725
+ imports: [
1726
+ common.CommonModule,
1727
+ forms.ReactiveFormsModule,
1728
+ flexLayout.FlexLayoutModule,
1729
+ // Material modules
1730
+ core$2.MatCommonModule,
1731
+ checkbox.MatCheckboxModule,
1732
+ chips.MatChipsModule,
1733
+ expansion.MatExpansionModule,
1734
+ icon$1.MatIconModule,
1735
+ formField.MatFormFieldModule,
1736
+ input.MatInputModule,
1737
+ radio.MatRadioModule,
1738
+ // External modules
1739
+ ngxVirtualScroller.VirtualScrollerModule,
1740
+ // ngx-lib modules
1741
+ ngxLib.PepNgxLibModule,
1742
+ checkbox$1.PepCheckboxModule,
1743
+ date.PepDateModule,
1744
+ select.PepSelectModule,
1745
+ textbox.PepTextboxModule,
1746
+ search.PepSearchModule,
1747
+ icon.PepIconModule,
1748
+ button.PepButtonModule,
1749
+ groupButtons.PepGroupButtonsModule
1750
+ ],
1751
+ exports: [
1752
+ PepSmartFiltersComponent,
1753
+ PepTextFilterComponent,
1754
+ PepBooleanFilterComponent,
1755
+ PepDateFilterComponent,
1756
+ PepMultiSelectFilterComponent,
1757
+ PepNumberFilterComponent
1758
+ ],
1759
+ declarations: [
1760
+ // BaseFilterComponent,
1761
+ PepSmartFiltersComponent,
1762
+ PepFilterActionsComponent,
1763
+ PepTextFilterComponent,
1764
+ PepBooleanFilterComponent,
1765
+ PepDateFilterComponent,
1766
+ PepMultiSelectFilterComponent,
1767
+ PepNumberFilterComponent
1768
+ ],
1769
+ },] }
1770
+ ];
1771
+ PepSmartFiltersModule.ctorParameters = function () { return [
1772
+ { type: icon.PepIconRegistry }
1737
1773
  ]; };
1738
1774
 
1739
- // Base field
1740
- // ------------------------------
1741
- var PepSmartFilterBaseField = /** @class */ (function () {
1742
- function PepSmartFilterBaseField(field) {
1743
- this.id = field.id;
1744
- this.name = field.name;
1745
- this.isOpen = field.isOpen;
1746
- this.options = field.options;
1747
- this.operators = field.operators;
1748
- this.operatorUnits = field.operatorUnits;
1749
- this._type = this.getType();
1750
- }
1751
- Object.defineProperty(PepSmartFilterBaseField.prototype, "componentType", {
1752
- get: function () {
1753
- return this._componentType;
1754
- },
1755
- enumerable: false,
1756
- configurable: true
1757
- });
1758
- Object.defineProperty(PepSmartFilterBaseField.prototype, "type", {
1759
- get: function () {
1760
- return this._type;
1761
- },
1762
- enumerable: false,
1763
- configurable: true
1764
- });
1765
- return PepSmartFilterBaseField;
1766
- }());
1767
- // Text field
1768
- // ------------------------------
1769
- var PepSmartFilterTextField = /** @class */ (function (_super) {
1770
- __extends(PepSmartFilterTextField, _super);
1771
- function PepSmartFilterTextField(field) {
1772
- var _this = _super.call(this, field) || this;
1773
- _this._componentType = 'text';
1774
- return _this;
1775
- }
1776
- PepSmartFilterTextField.prototype.getType = function () {
1777
- return 'text';
1778
- };
1779
- return PepSmartFilterTextField;
1780
- }(PepSmartFilterBaseField));
1781
- // Boolean field
1782
- // ------------------------------
1783
- var PepSmartFilterBooleanField = /** @class */ (function (_super) {
1784
- __extends(PepSmartFilterBooleanField, _super);
1785
- function PepSmartFilterBooleanField(field) {
1786
- var _this = _super.call(this, field) || this;
1787
- _this._componentType = 'boolean';
1788
- return _this;
1789
- }
1790
- PepSmartFilterBooleanField.prototype.getType = function () {
1791
- return 'boolean';
1792
- };
1793
- return PepSmartFilterBooleanField;
1794
- }(PepSmartFilterBaseField));
1795
- // Date fields
1796
- // ------------------------------
1797
- var PepSmartFilterDateBaseField = /** @class */ (function (_super) {
1798
- __extends(PepSmartFilterDateBaseField, _super);
1799
- function PepSmartFilterDateBaseField(field) {
1800
- var _this = _super.call(this, field) || this;
1801
- _this._componentType = 'date';
1802
- return _this;
1803
- }
1804
- return PepSmartFilterDateBaseField;
1805
- }(PepSmartFilterBaseField));
1806
- var PepSmartFilterDateField = /** @class */ (function (_super) {
1807
- __extends(PepSmartFilterDateField, _super);
1808
- function PepSmartFilterDateField(field) {
1809
- return _super.call(this, field) || this;
1810
- }
1811
- PepSmartFilterDateField.prototype.getType = function () {
1812
- return 'date';
1813
- };
1814
- return PepSmartFilterDateField;
1815
- }(PepSmartFilterDateBaseField));
1816
- var PepSmartFilterDateTimeField = /** @class */ (function (_super) {
1817
- __extends(PepSmartFilterDateTimeField, _super);
1818
- function PepSmartFilterDateTimeField(field) {
1819
- return _super.call(this, field) || this;
1820
- }
1821
- PepSmartFilterDateTimeField.prototype.getType = function () {
1822
- return 'date-time';
1823
- };
1824
- return PepSmartFilterDateTimeField;
1825
- }(PepSmartFilterDateBaseField));
1826
- // Multi select field
1827
- // ------------------------------
1828
- var PepSmartFilterMultiSelectField = /** @class */ (function (_super) {
1829
- __extends(PepSmartFilterMultiSelectField, _super);
1830
- function PepSmartFilterMultiSelectField(field) {
1831
- var _this = _super.call(this, field) || this;
1832
- _this._componentType = 'multi-select';
1833
- return _this;
1834
- }
1835
- PepSmartFilterMultiSelectField.prototype.getType = function () {
1836
- return 'multi-select';
1837
- };
1838
- return PepSmartFilterMultiSelectField;
1839
- }(PepSmartFilterBaseField));
1840
- // Number fields
1841
- // ------------------------------
1842
- var PepSmartFilterNumberBaseField = /** @class */ (function (_super) {
1843
- __extends(PepSmartFilterNumberBaseField, _super);
1844
- function PepSmartFilterNumberBaseField(field) {
1845
- var _this = _super.call(this, field) || this;
1846
- _this._componentType = 'number';
1847
- return _this;
1848
- }
1849
- return PepSmartFilterNumberBaseField;
1850
- }(PepSmartFilterBaseField));
1851
- var PepSmartFilterIntField = /** @class */ (function (_super) {
1852
- __extends(PepSmartFilterIntField, _super);
1853
- function PepSmartFilterIntField(field) {
1854
- return _super.call(this, field) || this;
1855
- }
1856
- PepSmartFilterIntField.prototype.getType = function () {
1857
- return 'int';
1858
- };
1859
- return PepSmartFilterIntField;
1860
- }(PepSmartFilterNumberBaseField));
1861
- var PepSmartFilterRealField = /** @class */ (function (_super) {
1862
- __extends(PepSmartFilterRealField, _super);
1863
- function PepSmartFilterRealField(field) {
1864
- return _super.call(this, field) || this;
1865
- }
1866
- PepSmartFilterRealField.prototype.getType = function () {
1867
- return 'real';
1868
- };
1869
- return PepSmartFilterRealField;
1870
- }(PepSmartFilterNumberBaseField));
1871
- var PepSmartFilterCurrencyField = /** @class */ (function (_super) {
1872
- __extends(PepSmartFilterCurrencyField, _super);
1873
- function PepSmartFilterCurrencyField(field) {
1874
- return _super.call(this, field) || this;
1875
- }
1876
- PepSmartFilterCurrencyField.prototype.getType = function () {
1877
- return 'currency';
1878
- };
1879
- return PepSmartFilterCurrencyField;
1880
- }(PepSmartFilterNumberBaseField));
1881
- var PepSmartFilterPercentageField = /** @class */ (function (_super) {
1882
- __extends(PepSmartFilterPercentageField, _super);
1883
- function PepSmartFilterPercentageField(field) {
1884
- return _super.call(this, field) || this;
1885
- }
1886
- PepSmartFilterPercentageField.prototype.getType = function () {
1887
- return 'percentage';
1888
- };
1889
- return PepSmartFilterPercentageField;
1775
+ // Base field
1776
+ // ------------------------------
1777
+ var PepSmartFilterBaseField = /** @class */ (function () {
1778
+ function PepSmartFilterBaseField(field) {
1779
+ this.id = field.id;
1780
+ this.name = field.name;
1781
+ this.isOpen = field.isOpen;
1782
+ this.options = field.options;
1783
+ this.operators = field.operators;
1784
+ this.operatorUnits = field.operatorUnits;
1785
+ this._type = this.getType();
1786
+ }
1787
+ Object.defineProperty(PepSmartFilterBaseField.prototype, "componentType", {
1788
+ get: function () {
1789
+ return this._componentType;
1790
+ },
1791
+ enumerable: false,
1792
+ configurable: true
1793
+ });
1794
+ Object.defineProperty(PepSmartFilterBaseField.prototype, "type", {
1795
+ get: function () {
1796
+ return this._type;
1797
+ },
1798
+ enumerable: false,
1799
+ configurable: true
1800
+ });
1801
+ return PepSmartFilterBaseField;
1802
+ }());
1803
+ // Text field
1804
+ // ------------------------------
1805
+ var PepSmartFilterTextField = /** @class */ (function (_super) {
1806
+ __extends(PepSmartFilterTextField, _super);
1807
+ function PepSmartFilterTextField(field) {
1808
+ var _this = _super.call(this, field) || this;
1809
+ _this._componentType = 'text';
1810
+ return _this;
1811
+ }
1812
+ PepSmartFilterTextField.prototype.getType = function () {
1813
+ return 'text';
1814
+ };
1815
+ return PepSmartFilterTextField;
1816
+ }(PepSmartFilterBaseField));
1817
+ // Boolean field
1818
+ // ------------------------------
1819
+ var PepSmartFilterBooleanField = /** @class */ (function (_super) {
1820
+ __extends(PepSmartFilterBooleanField, _super);
1821
+ function PepSmartFilterBooleanField(field) {
1822
+ var _this = _super.call(this, field) || this;
1823
+ _this._componentType = 'boolean';
1824
+ return _this;
1825
+ }
1826
+ PepSmartFilterBooleanField.prototype.getType = function () {
1827
+ return 'boolean';
1828
+ };
1829
+ return PepSmartFilterBooleanField;
1830
+ }(PepSmartFilterBaseField));
1831
+ // Date fields
1832
+ // ------------------------------
1833
+ var PepSmartFilterDateBaseField = /** @class */ (function (_super) {
1834
+ __extends(PepSmartFilterDateBaseField, _super);
1835
+ function PepSmartFilterDateBaseField(field) {
1836
+ var _this = _super.call(this, field) || this;
1837
+ _this._componentType = 'date';
1838
+ return _this;
1839
+ }
1840
+ return PepSmartFilterDateBaseField;
1841
+ }(PepSmartFilterBaseField));
1842
+ var PepSmartFilterDateField = /** @class */ (function (_super) {
1843
+ __extends(PepSmartFilterDateField, _super);
1844
+ function PepSmartFilterDateField(field) {
1845
+ return _super.call(this, field) || this;
1846
+ }
1847
+ PepSmartFilterDateField.prototype.getType = function () {
1848
+ return 'date';
1849
+ };
1850
+ return PepSmartFilterDateField;
1851
+ }(PepSmartFilterDateBaseField));
1852
+ var PepSmartFilterDateTimeField = /** @class */ (function (_super) {
1853
+ __extends(PepSmartFilterDateTimeField, _super);
1854
+ function PepSmartFilterDateTimeField(field) {
1855
+ return _super.call(this, field) || this;
1856
+ }
1857
+ PepSmartFilterDateTimeField.prototype.getType = function () {
1858
+ return 'date-time';
1859
+ };
1860
+ return PepSmartFilterDateTimeField;
1861
+ }(PepSmartFilterDateBaseField));
1862
+ // Multi select field
1863
+ // ------------------------------
1864
+ var PepSmartFilterMultiSelectField = /** @class */ (function (_super) {
1865
+ __extends(PepSmartFilterMultiSelectField, _super);
1866
+ function PepSmartFilterMultiSelectField(field) {
1867
+ var _this = _super.call(this, field) || this;
1868
+ _this._componentType = 'multi-select';
1869
+ return _this;
1870
+ }
1871
+ PepSmartFilterMultiSelectField.prototype.getType = function () {
1872
+ return 'multi-select';
1873
+ };
1874
+ return PepSmartFilterMultiSelectField;
1875
+ }(PepSmartFilterBaseField));
1876
+ // Number fields
1877
+ // ------------------------------
1878
+ var PepSmartFilterNumberBaseField = /** @class */ (function (_super) {
1879
+ __extends(PepSmartFilterNumberBaseField, _super);
1880
+ function PepSmartFilterNumberBaseField(field) {
1881
+ var _this = _super.call(this, field) || this;
1882
+ _this._componentType = 'number';
1883
+ return _this;
1884
+ }
1885
+ return PepSmartFilterNumberBaseField;
1886
+ }(PepSmartFilterBaseField));
1887
+ var PepSmartFilterIntField = /** @class */ (function (_super) {
1888
+ __extends(PepSmartFilterIntField, _super);
1889
+ function PepSmartFilterIntField(field) {
1890
+ return _super.call(this, field) || this;
1891
+ }
1892
+ PepSmartFilterIntField.prototype.getType = function () {
1893
+ return 'int';
1894
+ };
1895
+ return PepSmartFilterIntField;
1896
+ }(PepSmartFilterNumberBaseField));
1897
+ var PepSmartFilterRealField = /** @class */ (function (_super) {
1898
+ __extends(PepSmartFilterRealField, _super);
1899
+ function PepSmartFilterRealField(field) {
1900
+ return _super.call(this, field) || this;
1901
+ }
1902
+ PepSmartFilterRealField.prototype.getType = function () {
1903
+ return 'real';
1904
+ };
1905
+ return PepSmartFilterRealField;
1906
+ }(PepSmartFilterNumberBaseField));
1907
+ var PepSmartFilterCurrencyField = /** @class */ (function (_super) {
1908
+ __extends(PepSmartFilterCurrencyField, _super);
1909
+ function PepSmartFilterCurrencyField(field) {
1910
+ return _super.call(this, field) || this;
1911
+ }
1912
+ PepSmartFilterCurrencyField.prototype.getType = function () {
1913
+ return 'currency';
1914
+ };
1915
+ return PepSmartFilterCurrencyField;
1916
+ }(PepSmartFilterNumberBaseField));
1917
+ var PepSmartFilterPercentageField = /** @class */ (function (_super) {
1918
+ __extends(PepSmartFilterPercentageField, _super);
1919
+ function PepSmartFilterPercentageField(field) {
1920
+ return _super.call(this, field) || this;
1921
+ }
1922
+ PepSmartFilterPercentageField.prototype.getType = function () {
1923
+ return 'percentage';
1924
+ };
1925
+ return PepSmartFilterPercentageField;
1890
1926
  }(PepSmartFilterNumberBaseField));
1891
1927
 
1892
- function createTextSmartFilterField(data) {
1893
- return new PepSmartFilterTextField(data);
1894
- }
1895
- function createBooleanSmartFilterField(data) {
1896
- return new PepSmartFilterBooleanField(data);
1897
- }
1898
- function createDateSmartFilterField(data) {
1899
- return new PepSmartFilterDateField(data);
1900
- }
1901
- function createDateTimeSmartFilterField(data) {
1902
- return new PepSmartFilterDateTimeField(data);
1903
- }
1904
- function createMultiSelectSmartFilterField(data) {
1905
- return new PepSmartFilterMultiSelectField(data);
1906
- }
1907
- function createIntSmartFilterField(data) {
1908
- return new PepSmartFilterIntField(data);
1909
- }
1910
- function createRealSmartFilterField(data) {
1911
- return new PepSmartFilterRealField(data);
1912
- }
1913
- function createCurrencySmartFilterField(data) {
1914
- return new PepSmartFilterCurrencyField(data);
1915
- }
1916
- function createPercentageSmartFilterField(data) {
1917
- return new PepSmartFilterPercentageField(data);
1918
- }
1919
- function createSmartFilterField(data, type) {
1920
- var field;
1921
- switch (type) {
1922
- case 'text':
1923
- field = createTextSmartFilterField(data);
1924
- break;
1925
- case 'boolean':
1926
- field = createBooleanSmartFilterField(data);
1927
- break;
1928
- case 'date':
1929
- field = createDateSmartFilterField(data);
1930
- break;
1931
- case 'date-time':
1932
- field = createDateTimeSmartFilterField(data);
1933
- break;
1934
- case 'multi-select':
1935
- field = createMultiSelectSmartFilterField(data);
1936
- break;
1937
- case 'int':
1938
- field = createIntSmartFilterField(data);
1939
- break;
1940
- case 'real':
1941
- field = createRealSmartFilterField(data);
1942
- break;
1943
- case 'currency':
1944
- field = createCurrencySmartFilterField(data);
1945
- break;
1946
- case 'percentage':
1947
- field = createPercentageSmartFilterField(data);
1948
- break;
1949
- default:
1950
- field = createMultiSelectSmartFilterField(data);
1951
- break;
1952
- }
1953
- return field;
1954
- }
1955
- function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1956
- return {
1957
- fieldId: fieldId,
1958
- operator: operator,
1959
- operatorUnit: operatorUnit,
1960
- value: {
1961
- first: first,
1962
- second: second,
1963
- },
1964
- };
1928
+ function createTextSmartFilterField(data) {
1929
+ return new PepSmartFilterTextField(data);
1930
+ }
1931
+ function createBooleanSmartFilterField(data) {
1932
+ return new PepSmartFilterBooleanField(data);
1933
+ }
1934
+ function createDateSmartFilterField(data) {
1935
+ return new PepSmartFilterDateField(data);
1936
+ }
1937
+ function createDateTimeSmartFilterField(data) {
1938
+ return new PepSmartFilterDateTimeField(data);
1939
+ }
1940
+ function createMultiSelectSmartFilterField(data) {
1941
+ return new PepSmartFilterMultiSelectField(data);
1942
+ }
1943
+ function createIntSmartFilterField(data) {
1944
+ return new PepSmartFilterIntField(data);
1945
+ }
1946
+ function createRealSmartFilterField(data) {
1947
+ return new PepSmartFilterRealField(data);
1948
+ }
1949
+ function createCurrencySmartFilterField(data) {
1950
+ return new PepSmartFilterCurrencyField(data);
1951
+ }
1952
+ function createPercentageSmartFilterField(data) {
1953
+ return new PepSmartFilterPercentageField(data);
1954
+ }
1955
+ function createSmartFilterField(data, type) {
1956
+ var field;
1957
+ switch (type) {
1958
+ case 'text':
1959
+ field = createTextSmartFilterField(data);
1960
+ break;
1961
+ case 'boolean':
1962
+ field = createBooleanSmartFilterField(data);
1963
+ break;
1964
+ case 'date':
1965
+ field = createDateSmartFilterField(data);
1966
+ break;
1967
+ case 'date-time':
1968
+ field = createDateTimeSmartFilterField(data);
1969
+ break;
1970
+ case 'multi-select':
1971
+ field = createMultiSelectSmartFilterField(data);
1972
+ break;
1973
+ case 'int':
1974
+ field = createIntSmartFilterField(data);
1975
+ break;
1976
+ case 'real':
1977
+ field = createRealSmartFilterField(data);
1978
+ break;
1979
+ case 'currency':
1980
+ field = createCurrencySmartFilterField(data);
1981
+ break;
1982
+ case 'percentage':
1983
+ field = createPercentageSmartFilterField(data);
1984
+ break;
1985
+ default:
1986
+ field = createMultiSelectSmartFilterField(data);
1987
+ break;
1988
+ }
1989
+ return field;
1990
+ }
1991
+ function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1992
+ return {
1993
+ fieldId: fieldId,
1994
+ operator: operator,
1995
+ operatorUnit: operatorUnit,
1996
+ value: {
1997
+ first: first,
1998
+ second: second,
1999
+ },
2000
+ };
1965
2001
  }
1966
2002
 
1967
- /*
1968
- * Public API Surface of ngx-lib/smart-filters
2003
+ /*
2004
+ * Public API Surface of ngx-lib/smart-filters
1969
2005
  */
1970
2006
 
1971
- /**
1972
- * Generated bundle index. Do not edit.
2007
+ /**
2008
+ * Generated bundle index. Do not edit.
1973
2009
  */
1974
2010
 
1975
2011
  exports.BaseFilterComponent = BaseFilterComponent;