@pepperi-addons/ngx-lib 0.4.2-beta.137 → 0.4.2-beta.139

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