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