@pepperi-addons/ngx-lib 0.3.15-beta.60 → 0.3.15-beta.61

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 (690) 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 +302 -302
  21. package/bundles/pepperi-addons-ngx-lib-date.umd.js +667 -667
  22. package/bundles/pepperi-addons-ngx-lib-dialog.umd.js +519 -519
  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 +3253 -3253
  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 +324 -324
  30. package/bundles/pepperi-addons-ngx-lib-images-filmstrip.umd.js +360 -360
  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 +930 -930
  37. package/bundles/pepperi-addons-ngx-lib-query-builder.umd.js +1181 -1181
  38. package/bundles/pepperi-addons-ngx-lib-remote-loader.umd.js +683 -683
  39. package/bundles/pepperi-addons-ngx-lib-rich-html-textarea.umd.js +275 -275
  40. package/bundles/pepperi-addons-ngx-lib-search.umd.js +326 -326
  41. package/bundles/pepperi-addons-ngx-lib-select.umd.js +587 -587
  42. package/bundles/pepperi-addons-ngx-lib-separator.umd.js +79 -79
  43. package/bundles/pepperi-addons-ngx-lib-side-bar.umd.js +165 -165
  44. package/bundles/pepperi-addons-ngx-lib-signature.umd.js +286 -286
  45. package/bundles/pepperi-addons-ngx-lib-size-detector.umd.js +113 -113
  46. package/bundles/pepperi-addons-ngx-lib-slider.umd.js +124 -124
  47. package/bundles/pepperi-addons-ngx-lib-smart-filters.umd.js +1974 -1974
  48. package/bundles/pepperi-addons-ngx-lib-snack-bar.umd.js +148 -148
  49. package/bundles/pepperi-addons-ngx-lib-textarea.umd.js +211 -211
  50. package/bundles/pepperi-addons-ngx-lib-textbox-icon.umd.js +80 -80
  51. package/bundles/pepperi-addons-ngx-lib-textbox.umd.js +553 -553
  52. package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +129 -129
  53. package/bundles/pepperi-addons-ngx-lib.umd.js +4963 -4962
  54. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  55. package/button/button.component.d.ts +99 -99
  56. package/button/button.model.d.ts +14 -14
  57. package/button/button.module.d.ts +2 -2
  58. package/button/pepperi-addons-ngx-lib-button.d.ts +4 -4
  59. package/button/public-api.d.ts +3 -3
  60. package/carousel/carousel-item.directive.d.ts +9 -9
  61. package/carousel/carousel.component.d.ts +145 -145
  62. package/carousel/carousel.module.d.ts +2 -2
  63. package/carousel/pepperi-addons-ngx-lib-carousel.d.ts +4 -4
  64. package/carousel/public-api.d.ts +3 -3
  65. package/checkbox/checkbox.component.d.ts +47 -47
  66. package/checkbox/checkbox.module.d.ts +5 -5
  67. package/checkbox/pepperi-addons-ngx-lib-checkbox.d.ts +4 -4
  68. package/checkbox/public-api.d.ts +2 -2
  69. package/color/color-picker.component.d.ts +54 -54
  70. package/color/color.component.d.ts +27 -27
  71. package/color/color.model.d.ts +1 -1
  72. package/color/color.module.d.ts +5 -5
  73. package/color/pepperi-addons-ngx-lib-color.d.ts +5 -5
  74. package/color/public-api.d.ts +3 -3
  75. package/core/clipboard/clipboard.directive.d.ts +2 -2
  76. package/core/clipboard/clipboard.service.d.ts +2 -2
  77. package/core/clipboard/index.d.ts +1 -1
  78. package/core/clipboard/public-api.d.ts +2 -2
  79. package/core/common/directives/auto-width.directive.d.ts +16 -16
  80. package/core/common/directives/button-blur.directive.d.ts +6 -6
  81. package/core/common/directives/button-loader.directive.d.ts +23 -23
  82. package/core/common/directives/data-qa.directive.d.ts +8 -8
  83. package/core/common/directives/index.d.ts +1 -1
  84. package/core/common/directives/menu-blur.directive.d.ts +7 -7
  85. package/core/common/directives/prevent-multi-click.directive.d.ts +4 -4
  86. package/core/common/directives/print.directive.d.ts +72 -72
  87. package/core/common/directives/public-api.d.ts +7 -7
  88. package/core/common/index.d.ts +1 -1
  89. package/core/common/model/index.d.ts +1 -1
  90. package/core/common/model/papi.model.d.ts +2 -2
  91. package/core/common/model/public-api.d.ts +3 -3
  92. package/core/common/model/utilities.model.d.ts +5 -5
  93. package/core/common/model/wapi.model.d.ts +200 -200
  94. package/core/common/pipes/common-pipes.d.ts +36 -36
  95. package/core/common/pipes/date-ago.pipe.d.ts +8 -8
  96. package/core/common/pipes/index.d.ts +1 -1
  97. package/core/common/pipes/public-api.d.ts +2 -2
  98. package/core/common/public-api.d.ts +4 -4
  99. package/core/common/services/addon.service.d.ts +38 -38
  100. package/core/common/services/color.service.d.ts +48 -48
  101. package/core/common/services/cookie.service.d.ts +50 -50
  102. package/core/common/services/data-convertor.service.d.ts +41 -41
  103. package/core/common/services/file.service.d.ts +24 -24
  104. package/core/common/services/index.d.ts +1 -1
  105. package/core/common/services/jwt-helper.service.d.ts +10 -10
  106. package/core/common/services/public-api.d.ts +11 -11
  107. package/core/common/services/session.service.d.ts +15 -15
  108. package/core/common/services/translate.service.d.ts +9 -9
  109. package/core/common/services/utilities.service.d.ts +34 -34
  110. package/core/common/services/validator.service.d.ts +28 -28
  111. package/core/common/services/window-scrolling.service.d.ts +7 -7
  112. package/core/customization/customization.model.d.ts +266 -266
  113. package/core/customization/customization.service.d.ts +156 -156
  114. package/core/customization/index.d.ts +1 -1
  115. package/core/customization/public-api.d.ts +2 -2
  116. package/core/http/index.d.ts +1 -1
  117. package/core/http/interceptors/error.interceptor.d.ts +5 -5
  118. package/core/http/interceptors/index.d.ts +11 -11
  119. package/core/http/interceptors/loader.interceptor.d.ts +8 -8
  120. package/core/http/interceptors/profiler.interceptor.d.ts +5 -5
  121. package/core/http/public-api.d.ts +2 -2
  122. package/core/http/services/http.service.d.ts +25 -25
  123. package/core/http/services/loader.service.d.ts +10 -10
  124. package/core/index.d.ts +1 -1
  125. package/core/layout/index.d.ts +1 -1
  126. package/core/layout/layout.service.d.ts +33 -33
  127. package/core/layout/public-api.d.ts +2 -2
  128. package/core/layout/rtl.directive.d.ts +16 -16
  129. package/core/portal/attach.directive.d.ts +10 -10
  130. package/core/portal/index.d.ts +1 -1
  131. package/core/portal/portal.service.d.ts +9 -9
  132. package/core/portal/public-api.d.ts +3 -3
  133. package/core/portal/target.directive.d.ts +9 -9
  134. package/core/public-api.d.ts +7 -7
  135. package/core/scroll-to/index.d.ts +1 -1
  136. package/core/scroll-to/public-api.d.ts +1 -1
  137. package/core/scroll-to/scroll-to.service.d.ts +8 -8
  138. package/date/date.component.d.ts +66 -66
  139. package/date/date.model.d.ts +26 -26
  140. package/date/date.module.d.ts +5 -5
  141. package/date/pepperi-addons-ngx-lib-date.d.ts +5 -5
  142. package/date/public-api.d.ts +2 -2
  143. package/dialog/default-dialog.component.d.ts +9 -9
  144. package/dialog/dialog.component.d.ts +10 -10
  145. package/dialog/dialog.model.d.ts +31 -31
  146. package/dialog/dialog.module.d.ts +5 -5
  147. package/dialog/dialog.service.d.ts +24 -24
  148. package/dialog/pepperi-addons-ngx-lib-dialog.d.ts +5 -5
  149. package/dialog/public-api.d.ts +4 -4
  150. package/draggable-items/draggable-item/draggable-item.component.d.ts +8 -8
  151. package/draggable-items/draggable-items.component.d.ts +33 -33
  152. package/draggable-items/draggable-items.model.d.ts +11 -11
  153. package/draggable-items/draggable-items.module.d.ts +5 -5
  154. package/draggable-items/pepperi-addons-ngx-lib-draggable-items.d.ts +4 -4
  155. package/draggable-items/public-api.d.ts +4 -4
  156. package/esm2015/address/address.component.js +96 -96
  157. package/esm2015/address/address.module.js +30 -30
  158. package/esm2015/address/pepperi-addons-ngx-lib-address.js +4 -4
  159. package/esm2015/address/public-api.js +5 -5
  160. package/esm2015/attachment/attachment.component.js +208 -208
  161. package/esm2015/attachment/attachment.module.js +28 -28
  162. package/esm2015/attachment/pepperi-addons-ngx-lib-attachment.js +4 -4
  163. package/esm2015/attachment/public-api.js +5 -5
  164. package/esm2015/bread-crumbs/bread-crumbs.component.js +78 -78
  165. package/esm2015/bread-crumbs/bread-crumbs.model.js +6 -6
  166. package/esm2015/bread-crumbs/bread-crumbs.module.js +34 -34
  167. package/esm2015/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.js +4 -4
  168. package/esm2015/bread-crumbs/public-api.js +6 -6
  169. package/esm2015/button/button.component.js +127 -127
  170. package/esm2015/button/button.model.js +5 -5
  171. package/esm2015/button/button.module.js +26 -26
  172. package/esm2015/button/pepperi-addons-ngx-lib-button.js +4 -4
  173. package/esm2015/button/public-api.js +6 -6
  174. package/esm2015/carousel/carousel-item.directive.js +26 -26
  175. package/esm2015/carousel/carousel.component.js +699 -699
  176. package/esm2015/carousel/carousel.module.js +11 -11
  177. package/esm2015/carousel/pepperi-addons-ngx-lib-carousel.js +4 -4
  178. package/esm2015/carousel/public-api.js +7 -7
  179. package/esm2015/checkbox/checkbox.component.js +151 -151
  180. package/esm2015/checkbox/checkbox.module.js +39 -39
  181. package/esm2015/checkbox/pepperi-addons-ngx-lib-checkbox.js +4 -4
  182. package/esm2015/checkbox/public-api.js +5 -5
  183. package/esm2015/color/color-picker.component.js +197 -197
  184. package/esm2015/color/color.component.js +77 -77
  185. package/esm2015/color/color.model.js +1 -1
  186. package/esm2015/color/color.module.js +57 -57
  187. package/esm2015/color/pepperi-addons-ngx-lib-color.js +5 -5
  188. package/esm2015/color/public-api.js +6 -6
  189. package/esm2015/core/clipboard/clipboard.directive.js +19 -19
  190. package/esm2015/core/clipboard/clipboard.service.js +11 -11
  191. package/esm2015/core/clipboard/index.js +4 -4
  192. package/esm2015/core/clipboard/public-api.js +5 -5
  193. package/esm2015/core/common/directives/auto-width.directive.js +77 -77
  194. package/esm2015/core/common/directives/button-blur.directive.js +22 -22
  195. package/esm2015/core/common/directives/button-loader.directive.js +102 -102
  196. package/esm2015/core/common/directives/data-qa.directive.js +22 -22
  197. package/esm2015/core/common/directives/index.js +4 -4
  198. package/esm2015/core/common/directives/menu-blur.directive.js +28 -28
  199. package/esm2015/core/common/directives/prevent-multi-click.directive.js +21 -21
  200. package/esm2015/core/common/directives/print.directive.js +134 -134
  201. package/esm2015/core/common/directives/public-api.js +11 -11
  202. package/esm2015/core/common/index.js +4 -4
  203. package/esm2015/core/common/model/index.js +4 -4
  204. package/esm2015/core/common/model/papi.model.js +2 -2
  205. package/esm2015/core/common/model/public-api.js +6 -6
  206. package/esm2015/core/common/model/utilities.model.js +56 -56
  207. package/esm2015/core/common/model/wapi.model.js +155 -155
  208. package/esm2015/core/common/pipes/common-pipes.js +141 -141
  209. package/esm2015/core/common/pipes/date-ago.pipe.js +44 -44
  210. package/esm2015/core/common/pipes/index.js +4 -4
  211. package/esm2015/core/common/pipes/public-api.js +5 -5
  212. package/esm2015/core/common/public-api.js +7 -7
  213. package/esm2015/core/common/services/addon.service.js +160 -160
  214. package/esm2015/core/common/services/color.service.js +356 -356
  215. package/esm2015/core/common/services/cookie.service.js +147 -147
  216. package/esm2015/core/common/services/data-convertor.service.js +117 -117
  217. package/esm2015/core/common/services/file.service.js +211 -211
  218. package/esm2015/core/common/services/index.js +4 -4
  219. package/esm2015/core/common/services/jwt-helper.service.js +103 -103
  220. package/esm2015/core/common/services/public-api.js +14 -14
  221. package/esm2015/core/common/services/session.service.js +72 -72
  222. package/esm2015/core/common/services/translate.service.js +47 -47
  223. package/esm2015/core/common/services/utilities.service.js +253 -253
  224. package/esm2015/core/common/services/validator.service.js +272 -272
  225. package/esm2015/core/common/services/window-scrolling.service.js +30 -30
  226. package/esm2015/core/customization/customization.model.js +290 -290
  227. package/esm2015/core/customization/customization.service.js +777 -777
  228. package/esm2015/core/customization/index.js +4 -4
  229. package/esm2015/core/customization/public-api.js +5 -5
  230. package/esm2015/core/http/index.js +4 -4
  231. package/esm2015/core/http/interceptors/error.interceptor.js +23 -23
  232. package/esm2015/core/http/interceptors/index.js +23 -23
  233. package/esm2015/core/http/interceptors/loader.interceptor.js +31 -31
  234. package/esm2015/core/http/interceptors/profiler.interceptor.js +28 -28
  235. package/esm2015/core/http/public-api.js +5 -5
  236. package/esm2015/core/http/services/http.service.js +160 -160
  237. package/esm2015/core/http/services/loader.service.js +48 -48
  238. package/esm2015/core/index.js +4 -4
  239. package/esm2015/core/layout/index.js +4 -4
  240. package/esm2015/core/layout/layout.service.js +168 -168
  241. package/esm2015/core/layout/public-api.js +5 -5
  242. package/esm2015/core/layout/rtl.directive.js +46 -46
  243. package/esm2015/core/portal/attach.directive.js +26 -26
  244. package/esm2015/core/portal/index.js +4 -4
  245. package/esm2015/core/portal/portal.service.js +34 -34
  246. package/esm2015/core/portal/public-api.js +6 -6
  247. package/esm2015/core/portal/target.directive.js +23 -23
  248. package/esm2015/core/public-api.js +10 -10
  249. package/esm2015/core/scroll-to/index.js +4 -4
  250. package/esm2015/core/scroll-to/public-api.js +5 -5
  251. package/esm2015/core/scroll-to/scroll-to.service.js +81 -81
  252. package/esm2015/date/date.component.js +251 -251
  253. package/esm2015/date/date.model.js +44 -44
  254. package/esm2015/date/date.module.js +50 -50
  255. package/esm2015/date/pepperi-addons-ngx-lib-date.js +5 -5
  256. package/esm2015/date/public-api.js +5 -5
  257. package/esm2015/dialog/default-dialog.component.js +31 -31
  258. package/esm2015/dialog/dialog.component.js +28 -28
  259. package/esm2015/dialog/dialog.model.js +34 -34
  260. package/esm2015/dialog/dialog.module.js +39 -39
  261. package/esm2015/dialog/dialog.service.js +87 -87
  262. package/esm2015/dialog/pepperi-addons-ngx-lib-dialog.js +5 -5
  263. package/esm2015/dialog/public-api.js +7 -7
  264. package/esm2015/draggable-items/draggable-item/draggable-item.component.js +24 -24
  265. package/esm2015/draggable-items/draggable-items.component.js +91 -91
  266. package/esm2015/draggable-items/draggable-items.model.js +1 -1
  267. package/esm2015/draggable-items/draggable-items.module.js +42 -42
  268. package/esm2015/draggable-items/pepperi-addons-ngx-lib-draggable-items.js +4 -4
  269. package/esm2015/draggable-items/public-api.js +7 -7
  270. package/esm2015/field-title/field-title.component.js +31 -31
  271. package/esm2015/field-title/field-title.module.js +31 -31
  272. package/esm2015/field-title/pepperi-addons-ngx-lib-field-title.js +4 -4
  273. package/esm2015/field-title/public-api.js +5 -5
  274. package/esm2015/files-uploader/files-uploader.component.js +220 -220
  275. package/esm2015/files-uploader/files-uploader.module.js +49 -49
  276. package/esm2015/files-uploader/pepperi-addons-ngx-lib-files-uploader.js +4 -4
  277. package/esm2015/files-uploader/public-api.js +5 -5
  278. package/esm2015/form/field-generator.component.js +121 -121
  279. package/esm2015/form/form.component.js +1200 -1200
  280. package/esm2015/form/form.model.js +1 -1
  281. package/esm2015/form/form.module.js +107 -107
  282. package/esm2015/form/indicators.component.js +20 -20
  283. package/esm2015/form/internal-button.component.js +165 -165
  284. package/esm2015/form/internal-carusel.component.js +115 -115
  285. package/esm2015/form/internal-carusel.service.js +31 -31
  286. package/esm2015/form/internal-list.component.js +494 -494
  287. package/esm2015/form/internal-menu.component.js +54 -54
  288. package/esm2015/form/internal-page.component.js +350 -350
  289. package/esm2015/form/internal-page.service.js +120 -120
  290. package/esm2015/form/pepperi-addons-ngx-lib-form.js +13 -13
  291. package/esm2015/form/public-api.js +6 -6
  292. package/esm2015/group-buttons/group-buttons.component.js +57 -57
  293. package/esm2015/group-buttons/group-buttons.module.js +37 -37
  294. package/esm2015/group-buttons/pepperi-addons-ngx-lib-group-buttons.js +4 -4
  295. package/esm2015/group-buttons/public-api.js +5 -5
  296. package/esm2015/icon/icon-generated-all.model.js +100 -100
  297. package/esm2015/icon/icon-generated.model.js +389 -389
  298. package/esm2015/icon/icon-registry.service.js +22 -22
  299. package/esm2015/icon/icon.component.js +124 -124
  300. package/esm2015/icon/icon.module.js +14 -14
  301. package/esm2015/icon/icon.service.js +31 -31
  302. package/esm2015/icon/pepperi-addons-ngx-lib-icon.js +4 -4
  303. package/esm2015/icon/public-api.js +10 -10
  304. package/esm2015/image/image.component.js +228 -228
  305. package/esm2015/image/image.module.js +48 -48
  306. package/esm2015/image/image.service.js +56 -56
  307. package/esm2015/image/pepperi-addons-ngx-lib-image.js +4 -4
  308. package/esm2015/image/public-api.js +6 -6
  309. package/esm2015/images-filmstrip/images-filmstrip.component.js +316 -316
  310. package/esm2015/images-filmstrip/images-filmstrip.module.js +51 -51
  311. package/esm2015/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.js +4 -4
  312. package/esm2015/images-filmstrip/public-api.js +5 -5
  313. package/esm2015/link/link.component.js +315 -315
  314. package/esm2015/link/link.module.js +50 -50
  315. package/esm2015/link/link.pipes.js +13 -13
  316. package/esm2015/link/pepperi-addons-ngx-lib-link.js +5 -5
  317. package/esm2015/link/public-api.js +5 -5
  318. package/esm2015/list/list-actions.component.js +35 -35
  319. package/esm2015/list/list-carousel.component.js +94 -94
  320. package/esm2015/list/list-chooser.component.js +57 -57
  321. package/esm2015/list/list-pager.component.js +112 -112
  322. package/esm2015/list/list-sorting.component.js +54 -54
  323. package/esm2015/list/list-total.component.js +23 -23
  324. package/esm2015/list/list-views.component.js +71 -71
  325. package/esm2015/list/list.component.js +1127 -1127
  326. package/esm2015/list/list.model.js +3 -3
  327. package/esm2015/list/list.module.js +87 -87
  328. package/esm2015/list/list.pipes.js +39 -39
  329. package/esm2015/list/pepperi-addons-ngx-lib-list.js +6 -6
  330. package/esm2015/list/public-api.js +14 -14
  331. package/esm2015/list/virtual-scroller.js +1018 -1018
  332. package/esm2015/menu/menu-item.component.js +102 -102
  333. package/esm2015/menu/menu.component.js +173 -173
  334. package/esm2015/menu/menu.model.js +18 -18
  335. package/esm2015/menu/menu.module.js +39 -39
  336. package/esm2015/menu/pepperi-addons-ngx-lib-menu.js +5 -5
  337. package/esm2015/menu/public-api.js +6 -6
  338. package/esm2015/ngx-lib.module.js +96 -94
  339. package/esm2015/page-layout/page-layout.component.js +41 -41
  340. package/esm2015/page-layout/page-layout.module.js +20 -20
  341. package/esm2015/page-layout/pepperi-addons-ngx-lib-page-layout.js +4 -4
  342. package/esm2015/page-layout/public-api.js +5 -5
  343. package/esm2015/pepperi-addons-ngx-lib.js +8 -8
  344. package/esm2015/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.js +4 -4
  345. package/esm2015/profile-data-views-list/profile-data-view/profile-data-view.component.js +38 -38
  346. package/esm2015/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.js +59 -59
  347. package/esm2015/profile-data-views-list/profile-data-views-list.component.js +86 -86
  348. package/esm2015/profile-data-views-list/profile-data-views-list.model.js +1 -1
  349. package/esm2015/profile-data-views-list/profile-data-views-list.module.js +56 -56
  350. package/esm2015/profile-data-views-list/public-api.js +8 -8
  351. package/esm2015/public-api.js +5 -5
  352. package/esm2015/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.js +6 -6
  353. package/esm2015/quantity-selector/public-api.js +5 -5
  354. package/esm2015/quantity-selector/quantity-selector-validation.directive.js +43 -43
  355. package/esm2015/quantity-selector/quantity-selector.component.js +472 -472
  356. package/esm2015/quantity-selector/quantity-selector.module.js +52 -52
  357. package/esm2015/quantity-selector/quantity-selector.pipes.js +18 -18
  358. package/esm2015/query-builder/common/model/field.js +1 -1
  359. package/esm2015/query-builder/common/model/filter.js +1 -1
  360. package/esm2015/query-builder/common/model/legacy.js +1 -1
  361. package/esm2015/query-builder/common/model/operator-unit.js +41 -41
  362. package/esm2015/query-builder/common/model/operator.js +265 -265
  363. package/esm2015/query-builder/common/model/structure.js +1 -1
  364. package/esm2015/query-builder/common/model/type-map.js +26 -26
  365. package/esm2015/query-builder/common/model/type.js +5 -5
  366. package/esm2015/query-builder/common/services/output-query.service.js +112 -112
  367. package/esm2015/query-builder/common/services/query-structure.service.js +228 -228
  368. package/esm2015/query-builder/common/services/type-convertor.service.js +39 -39
  369. package/esm2015/query-builder/pepperi-addons-ngx-lib-query-builder.js +9 -9
  370. package/esm2015/query-builder/public-api.js +8 -8
  371. package/esm2015/query-builder/query-builder-item/query-builder-item.component.js +117 -117
  372. package/esm2015/query-builder/query-builder-section/query-builder-section.component.js +63 -63
  373. package/esm2015/query-builder/query-builder.component.js +107 -107
  374. package/esm2015/query-builder/query-builder.module.js +34 -34
  375. package/esm2015/query-builder/query-builder.service.js +102 -102
  376. package/esm2015/remote-loader/addon-block-loader.component.js +77 -77
  377. package/esm2015/remote-loader/addon-block-loader.service.js +63 -63
  378. package/esm2015/remote-loader/pepperi-addons-ngx-lib-remote-loader.js +4 -4
  379. package/esm2015/remote-loader/public-api.js +9 -9
  380. package/esm2015/remote-loader/remote-loader.component.js +114 -114
  381. package/esm2015/remote-loader/remote-loader.model.js +1 -1
  382. package/esm2015/remote-loader/remote-loader.module.js +37 -37
  383. package/esm2015/remote-loader/remote-loader.service.js +65 -65
  384. package/esm2015/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.js +4 -4
  385. package/esm2015/rich-html-textarea/public-api.js +5 -5
  386. package/esm2015/rich-html-textarea/rich-html-textarea.component.js +219 -219
  387. package/esm2015/rich-html-textarea/rich-html-textarea.module.js +56 -56
  388. package/esm2015/search/pepperi-addons-ngx-lib-search.js +4 -4
  389. package/esm2015/search/public-api.js +6 -6
  390. package/esm2015/search/search.component.js +273 -273
  391. package/esm2015/search/search.model.js +1 -1
  392. package/esm2015/search/search.module.js +44 -44
  393. package/esm2015/select/pepperi-addons-ngx-lib-select.js +4 -4
  394. package/esm2015/select/public-api.js +5 -5
  395. package/esm2015/select/select.component.js +219 -219
  396. package/esm2015/select/select.module.js +42 -42
  397. package/esm2015/separator/pepperi-addons-ngx-lib-separator.js +4 -4
  398. package/esm2015/separator/public-api.js +5 -5
  399. package/esm2015/separator/separator.component.js +62 -62
  400. package/esm2015/separator/separator.module.js +12 -12
  401. package/esm2015/side-bar/pepperi-addons-ngx-lib-side-bar.js +4 -4
  402. package/esm2015/side-bar/public-api.js +6 -6
  403. package/esm2015/side-bar/side-bar.component.js +132 -132
  404. package/esm2015/side-bar/side-bar.model.js +1 -1
  405. package/esm2015/side-bar/side-bar.module.js +33 -33
  406. package/esm2015/signature/pepperi-addons-ngx-lib-signature.js +4 -4
  407. package/esm2015/signature/public-api.js +5 -5
  408. package/esm2015/signature/signature.component.js +233 -233
  409. package/esm2015/signature/signature.module.js +54 -54
  410. package/esm2015/size-detector/pepperi-addons-ngx-lib-size-detector.js +4 -4
  411. package/esm2015/size-detector/public-api.js +5 -5
  412. package/esm2015/size-detector/size-detector.component.js +88 -88
  413. package/esm2015/size-detector/size-detector.module.js +21 -21
  414. package/esm2015/slider/pepperi-addons-ngx-lib-slider.js +4 -4
  415. package/esm2015/slider/public-api.js +5 -5
  416. package/esm2015/slider/slider.component.js +95 -95
  417. package/esm2015/slider/slider.module.js +24 -24
  418. package/esm2015/smart-filters/boolean-filter/boolean-filter.component.js +70 -70
  419. package/esm2015/smart-filters/common/filter-actions.component.js +25 -25
  420. package/esm2015/smart-filters/common/model/base-filter-component.js +291 -291
  421. package/esm2015/smart-filters/common/model/creator.js +75 -75
  422. package/esm2015/smart-filters/common/model/field.js +116 -116
  423. package/esm2015/smart-filters/common/model/filter.js +1 -1
  424. package/esm2015/smart-filters/common/model/operator.js +270 -270
  425. package/esm2015/smart-filters/common/model/type.js +1 -1
  426. package/esm2015/smart-filters/date-filter/date-filter.component.js +163 -163
  427. package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +190 -190
  428. package/esm2015/smart-filters/number-filter/number-filter.component.js +109 -109
  429. package/esm2015/smart-filters/pepperi-addons-ngx-lib-smart-filters.js +4 -4
  430. package/esm2015/smart-filters/public-api.js +18 -18
  431. package/esm2015/smart-filters/smart-filters.component.js +129 -129
  432. package/esm2015/smart-filters/smart-filters.module.js +90 -90
  433. package/esm2015/smart-filters/text-filter/text-filter.component.js +85 -85
  434. package/esm2015/snack-bar/default-snack-bar.component.js +27 -27
  435. package/esm2015/snack-bar/pepperi-addons-ngx-lib-snack-bar.js +5 -5
  436. package/esm2015/snack-bar/public-api.js +7 -7
  437. package/esm2015/snack-bar/snack-bar.component.js +25 -25
  438. package/esm2015/snack-bar/snack-bar.model.js +6 -6
  439. package/esm2015/snack-bar/snack-bar.module.js +41 -41
  440. package/esm2015/snack-bar/snack-bar.service.js +62 -62
  441. package/esm2015/textarea/pepperi-addons-ngx-lib-textarea.js +4 -4
  442. package/esm2015/textarea/public-api.js +5 -5
  443. package/esm2015/textarea/textarea.component.js +160 -160
  444. package/esm2015/textarea/textarea.module.js +50 -50
  445. package/esm2015/textbox/pepperi-addons-ngx-lib-textbox.js +5 -5
  446. package/esm2015/textbox/public-api.js +5 -5
  447. package/esm2015/textbox/textbox-validation.directive.js +85 -85
  448. package/esm2015/textbox/textbox.component.js +411 -411
  449. package/esm2015/textbox/textbox.module.js +44 -44
  450. package/esm2015/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.js +4 -4
  451. package/esm2015/textbox-icon/public-api.js +5 -5
  452. package/esm2015/textbox-icon/textbox-icon.component.js +40 -40
  453. package/esm2015/textbox-icon/textbox-icon.module.js +46 -46
  454. package/esm2015/top-bar/pepperi-addons-ngx-lib-top-bar.js +4 -4
  455. package/esm2015/top-bar/public-api.js +6 -6
  456. package/esm2015/top-bar/top-bar.component.js +98 -98
  457. package/esm2015/top-bar/top-bar.model.js +1 -1
  458. package/esm2015/top-bar/top-bar.module.js +40 -40
  459. package/fesm2015/pepperi-addons-ngx-lib-address.js +116 -116
  460. package/fesm2015/pepperi-addons-ngx-lib-attachment.js +227 -227
  461. package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.js +109 -109
  462. package/fesm2015/pepperi-addons-ngx-lib-button.js +149 -149
  463. package/fesm2015/pepperi-addons-ngx-lib-carousel.js +731 -731
  464. package/fesm2015/pepperi-addons-ngx-lib-checkbox.js +178 -178
  465. package/fesm2015/pepperi-addons-ngx-lib-color.js +298 -298
  466. package/fesm2015/pepperi-addons-ngx-lib-date.js +320 -320
  467. package/fesm2015/pepperi-addons-ngx-lib-dialog.js +192 -192
  468. package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js +143 -143
  469. package/fesm2015/pepperi-addons-ngx-lib-field-title.js +55 -55
  470. package/fesm2015/pepperi-addons-ngx-lib-files-uploader.js +252 -252
  471. package/fesm2015/pepperi-addons-ngx-lib-form.js +2697 -2697
  472. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.js +84 -84
  473. package/fesm2015/pepperi-addons-ngx-lib-icon.js +662 -662
  474. package/fesm2015/pepperi-addons-ngx-lib-image.js +308 -308
  475. package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.js +347 -347
  476. package/fesm2015/pepperi-addons-ngx-lib-link.js +358 -358
  477. package/fesm2015/pepperi-addons-ngx-lib-list.js +2661 -2661
  478. package/fesm2015/pepperi-addons-ngx-lib-menu.js +314 -314
  479. package/fesm2015/pepperi-addons-ngx-lib-page-layout.js +55 -55
  480. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js +219 -219
  481. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.js +561 -561
  482. package/fesm2015/pepperi-addons-ngx-lib-query-builder.js +1087 -1087
  483. package/fesm2015/pepperi-addons-ngx-lib-remote-loader.js +327 -327
  484. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.js +256 -256
  485. package/fesm2015/pepperi-addons-ngx-lib-search.js +301 -301
  486. package/fesm2015/pepperi-addons-ngx-lib-select.js +249 -249
  487. package/fesm2015/pepperi-addons-ngx-lib-separator.js +71 -71
  488. package/fesm2015/pepperi-addons-ngx-lib-side-bar.js +156 -156
  489. package/fesm2015/pepperi-addons-ngx-lib-signature.js +270 -270
  490. package/fesm2015/pepperi-addons-ngx-lib-size-detector.js +103 -103
  491. package/fesm2015/pepperi-addons-ngx-lib-slider.js +112 -112
  492. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1539 -1539
  493. package/fesm2015/pepperi-addons-ngx-lib-snack-bar.js +137 -137
  494. package/fesm2015/pepperi-addons-ngx-lib-textarea.js +194 -194
  495. package/fesm2015/pepperi-addons-ngx-lib-textbox-icon.js +78 -78
  496. package/fesm2015/pepperi-addons-ngx-lib-textbox.js +521 -521
  497. package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +125 -125
  498. package/fesm2015/pepperi-addons-ngx-lib.js +4320 -4319
  499. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  500. package/field-title/field-title.component.d.ts +11 -11
  501. package/field-title/field-title.module.d.ts +5 -5
  502. package/field-title/pepperi-addons-ngx-lib-field-title.d.ts +4 -4
  503. package/field-title/public-api.d.ts +2 -2
  504. package/files-uploader/files-uploader.component.d.ts +53 -53
  505. package/files-uploader/files-uploader.module.d.ts +5 -5
  506. package/files-uploader/pepperi-addons-ngx-lib-files-uploader.d.ts +4 -4
  507. package/files-uploader/public-api.d.ts +2 -2
  508. package/form/field-generator.component.d.ts +36 -36
  509. package/form/form.component.d.ts +90 -90
  510. package/form/form.model.d.ts +20 -20
  511. package/form/form.module.d.ts +5 -5
  512. package/form/indicators.component.d.ts +7 -7
  513. package/form/internal-button.component.d.ts +39 -39
  514. package/form/internal-carusel.component.d.ts +38 -38
  515. package/form/internal-carusel.service.d.ts +7 -7
  516. package/form/internal-list.component.d.ts +92 -92
  517. package/form/internal-menu.component.d.ts +16 -16
  518. package/form/internal-page.component.d.ts +72 -72
  519. package/form/internal-page.service.d.ts +19 -19
  520. package/form/pepperi-addons-ngx-lib-form.d.ts +13 -13
  521. package/form/public-api.d.ts +3 -3
  522. package/group-buttons/group-buttons.component.d.ts +20 -20
  523. package/group-buttons/group-buttons.module.d.ts +5 -5
  524. package/group-buttons/pepperi-addons-ngx-lib-group-buttons.d.ts +4 -4
  525. package/group-buttons/public-api.d.ts +2 -2
  526. package/icon/icon-generated-all.model.d.ts +99 -99
  527. package/icon/icon-generated.model.d.ts +394 -394
  528. package/icon/icon-registry.service.d.ts +6 -6
  529. package/icon/icon.component.d.ts +46 -46
  530. package/icon/icon.module.d.ts +2 -2
  531. package/icon/icon.service.d.ts +10 -10
  532. package/icon/pepperi-addons-ngx-lib-icon.d.ts +4 -4
  533. package/icon/public-api.d.ts +6 -6
  534. package/image/image.component.d.ts +63 -63
  535. package/image/image.module.d.ts +5 -5
  536. package/image/image.service.d.ts +11 -11
  537. package/image/pepperi-addons-ngx-lib-image.d.ts +4 -4
  538. package/image/public-api.d.ts +3 -3
  539. package/images-filmstrip/images-filmstrip.component.d.ts +84 -84
  540. package/images-filmstrip/images-filmstrip.module.d.ts +5 -5
  541. package/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.d.ts +4 -4
  542. package/images-filmstrip/public-api.d.ts +2 -2
  543. package/link/link.component.d.ts +131 -131
  544. package/link/link.module.d.ts +5 -5
  545. package/link/link.pipes.d.ts +4 -4
  546. package/link/pepperi-addons-ngx-lib-link.d.ts +5 -5
  547. package/link/public-api.d.ts +2 -2
  548. package/list/list-actions.component.d.ts +14 -14
  549. package/list/list-carousel.component.d.ts +36 -36
  550. package/list/list-chooser.component.d.ts +25 -25
  551. package/list/list-pager.component.d.ts +35 -35
  552. package/list/list-sorting.component.d.ts +26 -26
  553. package/list/list-total.component.d.ts +7 -7
  554. package/list/list-views.component.d.ts +31 -31
  555. package/list/list.component.d.ts +161 -161
  556. package/list/list.model.d.ts +31 -31
  557. package/list/list.module.d.ts +5 -5
  558. package/list/list.pipes.d.ts +11 -11
  559. package/list/pepperi-addons-ngx-lib-list.d.ts +6 -6
  560. package/list/public-api.d.ts +10 -10
  561. package/list/virtual-scroller.d.ts +176 -176
  562. package/menu/menu-item.component.d.ts +25 -25
  563. package/menu/menu.component.d.ts +43 -43
  564. package/menu/menu.model.d.ts +25 -25
  565. package/menu/menu.module.d.ts +5 -5
  566. package/menu/pepperi-addons-ngx-lib-menu.d.ts +5 -5
  567. package/menu/public-api.d.ts +3 -3
  568. package/ngx-lib.module.d.ts +2 -2
  569. package/package.json +1 -1
  570. package/page-layout/page-layout.component.d.ts +16 -16
  571. package/page-layout/page-layout.module.d.ts +2 -2
  572. package/page-layout/pepperi-addons-ngx-lib-page-layout.d.ts +4 -4
  573. package/page-layout/public-api.d.ts +2 -2
  574. package/pepperi-addons-ngx-lib.d.ts +8 -8
  575. package/pepperi-addons-ngx-lib.metadata.json +1 -1
  576. package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.d.ts +4 -4
  577. package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +15 -15
  578. package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +21 -21
  579. package/profile-data-views-list/profile-data-views-list.component.d.ts +32 -32
  580. package/profile-data-views-list/profile-data-views-list.model.d.ts +18 -18
  581. package/profile-data-views-list/profile-data-views-list.module.d.ts +5 -5
  582. package/profile-data-views-list/public-api.d.ts +5 -5
  583. package/public-api.d.ts +2 -2
  584. package/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.d.ts +6 -6
  585. package/quantity-selector/public-api.d.ts +2 -2
  586. package/quantity-selector/quantity-selector-validation.directive.d.ts +13 -13
  587. package/quantity-selector/quantity-selector.component.d.ts +98 -98
  588. package/quantity-selector/quantity-selector.module.d.ts +5 -5
  589. package/quantity-selector/quantity-selector.pipes.d.ts +4 -4
  590. package/query-builder/common/model/field.d.ts +8 -8
  591. package/query-builder/common/model/filter.d.ts +6 -6
  592. package/query-builder/common/model/legacy.d.ts +29 -29
  593. package/query-builder/common/model/operator-unit.d.ts +13 -13
  594. package/query-builder/common/model/operator.d.ts +21 -21
  595. package/query-builder/common/model/structure.d.ts +4 -4
  596. package/query-builder/common/model/type-map.d.ts +12 -12
  597. package/query-builder/common/model/type.d.ts +4 -4
  598. package/query-builder/common/services/output-query.service.d.ts +44 -44
  599. package/query-builder/common/services/query-structure.service.d.ts +78 -78
  600. package/query-builder/common/services/type-convertor.service.d.ts +10 -10
  601. package/query-builder/pepperi-addons-ngx-lib-query-builder.d.ts +9 -9
  602. package/query-builder/public-api.d.ts +5 -5
  603. package/query-builder/query-builder-item/query-builder-item.component.d.ts +38 -38
  604. package/query-builder/query-builder-section/query-builder-section.component.d.ts +27 -27
  605. package/query-builder/query-builder.component.d.ts +36 -36
  606. package/query-builder/query-builder.module.d.ts +2 -2
  607. package/query-builder/query-builder.service.d.ts +27 -27
  608. package/remote-loader/addon-block-loader.component.d.ts +29 -29
  609. package/remote-loader/addon-block-loader.service.d.ts +13 -13
  610. package/remote-loader/pepperi-addons-ngx-lib-remote-loader.d.ts +4 -4
  611. package/remote-loader/public-api.d.ts +6 -6
  612. package/remote-loader/remote-loader.component.d.ts +24 -24
  613. package/remote-loader/remote-loader.model.d.ts +36 -36
  614. package/remote-loader/remote-loader.module.d.ts +2 -2
  615. package/remote-loader/remote-loader.service.d.ts +14 -14
  616. package/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.d.ts +4 -4
  617. package/rich-html-textarea/public-api.d.ts +2 -2
  618. package/rich-html-textarea/rich-html-textarea.component.d.ts +75 -75
  619. package/rich-html-textarea/rich-html-textarea.module.d.ts +5 -5
  620. package/search/pepperi-addons-ngx-lib-search.d.ts +4 -4
  621. package/search/public-api.d.ts +3 -3
  622. package/search/search.component.d.ts +61 -61
  623. package/search/search.model.d.ts +14 -14
  624. package/search/search.module.d.ts +5 -5
  625. package/select/pepperi-addons-ngx-lib-select.d.ts +4 -4
  626. package/select/public-api.d.ts +2 -2
  627. package/select/select.component.d.ts +52 -52
  628. package/select/select.module.d.ts +5 -5
  629. package/separator/pepperi-addons-ngx-lib-separator.d.ts +4 -4
  630. package/separator/public-api.d.ts +2 -2
  631. package/separator/separator.component.d.ts +19 -19
  632. package/separator/separator.module.d.ts +2 -2
  633. package/side-bar/pepperi-addons-ngx-lib-side-bar.d.ts +4 -4
  634. package/side-bar/public-api.d.ts +3 -3
  635. package/side-bar/side-bar.component.d.ts +39 -39
  636. package/side-bar/side-bar.model.d.ts +4 -4
  637. package/side-bar/side-bar.module.d.ts +5 -5
  638. package/signature/pepperi-addons-ngx-lib-signature.d.ts +4 -4
  639. package/signature/public-api.d.ts +2 -2
  640. package/signature/signature.component.d.ts +65 -65
  641. package/signature/signature.module.d.ts +5 -5
  642. package/size-detector/pepperi-addons-ngx-lib-size-detector.d.ts +4 -4
  643. package/size-detector/public-api.d.ts +2 -2
  644. package/size-detector/size-detector.component.d.ts +26 -26
  645. package/size-detector/size-detector.module.d.ts +2 -2
  646. package/slider/pepperi-addons-ngx-lib-slider.d.ts +4 -4
  647. package/slider/public-api.d.ts +2 -2
  648. package/slider/slider.component.d.ts +36 -36
  649. package/slider/slider.module.d.ts +2 -2
  650. package/smart-filters/boolean-filter/boolean-filter.component.d.ts +25 -25
  651. package/smart-filters/common/filter-actions.component.d.ts +9 -9
  652. package/smart-filters/common/model/base-filter-component.d.ts +70 -70
  653. package/smart-filters/common/model/creator.d.ts +6 -6
  654. package/smart-filters/common/model/field.d.ts +69 -69
  655. package/smart-filters/common/model/filter.d.ts +11 -11
  656. package/smart-filters/common/model/operator.d.ts +51 -51
  657. package/smart-filters/common/model/type.d.ts +4 -4
  658. package/smart-filters/date-filter/date-filter.component.d.ts +56 -56
  659. package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +53 -53
  660. package/smart-filters/number-filter/number-filter.component.d.ts +48 -48
  661. package/smart-filters/pepperi-addons-ngx-lib-smart-filters.d.ts +4 -4
  662. package/smart-filters/public-api.d.ts +14 -14
  663. package/smart-filters/smart-filters.component.d.ts +32 -32
  664. package/smart-filters/smart-filters.module.d.ts +5 -5
  665. package/smart-filters/text-filter/text-filter.component.d.ts +25 -25
  666. package/snack-bar/default-snack-bar.component.d.ts +10 -10
  667. package/snack-bar/pepperi-addons-ngx-lib-snack-bar.d.ts +5 -5
  668. package/snack-bar/public-api.d.ts +4 -4
  669. package/snack-bar/snack-bar.component.d.ts +9 -9
  670. package/snack-bar/snack-bar.model.d.ts +8 -8
  671. package/snack-bar/snack-bar.module.d.ts +5 -5
  672. package/snack-bar/snack-bar.service.d.ts +21 -21
  673. package/textarea/pepperi-addons-ngx-lib-textarea.d.ts +4 -4
  674. package/textarea/public-api.d.ts +2 -2
  675. package/textarea/textarea.component.d.ts +51 -51
  676. package/textarea/textarea.module.d.ts +5 -5
  677. package/textbox/pepperi-addons-ngx-lib-textbox.d.ts +5 -5
  678. package/textbox/public-api.d.ts +2 -2
  679. package/textbox/textbox-validation.directive.d.ts +18 -18
  680. package/textbox/textbox.component.d.ts +141 -141
  681. package/textbox/textbox.module.d.ts +5 -5
  682. package/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.d.ts +4 -4
  683. package/textbox-icon/public-api.d.ts +2 -2
  684. package/textbox-icon/textbox-icon.component.d.ts +10 -10
  685. package/textbox-icon/textbox-icon.module.d.ts +5 -5
  686. package/top-bar/pepperi-addons-ngx-lib-top-bar.d.ts +4 -4
  687. package/top-bar/public-api.d.ts +3 -3
  688. package/top-bar/top-bar.component.d.ts +36 -36
  689. package/top-bar/top-bar.model.d.ts +4 -4
  690. package/top-bar/top-bar.module.d.ts +5 -5
@@ -4,2008 +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 <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 }]
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
- 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,
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,
761
761
  };
762
762
 
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 }]
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 }]
1089
1089
  };
1090
1090
 
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
- },] }
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
+ },] }
1175
1175
  ];
1176
1176
 
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 }]
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 }]
1247
1247
  };
1248
1248
 
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
- this.operator === 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
- },] }
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
+ this.operator === 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
+ },] }
1411
1411
  ];
1412
1412
 
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,] }]
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,] }]
1601
1601
  };
1602
1602
 
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 *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>",
1709
- styles: [""]
1710
- },] }
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 *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [formattedValue]=\"secondControl?.value || ''\" [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [formattedValue]=\"firstControl?.value || ''\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>",
1709
+ styles: [""]
1710
+ },] }
1711
1711
  ];
1712
1712
 
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 }
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 }
1773
1773
  ]; };
1774
1774
 
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;
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;
1926
1926
  }(PepSmartFilterNumberBaseField));
1927
1927
 
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
- };
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
+ };
2001
2001
  }
2002
2002
 
2003
- /*
2004
- * Public API Surface of ngx-lib/smart-filters
2003
+ /*
2004
+ * Public API Surface of ngx-lib/smart-filters
2005
2005
  */
2006
2006
 
2007
- /**
2008
- * Generated bundle index. Do not edit.
2007
+ /**
2008
+ * Generated bundle index. Do not edit.
2009
2009
  */
2010
2010
 
2011
2011
  exports.BaseFilterComponent = BaseFilterComponent;