@blaze-cms/react-page-builder 0.124.0-alpha.4 → 0.124.0-alpha.40

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 (419) hide show
  1. package/CHANGELOG.md +320 -0
  2. package/README.md +9 -0
  3. package/example.env +1 -0
  4. package/lib/BannerContext/index.js.map +1 -1
  5. package/lib/HOC/withInfiniteScroll.js.map +1 -1
  6. package/lib/HOC/withTitle.js.map +1 -1
  7. package/lib/PBContext/index.js.map +1 -1
  8. package/lib/application/query/index.js +9 -3
  9. package/lib/application/query/index.js.map +1 -1
  10. package/lib/components/BackToTop/BackToTop.js.map +1 -1
  11. package/lib/components/Banner/AdSlotRender.js.map +1 -1
  12. package/lib/components/Banner/Banner.js.map +1 -1
  13. package/lib/components/Banner/BannerRender.js.map +1 -1
  14. package/lib/components/Banner/helpers.js.map +1 -1
  15. package/lib/components/Banner/index.js.map +1 -1
  16. package/lib/components/BlazeLink.js.map +1 -1
  17. package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
  18. package/lib/components/Button.js.map +1 -1
  19. package/lib/components/Card/Card.js.map +1 -1
  20. package/lib/components/Card/CardContainer.js +3 -7
  21. package/lib/components/Card/CardContainer.js.map +1 -1
  22. package/lib/components/Card/CardFactory.js +6 -3
  23. package/lib/components/Card/CardFactory.js.map +1 -1
  24. package/lib/components/Card/CardRender.js.map +1 -1
  25. package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
  26. package/lib/components/Card/helpers/filters-setup.js.map +1 -1
  27. package/lib/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
  28. package/lib/components/Carousel/Carousel.js.map +1 -1
  29. package/lib/components/Carousel/CarouselImage/CarouselImage.js.map +1 -1
  30. package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
  31. package/lib/components/CarouselWrapper.js +2 -2
  32. package/lib/components/CarouselWrapper.js.map +1 -1
  33. package/lib/components/ClickWrapper.js.map +1 -1
  34. package/lib/components/Code/Code.js.map +1 -1
  35. package/lib/components/Code/ScriptTag.js.map +1 -1
  36. package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
  37. package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
  38. package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
  39. package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
  40. package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
  41. package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js.map +1 -1
  42. package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
  43. package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js.map +1 -1
  44. package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
  45. package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js.map +1 -1
  46. package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
  47. package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js.map +1 -1
  48. package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
  49. package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
  50. package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
  51. package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
  52. package/lib/components/DataSummary/helpers/get-data-summary-query.js.map +1 -1
  53. package/lib/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
  54. package/lib/components/DataSummary/helpers/get-prop-value.js.map +1 -1
  55. package/lib/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
  56. package/lib/components/DataSummary/helpers/strip-summary-props-content.js.map +1 -1
  57. package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
  58. package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
  59. package/lib/components/Image/GlobalLightbox/NavButton.js.map +1 -1
  60. package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
  61. package/lib/components/Image/Image.js.map +1 -1
  62. package/lib/components/Image/ImageDetails.js.map +1 -1
  63. package/lib/components/Image/ImageFactory.js.map +1 -1
  64. package/lib/components/Image/ImageRender.js +5 -1
  65. package/lib/components/Image/ImageRender.js.map +1 -1
  66. package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
  67. package/lib/components/ItemList/ItemListButton/ItemListButton.js +161 -0
  68. package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
  69. package/lib/components/ItemList/ItemListButton/index.js +16 -0
  70. package/lib/components/ItemList/ItemListButton/index.js.map +1 -0
  71. package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +83 -0
  72. package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
  73. package/lib/components/ItemList/ItemListCounter/index.js +16 -0
  74. package/lib/components/ItemList/ItemListCounter/index.js.map +1 -0
  75. package/lib/components/ItemList/ItemListNew/ItemListNew.js +87 -0
  76. package/lib/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
  77. package/lib/components/ItemList/ItemListNew/index.js +16 -0
  78. package/lib/components/ItemList/ItemListNew/index.js.map +1 -0
  79. package/lib/components/ItemList/constants.js +19 -0
  80. package/lib/components/ItemList/constants.js.map +1 -0
  81. package/lib/components/ItemList/helpers/get-item-list-data.js +17 -0
  82. package/lib/components/ItemList/helpers/get-item-list-data.js.map +1 -0
  83. package/lib/components/ItemList/helpers/get-item-list-id.js +23 -0
  84. package/lib/components/ItemList/helpers/get-item-list-id.js.map +1 -0
  85. package/lib/components/ItemList/helpers/get-item-list-ids.js +28 -0
  86. package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
  87. package/lib/components/ItemList/helpers/index.js +50 -0
  88. package/lib/components/ItemList/helpers/index.js.map +1 -0
  89. package/lib/components/ItemList/helpers/set-item-list-id.js +22 -0
  90. package/lib/components/ItemList/helpers/set-item-list-id.js.map +1 -0
  91. package/lib/components/ItemList/helpers/set-param-and-redirect.js +51 -0
  92. package/lib/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
  93. package/lib/components/ItemList/hooks/index.js +18 -0
  94. package/lib/components/ItemList/hooks/index.js.map +1 -0
  95. package/lib/components/ItemList/hooks/use-item-list-id.js +45 -0
  96. package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -0
  97. package/lib/components/Layout/Layout.js.map +1 -1
  98. package/lib/components/Layout/helpers/check-if-row-has-columns.js.map +1 -1
  99. package/lib/components/LazyImage/LazyImage.js +5 -1
  100. package/lib/components/LazyImage/LazyImage.js.map +1 -1
  101. package/lib/components/LazyImage/index.js.map +1 -1
  102. package/lib/components/List/ListBuilder.js +12 -6
  103. package/lib/components/List/ListBuilder.js.map +1 -1
  104. package/lib/components/List/ListFactory.js +34 -7
  105. package/lib/components/List/ListFactory.js.map +1 -1
  106. package/lib/components/List/ListRender.js.map +1 -1
  107. package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js.map +1 -1
  108. package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
  109. package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
  110. package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
  111. package/lib/components/List/components/Full/FullRender.js.map +1 -1
  112. package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
  113. package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js.map +1 -1
  114. package/lib/components/List/components/Header/ListHeader.js.map +1 -1
  115. package/lib/components/List/components/Pagination/Classic.js.map +1 -1
  116. package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
  117. package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
  118. package/lib/components/List/helpers/build-az-aggregations.js.map +1 -1
  119. package/lib/components/List/helpers/build-az-url.js.map +1 -1
  120. package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
  121. package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
  122. package/lib/components/List/helpers/has-required-item-list-details.js +29 -0
  123. package/lib/components/List/helpers/has-required-item-list-details.js.map +1 -0
  124. package/lib/components/List/helpers/index.js +8 -0
  125. package/lib/components/List/helpers/index.js.map +1 -1
  126. package/lib/components/Login/LoggedInMessage.js.map +1 -1
  127. package/lib/components/Login/Login.js.map +1 -1
  128. package/lib/components/Login/LoginForm.js.map +1 -1
  129. package/lib/components/Menu/Menu.js +41 -28
  130. package/lib/components/Menu/Menu.js.map +1 -1
  131. package/lib/components/Menu/MenuContext.js +20 -0
  132. package/lib/components/Menu/MenuContext.js.map +1 -0
  133. package/lib/components/MenuItem/MenuItem.js +26 -7
  134. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  135. package/lib/components/Modal/Modal.js.map +1 -1
  136. package/lib/components/PasswordReset/PasswordReset.js.map +1 -1
  137. package/lib/components/PasswordReset/helpers/validatePassword.js.map +1 -1
  138. package/lib/components/PasswordResetRequest/PasswordResetRequest.js.map +1 -1
  139. package/lib/components/SearchContent/SearchContent.js +183 -0
  140. package/lib/components/SearchContent/SearchContent.js.map +1 -0
  141. package/lib/components/SearchContent/SearchContentItems.js +51 -0
  142. package/lib/components/SearchContent/SearchContentItems.js.map +1 -0
  143. package/lib/components/SearchContent/SearchContentResults.js +45 -0
  144. package/lib/components/SearchContent/SearchContentResults.js.map +1 -0
  145. package/lib/components/SearchContent/SearchContentToggleIcon.js +42 -0
  146. package/lib/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
  147. package/lib/components/SearchContent/index.js +2 -233
  148. package/lib/components/SearchContent/index.js.map +1 -1
  149. package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js.map +1 -1
  150. package/lib/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
  151. package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
  152. package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js.map +1 -1
  153. package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js.map +1 -1
  154. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +27 -69
  155. package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  156. package/lib/components/SearchFilter/SearchFilterContainer.js +87 -23
  157. package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  158. package/lib/components/SearchFilter/components/Checkbox.js +19 -9
  159. package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
  160. package/lib/components/SearchFilter/components/Range.js.map +1 -1
  161. package/lib/components/SearchFilter/components/Select.js +27 -11
  162. package/lib/components/SearchFilter/components/Select.js.map +1 -1
  163. package/lib/components/SearchFilter/components/TextSearch.js +1 -5
  164. package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
  165. package/lib/components/SearchFilter/constants.js +1 -1
  166. package/lib/components/SearchFilter/constants.js.map +1 -1
  167. package/lib/components/SearchFilter/helpers/build-filters-query.js +87 -0
  168. package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
  169. package/lib/components/SearchFilter/helpers/build-query.js.map +1 -1
  170. package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
  171. package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
  172. package/lib/components/SearchFilter/helpers/calculate-min-max.js.map +1 -1
  173. package/lib/components/SearchFilter/helpers/check-if-range-updated.js.map +1 -1
  174. package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
  175. package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
  176. package/lib/components/SearchFilter/helpers/get-intersected-prop.js.map +1 -1
  177. package/lib/components/SearchFilter/helpers/get-range-value.js.map +1 -1
  178. package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
  179. package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
  180. package/lib/components/SearchFilter/helpers/index.js +8 -0
  181. package/lib/components/SearchFilter/helpers/index.js.map +1 -1
  182. package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
  183. package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
  184. package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
  185. package/lib/components/SocialFollow/SFItem.js.map +1 -1
  186. package/lib/components/SocialFollow/SocialFollow.js.map +1 -1
  187. package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
  188. package/lib/components/SubMenu/SubMenu.js.map +1 -1
  189. package/lib/components/TextBlock/TextBlockRender.js.map +1 -1
  190. package/lib/components/TextBlock/index.js.map +1 -1
  191. package/lib/components/Video/Video.js.map +1 -1
  192. package/lib/components/Video/VideoModal.js.map +1 -1
  193. package/lib/components/Video/VideoRender.js.map +1 -1
  194. package/lib/components/Video/providers/Default.js.map +1 -1
  195. package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
  196. package/lib/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
  197. package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
  198. package/lib/components/Video/providers/get-provider.js.map +1 -1
  199. package/lib/components/Wrapper.js.map +1 -1
  200. package/lib/components/index.js +16 -1
  201. package/lib/components/index.js.map +1 -1
  202. package/lib/constants/index.js +3 -1
  203. package/lib/constants/index.js.map +1 -1
  204. package/lib/helpers/build-inherited-filters.js.map +1 -1
  205. package/lib/helpers/build-raw-query-base.js.map +1 -1
  206. package/lib/helpers/build-raw-query.js.map +1 -1
  207. package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
  208. package/lib/helpers/check-props-to-use.js.map +1 -1
  209. package/lib/helpers/get-entities-with-banner.js.map +1 -1
  210. package/lib/helpers/get-entity-data.js.map +1 -1
  211. package/lib/helpers/get-entity-render-props.js.map +1 -1
  212. package/lib/helpers/get-filter-props.js.map +1 -1
  213. package/lib/helpers/get-generic-props.js.map +1 -1
  214. package/lib/helpers/get-generic-render-variables.js.map +1 -1
  215. package/lib/helpers/get-image-ids.js.map +1 -1
  216. package/lib/helpers/get-parsed-prop-values.js.map +1 -1
  217. package/lib/helpers/get-prop-values.js.map +1 -1
  218. package/lib/helpers/get-query-filters.js.map +1 -1
  219. package/lib/helpers/get-query-props.js.map +1 -1
  220. package/lib/helpers/get-updated-filter-by.js.map +1 -1
  221. package/lib/helpers/inject-banner.js.map +1 -1
  222. package/lib/helpers/inject-banners-to-entities.js.map +1 -1
  223. package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
  224. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
  225. package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js.map +1 -1
  226. package/lib/helpers/inject-multiple-banners/inject-multiple-banners.js.map +1 -1
  227. package/lib/helpers/is-filter-entitys-id.js.map +1 -1
  228. package/lib/helpers/parse-TextBlock.js.map +1 -1
  229. package/lib/helpers/parse-props-to-display.js.map +1 -1
  230. package/lib/helpers/render-children.js.map +1 -1
  231. package/lib/helpers/sort-response-data.js.map +1 -1
  232. package/lib/hooks/helpers/RenderComponent.js.map +1 -1
  233. package/lib/hooks/helpers/append-gtm-classname.js +1 -0
  234. package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
  235. package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
  236. package/lib/hooks/helpers/getComponent.js.map +1 -1
  237. package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
  238. package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
  239. package/lib/hooks/helpers/insert-banners.js.map +1 -1
  240. package/lib/hooks/helpers/update-targetings.js.map +1 -1
  241. package/lib/hooks/use-banner-insertion.js.map +1 -1
  242. package/lib/hooks/use-check-mobile-screen.js.map +1 -1
  243. package/lib/hooks/use-get-entity-schema.js.map +1 -1
  244. package/lib/hooks/use-get-entity-schemas-as-obj.js.map +1 -1
  245. package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
  246. package/lib/hooks/use-get-images.js.map +1 -1
  247. package/lib/hooks/use-get-single-entity-schema.js.map +1 -1
  248. package/lib/hooks/use-page-builder.js.map +1 -1
  249. package/lib/utils/get-class-modifiers.js.map +1 -1
  250. package/lib/utils/get-image-data.js.map +1 -1
  251. package/lib-es/application/query/index.js +49 -1
  252. package/lib-es/application/query/index.js.map +1 -1
  253. package/lib-es/components/Card/CardContainer.js +3 -7
  254. package/lib-es/components/Card/CardContainer.js.map +1 -1
  255. package/lib-es/components/Card/CardFactory.js +7 -4
  256. package/lib-es/components/Card/CardFactory.js.map +1 -1
  257. package/lib-es/components/CarouselWrapper.js +2 -2
  258. package/lib-es/components/CarouselWrapper.js.map +1 -1
  259. package/lib-es/components/Image/ImageRender.js +4 -1
  260. package/lib-es/components/Image/ImageRender.js.map +1 -1
  261. package/lib-es/components/ItemList/ItemListButton/ItemListButton.js +111 -0
  262. package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
  263. package/lib-es/components/ItemList/ItemListButton/index.js +3 -0
  264. package/lib-es/components/ItemList/ItemListButton/index.js.map +1 -0
  265. package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js +60 -0
  266. package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
  267. package/lib-es/components/ItemList/ItemListCounter/index.js +3 -0
  268. package/lib-es/components/ItemList/ItemListCounter/index.js.map +1 -0
  269. package/lib-es/components/ItemList/ItemListNew/ItemListNew.js +64 -0
  270. package/lib-es/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
  271. package/lib-es/components/ItemList/ItemListNew/index.js +3 -0
  272. package/lib-es/components/ItemList/ItemListNew/index.js.map +1 -0
  273. package/lib-es/components/ItemList/constants.js +6 -0
  274. package/lib-es/components/ItemList/constants.js.map +1 -0
  275. package/lib-es/components/ItemList/helpers/get-item-list-data.js +7 -0
  276. package/lib-es/components/ItemList/helpers/get-item-list-data.js.map +1 -0
  277. package/lib-es/components/ItemList/helpers/get-item-list-id.js +11 -0
  278. package/lib-es/components/ItemList/helpers/get-item-list-id.js.map +1 -0
  279. package/lib-es/components/ItemList/helpers/get-item-list-ids.js +13 -0
  280. package/lib-es/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
  281. package/lib-es/components/ItemList/helpers/index.js +6 -0
  282. package/lib-es/components/ItemList/helpers/index.js.map +1 -0
  283. package/lib-es/components/ItemList/helpers/set-item-list-id.js +10 -0
  284. package/lib-es/components/ItemList/helpers/set-item-list-id.js.map +1 -0
  285. package/lib-es/components/ItemList/helpers/set-param-and-redirect.js +20 -0
  286. package/lib-es/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
  287. package/lib-es/components/ItemList/hooks/index.js +2 -0
  288. package/lib-es/components/ItemList/hooks/index.js.map +1 -0
  289. package/lib-es/components/ItemList/hooks/use-item-list-id.js +26 -0
  290. package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -0
  291. package/lib-es/components/LazyImage/LazyImage.js +4 -1
  292. package/lib-es/components/LazyImage/LazyImage.js.map +1 -1
  293. package/lib-es/components/List/ListBuilder.js +12 -6
  294. package/lib-es/components/List/ListBuilder.js.map +1 -1
  295. package/lib-es/components/List/ListFactory.js +33 -9
  296. package/lib-es/components/List/ListFactory.js.map +1 -1
  297. package/lib-es/components/List/helpers/has-required-item-list-details.js +20 -0
  298. package/lib-es/components/List/helpers/has-required-item-list-details.js.map +1 -0
  299. package/lib-es/components/List/helpers/index.js +1 -0
  300. package/lib-es/components/List/helpers/index.js.map +1 -1
  301. package/lib-es/components/Menu/Menu.js +54 -46
  302. package/lib-es/components/Menu/Menu.js.map +1 -1
  303. package/lib-es/components/Menu/MenuContext.js +6 -0
  304. package/lib-es/components/Menu/MenuContext.js.map +1 -0
  305. package/lib-es/components/MenuItem/MenuItem.js +24 -9
  306. package/lib-es/components/MenuItem/MenuItem.js.map +1 -1
  307. package/lib-es/components/SearchContent/SearchContent.js +129 -0
  308. package/lib-es/components/SearchContent/SearchContent.js.map +1 -0
  309. package/lib-es/components/SearchContent/SearchContentItems.js +33 -0
  310. package/lib-es/components/SearchContent/SearchContentItems.js.map +1 -0
  311. package/lib-es/components/SearchContent/SearchContentResults.js +31 -0
  312. package/lib-es/components/SearchContent/SearchContentResults.js.map +1 -0
  313. package/lib-es/components/SearchContent/SearchContentToggleIcon.js +30 -0
  314. package/lib-es/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
  315. package/lib-es/components/SearchContent/index.js +1 -172
  316. package/lib-es/components/SearchContent/index.js.map +1 -1
  317. package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
  318. package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
  319. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +21 -46
  320. package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
  321. package/lib-es/components/SearchFilter/SearchFilterContainer.js +70 -15
  322. package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
  323. package/lib-es/components/SearchFilter/components/Checkbox.js +18 -9
  324. package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
  325. package/lib-es/components/SearchFilter/components/Select.js +23 -8
  326. package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
  327. package/lib-es/components/SearchFilter/components/TextSearch.js +1 -5
  328. package/lib-es/components/SearchFilter/components/TextSearch.js.map +1 -1
  329. package/lib-es/components/SearchFilter/constants.js +1 -1
  330. package/lib-es/components/SearchFilter/constants.js.map +1 -1
  331. package/lib-es/components/SearchFilter/helpers/build-filters-query.js +54 -0
  332. package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
  333. package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
  334. package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
  335. package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
  336. package/lib-es/components/SearchFilter/helpers/index.js +2 -1
  337. package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
  338. package/lib-es/components/index.js +10 -1
  339. package/lib-es/components/index.js.map +1 -1
  340. package/lib-es/constants/index.js +2 -1
  341. package/lib-es/constants/index.js.map +1 -1
  342. package/lib-es/helpers/build-raw-query.js.map +1 -1
  343. package/lib-es/hooks/helpers/append-gtm-classname.js +1 -0
  344. package/lib-es/hooks/helpers/append-gtm-classname.js.map +1 -1
  345. package/package.json +5 -4
  346. package/src/application/query/index.js +55 -1
  347. package/src/components/Card/CardContainer.js +2 -6
  348. package/src/components/Card/CardFactory.js +5 -3
  349. package/src/components/CarouselWrapper.js +2 -2
  350. package/src/components/Image/ImageRender.js +3 -0
  351. package/src/components/ItemList/ItemListButton/ItemListButton.js +94 -0
  352. package/src/components/ItemList/ItemListButton/index.js +3 -0
  353. package/src/components/ItemList/ItemListCounter/ItemListCounter.js +52 -0
  354. package/src/components/ItemList/ItemListCounter/index.js +3 -0
  355. package/src/components/ItemList/ItemListNew/ItemListNew.js +51 -0
  356. package/src/components/ItemList/ItemListNew/index.js +3 -0
  357. package/src/components/ItemList/constants.js +5 -0
  358. package/src/components/ItemList/helpers/get-item-list-data.js +6 -0
  359. package/src/components/ItemList/helpers/get-item-list-id.js +11 -0
  360. package/src/components/ItemList/helpers/get-item-list-ids.js +10 -0
  361. package/src/components/ItemList/helpers/index.js +5 -0
  362. package/src/components/ItemList/helpers/set-item-list-id.js +9 -0
  363. package/src/components/ItemList/helpers/set-param-and-redirect.js +20 -0
  364. package/src/components/ItemList/hooks/index.js +1 -0
  365. package/src/components/ItemList/hooks/use-item-list-id.js +27 -0
  366. package/src/components/LazyImage/LazyImage.js +11 -1
  367. package/src/components/List/ListBuilder.js +10 -5
  368. package/src/components/List/ListFactory.js +48 -12
  369. package/src/components/List/helpers/has-required-item-list-details.js +14 -0
  370. package/src/components/List/helpers/index.js +1 -0
  371. package/src/components/Menu/Menu.js +61 -54
  372. package/src/components/Menu/MenuContext.js +5 -0
  373. package/src/components/MenuItem/MenuItem.js +39 -14
  374. package/src/components/SearchContent/SearchContent.js +136 -0
  375. package/src/components/SearchContent/SearchContentItems.js +28 -0
  376. package/src/components/SearchContent/SearchContentResults.js +27 -0
  377. package/src/components/SearchContent/SearchContentToggleIcon.js +27 -0
  378. package/src/components/SearchContent/index.js +1 -177
  379. package/src/components/SearchFilter/SearchFilter/FiltersList.js +30 -37
  380. package/src/components/SearchFilter/SearchFilter/SearchFilter.js +20 -28
  381. package/src/components/SearchFilter/SearchFilterContainer.js +58 -16
  382. package/src/components/SearchFilter/components/Checkbox.js +23 -8
  383. package/src/components/SearchFilter/components/Select.js +18 -11
  384. package/src/components/SearchFilter/components/TextSearch.js +1 -3
  385. package/src/components/SearchFilter/constants.js +1 -1
  386. package/src/components/SearchFilter/helpers/build-filters-query.js +40 -0
  387. package/src/components/SearchFilter/helpers/build-raw-query-stringified.js +2 -1
  388. package/src/components/SearchFilter/helpers/get-initial-filter-values.js +1 -0
  389. package/src/components/SearchFilter/helpers/index.js +3 -1
  390. package/src/components/index.js +10 -1
  391. package/src/constants/index.js +2 -0
  392. package/src/helpers/build-raw-query.js +1 -0
  393. package/src/hooks/helpers/append-gtm-classname.js +3 -0
  394. package/tests/helpers/mocks.js +4 -4
  395. package/tests/unit/src/components/ItemList/ItemListButton.test.js +175 -0
  396. package/tests/unit/src/components/ItemList/ItemListCounter.test.js +65 -0
  397. package/tests/unit/src/components/ItemList/ItemListNew.test.js +164 -0
  398. package/tests/unit/src/components/ItemList/__snapshots__/ItemListButton.test.js.snap +107 -0
  399. package/tests/unit/src/components/ItemList/__snapshots__/ItemListCounter.test.js.snap +31 -0
  400. package/tests/unit/src/components/ItemList/__snapshots__/ItemListNew.test.js.snap +27 -0
  401. package/tests/unit/src/components/ItemList/helpers/get-item-list-data.test.js +28 -0
  402. package/tests/unit/src/components/ItemList/helpers/get-item-list-id.test.js +20 -0
  403. package/tests/unit/src/components/ItemList/helpers/get-item-list-ids.test.js +19 -0
  404. package/tests/unit/src/components/ItemList/helpers/set-item-list-id.test.js +13 -0
  405. package/tests/unit/src/components/ItemList/helpers/set-param-and-redirect.test.js +30 -0
  406. package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +32 -0
  407. package/tests/unit/src/components/List/helpers/has-required-item-list-details.test.js +30 -0
  408. package/tests/unit/src/components/Menu/Menu.test.js +9 -3
  409. package/tests/unit/src/components/Menu/__snapshots__/Menu.test.js.snap +12 -11
  410. package/tests/unit/src/components/MenuItem/MenuItem.test.js +1 -1
  411. package/tests/unit/src/components/MenuItem/SubMenu.test.js +5 -1
  412. package/tests/unit/src/components/MenuItem/__snapshots__/MenuItem.test.js.snap +54 -10
  413. package/tests/unit/src/components/SearchContent/SearchContent.test.js +29 -0
  414. package/tests/unit/src/components/SearchContent/__snapshots__/SearchContent.test.js.snap +9 -0
  415. package/tests/unit/src/components/SearchFilter/SearchFilter/SearchFilter.test.js +26 -7
  416. package/tests/unit/src/components/SearchFilter/SearchFilter/__snapshots__/SearchFilter.test.js.snap +4 -0
  417. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Checkbox.test.js.snap +2 -0
  418. package/tests/unit/src/components/SearchFilter/components/__snapshots__/Select.test.js.snap +4 -0
  419. package/tests/unit/src/components/__snapshots__/index.test.js.snap +12 -0
@@ -17,13 +17,10 @@ const FiltersList = ({
17
17
 
18
18
  return filters.map(({ type, label, propsToDisplay, elementTitle, ...otherProps }, index) => {
19
19
  if (!propsToDisplay && !propsToDisplay.length) return null;
20
-
21
20
  const dynamicKey = [itemId, index].join('-');
22
21
  const isDataAvailable = !!data && Object.keys(data).length;
23
22
  const dataAggregations = isDataAvailable ? data : null;
24
23
  const areAggregationsAvailable = isDataAvailable && !!dataAggregations;
25
- const results = areAggregationsAvailable && dataAggregations[propsToDisplay[0]];
26
- const shouldDisplayFilter = results && results.buckets && results.buckets.length;
27
24
 
28
25
  switch (type) {
29
26
  case TEXT_SEARCH:
@@ -43,43 +40,39 @@ const FiltersList = ({
43
40
  );
44
41
  case CHECKBOX:
45
42
  return (
46
- !!shouldDisplayFilter && (
47
- <div
48
- key={dynamicKey}
49
- className="filter__section filter__section--search-refine filter__section--checkboxes">
50
- <Checkbox
51
- {...otherProps}
52
- data={data}
53
- prop={propsToDisplay[0]}
54
- label={label}
55
- elementTitle={elementTitle}
56
- hasUrl={hasUrl}
57
- filterValues={filterValues}
58
- updateFilterValues={updateFilterValues}
59
- shouldSearch={shouldSearch}
60
- />
61
- </div>
62
- )
43
+ <div
44
+ key={dynamicKey}
45
+ className="filter__section filter__section--search-refine filter__section--checkboxes">
46
+ <Checkbox
47
+ {...otherProps}
48
+ data={data}
49
+ prop={propsToDisplay[0]}
50
+ label={label}
51
+ elementTitle={elementTitle}
52
+ hasUrl={hasUrl}
53
+ filterValues={filterValues}
54
+ updateFilterValues={updateFilterValues}
55
+ shouldSearch={shouldSearch}
56
+ />
57
+ </div>
63
58
  );
64
59
  case SELECT:
65
60
  return (
66
- !!shouldDisplayFilter && (
67
- <div
68
- key={dynamicKey}
69
- className="filter__section filter__section--search-refine filter__section--selects">
70
- <SelectFilter
71
- {...otherProps}
72
- data={data}
73
- prop={propsToDisplay[0]}
74
- label={label}
75
- elementTitle={elementTitle}
76
- hasUrl={hasUrl}
77
- filterValues={filterValues}
78
- updateFilterValues={updateFilterValues}
79
- shouldSearch={shouldSearch}
80
- />
81
- </div>
82
- )
61
+ <div
62
+ key={dynamicKey}
63
+ className="filter__section filter__section--search-refine filter__section--selects">
64
+ <SelectFilter
65
+ {...otherProps}
66
+ data={data}
67
+ prop={propsToDisplay[0]}
68
+ label={label}
69
+ elementTitle={elementTitle}
70
+ hasUrl={hasUrl}
71
+ filterValues={filterValues}
72
+ updateFilterValues={updateFilterValues}
73
+ shouldSearch={shouldSearch}
74
+ />
75
+ </div>
83
76
  );
84
77
  case RANGE:
85
78
  return (
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect, useReducer } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classnames from 'classnames';
4
4
  import debounce from 'lodash.debounce';
@@ -14,21 +14,6 @@ import ResetDesktopForm from './ResetDesktopForm';
14
14
  import MobileFormToolbar from './MobileFormToolbar';
15
15
  import { SEARCH, REFINE, MORE_FILTERS_CLASSES } from '../constants';
16
16
 
17
- const reducer = (state, action) => {
18
- const { newValues, type, shouldSearch = true } = action;
19
-
20
- switch (type) {
21
- case 'update':
22
- return { ...state, ...newValues, shouldSearch };
23
- case 'resetSearch':
24
- return { ...state, shouldSearch: false };
25
- case 'reset':
26
- return { ...newValues, shouldSearch };
27
- default:
28
- throw new Error();
29
- }
30
- };
31
-
32
17
  const SearchFilter = ({
33
18
  searchFilterRef,
34
19
  data,
@@ -40,27 +25,33 @@ const SearchFilter = ({
40
25
  isCollapsedOnResponsive,
41
26
  displaySearchFilter,
42
27
  setDisplaySearchFilter,
43
- initialFilterValues,
44
28
  groupAfterDesktop,
45
- groupAfterMobile
29
+ groupAfterMobile,
30
+ filterValues,
31
+ setAppliedFilters
46
32
  }) => {
47
33
  const [moreFiltersMobileCollapsed, setMoreFiltersMobileCollapsed] = useState(true);
48
34
  const [moreFiltersDesktopCollapsed, setMoreFiltersDesktopCollapsed] = useState(true);
49
- const [filterValues, dispatch] = useReducer(reducer, initialFilterValues);
50
35
 
51
- const handleSubmit = debounce(newValues => {
36
+ const doSubmit = (newValues = filterValues) => {
52
37
  const newQuery = buildQuery(newValues, filters);
53
38
  handleSearch(newQuery);
39
+ setMoreFiltersDesktopCollapsed(true);
40
+ setMoreFiltersMobileCollapsed(true);
41
+ };
42
+
43
+ const handleSubmit = debounce(newValues => {
44
+ doSubmit(newValues);
54
45
  }, 200);
55
46
 
56
47
  useEffect(
57
48
  () => {
58
49
  if (filterValues.shouldSearch) {
59
50
  handleSubmit(filterValues);
60
- dispatch({ type: 'resetSearch' });
51
+ setAppliedFilters({ type: 'resetSearch' });
61
52
  }
62
53
  },
63
- [filterValues, handleSubmit]
54
+ [filterValues, handleSubmit, setAppliedFilters]
64
55
  );
65
56
 
66
57
  const formClass = classnames('filter__form filter__form--initial', {
@@ -79,12 +70,11 @@ const SearchFilter = ({
79
70
 
80
71
  const handleReset = () => {
81
72
  const newValues = getInitialFilterValues(data, filters, {});
82
-
83
- dispatch({ newValues, type: 'reset' });
73
+ setAppliedFilters({ newValues, type: 'reset' });
84
74
  };
85
75
 
86
76
  const updateFilterValues = (newValues, shouldSubmit) => {
87
- dispatch({ newValues, shouldSearch: shouldSubmit, type: 'update' });
77
+ setAppliedFilters({ newValues, shouldSearch: shouldSubmit, type: 'update' });
88
78
  };
89
79
 
90
80
  const shouldGroup = !!(groupAfterDesktop || groupAfterMobile);
@@ -99,8 +89,7 @@ const SearchFilter = ({
99
89
  id={formId}
100
90
  onSubmit={e => {
101
91
  e.preventDefault();
102
- const newQuery = buildQuery(filterValues, filters);
103
- handleSearch(newQuery);
92
+ doSubmit();
104
93
  }}>
105
94
  {displaySearchFilter && (
106
95
  <CloseMobileForm handleClose={() => setDisplaySearchFilter(false)} />
@@ -136,6 +125,7 @@ const SearchFilter = ({
136
125
 
137
126
  {!!groupAfterMobile && (
138
127
  <button
128
+ data-testId="search-filter-mobile-toggler"
139
129
  className={moreFiltersMobileTogglerClass}
140
130
  type="button"
141
131
  onClick={() => setMoreFiltersMobileCollapsed(!moreFiltersMobileCollapsed)}>
@@ -160,6 +150,7 @@ const SearchFilter = ({
160
150
 
161
151
  {!!groupAfterDesktop && (
162
152
  <button
153
+ data-testId="search-filter-desktop-toggler"
163
154
  className={moreFiltersDesktopTogglerClass}
164
155
  type="button"
165
156
  onClick={() =>
@@ -241,7 +232,8 @@ SearchFilter.propTypes = {
241
232
  isCollapsedOnResponsive: PropTypes.bool.isRequired,
242
233
  groupAfterDesktop: PropTypes.number.isRequired,
243
234
  groupAfterMobile: PropTypes.number.isRequired,
244
- initialFilterValues: PropTypes.object.isRequired
235
+ filterValues: PropTypes.object.isRequired,
236
+ setAppliedFilters: PropTypes.func.isRequired
245
237
  };
246
238
 
247
239
  export default SearchFilter;
@@ -1,4 +1,4 @@
1
- import React, { useState, useRef } from 'react';
1
+ import React, { useState, useRef, useReducer } from 'react';
2
2
  import { useRouter } from 'next/router';
3
3
  import { useQuery } from '@apollo/client';
4
4
  import PropTypes from 'prop-types';
@@ -6,11 +6,31 @@ import { parseUrl, stringify } from 'query-string';
6
6
  import SearchFilter from './SearchFilter';
7
7
  import { withTitle } from '../../HOC';
8
8
  import { getSearchPublishedContent } from '../../application/query';
9
- import { buildNewQuery, buildRawQueryStringified, getInitialFilterValues } from './helpers';
9
+ import {
10
+ buildNewQuery,
11
+ buildRawQueryStringified,
12
+ getInitialFilterValues,
13
+ buildFiltersQuery
14
+ } from './helpers';
10
15
  import { getEntityData } from '../../helpers';
11
16
  import { RAW_RESULTS, RANGE, CHECKBOX_SELECT } from './constants';
12
17
  import { SCROLL_OFFSET } from '../../constants';
13
18
 
19
+ const reducer = (state, action) => {
20
+ const { newValues, type, shouldSearch = true } = action;
21
+
22
+ switch (type) {
23
+ case 'update':
24
+ return { ...state, ...newValues, shouldSearch };
25
+ case 'resetSearch':
26
+ return { ...state, shouldSearch: false };
27
+ case 'reset':
28
+ return { ...newValues, shouldSearch };
29
+ default:
30
+ throw new Error();
31
+ }
32
+ };
33
+
14
34
  const SearchFilterContainer = ({
15
35
  entity,
16
36
  url,
@@ -18,25 +38,28 @@ const SearchFilterContainer = ({
18
38
  name,
19
39
  isCollapsedOnResponsive,
20
40
  groupAfterMobile,
21
- groupAfterDesktop
41
+ groupAfterDesktop,
42
+ filterBy,
43
+ filterByProperty,
44
+ shouldAddFilters
22
45
  }) => {
23
46
  const router = useRouter();
47
+ const { asPath } = router;
24
48
  const searchFilterRef = useRef(null);
25
49
  const [key, setKey] = useState(`filter-${name}`);
26
50
  const [displaySearchFilter, setDisplaySearchFilter] = useState(false);
27
- const hasUrl = !!url;
28
51
  const {
29
52
  url: currentUrl,
30
53
  query: { sort, sortby },
31
54
  query
32
- } = parseUrl(router.asPath);
55
+ } = parseUrl(asPath);
56
+ const [filterValues, dispatch] = useReducer(reducer, query);
57
+ const hasUrl = !!url;
58
+
33
59
  const sortValues = sort && sortby ? stringify({ sort, sortby }) : '';
34
60
  const baseQuery = sortValues ? `${currentUrl}?${sortValues}` : currentUrl;
35
61
 
36
62
  const action = getSearchPublishedContent(RAW_RESULTS);
37
-
38
- let rawQueryStringified = '';
39
-
40
63
  const checkboxSelectValues = [];
41
64
  const rangeValues = [];
42
65
 
@@ -50,21 +73,32 @@ const SearchFilterContainer = ({
50
73
 
51
74
  const { docType } = getEntityData(entity);
52
75
 
53
- rawQueryStringified = buildRawQueryStringified(checkboxSelectValues, rangeValues, docType);
76
+ const filtersQuery = shouldAddFilters
77
+ ? buildFiltersQuery(filterValues || query, filterBy, filterByProperty)
78
+ : [];
79
+
80
+ const rawQueryStringified = buildRawQueryStringified(
81
+ checkboxSelectValues,
82
+ rangeValues,
83
+ docType,
84
+ filtersQuery
85
+ );
54
86
 
55
- const { data, error, loading } = useQuery(action, {
87
+ const { data, error } = useQuery(action, {
56
88
  variables: { rawQueryStringified, limit: 0 }, // we only want aggs so limit=0 for no search results
57
89
  skip: !rawQueryStringified
58
90
  });
59
91
 
60
- if (loading) return null;
61
92
  if (error) return error.message;
62
93
  if (!filters.length) return null;
63
94
 
64
- const { searchPublishedContent: { rawResults: { aggregations: filterData = {} } = {} } = {} } =
95
+ const { searchPublishedContent: { rawResults: { aggregations: filterData } = {} } = {} } =
65
96
  data || {};
66
97
 
67
- const initialFilterValues = getInitialFilterValues(filterData, filters, query);
98
+ if (!filterValues && filterData) {
99
+ const initialFilterValues = getInitialFilterValues(filterData, filters, query);
100
+ dispatch({ newValues: initialFilterValues, shouldSearch: false, type: 'update' });
101
+ }
68
102
 
69
103
  const handleSearch = newQuery => {
70
104
  setDisplaySearchFilter(false);
@@ -93,17 +127,19 @@ const SearchFilterContainer = ({
93
127
  window.scrollTo(0, 0);
94
128
  }
95
129
  };
130
+ if (!filterValues) return '';
96
131
 
97
132
  return (
98
133
  <SearchFilter
99
134
  key={key}
135
+ setAppliedFilters={dispatch}
100
136
  searchFilterRef={searchFilterRef}
101
137
  data={filterData}
102
138
  filters={filters}
103
139
  hasUrl={hasUrl}
104
140
  entity={entity}
105
141
  handleSearch={handleSearch}
106
- initialFilterValues={initialFilterValues}
142
+ filterValues={filterValues}
107
143
  name={name}
108
144
  isCollapsedOnResponsive={isCollapsedOnResponsive}
109
145
  displaySearchFilter={displaySearchFilter}
@@ -121,7 +157,10 @@ SearchFilterContainer.propTypes = {
121
157
  name: PropTypes.string.isRequired,
122
158
  isCollapsedOnResponsive: PropTypes.bool,
123
159
  groupAfterMobile: PropTypes.number,
124
- groupAfterDesktop: PropTypes.number
160
+ groupAfterDesktop: PropTypes.number,
161
+ filterBy: PropTypes.array,
162
+ filterByProperty: PropTypes.array,
163
+ shouldAddFilters: PropTypes.bool
125
164
  };
126
165
 
127
166
  SearchFilterContainer.defaultProps = {
@@ -130,7 +169,10 @@ SearchFilterContainer.defaultProps = {
130
169
  entity: '',
131
170
  isCollapsedOnResponsive: true,
132
171
  groupAfterMobile: 0,
133
- groupAfterDesktop: 0
172
+ groupAfterDesktop: 0,
173
+ filterBy: [],
174
+ filterByProperty: [],
175
+ shouldAddFilters: false
134
176
  };
135
177
 
136
178
  export default withTitle(SearchFilterContainer);
@@ -7,8 +7,17 @@ import { withTitle } from '../../../HOC';
7
7
  import { decodeValue } from '../helpers';
8
8
  import { LIMIT_MIN, LIMIT_MAX, MORE, LESS } from '../constants';
9
9
 
10
- const Checkbox = ({ data, prop, updateFilterValues, filterValues, label, shouldSearch }) => {
10
+ const Checkbox = ({
11
+ data,
12
+ prop,
13
+ updateFilterValues,
14
+ filterValues,
15
+ label,
16
+ shouldSearch,
17
+ displayFilterCount
18
+ }) => {
11
19
  const [checkboxLimit, setCheckboxLimit] = useState(null);
20
+ if (!data[prop]) return null;
12
21
 
13
22
  const handleCheckboxOptions = () => {
14
23
  if (checkboxLimit[prop] === LIMIT_MIN) {
@@ -35,7 +44,10 @@ const Checkbox = ({ data, prop, updateFilterValues, filterValues, label, shouldS
35
44
  const multiple = [];
36
45
 
37
46
  const sortedValues = data[prop].buckets
38
- .map(({ key }) => key)
47
+ .map(({ key, doc_count: count }) => {
48
+ const optionLabel = displayFilterCount ? `${key} (${count})` : key;
49
+ return [key, optionLabel, !count];
50
+ })
39
51
  .filter(Boolean)
40
52
  .sort();
41
53
 
@@ -43,11 +55,12 @@ const Checkbox = ({ data, prop, updateFilterValues, filterValues, label, shouldS
43
55
  (value, i) =>
44
56
  i < checkboxLimit[prop] &&
45
57
  multiple.push({
46
- label: upperFirst(value),
47
- value,
58
+ label: upperFirst(value[1]),
59
+ value: value[0],
48
60
  name: prop,
49
- checked: checkboxQueryParams.includes(value),
50
- id: value
61
+ checked: checkboxQueryParams.includes(value[0]),
62
+ id: value[0],
63
+ disabled: value[2]
51
64
  })
52
65
  );
53
66
 
@@ -95,12 +108,14 @@ Checkbox.propTypes = {
95
108
  filterValues: PropTypes.object.isRequired,
96
109
  updateFilterValues: PropTypes.func.isRequired,
97
110
  shouldSearch: PropTypes.bool,
98
- label: PropTypes.string
111
+ label: PropTypes.string,
112
+ displayFilterCount: PropTypes.bool
99
113
  };
100
114
 
101
115
  Checkbox.defaultProps = {
102
116
  shouldSearch: false,
103
- label: ''
117
+ label: '',
118
+ displayFilterCount: false
104
119
  };
105
120
 
106
121
  export default withTitle(Checkbox);
@@ -11,17 +11,21 @@ const SelectFilter = ({
11
11
  updateFilterValues,
12
12
  filterValues,
13
13
  shouldSearch,
14
- displayLabelAsPlaceholder
14
+ displayLabelAsPlaceholder,
15
+ displayFilterCount
15
16
  }) => {
16
17
  const filterValue = filterValues[prop] || '';
17
-
18
- const options = data[prop].buckets
19
- .map(bucket => bucket.key)
18
+ const disabledOptions = [];
19
+ const { buckets = [] } = data[prop] || {};
20
+ const options = buckets
21
+ .map(({ key, doc_count: count }) => {
22
+ if (!count) disabledOptions.push(key);
23
+ const optionLabel = displayFilterCount ? `${key} (${count})` : key;
24
+ return [key, optionLabel];
25
+ })
20
26
  .filter(Boolean)
21
27
  .sort();
22
28
 
23
- const optionsJoined = options;
24
-
25
29
  const labelText = label || prop;
26
30
  let labelToUse = labelText;
27
31
  let defaultTextValue = DEFAULT_OPTION;
@@ -36,14 +40,14 @@ const SelectFilter = ({
36
40
  value={filterValue}
37
41
  id={prop}
38
42
  data-testid={`filter-${prop}`}
39
- options={optionsJoined}
43
+ options={options}
40
44
  defaultTextValue={defaultTextValue}
41
45
  onChange={({ value }) => {
42
46
  let valueToUse = value;
43
47
  if (value === defaultTextValue) valueToUse = '';
44
-
45
48
  updateFilterValues({ [prop]: valueToUse }, shouldSearch);
46
49
  }}
50
+ disabled={disabledOptions}
47
51
  />
48
52
  );
49
53
  };
@@ -51,17 +55,20 @@ const SelectFilter = ({
51
55
  SelectFilter.propTypes = {
52
56
  data: PropTypes.object.isRequired,
53
57
  prop: PropTypes.string.isRequired,
54
- filterValues: PropTypes.object.isRequired,
58
+ filterValues: PropTypes.object,
55
59
  updateFilterValues: PropTypes.func.isRequired,
56
60
  shouldSearch: PropTypes.bool,
57
61
  label: PropTypes.string,
58
- displayLabelAsPlaceholder: PropTypes.bool
62
+ displayLabelAsPlaceholder: PropTypes.bool,
63
+ displayFilterCount: PropTypes.bool
59
64
  };
60
65
 
61
66
  SelectFilter.defaultProps = {
67
+ filterValues: {},
62
68
  shouldSearch: false,
63
69
  label: '',
64
- displayLabelAsPlaceholder: false
70
+ displayLabelAsPlaceholder: false,
71
+ displayFilterCount: false
65
72
  };
66
73
 
67
74
  export default withTitle(SelectFilter);
@@ -5,7 +5,7 @@ import { MdSearch } from 'react-icons/md';
5
5
  import { withTitle } from '../../../HOC';
6
6
  import { SEARCH_TERM } from '../constants';
7
7
 
8
- const TextSearch = ({ label, searchValue, updateFilterValues, handleSubmit, filterValues }) => (
8
+ const TextSearch = ({ label, searchValue, updateFilterValues }) => (
9
9
  <div className="search">
10
10
  <div className="search__wrapper">
11
11
  <div className="form-field form-field--input form-field--search">
@@ -34,10 +34,8 @@ const TextSearch = ({ label, searchValue, updateFilterValues, handleSubmit, filt
34
34
  );
35
35
 
36
36
  TextSearch.propTypes = {
37
- filterValues: PropTypes.object.isRequired,
38
37
  searchValue: PropTypes.string.isRequired,
39
38
  updateFilterValues: PropTypes.func.isRequired,
40
- handleSubmit: PropTypes.func.isRequired,
41
39
  label: PropTypes.string
42
40
  };
43
41
 
@@ -2,7 +2,7 @@ const CHECKBOX = 'checkbox';
2
2
  const SELECT = 'select';
3
3
  const TEXT_SEARCH = 'text-search';
4
4
  const SEARCH_TERM = 'search_term';
5
- const SIZE = 50;
5
+ const SIZE = process.env.BLAZE_PB_SEARCH_FILETER_AGG_SIZE || 500;
6
6
  const KEYWORD = 'keyword';
7
7
  const RAW_RESULTS = 'rawResults';
8
8
  const DEFAULT_OPTION = 'Any';
@@ -0,0 +1,40 @@
1
+ const builFilterObject = (key, value, filters) => {
2
+ const isArray = Array.isArray(value);
3
+ if (!isArray) {
4
+ const singleFilterObj = { match: { [key]: value } };
5
+ filters.push(singleFilterObj);
6
+ return;
7
+ }
8
+
9
+ value.forEach(filterValue => {
10
+ filters.push({ match: { [key]: filterValue } });
11
+ });
12
+ };
13
+ const buildFiltersQuery = (query, filterBy, filterByProperty) => {
14
+ const mustFilters = [];
15
+ Object.keys(query).forEach(queryKey => {
16
+ if (queryKey === 'search_term' || queryKey === 'shouldSearch') return;
17
+ if (!queryKey || !query[queryKey]) return;
18
+ const queryValue = query[queryKey];
19
+ const queryKeyword = `${queryKey}.keyword`;
20
+ builFilterObject(queryKeyword, queryValue, mustFilters);
21
+ });
22
+
23
+ if (filterByProperty && filterByProperty.length) {
24
+ filterByProperty &&
25
+ filterByProperty.forEach(filterByPropOption => {
26
+ const [filterByPropKey] = filterByPropOption.split('/');
27
+ filterBy.forEach(filterByOption => {
28
+ if (filterByOption.indexOf(filterByPropKey) === -1) return;
29
+ const [, filteryByValue] = filterByOption.split('/');
30
+ const filterByKeyword = `${filterByPropKey}.keyword`;
31
+ if (!filteryByValue) return;
32
+ mustFilters.push({ match: { [filterByKeyword]: filteryByValue } });
33
+ });
34
+ });
35
+ }
36
+
37
+ return mustFilters;
38
+ };
39
+
40
+ export default buildFiltersQuery;
@@ -1,6 +1,6 @@
1
1
  import { KEYWORD, SIZE } from '../constants';
2
2
 
3
- const buildRawQueryStringified = (checkboxSelectValues, rangeValues, entity) => {
3
+ const buildRawQueryStringified = (checkboxSelectValues, rangeValues, entity, mustFilters) => {
4
4
  if (!checkboxSelectValues.length && !rangeValues.length) return '';
5
5
 
6
6
  const aggs = {};
@@ -36,6 +36,7 @@ const buildRawQueryStringified = (checkboxSelectValues, rangeValues, entity) =>
36
36
  }
37
37
  }
38
38
  ],
39
+ must: mustFilters,
39
40
  minimum_should_match: 1
40
41
  }
41
42
  }
@@ -3,6 +3,7 @@ import getFilterValueFromQuery from './get-filter-value-from-query';
3
3
 
4
4
  const getInitialFilterValues = (filterData, filters, query) => {
5
5
  const filterValues = {};
6
+
6
7
  Object.keys(filterData).forEach(key => {
7
8
  const filterProps =
8
9
  filters.find(({ propsToDisplay }) => propsToDisplay.find(prop => key === prop)) || {};
@@ -13,6 +13,7 @@ import isDeviceDesktop from './is-device-desktop';
13
13
  import getInitialFilterValues from './get-initial-filter-values';
14
14
  import getFilterValueFromQuery from './get-filter-value-from-query';
15
15
  import buildQuery from './build-query';
16
+ import buildFiltersQuery from './build-filters-query';
16
17
 
17
18
  export {
18
19
  buildQuery,
@@ -30,5 +31,6 @@ export {
30
31
  getSelectOptions,
31
32
  isDeviceDesktop,
32
33
  getInitialFilterValues,
33
- getFilterValueFromQuery
34
+ getFilterValueFromQuery,
35
+ buildFiltersQuery
34
36
  };
@@ -18,7 +18,7 @@ export default {
18
18
  video: dynamic(() => import(/* webpackChunkName: "blazePbVideo" */ './Video')),
19
19
  wrapper: dynamic(() => import(/* webpackChunkName: "blazePbWrapper" */ './Wrapper')),
20
20
  searchcontent: dynamic(() =>
21
- import(/* webpackChunkName: "blazePbSearchFilter" */ './SearchContent')
21
+ import(/* webpackChunkName: "blazePbSearchFilter" */ './SearchContent/SearchContent')
22
22
  ),
23
23
  searchfilter: dynamic(() =>
24
24
  import(/* webpackChunkName: "blazePbSearchFilter" */ './SearchFilter')
@@ -42,5 +42,14 @@ export default {
42
42
  import(/* webpackChunkName: "blazePbPasswordResetRequest" */ './PasswordResetRequest')
43
43
  ),
44
44
  breadcrumb: dynamic(() => import(/* webpackChunkName: "blazePbBreadcrumb" */ './Breadcrumb')),
45
+ itemlistbutton: dynamic(() =>
46
+ import(/* webpackChunkName: "blazePbItemListButton" */ './ItemList/ItemListButton')
47
+ ),
48
+ itemlistcounter: dynamic(() =>
49
+ import(/* webpackChunkName: "blazePbItemListCounter" */ './ItemList/ItemListCounter')
50
+ ),
51
+ itemlistnew: dynamic(() =>
52
+ import(/* webpackChunkName: "blazePbItemListNew" */ './ItemList/ItemListNew')
53
+ ),
45
54
  backtotop: dynamic(() => import(/* webpackChunkName: "blazePbBackToTop" */ './BackToTop'))
46
55
  };
@@ -17,6 +17,7 @@ const RANGE = 'range';
17
17
  const CHECKBOX = 'checkbox';
18
18
  const ELEMENT = 'element';
19
19
  const MENU_ITEM = 'menuitem';
20
+ const SUB_MENU = 'submenu';
20
21
  const SELECT = 'select';
21
22
  const ON_CLICK = 'onClick';
22
23
  const KEYWORD = 'keyword';
@@ -303,6 +304,7 @@ export {
303
304
  MOBILE_WIDTH,
304
305
  HIDDEN,
305
306
  MENU_ITEM,
307
+ SUB_MENU,
306
308
  LOGIN_FORM,
307
309
  PASSWORD_REGEX,
308
310
  PASSWORD_VALIDATION_MESSAGE,
@@ -62,6 +62,7 @@ const buildRawQuery = (
62
62
 
63
63
  if (itemsToDisplay && itemsToDisplay.length) {
64
64
  const itemsToDisplayIds = getItemsToDisplayIds(itemsToDisplay);
65
+
65
66
  query.bool.must.push({ ids: { values: itemsToDisplayIds } });
66
67
  if (shouldApplySort) {
67
68
  return {
@@ -7,6 +7,9 @@ const appendGtmClassName = (settings, childComponents) => {
7
7
  children: [, compChildren]
8
8
  }
9
9
  } = childComponents;
10
+
11
+ if (!compChildren || !Array.isArray(compChildren)) return settings;
12
+
10
13
  const gtmClassNames = compChildren
11
14
  .filter(
12
15
  ({