@pepperi-addons/ngx-lib 0.3.9-beta.21 → 0.3.9-beta.22

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 (654) 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 +296 -296
  21. package/bundles/pepperi-addons-ngx-lib-date.umd.js +660 -660
  22. package/bundles/pepperi-addons-ngx-lib-dialog.umd.js +171 -171
  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 +3237 -3229
  27. package/bundles/pepperi-addons-ngx-lib-form.umd.js.map +1 -1
  28. package/bundles/pepperi-addons-ngx-lib-group-buttons.umd.js +87 -87
  29. package/bundles/pepperi-addons-ngx-lib-icon.umd.js +681 -681
  30. package/bundles/pepperi-addons-ngx-lib-image.umd.js +316 -316
  31. package/bundles/pepperi-addons-ngx-lib-images-filmstrip.umd.js +413 -413
  32. package/bundles/pepperi-addons-ngx-lib-link.umd.js +464 -464
  33. package/bundles/pepperi-addons-ngx-lib-list.umd.js +3187 -3187
  34. package/bundles/pepperi-addons-ngx-lib-menu.umd.js +646 -646
  35. package/bundles/pepperi-addons-ngx-lib-page-layout.umd.js +60 -60
  36. package/bundles/pepperi-addons-ngx-lib-profile-data-views-list.umd.js +543 -543
  37. package/bundles/pepperi-addons-ngx-lib-quantity-selector.umd.js +914 -914
  38. package/bundles/pepperi-addons-ngx-lib-query-builder.umd.js +1060 -1060
  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 +576 -576
  42. package/bundles/pepperi-addons-ngx-lib-separator.umd.js +79 -79
  43. package/bundles/pepperi-addons-ngx-lib-side-bar.umd.js +163 -163
  44. package/bundles/pepperi-addons-ngx-lib-signature.umd.js +283 -283
  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 +1780 -1780
  48. package/bundles/pepperi-addons-ngx-lib-textarea.umd.js +211 -211
  49. package/bundles/pepperi-addons-ngx-lib-textbox-icon.umd.js +80 -80
  50. package/bundles/pepperi-addons-ngx-lib-textbox.umd.js +506 -506
  51. package/bundles/pepperi-addons-ngx-lib-top-bar.umd.js +129 -129
  52. package/bundles/pepperi-addons-ngx-lib.umd.js +4719 -4719
  53. package/bundles/pepperi-addons-ngx-lib.umd.js.map +1 -1
  54. package/button/button.component.d.ts +99 -99
  55. package/button/button.model.d.ts +14 -14
  56. package/button/button.module.d.ts +2 -2
  57. package/button/pepperi-addons-ngx-lib-button.d.ts +4 -4
  58. package/button/public-api.d.ts +3 -3
  59. package/carousel/carousel-item.directive.d.ts +9 -9
  60. package/carousel/carousel.component.d.ts +145 -145
  61. package/carousel/carousel.module.d.ts +2 -2
  62. package/carousel/pepperi-addons-ngx-lib-carousel.d.ts +4 -4
  63. package/carousel/public-api.d.ts +3 -3
  64. package/checkbox/checkbox.component.d.ts +47 -47
  65. package/checkbox/checkbox.module.d.ts +5 -5
  66. package/checkbox/pepperi-addons-ngx-lib-checkbox.d.ts +4 -4
  67. package/checkbox/public-api.d.ts +2 -2
  68. package/color/color-picker.component.d.ts +52 -52
  69. package/color/color.component.d.ts +26 -26
  70. package/color/color.model.d.ts +1 -1
  71. package/color/color.module.d.ts +5 -5
  72. package/color/pepperi-addons-ngx-lib-color.d.ts +5 -5
  73. package/color/public-api.d.ts +3 -3
  74. package/core/clipboard/clipboard.directive.d.ts +2 -2
  75. package/core/clipboard/clipboard.service.d.ts +2 -2
  76. package/core/clipboard/index.d.ts +1 -1
  77. package/core/clipboard/public-api.d.ts +2 -2
  78. package/core/common/directives/auto-width.directive.d.ts +16 -16
  79. package/core/common/directives/button-blur.directive.d.ts +6 -6
  80. package/core/common/directives/button-loader.directive.d.ts +23 -23
  81. package/core/common/directives/data-qa.directive.d.ts +8 -8
  82. package/core/common/directives/index.d.ts +1 -1
  83. package/core/common/directives/menu-blur.directive.d.ts +7 -7
  84. package/core/common/directives/prevent-multi-click.directive.d.ts +4 -4
  85. package/core/common/directives/print.directive.d.ts +72 -72
  86. package/core/common/directives/public-api.d.ts +7 -7
  87. package/core/common/index.d.ts +1 -1
  88. package/core/common/model/index.d.ts +1 -1
  89. package/core/common/model/papi.model.d.ts +2 -2
  90. package/core/common/model/public-api.d.ts +3 -3
  91. package/core/common/model/utilities.model.d.ts +5 -5
  92. package/core/common/model/wapi.model.d.ts +200 -200
  93. package/core/common/pipes/common-pipes.d.ts +36 -36
  94. package/core/common/pipes/index.d.ts +1 -1
  95. package/core/common/pipes/public-api.d.ts +1 -1
  96. package/core/common/public-api.d.ts +4 -4
  97. package/core/common/services/addon.service.d.ts +32 -32
  98. package/core/common/services/color.service.d.ts +48 -48
  99. package/core/common/services/cookie.service.d.ts +50 -50
  100. package/core/common/services/data-convertor.service.d.ts +39 -39
  101. package/core/common/services/file.service.d.ts +24 -24
  102. package/core/common/services/index.d.ts +1 -1
  103. package/core/common/services/jwt-helper.service.d.ts +10 -10
  104. package/core/common/services/public-api.d.ts +11 -11
  105. package/core/common/services/session.service.d.ts +15 -15
  106. package/core/common/services/translate.service.d.ts +9 -9
  107. package/core/common/services/utilities.service.d.ts +18 -18
  108. package/core/common/services/validator.service.d.ts +28 -28
  109. package/core/common/services/window-scrolling.service.d.ts +7 -7
  110. package/core/customization/customization.model.d.ts +264 -264
  111. package/core/customization/customization.service.d.ts +155 -155
  112. package/core/customization/index.d.ts +1 -1
  113. package/core/customization/public-api.d.ts +2 -2
  114. package/core/http/index.d.ts +1 -1
  115. package/core/http/interceptors/error.interceptor.d.ts +5 -5
  116. package/core/http/interceptors/index.d.ts +11 -11
  117. package/core/http/interceptors/loader.interceptor.d.ts +8 -8
  118. package/core/http/interceptors/profiler.interceptor.d.ts +5 -5
  119. package/core/http/public-api.d.ts +2 -2
  120. package/core/http/services/http.service.d.ts +25 -25
  121. package/core/http/services/loader.service.d.ts +10 -10
  122. package/core/index.d.ts +1 -1
  123. package/core/layout/index.d.ts +1 -1
  124. package/core/layout/layout.service.d.ts +33 -33
  125. package/core/layout/public-api.d.ts +2 -2
  126. package/core/layout/rtl.directive.d.ts +16 -16
  127. package/core/portal/attach.directive.d.ts +10 -10
  128. package/core/portal/index.d.ts +1 -1
  129. package/core/portal/portal.service.d.ts +9 -9
  130. package/core/portal/public-api.d.ts +3 -3
  131. package/core/portal/target.directive.d.ts +9 -9
  132. package/core/public-api.d.ts +7 -7
  133. package/core/scroll-to/index.d.ts +1 -1
  134. package/core/scroll-to/public-api.d.ts +1 -1
  135. package/core/scroll-to/scroll-to.service.d.ts +8 -8
  136. package/date/date.component.d.ts +65 -65
  137. package/date/date.model.d.ts +26 -26
  138. package/date/date.module.d.ts +5 -5
  139. package/date/pepperi-addons-ngx-lib-date.d.ts +5 -5
  140. package/date/public-api.d.ts +2 -2
  141. package/dialog/default-dialog.component.d.ts +8 -8
  142. package/dialog/dialog.component.d.ts +6 -6
  143. package/dialog/dialog.model.d.ts +27 -27
  144. package/dialog/dialog.module.d.ts +5 -5
  145. package/dialog/dialog.service.d.ts +24 -24
  146. package/dialog/pepperi-addons-ngx-lib-dialog.d.ts +5 -5
  147. package/dialog/public-api.d.ts +4 -4
  148. package/draggable-items/draggable-item/draggable-item.component.d.ts +8 -8
  149. package/draggable-items/draggable-items.component.d.ts +33 -33
  150. package/draggable-items/draggable-items.model.d.ts +7 -7
  151. package/draggable-items/draggable-items.module.d.ts +5 -5
  152. package/draggable-items/pepperi-addons-ngx-lib-draggable-items.d.ts +4 -4
  153. package/draggable-items/pepperi-addons-ngx-lib-draggable-items.metadata.json +1 -1
  154. package/draggable-items/public-api.d.ts +4 -4
  155. package/esm2015/address/address.component.js +96 -96
  156. package/esm2015/address/address.module.js +30 -30
  157. package/esm2015/address/pepperi-addons-ngx-lib-address.js +4 -4
  158. package/esm2015/address/public-api.js +5 -5
  159. package/esm2015/attachment/attachment.component.js +208 -208
  160. package/esm2015/attachment/attachment.module.js +28 -28
  161. package/esm2015/attachment/pepperi-addons-ngx-lib-attachment.js +4 -4
  162. package/esm2015/attachment/public-api.js +5 -5
  163. package/esm2015/bread-crumbs/bread-crumbs.component.js +78 -78
  164. package/esm2015/bread-crumbs/bread-crumbs.model.js +6 -6
  165. package/esm2015/bread-crumbs/bread-crumbs.module.js +34 -34
  166. package/esm2015/bread-crumbs/pepperi-addons-ngx-lib-bread-crumbs.js +4 -4
  167. package/esm2015/bread-crumbs/public-api.js +6 -6
  168. package/esm2015/button/button.component.js +127 -127
  169. package/esm2015/button/button.model.js +5 -5
  170. package/esm2015/button/button.module.js +26 -26
  171. package/esm2015/button/pepperi-addons-ngx-lib-button.js +4 -4
  172. package/esm2015/button/public-api.js +6 -6
  173. package/esm2015/carousel/carousel-item.directive.js +26 -26
  174. package/esm2015/carousel/carousel.component.js +699 -699
  175. package/esm2015/carousel/carousel.module.js +11 -11
  176. package/esm2015/carousel/pepperi-addons-ngx-lib-carousel.js +4 -4
  177. package/esm2015/carousel/public-api.js +7 -7
  178. package/esm2015/checkbox/checkbox.component.js +151 -151
  179. package/esm2015/checkbox/checkbox.module.js +39 -39
  180. package/esm2015/checkbox/pepperi-addons-ngx-lib-checkbox.js +4 -4
  181. package/esm2015/checkbox/public-api.js +5 -5
  182. package/esm2015/color/color-picker.component.js +194 -194
  183. package/esm2015/color/color.component.js +74 -74
  184. package/esm2015/color/color.model.js +1 -1
  185. package/esm2015/color/color.module.js +57 -57
  186. package/esm2015/color/pepperi-addons-ngx-lib-color.js +5 -5
  187. package/esm2015/color/public-api.js +6 -6
  188. package/esm2015/core/clipboard/clipboard.directive.js +19 -19
  189. package/esm2015/core/clipboard/clipboard.service.js +11 -11
  190. package/esm2015/core/clipboard/index.js +4 -4
  191. package/esm2015/core/clipboard/public-api.js +5 -5
  192. package/esm2015/core/common/directives/auto-width.directive.js +77 -77
  193. package/esm2015/core/common/directives/button-blur.directive.js +22 -22
  194. package/esm2015/core/common/directives/button-loader.directive.js +102 -102
  195. package/esm2015/core/common/directives/data-qa.directive.js +22 -22
  196. package/esm2015/core/common/directives/index.js +4 -4
  197. package/esm2015/core/common/directives/menu-blur.directive.js +28 -28
  198. package/esm2015/core/common/directives/prevent-multi-click.directive.js +21 -21
  199. package/esm2015/core/common/directives/print.directive.js +134 -134
  200. package/esm2015/core/common/directives/public-api.js +11 -11
  201. package/esm2015/core/common/index.js +4 -4
  202. package/esm2015/core/common/model/index.js +4 -4
  203. package/esm2015/core/common/model/papi.model.js +2 -2
  204. package/esm2015/core/common/model/public-api.js +6 -6
  205. package/esm2015/core/common/model/utilities.model.js +56 -56
  206. package/esm2015/core/common/model/wapi.model.js +155 -155
  207. package/esm2015/core/common/pipes/common-pipes.js +141 -141
  208. package/esm2015/core/common/pipes/index.js +4 -4
  209. package/esm2015/core/common/pipes/public-api.js +4 -4
  210. package/esm2015/core/common/public-api.js +7 -7
  211. package/esm2015/core/common/services/addon.service.js +123 -123
  212. package/esm2015/core/common/services/color.service.js +356 -356
  213. package/esm2015/core/common/services/cookie.service.js +147 -147
  214. package/esm2015/core/common/services/data-convertor.service.js +111 -111
  215. package/esm2015/core/common/services/file.service.js +211 -211
  216. package/esm2015/core/common/services/index.js +4 -4
  217. package/esm2015/core/common/services/jwt-helper.service.js +103 -103
  218. package/esm2015/core/common/services/public-api.js +14 -14
  219. package/esm2015/core/common/services/session.service.js +72 -72
  220. package/esm2015/core/common/services/translate.service.js +47 -47
  221. package/esm2015/core/common/services/utilities.service.js +123 -123
  222. package/esm2015/core/common/services/validator.service.js +272 -272
  223. package/esm2015/core/common/services/window-scrolling.service.js +30 -30
  224. package/esm2015/core/customization/customization.model.js +290 -290
  225. package/esm2015/core/customization/customization.service.js +774 -774
  226. package/esm2015/core/customization/index.js +4 -4
  227. package/esm2015/core/customization/public-api.js +5 -5
  228. package/esm2015/core/http/index.js +4 -4
  229. package/esm2015/core/http/interceptors/error.interceptor.js +23 -23
  230. package/esm2015/core/http/interceptors/index.js +23 -23
  231. package/esm2015/core/http/interceptors/loader.interceptor.js +32 -32
  232. package/esm2015/core/http/interceptors/profiler.interceptor.js +28 -28
  233. package/esm2015/core/http/public-api.js +5 -5
  234. package/esm2015/core/http/services/http.service.js +160 -160
  235. package/esm2015/core/http/services/loader.service.js +48 -48
  236. package/esm2015/core/index.js +4 -4
  237. package/esm2015/core/layout/index.js +4 -4
  238. package/esm2015/core/layout/layout.service.js +168 -168
  239. package/esm2015/core/layout/public-api.js +5 -5
  240. package/esm2015/core/layout/rtl.directive.js +46 -46
  241. package/esm2015/core/portal/attach.directive.js +26 -26
  242. package/esm2015/core/portal/index.js +4 -4
  243. package/esm2015/core/portal/portal.service.js +34 -34
  244. package/esm2015/core/portal/public-api.js +6 -6
  245. package/esm2015/core/portal/target.directive.js +23 -23
  246. package/esm2015/core/public-api.js +10 -10
  247. package/esm2015/core/scroll-to/index.js +4 -4
  248. package/esm2015/core/scroll-to/public-api.js +5 -5
  249. package/esm2015/core/scroll-to/scroll-to.service.js +81 -81
  250. package/esm2015/date/date.component.js +244 -244
  251. package/esm2015/date/date.model.js +44 -44
  252. package/esm2015/date/date.module.js +50 -50
  253. package/esm2015/date/pepperi-addons-ngx-lib-date.js +5 -5
  254. package/esm2015/date/public-api.js +5 -5
  255. package/esm2015/dialog/default-dialog.component.js +28 -28
  256. package/esm2015/dialog/dialog.component.js +21 -21
  257. package/esm2015/dialog/dialog.model.js +21 -21
  258. package/esm2015/dialog/dialog.module.js +39 -39
  259. package/esm2015/dialog/dialog.service.js +73 -73
  260. package/esm2015/dialog/pepperi-addons-ngx-lib-dialog.js +5 -5
  261. package/esm2015/dialog/public-api.js +7 -7
  262. package/esm2015/draggable-items/draggable-item/draggable-item.component.js +24 -24
  263. package/esm2015/draggable-items/draggable-items.component.js +91 -91
  264. package/esm2015/draggable-items/draggable-items.model.js +1 -1
  265. package/esm2015/draggable-items/draggable-items.module.js +42 -42
  266. package/esm2015/draggable-items/pepperi-addons-ngx-lib-draggable-items.js +4 -4
  267. package/esm2015/draggable-items/public-api.js +7 -7
  268. package/esm2015/field-title/field-title.component.js +31 -31
  269. package/esm2015/field-title/field-title.module.js +31 -31
  270. package/esm2015/field-title/pepperi-addons-ngx-lib-field-title.js +4 -4
  271. package/esm2015/field-title/public-api.js +5 -5
  272. package/esm2015/files-uploader/files-uploader.component.js +220 -220
  273. package/esm2015/files-uploader/files-uploader.module.js +49 -49
  274. package/esm2015/files-uploader/pepperi-addons-ngx-lib-files-uploader.js +4 -4
  275. package/esm2015/files-uploader/public-api.js +5 -5
  276. package/esm2015/form/field-generator.component.js +121 -121
  277. package/esm2015/form/form.component.js +1189 -1181
  278. package/esm2015/form/form.model.js +1 -1
  279. package/esm2015/form/form.module.js +107 -107
  280. package/esm2015/form/indicators.component.js +20 -20
  281. package/esm2015/form/internal-button.component.js +165 -165
  282. package/esm2015/form/internal-carusel.component.js +115 -115
  283. package/esm2015/form/internal-carusel.service.js +31 -31
  284. package/esm2015/form/internal-list.component.js +494 -494
  285. package/esm2015/form/internal-menu.component.js +54 -54
  286. package/esm2015/form/internal-page.component.js +350 -350
  287. package/esm2015/form/internal-page.service.js +120 -120
  288. package/esm2015/form/pepperi-addons-ngx-lib-form.js +13 -13
  289. package/esm2015/form/public-api.js +6 -6
  290. package/esm2015/group-buttons/group-buttons.component.js +57 -57
  291. package/esm2015/group-buttons/group-buttons.module.js +37 -37
  292. package/esm2015/group-buttons/pepperi-addons-ngx-lib-group-buttons.js +4 -4
  293. package/esm2015/group-buttons/public-api.js +5 -5
  294. package/esm2015/icon/icon-generated-all.model.js +100 -100
  295. package/esm2015/icon/icon-generated.model.js +389 -389
  296. package/esm2015/icon/icon-registry.service.js +22 -22
  297. package/esm2015/icon/icon.component.js +124 -124
  298. package/esm2015/icon/icon.module.js +14 -14
  299. package/esm2015/icon/icon.service.js +31 -31
  300. package/esm2015/icon/pepperi-addons-ngx-lib-icon.js +4 -4
  301. package/esm2015/icon/public-api.js +10 -10
  302. package/esm2015/image/image.component.js +222 -222
  303. package/esm2015/image/image.module.js +48 -48
  304. package/esm2015/image/image.service.js +54 -54
  305. package/esm2015/image/pepperi-addons-ngx-lib-image.js +4 -4
  306. package/esm2015/image/public-api.js +6 -6
  307. package/esm2015/images-filmstrip/images-filmstrip.component.js +363 -363
  308. package/esm2015/images-filmstrip/images-filmstrip.module.js +70 -70
  309. package/esm2015/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.js +4 -4
  310. package/esm2015/images-filmstrip/public-api.js +5 -5
  311. package/esm2015/link/link.component.js +390 -390
  312. package/esm2015/link/link.module.js +50 -50
  313. package/esm2015/link/link.pipes.js +14 -14
  314. package/esm2015/link/pepperi-addons-ngx-lib-link.js +5 -5
  315. package/esm2015/link/public-api.js +5 -5
  316. package/esm2015/list/list-actions.component.js +35 -35
  317. package/esm2015/list/list-carousel.component.js +94 -94
  318. package/esm2015/list/list-chooser.component.js +57 -57
  319. package/esm2015/list/list-pager.component.js +112 -112
  320. package/esm2015/list/list-sorting.component.js +54 -54
  321. package/esm2015/list/list-total.component.js +23 -23
  322. package/esm2015/list/list-views.component.js +71 -71
  323. package/esm2015/list/list.component.js +1123 -1123
  324. package/esm2015/list/list.model.js +3 -3
  325. package/esm2015/list/list.module.js +87 -87
  326. package/esm2015/list/list.pipes.js +39 -39
  327. package/esm2015/list/pepperi-addons-ngx-lib-list.js +6 -6
  328. package/esm2015/list/public-api.js +14 -14
  329. package/esm2015/list/virtual-scroller.js +1018 -1018
  330. package/esm2015/menu/menu-item.component.js +102 -102
  331. package/esm2015/menu/menu.component.js +173 -173
  332. package/esm2015/menu/menu.model.js +18 -18
  333. package/esm2015/menu/menu.module.js +39 -39
  334. package/esm2015/menu/pepperi-addons-ngx-lib-menu.js +5 -5
  335. package/esm2015/menu/public-api.js +6 -6
  336. package/esm2015/ngx-lib.module.js +76 -76
  337. package/esm2015/page-layout/page-layout.component.js +41 -41
  338. package/esm2015/page-layout/page-layout.module.js +20 -20
  339. package/esm2015/page-layout/pepperi-addons-ngx-lib-page-layout.js +4 -4
  340. package/esm2015/page-layout/public-api.js +5 -5
  341. package/esm2015/pepperi-addons-ngx-lib.js +8 -8
  342. package/esm2015/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.js +4 -4
  343. package/esm2015/profile-data-views-list/profile-data-view/profile-data-view.component.js +38 -38
  344. package/esm2015/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.js +59 -59
  345. package/esm2015/profile-data-views-list/profile-data-views-list.component.js +86 -86
  346. package/esm2015/profile-data-views-list/profile-data-views-list.model.js +1 -1
  347. package/esm2015/profile-data-views-list/profile-data-views-list.module.js +56 -56
  348. package/esm2015/profile-data-views-list/public-api.js +8 -8
  349. package/esm2015/public-api.js +5 -5
  350. package/esm2015/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.js +6 -6
  351. package/esm2015/quantity-selector/public-api.js +5 -5
  352. package/esm2015/quantity-selector/quantity-selector-validation.directive.js +43 -43
  353. package/esm2015/quantity-selector/quantity-selector.component.js +460 -460
  354. package/esm2015/quantity-selector/quantity-selector.module.js +52 -52
  355. package/esm2015/quantity-selector/quantity-selector.pipes.js +18 -18
  356. package/esm2015/query-builder/common/model/field.js +1 -1
  357. package/esm2015/query-builder/common/model/filter.js +1 -1
  358. package/esm2015/query-builder/common/model/legacy.js +1 -1
  359. package/esm2015/query-builder/common/model/operator-unit.js +41 -41
  360. package/esm2015/query-builder/common/model/operator.js +206 -206
  361. package/esm2015/query-builder/common/model/structure.js +1 -1
  362. package/esm2015/query-builder/common/model/type-map.js +26 -26
  363. package/esm2015/query-builder/common/model/type.js +5 -5
  364. package/esm2015/query-builder/common/services/output-query.service.js +110 -110
  365. package/esm2015/query-builder/common/services/type-convertor.service.js +39 -39
  366. package/esm2015/query-builder/pepperi-addons-ngx-lib-query-builder.js +8 -8
  367. package/esm2015/query-builder/public-api.js +7 -7
  368. package/esm2015/query-builder/query-builder-item/query-builder-item.component.js +115 -115
  369. package/esm2015/query-builder/query-builder-section/query-builder-section.component.js +63 -63
  370. package/esm2015/query-builder/query-builder.component.js +103 -103
  371. package/esm2015/query-builder/query-builder.module.js +34 -34
  372. package/esm2015/query-builder/query-builder.service.js +281 -281
  373. package/esm2015/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.js +4 -4
  374. package/esm2015/rich-html-textarea/public-api.js +5 -5
  375. package/esm2015/rich-html-textarea/rich-html-textarea.component.js +219 -219
  376. package/esm2015/rich-html-textarea/rich-html-textarea.module.js +56 -56
  377. package/esm2015/search/pepperi-addons-ngx-lib-search.js +4 -4
  378. package/esm2015/search/public-api.js +6 -6
  379. package/esm2015/search/search.component.js +273 -273
  380. package/esm2015/search/search.model.js +1 -1
  381. package/esm2015/search/search.module.js +44 -44
  382. package/esm2015/select/pepperi-addons-ngx-lib-select.js +4 -4
  383. package/esm2015/select/public-api.js +5 -5
  384. package/esm2015/select/select.component.js +212 -212
  385. package/esm2015/select/select.module.js +42 -42
  386. package/esm2015/separator/pepperi-addons-ngx-lib-separator.js +4 -4
  387. package/esm2015/separator/public-api.js +5 -5
  388. package/esm2015/separator/separator.component.js +62 -62
  389. package/esm2015/separator/separator.module.js +12 -12
  390. package/esm2015/side-bar/pepperi-addons-ngx-lib-side-bar.js +4 -4
  391. package/esm2015/side-bar/public-api.js +6 -6
  392. package/esm2015/side-bar/side-bar.component.js +130 -130
  393. package/esm2015/side-bar/side-bar.model.js +1 -1
  394. package/esm2015/side-bar/side-bar.module.js +33 -33
  395. package/esm2015/signature/pepperi-addons-ngx-lib-signature.js +4 -4
  396. package/esm2015/signature/public-api.js +5 -5
  397. package/esm2015/signature/signature.component.js +230 -230
  398. package/esm2015/signature/signature.module.js +54 -54
  399. package/esm2015/size-detector/pepperi-addons-ngx-lib-size-detector.js +4 -4
  400. package/esm2015/size-detector/public-api.js +5 -5
  401. package/esm2015/size-detector/size-detector.component.js +88 -88
  402. package/esm2015/size-detector/size-detector.module.js +21 -21
  403. package/esm2015/slider/pepperi-addons-ngx-lib-slider.js +4 -4
  404. package/esm2015/slider/public-api.js +5 -5
  405. package/esm2015/slider/slider.component.js +95 -95
  406. package/esm2015/slider/slider.module.js +24 -24
  407. package/esm2015/smart-filters/boolean-filter/boolean-filter.component.js +41 -41
  408. package/esm2015/smart-filters/common/filter-actions.component.js +25 -25
  409. package/esm2015/smart-filters/common/model/base-filter-component.js +259 -259
  410. package/esm2015/smart-filters/common/model/creator.js +75 -75
  411. package/esm2015/smart-filters/common/model/field.js +116 -116
  412. package/esm2015/smart-filters/common/model/filter.js +1 -1
  413. package/esm2015/smart-filters/common/model/operator.js +215 -215
  414. package/esm2015/smart-filters/common/model/type.js +1 -1
  415. package/esm2015/smart-filters/date-filter/date-filter.component.js +143 -143
  416. package/esm2015/smart-filters/multi-select-filter/multi-select-filter.component.js +152 -152
  417. package/esm2015/smart-filters/number-filter/number-filter.component.js +102 -102
  418. package/esm2015/smart-filters/pepperi-addons-ngx-lib-smart-filters.js +4 -4
  419. package/esm2015/smart-filters/public-api.js +18 -18
  420. package/esm2015/smart-filters/smart-filters.component.js +129 -129
  421. package/esm2015/smart-filters/smart-filters.module.js +90 -90
  422. package/esm2015/smart-filters/text-filter/text-filter.component.js +78 -78
  423. package/esm2015/textarea/pepperi-addons-ngx-lib-textarea.js +4 -4
  424. package/esm2015/textarea/public-api.js +5 -5
  425. package/esm2015/textarea/textarea.component.js +160 -160
  426. package/esm2015/textarea/textarea.module.js +50 -50
  427. package/esm2015/textbox/pepperi-addons-ngx-lib-textbox.js +5 -5
  428. package/esm2015/textbox/public-api.js +5 -5
  429. package/esm2015/textbox/textbox-validation.directive.js +85 -85
  430. package/esm2015/textbox/textbox.component.js +368 -368
  431. package/esm2015/textbox/textbox.module.js +44 -44
  432. package/esm2015/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.js +4 -4
  433. package/esm2015/textbox-icon/public-api.js +5 -5
  434. package/esm2015/textbox-icon/textbox-icon.component.js +40 -40
  435. package/esm2015/textbox-icon/textbox-icon.module.js +46 -46
  436. package/esm2015/top-bar/pepperi-addons-ngx-lib-top-bar.js +4 -4
  437. package/esm2015/top-bar/public-api.js +6 -6
  438. package/esm2015/top-bar/top-bar.component.js +98 -98
  439. package/esm2015/top-bar/top-bar.model.js +1 -1
  440. package/esm2015/top-bar/top-bar.module.js +40 -40
  441. package/fesm2015/pepperi-addons-ngx-lib-address.js +116 -116
  442. package/fesm2015/pepperi-addons-ngx-lib-attachment.js +227 -227
  443. package/fesm2015/pepperi-addons-ngx-lib-bread-crumbs.js +109 -109
  444. package/fesm2015/pepperi-addons-ngx-lib-button.js +149 -149
  445. package/fesm2015/pepperi-addons-ngx-lib-carousel.js +731 -731
  446. package/fesm2015/pepperi-addons-ngx-lib-checkbox.js +178 -178
  447. package/fesm2015/pepperi-addons-ngx-lib-color.js +292 -292
  448. package/fesm2015/pepperi-addons-ngx-lib-date.js +313 -313
  449. package/fesm2015/pepperi-addons-ngx-lib-dialog.js +157 -157
  450. package/fesm2015/pepperi-addons-ngx-lib-draggable-items.js +143 -143
  451. package/fesm2015/pepperi-addons-ngx-lib-field-title.js +55 -55
  452. package/fesm2015/pepperi-addons-ngx-lib-files-uploader.js +252 -252
  453. package/fesm2015/pepperi-addons-ngx-lib-form.js +2685 -2677
  454. package/fesm2015/pepperi-addons-ngx-lib-form.js.map +1 -1
  455. package/fesm2015/pepperi-addons-ngx-lib-group-buttons.js +84 -84
  456. package/fesm2015/pepperi-addons-ngx-lib-icon.js +662 -662
  457. package/fesm2015/pepperi-addons-ngx-lib-image.js +300 -300
  458. package/fesm2015/pepperi-addons-ngx-lib-images-filmstrip.js +400 -400
  459. package/fesm2015/pepperi-addons-ngx-lib-link.js +434 -434
  460. package/fesm2015/pepperi-addons-ngx-lib-list.js +2657 -2657
  461. package/fesm2015/pepperi-addons-ngx-lib-menu.js +314 -314
  462. package/fesm2015/pepperi-addons-ngx-lib-page-layout.js +55 -55
  463. package/fesm2015/pepperi-addons-ngx-lib-profile-data-views-list.js +219 -219
  464. package/fesm2015/pepperi-addons-ngx-lib-quantity-selector.js +549 -549
  465. package/fesm2015/pepperi-addons-ngx-lib-query-builder.js +976 -976
  466. package/fesm2015/pepperi-addons-ngx-lib-rich-html-textarea.js +256 -256
  467. package/fesm2015/pepperi-addons-ngx-lib-search.js +301 -301
  468. package/fesm2015/pepperi-addons-ngx-lib-select.js +242 -242
  469. package/fesm2015/pepperi-addons-ngx-lib-separator.js +71 -71
  470. package/fesm2015/pepperi-addons-ngx-lib-side-bar.js +154 -154
  471. package/fesm2015/pepperi-addons-ngx-lib-signature.js +267 -267
  472. package/fesm2015/pepperi-addons-ngx-lib-size-detector.js +103 -103
  473. package/fesm2015/pepperi-addons-ngx-lib-slider.js +112 -112
  474. package/fesm2015/pepperi-addons-ngx-lib-smart-filters.js +1351 -1351
  475. package/fesm2015/pepperi-addons-ngx-lib-textarea.js +194 -194
  476. package/fesm2015/pepperi-addons-ngx-lib-textbox-icon.js +78 -78
  477. package/fesm2015/pepperi-addons-ngx-lib-textbox.js +478 -478
  478. package/fesm2015/pepperi-addons-ngx-lib-top-bar.js +125 -125
  479. package/fesm2015/pepperi-addons-ngx-lib.js +4087 -4087
  480. package/fesm2015/pepperi-addons-ngx-lib.js.map +1 -1
  481. package/field-title/field-title.component.d.ts +11 -11
  482. package/field-title/field-title.module.d.ts +5 -5
  483. package/field-title/pepperi-addons-ngx-lib-field-title.d.ts +4 -4
  484. package/field-title/public-api.d.ts +2 -2
  485. package/files-uploader/files-uploader.component.d.ts +53 -53
  486. package/files-uploader/files-uploader.module.d.ts +5 -5
  487. package/files-uploader/pepperi-addons-ngx-lib-files-uploader.d.ts +4 -4
  488. package/files-uploader/public-api.d.ts +2 -2
  489. package/form/field-generator.component.d.ts +36 -36
  490. package/form/form.component.d.ts +88 -88
  491. package/form/form.model.d.ts +20 -20
  492. package/form/form.module.d.ts +5 -5
  493. package/form/indicators.component.d.ts +7 -7
  494. package/form/internal-button.component.d.ts +39 -39
  495. package/form/internal-carusel.component.d.ts +38 -38
  496. package/form/internal-carusel.service.d.ts +7 -7
  497. package/form/internal-list.component.d.ts +92 -92
  498. package/form/internal-menu.component.d.ts +16 -16
  499. package/form/internal-page.component.d.ts +72 -72
  500. package/form/internal-page.service.d.ts +19 -19
  501. package/form/pepperi-addons-ngx-lib-form.d.ts +13 -13
  502. package/form/public-api.d.ts +3 -3
  503. package/group-buttons/group-buttons.component.d.ts +20 -20
  504. package/group-buttons/group-buttons.module.d.ts +5 -5
  505. package/group-buttons/pepperi-addons-ngx-lib-group-buttons.d.ts +4 -4
  506. package/group-buttons/public-api.d.ts +2 -2
  507. package/icon/icon-generated-all.model.d.ts +99 -99
  508. package/icon/icon-generated.model.d.ts +394 -394
  509. package/icon/icon-registry.service.d.ts +6 -6
  510. package/icon/icon.component.d.ts +46 -46
  511. package/icon/icon.module.d.ts +2 -2
  512. package/icon/icon.service.d.ts +10 -10
  513. package/icon/pepperi-addons-ngx-lib-icon.d.ts +4 -4
  514. package/icon/public-api.d.ts +6 -6
  515. package/image/image.component.d.ts +62 -62
  516. package/image/image.module.d.ts +5 -5
  517. package/image/image.service.d.ts +11 -11
  518. package/image/pepperi-addons-ngx-lib-image.d.ts +4 -4
  519. package/image/public-api.d.ts +3 -3
  520. package/images-filmstrip/images-filmstrip.component.d.ts +82 -82
  521. package/images-filmstrip/images-filmstrip.module.d.ts +5 -5
  522. package/images-filmstrip/pepperi-addons-ngx-lib-images-filmstrip.d.ts +4 -4
  523. package/images-filmstrip/public-api.d.ts +2 -2
  524. package/link/link.component.d.ts +136 -136
  525. package/link/link.module.d.ts +5 -5
  526. package/link/link.pipes.d.ts +4 -4
  527. package/link/pepperi-addons-ngx-lib-link.d.ts +5 -5
  528. package/link/public-api.d.ts +2 -2
  529. package/list/list-actions.component.d.ts +14 -14
  530. package/list/list-carousel.component.d.ts +36 -36
  531. package/list/list-chooser.component.d.ts +25 -25
  532. package/list/list-pager.component.d.ts +35 -35
  533. package/list/list-sorting.component.d.ts +26 -26
  534. package/list/list-total.component.d.ts +7 -7
  535. package/list/list-views.component.d.ts +31 -31
  536. package/list/list.component.d.ts +159 -159
  537. package/list/list.model.d.ts +30 -30
  538. package/list/list.module.d.ts +5 -5
  539. package/list/list.pipes.d.ts +11 -11
  540. package/list/pepperi-addons-ngx-lib-list.d.ts +6 -6
  541. package/list/public-api.d.ts +10 -10
  542. package/list/virtual-scroller.d.ts +176 -176
  543. package/menu/menu-item.component.d.ts +25 -25
  544. package/menu/menu.component.d.ts +43 -43
  545. package/menu/menu.model.d.ts +25 -25
  546. package/menu/menu.module.d.ts +5 -5
  547. package/menu/pepperi-addons-ngx-lib-menu.d.ts +5 -5
  548. package/menu/public-api.d.ts +3 -3
  549. package/ngx-lib.module.d.ts +2 -2
  550. package/package.json +1 -1
  551. package/page-layout/page-layout.component.d.ts +16 -16
  552. package/page-layout/page-layout.module.d.ts +2 -2
  553. package/page-layout/pepperi-addons-ngx-lib-page-layout.d.ts +4 -4
  554. package/page-layout/public-api.d.ts +2 -2
  555. package/pepperi-addons-ngx-lib.d.ts +8 -8
  556. package/profile-data-views-list/pepperi-addons-ngx-lib-profile-data-views-list.d.ts +4 -4
  557. package/profile-data-views-list/profile-data-view/profile-data-view.component.d.ts +15 -15
  558. package/profile-data-views-list/profile-data-views-card/profile-data-views-card.component.d.ts +21 -21
  559. package/profile-data-views-list/profile-data-views-list.component.d.ts +32 -32
  560. package/profile-data-views-list/profile-data-views-list.model.d.ts +18 -18
  561. package/profile-data-views-list/profile-data-views-list.module.d.ts +5 -5
  562. package/profile-data-views-list/public-api.d.ts +5 -5
  563. package/public-api.d.ts +2 -2
  564. package/quantity-selector/pepperi-addons-ngx-lib-quantity-selector.d.ts +6 -6
  565. package/quantity-selector/public-api.d.ts +2 -2
  566. package/quantity-selector/quantity-selector-validation.directive.d.ts +13 -13
  567. package/quantity-selector/quantity-selector.component.d.ts +96 -96
  568. package/quantity-selector/quantity-selector.module.d.ts +5 -5
  569. package/quantity-selector/quantity-selector.pipes.d.ts +4 -4
  570. package/query-builder/common/model/field.d.ts +8 -8
  571. package/query-builder/common/model/filter.d.ts +6 -6
  572. package/query-builder/common/model/legacy.d.ts +29 -29
  573. package/query-builder/common/model/operator-unit.d.ts +13 -13
  574. package/query-builder/common/model/operator.d.ts +21 -21
  575. package/query-builder/common/model/structure.d.ts +4 -4
  576. package/query-builder/common/model/type-map.d.ts +12 -12
  577. package/query-builder/common/model/type.d.ts +4 -4
  578. package/query-builder/common/services/output-query.service.d.ts +44 -44
  579. package/query-builder/common/services/type-convertor.service.d.ts +10 -10
  580. package/query-builder/pepperi-addons-ngx-lib-query-builder.d.ts +8 -8
  581. package/query-builder/public-api.d.ts +4 -4
  582. package/query-builder/query-builder-item/query-builder-item.component.d.ts +37 -37
  583. package/query-builder/query-builder-section/query-builder-section.component.d.ts +27 -27
  584. package/query-builder/query-builder.component.d.ts +35 -35
  585. package/query-builder/query-builder.module.d.ts +2 -2
  586. package/query-builder/query-builder.service.d.ts +94 -94
  587. package/rich-html-textarea/pepperi-addons-ngx-lib-rich-html-textarea.d.ts +4 -4
  588. package/rich-html-textarea/public-api.d.ts +2 -2
  589. package/rich-html-textarea/rich-html-textarea.component.d.ts +75 -75
  590. package/rich-html-textarea/rich-html-textarea.module.d.ts +5 -5
  591. package/search/pepperi-addons-ngx-lib-search.d.ts +4 -4
  592. package/search/public-api.d.ts +3 -3
  593. package/search/search.component.d.ts +61 -61
  594. package/search/search.model.d.ts +14 -14
  595. package/search/search.module.d.ts +5 -5
  596. package/select/pepperi-addons-ngx-lib-select.d.ts +4 -4
  597. package/select/public-api.d.ts +2 -2
  598. package/select/select.component.d.ts +50 -50
  599. package/select/select.module.d.ts +5 -5
  600. package/separator/pepperi-addons-ngx-lib-separator.d.ts +4 -4
  601. package/separator/public-api.d.ts +2 -2
  602. package/separator/separator.component.d.ts +19 -19
  603. package/separator/separator.module.d.ts +2 -2
  604. package/side-bar/pepperi-addons-ngx-lib-side-bar.d.ts +4 -4
  605. package/side-bar/public-api.d.ts +3 -3
  606. package/side-bar/side-bar.component.d.ts +38 -38
  607. package/side-bar/side-bar.model.d.ts +4 -4
  608. package/side-bar/side-bar.module.d.ts +5 -5
  609. package/signature/pepperi-addons-ngx-lib-signature.d.ts +4 -4
  610. package/signature/public-api.d.ts +2 -2
  611. package/signature/signature.component.d.ts +64 -64
  612. package/signature/signature.module.d.ts +5 -5
  613. package/size-detector/pepperi-addons-ngx-lib-size-detector.d.ts +4 -4
  614. package/size-detector/public-api.d.ts +2 -2
  615. package/size-detector/size-detector.component.d.ts +26 -26
  616. package/size-detector/size-detector.module.d.ts +2 -2
  617. package/slider/pepperi-addons-ngx-lib-slider.d.ts +4 -4
  618. package/slider/public-api.d.ts +2 -2
  619. package/slider/slider.component.d.ts +36 -36
  620. package/slider/slider.module.d.ts +2 -2
  621. package/smart-filters/boolean-filter/boolean-filter.component.d.ts +12 -12
  622. package/smart-filters/common/filter-actions.component.d.ts +9 -9
  623. package/smart-filters/common/model/base-filter-component.d.ts +67 -67
  624. package/smart-filters/common/model/creator.d.ts +6 -6
  625. package/smart-filters/common/model/field.d.ts +69 -69
  626. package/smart-filters/common/model/filter.d.ts +11 -11
  627. package/smart-filters/common/model/operator.d.ts +38 -38
  628. package/smart-filters/common/model/type.d.ts +4 -4
  629. package/smart-filters/date-filter/date-filter.component.d.ts +41 -41
  630. package/smart-filters/multi-select-filter/multi-select-filter.component.d.ts +39 -39
  631. package/smart-filters/number-filter/number-filter.component.d.ts +38 -38
  632. package/smart-filters/pepperi-addons-ngx-lib-smart-filters.d.ts +4 -4
  633. package/smart-filters/public-api.d.ts +14 -14
  634. package/smart-filters/smart-filters.component.d.ts +32 -32
  635. package/smart-filters/smart-filters.module.d.ts +5 -5
  636. package/smart-filters/text-filter/text-filter.component.d.ts +17 -17
  637. package/textarea/pepperi-addons-ngx-lib-textarea.d.ts +4 -4
  638. package/textarea/public-api.d.ts +2 -2
  639. package/textarea/textarea.component.d.ts +51 -51
  640. package/textarea/textarea.module.d.ts +5 -5
  641. package/textbox/pepperi-addons-ngx-lib-textbox.d.ts +5 -5
  642. package/textbox/public-api.d.ts +2 -2
  643. package/textbox/textbox-validation.directive.d.ts +18 -18
  644. package/textbox/textbox.component.d.ts +131 -131
  645. package/textbox/textbox.module.d.ts +5 -5
  646. package/textbox-icon/pepperi-addons-ngx-lib-textbox-icon.d.ts +4 -4
  647. package/textbox-icon/public-api.d.ts +2 -2
  648. package/textbox-icon/textbox-icon.component.d.ts +10 -10
  649. package/textbox-icon/textbox-icon.module.d.ts +5 -5
  650. package/top-bar/pepperi-addons-ngx-lib-top-bar.d.ts +4 -4
  651. package/top-bar/public-api.d.ts +3 -3
  652. package/top-bar/top-bar.component.d.ts +36 -36
  653. package/top-bar/top-bar.model.d.ts +4 -4
  654. package/top-bar/top-bar.module.d.ts +5 -5
@@ -4,1090 +4,1090 @@
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']['query-builder'] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.flexLayout, global['pepperi-addons']['ngx-lib']['smart-filters'], global['pepperi-addons']['ngx-lib'].select, global['pepperi-addons']['ngx-lib'].button, global['pepperi-addons']['ngx-lib']['group-buttons'], global.rxjs));
5
5
  }(this, (function (exports, core, common, forms, flexLayout, smartFilters, select, button, groupButtons, rxjs) { 'use strict';
6
6
 
7
- var Equals = {
8
- legacy: 'IsEqual',
9
- smartFilter: smartFilters.PepSmartFilterOperators.Equals,
10
- type: ['boolean', 'int', 'text']
11
- };
12
- var NotEqual = {
13
- legacy: 'IsNotEqual',
14
- smartFilter: smartFilters.PepSmartFilterOperators.NotEqual,
15
- type: null
16
- };
17
- var LessThan = {
18
- legacy: '<',
19
- smartFilter: smartFilters.PepSmartFilterOperators.LessThan,
20
- type: null
21
- };
22
- var GreaterThan = {
23
- legacy: '>',
24
- smartFilter: smartFilters.PepSmartFilterOperators.GreaterThan,
25
- type: null
26
- };
27
- /*
28
- const GreaterThanOrEquals: IPepQueryBuilderOperator = {
29
- legacy: {
30
- operator: '>=',
31
- type: 'Integer'
32
- },
33
- smartFilter: {
34
- item: PepSmartFilterOperators.GreaterThanOrEquals,
35
- type: 'int'
36
- }
37
- };
38
-
39
- const LessThanOrEquals: IPepQueryBuilderOperator = {
40
- legacy: {
41
- operator: '<=',
42
- type: 'Integer'
43
- },
44
- smartFilter: {
45
- item: PepSmartFilterOperators.LessThanOrEquals,
46
- type: 'int',
47
- type: 'Integer'
48
- }
49
- }; */
50
- var NumberRange = {
51
- legacy: 'Between',
52
- smartFilter: smartFilters.PepSmartFilterOperators.NumberRange,
53
- type: ['int']
54
- };
55
- var Contains = {
56
- legacy: 'Contains',
57
- smartFilter: smartFilters.PepSmartFilterOperators.Contains,
58
- type: null
59
- };
60
- /*
61
- const BeginsWith: IPepQueryBuilderOperator = {
62
- legacy: {
63
- operator: 'BeginsWith',
64
- type: 'String'
65
- },
66
- smartFilter: {
67
- item: PepSmartFilterOperators.BeginsWith,
68
- type: 'text'
69
- }
70
- };
71
-
72
- const EndsWith: IPepQueryBuilderOperator = {
73
- legacy: {
74
- operator: 'EndsWith',
75
- type: 'String'
76
- },
77
- smartFilter: {
78
- item: PepSmartFilterOperators.EndsWith,
79
- type: 'text'
80
- }
81
- };
82
-
83
- const Before: IPepQueryBuilderOperator = {
84
- legacy: {
85
- operator: 'Before',
86
- type: 'Date'
87
- },
88
- smartFilter: {
89
- item: PepSmartFilterOperators.Before,
90
- type: 'date'
91
- }
92
- };
93
-
94
- const After: IPepQueryBuilderOperator = {
95
- legacy: {
96
- operator: 'After',
97
- type: 'Date'
98
- },
99
- smartFilter: {
100
- item: PepSmartFilterOperators.After,
101
- type: 'date'
102
- }
103
- }; */
104
- var InTheLast = {
105
- legacy: 'InTheLast',
106
- smartFilter: smartFilters.PepSmartFilterOperators.InTheLast,
107
- type: null
108
- };
109
- var NotInTheLast = {
110
- legacy: 'NotInTheLast',
111
- smartFilter: smartFilters.PepSmartFilterOperators.NotInTheLast,
112
- type: null
113
- };
114
- var Today = {
115
- legacy: 'Today',
116
- smartFilter: smartFilters.PepSmartFilterOperators.Today,
117
- type: null
118
- };
119
- var ThisWeek = {
120
- legacy: 'ThisWeek',
121
- smartFilter: smartFilters.PepSmartFilterOperators.ThisWeek,
122
- type: null
123
- };
124
- var ThisMonth = {
125
- legacy: 'ThisMonth',
126
- smartFilter: smartFilters.PepSmartFilterOperators.ThisMonth,
127
- type: null
128
- };
129
- var DateRange = {
130
- legacy: 'Between',
131
- smartFilter: smartFilters.PepSmartFilterOperators.DateRange,
132
- type: ['date-time']
133
- };
134
- var DueIn = {
135
- legacy: 'DueIn',
136
- smartFilter: smartFilters.PepSmartFilterOperators.DueIn,
137
- type: null
138
- };
139
- var NotDueIn = {
140
- legacy: 'NotDueIn',
141
- smartFilter: smartFilters.PepSmartFilterOperators.NotDueIn,
142
- type: null
143
- };
144
- var On = {
145
- legacy: 'On',
146
- smartFilter: smartFilters.PepSmartFilterOperators.On,
147
- type: null
148
- };
149
- var IsEmpty = {
150
- legacy: 'IsEmpty',
151
- smartFilter: smartFilters.PepSmartFilterOperators.IsEmpty,
152
- type: null
153
- };
154
- var IsNotEmpty = {
155
- legacy: 'IsNotEmpty',
156
- smartFilter: smartFilters.PepSmartFilterOperators.IsNotEmpty,
157
- type: null
158
- };
159
- var In = {
160
- legacy: 'IsEqual',
161
- smartFilter: smartFilters.PepSmartFilterOperators.In,
162
- type: ['multi-select']
163
- };
164
- var PepQueryBuilderOperators = [
165
- Equals,
166
- NotEqual,
167
- LessThan,
168
- // LessThanOrEquals,
169
- GreaterThan,
170
- // GreaterThanOrEquals,
171
- NumberRange,
172
- Contains,
173
- // BeginsWith,
174
- // EndsWith,
175
- // After,
176
- // Before,
177
- InTheLast,
178
- NotInTheLast,
179
- Today,
180
- ThisWeek,
181
- ThisMonth,
182
- DateRange,
183
- DueIn,
184
- NotDueIn,
185
- On,
186
- IsEmpty,
187
- IsNotEmpty,
188
- In
189
- ];
190
- /**
191
- * gets a smart filter operator item
192
- * @param operator legacy operator
193
- * @param type smart filter's type
194
- * @returns smart filter operator item
195
- */
196
- function getSmartBuilderOperator(operator, type) {
197
- var smartFilterOperator = PepQueryBuilderOperators.find(function (item) { return item.legacy === operator &&
198
- (item.type === null || item.type.includes(type)); });
199
- return smartFilterOperator ? smartFilterOperator.smartFilter : null;
200
- }
201
- /**
202
- * gets a legacy operator value
203
- * @param operator smart filter operator item
204
- * @param type smart filter's type
205
- * @returns legacy operator value
206
- */
207
- function getLegacyOperator(operator, type) {
208
- var legacyOperator = PepQueryBuilderOperators.find(function (item) { return item.smartFilter === operator &&
209
- (item.type === null || item.type.includes(type)); });
210
- return legacyOperator ? legacyOperator.legacy : null;
7
+ var Equals = {
8
+ legacy: 'IsEqual',
9
+ smartFilter: smartFilters.PepSmartFilterOperators.Equals,
10
+ type: ['boolean', 'int', 'text']
11
+ };
12
+ var NotEqual = {
13
+ legacy: 'IsNotEqual',
14
+ smartFilter: smartFilters.PepSmartFilterOperators.NotEqual,
15
+ type: null
16
+ };
17
+ var LessThan = {
18
+ legacy: '<',
19
+ smartFilter: smartFilters.PepSmartFilterOperators.LessThan,
20
+ type: null
21
+ };
22
+ var GreaterThan = {
23
+ legacy: '>',
24
+ smartFilter: smartFilters.PepSmartFilterOperators.GreaterThan,
25
+ type: null
26
+ };
27
+ /*
28
+ const GreaterThanOrEquals: IPepQueryBuilderOperator = {
29
+ legacy: {
30
+ operator: '>=',
31
+ type: 'Integer'
32
+ },
33
+ smartFilter: {
34
+ item: PepSmartFilterOperators.GreaterThanOrEquals,
35
+ type: 'int'
36
+ }
37
+ };
38
+
39
+ const LessThanOrEquals: IPepQueryBuilderOperator = {
40
+ legacy: {
41
+ operator: '<=',
42
+ type: 'Integer'
43
+ },
44
+ smartFilter: {
45
+ item: PepSmartFilterOperators.LessThanOrEquals,
46
+ type: 'int',
47
+ type: 'Integer'
48
+ }
49
+ }; */
50
+ var NumberRange = {
51
+ legacy: 'Between',
52
+ smartFilter: smartFilters.PepSmartFilterOperators.NumberRange,
53
+ type: ['int']
54
+ };
55
+ var Contains = {
56
+ legacy: 'Contains',
57
+ smartFilter: smartFilters.PepSmartFilterOperators.Contains,
58
+ type: null
59
+ };
60
+ /*
61
+ const BeginsWith: IPepQueryBuilderOperator = {
62
+ legacy: {
63
+ operator: 'BeginsWith',
64
+ type: 'String'
65
+ },
66
+ smartFilter: {
67
+ item: PepSmartFilterOperators.BeginsWith,
68
+ type: 'text'
69
+ }
70
+ };
71
+
72
+ const EndsWith: IPepQueryBuilderOperator = {
73
+ legacy: {
74
+ operator: 'EndsWith',
75
+ type: 'String'
76
+ },
77
+ smartFilter: {
78
+ item: PepSmartFilterOperators.EndsWith,
79
+ type: 'text'
80
+ }
81
+ };
82
+
83
+ const Before: IPepQueryBuilderOperator = {
84
+ legacy: {
85
+ operator: 'Before',
86
+ type: 'Date'
87
+ },
88
+ smartFilter: {
89
+ item: PepSmartFilterOperators.Before,
90
+ type: 'date'
91
+ }
92
+ };
93
+
94
+ const After: IPepQueryBuilderOperator = {
95
+ legacy: {
96
+ operator: 'After',
97
+ type: 'Date'
98
+ },
99
+ smartFilter: {
100
+ item: PepSmartFilterOperators.After,
101
+ type: 'date'
102
+ }
103
+ }; */
104
+ var InTheLast = {
105
+ legacy: 'InTheLast',
106
+ smartFilter: smartFilters.PepSmartFilterOperators.InTheLast,
107
+ type: null
108
+ };
109
+ var NotInTheLast = {
110
+ legacy: 'NotInTheLast',
111
+ smartFilter: smartFilters.PepSmartFilterOperators.NotInTheLast,
112
+ type: null
113
+ };
114
+ var Today = {
115
+ legacy: 'Today',
116
+ smartFilter: smartFilters.PepSmartFilterOperators.Today,
117
+ type: null
118
+ };
119
+ var ThisWeek = {
120
+ legacy: 'ThisWeek',
121
+ smartFilter: smartFilters.PepSmartFilterOperators.ThisWeek,
122
+ type: null
123
+ };
124
+ var ThisMonth = {
125
+ legacy: 'ThisMonth',
126
+ smartFilter: smartFilters.PepSmartFilterOperators.ThisMonth,
127
+ type: null
128
+ };
129
+ var DateRange = {
130
+ legacy: 'Between',
131
+ smartFilter: smartFilters.PepSmartFilterOperators.DateRange,
132
+ type: ['date-time']
133
+ };
134
+ var DueIn = {
135
+ legacy: 'DueIn',
136
+ smartFilter: smartFilters.PepSmartFilterOperators.DueIn,
137
+ type: null
138
+ };
139
+ var NotDueIn = {
140
+ legacy: 'NotDueIn',
141
+ smartFilter: smartFilters.PepSmartFilterOperators.NotDueIn,
142
+ type: null
143
+ };
144
+ var On = {
145
+ legacy: 'On',
146
+ smartFilter: smartFilters.PepSmartFilterOperators.On,
147
+ type: null
148
+ };
149
+ var IsEmpty = {
150
+ legacy: 'IsEmpty',
151
+ smartFilter: smartFilters.PepSmartFilterOperators.IsEmpty,
152
+ type: null
153
+ };
154
+ var IsNotEmpty = {
155
+ legacy: 'IsNotEmpty',
156
+ smartFilter: smartFilters.PepSmartFilterOperators.IsNotEmpty,
157
+ type: null
158
+ };
159
+ var In = {
160
+ legacy: 'IsEqual',
161
+ smartFilter: smartFilters.PepSmartFilterOperators.In,
162
+ type: ['multi-select']
163
+ };
164
+ var PepQueryBuilderOperators = [
165
+ Equals,
166
+ NotEqual,
167
+ LessThan,
168
+ // LessThanOrEquals,
169
+ GreaterThan,
170
+ // GreaterThanOrEquals,
171
+ NumberRange,
172
+ Contains,
173
+ // BeginsWith,
174
+ // EndsWith,
175
+ // After,
176
+ // Before,
177
+ InTheLast,
178
+ NotInTheLast,
179
+ Today,
180
+ ThisWeek,
181
+ ThisMonth,
182
+ DateRange,
183
+ DueIn,
184
+ NotDueIn,
185
+ On,
186
+ IsEmpty,
187
+ IsNotEmpty,
188
+ In
189
+ ];
190
+ /**
191
+ * gets a smart filter operator item
192
+ * @param operator legacy operator
193
+ * @param type smart filter's type
194
+ * @returns smart filter operator item
195
+ */
196
+ function getSmartBuilderOperator(operator, type) {
197
+ var smartFilterOperator = PepQueryBuilderOperators.find(function (item) { return item.legacy === operator &&
198
+ (item.type === null || item.type.includes(type)); });
199
+ return smartFilterOperator ? smartFilterOperator.smartFilter : null;
200
+ }
201
+ /**
202
+ * gets a legacy operator value
203
+ * @param operator smart filter operator item
204
+ * @param type smart filter's type
205
+ * @returns legacy operator value
206
+ */
207
+ function getLegacyOperator(operator, type) {
208
+ var legacyOperator = PepQueryBuilderOperators.find(function (item) { return item.smartFilter === operator &&
209
+ (item.type === null || item.type.includes(type)); });
210
+ return legacyOperator ? legacyOperator.legacy : null;
211
211
  }
212
212
 
213
- var PepTypeConvertorService = /** @class */ (function () {
214
- function PepTypeConvertorService() {
215
- this._operators = [];
216
- this._booleans = [];
217
- this.initOperators();
218
- this.initBooleans();
219
- }
220
- Object.defineProperty(PepTypeConvertorService.prototype, "operators", {
221
- get: function () {
222
- return this._operators;
223
- },
224
- enumerable: false,
225
- configurable: true
226
- });
227
- Object.defineProperty(PepTypeConvertorService.prototype, "booleans", {
228
- get: function () {
229
- return this._booleans;
230
- },
231
- enumerable: false,
232
- configurable: true
233
- });
234
- PepTypeConvertorService.prototype.initOperators = function () {
235
- this._operators.push({
236
- key: 'AND',
237
- value: 'And'
238
- });
239
- this._operators.push({
240
- key: 'OR',
241
- value: 'Or'
242
- });
243
- };
244
- PepTypeConvertorService.prototype.initBooleans = function () {
245
- this._booleans.push({
246
- key: 'True',
247
- value: 'True'
248
- });
249
- this._booleans.push({
250
- key: 'False',
251
- value: 'False'
252
- });
253
- };
254
- return PepTypeConvertorService;
255
- }());
256
- PepTypeConvertorService.decorators = [
257
- { type: core.Injectable }
258
- ];
213
+ var PepTypeConvertorService = /** @class */ (function () {
214
+ function PepTypeConvertorService() {
215
+ this._operators = [];
216
+ this._booleans = [];
217
+ this.initOperators();
218
+ this.initBooleans();
219
+ }
220
+ Object.defineProperty(PepTypeConvertorService.prototype, "operators", {
221
+ get: function () {
222
+ return this._operators;
223
+ },
224
+ enumerable: false,
225
+ configurable: true
226
+ });
227
+ Object.defineProperty(PepTypeConvertorService.prototype, "booleans", {
228
+ get: function () {
229
+ return this._booleans;
230
+ },
231
+ enumerable: false,
232
+ configurable: true
233
+ });
234
+ PepTypeConvertorService.prototype.initOperators = function () {
235
+ this._operators.push({
236
+ key: 'AND',
237
+ value: 'And'
238
+ });
239
+ this._operators.push({
240
+ key: 'OR',
241
+ value: 'Or'
242
+ });
243
+ };
244
+ PepTypeConvertorService.prototype.initBooleans = function () {
245
+ this._booleans.push({
246
+ key: 'True',
247
+ value: 'True'
248
+ });
249
+ this._booleans.push({
250
+ key: 'False',
251
+ value: 'False'
252
+ });
253
+ };
254
+ return PepTypeConvertorService;
255
+ }());
256
+ PepTypeConvertorService.decorators = [
257
+ { type: core.Injectable }
258
+ ];
259
259
  PepTypeConvertorService.ctorParameters = function () { return []; };
260
260
 
261
- var PepQueryBuilderSectionComponent = /** @class */ (function () {
262
- function PepQueryBuilderSectionComponent(_typeConvertorService) {
263
- this._typeConvertorService = _typeConvertorService;
264
- this.hasFields = true;
265
- this.createSection = new core.EventEmitter();
266
- this.createItem = new core.EventEmitter();
267
- this.remove = new core.EventEmitter();
268
- this.operatorChange = new core.EventEmitter();
269
- }
270
- PepQueryBuilderSectionComponent.prototype.ngOnInit = function () {
271
- this.initOperators();
272
- };
273
- Object.defineProperty(PepQueryBuilderSectionComponent.prototype, "f", {
274
- get: function () {
275
- return this.form.controls;
276
- },
277
- enumerable: false,
278
- configurable: true
279
- });
280
- PepQueryBuilderSectionComponent.prototype.initOperators = function () {
281
- var _this = this;
282
- this.toggleButtons = this._typeConvertorService.operators.map(function (operator) {
283
- return {
284
- key: operator.key,
285
- value: operator.value,
286
- callback: function (event) { return _this.onOperatorChanged(event); }
287
- };
288
- });
289
- };
290
- PepQueryBuilderSectionComponent.prototype.onOperatorChanged = function (event) {
291
- var _a;
292
- if ((_a = event === null || event === void 0 ? void 0 : event.source) === null || _a === void 0 ? void 0 : _a.key) {
293
- this.f.operator.setValue(event.source.key);
294
- this.operatorChange.emit();
295
- }
296
- };
297
- PepQueryBuilderSectionComponent.prototype.onAddRuleClicked = function () {
298
- this.createItem.emit();
299
- };
300
- PepQueryBuilderSectionComponent.prototype.onAddRuleSetClicked = function () {
301
- this.createSection.emit();
302
- };
303
- PepQueryBuilderSectionComponent.prototype.onDeleteSectionClicked = function () {
304
- this.remove.emit();
305
- };
306
- return PepQueryBuilderSectionComponent;
307
- }());
308
- PepQueryBuilderSectionComponent.decorators = [
309
- { type: core.Component, args: [{
310
- selector: 'pep-query-builder-section',
311
- template: "<div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <div class=\"query-section-container\" fxLayout=\"column\" fxLayoutGap=\".5rem\">\n <div fxLayout=\"row\" fxLayoutAlign=\"space-between\">\n <pep-group-buttons [buttons]=\"toggleButtons\" [selectedButtonKey]=\"f.operator?.value || ''\" styleType=\"weak\"\n sizeType=\"sm\" [viewType]=\"'toggle'\" [buttonsDisabled]=\"!hasFields\">\n </pep-group-buttons>\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-button value=\"Add Filter\" styleType=\"weak\" styleStateType=\"system\" sizeType=\"sm\" classNames=\"\"\n [disabled]=\"!hasFields\" iconName=\"number_plus\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onAddRuleClicked()\"></pep-button>\n <ng-container *ngIf=\"depth.current < depth.max-1\">\n <pep-button value=\"Add Filter Group\" styleType=\"weak\" styleStateType=\"system\" sizeType=\"sm\"\n classNames=\"\" [disabled]=\"!hasFields\" iconName=\"number_plus\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onAddRuleSetClicked()\"></pep-button>\n </ng-container>\n </div>\n </div>\n <ng-container #sectionContainer></ng-container>\n </div>\n <pep-button *ngIf=\"depth.current > 0\" styleType=\"weak\" styleStateType=\"system_bin\" sizeType=\"md\" classNames=\"\"\n [disabled]=\"false\" iconName=\"system_bin\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onDeleteSectionClicked()\">\n </pep-button>\n</div>",
312
- styles: [".query-section-container{border-radius:.25rem;border-radius:var(--pep-border-radius-md,.25rem);padding:.5rem;width:100%}", ".query-section-container{box-shadow:0 .25rem .5rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-sm-offset,0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);border:1px solid rgba(26,26,26,.24);border:1px solid hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.24)}"]
313
- },] }
314
- ];
315
- PepQueryBuilderSectionComponent.ctorParameters = function () { return [
316
- { type: PepTypeConvertorService }
317
- ]; };
318
- PepQueryBuilderSectionComponent.propDecorators = {
319
- form: [{ type: core.Input }],
320
- depth: [{ type: core.Input }],
321
- hasFields: [{ type: core.Input }],
322
- createSection: [{ type: core.Output }],
323
- createItem: [{ type: core.Output }],
324
- remove: [{ type: core.Output }],
325
- operatorChange: [{ type: core.Output }],
326
- sectionContainer: [{ type: core.ViewChild, args: ['sectionContainer', { read: core.ViewContainerRef, static: true },] }]
261
+ var PepQueryBuilderSectionComponent = /** @class */ (function () {
262
+ function PepQueryBuilderSectionComponent(_typeConvertorService) {
263
+ this._typeConvertorService = _typeConvertorService;
264
+ this.hasFields = true;
265
+ this.createSection = new core.EventEmitter();
266
+ this.createItem = new core.EventEmitter();
267
+ this.remove = new core.EventEmitter();
268
+ this.operatorChange = new core.EventEmitter();
269
+ }
270
+ PepQueryBuilderSectionComponent.prototype.ngOnInit = function () {
271
+ this.initOperators();
272
+ };
273
+ Object.defineProperty(PepQueryBuilderSectionComponent.prototype, "f", {
274
+ get: function () {
275
+ return this.form.controls;
276
+ },
277
+ enumerable: false,
278
+ configurable: true
279
+ });
280
+ PepQueryBuilderSectionComponent.prototype.initOperators = function () {
281
+ var _this = this;
282
+ this.toggleButtons = this._typeConvertorService.operators.map(function (operator) {
283
+ return {
284
+ key: operator.key,
285
+ value: operator.value,
286
+ callback: function (event) { return _this.onOperatorChanged(event); }
287
+ };
288
+ });
289
+ };
290
+ PepQueryBuilderSectionComponent.prototype.onOperatorChanged = function (event) {
291
+ var _a;
292
+ if ((_a = event === null || event === void 0 ? void 0 : event.source) === null || _a === void 0 ? void 0 : _a.key) {
293
+ this.f.operator.setValue(event.source.key);
294
+ this.operatorChange.emit();
295
+ }
296
+ };
297
+ PepQueryBuilderSectionComponent.prototype.onAddRuleClicked = function () {
298
+ this.createItem.emit();
299
+ };
300
+ PepQueryBuilderSectionComponent.prototype.onAddRuleSetClicked = function () {
301
+ this.createSection.emit();
302
+ };
303
+ PepQueryBuilderSectionComponent.prototype.onDeleteSectionClicked = function () {
304
+ this.remove.emit();
305
+ };
306
+ return PepQueryBuilderSectionComponent;
307
+ }());
308
+ PepQueryBuilderSectionComponent.decorators = [
309
+ { type: core.Component, args: [{
310
+ selector: 'pep-query-builder-section',
311
+ template: "<div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <div class=\"query-section-container\" fxLayout=\"column\" fxLayoutGap=\".5rem\">\n <div fxLayout=\"row\" fxLayoutAlign=\"space-between\">\n <pep-group-buttons [buttons]=\"toggleButtons\" [selectedButtonKey]=\"f.operator?.value || ''\" styleType=\"weak\"\n sizeType=\"sm\" [viewType]=\"'toggle'\" [buttonsDisabled]=\"!hasFields\">\n </pep-group-buttons>\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-button value=\"Add Filter\" styleType=\"weak\" styleStateType=\"system\" sizeType=\"sm\" classNames=\"\"\n [disabled]=\"!hasFields\" iconName=\"number_plus\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onAddRuleClicked()\"></pep-button>\n <ng-container *ngIf=\"depth.current < depth.max-1\">\n <pep-button value=\"Add Filter Group\" styleType=\"weak\" styleStateType=\"system\" sizeType=\"sm\"\n classNames=\"\" [disabled]=\"!hasFields\" iconName=\"number_plus\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onAddRuleSetClicked()\"></pep-button>\n </ng-container>\n </div>\n </div>\n <ng-container #sectionContainer></ng-container>\n </div>\n <pep-button *ngIf=\"depth.current > 0\" styleType=\"weak\" styleStateType=\"system_bin\" sizeType=\"md\" classNames=\"\"\n [disabled]=\"false\" iconName=\"system_bin\" iconPosition=\"end\" [visible]=\"true\"\n (buttonClick)=\"onDeleteSectionClicked()\">\n </pep-button>\n</div>",
312
+ styles: [".query-section-container{border-radius:.25rem;border-radius:var(--pep-border-radius-md,.25rem);padding:.5rem;width:100%}", ".query-section-container{box-shadow:0 .25rem .5rem 0 rgba(26,26,26,.08);box-shadow:var(--pep-shadow-sm-offset,0 .25rem .5rem 0) hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.08);border:1px solid rgba(26,26,26,.24);border:1px solid hsla(var(--pep-color-system-primary-h,0),var(--pep-color-system-primary-s,0%),var(--pep-color-system-primary-l,10%),.24)}"]
313
+ },] }
314
+ ];
315
+ PepQueryBuilderSectionComponent.ctorParameters = function () { return [
316
+ { type: PepTypeConvertorService }
317
+ ]; };
318
+ PepQueryBuilderSectionComponent.propDecorators = {
319
+ form: [{ type: core.Input }],
320
+ depth: [{ type: core.Input }],
321
+ hasFields: [{ type: core.Input }],
322
+ createSection: [{ type: core.Output }],
323
+ createItem: [{ type: core.Output }],
324
+ remove: [{ type: core.Output }],
325
+ operatorChange: [{ type: core.Output }],
326
+ sectionContainer: [{ type: core.ViewChild, args: ['sectionContainer', { read: core.ViewContainerRef, static: true },] }]
327
327
  };
328
328
 
329
- var PepQueryBuilderItemComponent = /** @class */ (function () {
330
- function PepQueryBuilderItemComponent(_fb, typeConvertorService) {
331
- this._fb = _fb;
332
- this.typeConvertorService = typeConvertorService;
333
- this._fields = [];
334
- this._options = [];
335
- this._selectedField = null;
336
- this.filterChange = new core.EventEmitter();
337
- this.remove = new core.EventEmitter();
338
- this.setupForm();
339
- }
340
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "fields", {
341
- set: function (list) {
342
- if ((list === null || list === void 0 ? void 0 : list.length) > 0) {
343
- this._fields = list;
344
- this._options = list.map(function (field) {
345
- return {
346
- key: field.smart.id,
347
- value: field.smart.name
348
- };
349
- });
350
- }
351
- },
352
- enumerable: false,
353
- configurable: true
354
- });
355
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "selected", {
356
- set: function (value) {
357
- if (value) {
358
- this._selectedField = value.smart;
359
- this.queryForm.fieldType.setValue(value.query.fieldType);
360
- }
361
- },
362
- enumerable: false,
363
- configurable: true
364
- });
365
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "filter", {
366
- set: function (value) {
367
- if (value) {
368
- this._filter = value;
369
- }
370
- },
371
- enumerable: false,
372
- configurable: true
373
- });
374
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "parentForm", {
375
- set: function (value) {
376
- if (value) {
377
- this._parentForm = value;
378
- this.addToParentForm();
379
- }
380
- },
381
- enumerable: false,
382
- configurable: true
383
- });
384
- PepQueryBuilderItemComponent.prototype.ngOnInit = function () {
385
- //
386
- };
387
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "f", {
388
- get: function () {
389
- return this.form.controls;
390
- },
391
- enumerable: false,
392
- configurable: true
393
- });
394
- Object.defineProperty(PepQueryBuilderItemComponent.prototype, "queryForm", {
395
- get: function () {
396
- return this.f.query.controls;
397
- },
398
- enumerable: false,
399
- configurable: true
400
- });
401
- PepQueryBuilderItemComponent.prototype.setupForm = function () {
402
- this.form = this._fb.group({
403
- smart: this._fb.group({
404
- fieldId: this._fb.control(null),
405
- fieldType: this._fb.control(null),
406
- operator: this._fb.control(null),
407
- operatorUnit: this._fb.control(null),
408
- values: this._fb.group({
409
- first: this._fb.control(null),
410
- second: this._fb.control(null)
411
- })
412
- }),
413
- query: this._fb.group({
414
- fieldType: this._fb.control(null)
415
- })
416
- });
417
- };
418
- PepQueryBuilderItemComponent.prototype.addToParentForm = function () {
419
- this._parentForm.setControl(this.formKey, this.form);
420
- };
421
- PepQueryBuilderItemComponent.prototype.onFieldChanged = function (key) {
422
- var _this = this;
423
- var item = this._fields.find(function (field) { return field.smart.id === key; });
424
- this.setupForm();
425
- this.queryForm.fieldType.setValue(item.query.fieldType);
426
- this.addToParentForm();
427
- /**
428
- * hack due to angular's change detection bug -
429
- * ERROR Error: There is no FormControl instance attached to form control element with name: [formControlName]
430
- */
431
- this._selectedField = null;
432
- setTimeout(function () {
433
- _this._selectedField = item ? item.smart : null;
434
- }, 0);
435
- this._filter = null;
436
- };
437
- PepQueryBuilderItemComponent.prototype.onFilterChanged = function () {
438
- if (this.form.valid) {
439
- this.filterChange.emit();
440
- }
441
- };
442
- PepQueryBuilderItemComponent.prototype.onDeleteItemClicked = function () {
443
- this.remove.emit();
444
- };
445
- return PepQueryBuilderItemComponent;
446
- }());
447
- PepQueryBuilderItemComponent.decorators = [
448
- { type: core.Component, args: [{
449
- selector: 'pep-query-builder-item',
450
- template: "<div fxLayout=\"column\" fxLayoutGap=\".5rem\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select fxFlex=\"25%\" [value]=\"_selectedField?.id\" xAlignment=\"left\" [options]=\"_options\"\n [renderTitle]=\"false\" (valueChange)=\"onFieldChanged($event)\"></pep-select>\n <ng-container *ngIf=\"_selectedField?.componentType\">\n <ng-container [ngSwitch]=\"_selectedField.componentType\">\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-text-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [options]=\"typeConvertorService.booleans\" [renderTitle]=\"false\"\n (filterChange)=\"onFilterChanged()\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-number-filter>\n </ng-container>\n </ng-container>\n </ng-container>\n <pep-button styleType=\"weak\" styleStateType=\"system_bin\" sizeType=\"md\" classNames=\"\" [disabled]=\"false\"\n iconName=\"system_bin\" iconPosition=\"end\" [visible]=\"true\" (buttonClick)=\"onDeleteItemClicked()\">\n </pep-button>\n </div>\n</div>",
451
- styles: ["::ng-deep .pep-field-no-spacing{min-height:0!important;margin-bottom:0!important}"]
452
- },] }
453
- ];
454
- PepQueryBuilderItemComponent.ctorParameters = function () { return [
455
- { type: forms.FormBuilder },
456
- { type: PepTypeConvertorService }
457
- ]; };
458
- PepQueryBuilderItemComponent.propDecorators = {
459
- formKey: [{ type: core.Input }],
460
- fields: [{ type: core.Input }],
461
- selected: [{ type: core.Input }],
462
- filter: [{ type: core.Input }],
463
- parentForm: [{ type: core.Input }],
464
- filterChange: [{ type: core.Output }],
465
- remove: [{ type: core.Output }]
329
+ var PepQueryBuilderItemComponent = /** @class */ (function () {
330
+ function PepQueryBuilderItemComponent(_fb, typeConvertorService) {
331
+ this._fb = _fb;
332
+ this.typeConvertorService = typeConvertorService;
333
+ this._fields = [];
334
+ this._options = [];
335
+ this._selectedField = null;
336
+ this.filterChange = new core.EventEmitter();
337
+ this.remove = new core.EventEmitter();
338
+ this.setupForm();
339
+ }
340
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "fields", {
341
+ set: function (list) {
342
+ if ((list === null || list === void 0 ? void 0 : list.length) > 0) {
343
+ this._fields = list;
344
+ this._options = list.map(function (field) {
345
+ return {
346
+ key: field.smart.id,
347
+ value: field.smart.name
348
+ };
349
+ });
350
+ }
351
+ },
352
+ enumerable: false,
353
+ configurable: true
354
+ });
355
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "selected", {
356
+ set: function (value) {
357
+ if (value) {
358
+ this._selectedField = value.smart;
359
+ this.queryForm.fieldType.setValue(value.query.fieldType);
360
+ }
361
+ },
362
+ enumerable: false,
363
+ configurable: true
364
+ });
365
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "filter", {
366
+ set: function (value) {
367
+ if (value) {
368
+ this._filter = value;
369
+ }
370
+ },
371
+ enumerable: false,
372
+ configurable: true
373
+ });
374
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "parentForm", {
375
+ set: function (value) {
376
+ if (value) {
377
+ this._parentForm = value;
378
+ this.addToParentForm();
379
+ }
380
+ },
381
+ enumerable: false,
382
+ configurable: true
383
+ });
384
+ PepQueryBuilderItemComponent.prototype.ngOnInit = function () {
385
+ //
386
+ };
387
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "f", {
388
+ get: function () {
389
+ return this.form.controls;
390
+ },
391
+ enumerable: false,
392
+ configurable: true
393
+ });
394
+ Object.defineProperty(PepQueryBuilderItemComponent.prototype, "queryForm", {
395
+ get: function () {
396
+ return this.f.query.controls;
397
+ },
398
+ enumerable: false,
399
+ configurable: true
400
+ });
401
+ PepQueryBuilderItemComponent.prototype.setupForm = function () {
402
+ this.form = this._fb.group({
403
+ smart: this._fb.group({
404
+ fieldId: this._fb.control(null),
405
+ fieldType: this._fb.control(null),
406
+ operator: this._fb.control(null),
407
+ operatorUnit: this._fb.control(null),
408
+ values: this._fb.group({
409
+ first: this._fb.control(null),
410
+ second: this._fb.control(null)
411
+ })
412
+ }),
413
+ query: this._fb.group({
414
+ fieldType: this._fb.control(null)
415
+ })
416
+ });
417
+ };
418
+ PepQueryBuilderItemComponent.prototype.addToParentForm = function () {
419
+ this._parentForm.setControl(this.formKey, this.form);
420
+ };
421
+ PepQueryBuilderItemComponent.prototype.onFieldChanged = function (key) {
422
+ var _this = this;
423
+ var item = this._fields.find(function (field) { return field.smart.id === key; });
424
+ this.setupForm();
425
+ this.queryForm.fieldType.setValue(item.query.fieldType);
426
+ this.addToParentForm();
427
+ /**
428
+ * hack due to angular's change detection bug -
429
+ * ERROR Error: There is no FormControl instance attached to form control element with name: [formControlName]
430
+ */
431
+ this._selectedField = null;
432
+ setTimeout(function () {
433
+ _this._selectedField = item ? item.smart : null;
434
+ }, 0);
435
+ this._filter = null;
436
+ };
437
+ PepQueryBuilderItemComponent.prototype.onFilterChanged = function () {
438
+ if (this.form.valid) {
439
+ this.filterChange.emit();
440
+ }
441
+ };
442
+ PepQueryBuilderItemComponent.prototype.onDeleteItemClicked = function () {
443
+ this.remove.emit();
444
+ };
445
+ return PepQueryBuilderItemComponent;
446
+ }());
447
+ PepQueryBuilderItemComponent.decorators = [
448
+ { type: core.Component, args: [{
449
+ selector: 'pep-query-builder-item',
450
+ template: "<div fxLayout=\"column\" fxLayoutGap=\".5rem\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select fxFlex=\"25%\" [value]=\"_selectedField?.id\" xAlignment=\"left\" [options]=\"_options\"\n [renderTitle]=\"false\" (valueChange)=\"onFieldChanged($event)\"></pep-select>\n <ng-container *ngIf=\"_selectedField?.componentType\">\n <ng-container [ngSwitch]=\"_selectedField.componentType\">\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-text-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [options]=\"typeConvertorService.booleans\" [renderTitle]=\"false\"\n (filterChange)=\"onFilterChanged()\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter fxFlex=\"auto\" [showActionButtons]=\"false\" [field]=\"_selectedField\"\n [filter]=\"_filter\" [parentForm]=\"f.smart\" [emitOnChange]=\"true\" [inline]=\"true\"\n [renderTitle]=\"false\" (filterChange)=\"onFilterChanged()\">\n </pep-number-filter>\n </ng-container>\n </ng-container>\n </ng-container>\n <pep-button styleType=\"weak\" styleStateType=\"system_bin\" sizeType=\"md\" classNames=\"\" [disabled]=\"false\"\n iconName=\"system_bin\" iconPosition=\"end\" [visible]=\"true\" (buttonClick)=\"onDeleteItemClicked()\">\n </pep-button>\n </div>\n</div>",
451
+ styles: ["::ng-deep .pep-field-no-spacing{min-height:0!important;margin-bottom:0!important}"]
452
+ },] }
453
+ ];
454
+ PepQueryBuilderItemComponent.ctorParameters = function () { return [
455
+ { type: forms.FormBuilder },
456
+ { type: PepTypeConvertorService }
457
+ ]; };
458
+ PepQueryBuilderItemComponent.propDecorators = {
459
+ formKey: [{ type: core.Input }],
460
+ fields: [{ type: core.Input }],
461
+ selected: [{ type: core.Input }],
462
+ filter: [{ type: core.Input }],
463
+ parentForm: [{ type: core.Input }],
464
+ filterChange: [{ type: core.Output }],
465
+ remove: [{ type: core.Output }]
466
466
  };
467
467
 
468
- var PepQueryBuilderTypeMap = /** @class */ (function () {
469
- function PepQueryBuilderTypeMap() {
470
- this.loadTypes();
471
- }
472
- PepQueryBuilderTypeMap.prototype.loadTypes = function () {
473
- this.map = new Map();
474
- this.map.set('Bool', 'boolean');
475
- this.map.set('JsonBool', 'boolean');
476
- this.map.set('Integer', 'int');
477
- this.map.set('Double', 'int');
478
- this.map.set('String', 'text');
479
- this.map.set('Guid', 'text');
480
- this.map.set('Date', 'date');
481
- this.map.set('DateTime', 'date-time');
482
- this.map.set('MultipleStringValues', 'multi-select');
483
- };
484
- /**
485
- * Converts legacy field type to smart builder type
486
- * @param type legacy type
487
- * @returns smart builder field type
488
- */
489
- PepQueryBuilderTypeMap.prototype.getSmartBuilderType = function (key) {
490
- var item = this.map.get(key);
491
- return item ? item : null;
492
- };
493
- return PepQueryBuilderTypeMap;
468
+ var PepQueryBuilderTypeMap = /** @class */ (function () {
469
+ function PepQueryBuilderTypeMap() {
470
+ this.loadTypes();
471
+ }
472
+ PepQueryBuilderTypeMap.prototype.loadTypes = function () {
473
+ this.map = new Map();
474
+ this.map.set('Bool', 'boolean');
475
+ this.map.set('JsonBool', 'boolean');
476
+ this.map.set('Integer', 'int');
477
+ this.map.set('Double', 'int');
478
+ this.map.set('String', 'text');
479
+ this.map.set('Guid', 'text');
480
+ this.map.set('Date', 'date');
481
+ this.map.set('DateTime', 'date-time');
482
+ this.map.set('MultipleStringValues', 'multi-select');
483
+ };
484
+ /**
485
+ * Converts legacy field type to smart builder type
486
+ * @param type legacy type
487
+ * @returns smart builder field type
488
+ */
489
+ PepQueryBuilderTypeMap.prototype.getSmartBuilderType = function (key) {
490
+ var item = this.map.get(key);
491
+ return item ? item : null;
492
+ };
493
+ return PepQueryBuilderTypeMap;
494
494
  }());
495
495
 
496
- var Days = {
497
- legacy: 'Days',
498
- smartFilter: smartFilters.PepSmartFilterOperatorUnits.Days
499
- };
500
- var Weeks = {
501
- legacy: 'Weeks',
502
- smartFilter: smartFilters.PepSmartFilterOperatorUnits.Weeks
503
- };
504
- var Months = {
505
- legacy: 'Months',
506
- smartFilter: smartFilters.PepSmartFilterOperatorUnits.Months
507
- };
508
- var Years = {
509
- legacy: 'Years',
510
- smartFilter: smartFilters.PepSmartFilterOperatorUnits.Years
511
- };
512
- var PepQueryBuilderOperationUnit = [
513
- Days,
514
- Weeks,
515
- Months,
516
- Years,
517
- ];
518
- /**
519
- * gets a smart filter operation unit item
520
- * @param operationUnit legacy operation unit
521
- * @returns smart filter operation unit item
522
- */
523
- function getSmartBuilderOperationUnit(operationUnit) {
524
- var smartFilterOperationUnit = PepQueryBuilderOperationUnit.find(function (unit) { return unit.legacy === operationUnit; });
525
- return smartFilterOperationUnit ? smartFilterOperationUnit.smartFilter : null;
526
- }
527
- /**
528
- * gets a legacy operation unit value
529
- * @param operationUnit smart filter operation unit item
530
- * @returns legacy operation unit value
531
- */
532
- function getLegacyOperationUnit(operationUnit) {
533
- var legacyOperationUnit = PepQueryBuilderOperationUnit.find(function (unit) { return unit.smartFilter === operationUnit; });
534
- return legacyOperationUnit ? legacyOperationUnit.legacy : null;
496
+ var Days = {
497
+ legacy: 'Days',
498
+ smartFilter: smartFilters.PepSmartFilterOperatorUnits.Days
499
+ };
500
+ var Weeks = {
501
+ legacy: 'Weeks',
502
+ smartFilter: smartFilters.PepSmartFilterOperatorUnits.Weeks
503
+ };
504
+ var Months = {
505
+ legacy: 'Months',
506
+ smartFilter: smartFilters.PepSmartFilterOperatorUnits.Months
507
+ };
508
+ var Years = {
509
+ legacy: 'Years',
510
+ smartFilter: smartFilters.PepSmartFilterOperatorUnits.Years
511
+ };
512
+ var PepQueryBuilderOperationUnit = [
513
+ Days,
514
+ Weeks,
515
+ Months,
516
+ Years,
517
+ ];
518
+ /**
519
+ * gets a smart filter operation unit item
520
+ * @param operationUnit legacy operation unit
521
+ * @returns smart filter operation unit item
522
+ */
523
+ function getSmartBuilderOperationUnit(operationUnit) {
524
+ var smartFilterOperationUnit = PepQueryBuilderOperationUnit.find(function (unit) { return unit.legacy === operationUnit; });
525
+ return smartFilterOperationUnit ? smartFilterOperationUnit.smartFilter : null;
526
+ }
527
+ /**
528
+ * gets a legacy operation unit value
529
+ * @param operationUnit smart filter operation unit item
530
+ * @returns legacy operation unit value
531
+ */
532
+ function getLegacyOperationUnit(operationUnit) {
533
+ var legacyOperationUnit = PepQueryBuilderOperationUnit.find(function (unit) { return unit.smartFilter === operationUnit; });
534
+ return legacyOperationUnit ? legacyOperationUnit.legacy : null;
535
535
  }
536
536
 
537
- var PepOutputQueryService = /** @class */ (function () {
538
- function PepOutputQueryService() {
539
- //
540
- }
541
- /**
542
- * generates a legacy query structure
543
- * @param filters UI smart filters structure
544
- * @returns legacy query
545
- */
546
- PepOutputQueryService.prototype.generateQuery = function (filters) {
547
- this.initParams();
548
- return this.sectionWalk(filters);
549
- };
550
- /**
551
- * init params
552
- */
553
- PepOutputQueryService.prototype.initParams = function () {
554
- this._complexIdCounter = 1;
555
- this._expressionIdCounter = 1;
556
- };
557
- /**
558
- * a recursive function dynamically builds legacy query structure
559
- * @param current UI object represents either a section or filter component
560
- * @returns section query data
561
- */
562
- PepOutputQueryService.prototype.sectionWalk = function (current) {
563
- var _this = this;
564
- var section = null;
565
- Object.keys(current).forEach(function (key) {
566
- if (key.includes('item')) {
567
- section = _this.addToSection(section, {
568
- ExpressionId: (_this._expressionIdCounter++).toString(),
569
- ApiName: current[key].smart.fieldId,
570
- FieldType: current[key].query.fieldType,
571
- Operation: getLegacyOperator(current[key].smart.operator, current[key].smart.fieldType),
572
- Values: _this.getItemValues(current[key].smart)
573
- }, current.operator);
574
- }
575
- else if (key.includes('section')) {
576
- var childSection = _this.sectionWalk(current[key]);
577
- if (childSection) {
578
- section = _this.addToSection(section, childSection, current.operator);
579
- }
580
- }
581
- });
582
- return section;
583
- };
584
- /**
585
- * adds a legacy filter object to the current query structure
586
- * @param section section query data
587
- * @param item filter item
588
- * @param operator query operator
589
- * @returns
590
- */
591
- PepOutputQueryService.prototype.addToSection = function (section, item, operator) {
592
- return section ? this.createSection(section, item, operator) : item;
593
- };
594
- /**
595
- * creates a legacy complex object
596
- * @param left LeftNode object
597
- * @param right RightNode object
598
- * @param operator query operator
599
- * @returns legacy complex object
600
- */
601
- PepOutputQueryService.prototype.createSection = function (left, right, operator) {
602
- return {
603
- ComplexId: (this._complexIdCounter++).toString(),
604
- LeftNode: left,
605
- RightNode: right,
606
- Operation: operator
607
- };
608
- };
609
- /**
610
- * gets legacy filter values object
611
- * @param current UI filter object's values
612
- * @returns an array represents legacy values
613
- */
614
- PepOutputQueryService.prototype.getItemValues = function (current) {
615
- var _a;
616
- var values = [];
617
- if ((_a = current === null || current === void 0 ? void 0 : current.values) === null || _a === void 0 ? void 0 : _a.first) {
618
- if (current.operator === smartFilters.PepSmartFilterOperators.In) { //multi select
619
- values = current.values.first;
620
- }
621
- else if (current.operator === smartFilters.PepSmartFilterOperators.InTheLast ||
622
- current.operator === smartFilters.PepSmartFilterOperators.NotInTheLast ||
623
- current.operator === smartFilters.PepSmartFilterOperators.DueIn ||
624
- current.operator === smartFilters.PepSmartFilterOperators.NotDueIn) { //operation unit
625
- values.push(current.values.first);
626
- if (current.operatorUnit) {
627
- values.push(getLegacyOperationUnit(current.operatorUnit));
628
- }
629
- }
630
- else {
631
- values.push(current.values.first);
632
- if (current.values.second) {
633
- values.push(current.values.second);
634
- }
635
- }
636
- }
637
- return values;
638
- };
639
- return PepOutputQueryService;
640
- }());
641
- PepOutputQueryService.decorators = [
642
- { type: core.Injectable }
643
- ];
537
+ var PepOutputQueryService = /** @class */ (function () {
538
+ function PepOutputQueryService() {
539
+ //
540
+ }
541
+ /**
542
+ * generates a legacy query structure
543
+ * @param filters UI smart filters structure
544
+ * @returns legacy query
545
+ */
546
+ PepOutputQueryService.prototype.generateQuery = function (filters) {
547
+ this.initParams();
548
+ return this.sectionWalk(filters);
549
+ };
550
+ /**
551
+ * init params
552
+ */
553
+ PepOutputQueryService.prototype.initParams = function () {
554
+ this._complexIdCounter = 1;
555
+ this._expressionIdCounter = 1;
556
+ };
557
+ /**
558
+ * a recursive function dynamically builds legacy query structure
559
+ * @param current UI object represents either a section or filter component
560
+ * @returns section query data
561
+ */
562
+ PepOutputQueryService.prototype.sectionWalk = function (current) {
563
+ var _this = this;
564
+ var section = null;
565
+ Object.keys(current).forEach(function (key) {
566
+ if (key.includes('item')) {
567
+ section = _this.addToSection(section, {
568
+ ExpressionId: (_this._expressionIdCounter++).toString(),
569
+ ApiName: current[key].smart.fieldId,
570
+ FieldType: current[key].query.fieldType,
571
+ Operation: getLegacyOperator(current[key].smart.operator, current[key].smart.fieldType),
572
+ Values: _this.getItemValues(current[key].smart)
573
+ }, current.operator);
574
+ }
575
+ else if (key.includes('section')) {
576
+ var childSection = _this.sectionWalk(current[key]);
577
+ if (childSection) {
578
+ section = _this.addToSection(section, childSection, current.operator);
579
+ }
580
+ }
581
+ });
582
+ return section;
583
+ };
584
+ /**
585
+ * adds a legacy filter object to the current query structure
586
+ * @param section section query data
587
+ * @param item filter item
588
+ * @param operator query operator
589
+ * @returns
590
+ */
591
+ PepOutputQueryService.prototype.addToSection = function (section, item, operator) {
592
+ return section ? this.createSection(section, item, operator) : item;
593
+ };
594
+ /**
595
+ * creates a legacy complex object
596
+ * @param left LeftNode object
597
+ * @param right RightNode object
598
+ * @param operator query operator
599
+ * @returns legacy complex object
600
+ */
601
+ PepOutputQueryService.prototype.createSection = function (left, right, operator) {
602
+ return {
603
+ ComplexId: (this._complexIdCounter++).toString(),
604
+ LeftNode: left,
605
+ RightNode: right,
606
+ Operation: operator
607
+ };
608
+ };
609
+ /**
610
+ * gets legacy filter values object
611
+ * @param current UI filter object's values
612
+ * @returns an array represents legacy values
613
+ */
614
+ PepOutputQueryService.prototype.getItemValues = function (current) {
615
+ var _a;
616
+ var values = [];
617
+ if ((_a = current === null || current === void 0 ? void 0 : current.values) === null || _a === void 0 ? void 0 : _a.first) {
618
+ if (current.operator === smartFilters.PepSmartFilterOperators.In) { //multi select
619
+ values = current.values.first;
620
+ }
621
+ else if (current.operator === smartFilters.PepSmartFilterOperators.InTheLast ||
622
+ current.operator === smartFilters.PepSmartFilterOperators.NotInTheLast ||
623
+ current.operator === smartFilters.PepSmartFilterOperators.DueIn ||
624
+ current.operator === smartFilters.PepSmartFilterOperators.NotDueIn) { //operation unit
625
+ values.push(current.values.first);
626
+ if (current.operatorUnit) {
627
+ values.push(getLegacyOperationUnit(current.operatorUnit));
628
+ }
629
+ }
630
+ else {
631
+ values.push(current.values.first);
632
+ if (current.values.second) {
633
+ values.push(current.values.second);
634
+ }
635
+ }
636
+ }
637
+ return values;
638
+ };
639
+ return PepOutputQueryService;
640
+ }());
641
+ PepOutputQueryService.decorators = [
642
+ { type: core.Injectable }
643
+ ];
644
644
  PepOutputQueryService.ctorParameters = function () { return []; };
645
645
 
646
- var PepOperatorTypes;
647
- (function (PepOperatorTypes) {
648
- PepOperatorTypes["And"] = "AND";
649
- PepOperatorTypes["Or"] = "OR";
646
+ var PepOperatorTypes;
647
+ (function (PepOperatorTypes) {
648
+ PepOperatorTypes["And"] = "AND";
649
+ PepOperatorTypes["Or"] = "OR";
650
650
  })(PepOperatorTypes || (PepOperatorTypes = {}));
651
651
 
652
- var MAX_STRUCTURE_DEPTH = 3;
653
- var PepQueryBuilderService = /** @class */ (function () {
654
- function PepQueryBuilderService(_fb, _resolver, _outputQueryService) {
655
- this._fb = _fb;
656
- this._resolver = _resolver;
657
- this._outputQueryService = _outputQueryService;
658
- this._outputQuery$ = new rxjs.BehaviorSubject(null);
659
- this._maxStructureDepth = MAX_STRUCTURE_DEPTH;
660
- this.outputQuery$ = this._outputQuery$.asObservable();
661
- }
662
- Object.defineProperty(PepQueryBuilderService.prototype, "maxDepth", {
663
- get: function () {
664
- return this._maxStructureDepth;
665
- },
666
- set: function (value) {
667
- this._maxStructureDepth = value;
668
- },
669
- enumerable: false,
670
- configurable: true
671
- });
672
- Object.defineProperty(PepQueryBuilderService.prototype, "fields", {
673
- set: function (list) {
674
- this._smartFilterFields = this.convertToSmartFilterFields(list);
675
- },
676
- enumerable: false,
677
- configurable: true
678
- });
679
- Object.defineProperty(PepQueryBuilderService.prototype, "hasFields", {
680
- get: function () {
681
- var _a;
682
- return ((_a = this._smartFilterFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
683
- },
684
- enumerable: false,
685
- configurable: true
686
- });
687
- Object.defineProperty(PepQueryBuilderService.prototype, "form", {
688
- get: function () {
689
- return this._form;
690
- },
691
- set: function (value) {
692
- this._form = value;
693
- },
694
- enumerable: false,
695
- configurable: true
696
- });
697
- /**
698
- * builds a dynamic UI query structure
699
- * might has a different structure than the query's due to parent-child elements merge
700
- * @param query legacy query
701
- * @param containerRef reference to root element
702
- */
703
- PepQueryBuilderService.prototype.buildQueryStructure = function (query, containerRef) {
704
- //update root operator
705
- if (this.hasProperty(query, 'ComplexId') &&
706
- (query === null || query === void 0 ? void 0 : query.Operation) &&
707
- query.Operation !== this._form.get('operator').value) {
708
- this._form.get('operator').setValue(query.Operation);
709
- }
710
- this.flatten(this._form.get('operator').value, query, containerRef, this._form, 0);
711
- };
712
- /**
713
- * checks if the object contains property
714
- * @param obj object
715
- * @param prop property name
716
- * @returns true if contains, false otherwise
717
- */
718
- PepQueryBuilderService.prototype.hasProperty = function (obj, prop) {
719
- return Object.prototype.hasOwnProperty.call(obj, prop);
720
- };
721
- /**
722
- * a recursive function dynamically builds UI filters structure
723
- * @param parentOperator parent legacy complex operator
724
- * @param current child legacy object (either another complex or expression type)
725
- * @param containerRef parent element
726
- * @param parentForm parent form
727
- */
728
- PepQueryBuilderService.prototype.flatten = function (parentOperator, current, containerRef, parentForm, depth) {
729
- if (this.hasProperty(current, 'ComplexId')) {
730
- var section = current;
731
- if (parentOperator === current.Operation) {
732
- this.flatten(current.Operation, section.LeftNode, containerRef, parentForm, depth);
733
- this.flatten(current.Operation, section.RightNode, containerRef, parentForm, depth);
734
- }
735
- else {
736
- var result = this.createSection(section.Operation, containerRef, parentForm, depth);
737
- this.flatten(section.Operation, section.LeftNode, result.containerRef, result.parentForm, depth + 1);
738
- this.flatten(section.Operation, section.RightNode, result.containerRef, result.parentForm, depth + 1);
739
- }
740
- }
741
- else if (this.hasProperty(current, 'ExpressionId')) {
742
- this.createItem(current, containerRef, parentForm);
743
- }
744
- };
745
- /**
746
- * creates a container object of two or more child filter items
747
- * @param operator AND/OR operator
748
- * @param containerRef parent element
749
- * @param parentForm parent form
750
- * @param depth
751
- * @returns an object containing the current element and current form
752
- */
753
- PepQueryBuilderService.prototype.createSection = function (operator, containerRef, parentForm, depth) {
754
- var _this = this;
755
- var factory = this._resolver.resolveComponentFactory(PepQueryBuilderSectionComponent);
756
- var componentRef = containerRef.createComponent(factory);
757
- var sectionGroup = this._fb.group({
758
- operator: this._fb.control(operator)
759
- });
760
- var counter = 1;
761
- Object.keys(parentForm.controls).forEach(function (item) {
762
- if (item.includes('section')) {
763
- counter++;
764
- }
765
- });
766
- var formKey = "section" + counter;
767
- parentForm.addControl(formKey, sectionGroup);
768
- componentRef.instance.form = sectionGroup;
769
- componentRef.instance.depth = {
770
- current: depth,
771
- max: this._maxStructureDepth
772
- };
773
- componentRef.instance.createSection.subscribe(function () {
774
- var section = _this.createSection(PepOperatorTypes.And, componentRef.instance.sectionContainer, sectionGroup, depth + 1);
775
- _this.createItem(null, section.containerRef, section.parentForm);
776
- });
777
- componentRef.instance.createItem.subscribe(function () {
778
- _this.createItem(null, componentRef.instance.sectionContainer, sectionGroup);
779
- });
780
- componentRef.instance.remove.subscribe(function () {
781
- parentForm.removeControl(formKey);
782
- componentRef.destroy();
783
- _this.createOutputQuery();
784
- });
785
- componentRef.instance.operatorChange.subscribe(function () {
786
- _this.createOutputQuery();
787
- });
788
- return {
789
- containerRef: componentRef.instance.sectionContainer,
790
- parentForm: sectionGroup
791
- };
792
- };
793
- /**
794
- * creates a component represents filter item (leaf element - has no childs)
795
- * @param current filter legacy element
796
- * @param containerRef parent element
797
- * @param parentForm parent form
798
- */
799
- PepQueryBuilderService.prototype.createItem = function (current, containerRef, parentForm) {
800
- var _this = this;
801
- var factory = this._resolver.resolveComponentFactory(PepQueryBuilderItemComponent);
802
- var componentRef = containerRef.createComponent(factory);
803
- var counter = 1;
804
- Object.keys(parentForm.controls).forEach(function (item) {
805
- if (item.includes('item')) {
806
- counter++;
807
- }
808
- });
809
- var formKey = "item" + counter;
810
- componentRef.instance.formKey = formKey;
811
- componentRef.instance.fields = this._smartFilterFields;
812
- var selectedField = this.getSelectedField(current);
813
- if (selectedField) {
814
- componentRef.instance.selected = selectedField;
815
- if (current) {
816
- componentRef.instance.filter = this.getFilter(current, selectedField.smart);
817
- }
818
- }
819
- componentRef.instance.parentForm = parentForm;
820
- componentRef.instance.filterChange.subscribe(function () {
821
- _this.createOutputQuery();
822
- });
823
- componentRef.instance.remove.subscribe(function () {
824
- parentForm.removeControl(formKey);
825
- componentRef.destroy();
826
- _this.createOutputQuery();
827
- });
828
- };
829
- /**
830
- * creates a smart filter object
831
- * @param current filter legacy element
832
- * @param field filter's selected field
833
- * @returns smart filter object
834
- */
835
- PepQueryBuilderService.prototype.getFilter = function (current, field) {
836
- var operator = getSmartBuilderOperator(current.Operation, field.type);
837
- if (operator) {
838
- var filterValues = this.getFilterValues(current, operator, field);
839
- return smartFilters.createSmartFilter(current.ApiName, operator, filterValues.first, filterValues.second, filterValues.operationUnit);
840
- }
841
- else {
842
- return null;
843
- }
844
- };
845
- /**
846
- * get smart filter field
847
- * @param current filter legacy element
848
- * @returns smart filter field, if not found returns the first field
849
- */
850
- PepQueryBuilderService.prototype.getSelectedField = function (current) {
851
- var _a, _b;
852
- if (current) {
853
- var item = this._smartFilterFields.find(function (field) { return field.smart.id === current.ApiName; });
854
- return item ? item : ((_a = this._smartFilterFields) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this._smartFilterFields[0] : null;
855
- }
856
- else {
857
- return ((_b = this._smartFilterFields) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this._smartFilterFields[0] : null;
858
- }
859
- };
860
- /**
861
- * gets smart filter's values data
862
- * @param current filter legacy element
863
- * @param operator smart filter operator
864
- * @param field filter's selected field
865
- * @returns object contains the filter values data
866
- */
867
- PepQueryBuilderService.prototype.getFilterValues = function (current, operator, field) {
868
- var _a, _b, _c, _d, _e;
869
- var data = {
870
- first: null,
871
- second: null,
872
- operationUnit: null
873
- };
874
- if (operator === smartFilters.PepSmartFilterOperators.In) { //multi select
875
- //filter keys don't exist on field options
876
- data.first = ((_a = current === null || current === void 0 ? void 0 : current.Values) === null || _a === void 0 ? void 0 : _a.length) > 0 ? current.Values.filter(function (item) {
877
- return field.options.find(function (option) { return option.key === item; });
878
- }) : null;
879
- }
880
- else if (operator === smartFilters.PepSmartFilterOperators.InTheLast ||
881
- operator === smartFilters.PepSmartFilterOperators.NotInTheLast ||
882
- operator === smartFilters.PepSmartFilterOperators.DueIn ||
883
- operator === smartFilters.PepSmartFilterOperators.NotDueIn) { //operation unit
884
- data.first = ((_b = current === null || current === void 0 ? void 0 : current.Values) === null || _b === void 0 ? void 0 : _b.length) > 0 ? current.Values[0] : null;
885
- if (((_c = current === null || current === void 0 ? void 0 : current.Values) === null || _c === void 0 ? void 0 : _c.length) === 2) {
886
- data.operationUnit = getSmartBuilderOperationUnit(current.Values[1]);
887
- }
888
- }
889
- else {
890
- data.first = ((_d = current === null || current === void 0 ? void 0 : current.Values) === null || _d === void 0 ? void 0 : _d.length) > 0 ? current.Values[0] : null;
891
- data.second = ((_e = current === null || current === void 0 ? void 0 : current.Values) === null || _e === void 0 ? void 0 : _e.length) === 2 ? current.Values[1] : null;
892
- }
893
- return data;
894
- };
895
- /**
896
- * converts legacy fields to smart filter fields
897
- * @param fields legacy fields array
898
- * @returns smart filter fields array
899
- */
900
- PepQueryBuilderService.prototype.convertToSmartFilterFields = function (fields) {
901
- if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
902
- var typeMapper_1 = new PepQueryBuilderTypeMap();
903
- return fields.map(function (field) {
904
- var _a;
905
- return {
906
- smart: smartFilters.createSmartFilterField({
907
- id: field.FieldID,
908
- name: field.Title,
909
- options: (_a = field.OptionalValues) === null || _a === void 0 ? void 0 : _a.map(function (option) {
910
- return {
911
- key: option.Key,
912
- value: option.Value
913
- };
914
- })
915
- }, typeMapper_1.getSmartBuilderType(field.FieldType)),
916
- query: {
917
- fieldType: field.FieldType
918
- }
919
- };
920
- });
921
- }
922
- else {
923
- return [];
924
- }
925
- };
926
- /**
927
- * creates a legacy output query
928
- */
929
- PepQueryBuilderService.prototype.createOutputQuery = function () {
930
- if (this._form.valid) {
931
- var query = this._outputQueryService.generateQuery(this._form.value);
932
- this._outputQuery$.next(query);
933
- }
934
- };
935
- return PepQueryBuilderService;
936
- }());
937
- PepQueryBuilderService.decorators = [
938
- { type: core.Injectable }
939
- ];
940
- PepQueryBuilderService.ctorParameters = function () { return [
941
- { type: forms.FormBuilder },
942
- { type: core.ComponentFactoryResolver },
943
- { type: PepOutputQueryService }
652
+ var MAX_STRUCTURE_DEPTH = 3;
653
+ var PepQueryBuilderService = /** @class */ (function () {
654
+ function PepQueryBuilderService(_fb, _resolver, _outputQueryService) {
655
+ this._fb = _fb;
656
+ this._resolver = _resolver;
657
+ this._outputQueryService = _outputQueryService;
658
+ this._outputQuery$ = new rxjs.BehaviorSubject(null);
659
+ this._maxStructureDepth = MAX_STRUCTURE_DEPTH;
660
+ this.outputQuery$ = this._outputQuery$.asObservable();
661
+ }
662
+ Object.defineProperty(PepQueryBuilderService.prototype, "maxDepth", {
663
+ get: function () {
664
+ return this._maxStructureDepth;
665
+ },
666
+ set: function (value) {
667
+ this._maxStructureDepth = value;
668
+ },
669
+ enumerable: false,
670
+ configurable: true
671
+ });
672
+ Object.defineProperty(PepQueryBuilderService.prototype, "fields", {
673
+ set: function (list) {
674
+ this._smartFilterFields = this.convertToSmartFilterFields(list);
675
+ },
676
+ enumerable: false,
677
+ configurable: true
678
+ });
679
+ Object.defineProperty(PepQueryBuilderService.prototype, "hasFields", {
680
+ get: function () {
681
+ var _a;
682
+ return ((_a = this._smartFilterFields) === null || _a === void 0 ? void 0 : _a.length) > 0;
683
+ },
684
+ enumerable: false,
685
+ configurable: true
686
+ });
687
+ Object.defineProperty(PepQueryBuilderService.prototype, "form", {
688
+ get: function () {
689
+ return this._form;
690
+ },
691
+ set: function (value) {
692
+ this._form = value;
693
+ },
694
+ enumerable: false,
695
+ configurable: true
696
+ });
697
+ /**
698
+ * builds a dynamic UI query structure
699
+ * might has a different structure than the query's due to parent-child elements merge
700
+ * @param query legacy query
701
+ * @param containerRef reference to root element
702
+ */
703
+ PepQueryBuilderService.prototype.buildQueryStructure = function (query, containerRef) {
704
+ //update root operator
705
+ if (this.hasProperty(query, 'ComplexId') &&
706
+ (query === null || query === void 0 ? void 0 : query.Operation) &&
707
+ query.Operation !== this._form.get('operator').value) {
708
+ this._form.get('operator').setValue(query.Operation);
709
+ }
710
+ this.flatten(this._form.get('operator').value, query, containerRef, this._form, 0);
711
+ };
712
+ /**
713
+ * checks if the object contains property
714
+ * @param obj object
715
+ * @param prop property name
716
+ * @returns true if contains, false otherwise
717
+ */
718
+ PepQueryBuilderService.prototype.hasProperty = function (obj, prop) {
719
+ return Object.prototype.hasOwnProperty.call(obj, prop);
720
+ };
721
+ /**
722
+ * a recursive function dynamically builds UI filters structure
723
+ * @param parentOperator parent legacy complex operator
724
+ * @param current child legacy object (either another complex or expression type)
725
+ * @param containerRef parent element
726
+ * @param parentForm parent form
727
+ */
728
+ PepQueryBuilderService.prototype.flatten = function (parentOperator, current, containerRef, parentForm, depth) {
729
+ if (this.hasProperty(current, 'ComplexId')) {
730
+ var section = current;
731
+ if (parentOperator === current.Operation) {
732
+ this.flatten(current.Operation, section.LeftNode, containerRef, parentForm, depth);
733
+ this.flatten(current.Operation, section.RightNode, containerRef, parentForm, depth);
734
+ }
735
+ else {
736
+ var result = this.createSection(section.Operation, containerRef, parentForm, depth);
737
+ this.flatten(section.Operation, section.LeftNode, result.containerRef, result.parentForm, depth + 1);
738
+ this.flatten(section.Operation, section.RightNode, result.containerRef, result.parentForm, depth + 1);
739
+ }
740
+ }
741
+ else if (this.hasProperty(current, 'ExpressionId')) {
742
+ this.createItem(current, containerRef, parentForm);
743
+ }
744
+ };
745
+ /**
746
+ * creates a container object of two or more child filter items
747
+ * @param operator AND/OR operator
748
+ * @param containerRef parent element
749
+ * @param parentForm parent form
750
+ * @param depth
751
+ * @returns an object containing the current element and current form
752
+ */
753
+ PepQueryBuilderService.prototype.createSection = function (operator, containerRef, parentForm, depth) {
754
+ var _this = this;
755
+ var factory = this._resolver.resolveComponentFactory(PepQueryBuilderSectionComponent);
756
+ var componentRef = containerRef.createComponent(factory);
757
+ var sectionGroup = this._fb.group({
758
+ operator: this._fb.control(operator)
759
+ });
760
+ var counter = 1;
761
+ Object.keys(parentForm.controls).forEach(function (item) {
762
+ if (item.includes('section')) {
763
+ counter++;
764
+ }
765
+ });
766
+ var formKey = "section" + counter;
767
+ parentForm.addControl(formKey, sectionGroup);
768
+ componentRef.instance.form = sectionGroup;
769
+ componentRef.instance.depth = {
770
+ current: depth,
771
+ max: this._maxStructureDepth
772
+ };
773
+ componentRef.instance.createSection.subscribe(function () {
774
+ var section = _this.createSection(PepOperatorTypes.And, componentRef.instance.sectionContainer, sectionGroup, depth + 1);
775
+ _this.createItem(null, section.containerRef, section.parentForm);
776
+ });
777
+ componentRef.instance.createItem.subscribe(function () {
778
+ _this.createItem(null, componentRef.instance.sectionContainer, sectionGroup);
779
+ });
780
+ componentRef.instance.remove.subscribe(function () {
781
+ parentForm.removeControl(formKey);
782
+ componentRef.destroy();
783
+ _this.createOutputQuery();
784
+ });
785
+ componentRef.instance.operatorChange.subscribe(function () {
786
+ _this.createOutputQuery();
787
+ });
788
+ return {
789
+ containerRef: componentRef.instance.sectionContainer,
790
+ parentForm: sectionGroup
791
+ };
792
+ };
793
+ /**
794
+ * creates a component represents filter item (leaf element - has no childs)
795
+ * @param current filter legacy element
796
+ * @param containerRef parent element
797
+ * @param parentForm parent form
798
+ */
799
+ PepQueryBuilderService.prototype.createItem = function (current, containerRef, parentForm) {
800
+ var _this = this;
801
+ var factory = this._resolver.resolveComponentFactory(PepQueryBuilderItemComponent);
802
+ var componentRef = containerRef.createComponent(factory);
803
+ var counter = 1;
804
+ Object.keys(parentForm.controls).forEach(function (item) {
805
+ if (item.includes('item')) {
806
+ counter++;
807
+ }
808
+ });
809
+ var formKey = "item" + counter;
810
+ componentRef.instance.formKey = formKey;
811
+ componentRef.instance.fields = this._smartFilterFields;
812
+ var selectedField = this.getSelectedField(current);
813
+ if (selectedField) {
814
+ componentRef.instance.selected = selectedField;
815
+ if (current) {
816
+ componentRef.instance.filter = this.getFilter(current, selectedField.smart);
817
+ }
818
+ }
819
+ componentRef.instance.parentForm = parentForm;
820
+ componentRef.instance.filterChange.subscribe(function () {
821
+ _this.createOutputQuery();
822
+ });
823
+ componentRef.instance.remove.subscribe(function () {
824
+ parentForm.removeControl(formKey);
825
+ componentRef.destroy();
826
+ _this.createOutputQuery();
827
+ });
828
+ };
829
+ /**
830
+ * creates a smart filter object
831
+ * @param current filter legacy element
832
+ * @param field filter's selected field
833
+ * @returns smart filter object
834
+ */
835
+ PepQueryBuilderService.prototype.getFilter = function (current, field) {
836
+ var operator = getSmartBuilderOperator(current.Operation, field.type);
837
+ if (operator) {
838
+ var filterValues = this.getFilterValues(current, operator, field);
839
+ return smartFilters.createSmartFilter(current.ApiName, operator, filterValues.first, filterValues.second, filterValues.operationUnit);
840
+ }
841
+ else {
842
+ return null;
843
+ }
844
+ };
845
+ /**
846
+ * get smart filter field
847
+ * @param current filter legacy element
848
+ * @returns smart filter field, if not found returns the first field
849
+ */
850
+ PepQueryBuilderService.prototype.getSelectedField = function (current) {
851
+ var _a, _b;
852
+ if (current) {
853
+ var item = this._smartFilterFields.find(function (field) { return field.smart.id === current.ApiName; });
854
+ return item ? item : ((_a = this._smartFilterFields) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this._smartFilterFields[0] : null;
855
+ }
856
+ else {
857
+ return ((_b = this._smartFilterFields) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this._smartFilterFields[0] : null;
858
+ }
859
+ };
860
+ /**
861
+ * gets smart filter's values data
862
+ * @param current filter legacy element
863
+ * @param operator smart filter operator
864
+ * @param field filter's selected field
865
+ * @returns object contains the filter values data
866
+ */
867
+ PepQueryBuilderService.prototype.getFilterValues = function (current, operator, field) {
868
+ var _a, _b, _c, _d, _e;
869
+ var data = {
870
+ first: null,
871
+ second: null,
872
+ operationUnit: null
873
+ };
874
+ if (operator === smartFilters.PepSmartFilterOperators.In) { //multi select
875
+ //filter keys don't exist on field options
876
+ data.first = ((_a = current === null || current === void 0 ? void 0 : current.Values) === null || _a === void 0 ? void 0 : _a.length) > 0 ? current.Values.filter(function (item) {
877
+ return field.options.find(function (option) { return option.key === item; });
878
+ }) : null;
879
+ }
880
+ else if (operator === smartFilters.PepSmartFilterOperators.InTheLast ||
881
+ operator === smartFilters.PepSmartFilterOperators.NotInTheLast ||
882
+ operator === smartFilters.PepSmartFilterOperators.DueIn ||
883
+ operator === smartFilters.PepSmartFilterOperators.NotDueIn) { //operation unit
884
+ data.first = ((_b = current === null || current === void 0 ? void 0 : current.Values) === null || _b === void 0 ? void 0 : _b.length) > 0 ? current.Values[0] : null;
885
+ if (((_c = current === null || current === void 0 ? void 0 : current.Values) === null || _c === void 0 ? void 0 : _c.length) === 2) {
886
+ data.operationUnit = getSmartBuilderOperationUnit(current.Values[1]);
887
+ }
888
+ }
889
+ else {
890
+ data.first = ((_d = current === null || current === void 0 ? void 0 : current.Values) === null || _d === void 0 ? void 0 : _d.length) > 0 ? current.Values[0] : null;
891
+ data.second = ((_e = current === null || current === void 0 ? void 0 : current.Values) === null || _e === void 0 ? void 0 : _e.length) === 2 ? current.Values[1] : null;
892
+ }
893
+ return data;
894
+ };
895
+ /**
896
+ * converts legacy fields to smart filter fields
897
+ * @param fields legacy fields array
898
+ * @returns smart filter fields array
899
+ */
900
+ PepQueryBuilderService.prototype.convertToSmartFilterFields = function (fields) {
901
+ if ((fields === null || fields === void 0 ? void 0 : fields.length) > 0) {
902
+ var typeMapper_1 = new PepQueryBuilderTypeMap();
903
+ return fields.map(function (field) {
904
+ var _a;
905
+ return {
906
+ smart: smartFilters.createSmartFilterField({
907
+ id: field.FieldID,
908
+ name: field.Title,
909
+ options: (_a = field.OptionalValues) === null || _a === void 0 ? void 0 : _a.map(function (option) {
910
+ return {
911
+ key: option.Key,
912
+ value: option.Value
913
+ };
914
+ })
915
+ }, typeMapper_1.getSmartBuilderType(field.FieldType)),
916
+ query: {
917
+ fieldType: field.FieldType
918
+ }
919
+ };
920
+ });
921
+ }
922
+ else {
923
+ return [];
924
+ }
925
+ };
926
+ /**
927
+ * creates a legacy output query
928
+ */
929
+ PepQueryBuilderService.prototype.createOutputQuery = function () {
930
+ if (this._form.valid) {
931
+ var query = this._outputQueryService.generateQuery(this._form.value);
932
+ this._outputQuery$.next(query);
933
+ }
934
+ };
935
+ return PepQueryBuilderService;
936
+ }());
937
+ PepQueryBuilderService.decorators = [
938
+ { type: core.Injectable }
939
+ ];
940
+ PepQueryBuilderService.ctorParameters = function () { return [
941
+ { type: forms.FormBuilder },
942
+ { type: core.ComponentFactoryResolver },
943
+ { type: PepOutputQueryService }
944
944
  ]; };
945
945
 
946
- var PepQueryBuilderComponent = /** @class */ (function () {
947
- function PepQueryBuilderComponent(_fb, queryBuilderService) {
948
- var _this = this;
949
- this._fb = _fb;
950
- this.queryBuilderService = queryBuilderService;
951
- this._query = null;
952
- this.queryChange = new core.EventEmitter();
953
- this.formValidationChange = new core.EventEmitter();
954
- this._lastFormValidStatus = true;
955
- this.hasFields = false;
956
- this.setupForm();
957
- this.initDepth();
958
- this._formSubscription$ = this.queryBuilderService.form.valueChanges.subscribe(function (val) {
959
- if (_this.queryBuilderService.form.valid !== _this._lastFormValidStatus) {
960
- _this._lastFormValidStatus = _this.queryBuilderService.form.valid;
961
- _this.formValidationChange.emit(_this._lastFormValidStatus);
962
- }
963
- });
964
- this._outputQuerySubscription$ = this.queryBuilderService.outputQuery$.subscribe(function (outputQuery) {
965
- _this.queryChange.emit(outputQuery);
966
- });
967
- }
968
- Object.defineProperty(PepQueryBuilderComponent.prototype, "query", {
969
- set: function (object) {
970
- this._query = object;
971
- this.loadQuery();
972
- },
973
- enumerable: false,
974
- configurable: true
975
- });
976
- Object.defineProperty(PepQueryBuilderComponent.prototype, "fields", {
977
- set: function (list) {
978
- this.queryBuilderService.fields = list;
979
- this.hasFields = this.queryBuilderService.hasFields;
980
- this.loadQuery();
981
- },
982
- enumerable: false,
983
- configurable: true
984
- });
985
- Object.defineProperty(PepQueryBuilderComponent.prototype, "maxDepth", {
986
- set: function (value) {
987
- this.queryBuilderService.maxDepth = value;
988
- },
989
- enumerable: false,
990
- configurable: true
991
- });
992
- PepQueryBuilderComponent.prototype.ngOnInit = function () {
993
- //
994
- };
995
- PepQueryBuilderComponent.prototype.setupForm = function () {
996
- this.queryBuilderService.form = this._fb.group({
997
- operator: this._fb.control(PepOperatorTypes.And)
998
- });
999
- };
1000
- PepQueryBuilderComponent.prototype.initDepth = function () {
1001
- this.depth = {
1002
- current: 0,
1003
- max: this.queryBuilderService.maxDepth
1004
- };
1005
- };
1006
- /**
1007
- * builds UI query structure as soon as both the fields and query loads
1008
- */
1009
- PepQueryBuilderComponent.prototype.loadQuery = function () {
1010
- var _a;
1011
- if (this._query &&
1012
- this.queryBuilderService.hasFields &&
1013
- ((_a = this.root) === null || _a === void 0 ? void 0 : _a.sectionContainer)) {
1014
- this.queryBuilderService.buildQueryStructure(this._query, this.root.sectionContainer);
1015
- }
1016
- };
1017
- PepQueryBuilderComponent.prototype.onCreateSection = function () {
1018
- var section = this.queryBuilderService.createSection(PepOperatorTypes.And, this.root.sectionContainer, this.queryBuilderService.form, 1);
1019
- this.queryBuilderService.createItem(null, section.containerRef, section.parentForm);
1020
- };
1021
- PepQueryBuilderComponent.prototype.onCreateItem = function () {
1022
- this.queryBuilderService.createItem(null, this.root.sectionContainer, this.queryBuilderService.form);
1023
- };
1024
- PepQueryBuilderComponent.prototype.onOperatorChange = function () {
1025
- this.queryBuilderService.createOutputQuery();
1026
- };
1027
- PepQueryBuilderComponent.prototype.ngOnDestroy = function () {
1028
- if (this._formSubscription$) {
1029
- this._formSubscription$.unsubscribe();
1030
- }
1031
- if (this._outputQuerySubscription$) {
1032
- this._outputQuerySubscription$.unsubscribe();
1033
- }
1034
- };
1035
- return PepQueryBuilderComponent;
1036
- }());
1037
- PepQueryBuilderComponent.decorators = [
1038
- { type: core.Component, args: [{
1039
- selector: 'pep-query-builder',
1040
- template: "<pep-query-builder-section #rootContainer [form]=\"queryBuilderService.form\" [depth]=\"depth\" [hasFields]=\"hasFields\"\n (createSection)=\"onCreateSection()\" (createItem)=\"onCreateItem()\" (operatorChange)=\"onOperatorChange()\">\n</pep-query-builder-section>",
1041
- providers: [PepQueryBuilderService, PepTypeConvertorService, PepOutputQueryService],
1042
- styles: [""]
1043
- },] }
1044
- ];
1045
- PepQueryBuilderComponent.ctorParameters = function () { return [
1046
- { type: forms.FormBuilder },
1047
- { type: PepQueryBuilderService }
1048
- ]; };
1049
- PepQueryBuilderComponent.propDecorators = {
1050
- query: [{ type: core.Input }],
1051
- fields: [{ type: core.Input }],
1052
- maxDepth: [{ type: core.Input }],
1053
- queryChange: [{ type: core.Output }],
1054
- formValidationChange: [{ type: core.Output }],
1055
- root: [{ type: core.ViewChild, args: ['rootContainer', { static: true },] }]
946
+ var PepQueryBuilderComponent = /** @class */ (function () {
947
+ function PepQueryBuilderComponent(_fb, queryBuilderService) {
948
+ var _this = this;
949
+ this._fb = _fb;
950
+ this.queryBuilderService = queryBuilderService;
951
+ this._query = null;
952
+ this.queryChange = new core.EventEmitter();
953
+ this.formValidationChange = new core.EventEmitter();
954
+ this._lastFormValidStatus = true;
955
+ this.hasFields = false;
956
+ this.setupForm();
957
+ this.initDepth();
958
+ this._formSubscription$ = this.queryBuilderService.form.valueChanges.subscribe(function (val) {
959
+ if (_this.queryBuilderService.form.valid !== _this._lastFormValidStatus) {
960
+ _this._lastFormValidStatus = _this.queryBuilderService.form.valid;
961
+ _this.formValidationChange.emit(_this._lastFormValidStatus);
962
+ }
963
+ });
964
+ this._outputQuerySubscription$ = this.queryBuilderService.outputQuery$.subscribe(function (outputQuery) {
965
+ _this.queryChange.emit(outputQuery);
966
+ });
967
+ }
968
+ Object.defineProperty(PepQueryBuilderComponent.prototype, "query", {
969
+ set: function (object) {
970
+ this._query = object;
971
+ this.loadQuery();
972
+ },
973
+ enumerable: false,
974
+ configurable: true
975
+ });
976
+ Object.defineProperty(PepQueryBuilderComponent.prototype, "fields", {
977
+ set: function (list) {
978
+ this.queryBuilderService.fields = list;
979
+ this.hasFields = this.queryBuilderService.hasFields;
980
+ this.loadQuery();
981
+ },
982
+ enumerable: false,
983
+ configurable: true
984
+ });
985
+ Object.defineProperty(PepQueryBuilderComponent.prototype, "maxDepth", {
986
+ set: function (value) {
987
+ this.queryBuilderService.maxDepth = value;
988
+ },
989
+ enumerable: false,
990
+ configurable: true
991
+ });
992
+ PepQueryBuilderComponent.prototype.ngOnInit = function () {
993
+ //
994
+ };
995
+ PepQueryBuilderComponent.prototype.setupForm = function () {
996
+ this.queryBuilderService.form = this._fb.group({
997
+ operator: this._fb.control(PepOperatorTypes.And)
998
+ });
999
+ };
1000
+ PepQueryBuilderComponent.prototype.initDepth = function () {
1001
+ this.depth = {
1002
+ current: 0,
1003
+ max: this.queryBuilderService.maxDepth
1004
+ };
1005
+ };
1006
+ /**
1007
+ * builds UI query structure as soon as both the fields and query loads
1008
+ */
1009
+ PepQueryBuilderComponent.prototype.loadQuery = function () {
1010
+ var _a;
1011
+ if (this._query &&
1012
+ this.queryBuilderService.hasFields &&
1013
+ ((_a = this.root) === null || _a === void 0 ? void 0 : _a.sectionContainer)) {
1014
+ this.queryBuilderService.buildQueryStructure(this._query, this.root.sectionContainer);
1015
+ }
1016
+ };
1017
+ PepQueryBuilderComponent.prototype.onCreateSection = function () {
1018
+ var section = this.queryBuilderService.createSection(PepOperatorTypes.And, this.root.sectionContainer, this.queryBuilderService.form, 1);
1019
+ this.queryBuilderService.createItem(null, section.containerRef, section.parentForm);
1020
+ };
1021
+ PepQueryBuilderComponent.prototype.onCreateItem = function () {
1022
+ this.queryBuilderService.createItem(null, this.root.sectionContainer, this.queryBuilderService.form);
1023
+ };
1024
+ PepQueryBuilderComponent.prototype.onOperatorChange = function () {
1025
+ this.queryBuilderService.createOutputQuery();
1026
+ };
1027
+ PepQueryBuilderComponent.prototype.ngOnDestroy = function () {
1028
+ if (this._formSubscription$) {
1029
+ this._formSubscription$.unsubscribe();
1030
+ }
1031
+ if (this._outputQuerySubscription$) {
1032
+ this._outputQuerySubscription$.unsubscribe();
1033
+ }
1034
+ };
1035
+ return PepQueryBuilderComponent;
1036
+ }());
1037
+ PepQueryBuilderComponent.decorators = [
1038
+ { type: core.Component, args: [{
1039
+ selector: 'pep-query-builder',
1040
+ template: "<pep-query-builder-section #rootContainer [form]=\"queryBuilderService.form\" [depth]=\"depth\" [hasFields]=\"hasFields\"\n (createSection)=\"onCreateSection()\" (createItem)=\"onCreateItem()\" (operatorChange)=\"onOperatorChange()\">\n</pep-query-builder-section>",
1041
+ providers: [PepQueryBuilderService, PepTypeConvertorService, PepOutputQueryService],
1042
+ styles: [""]
1043
+ },] }
1044
+ ];
1045
+ PepQueryBuilderComponent.ctorParameters = function () { return [
1046
+ { type: forms.FormBuilder },
1047
+ { type: PepQueryBuilderService }
1048
+ ]; };
1049
+ PepQueryBuilderComponent.propDecorators = {
1050
+ query: [{ type: core.Input }],
1051
+ fields: [{ type: core.Input }],
1052
+ maxDepth: [{ type: core.Input }],
1053
+ queryChange: [{ type: core.Output }],
1054
+ formValidationChange: [{ type: core.Output }],
1055
+ root: [{ type: core.ViewChild, args: ['rootContainer', { static: true },] }]
1056
1056
  };
1057
1057
 
1058
- var PepQueryBuilderModule = /** @class */ (function () {
1059
- function PepQueryBuilderModule() {
1060
- }
1061
- return PepQueryBuilderModule;
1062
- }());
1063
- PepQueryBuilderModule.decorators = [
1064
- { type: core.NgModule, args: [{
1065
- imports: [
1066
- common.CommonModule,
1067
- forms.ReactiveFormsModule,
1068
- flexLayout.FlexLayoutModule,
1069
- select.PepSelectModule,
1070
- button.PepButtonModule,
1071
- groupButtons.PepGroupButtonsModule,
1072
- smartFilters.PepSmartFiltersModule
1073
- ],
1074
- exports: [
1075
- PepQueryBuilderComponent
1076
- ],
1077
- declarations: [
1078
- PepQueryBuilderComponent,
1079
- PepQueryBuilderSectionComponent,
1080
- PepQueryBuilderItemComponent
1081
- ]
1082
- },] }
1058
+ var PepQueryBuilderModule = /** @class */ (function () {
1059
+ function PepQueryBuilderModule() {
1060
+ }
1061
+ return PepQueryBuilderModule;
1062
+ }());
1063
+ PepQueryBuilderModule.decorators = [
1064
+ { type: core.NgModule, args: [{
1065
+ imports: [
1066
+ common.CommonModule,
1067
+ forms.ReactiveFormsModule,
1068
+ flexLayout.FlexLayoutModule,
1069
+ select.PepSelectModule,
1070
+ button.PepButtonModule,
1071
+ groupButtons.PepGroupButtonsModule,
1072
+ smartFilters.PepSmartFiltersModule
1073
+ ],
1074
+ exports: [
1075
+ PepQueryBuilderComponent
1076
+ ],
1077
+ declarations: [
1078
+ PepQueryBuilderComponent,
1079
+ PepQueryBuilderSectionComponent,
1080
+ PepQueryBuilderItemComponent
1081
+ ]
1082
+ },] }
1083
1083
  ];
1084
1084
 
1085
- /*
1086
- * Public API Surface of ngx-lib/query-builder
1085
+ /*
1086
+ * Public API Surface of ngx-lib/query-builder
1087
1087
  */
1088
1088
 
1089
- /**
1090
- * Generated bundle index. Do not edit.
1089
+ /**
1090
+ * Generated bundle index. Do not edit.
1091
1091
  */
1092
1092
 
1093
1093
  exports.PepQueryBuilderComponent = PepQueryBuilderComponent;