@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,1715 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, Directive, ViewChild, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i2 from '@angular/forms';
6
+ import { Validators, FormControl, ReactiveFormsModule, FormBuilder } from '@angular/forms';
7
+ import { FlexLayoutModule } from '@angular/flex-layout';
8
+ import { MatCommonModule } from '@angular/material/core';
9
+ import * as i5$2 from '@angular/material/checkbox';
10
+ import { MatCheckboxModule } from '@angular/material/checkbox';
11
+ import * as i4$3 from '@angular/material/chips';
12
+ import { MatChipsModule } from '@angular/material/chips';
13
+ import * as i5$3 from '@angular/material/expansion';
14
+ import { MatExpansionModule } from '@angular/material/expansion';
15
+ import * as i6$1 from '@angular/material/icon';
16
+ import { MatIconModule } from '@angular/material/icon';
17
+ import { MatFormFieldModule } from '@angular/material/form-field';
18
+ import { MatInputModule } from '@angular/material/input';
19
+ import * as i4$1 from '@angular/material/radio';
20
+ import { MatRadioModule } from '@angular/material/radio';
21
+ import * as i6 from 'ngx-virtual-scroller';
22
+ import { VirtualScrollerComponent, VirtualScrollerModule } from 'ngx-virtual-scroller';
23
+ import * as i3 from '@pepperi-addons/ngx-lib';
24
+ import { PepNgxLibModule } from '@pepperi-addons/ngx-lib';
25
+ import { PepCheckboxModule } from '@pepperi-addons/ngx-lib/checkbox';
26
+ import * as i5$1 from '@pepperi-addons/ngx-lib/date';
27
+ import { PepDateModule } from '@pepperi-addons/ngx-lib/date';
28
+ import * as i4 from '@pepperi-addons/ngx-lib/select';
29
+ import { PepSelectModule } from '@pepperi-addons/ngx-lib/select';
30
+ import * as i5 from '@pepperi-addons/ngx-lib/textbox';
31
+ import { PepTextboxModule } from '@pepperi-addons/ngx-lib/textbox';
32
+ import * as i9 from '@pepperi-addons/ngx-lib/search';
33
+ import { PepSearchModule } from '@pepperi-addons/ngx-lib/search';
34
+ import { PepButtonModule } from '@pepperi-addons/ngx-lib/button';
35
+ import * as i1$1 from '@pepperi-addons/ngx-lib/icon';
36
+ import { pepIconNumberMinus, pepIconNumberPlus, PepIconModule } from '@pepperi-addons/ngx-lib/icon';
37
+ import { PepGroupButtonsModule } from '@pepperi-addons/ngx-lib/group-buttons';
38
+ import * as i3$2 from '@angular/cdk/bidi';
39
+ import { takeUntil, distinctUntilChanged, startWith, map } from 'rxjs/operators';
40
+ import { Subject } from 'rxjs';
41
+ import * as i2$1 from '@ngx-translate/core';
42
+ import * as i3$1 from '@angular/flex-layout/flex';
43
+ import * as i4$2 from '@angular/flex-layout/extended';
44
+
45
+ class IPepSmartFilterOperator {
46
+ }
47
+ const Equals = {
48
+ id: 'eq',
49
+ name: 'EQUAL',
50
+ short: '=',
51
+ componentType: [
52
+ 'number',
53
+ 'boolean',
54
+ // 'multi-select',
55
+ // 'date',
56
+ 'text',
57
+ // 'auto-complete',
58
+ // 'select',
59
+ ],
60
+ };
61
+ const NotEqual = {
62
+ id: 'neq',
63
+ name: 'NOT_EQUAL',
64
+ short: '<>',
65
+ componentType: [
66
+ 'number',
67
+ // 'multi-select',
68
+ // 'date',
69
+ 'text',
70
+ // 'auto-complete',
71
+ // 'select',
72
+ ],
73
+ };
74
+ const LessThan = {
75
+ id: 'lt',
76
+ name: 'LESS_THEN',
77
+ short: '<',
78
+ componentType: ['number'],
79
+ };
80
+ // const LessThanOrEquals: IPepSmartFilterOperator = {
81
+ // id: 'ltoe',
82
+ // name: 'LESS_THEN_OR_EQUAL',
83
+ // short: '<=',
84
+ // type: ['number'],
85
+ // };
86
+ const GreaterThan = {
87
+ id: 'gt',
88
+ name: 'GREATER_THEN',
89
+ short: '>',
90
+ componentType: ['number'],
91
+ };
92
+ // const GreaterThanOrEquals: IPepSmartFilterOperator = {
93
+ // id: 'gtoe',
94
+ // name: 'GREATER_THEN_OR_EQUAL',
95
+ // short: '>=',
96
+ // type: ['number'],
97
+ // };
98
+ const NumberRange = {
99
+ id: 'numberRange',
100
+ name: 'NUMBER_RANGE',
101
+ short: 'Range',
102
+ componentType: ['number'],
103
+ };
104
+ const Contains = {
105
+ id: 'contains',
106
+ name: 'CONTAINS',
107
+ short: 'Contains',
108
+ componentType: ['text'],
109
+ };
110
+ const BeginsWith = {
111
+ id: 'beginsWith',
112
+ name: 'BEGINS_WITH',
113
+ short: 'Begins With',
114
+ componentType: ['text'],
115
+ };
116
+ const EndsWith = {
117
+ id: 'endsWith',
118
+ name: 'ENDS_WITH',
119
+ short: 'End With',
120
+ componentType: ['text'],
121
+ };
122
+ // const After: Operator = {
123
+ // id: 'after',
124
+ // name: 'After',
125
+ // short: 'After',
126
+ // type: ['date'],
127
+ // };
128
+ // const Before: Operator = {
129
+ // id: 'before',
130
+ // name: 'Before',
131
+ // short: 'Before',
132
+ // type: ['date'],
133
+ // };
134
+ const InTheLast = {
135
+ id: 'inTheLast',
136
+ name: 'IN_THE_LAST',
137
+ short: 'In the last',
138
+ componentType: ['date'],
139
+ };
140
+ const Today = {
141
+ id: 'today',
142
+ name: 'TODAY',
143
+ short: 'Today',
144
+ componentType: ['date'],
145
+ };
146
+ const ThisWeek = {
147
+ id: 'thisWeek',
148
+ name: 'THIS_WEEK',
149
+ short: 'This week',
150
+ componentType: ['date'],
151
+ };
152
+ const ThisMonth = {
153
+ id: 'thisMonth',
154
+ name: 'THIS_MONTH',
155
+ short: 'This month',
156
+ componentType: ['date'],
157
+ };
158
+ const DateRange = {
159
+ id: 'dateRange',
160
+ name: 'DATE_RANGE',
161
+ short: 'Range',
162
+ componentType: ['date'],
163
+ };
164
+ const DueIn = {
165
+ id: 'dueIn',
166
+ name: 'DUE_IN',
167
+ short: 'Due in',
168
+ componentType: ['date'],
169
+ };
170
+ const On = {
171
+ id: 'on',
172
+ name: 'ON',
173
+ short: 'On',
174
+ componentType: ['date'],
175
+ };
176
+ const NotInTheLast = {
177
+ id: 'notInTheLast',
178
+ name: 'NOT_IN_THE_LAST',
179
+ short: 'Not in the last',
180
+ componentType: ['date'],
181
+ };
182
+ const NotDueIn = {
183
+ id: 'notDueIn',
184
+ name: 'NOT_DUE_IN',
185
+ short: 'Not due in',
186
+ componentType: ['date'],
187
+ };
188
+ const IsEmpty = {
189
+ id: 'isEmpty',
190
+ name: 'IS_EMPTY',
191
+ short: 'Is empty',
192
+ componentType: ['date'],
193
+ };
194
+ const IsNotEmpty = {
195
+ id: 'isNotEmpty',
196
+ name: 'IS_NOT_EMPTY',
197
+ short: 'Is not empty',
198
+ componentType: ['date'],
199
+ };
200
+ const In = {
201
+ id: 'in',
202
+ name: 'IN',
203
+ short: 'In',
204
+ componentType: ['multi-select'],
205
+ };
206
+ const InVariable = {
207
+ id: 'inv',
208
+ name: 'IN_VARIABLE',
209
+ short: 'In',
210
+ componentType: ['multi-select', 'text'],
211
+ };
212
+ const PepSmartFilterOperators = {
213
+ Equals: Equals,
214
+ NotEqual: NotEqual,
215
+ LessThan: LessThan,
216
+ // LessThanOrEquals: LessThanOrEquals,
217
+ GreaterThan: GreaterThan,
218
+ // GreaterThanOrEquals: GreaterThanOrEquals,
219
+ NumberRange: NumberRange,
220
+ Contains: Contains,
221
+ BeginsWith: BeginsWith,
222
+ EndsWith: EndsWith,
223
+ // After: After,
224
+ // Before: Before,
225
+ InTheLast: InTheLast,
226
+ Today: Today,
227
+ ThisWeek: ThisWeek,
228
+ ThisMonth: ThisMonth,
229
+ DateRange: DateRange,
230
+ DueIn: DueIn,
231
+ On: On,
232
+ NotInTheLast: NotInTheLast,
233
+ NotDueIn: NotDueIn,
234
+ IsEmpty: IsEmpty,
235
+ IsNotEmpty: IsNotEmpty,
236
+ In: In,
237
+ };
238
+ //additional operators to be added upon input flag
239
+ const InTheLastCalendar = {
240
+ id: 'inTheLastCalendar',
241
+ name: 'IN_THE_LAST_CALENDAR',
242
+ short: 'In the last (calendar)',
243
+ componentType: ['date'],
244
+ };
245
+ const NotInTheLastCalendar = {
246
+ id: 'notInTheLastCalendar',
247
+ name: 'NOT_IN_THE_LAST_CALENDAR',
248
+ short: 'Not in the last (calendar)',
249
+ componentType: ['date'],
250
+ };
251
+ const PepSmartFilterAdditionalOperators = {
252
+ InTheLastCalendar: InTheLastCalendar,
253
+ NotInTheLastCalendar: NotInTheLastCalendar
254
+ };
255
+ //additional variable operators to be added upon input variable fields
256
+ const EqualsToVariable = {
257
+ id: 'eqv',
258
+ name: 'EQUAL_TO_VARIABLE',
259
+ short: '=',
260
+ componentType: ['text', 'number', 'boolean']
261
+ };
262
+ const NotEqualsToVariable = {
263
+ id: 'neqv',
264
+ name: 'NOT_EQUAL_TO_VARIABLE',
265
+ short: '<>',
266
+ componentType: ['boolean']
267
+ };
268
+ const LessThanVariable = {
269
+ id: 'ltv',
270
+ name: 'LESS_THAN_VARIABLE',
271
+ short: '<',
272
+ componentType: ['number'],
273
+ };
274
+ const GreaterThanVariable = {
275
+ id: 'gtv',
276
+ name: 'GREATER_THAN_VARIABLE',
277
+ short: '>',
278
+ componentType: ['number'],
279
+ };
280
+ const DateRangeVariable = {
281
+ id: 'dateRangeVariable',
282
+ name: 'DATE_RANGE_VARIABLE',
283
+ short: 'Range Variable',
284
+ componentType: ['date'],
285
+ };
286
+ const PepSmartFilterVariableOperators = {
287
+ EqualsToVariable: EqualsToVariable,
288
+ NotEqualsToVariable: NotEqualsToVariable,
289
+ LessThanVariable: LessThanVariable,
290
+ GreaterThanVariable: GreaterThanVariable,
291
+ DateRangeVariable: DateRangeVariable,
292
+ InVariable: InVariable
293
+ };
294
+ class IPepSmartFilterOperatorUnit {
295
+ }
296
+ const Days = {
297
+ id: 'days',
298
+ name: 'DAYS',
299
+ componentType: ['date'],
300
+ };
301
+ const Weeks = {
302
+ id: 'weeks',
303
+ name: 'WEEKS',
304
+ componentType: ['date'],
305
+ };
306
+ const Months = {
307
+ id: 'months',
308
+ name: 'MONTHS',
309
+ componentType: ['date'],
310
+ };
311
+ const Years = {
312
+ id: 'years',
313
+ name: 'YEARS',
314
+ componentType: ['date'],
315
+ };
316
+ const PepSmartFilterOperatorUnits = {
317
+ Days: Days,
318
+ Weeks: Weeks,
319
+ Months: Months,
320
+ Years: Years,
321
+ };
322
+
323
+ class PepFilterActionsComponent {
324
+ constructor() {
325
+ this.clearClick = new EventEmitter();
326
+ this.applyClick = new EventEmitter();
327
+ }
328
+ clear() {
329
+ this.clearClick.emit();
330
+ }
331
+ apply() {
332
+ this.applyClick.emit();
333
+ }
334
+ }
335
+ PepFilterActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
336
+ PepFilterActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepFilterActionsComponent, selector: "pep-filter-actions", inputs: { form: "form" }, outputs: { clearClick: "clearClick", applyClick: "applyClick" }, ngImport: i0, template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"], dependencies: [{ kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepFilterActionsComponent, decorators: [{
338
+ type: Component,
339
+ args: [{ selector: 'pep-filter-actions', template: "<div [formGroup]=\"form\" class=\"filter-actions pep-spacing-element-negative\">\n <button mat-button class=\"pep-spacing-element pep-button sm weak\" (click)=\"clear()\">\n {{ 'ACTIONS.CLEAR' | translate }}\n </button>\n <button mat-button class=\"pep-spacing-element pep-button sm strong\" (click)=\"apply()\" [disabled]=\"form.invalid\">\n {{ 'ACTIONS.APPLY' | translate }}\n </button>\n</div>", styles: [".filter-actions{margin:var(--pep-spacing-lg, 1rem) 0 calc(var(--pep-spacing-lg, 1rem) / 2);display:flex;justify-content:flex-end}\n"] }]
340
+ }], propDecorators: { form: [{
341
+ type: Input
342
+ }], clearClick: [{
343
+ type: Output
344
+ }], applyClick: [{
345
+ type: Output
346
+ }] } });
347
+
348
+ class BaseFilterComponent {
349
+ constructor(viewContainerRef, injector, resolver, builder, translate, validator, utilitiesService, renderer) {
350
+ this.viewContainerRef = viewContainerRef;
351
+ this.injector = injector;
352
+ this.resolver = resolver;
353
+ this.builder = builder;
354
+ this.translate = translate;
355
+ this.validator = validator;
356
+ this.utilitiesService = utilitiesService;
357
+ this.renderer = renderer;
358
+ this._fieldIdWithNoDots = '';
359
+ this.variableFieldOptions = [];
360
+ this.emitOnChange = false;
361
+ this.inline = false;
362
+ this.showActionButtons = true;
363
+ this.renderTitle = true;
364
+ this.showAdditionalOperators = false;
365
+ this.filterClear = new EventEmitter();
366
+ this.filterChange = new EventEmitter();
367
+ this.OPERATORS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATORS';
368
+ this.OPERATOR_UNITS_TRANSLATION_PREFIX = 'SMART_FILTERS.OPERATOR_UNITS';
369
+ this._destroyed = new Subject();
370
+ }
371
+ set field(value) {
372
+ this._field = value;
373
+ this._fieldIdWithNoDots = value ? value.id.replace(/\./g, '_') : '';
374
+ this.setupForm();
375
+ }
376
+ get field() {
377
+ return this._field;
378
+ }
379
+ set variableField(list) {
380
+ if (list === null || list === void 0 ? void 0 : list.length) {
381
+ this.variableFieldOptions = list.map(item => {
382
+ return {
383
+ key: item,
384
+ value: item
385
+ };
386
+ });
387
+ }
388
+ }
389
+ set filter(value) {
390
+ this._filter = value;
391
+ this.setupFilter();
392
+ }
393
+ get filter() {
394
+ return this._filter;
395
+ }
396
+ set parentForm(form) {
397
+ this._parentForm = form;
398
+ this.updateParentForm();
399
+ }
400
+ set operator(operator) {
401
+ var _a;
402
+ if ((operator === null || operator === void 0 ? void 0 : operator.id) != ((_a = this._operator) === null || _a === void 0 ? void 0 : _a.id)) {
403
+ // Validate operator
404
+ const index = this.operators.findIndex((o) => o.id === operator.id);
405
+ if (index >= 0) {
406
+ this._operator = this.operators[index];
407
+ }
408
+ else {
409
+ this._operator = this.operators[0];
410
+ }
411
+ this.form.reset();
412
+ this.updateValidity();
413
+ }
414
+ }
415
+ get operator() {
416
+ return this._operator;
417
+ }
418
+ set operatorUnit(operatorUnit) {
419
+ // Validate operator unit
420
+ if (operatorUnit) {
421
+ const index = this.operatorUnits.findIndex((ou) => ou.id === operatorUnit.id);
422
+ if (index >= 0) {
423
+ this._operatorUnit = this.operatorUnits[index];
424
+ }
425
+ else {
426
+ this._operatorUnit = this.operatorUnits[0];
427
+ }
428
+ }
429
+ else {
430
+ this._operatorUnit = undefined;
431
+ }
432
+ }
433
+ get operatorUnit() {
434
+ return this._operatorUnit;
435
+ }
436
+ get firstControlKey() {
437
+ return this.field ? `${this._fieldIdWithNoDots}_first` : 'first';
438
+ }
439
+ get firstControl() {
440
+ return this.form.get(this.firstControlKey);
441
+ }
442
+ get secondControlKey() {
443
+ return this.field ? `${this._fieldIdWithNoDots}_second` : 'second';
444
+ }
445
+ get secondControl() {
446
+ return this.form.get(this.secondControlKey);
447
+ }
448
+ createActionsComponent() {
449
+ const factory = this.resolver.resolveComponentFactory(PepFilterActionsComponent);
450
+ this.actionsContainerRef = factory.create(this.injector);
451
+ this.actionsContainerRef.instance.form = this.form;
452
+ this.actionsContainerRef.instance.applyClick.subscribe(() => this.applyFilter());
453
+ this.actionsContainerRef.instance.clearClick.subscribe(() => this.clearFilter());
454
+ this.viewContainerRef.insert(this.actionsContainerRef.hostView);
455
+ }
456
+ setupForm() {
457
+ const formValue = {};
458
+ formValue[this.firstControlKey] = [];
459
+ formValue[this.secondControlKey] = [];
460
+ // this.form.patchValue(formValue);
461
+ this.form = this.builder.group(formValue);
462
+ // this.form[this.firstControlKey] = [];
463
+ // this.form[this.secondControlKey] = [];
464
+ this.setupOperators();
465
+ if (this.showActionButtons) {
466
+ this.createActionsComponent();
467
+ }
468
+ }
469
+ setupOperators() {
470
+ var _a, _b, _c;
471
+ // Get the operators by componentType.
472
+ this.operators = Object.keys(PepSmartFilterOperators)
473
+ .filter((key) => {
474
+ return PepSmartFilterOperators[key].componentType.includes(this.field.componentType);
475
+ })
476
+ .map((key) => PepSmartFilterOperators[key]);
477
+ // Add additional operators
478
+ if (this.showAdditionalOperators) {
479
+ const additional = Object.keys(PepSmartFilterAdditionalOperators)
480
+ .filter((key) => {
481
+ return PepSmartFilterAdditionalOperators[key].componentType.includes(this.field.componentType);
482
+ })
483
+ .map((key) => PepSmartFilterAdditionalOperators[key]);
484
+ this.operators = [...this.operators, ...additional];
485
+ }
486
+ //add variable operators
487
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
488
+ const variables = Object.keys(PepSmartFilterVariableOperators)
489
+ .filter((key) => {
490
+ return PepSmartFilterVariableOperators[key].componentType.includes(this.field.componentType);
491
+ })
492
+ .map((key) => PepSmartFilterVariableOperators[key]);
493
+ this.operators = [...this.operators, ...variables];
494
+ }
495
+ // Filter by from field.operators input if exist.
496
+ if (((_b = this.field.operators) === null || _b === void 0 ? void 0 : _b.length) > 0) {
497
+ this.operators = this.operators.filter((o1) => this.field.operators.some((o2) => o1.id === o2));
498
+ }
499
+ // Get the operator units by componentType.
500
+ this.operatorUnits = Object.keys(PepSmartFilterOperatorUnits)
501
+ .filter((key) => {
502
+ return PepSmartFilterOperatorUnits[key].componentType.includes(this.field.componentType);
503
+ })
504
+ .map((key) => PepSmartFilterOperatorUnits[key]);
505
+ // Filter by from field.operatorsUnits input if exist.
506
+ if (((_c = this.field.operatorUnits) === null || _c === void 0 ? void 0 : _c.length) > 0) {
507
+ this.operatorUnits = this.operatorUnits.filter((o1) => this.field.operatorUnits.some((o2) => o1.id === o2));
508
+ }
509
+ // Load translation before get the options in the children.
510
+ this.translate.get('SMART_FILTERS.TITLE').subscribe((res) => {
511
+ this.loadOperatorsOptions();
512
+ });
513
+ }
514
+ setupFilter() {
515
+ if (this._filter) {
516
+ this.operator = this._filter.operator;
517
+ this.operatorUnit = this._filter.operatorUnit;
518
+ const formValue = {};
519
+ formValue[this.firstControlKey] = this._filter.value.first;
520
+ formValue[this.secondControlKey] = this._filter.value.second;
521
+ this.form.patchValue(formValue);
522
+ }
523
+ else {
524
+ this.operator = this.getDefaultOperator();
525
+ this.operatorUnit = this.getDefaultOperatorUnit();
526
+ this.clearFilter(false);
527
+ }
528
+ }
529
+ updateParentForm() {
530
+ this._parentForm.setControl('fieldId', this.builder.control(this.field.id));
531
+ this._parentForm.setControl('fieldType', this.builder.control(this.field.type));
532
+ this._parentForm.setControl('operator', this.builder.control(this.operator));
533
+ this._parentForm.setControl('operatorUnit', this.builder.control(this.operatorUnit));
534
+ this._parentForm.setControl('values', this.builder.group({
535
+ first: this.firstControl,
536
+ second: this.secondControl
537
+ }));
538
+ }
539
+ getDestroyer() {
540
+ return takeUntil(this._destroyed);
541
+ }
542
+ updateValidity() {
543
+ this.setFieldsStateAndValidators();
544
+ this.firstControl.updateValueAndValidity();
545
+ this.secondControl.updateValueAndValidity();
546
+ }
547
+ // Load the operators options from the translation.
548
+ loadOperatorsOptions() {
549
+ // Not implemented in the base
550
+ }
551
+ // Set default validators - some childs override this.
552
+ setFieldsStateAndValidators() {
553
+ this.firstControl.setValidators(Validators.required);
554
+ this.secondControl.setValidators(Validators.required);
555
+ this.secondControl.disable();
556
+ }
557
+ // Return undefined - some childs override this.
558
+ getDefaultOperatorUnit() {
559
+ return undefined;
560
+ }
561
+ initFilter() {
562
+ // Not implemented in the base
563
+ }
564
+ clearFilter(emitEvent = true) {
565
+ this._filter = null;
566
+ this.form.reset();
567
+ this.initFilter();
568
+ if (emitEvent) {
569
+ this.filterClear.emit();
570
+ }
571
+ }
572
+ applyFilter() {
573
+ const filterValue = this.getFilterValue();
574
+ // If the filter is not null declare it, else - clear it.
575
+ if (filterValue) {
576
+ const filter = {
577
+ fieldId: this.field.id,
578
+ operator: this.operator,
579
+ operatorUnit: this.operatorUnit,
580
+ value: filterValue,
581
+ };
582
+ this._filter = filter;
583
+ this.filterChange.emit(filter);
584
+ }
585
+ else {
586
+ this.clearFilter();
587
+ }
588
+ }
589
+ ngOnInit() {
590
+ if (this.form) {
591
+ this.updateValidity();
592
+ }
593
+ }
594
+ ngOnChanges() {
595
+ // if (this.form) {
596
+ // this.updateValidity();
597
+ // }
598
+ }
599
+ ngOnDestroy() {
600
+ this._destroyed.next();
601
+ this._destroyed.complete();
602
+ if (this.showActionButtons) {
603
+ this.actionsContainerRef.destroy();
604
+ }
605
+ }
606
+ }
607
+ BaseFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, deps: [{ token: i0.ViewContainerRef }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }, { token: i2.FormBuilder }, { token: i2$1.TranslateService }, { token: i3.PepValidatorService }, { token: i3.PepUtilitiesService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
608
+ BaseFilterComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: BaseFilterComponent, inputs: { field: "field", variableField: "variableField", filter: "filter", parentForm: "parentForm", emitOnChange: "emitOnChange", inline: "inline", showActionButtons: "showActionButtons", renderTitle: "renderTitle", showAdditionalOperators: "showAdditionalOperators" }, outputs: { filterClear: "filterClear", filterChange: "filterChange" }, usesOnChanges: true, ngImport: i0 });
609
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: BaseFilterComponent, decorators: [{
610
+ type: Directive,
611
+ args: [{}]
612
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i2.FormBuilder }, { type: i2$1.TranslateService }, { type: i3.PepValidatorService }, { type: i3.PepUtilitiesService }, { type: i0.Renderer2 }]; }, propDecorators: { field: [{
613
+ type: Input
614
+ }], variableField: [{
615
+ type: Input
616
+ }], filter: [{
617
+ type: Input
618
+ }], parentForm: [{
619
+ type: Input
620
+ }], emitOnChange: [{
621
+ type: Input
622
+ }], inline: [{
623
+ type: Input
624
+ }], showActionButtons: [{
625
+ type: Input
626
+ }], renderTitle: [{
627
+ type: Input
628
+ }], showAdditionalOperators: [{
629
+ type: Input
630
+ }], filterClear: [{
631
+ type: Output
632
+ }], filterChange: [{
633
+ type: Output
634
+ }] } });
635
+
636
+ class PepTextFilterComponent extends BaseFilterComponent {
637
+ constructor() {
638
+ super(...arguments);
639
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
640
+ this.chooseTypeOptions = [];
641
+ this.operatorWidth = '38%';
642
+ this.firstControlWidth = '62%';
643
+ }
644
+ ngOnInit() {
645
+ this.firstControl.valueChanges
646
+ .pipe(this.getDestroyer(), distinctUntilChanged())
647
+ .subscribe(() => {
648
+ this.setFieldsStateAndValidators();
649
+ });
650
+ }
651
+ // Override
652
+ getDefaultOperator() {
653
+ return PepSmartFilterOperators.Equals;
654
+ }
655
+ // Override
656
+ getFilterValue() {
657
+ const filterValue = {
658
+ first: this.firstControl.value,
659
+ };
660
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
661
+ filterValue['second'] = this.secondControl.value;
662
+ }
663
+ return filterValue;
664
+ }
665
+ // Override
666
+ loadOperatorsOptions() {
667
+ this.chooseTypeOptions = this.operators.map((operator) => {
668
+ return {
669
+ key: operator.id,
670
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
671
+ };
672
+ });
673
+ }
674
+ // Override
675
+ setFieldsStateAndValidators() {
676
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
677
+ const firstValidators = [Validators.required];
678
+ if (this.secondControl.value) {
679
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
680
+ }
681
+ this.firstControl.setValidators(firstValidators);
682
+ this.firstControl.updateValueAndValidity();
683
+ }
684
+ else {
685
+ super.setFieldsStateAndValidators();
686
+ }
687
+ }
688
+ onOperatorChanged(value) {
689
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
690
+ this.operator = operator;
691
+ if (this._parentForm) {
692
+ this.updateParentForm();
693
+ }
694
+ if (this.emitOnChange) {
695
+ this.applyFilter();
696
+ }
697
+ }
698
+ onVariableChanged(value) {
699
+ this.firstControl.setValue(value);
700
+ if (this.emitOnChange) {
701
+ this.applyFilter();
702
+ }
703
+ }
704
+ onValueChanged() {
705
+ if (this.emitOnChange) {
706
+ this.applyFilter();
707
+ }
708
+ }
709
+ }
710
+ PepTextFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
711
+ PepTextFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepTextFilterComponent, selector: "pep-text-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.InVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable ||\n operator === PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: i4.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: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
712
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepTextFilterComponent, decorators: [{
713
+ type: Component,
714
+ args: [{ selector: 'pep-text-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.InVariable\">\n <pep-textbox [fxFlex]=\"inline ? firstControlWidth : null\" [form]=\"form\" [key]=\"firstControlKey\"\n [label]=\"'SMART_FILTERS.VALUE' | translate\" [renderError]=\"false\" [renderTitle]=\"renderTitle\"\n [type]=\"field.type\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable ||\n operator === PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"inline ? firstControlWidth : null\" [key]=\"firstControlKey\"\n [value]=\"firstControl?.value || ''\" [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\"\n [emptyOption]=\"false\" [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n</div>" }]
715
+ }] });
716
+
717
+ class PepBooleanFilterComponent extends BaseFilterComponent {
718
+ constructor() {
719
+ super(...arguments);
720
+ this.options = [];
721
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
722
+ this.chooseTypeOptions = [];
723
+ }
724
+ ngOnInit() {
725
+ if (this.inline) {
726
+ this.setControlsWidth();
727
+ }
728
+ }
729
+ // Override
730
+ getDefaultOperator() {
731
+ return PepSmartFilterOperators.Equals;
732
+ }
733
+ // Override
734
+ getFilterValue() {
735
+ const filterValue = { first: this.firstControl.value || false };
736
+ return filterValue;
737
+ }
738
+ // Override
739
+ loadOperatorsOptions() {
740
+ this.chooseTypeOptions = this.operators.map((operator) => {
741
+ return {
742
+ key: operator.id,
743
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
744
+ };
745
+ });
746
+ }
747
+ setControlsWidth() {
748
+ var _a;
749
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
750
+ this.operatorWidth = '38%';
751
+ this.valueWidth = '62%';
752
+ }
753
+ else {
754
+ this.valueWidth = '100%';
755
+ }
756
+ }
757
+ onOperatorChanged(value) {
758
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
759
+ this.operator = operator;
760
+ if (this._parentForm) {
761
+ this.updateParentForm();
762
+ }
763
+ if (this.emitOnChange) {
764
+ this.applyFilter();
765
+ }
766
+ }
767
+ onValueChanged(value) {
768
+ this.firstControl.setValue(value);
769
+ if (this.emitOnChange) {
770
+ this.applyFilter();
771
+ }
772
+ }
773
+ }
774
+ PepBooleanFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
775
+ PepBooleanFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: { options: "options" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline; then inlineBlock; else notInlineBlock\"></ng-container>\n<ng-template #inlineBlock>\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-template>\n<ng-template #notInlineBlock>\n <div [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group \" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n <span class=\"body-sm ellipsis\">{{ 'CHECKBOX.TRUE' | translate }}</span>\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n <span class=\"body-sm ellipsis\">{{ 'CHECKBOX.FALSE' | translate }}</span>\n </mat-radio-button>\n </mat-radio-group>\n </div>\n</ng-template>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { 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: "directive", type: i4$1.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$1.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: i4.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: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
776
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepBooleanFilterComponent, decorators: [{
777
+ type: Component,
778
+ args: [{ selector: 'pep-boolean-filter', template: "<ng-container *ngIf=\"inline; then inlineBlock; else notInlineBlock\"></ng-container>\n<ng-template #inlineBlock>\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\"\n [options]=\"options\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [fxFlex]=\"valueWidth\" [value]=\"firstControl?.value || ''\" xAlignment=\"left\" [options]=\"options\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-template>\n<ng-template #notInlineBlock>\n <div [formGroup]=\"form\">\n <mat-radio-group class=\"radio-group \" [formControlName]=\"firstControlKey\">\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"true\">\n <span class=\"body-sm ellipsis\">{{ 'CHECKBOX.TRUE' | translate }}</span>\n </mat-radio-button>\n <mat-radio-button class=\"pep-radio-button md pep-input no-default-background\" value=\"false\">\n <span class=\"body-sm ellipsis\">{{ 'CHECKBOX.FALSE' | translate }}</span>\n </mat-radio-button>\n </mat-radio-group>\n </div>\n</ng-template>", styles: [".radio-group{display:flex;flex-direction:column}.radio-group .pep-radio-button.pep-input{height:2.25rem;display:flex}\n"] }]
779
+ }], propDecorators: { options: [{
780
+ type: Input
781
+ }] } });
782
+
783
+ class PepDateFilterComponent extends BaseFilterComponent {
784
+ constructor() {
785
+ super(...arguments);
786
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
787
+ this.PepSmartFilterAdditionalOperators = PepSmartFilterAdditionalOperators;
788
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
789
+ this.chooseTimeOptions = [];
790
+ this.chooseTimeUnitOptions = [];
791
+ }
792
+ ngOnInit() {
793
+ if (this.inline) {
794
+ this.setControlsWidth();
795
+ }
796
+ }
797
+ // Override
798
+ getDefaultOperator() {
799
+ return PepSmartFilterOperators.InTheLast;
800
+ }
801
+ // Override
802
+ getDefaultOperatorUnit() {
803
+ if (this.operator === PepSmartFilterOperators.InTheLast ||
804
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
805
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
806
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
807
+ this.operator === PepSmartFilterOperators.DueIn ||
808
+ this.operator === PepSmartFilterOperators.NotDueIn) {
809
+ return PepSmartFilterOperatorUnits.Months;
810
+ }
811
+ else {
812
+ return undefined;
813
+ }
814
+ }
815
+ // Override
816
+ getFilterValue() {
817
+ const filterValue = {
818
+ first: this.firstControl.value,
819
+ };
820
+ if (this.operator === PepSmartFilterOperators.DateRange ||
821
+ this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
822
+ filterValue['second'] = this.secondControl.value;
823
+ }
824
+ return filterValue;
825
+ }
826
+ // Override
827
+ initFilter() {
828
+ setTimeout(() => {
829
+ if (this.emitOnChange) {
830
+ this.applyFilter();
831
+ }
832
+ }, 0);
833
+ }
834
+ // Override
835
+ loadOperatorsOptions() {
836
+ this.chooseTimeOptions = this.operators.map((operator) => {
837
+ return {
838
+ key: operator.id,
839
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
840
+ };
841
+ });
842
+ this.chooseTimeUnitOptions = this.operatorUnits.map((operatorUnit) => {
843
+ return {
844
+ key: operatorUnit.id,
845
+ value: this.translate.instant(`${this.OPERATOR_UNITS_TRANSLATION_PREFIX}.${operatorUnit.name}`),
846
+ };
847
+ });
848
+ }
849
+ // Override
850
+ setFieldsStateAndValidators() {
851
+ this.firstControl.enable();
852
+ if (this.operator === PepSmartFilterOperators.DateRange ||
853
+ this.operator === PepSmartFilterVariableOperators.DateRangeVariable) {
854
+ this.firstControl.setValidators(Validators.required);
855
+ this.secondControl.enable();
856
+ this.secondControl.setValidators(Validators.required);
857
+ }
858
+ else if (this.operator === PepSmartFilterOperators.InTheLast ||
859
+ this.operator === PepSmartFilterAdditionalOperators.InTheLastCalendar ||
860
+ this.operator === PepSmartFilterOperators.NotInTheLast ||
861
+ this.operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar ||
862
+ this.operator === PepSmartFilterOperators.DueIn ||
863
+ this.operator === PepSmartFilterOperators.NotDueIn) {
864
+ this.firstControl.setValidators([
865
+ Validators.required,
866
+ this.validator.numberValidator(),
867
+ ]);
868
+ this.secondControl.disable();
869
+ }
870
+ else {
871
+ // Disable 'first' field.
872
+ if (this.operator === PepSmartFilterOperators.Today ||
873
+ this.operator === PepSmartFilterOperators.ThisWeek ||
874
+ this.operator === PepSmartFilterOperators.ThisMonth ||
875
+ this.operator === PepSmartFilterOperators.IsEmpty ||
876
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
877
+ this.firstControl.disable();
878
+ }
879
+ // Default disable 'second' field.
880
+ super.setFieldsStateAndValidators();
881
+ }
882
+ }
883
+ setControlsWidth() {
884
+ if (this.operator === PepSmartFilterOperators.Today ||
885
+ this.operator === PepSmartFilterOperators.ThisWeek ||
886
+ this.operator === PepSmartFilterOperators.ThisMonth ||
887
+ this.operator === PepSmartFilterOperators.IsEmpty ||
888
+ this.operator === PepSmartFilterOperators.IsNotEmpty) {
889
+ this.operatorWidth = 'auto';
890
+ this.fieldsWidth = '0%';
891
+ }
892
+ else if (this.operator === PepSmartFilterOperators.On) {
893
+ this.operatorWidth = '38%';
894
+ this.fieldsWidth = '62%';
895
+ }
896
+ else {
897
+ this.operatorWidth = '30%';
898
+ this.fieldsWidth = '70%';
899
+ }
900
+ }
901
+ onOperatorChanged(value) {
902
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
903
+ this.operator = operator;
904
+ this.operatorUnit = this.getDefaultOperatorUnit();
905
+ if (this.inline) {
906
+ this.setControlsWidth();
907
+ }
908
+ if (this._parentForm) {
909
+ this.updateParentForm();
910
+ }
911
+ setTimeout(() => {
912
+ if (this.emitOnChange) {
913
+ this.applyFilter();
914
+ }
915
+ }, 0);
916
+ }
917
+ onTimeUnitChanged(value) {
918
+ const operatorUnit = Object.values(PepSmartFilterOperatorUnits).find((operatorUnit) => operatorUnit.id === value);
919
+ this.operatorUnit = operatorUnit;
920
+ if (this._parentForm) {
921
+ this.updateParentForm();
922
+ }
923
+ if (this.emitOnChange) {
924
+ this.applyFilter();
925
+ }
926
+ }
927
+ onVariableChanged(value) {
928
+ this.firstControl.setValue(value);
929
+ if (this.emitOnChange) {
930
+ this.applyFilter();
931
+ }
932
+ }
933
+ onSecondVariableChanged(value) {
934
+ this.secondControl.setValue(value);
935
+ if (this.emitOnChange) {
936
+ this.applyFilter();
937
+ }
938
+ }
939
+ onDateValueChanged() {
940
+ if (this.emitOnChange) {
941
+ this.applyFilter();
942
+ }
943
+ }
944
+ }
945
+ PepDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
946
+ PepDateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepDateFilterComponent, selector: "pep-date-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: "directive", type: i3.PepRtlDirectionDirective, selector: "[pepRtlDirection]" }, { kind: "component", type: i5$1.PepDateComponent, selector: "pep-date", inputs: ["key", "value", "label", "type", "mandatory", "disabled", "readonly", "textColor", "xAlignment", "rowSpan", "visible", "minValue", "maxValue", "minDateValue", "maxDateValue", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType"], outputs: ["valueChange"] }, { kind: "component", type: i4.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: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
947
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepDateFilterComponent, decorators: [{
948
+ type: Component,
949
+ args: [{ selector: 'pep-date-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [key]=\"'timeOperator'\" [value]=\"operator.id\" [label]=\"'SMART_FILTERS.CHOOSE_TIME' | translate\"\n [renderTitle]=\"renderTitle\" [emptyOption]=\"false\" [options]=\"chooseTimeOptions\"\n [fxFlex]=\"inline ? operatorWidth : null\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <div *ngIf=\"operator === PepSmartFilterOperators.InTheLast ||\n operator === PepSmartFilterAdditionalOperators.InTheLastCalendar || \n operator === PepSmartFilterOperators.NotInTheLast ||\n operator === PepSmartFilterAdditionalOperators.NotInTheLastCalendar || \n operator === PepSmartFilterOperators.DueIn ||\n operator === PepSmartFilterOperators.NotDueIn\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\" [type]=\"'int'\"\n [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-textbox>\n <!-- Time unit -->\n <pep-select [form]=\"form\" [key]=\"'timeUnit'\" [value]=\"operatorUnit?.id\"\n [label]=\"'SMART_FILTERS.TIME_UNIT' | translate\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [emptyOption]=\"false\" [options]=\"chooseTimeUnitOptions\" (valueChange)=\"onTimeUnitChanged($event)\">\n </pep-select>\n </div>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterOperators.DateRange\" fxLayout=\"row\" fxLayout.xs=\"column\"\n [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\" [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Start date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.START_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"firstControl?.value || ''\"\n [maxDateValue]=\"secondControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n <!-- End date -->\n <pep-date [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.END_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" fxFlex=\"50%\"\n [type]=\"field.type === 'date' ? 'date' : 'datetime'\" [value]=\"secondControl?.value || ''\"\n [minDateValue]=\"firstControl?.value\" (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </div>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.On\">\n <!-- Choose a date -->\n <pep-date [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.CHOOSE_DATE' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type === 'date' ? 'date' : 'datetime'\"\n [fxFlex]=\"inline ? fieldsWidth : null\" [value]=\"firstControl?.value || ''\"\n (valueChange)=\"onDateValueChanged()\">\n </pep-date>\n </ng-container>\n <div pepRtlDirection *ngIf=\"operator === PepSmartFilterVariableOperators.DateRangeVariable\" fxLayout=\"row\"\n fxLayout.xs=\"column\" fxLayoutGap=\".5rem\" fxFlex=\"fieldsWidth\">\n <pep-select fxFlex=\"50%\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\"></pep-select>\n <pep-select fxFlex=\"50%\" [key]=\"secondControlKey\" [value]=\"secondControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onSecondVariableChanged($event)\"></pep-select>\n </div>\n</div>\n" }]
950
+ }] });
951
+
952
+ class PepMultiSelectFilterOption {
953
+ constructor() {
954
+ this.selected = false;
955
+ }
956
+ }
957
+ class PepMultiSelectFilterComponent extends BaseFilterComponent {
958
+ constructor() {
959
+ super(...arguments);
960
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
961
+ this.options = [];
962
+ this.chooseTypeOptions = [];
963
+ this.searchControl = new FormControl();
964
+ //inline props
965
+ this.selected = '';
966
+ this.inlineOptions = [];
967
+ this.MAX_OPTIONS_TO_SHOW = 6.35;
968
+ this.numberOptionsToShowSearch = 10;
969
+ }
970
+ ngOnInit() {
971
+ super.ngOnInit;
972
+ if (this.inline) {
973
+ this.inlineControlInit();
974
+ this.setControlsWidth();
975
+ }
976
+ else {
977
+ this.noneInlineControlInit();
978
+ }
979
+ }
980
+ ngAfterViewInit() {
981
+ // Calc for the first time.
982
+ this.calcOptionsHeight(this.options.length);
983
+ }
984
+ inlineControlInit() {
985
+ var _a, _b, _c;
986
+ //load options from field
987
+ this.inlineOptions = ((_b = (_a = this.field) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length) > 0 ? this.field.options : [];
988
+ // init the selected values from first value.
989
+ if (((_c = this.firstControl) === null || _c === void 0 ? void 0 : _c.value) && Array.isArray(this.firstControl.value)) {
990
+ this.selected = this.firstControl.value.join(';');
991
+ }
992
+ }
993
+ noneInlineControlInit() {
994
+ var _a;
995
+ if (((_a = this.field.options) === null || _a === void 0 ? void 0 : _a.length) > 0) {
996
+ this.options = this.field.options.map((opt) => {
997
+ return { value: opt.value, count: opt.count, selected: false };
998
+ });
999
+ }
1000
+ else {
1001
+ this.searchControl.disable();
1002
+ }
1003
+ // Init the selected values from first value.
1004
+ const firstControl = this.firstControl;
1005
+ if (firstControl.value) {
1006
+ this.initOptionsSelectedValues(firstControl.value);
1007
+ }
1008
+ // Add subscription for the first value change to set the selected options.
1009
+ firstControl.valueChanges
1010
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1011
+ .subscribe((selectedValues) => {
1012
+ this.initOptionsSelectedValues(selectedValues);
1013
+ });
1014
+ // Filter the options by the search control.
1015
+ this.filteredOptions$ = this.searchControl.valueChanges.pipe(this.getDestroyer(), startWith(''), map((option) => typeof option === 'string' ? option : option && option.value), map((value) => (value ? this.filterOptions(value) : this.options)));
1016
+ // Each time the filter change.
1017
+ this.filteredOptions$.subscribe((filterdOptions) => {
1018
+ this.calcOptionsHeight(filterdOptions.length);
1019
+ setTimeout(() => {
1020
+ // 8 is the padding top of the multi-select-options
1021
+ this.virtualScroller.scrollToPosition(-8);
1022
+ }, 125);
1023
+ });
1024
+ }
1025
+ initOptionsSelectedValues(selectedValues) {
1026
+ this.options.forEach((opt) => {
1027
+ const isValueSelected = selectedValues && selectedValues.includes(opt.value);
1028
+ opt.selected = isValueSelected;
1029
+ });
1030
+ }
1031
+ calcOptionsHeight(optionsCount) {
1032
+ if (this.optionsContainer) {
1033
+ const optionsToShow = optionsCount > this.MAX_OPTIONS_TO_SHOW
1034
+ ? this.MAX_OPTIONS_TO_SHOW
1035
+ : optionsCount;
1036
+ // optionsToShow * 2.25 is 1 option height + 1 is the padding top & bottom of the container.
1037
+ const optionsHeight = optionsToShow * 2.25 + 1 + 'rem';
1038
+ this.renderer.setStyle(this.optionsContainer.nativeElement, 'height', optionsHeight);
1039
+ }
1040
+ }
1041
+ filterOptions(value) {
1042
+ const filterValue = value.toLowerCase();
1043
+ return this.options.filter((opt) => opt.value &&
1044
+ opt.value.toLowerCase().includes(filterValue.toLowerCase()));
1045
+ }
1046
+ // Override
1047
+ getDefaultOperator() {
1048
+ return PepSmartFilterOperators.In;
1049
+ }
1050
+ // Override
1051
+ getFilterValue() {
1052
+ if (this.inline) {
1053
+ return {
1054
+ first: this.firstControl.value
1055
+ };
1056
+ }
1057
+ else {
1058
+ const selectedValues = this.options
1059
+ .filter((opt) => opt.selected)
1060
+ .map((opt) => opt.value);
1061
+ const filterValue = {
1062
+ first: selectedValues,
1063
+ };
1064
+ return selectedValues.length > 0 ? filterValue : null;
1065
+ }
1066
+ }
1067
+ // Override
1068
+ loadOperatorsOptions() {
1069
+ this.chooseTypeOptions = this.operators.map((operator) => {
1070
+ return {
1071
+ key: operator.id,
1072
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1073
+ };
1074
+ });
1075
+ }
1076
+ setControlsWidth() {
1077
+ var _a;
1078
+ if ((_a = this.variableFieldOptions) === null || _a === void 0 ? void 0 : _a.length) {
1079
+ this.operatorWidth = '38%';
1080
+ this.valueWidth = '62%';
1081
+ }
1082
+ else {
1083
+ this.valueWidth = '100%';
1084
+ }
1085
+ }
1086
+ onOperatorChanged(value) {
1087
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1088
+ this.operator = operator;
1089
+ if (this._parentForm) {
1090
+ this.updateParentForm();
1091
+ }
1092
+ if (this.emitOnChange) {
1093
+ this.applyFilter();
1094
+ }
1095
+ }
1096
+ // Override
1097
+ initFilter() {
1098
+ this.options.forEach((opt) => (opt.selected = false));
1099
+ this.searchControl.setValue('');
1100
+ }
1101
+ onOptionChange(option, event) {
1102
+ option.selected = event.checked;
1103
+ this.firstControl.setValue(this.options.filter((opt) => opt.selected).map((opt) => opt.value), { emitEvent: false });
1104
+ }
1105
+ onMultiSelectChanged(value) {
1106
+ if (value) {
1107
+ const selected = value.split(';');
1108
+ this.firstControl.setValue(selected);
1109
+ }
1110
+ else {
1111
+ this.firstControl.setValue(null);
1112
+ }
1113
+ if (this.emitOnChange) {
1114
+ this.applyFilter();
1115
+ }
1116
+ }
1117
+ onValueChanged(value) {
1118
+ this.firstControl.setValue(value);
1119
+ if (this.emitOnChange) {
1120
+ this.applyFilter();
1121
+ }
1122
+ }
1123
+ }
1124
+ PepMultiSelectFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1125
+ PepMultiSelectFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter", viewQueries: [{ propertyName: "optionsContainer", first: true, predicate: ["optionsContainer"], descendants: true }, { propertyName: "virtualScroller", first: true, predicate: VirtualScrollerComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable || \n operator === PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable &&\n operator !== PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: "directive", type: i4$2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "component", type: i5$2.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i6.VirtualScrollerComponent, selector: "virtual-scroller,[virtualScroller]", inputs: ["executeRefreshOutsideAngularZone", "RTL", "useMarginInsteadOfTranslate", "ssrViewportWidth", "ssrViewportHeight", "compareItems", "checkResizeInterval", "modifyOverflowStyleOfParentScroll", "resizeBypassRefreshThreshold", "scrollAnimationTime", "scrollDebounceTime", "scrollThrottlingTime", "scrollbarHeight", "scrollbarWidth", "stripedTable", "horizontal", "enableUnequalChildrenSizes", "bufferAmount", "items", "parentScroll", "childWidth", "childHeight", "ssrChildWidth", "ssrChildHeight"], outputs: ["vsUpdate", "vsChange", "vsStart", "vsEnd"], exportAs: ["virtualScroller"] }, { kind: "directive", type: i3.PepRtlClassDirective, selector: "[pepRtlClass]" }, { kind: "component", type: i4.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: i9.PepSearchComponent, selector: "pep-search", inputs: ["triggerOn", "autoCompleteTop", "autoCompleteValues", "shrink", "value", "searchControl", "useAsWebComponent", "sizeType"], outputs: ["search", "autocompleteChange", "stateChange"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepMultiSelectFilterComponent, decorators: [{
1127
+ type: Component,
1128
+ args: [{ selector: 'pep-multi-select-filter', template: "<ng-container *ngIf=\"inline\">\n <ng-container *ngIf=\"variableFieldOptions?.length\">\n <div fxLayout=\"row\" fxLayoutGap=\".5rem\">\n <pep-select [fxFlex]=\"operatorWidth\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.EqualsToVariable || \n operator === PepSmartFilterVariableOperators.NotEqualsToVariable || \n operator === PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onValueChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterVariableOperators.EqualsToVariable && \n operator !== PepSmartFilterVariableOperators.NotEqualsToVariable &&\n operator !== PepSmartFilterVariableOperators.InVariable\">\n <pep-select [fxFlex]=\"valueWidth\" [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\"\n [value]=\"selected\" [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n </div>\n </ng-container>\n <ng-container *ngIf=\"!variableFieldOptions || !variableFieldOptions.length\">\n <pep-select [label]=\"'Pepperi Multi Select'\" [type]=\"'multi'\" [value]=\"selected\"\n [xAlignment]=\"'left'\" [renderTitle]=\"renderTitle\" [options]='inlineOptions'\n (valueChange)=\"onMultiSelectChanged($event)\">\n </pep-select>\n </ng-container>\n</ng-container>\n<div *ngIf=\"!inline\" [formGroup]=\"form\">\n <pep-search *ngIf=\"options?.length > numberOptionsToShowSearch\" [searchControl]=\"searchControl\"\n [triggerOn]=\"'keydown'\" shrink=\"never\"></pep-search>\n <div pepRtlClass class=\"multi-select-options pep-border-top pep-border-bottom\"\n [ngClass]=\"{'with-no-search': options?.length <= numberOptionsToShowSearch}\">\n <div #optionsContainer class=\"flip-scroll\" pepRtlClass>\n <virtual-scroller #scroll [items]=\"filteredOptions$ | async\" [parentScroll]=\"optionsContainer\">\n <mat-checkbox *ngFor=\"let opt of scroll.viewPortItems\"\n class=\"pep-checkbox-container pep-input no-default-background md\" [title]=\"opt.value\"\n [checked]=\"opt.selected\" (change)=\"onOptionChange(opt, $event)\">\n <div class=\"title\">\n <span class=\"body-sm ellipsis\">{{ opt.value }}</span>\n <span *ngIf=\"opt.count\" class=\"color-dimmed body-xs ellipsis\">({{opt.count}})</span>\n </div>\n </mat-checkbox>\n <ng-container *ngIf=\"scroll.viewPortItems?.length === 0\">\n <span class=\"no-options body-sm ellipsis\" [title]=\"field.name\">\n {{ ( options.length > 0 ? \"SMART_FILTERS.NO_SEARCH_RESULTS\" : \"SMART_FILTERS.NO_OPTIONS\") |\n translate }}\n </span>\n </ng-container>\n </virtual-scroller>\n </div>\n </div>\n</div>", styles: [".multi-select-options{margin:var(--pep-spacing-sm, .5rem) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options.with-no-search{margin:calc(var(--pep-spacing-sm, .5rem) * -1) calc(var(--pep-spacing-xs, .25rem) * -1) 0}.multi-select-options .no-options{display:flex;padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-md, .75rem)}.multi-select-options .flip-scroll{padding:var(--pep-spacing-sm, .5rem) var(--pep-spacing-xs, .25rem);min-height:3.25rem;max-height:34.75rem;direction:rtl}.multi-select-options .flip-scroll virtual-scroller{direction:ltr}.multi-select-options .flip-scroll.rtl{direction:ltr}.multi-select-options .flip-scroll.rtl virtual-scroller{direction:rtl}.multi-select-options .pep-checkbox-container{height:2.25rem;padding-inline-end:0}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout{width:100%;height:100%;grid-template-columns:auto 1fr}.multi-select-options .pep-checkbox-container ::ng-deep .mat-checkbox-layout .mat-checkbox-label{align-self:center}.multi-select-options .pep-checkbox-container .title{display:grid;grid-auto-flow:column;justify-content:space-between;align-items:center;margin:0 var(--pep-spacing-xs, .25rem)}\n"] }]
1129
+ }], propDecorators: { optionsContainer: [{
1130
+ type: ViewChild,
1131
+ args: ['optionsContainer']
1132
+ }], virtualScroller: [{
1133
+ type: ViewChild,
1134
+ args: [VirtualScrollerComponent]
1135
+ }] } });
1136
+
1137
+ class PepNumberFilterComponent extends BaseFilterComponent {
1138
+ constructor() {
1139
+ super(...arguments);
1140
+ this.PepSmartFilterOperators = PepSmartFilterOperators;
1141
+ this.PepSmartFilterVariableOperators = PepSmartFilterVariableOperators;
1142
+ this.chooseTypeOptions = [];
1143
+ this.operatorWidth = '38%';
1144
+ this.fieldsWidth = '70%';
1145
+ }
1146
+ ngOnInit() {
1147
+ this.firstControl.valueChanges
1148
+ // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1149
+ // .pipe(this.getDestroyer(), distinctUntilChanged((pre: any, curr: any) =>
1150
+ // this.utilitiesService.isEqualNumber(pre, curr)
1151
+ // ))
1152
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1153
+ .subscribe(() => {
1154
+ console.log(`firstControl.valueChanges - ${this.firstControl.value}`);
1155
+ this.setFieldsStateAndValidators();
1156
+ });
1157
+ this.secondControl.valueChanges
1158
+ .pipe(this.getDestroyer(), distinctUntilChanged())
1159
+ // .pipe(debounceTime(3000), this.getDestroyer(), distinctUntilChanged())
1160
+ .subscribe(() => {
1161
+ this.setFieldsStateAndValidators();
1162
+ });
1163
+ this.setControlsWidth();
1164
+ }
1165
+ // Override
1166
+ getDefaultOperator() {
1167
+ return PepSmartFilterOperators.Equals;
1168
+ }
1169
+ // Override
1170
+ getFilterValue() {
1171
+ const filterValue = {
1172
+ first: this.firstControl.value,
1173
+ };
1174
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1175
+ filterValue['second'] = this.secondControl.value;
1176
+ }
1177
+ return filterValue;
1178
+ }
1179
+ // Override
1180
+ initFilter() {
1181
+ setTimeout(() => {
1182
+ if (this.emitOnChange) {
1183
+ this.applyFilter();
1184
+ }
1185
+ }, 0);
1186
+ }
1187
+ // Override
1188
+ loadOperatorsOptions() {
1189
+ this.chooseTypeOptions = this.operators.map((operator) => {
1190
+ return {
1191
+ key: operator.id,
1192
+ value: this.translate.instant(`${this.OPERATORS_TRANSLATION_PREFIX}.${operator.name}`),
1193
+ };
1194
+ });
1195
+ }
1196
+ // Override
1197
+ setFieldsStateAndValidators() {
1198
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1199
+ const firstValidators = [Validators.required];
1200
+ if (this.secondControl.value) {
1201
+ firstValidators.push(this.validator.isLessThan(this.secondControl));
1202
+ }
1203
+ this.firstControl.setValidators(firstValidators);
1204
+ this.firstControl.updateValueAndValidity();
1205
+ this.secondControl.enable();
1206
+ const secondValidators = [Validators.required];
1207
+ if (this.firstControl.value) {
1208
+ secondValidators.push(this.validator.isGreaterThan(this.firstControl));
1209
+ }
1210
+ this.secondControl.setValidators(secondValidators);
1211
+ this.secondControl.updateValueAndValidity();
1212
+ }
1213
+ else {
1214
+ super.setFieldsStateAndValidators();
1215
+ }
1216
+ }
1217
+ setControlsWidth() {
1218
+ if (this.operator === PepSmartFilterOperators.NumberRange) {
1219
+ this.operatorWidth = '30%';
1220
+ this.fieldsWidth = '70%';
1221
+ }
1222
+ else {
1223
+ this.operatorWidth = '38%';
1224
+ this.fieldsWidth = '62%';
1225
+ }
1226
+ }
1227
+ onOperatorChanged(value) {
1228
+ const operator = Object.values(this.operators).find((operator) => operator.id === value);
1229
+ this.operator = operator;
1230
+ if (this._parentForm) {
1231
+ this.updateParentForm();
1232
+ }
1233
+ this.setControlsWidth();
1234
+ setTimeout(() => {
1235
+ if (this.emitOnChange) {
1236
+ this.applyFilter();
1237
+ }
1238
+ }, 0);
1239
+ }
1240
+ onVariableChanged(value) {
1241
+ this.firstControl.setValue(value);
1242
+ if (this.emitOnChange) {
1243
+ this.applyFilter();
1244
+ }
1245
+ }
1246
+ onValueChanged() {
1247
+ // this.firstControl.setValue(value);
1248
+ // console.log(`onValueChanged ${this.firstControl.value}`);
1249
+ if (this.emitOnChange) {
1250
+ this.applyFilter();
1251
+ }
1252
+ }
1253
+ }
1254
+ PepNumberFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1255
+ PepNumberFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepNumberFilterComponent, selector: "pep-number-filter", usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [value]=\"firstControl?.value || ''\" \n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { 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: i4.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: i5.PepTextboxComponent, selector: "pep-textbox", inputs: ["key", "value", "minFractionDigits", "maxFractionDigits", "accessory", "label", "placeholder", "type", "mandatory", "disabled", "readonly", "maxFieldCharacters", "hint", "textColor", "xAlignment", "rowSpan", "minValue", "maxValue", "visible", "form", "isActive", "showTitle", "renderTitle", "renderError", "renderSymbol", "layoutType", "parentFieldKey", "regex", "regexError", "isInFocus"], outputs: ["valueChange", "keyup"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] });
1256
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepNumberFilterComponent, decorators: [{
1257
+ type: Component,
1258
+ args: [{ selector: 'pep-number-filter', template: "<div [formGroup]=\"form\" [fxLayout]=\"inline ? 'row' : 'column'\" [fxLayoutGap]=\"inline ? '.5rem' : '0rem'\">\n <ng-container>\n <pep-select [fxFlex]=\"inline ? operatorWidth : null\" [key]=\"'typeOperator'\" [value]=\"operator.id\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"chooseTypeOptions\" (valueChange)=\"onOperatorChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterOperators.NumberRange\">\n <div fxLayout=\"row\" fxLayout.xs=\"column\" [fxLayoutGap]=\"inline ? '.5rem' : '1rem'\"\n [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Min number -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.MIN' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [value]=\"firstControl?.value || ''\"\n [maxValue]=\"secondControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n <!-- Max number -->\n <pep-textbox [form]=\"form\" [key]=\"secondControlKey\" [label]=\"'SMART_FILTERS.MAX' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\" fxFlex=\"50%\"\n [value]=\"secondControl?.value || ''\"\n [minValue]=\"firstControl?.value || ''\" (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n <ng-container *ngIf=\"operator === PepSmartFilterVariableOperators.LessThanVariable || \n operator === PepSmartFilterVariableOperators.GreaterThanVariable || \n operator === PepSmartFilterVariableOperators.EqualsToVariable\">\n <pep-select [fxFlex]=\"inline ? fieldsWidth : null\" [key]=\"firstControlKey\" [value]=\"firstControl?.value || ''\"\n [label]=\"'SMART_FILTERS.TYPE' | translate\" [renderTitle]=\"renderTitle\" [emptyOption]=\"false\"\n [options]=\"variableFieldOptions\" (valueChange)=\"onVariableChanged($event)\">\n </pep-select>\n </ng-container>\n <ng-container *ngIf=\"operator !== PepSmartFilterOperators.NumberRange && operator !== PepSmartFilterVariableOperators.LessThanVariable &&\n operator !== PepSmartFilterVariableOperators.GreaterThanVariable && \n operator !== PepSmartFilterVariableOperators.EqualsToVariable\">\n <div [fxFlex]=\"inline ? fieldsWidth : null\">\n <!-- Amount -->\n <pep-textbox [form]=\"form\" [key]=\"firstControlKey\" [label]=\"'SMART_FILTERS.AMOUNT' | translate\"\n [renderError]=\"false\" [renderTitle]=\"renderTitle\" [type]=\"field.type\"\n [value]=\"firstControl?.value || ''\" \n (valueChange)=\"onValueChanged()\">\n </pep-textbox>\n </div>\n </ng-container>\n</div>" }]
1259
+ }] });
1260
+
1261
+ class PepSmartFiltersComponent {
1262
+ constructor(hostElement, layoutService) {
1263
+ this.hostElement = hostElement;
1264
+ this.layoutService = layoutService;
1265
+ this.title = '';
1266
+ this.filtersDataMap = new Map();
1267
+ this._filters = [];
1268
+ this._fields = [];
1269
+ this._useAsWebComponent = false;
1270
+ // @Output()
1271
+ // filtersClear: EventEmitter<void> = new EventEmitter<void>();
1272
+ this.filtersChange = new EventEmitter();
1273
+ this.fieldToggleChange = new EventEmitter();
1274
+ this.expansionPanelHeaderHeight = '*';
1275
+ }
1276
+ set filters(value) {
1277
+ this._filters = value;
1278
+ this.setupFilters(value);
1279
+ }
1280
+ get filters() {
1281
+ this._filters = [...this.filtersDataMap.keys()]
1282
+ // .filter((key) => this.filtersDataMap.get(key) !== null)
1283
+ .map((key) => {
1284
+ if (key) {
1285
+ return this.filtersDataMap.get(key);
1286
+ }
1287
+ });
1288
+ return this._filters;
1289
+ }
1290
+ set fields(value) {
1291
+ this._fields = value;
1292
+ }
1293
+ get fields() {
1294
+ return this._fields;
1295
+ }
1296
+ set useAsWebComponent(value) {
1297
+ if (value) {
1298
+ this.exportFunctionsOnHostElement();
1299
+ }
1300
+ }
1301
+ get useAsWebComponent() {
1302
+ return this._useAsWebComponent;
1303
+ }
1304
+ exportFunctionsOnHostElement() {
1305
+ // This is for web component usage for use those functions.
1306
+ this.hostElement.nativeElement.clearFilters = this.clearFilters.bind(this);
1307
+ this.hostElement.nativeElement.clearFilter = this.clearFilter.bind(this);
1308
+ this.hostElement.nativeElement.toggleField = this.toggleField.bind(this);
1309
+ }
1310
+ setupFilters(value) {
1311
+ this.filtersDataMap.clear();
1312
+ if (value) {
1313
+ value.forEach((filter) => {
1314
+ // Validate before add the filter into the map.
1315
+ let currentField = null;
1316
+ if (this.fields && this.fields.length > 0) {
1317
+ currentField = this.fields.find((field) => field.id === filter.fieldId);
1318
+ }
1319
+ if (currentField) {
1320
+ // Only if the operator is from the same type
1321
+ if (filter.operator.componentType.includes(currentField.componentType)) {
1322
+ let isOperatorUnitValid = true;
1323
+ if (filter.operatorUnit) {
1324
+ // Only if the operator unit is not from the same type
1325
+ if (!filter.operatorUnit.componentType.includes(currentField.componentType)) {
1326
+ isOperatorUnitValid = false;
1327
+ }
1328
+ }
1329
+ // Add the filter.
1330
+ if (isOperatorUnitValid) {
1331
+ this.filtersDataMap.set(filter.fieldId, filter);
1332
+ }
1333
+ }
1334
+ }
1335
+ });
1336
+ }
1337
+ }
1338
+ raiseFiltersChange() {
1339
+ this.filtersChange.emit(this.filters);
1340
+ }
1341
+ toggleField(index, isOpen) {
1342
+ this.fields[index].isOpen = isOpen;
1343
+ this.fieldToggleChange.emit(this.fields[index]);
1344
+ }
1345
+ clearFilters() {
1346
+ this.filtersDataMap.clear();
1347
+ }
1348
+ clearFilter(fieldId) {
1349
+ this.filtersDataMap.delete(fieldId);
1350
+ }
1351
+ // Clear all the filters and raise event that filters has change.
1352
+ onFiltersClear() {
1353
+ this.clearFilters();
1354
+ this.raiseFiltersChange();
1355
+ }
1356
+ // Clear the filter and raise event that filters has change.
1357
+ onFilterClear(field) {
1358
+ this.clearFilter(field.id);
1359
+ this.raiseFiltersChange();
1360
+ }
1361
+ // Set the filter and raise event that filters has change.
1362
+ onFilterChange(field, filterData) {
1363
+ this.clearFilter(field.id);
1364
+ this.filtersDataMap.set(field.id, filterData);
1365
+ this.raiseFiltersChange();
1366
+ }
1367
+ }
1368
+ PepSmartFiltersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, deps: [{ token: i0.ElementRef }, { token: i3.PepLayoutService }], target: i0.ɵɵFactoryTarget.Component });
1369
+ PepSmartFiltersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: PepSmartFiltersComponent, selector: "pep-smart-filters", inputs: { title: "title", filters: "filters", fields: "fields", useAsWebComponent: "useAsWebComponent" }, outputs: { filtersChange: "filtersChange", fieldToggleChange: "fieldToggleChange" }, ngImport: i0, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3$2.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "directive", type: i4$3.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i5$3.MatAccordion, selector: "mat-accordion", inputs: ["multi", "hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i5$3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5$3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i5$3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "component", type: i6$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$1.PepIconComponent, selector: "pep-icon", inputs: ["spin", "name", "fill"] }, { kind: "component", type: PepTextFilterComponent, selector: "pep-text-filter" }, { kind: "component", type: PepBooleanFilterComponent, selector: "pep-boolean-filter", inputs: ["options"] }, { kind: "component", type: PepDateFilterComponent, selector: "pep-date-filter" }, { kind: "component", type: PepMultiSelectFilterComponent, selector: "pep-multi-select-filter" }, { kind: "component", type: PepNumberFilterComponent, selector: "pep-number-filter" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1370
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersComponent, decorators: [{
1371
+ type: Component,
1372
+ args: [{ selector: 'pep-smart-filters', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"smart-filters-container\" dir=\"{{ layoutService.isRtl() ? 'rtl' : 'ltr' }}\">\n <div *ngIf=\"fields?.length > 0\" class=\"title\">\n <span class=\"body-md bold\">{{ title?.length > 0 ? title : (\"SMART_FILTERS.TITLE\" | translate)}}</span>\n <mat-chip *ngIf=\"filtersDataMap.size > 0\" [selectable]=\"false\" [removable]=\"true\" (click)=\"onFiltersClear()\"\n class=\"clear-filter pep-button chip xs weak\">\n <span class=\"body-xs ellipsis \">\n {{ \"ACTIONS.CLEAR\" | translate}}\n </span>\n </mat-chip>\n </div>\n\n <mat-accordion [displayMode]=\"'flat'\" [multi]=\"true\" class=\"pep-accordion2\">\n <mat-expansion-panel *ngFor=\"let field of fields; let i = index\" hideToggle=\"true\" [expanded]=\"field.isOpen\"\n (opened)=\"toggleField(i, true)\" (closed)=\"toggleField(i, false)\">\n <mat-expansion-panel-header [collapsedHeight]=\"expansionPanelHeaderHeight\"\n [expandedHeight]=\"expansionPanelHeaderHeight\">\n <mat-panel-title class=\"pep-spacing-element-negative\">\n <div class=\"smart-filter-title-container\">\n <mat-icon class=\"pep-spacing-element\">\n <pep-icon [name]=\"field.isOpen ? 'number_minus' : 'number_plus'\"></pep-icon>\n </mat-icon>\n <span class=\"body-sm ellipsis\" [title]=\"field.name\">\n {{ field.name }}\n </span>\n <mat-chip *ngIf=\"filtersDataMap.get(field.id)\" [selectable]=\"false\" [removable]=\"true\"\n (click)=\"onFilterClear(field)\" class=\"clear-filter pep-button chip xs weak\">\n <span *ngIf=\"field.componentType === 'multi-select'\" class=\"body-xs pep-spacing-element\">\n {{ filtersDataMap.get(field.id).value?.first?.length }}\n <!-- {{ field.componentType === 'multi-select' ?\n filtersDataMap.get(field.id).value?.first?.length : 1 }} -->\n </span>\n <mat-icon>\n <pep-icon name=\"system_close\"></pep-icon>\n </mat-icon>\n </mat-chip>\n </div>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"expansion-content smart-filter-content\">\n <ng-container [ngSwitch]=\"field.componentType\">\n <ng-container *ngSwitchCase=\"'boolean'\">\n <pep-boolean-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-boolean-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'date'\">\n <pep-date-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-date-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'multi-select'\">\n <pep-multi-select-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-multi-select-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'number'\">\n <pep-number-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-number-filter>\n </ng-container>\n <ng-container *ngSwitchCase=\"'text'\">\n <pep-text-filter [field]=\"field\" [filter]=\"filtersDataMap.get(field.id)\"\n (filterChange)=\"onFilterChange(field, $event)\" (filterClear)=\"onFilterClear(field)\">\n </pep-text-filter>\n </ng-container>\n <!-- <div *ngSwitchDefault>\n </div> -->\n </ng-container>\n </div>\n </mat-expansion-panel>\n </mat-accordion>\n</div>", styles: [".smart-filters-container .title{height:calc(var(--pep-top-bar-spacing-bottom, .5rem) + var(--pep-top-bar-field-height, 2.5rem));display:flex;flex-flow:wrap;align-items:center;justify-content:space-between}.smart-filters-container .title .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:0 var(--pep-spacing-xs, .25rem);padding:0 var(--pep-spacing-md, .75rem)}.smart-filters-container .title .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container{display:grid;grid-auto-flow:column;grid-template-columns:auto 1fr auto;width:100%}.smart-filters-container .smart-filter-title-container>*{align-self:center}.smart-filters-container .smart-filter-title-container .clear-filter{display:flex;flex-direction:row;align-items:center;justify-content:center;margin-inline-end:var(--pep-spacing-sm, .5rem)}.smart-filters-container .smart-filter-title-container .clear-filter:after{background-color:transparent}.smart-filters-container .smart-filter-title-container .mat-icon pep-icon{height:.75rem;width:.75rem}\n", ".smart-filters-container .clear-filter.weak{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.12)}.smart-filters-container .clear-filter.weak:hover{background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.16)}.smart-filters-container .clear-filter.weak:focus{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative;box-shadow:0 0 0 var(--pep-spacing-xs, .25rem) hsla(var(--pep-color-text-link-h, 207),var(--pep-color-text-link-s, 76%),var(--pep-color-text-link-l, 37%),.5)}.smart-filters-container .clear-filter.weak:focus:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:focus:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:active{box-shadow:var(--pep-shadow-xs-offset, 0 .125rem .25rem 0) hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.08);position:relative}.smart-filters-container .clear-filter.weak:active:not(.keep-background-on-focus){background:hsl(var(--pep-color-system-primary-invert-h, 255),var(--pep-color-system-primary-invert-s, 100%),var(--pep-color-system-primary-invert-l, 100%))}.smart-filters-container .clear-filter.weak:active:after{z-index:0;content:\"\";transition:all .25s;display:block;position:absolute;inset:0;border-radius:inherit;border:1px solid hsl(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%))}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled){box-shadow:unset;border:unset;color:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)!important;background:hsla(var(--pep-color-weak-h, 0),var(--pep-color-weak-s, 0%),var(--pep-color-weak-l, 10%),.04)!important}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled):after{border:unset}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon{fill:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}.smart-filters-container .clear-filter.weak:disabled:not(.ignore-disabled) .svg-icon.stroke{fill:unset;stroke:hsla(var(--pep-color-system-primary-h, 0),var(--pep-color-system-primary-s, 0%),var(--pep-color-system-primary-l, 10%),.35)}\n"] }]
1373
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i3.PepLayoutService }]; }, propDecorators: { title: [{
1374
+ type: Input
1375
+ }], filters: [{
1376
+ type: Input
1377
+ }], fields: [{
1378
+ type: Input
1379
+ }], useAsWebComponent: [{
1380
+ type: Input
1381
+ }], filtersChange: [{
1382
+ type: Output
1383
+ }], fieldToggleChange: [{
1384
+ type: Output
1385
+ }] } });
1386
+
1387
+ class PepSmartFiltersModule {
1388
+ constructor(pepIconRegistry) {
1389
+ this.pepIconRegistry = pepIconRegistry;
1390
+ this.pepIconRegistry.registerIcons([
1391
+ pepIconNumberMinus,
1392
+ pepIconNumberPlus,
1393
+ ]);
1394
+ }
1395
+ }
1396
+ PepSmartFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, deps: [{ token: i1$1.PepIconRegistry }], target: i0.ɵɵFactoryTarget.NgModule });
1397
+ PepSmartFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, declarations: [
1398
+ // BaseFilterComponent,
1399
+ PepSmartFiltersComponent,
1400
+ PepFilterActionsComponent,
1401
+ PepTextFilterComponent,
1402
+ PepBooleanFilterComponent,
1403
+ PepDateFilterComponent,
1404
+ PepMultiSelectFilterComponent,
1405
+ PepNumberFilterComponent
1406
+ ], imports: [CommonModule,
1407
+ ReactiveFormsModule,
1408
+ FlexLayoutModule,
1409
+ // Material modules
1410
+ MatCommonModule,
1411
+ MatCheckboxModule,
1412
+ MatChipsModule,
1413
+ MatExpansionModule,
1414
+ MatIconModule,
1415
+ MatFormFieldModule,
1416
+ MatInputModule,
1417
+ MatRadioModule,
1418
+ // External modules
1419
+ VirtualScrollerModule,
1420
+ // ngx-lib modules
1421
+ PepNgxLibModule,
1422
+ PepCheckboxModule,
1423
+ PepDateModule,
1424
+ PepSelectModule,
1425
+ PepTextboxModule,
1426
+ PepSearchModule,
1427
+ PepIconModule,
1428
+ PepButtonModule,
1429
+ PepGroupButtonsModule], exports: [PepSmartFiltersComponent,
1430
+ PepTextFilterComponent,
1431
+ PepBooleanFilterComponent,
1432
+ PepDateFilterComponent,
1433
+ PepMultiSelectFilterComponent,
1434
+ PepNumberFilterComponent] });
1435
+ PepSmartFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, providers: [
1436
+ FormBuilder
1437
+ ], imports: [CommonModule,
1438
+ ReactiveFormsModule,
1439
+ FlexLayoutModule,
1440
+ // Material modules
1441
+ MatCommonModule,
1442
+ MatCheckboxModule,
1443
+ MatChipsModule,
1444
+ MatExpansionModule,
1445
+ MatIconModule,
1446
+ MatFormFieldModule,
1447
+ MatInputModule,
1448
+ MatRadioModule,
1449
+ // External modules
1450
+ VirtualScrollerModule,
1451
+ // ngx-lib modules
1452
+ PepNgxLibModule,
1453
+ PepCheckboxModule,
1454
+ PepDateModule,
1455
+ PepSelectModule,
1456
+ PepTextboxModule,
1457
+ PepSearchModule,
1458
+ PepIconModule,
1459
+ PepButtonModule,
1460
+ PepGroupButtonsModule] });
1461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: PepSmartFiltersModule, decorators: [{
1462
+ type: NgModule,
1463
+ args: [{
1464
+ imports: [
1465
+ CommonModule,
1466
+ ReactiveFormsModule,
1467
+ FlexLayoutModule,
1468
+ // Material modules
1469
+ MatCommonModule,
1470
+ MatCheckboxModule,
1471
+ MatChipsModule,
1472
+ MatExpansionModule,
1473
+ MatIconModule,
1474
+ MatFormFieldModule,
1475
+ MatInputModule,
1476
+ MatRadioModule,
1477
+ // External modules
1478
+ VirtualScrollerModule,
1479
+ // ngx-lib modules
1480
+ PepNgxLibModule,
1481
+ PepCheckboxModule,
1482
+ PepDateModule,
1483
+ PepSelectModule,
1484
+ PepTextboxModule,
1485
+ PepSearchModule,
1486
+ PepIconModule,
1487
+ PepButtonModule,
1488
+ PepGroupButtonsModule
1489
+ ],
1490
+ exports: [
1491
+ PepSmartFiltersComponent,
1492
+ PepTextFilterComponent,
1493
+ PepBooleanFilterComponent,
1494
+ PepDateFilterComponent,
1495
+ PepMultiSelectFilterComponent,
1496
+ PepNumberFilterComponent
1497
+ ],
1498
+ declarations: [
1499
+ // BaseFilterComponent,
1500
+ PepSmartFiltersComponent,
1501
+ PepFilterActionsComponent,
1502
+ PepTextFilterComponent,
1503
+ PepBooleanFilterComponent,
1504
+ PepDateFilterComponent,
1505
+ PepMultiSelectFilterComponent,
1506
+ PepNumberFilterComponent
1507
+ ],
1508
+ providers: [
1509
+ FormBuilder
1510
+ ]
1511
+ }]
1512
+ }], ctorParameters: function () { return [{ type: i1$1.PepIconRegistry }]; } });
1513
+
1514
+ // Base field
1515
+ // ------------------------------
1516
+ class PepSmartFilterBaseField {
1517
+ constructor(field) {
1518
+ this.id = field.id;
1519
+ this.name = field.name;
1520
+ this.isOpen = field.isOpen;
1521
+ this.options = field.options;
1522
+ this.operators = field.operators;
1523
+ this.operatorUnits = field.operatorUnits;
1524
+ this._type = this.getType();
1525
+ }
1526
+ get componentType() {
1527
+ return this._componentType;
1528
+ }
1529
+ get type() {
1530
+ return this._type;
1531
+ }
1532
+ }
1533
+ // Text field
1534
+ // ------------------------------
1535
+ class PepSmartFilterTextField extends PepSmartFilterBaseField {
1536
+ constructor(field) {
1537
+ super(field);
1538
+ this._componentType = 'text';
1539
+ }
1540
+ getType() {
1541
+ return 'text';
1542
+ }
1543
+ }
1544
+ // Boolean field
1545
+ // ------------------------------
1546
+ class PepSmartFilterBooleanField extends PepSmartFilterBaseField {
1547
+ constructor(field) {
1548
+ super(field);
1549
+ this._componentType = 'boolean';
1550
+ }
1551
+ getType() {
1552
+ return 'boolean';
1553
+ }
1554
+ }
1555
+ // Date fields
1556
+ // ------------------------------
1557
+ class PepSmartFilterDateBaseField extends PepSmartFilterBaseField {
1558
+ constructor(field) {
1559
+ super(field);
1560
+ this._componentType = 'date';
1561
+ }
1562
+ }
1563
+ class PepSmartFilterDateField extends PepSmartFilterDateBaseField {
1564
+ constructor(field) {
1565
+ super(field);
1566
+ }
1567
+ getType() {
1568
+ return 'date';
1569
+ }
1570
+ }
1571
+ class PepSmartFilterDateTimeField extends PepSmartFilterDateBaseField {
1572
+ constructor(field) {
1573
+ super(field);
1574
+ }
1575
+ getType() {
1576
+ return 'date-time';
1577
+ }
1578
+ }
1579
+ // Multi select field
1580
+ // ------------------------------
1581
+ class PepSmartFilterMultiSelectField extends PepSmartFilterBaseField {
1582
+ constructor(field) {
1583
+ super(field);
1584
+ this._componentType = 'multi-select';
1585
+ }
1586
+ getType() {
1587
+ return 'multi-select';
1588
+ }
1589
+ }
1590
+ // Number fields
1591
+ // ------------------------------
1592
+ class PepSmartFilterNumberBaseField extends PepSmartFilterBaseField {
1593
+ constructor(field) {
1594
+ super(field);
1595
+ this._componentType = 'number';
1596
+ }
1597
+ }
1598
+ class PepSmartFilterIntField extends PepSmartFilterNumberBaseField {
1599
+ constructor(field) {
1600
+ super(field);
1601
+ }
1602
+ getType() {
1603
+ return 'int';
1604
+ }
1605
+ }
1606
+ class PepSmartFilterRealField extends PepSmartFilterNumberBaseField {
1607
+ constructor(field) {
1608
+ super(field);
1609
+ }
1610
+ getType() {
1611
+ return 'real';
1612
+ }
1613
+ }
1614
+ class PepSmartFilterCurrencyField extends PepSmartFilterNumberBaseField {
1615
+ constructor(field) {
1616
+ super(field);
1617
+ }
1618
+ getType() {
1619
+ return 'currency';
1620
+ }
1621
+ }
1622
+ class PepSmartFilterPercentageField extends PepSmartFilterNumberBaseField {
1623
+ constructor(field) {
1624
+ super(field);
1625
+ }
1626
+ getType() {
1627
+ return 'percentage';
1628
+ }
1629
+ }
1630
+
1631
+ function createTextSmartFilterField(data) {
1632
+ return new PepSmartFilterTextField(data);
1633
+ }
1634
+ function createBooleanSmartFilterField(data) {
1635
+ return new PepSmartFilterBooleanField(data);
1636
+ }
1637
+ function createDateSmartFilterField(data) {
1638
+ return new PepSmartFilterDateField(data);
1639
+ }
1640
+ function createDateTimeSmartFilterField(data) {
1641
+ return new PepSmartFilterDateTimeField(data);
1642
+ }
1643
+ function createMultiSelectSmartFilterField(data) {
1644
+ return new PepSmartFilterMultiSelectField(data);
1645
+ }
1646
+ function createIntSmartFilterField(data) {
1647
+ return new PepSmartFilterIntField(data);
1648
+ }
1649
+ function createRealSmartFilterField(data) {
1650
+ return new PepSmartFilterRealField(data);
1651
+ }
1652
+ function createCurrencySmartFilterField(data) {
1653
+ return new PepSmartFilterCurrencyField(data);
1654
+ }
1655
+ function createPercentageSmartFilterField(data) {
1656
+ return new PepSmartFilterPercentageField(data);
1657
+ }
1658
+ function createSmartFilterField(data, type) {
1659
+ let field;
1660
+ switch (type) {
1661
+ case 'text':
1662
+ field = createTextSmartFilterField(data);
1663
+ break;
1664
+ case 'boolean':
1665
+ field = createBooleanSmartFilterField(data);
1666
+ break;
1667
+ case 'date':
1668
+ field = createDateSmartFilterField(data);
1669
+ break;
1670
+ case 'date-time':
1671
+ field = createDateTimeSmartFilterField(data);
1672
+ break;
1673
+ case 'multi-select':
1674
+ field = createMultiSelectSmartFilterField(data);
1675
+ break;
1676
+ case 'int':
1677
+ field = createIntSmartFilterField(data);
1678
+ break;
1679
+ case 'real':
1680
+ field = createRealSmartFilterField(data);
1681
+ break;
1682
+ case 'currency':
1683
+ field = createCurrencySmartFilterField(data);
1684
+ break;
1685
+ case 'percentage':
1686
+ field = createPercentageSmartFilterField(data);
1687
+ break;
1688
+ default:
1689
+ field = createMultiSelectSmartFilterField(data);
1690
+ break;
1691
+ }
1692
+ return field;
1693
+ }
1694
+ function createSmartFilter(fieldId, operator, first, second, operatorUnit) {
1695
+ return {
1696
+ fieldId: fieldId,
1697
+ operator: operator,
1698
+ operatorUnit: operatorUnit,
1699
+ value: {
1700
+ first: first,
1701
+ second: second,
1702
+ },
1703
+ };
1704
+ }
1705
+
1706
+ /*
1707
+ * Public API Surface of ngx-lib/smart-filters
1708
+ */
1709
+
1710
+ /**
1711
+ * Generated bundle index. Do not edit.
1712
+ */
1713
+
1714
+ export { BaseFilterComponent, IPepSmartFilterOperator, IPepSmartFilterOperatorUnit, PepBooleanFilterComponent, PepDateFilterComponent, PepFilterActionsComponent, PepMultiSelectFilterComponent, PepNumberFilterComponent, PepSmartFilterAdditionalOperators, PepSmartFilterBaseField, PepSmartFilterBooleanField, PepSmartFilterCurrencyField, PepSmartFilterDateBaseField, PepSmartFilterDateField, PepSmartFilterDateTimeField, PepSmartFilterIntField, PepSmartFilterMultiSelectField, PepSmartFilterNumberBaseField, PepSmartFilterOperatorUnits, PepSmartFilterOperators, PepSmartFilterPercentageField, PepSmartFilterRealField, PepSmartFilterTextField, PepSmartFilterVariableOperators, PepSmartFiltersComponent, PepSmartFiltersModule, PepTextFilterComponent, createSmartFilter, createSmartFilterField };
1715
+ //# sourceMappingURL=pepperi-addons-ngx-lib-smart-filters.mjs.map