@blaze-cms/react-page-builder 0.124.0-alpha.9 → 0.124.1-alpha.2
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.
- package/CHANGELOG.md +325 -0
- package/README.md +8 -0
- package/lib/BannerContext/index.js.map +1 -1
- package/lib/HOC/withInfiniteScroll.js.map +1 -1
- package/lib/HOC/withTitle.js.map +1 -1
- package/lib/PBContext/index.js.map +1 -1
- package/lib/application/query/index.js +8 -2
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/BackToTop/BackToTop.js.map +1 -1
- package/lib/components/Banner/AdSlotRender.js.map +1 -1
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/BannerRender.js.map +1 -1
- package/lib/components/Banner/helpers.js.map +1 -1
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/BlazeLink.js.map +1 -1
- package/lib/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/components/Button.js +18 -5
- package/lib/components/Button.js.map +1 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContainer.js +3 -7
- package/lib/components/Card/CardContainer.js.map +1 -1
- package/lib/components/Card/CardFactory.js +6 -3
- package/lib/components/Card/CardFactory.js.map +1 -1
- package/lib/components/Card/CardRender.js.map +1 -1
- package/lib/components/Card/helpers/filter-query-setup.js.map +1 -1
- package/lib/components/Card/helpers/filters-setup.js.map +1 -1
- package/lib/components/Card/helpers/get-dynamic-grid-classes.js.map +1 -1
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselImage/CarouselImage.js.map +1 -1
- package/lib/components/Carousel/CarouselRender/CarouselRender.js.map +1 -1
- package/lib/components/CarouselWrapper.js +2 -2
- package/lib/components/CarouselWrapper.js.map +1 -1
- package/lib/components/ClickWrapper.js.map +1 -1
- package/lib/components/Code/Code.js.map +1 -1
- package/lib/components/Code/ScriptTag.js.map +1 -1
- package/lib/components/Code/helpers/wrap-script-tags.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryFactory.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryRender.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/HeadingLargeSummary/HeadingLargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ItemDetailsSummary/ItemDetailsSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/LargeSummary/LargeSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/ListSummary/ListSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummary.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/TextSummary/TextSummaryContent.js.map +1 -1
- package/lib/components/DataSummary/DataSummaryTypes/index.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-loop-props-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/build-props-to-display-with-content.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-data-summary-query.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-link-based-on-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-prop-value.js.map +1 -1
- package/lib/components/DataSummary/helpers/get-value-from-array.js.map +1 -1
- package/lib/components/DataSummary/helpers/strip-summary-props-content.js.map +1 -1
- package/lib/components/EmailConfirm/EmailConfirm.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/GlobalLightbox.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/NavButton.js.map +1 -1
- package/lib/components/Image/GlobalLightbox/index.js.map +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/ImageDetails.js.map +1 -1
- package/lib/components/Image/ImageFactory.js.map +1 -1
- package/lib/components/Image/ImageRender.js +5 -1
- package/lib/components/Image/ImageRender.js.map +1 -1
- package/lib/components/Image/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/ItemList/ItemListButton/ItemListButton.js +161 -0
- package/lib/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
- package/lib/components/ItemList/ItemListButton/index.js +16 -0
- package/lib/components/ItemList/ItemListButton/index.js.map +1 -0
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js +83 -0
- package/lib/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
- package/lib/components/ItemList/ItemListCounter/index.js +16 -0
- package/lib/components/ItemList/ItemListCounter/index.js.map +1 -0
- package/lib/components/ItemList/ItemListNew/ItemListNew.js +87 -0
- package/lib/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
- package/lib/components/ItemList/ItemListNew/index.js +16 -0
- package/lib/components/ItemList/ItemListNew/index.js.map +1 -0
- package/lib/components/ItemList/constants.js +19 -0
- package/lib/components/ItemList/constants.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-data.js +17 -0
- package/lib/components/ItemList/helpers/get-item-list-data.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-id.js +23 -0
- package/lib/components/ItemList/helpers/get-item-list-id.js.map +1 -0
- package/lib/components/ItemList/helpers/get-item-list-ids.js +28 -0
- package/lib/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
- package/lib/components/ItemList/helpers/index.js +50 -0
- package/lib/components/ItemList/helpers/index.js.map +1 -0
- package/lib/components/ItemList/helpers/set-item-list-id.js +22 -0
- package/lib/components/ItemList/helpers/set-item-list-id.js.map +1 -0
- package/lib/components/ItemList/helpers/set-param-and-redirect.js +51 -0
- package/lib/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
- package/lib/components/ItemList/hooks/index.js +18 -0
- package/lib/components/ItemList/hooks/index.js.map +1 -0
- package/lib/components/ItemList/hooks/use-item-list-id.js +45 -0
- package/lib/components/ItemList/hooks/use-item-list-id.js.map +1 -0
- package/lib/components/Layout/Layout.js.map +1 -1
- package/lib/components/Layout/helpers/check-if-row-has-columns.js.map +1 -1
- package/lib/components/LazyImage/LazyImage.js +5 -1
- package/lib/components/LazyImage/LazyImage.js.map +1 -1
- package/lib/components/LazyImage/index.js.map +1 -1
- package/lib/components/List/ListBuilder.js +12 -6
- package/lib/components/List/ListBuilder.js.map +1 -1
- package/lib/components/List/ListFactory.js +34 -7
- package/lib/components/List/ListFactory.js.map +1 -1
- package/lib/components/List/ListRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRender.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderItem.js.map +1 -1
- package/lib/components/List/components/Cards/CardsRenderWrapper.js.map +1 -1
- package/lib/components/List/components/Full/FullRender.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderItem.js.map +1 -1
- package/lib/components/List/components/Full/FullRenderWithInfiniteScroll.js.map +1 -1
- package/lib/components/List/components/Header/ListHeader.js.map +1 -1
- package/lib/components/List/components/Pagination/Classic.js.map +1 -1
- package/lib/components/List/components/Pagination/ListPagination.js.map +1 -1
- package/lib/components/List/components/Pagination/LoadMore.js.map +1 -1
- package/lib/components/List/helpers/build-az-aggregations.js.map +1 -1
- package/lib/components/List/helpers/build-az-url.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-items.js.map +1 -1
- package/lib/components/List/helpers/build-pagination-url.js.map +1 -1
- package/lib/components/List/helpers/has-required-item-list-details.js +29 -0
- package/lib/components/List/helpers/has-required-item-list-details.js.map +1 -0
- package/lib/components/List/helpers/index.js +8 -0
- package/lib/components/List/helpers/index.js.map +1 -1
- package/lib/components/Login/LoggedInMessage.js.map +1 -1
- package/lib/components/Login/Login.js.map +1 -1
- package/lib/components/Login/LoginForm.js.map +1 -1
- package/lib/components/Menu/Menu.js +41 -28
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/MenuContext.js +20 -0
- package/lib/components/Menu/MenuContext.js.map +1 -0
- package/lib/components/MenuItem/MenuItem.js +26 -7
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/PasswordReset/PasswordReset.js.map +1 -1
- package/lib/components/PasswordReset/helpers/validatePassword.js.map +1 -1
- package/lib/components/PasswordResetRequest/PasswordResetRequest.js.map +1 -1
- package/lib/components/SearchContent/SearchContent.js +183 -0
- package/lib/components/SearchContent/SearchContent.js.map +1 -0
- package/lib/components/SearchContent/SearchContentItems.js +51 -0
- package/lib/components/SearchContent/SearchContentItems.js.map +1 -0
- package/lib/components/SearchContent/SearchContentResults.js +45 -0
- package/lib/components/SearchContent/SearchContentResults.js.map +1 -0
- package/lib/components/SearchContent/SearchContentToggleIcon.js +42 -0
- package/lib/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
- package/lib/components/SearchContent/index.js +2 -301
- package/lib/components/SearchContent/index.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/CloseMobileForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
- package/lib/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/MobileFormToolbar.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/ResetDesktopForm.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +18 -67
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +97 -22
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/components/Checkbox.js +19 -9
- package/lib/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib/components/SearchFilter/components/Range.js +23 -6
- package/lib/components/SearchFilter/components/Range.js.map +1 -1
- package/lib/components/SearchFilter/components/Select.js +27 -11
- package/lib/components/SearchFilter/components/Select.js.map +1 -1
- package/lib/components/SearchFilter/components/TextSearch.js +1 -5
- package/lib/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-filters-query.js +110 -0
- package/lib/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
- package/lib/components/SearchFilter/helpers/build-query.js +1 -1
- package/lib/components/SearchFilter/helpers/build-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js +15 -8
- package/lib/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
- package/lib/components/SearchFilter/helpers/calculate-min-max.js.map +1 -1
- package/lib/components/SearchFilter/helpers/check-if-range-updated.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-filter-value-from-query.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js +16 -1
- package/lib/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-intersected-prop.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-range-value.js +4 -2
- package/lib/components/SearchFilter/helpers/get-range-value.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-select-options.js.map +1 -1
- package/lib/components/SearchFilter/helpers/index.js +8 -0
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib/components/SearchFilter/helpers/parse-filter-value.js +3 -7
- package/lib/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
- package/lib/components/SearchFilterSort/SearchFilterSort.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/handle-sort-update.js.map +1 -1
- package/lib/components/SearchFilterSort/helpers/update-sort.js.map +1 -1
- package/lib/components/SocialFollow/SFItem.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollow.js.map +1 -1
- package/lib/components/SocialFollow/SocialFollowRender.js.map +1 -1
- package/lib/components/SubMenu/SubMenu.js.map +1 -1
- package/lib/components/TextBlock/TextBlockRender.js.map +1 -1
- package/lib/components/TextBlock/index.js.map +1 -1
- package/lib/components/Video/Video.js.map +1 -1
- package/lib/components/Video/VideoModal.js.map +1 -1
- package/lib/components/Video/VideoRender.js.map +1 -1
- package/lib/components/Video/providers/Default.js.map +1 -1
- package/lib/components/Video/providers/JWPlayer/JWPlayerProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YouTubeProvider.js.map +1 -1
- package/lib/components/Video/providers/YouTube/YoutubeEmbeded.js.map +1 -1
- package/lib/components/Video/providers/get-provider.js.map +1 -1
- package/lib/components/Wrapper.js.map +1 -1
- package/lib/components/index.js +16 -1
- package/lib/components/index.js.map +1 -1
- package/lib/constants/index.js +3 -1
- package/lib/constants/index.js.map +1 -1
- package/lib/helpers/build-inherited-filters.js.map +1 -1
- package/lib/helpers/build-raw-query-base.js.map +1 -1
- package/lib/helpers/build-raw-query.js.map +1 -1
- package/lib/helpers/build-search-values-checkbox-select.js.map +1 -1
- package/lib/helpers/check-props-to-use.js.map +1 -1
- package/lib/helpers/get-entities-with-banner.js.map +1 -1
- package/lib/helpers/get-entity-data.js.map +1 -1
- package/lib/helpers/get-entity-render-props.js.map +1 -1
- package/lib/helpers/get-filter-props.js.map +1 -1
- package/lib/helpers/get-generic-props.js.map +1 -1
- package/lib/helpers/get-generic-render-variables.js.map +1 -1
- package/lib/helpers/get-image-ids.js.map +1 -1
- package/lib/helpers/get-parsed-prop-values.js.map +1 -1
- package/lib/helpers/get-prop-values.js.map +1 -1
- package/lib/helpers/get-query-filters.js.map +1 -1
- package/lib/helpers/get-query-props.js.map +1 -1
- package/lib/helpers/get-updated-filter-by.js.map +1 -1
- package/lib/helpers/inject-banner.js.map +1 -1
- package/lib/helpers/inject-banners-to-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-entities/get-banners-for-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/get-banners-for-nodes.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/get-banners-for-nodes/helpers/group-node-entities.js.map +1 -1
- package/lib/helpers/inject-multiple-banners/inject-multiple-banners.js.map +1 -1
- package/lib/helpers/is-filter-entitys-id.js.map +1 -1
- package/lib/helpers/parse-TextBlock.js.map +1 -1
- package/lib/helpers/parse-props-to-display.js.map +1 -1
- package/lib/helpers/render-children.js.map +1 -1
- package/lib/helpers/sort-response-data.js.map +1 -1
- package/lib/hooks/helpers/RenderComponent.js.map +1 -1
- package/lib/hooks/helpers/append-gtm-classname.js +1 -0
- package/lib/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/lib/hooks/helpers/buildPBComponents.js.map +1 -1
- package/lib/hooks/helpers/getComponent.js.map +1 -1
- package/lib/hooks/helpers/inject-element-banners.js.map +1 -1
- package/lib/hooks/helpers/inject-textblock-banners.js.map +1 -1
- package/lib/hooks/helpers/insert-banners.js.map +1 -1
- package/lib/hooks/helpers/update-targetings.js.map +1 -1
- package/lib/hooks/use-banner-insertion.js.map +1 -1
- package/lib/hooks/use-check-mobile-screen.js.map +1 -1
- package/lib/hooks/use-get-entity-schema.js.map +1 -1
- package/lib/hooks/use-get-entity-schemas-as-obj.js.map +1 -1
- package/lib/hooks/use-get-image-id-from-relation.js.map +1 -1
- package/lib/hooks/use-get-images.js.map +1 -1
- package/lib/hooks/use-get-single-entity-schema.js.map +1 -1
- package/lib/hooks/use-page-builder.js.map +1 -1
- package/lib/utils/get-class-modifiers.js.map +1 -1
- package/lib/utils/get-image-data.js.map +1 -1
- package/lib-es/application/query/index.js +45 -1
- package/lib-es/application/query/index.js.map +1 -1
- package/lib-es/components/Button.js +18 -6
- package/lib-es/components/Button.js.map +1 -1
- package/lib-es/components/Card/CardContainer.js +3 -7
- package/lib-es/components/Card/CardContainer.js.map +1 -1
- package/lib-es/components/Card/CardFactory.js +7 -4
- package/lib-es/components/Card/CardFactory.js.map +1 -1
- package/lib-es/components/CarouselWrapper.js +2 -2
- package/lib-es/components/CarouselWrapper.js.map +1 -1
- package/lib-es/components/Image/ImageRender.js +4 -1
- package/lib-es/components/Image/ImageRender.js.map +1 -1
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js +111 -0
- package/lib-es/components/ItemList/ItemListButton/ItemListButton.js.map +1 -0
- package/lib-es/components/ItemList/ItemListButton/index.js +3 -0
- package/lib-es/components/ItemList/ItemListButton/index.js.map +1 -0
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js +60 -0
- package/lib-es/components/ItemList/ItemListCounter/ItemListCounter.js.map +1 -0
- package/lib-es/components/ItemList/ItemListCounter/index.js +3 -0
- package/lib-es/components/ItemList/ItemListCounter/index.js.map +1 -0
- package/lib-es/components/ItemList/ItemListNew/ItemListNew.js +64 -0
- package/lib-es/components/ItemList/ItemListNew/ItemListNew.js.map +1 -0
- package/lib-es/components/ItemList/ItemListNew/index.js +3 -0
- package/lib-es/components/ItemList/ItemListNew/index.js.map +1 -0
- package/lib-es/components/ItemList/constants.js +6 -0
- package/lib-es/components/ItemList/constants.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-data.js +7 -0
- package/lib-es/components/ItemList/helpers/get-item-list-data.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-id.js +11 -0
- package/lib-es/components/ItemList/helpers/get-item-list-id.js.map +1 -0
- package/lib-es/components/ItemList/helpers/get-item-list-ids.js +13 -0
- package/lib-es/components/ItemList/helpers/get-item-list-ids.js.map +1 -0
- package/lib-es/components/ItemList/helpers/index.js +6 -0
- package/lib-es/components/ItemList/helpers/index.js.map +1 -0
- package/lib-es/components/ItemList/helpers/set-item-list-id.js +10 -0
- package/lib-es/components/ItemList/helpers/set-item-list-id.js.map +1 -0
- package/lib-es/components/ItemList/helpers/set-param-and-redirect.js +20 -0
- package/lib-es/components/ItemList/helpers/set-param-and-redirect.js.map +1 -0
- package/lib-es/components/ItemList/hooks/index.js +2 -0
- package/lib-es/components/ItemList/hooks/index.js.map +1 -0
- package/lib-es/components/ItemList/hooks/use-item-list-id.js +26 -0
- package/lib-es/components/ItemList/hooks/use-item-list-id.js.map +1 -0
- package/lib-es/components/LazyImage/LazyImage.js +4 -1
- package/lib-es/components/LazyImage/LazyImage.js.map +1 -1
- package/lib-es/components/List/ListBuilder.js +12 -6
- package/lib-es/components/List/ListBuilder.js.map +1 -1
- package/lib-es/components/List/ListFactory.js +33 -9
- package/lib-es/components/List/ListFactory.js.map +1 -1
- package/lib-es/components/List/helpers/has-required-item-list-details.js +20 -0
- package/lib-es/components/List/helpers/has-required-item-list-details.js.map +1 -0
- package/lib-es/components/List/helpers/index.js +1 -0
- package/lib-es/components/List/helpers/index.js.map +1 -1
- package/lib-es/components/Menu/Menu.js +54 -46
- package/lib-es/components/Menu/Menu.js.map +1 -1
- package/lib-es/components/Menu/MenuContext.js +6 -0
- package/lib-es/components/Menu/MenuContext.js.map +1 -0
- package/lib-es/components/MenuItem/MenuItem.js +24 -9
- package/lib-es/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-es/components/SearchContent/SearchContent.js +129 -0
- package/lib-es/components/SearchContent/SearchContent.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentItems.js +33 -0
- package/lib-es/components/SearchContent/SearchContentItems.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentResults.js +31 -0
- package/lib-es/components/SearchContent/SearchContentResults.js.map +1 -0
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js +30 -0
- package/lib-es/components/SearchContent/SearchContentToggleIcon.js.map +1 -0
- package/lib-es/components/SearchContent/index.js +1 -205
- package/lib-es/components/SearchContent/index.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js +2 -4
- package/lib-es/components/SearchFilter/SearchFilter/FiltersList.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +12 -44
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +77 -15
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Checkbox.js +18 -9
- package/lib-es/components/SearchFilter/components/Checkbox.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Range.js +19 -6
- package/lib-es/components/SearchFilter/components/Range.js.map +1 -1
- package/lib-es/components/SearchFilter/components/Select.js +23 -8
- package/lib-es/components/SearchFilter/components/Select.js.map +1 -1
- package/lib-es/components/SearchFilter/components/TextSearch.js +1 -5
- package/lib-es/components/SearchFilter/components/TextSearch.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js +73 -0
- package/lib-es/components/SearchFilter/helpers/build-filters-query.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/build-query.js +1 -1
- package/lib-es/components/SearchFilter/helpers/build-query.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js +15 -9
- package/lib-es/components/SearchFilter/helpers/build-raw-query-stringified.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js +14 -1
- package/lib-es/components/SearchFilter/helpers/get-initial-filter-values.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/get-range-value.js +2 -2
- package/lib-es/components/SearchFilter/helpers/get-range-value.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/index.js +2 -1
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/parse-filter-value.js +3 -3
- package/lib-es/components/SearchFilter/helpers/parse-filter-value.js.map +1 -1
- package/lib-es/components/index.js +10 -1
- package/lib-es/components/index.js.map +1 -1
- package/lib-es/constants/index.js +2 -1
- package/lib-es/constants/index.js.map +1 -1
- package/lib-es/helpers/build-raw-query.js.map +1 -1
- package/lib-es/hooks/helpers/append-gtm-classname.js +1 -0
- package/lib-es/hooks/helpers/append-gtm-classname.js.map +1 -1
- package/package.json +5 -4
- package/src/application/query/index.js +51 -1
- package/src/components/Button.js +27 -5
- package/src/components/Card/CardContainer.js +2 -6
- package/src/components/Card/CardFactory.js +5 -3
- package/src/components/CarouselWrapper.js +2 -2
- package/src/components/Image/ImageRender.js +3 -0
- package/src/components/ItemList/ItemListButton/ItemListButton.js +94 -0
- package/src/components/ItemList/ItemListButton/index.js +3 -0
- package/src/components/ItemList/ItemListCounter/ItemListCounter.js +52 -0
- package/src/components/ItemList/ItemListCounter/index.js +3 -0
- package/src/components/ItemList/ItemListNew/ItemListNew.js +51 -0
- package/src/components/ItemList/ItemListNew/index.js +3 -0
- package/src/components/ItemList/constants.js +5 -0
- package/src/components/ItemList/helpers/get-item-list-data.js +6 -0
- package/src/components/ItemList/helpers/get-item-list-id.js +11 -0
- package/src/components/ItemList/helpers/get-item-list-ids.js +10 -0
- package/src/components/ItemList/helpers/index.js +5 -0
- package/src/components/ItemList/helpers/set-item-list-id.js +9 -0
- package/src/components/ItemList/helpers/set-param-and-redirect.js +20 -0
- package/src/components/ItemList/hooks/index.js +1 -0
- package/src/components/ItemList/hooks/use-item-list-id.js +27 -0
- package/src/components/LazyImage/LazyImage.js +11 -1
- package/src/components/List/ListBuilder.js +10 -5
- package/src/components/List/ListFactory.js +48 -12
- package/src/components/List/helpers/has-required-item-list-details.js +14 -0
- package/src/components/List/helpers/index.js +1 -0
- package/src/components/Menu/Menu.js +61 -54
- package/src/components/Menu/MenuContext.js +5 -0
- package/src/components/MenuItem/MenuItem.js +39 -14
- package/src/components/SearchContent/SearchContent.js +136 -0
- package/src/components/SearchContent/SearchContentItems.js +28 -0
- package/src/components/SearchContent/SearchContentResults.js +27 -0
- package/src/components/SearchContent/SearchContentToggleIcon.js +27 -0
- package/src/components/SearchContent/index.js +1 -217
- package/src/components/SearchFilter/SearchFilter/FiltersList.js +30 -37
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +12 -26
- package/src/components/SearchFilter/SearchFilterContainer.js +72 -16
- package/src/components/SearchFilter/components/Checkbox.js +23 -8
- package/src/components/SearchFilter/components/Range.js +11 -5
- package/src/components/SearchFilter/components/Select.js +18 -11
- package/src/components/SearchFilter/components/TextSearch.js +1 -3
- package/src/components/SearchFilter/helpers/build-filters-query.js +60 -0
- package/src/components/SearchFilter/helpers/build-query.js +3 -1
- package/src/components/SearchFilter/helpers/build-raw-query-stringified.js +17 -11
- package/src/components/SearchFilter/helpers/get-initial-filter-values.js +15 -1
- package/src/components/SearchFilter/helpers/get-range-value.js +2 -2
- package/src/components/SearchFilter/helpers/index.js +3 -1
- package/src/components/SearchFilter/helpers/parse-filter-value.js +3 -3
- package/src/components/index.js +10 -1
- package/src/constants/index.js +2 -0
- package/src/helpers/build-raw-query.js +1 -0
- package/src/hooks/helpers/append-gtm-classname.js +3 -0
- package/tests/unit/src/components/Button.test.js +55 -1
- package/tests/unit/src/components/ItemList/ItemListButton.test.js +175 -0
- package/tests/unit/src/components/ItemList/ItemListCounter.test.js +65 -0
- package/tests/unit/src/components/ItemList/ItemListNew.test.js +164 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListButton.test.js.snap +107 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListCounter.test.js.snap +31 -0
- package/tests/unit/src/components/ItemList/__snapshots__/ItemListNew.test.js.snap +27 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-data.test.js +28 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-id.test.js +20 -0
- package/tests/unit/src/components/ItemList/helpers/get-item-list-ids.test.js +19 -0
- package/tests/unit/src/components/ItemList/helpers/set-item-list-id.test.js +13 -0
- package/tests/unit/src/components/ItemList/helpers/set-param-and-redirect.test.js +30 -0
- package/tests/unit/src/components/ItemList/hooks/use-item-list-id.test.js +32 -0
- package/tests/unit/src/components/List/helpers/has-required-item-list-details.test.js +30 -0
- package/tests/unit/src/components/Menu/Menu.test.js +9 -3
- package/tests/unit/src/components/Menu/__snapshots__/Menu.test.js.snap +12 -11
- package/tests/unit/src/components/MenuItem/MenuItem.test.js +1 -1
- package/tests/unit/src/components/MenuItem/SubMenu.test.js +5 -1
- package/tests/unit/src/components/MenuItem/__snapshots__/MenuItem.test.js.snap +54 -10
- package/tests/unit/src/components/SearchContent/SearchContent.test.js +29 -0
- package/tests/unit/src/components/SearchContent/__snapshots__/SearchContent.test.js.snap +9 -0
- package/tests/unit/src/components/SearchFilter/SearchFilter/SearchFilter.test.js +3 -6
- package/tests/unit/src/components/SearchFilter/components/Range.test.js +24 -0
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Checkbox.test.js.snap +2 -0
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Range.test.js.snap +3 -3
- package/tests/unit/src/components/SearchFilter/components/__snapshots__/Select.test.js.snap +4 -0
- package/tests/unit/src/components/SearchFilter/helpers/build-query.test.js +2 -2
- package/tests/unit/src/components/SearchFilter/helpers/get-initial-filter-values.test.js +31 -11
- package/tests/unit/src/components/SearchFilter/helpers/parse-filter-value.test.js +1 -1
- package/tests/unit/src/components/__snapshots__/index.test.js.snap +12 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import getitemListIds from '../../../../../../src/components/ItemList/helpers/get-item-list-ids';
|
|
3
|
+
|
|
4
|
+
describe('getitemListIds helper', () => {
|
|
5
|
+
const noData = getitemListIds();
|
|
6
|
+
const emptyData = getitemListIds({});
|
|
7
|
+
const withData = getitemListIds({
|
|
8
|
+
getItemList: { listItems: [{ itemId: '123' }, { itemId: '456' }] }
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should return null if no valid data is passed', () => {
|
|
12
|
+
expect(noData).toEqual(null);
|
|
13
|
+
expect(emptyData).toEqual(null);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('should return itemsToDisplay formatted ids', () => {
|
|
17
|
+
expect(withData).toEqual([{ displayItems: ['123'] }, { displayItems: ['456'] }]);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import setItemListId from '../../../../../../src/components/ItemList/helpers/set-item-list-id';
|
|
3
|
+
import { LIST_ITEM_LOCAL_KEY } from '../../../../../../src/components/ItemList/constants';
|
|
4
|
+
|
|
5
|
+
describe('setItemListId helper', () => {
|
|
6
|
+
const listId = 'LIST ID';
|
|
7
|
+
const listName = 'LIST';
|
|
8
|
+
|
|
9
|
+
it('should set list id in localstorage', () => {
|
|
10
|
+
setItemListId(listName, listId);
|
|
11
|
+
expect(localStorage.setItem).toHaveBeenCalledWith(`${LIST_ITEM_LOCAL_KEY}${listName}`, listId);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import setParamAndRedirect from '../../../../../../src/components/ItemList/helpers/set-param-and-redirect';
|
|
3
|
+
import { LIST_ITEM_QUERY_PARAM } from '../../../../../../src/components/ItemList/constants';
|
|
4
|
+
|
|
5
|
+
describe('setParamAndRedirect helper', () => {
|
|
6
|
+
const url = '/test?otherParam=abc';
|
|
7
|
+
const urlWithQueryString = `${url}&${LIST_ITEM_QUERY_PARAM}=123`;
|
|
8
|
+
|
|
9
|
+
it('should return if no value and queryParam not present', () => {
|
|
10
|
+
const router = { asPath: url, push: jest.fn() };
|
|
11
|
+
expect(setParamAndRedirect(router)).toBeUndefined();
|
|
12
|
+
expect(router.push).not.toHaveBeenCalled();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should remove queryString if no value passed', () => {
|
|
16
|
+
const router = { asPath: urlWithQueryString, push: jest.fn() };
|
|
17
|
+
expect(setParamAndRedirect(router)).toBeUndefined();
|
|
18
|
+
expect(router.push).toHaveBeenCalledWith('/Resolver', url, {
|
|
19
|
+
shallow: true
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should add queryString if value passed', () => {
|
|
24
|
+
const router = { asPath: url, push: jest.fn() };
|
|
25
|
+
expect(setParamAndRedirect(router, '123')).toBeUndefined();
|
|
26
|
+
expect(router.push).toHaveBeenCalledWith('/Resolver', urlWithQueryString, {
|
|
27
|
+
shallow: true
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { renderHook, act } from '@testing-library/react-hooks';
|
|
2
|
+
import useItemListId from '../../../../../../src/components/ItemList/hooks/use-item-list-id';
|
|
3
|
+
import getItemListId from '../../../../../../src/components/ItemList/helpers/get-item-list-id';
|
|
4
|
+
|
|
5
|
+
jest.mock('../../../../../../src/components/ItemList/helpers/get-item-list-id', () =>
|
|
6
|
+
jest.fn(() => 'LIST ID')
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
describe('useItemListId hook', () => {
|
|
10
|
+
const listId = 'LIST ID';
|
|
11
|
+
const listName = 'LIST';
|
|
12
|
+
|
|
13
|
+
it('should return listId ', () => {
|
|
14
|
+
const { result } = renderHook(() => useItemListId({ listName }));
|
|
15
|
+
expect(result.current).toEqual({ listId });
|
|
16
|
+
expect(getItemListId).toHaveBeenCalledWith(listName);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should return listId after storage event', () => {
|
|
20
|
+
const noListValue = 'empty';
|
|
21
|
+
getItemListId.mockReturnValueOnce(noListValue);
|
|
22
|
+
const { result } = renderHook(() => useItemListId({ listName }));
|
|
23
|
+
expect(result.current).toEqual({ listId: noListValue });
|
|
24
|
+
|
|
25
|
+
act(() => {
|
|
26
|
+
window.dispatchEvent(new Event('storage'));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
expect(result.current).toEqual({ listId });
|
|
30
|
+
expect(getItemListId).toHaveBeenNthCalledWith(2, listName);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import hasRequiredItemListDetails from '../../../../../../src/components/List/helpers/has-required-item-list-details';
|
|
2
|
+
import setParamAndRedirect from '../../../../../../src/components/ItemList/helpers/set-param-and-redirect';
|
|
3
|
+
|
|
4
|
+
jest.mock('../../../../../../src/components/ItemList/helpers/set-param-and-redirect', () =>
|
|
5
|
+
jest.fn()
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
describe('hasRequiredItemListDetails helper function', () => {
|
|
9
|
+
const itemListId = 'localstorage id';
|
|
10
|
+
const router = {};
|
|
11
|
+
const itemListName = 'LIST NAME';
|
|
12
|
+
const queryItemListId = 'query id';
|
|
13
|
+
|
|
14
|
+
it('should return true if no itemListName', () => {
|
|
15
|
+
expect(hasRequiredItemListDetails({})).toEqual(true);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should call setParamAndRedirect if queryItemListId not set and itemListId is', () => {
|
|
19
|
+
expect(hasRequiredItemListDetails({ itemListName, itemListId, router })).toEqual(false);
|
|
20
|
+
expect(setParamAndRedirect).toHaveBeenCalledWith(router, itemListId);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should return false if no queryItemListId and itemListId', () => {
|
|
24
|
+
expect(hasRequiredItemListDetails({ itemListName })).toEqual(false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should return true queryItemListId is set', () => {
|
|
28
|
+
expect(hasRequiredItemListDetails({ itemListName, queryItemListId })).toEqual(true);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -3,16 +3,22 @@ import { render } from '@blaze-cms/tools/test-helpers/test-functions';
|
|
|
3
3
|
import '@testing-library/jest-dom/extend-expect';
|
|
4
4
|
import Menu from '../../../../../src/components/Menu';
|
|
5
5
|
|
|
6
|
-
jest.mock('
|
|
6
|
+
jest.mock('next/router', () => ({
|
|
7
|
+
useRouter: jest.fn(() => ({ events: { on: jest.fn(), off: jest.fn() } }))
|
|
8
|
+
}));
|
|
7
9
|
|
|
8
10
|
const props = {
|
|
9
11
|
collapse: false,
|
|
10
12
|
modifier: 'menu-mod',
|
|
11
|
-
children: [
|
|
13
|
+
children: [
|
|
14
|
+
<div className="child_1" key="1">
|
|
15
|
+
only child
|
|
16
|
+
</div>
|
|
17
|
+
]
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
describe('Menu component', () => {
|
|
15
|
-
it
|
|
21
|
+
it('should render without throwing an error and match snapshot', () => {
|
|
16
22
|
const { asFragment } = render(Menu, props);
|
|
17
23
|
expect(asFragment()).toMatchSnapshot();
|
|
18
24
|
});
|
|
@@ -3,20 +3,21 @@
|
|
|
3
3
|
exports[`Menu component should render without throwing an error and match snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="menu--
|
|
6
|
+
class="menu--wrapper"
|
|
7
7
|
>
|
|
8
|
-
<
|
|
9
|
-
class="menu-
|
|
8
|
+
<div
|
|
9
|
+
class="menu--desktop-wrapper"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
class="
|
|
11
|
+
<ul
|
|
12
|
+
class=" menu-mod"
|
|
13
13
|
>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
<div
|
|
15
|
+
class="child_1"
|
|
16
|
+
>
|
|
17
|
+
only child
|
|
18
|
+
</div>
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
20
21
|
</div>
|
|
21
22
|
</DocumentFragment>
|
|
22
23
|
`;
|
|
@@ -15,7 +15,11 @@ describe('SubMenu component', () => {
|
|
|
15
15
|
it('should render children if passed', () => {
|
|
16
16
|
const { container, asFragment } = render(SubMenu, {
|
|
17
17
|
modifier: '',
|
|
18
|
-
children: [
|
|
18
|
+
children: [
|
|
19
|
+
<div className="sub-menu-child" key="1">
|
|
20
|
+
some stuff
|
|
21
|
+
</div>
|
|
22
|
+
]
|
|
19
23
|
});
|
|
20
24
|
expect(asFragment()).toMatchSnapshot();
|
|
21
25
|
expect(container.firstChild.firstChild).toContainHTML('div');
|
|
@@ -5,13 +5,35 @@ exports[`MenuItem component should render link if url is passed 1`] = `
|
|
|
5
5
|
<li
|
|
6
6
|
class="menu-item-mod"
|
|
7
7
|
>
|
|
8
|
-
<
|
|
9
|
-
|
|
8
|
+
<div
|
|
9
|
+
class="menu--item--link"
|
|
10
10
|
>
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<a
|
|
12
|
+
href="/somewhere"
|
|
13
|
+
>
|
|
14
|
+
Item 1
|
|
15
|
+
</a>
|
|
16
|
+
<i
|
|
17
|
+
class="menu--item--link--icon"
|
|
18
|
+
role="button"
|
|
19
|
+
>
|
|
20
|
+
<svg
|
|
21
|
+
fill="currentColor"
|
|
22
|
+
height="1em"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
stroke-width="0"
|
|
25
|
+
viewBox="0 0 448 512"
|
|
26
|
+
width="1em"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<path
|
|
30
|
+
d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
</i>
|
|
34
|
+
</div>
|
|
13
35
|
<div
|
|
14
|
-
class="hidden"
|
|
36
|
+
class="menu--item-children hidden"
|
|
15
37
|
>
|
|
16
38
|
<div
|
|
17
39
|
class="child_1"
|
|
@@ -29,13 +51,35 @@ exports[`MenuItem component should render without throwing an error and match sn
|
|
|
29
51
|
<li
|
|
30
52
|
class="menu-item-mod"
|
|
31
53
|
>
|
|
32
|
-
<
|
|
33
|
-
|
|
54
|
+
<div
|
|
55
|
+
class="menu--item--link"
|
|
34
56
|
>
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
<span
|
|
58
|
+
role="button"
|
|
59
|
+
>
|
|
60
|
+
Item 1
|
|
61
|
+
</span>
|
|
62
|
+
<i
|
|
63
|
+
class="menu--item--link--icon"
|
|
64
|
+
role="button"
|
|
65
|
+
>
|
|
66
|
+
<svg
|
|
67
|
+
fill="currentColor"
|
|
68
|
+
height="1em"
|
|
69
|
+
stroke="currentColor"
|
|
70
|
+
stroke-width="0"
|
|
71
|
+
viewBox="0 0 448 512"
|
|
72
|
+
width="1em"
|
|
73
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
74
|
+
>
|
|
75
|
+
<path
|
|
76
|
+
d="M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"
|
|
77
|
+
/>
|
|
78
|
+
</svg>
|
|
79
|
+
</i>
|
|
80
|
+
</div>
|
|
37
81
|
<div
|
|
38
|
-
class="hidden"
|
|
82
|
+
class="menu--item-children hidden"
|
|
39
83
|
>
|
|
40
84
|
<div
|
|
41
85
|
class="child_1"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
3
|
+
import { MockedProvider } from '@apollo/client/testing';
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
|
+
import SearchContent from '../../../../../src/components/SearchContent';
|
|
6
|
+
|
|
7
|
+
jest.mock('@apollo/client', () => ({
|
|
8
|
+
...jest.requireActual('@apollo/client'),
|
|
9
|
+
useQuery: jest.fn(() => ({ data: {}, loading: false, error: null }))
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
jest.mock('next/router', () => ({
|
|
13
|
+
useRouter: jest.fn(() => ({ asPath: 'test-url' }))
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
jest.mock('../../../../../src/components/SearchContent/SearchContent', () =>
|
|
17
|
+
jest.fn(() => <div>Mocked component</div>)
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
describe('SearchContent', () => {
|
|
21
|
+
it('should match snapshot', async () => {
|
|
22
|
+
const { asFragment } = render(
|
|
23
|
+
<MockedProvider mocks={[]} addTypename={false}>
|
|
24
|
+
<SearchContent />
|
|
25
|
+
</MockedProvider>
|
|
26
|
+
);
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -11,7 +11,7 @@ const renderComponent = (Component, props) => {
|
|
|
11
11
|
|
|
12
12
|
const mockedProps = {
|
|
13
13
|
data: {},
|
|
14
|
-
|
|
14
|
+
filterValues: {},
|
|
15
15
|
filters: [],
|
|
16
16
|
searchFilterRef: {},
|
|
17
17
|
buttonRef: { current: null },
|
|
@@ -24,14 +24,11 @@ const mockedProps = {
|
|
|
24
24
|
groupAfterMobile: 0,
|
|
25
25
|
groupAfterDesktop: 0,
|
|
26
26
|
isCollapsedOnResponsive: true,
|
|
27
|
-
displaySearchFilter: false
|
|
27
|
+
displaySearchFilter: false,
|
|
28
|
+
setAppliedFilters: jest.fn()
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
describe('SearchFilter component', () => {
|
|
31
|
-
it('should be defined', () => {
|
|
32
|
-
expect(SearchFilter).toBeDefined();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
32
|
describe('when isCollapsedOnResponsive = true, displaySearchFilter = false', () => {
|
|
36
33
|
const specificMockedProps = {
|
|
37
34
|
...mockedProps,
|
|
@@ -9,6 +9,12 @@ jest.mock('next/router', () => ({
|
|
|
9
9
|
const getMockedProps = overrides => ({
|
|
10
10
|
rangeInterval: 100,
|
|
11
11
|
label: 'GLabel',
|
|
12
|
+
dataAggregations: {
|
|
13
|
+
name: {
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 6600
|
|
16
|
+
}
|
|
17
|
+
},
|
|
12
18
|
filterValues: {
|
|
13
19
|
name: {
|
|
14
20
|
max: 6600,
|
|
@@ -41,6 +47,12 @@ describe('Range component', () => {
|
|
|
41
47
|
|
|
42
48
|
it('should match snapshot large values formatted correctly', async () => {
|
|
43
49
|
const mockedProps = getMockedProps({
|
|
50
|
+
dataAggregations: {
|
|
51
|
+
name: {
|
|
52
|
+
min: 9995,
|
|
53
|
+
max: 10000
|
|
54
|
+
}
|
|
55
|
+
},
|
|
44
56
|
filterValues: {
|
|
45
57
|
name: {
|
|
46
58
|
min: 9999,
|
|
@@ -59,6 +71,12 @@ describe('Range component', () => {
|
|
|
59
71
|
|
|
60
72
|
it('should match snapshot with interval and rounded min & max values', async () => {
|
|
61
73
|
const mockedProps = getMockedProps({
|
|
74
|
+
dataAggregations: {
|
|
75
|
+
name: {
|
|
76
|
+
min: 15.5,
|
|
77
|
+
max: 49.5
|
|
78
|
+
}
|
|
79
|
+
},
|
|
62
80
|
filterValues: {
|
|
63
81
|
name: {
|
|
64
82
|
min: 15.5,
|
|
@@ -77,6 +95,12 @@ describe('Range component', () => {
|
|
|
77
95
|
|
|
78
96
|
it('should match snapshot with adjusted min & max values based on interval', async () => {
|
|
79
97
|
const mockedProps = getMockedProps({
|
|
98
|
+
dataAggregations: {
|
|
99
|
+
name: {
|
|
100
|
+
min: 6,
|
|
101
|
+
max: 8
|
|
102
|
+
}
|
|
103
|
+
},
|
|
80
104
|
filterValues: {
|
|
81
105
|
name: {
|
|
82
106
|
min: 6,
|
package/tests/unit/src/components/SearchFilter/components/__snapshots__/Checkbox.test.js.snap
CHANGED
|
@@ -10,6 +10,7 @@ exports[`Checkbox component should render without throwing an error match snapsh
|
|
|
10
10
|
class="form-checkbox"
|
|
11
11
|
data-cy="checkbox-cy-1"
|
|
12
12
|
data-testid="checkbox-1"
|
|
13
|
+
disabled=""
|
|
13
14
|
id="name1-checkbox"
|
|
14
15
|
name="name"
|
|
15
16
|
readonly=""
|
|
@@ -36,6 +37,7 @@ exports[`Checkbox component should render without throwing an error match snapsh
|
|
|
36
37
|
class="form-checkbox"
|
|
37
38
|
data-cy="checkbox-cy-2"
|
|
38
39
|
data-testid="checkbox-2"
|
|
40
|
+
disabled=""
|
|
39
41
|
id="name2-checkbox"
|
|
40
42
|
name="name"
|
|
41
43
|
readonly=""
|
|
@@ -76,7 +76,7 @@ Array [
|
|
|
76
76
|
id="nameRange"
|
|
77
77
|
max={10000}
|
|
78
78
|
max-value={10000}
|
|
79
|
-
min={
|
|
79
|
+
min={9995}
|
|
80
80
|
min-value={9999}
|
|
81
81
|
step={1}
|
|
82
82
|
>
|
|
@@ -224,9 +224,9 @@ Array [
|
|
|
224
224
|
<div
|
|
225
225
|
className="range__filter name"
|
|
226
226
|
id="nameRange"
|
|
227
|
-
max={
|
|
227
|
+
max={50}
|
|
228
228
|
max-value={49.5}
|
|
229
|
-
min={15
|
|
229
|
+
min={15}
|
|
230
230
|
min-value={15.5}
|
|
231
231
|
step={1}
|
|
232
232
|
>
|
|
@@ -13,11 +13,13 @@ exports[`Select component should display label as placeholder with no label tag
|
|
|
13
13
|
Placeholder label
|
|
14
14
|
</option>
|
|
15
15
|
<option
|
|
16
|
+
disabled=""
|
|
16
17
|
value="name1"
|
|
17
18
|
>
|
|
18
19
|
name1
|
|
19
20
|
</option>
|
|
20
21
|
<option
|
|
22
|
+
disabled=""
|
|
21
23
|
value="name2"
|
|
22
24
|
>
|
|
23
25
|
name2
|
|
@@ -46,11 +48,13 @@ exports[`Select component should render witout throwing an error and match snaps
|
|
|
46
48
|
Any
|
|
47
49
|
</option>
|
|
48
50
|
<option
|
|
51
|
+
disabled=""
|
|
49
52
|
value="name1"
|
|
50
53
|
>
|
|
51
54
|
name1
|
|
52
55
|
</option>
|
|
53
56
|
<option
|
|
57
|
+
disabled=""
|
|
54
58
|
value="name2"
|
|
55
59
|
>
|
|
56
60
|
name2
|
|
@@ -24,10 +24,10 @@ describe('buildQuery helper function', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
it('should return new query string with search term if available', () => {
|
|
27
|
-
expect(withTextSearch).toEqual('search_term=new
|
|
27
|
+
expect(withTextSearch).toEqual('search_term=new%20search%20value');
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
it('should return new query string with search text and all other available query values', () => {
|
|
31
|
-
expect(withSearchAndRange).toEqual('search_term=new
|
|
31
|
+
expect(withSearchAndRange).toEqual('search_term=new%20search%20value&rangeFilter=2-10');
|
|
32
32
|
});
|
|
33
33
|
});
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import getInitialFilterValues from '../../../../../../src/components/SearchFilter/helpers/get-initial-filter-values';
|
|
2
2
|
import { SEARCH_TERM } from '../../../../../../src/components/SearchFilter/constants';
|
|
3
3
|
|
|
4
|
+
const filters = [
|
|
5
|
+
{ propsToDisplay: ['rangeFilter'], type: 'range', rangeInterval: 1 },
|
|
6
|
+
{ propsToDisplay: ['checkboxFilter'], type: 'checkbox' },
|
|
7
|
+
{ propsToDisplay: ['emptySelect'], type: 'select' }
|
|
8
|
+
];
|
|
9
|
+
const query = {
|
|
10
|
+
[SEARCH_TERM]: 'some text search',
|
|
11
|
+
rangeFilter: '7-8',
|
|
12
|
+
checkboxFilter: ['check1', 'check2']
|
|
13
|
+
};
|
|
4
14
|
const mockedProps = [
|
|
5
15
|
[{}, [], {}],
|
|
6
|
-
[
|
|
7
|
-
{ rangeFilter: { min: 5, max: 10 }, checkboxFilter: {}, emptySelect: {} },
|
|
8
|
-
[
|
|
9
|
-
{ propsToDisplay: ['rangeFilter'], type: 'range', rangeInterval: 1 },
|
|
10
|
-
{ propsToDisplay: ['checkboxFilter'], type: 'checkbox' },
|
|
11
|
-
{ propsToDisplay: ['emptySelect'], type: 'select' }
|
|
12
|
-
],
|
|
13
|
-
{ [SEARCH_TERM]: 'some text search', rangeFilter: '7-8', checkboxFilter: ['check1', 'check2'] }
|
|
14
|
-
]
|
|
16
|
+
[{ rangeFilter: { min: 5, max: 10 }, checkboxFilter: {}, emptySelect: {} }, filters, query]
|
|
15
17
|
];
|
|
16
18
|
|
|
17
19
|
describe('getInitialFilterValues helper function', () => {
|
|
@@ -19,12 +21,30 @@ describe('getInitialFilterValues helper function', () => {
|
|
|
19
21
|
const withValues = getInitialFilterValues(...mockedProps[1]);
|
|
20
22
|
|
|
21
23
|
it('should return init filter values based on query and filterData', () => {
|
|
22
|
-
expect(withNoValue).toEqual({ search_term: '' });
|
|
24
|
+
expect(withNoValue).toEqual({ dataNotSet: false, search_term: '' });
|
|
23
25
|
expect(withValues).toEqual({
|
|
24
|
-
|
|
26
|
+
dataNotSet: false,
|
|
27
|
+
search_term: query[SEARCH_TERM],
|
|
25
28
|
rangeFilter: { max: 10, maxValue: 8, min: 5, minValue: 7, step: 1 },
|
|
26
29
|
checkboxFilter: ['check1', 'check2'],
|
|
27
30
|
emptySelect: null
|
|
28
31
|
});
|
|
29
32
|
});
|
|
33
|
+
|
|
34
|
+
it('should return init filter values without filterData', () => {
|
|
35
|
+
const withNoData = getInitialFilterValues(null, filters, query);
|
|
36
|
+
expect(withNoData).toEqual({
|
|
37
|
+
dataNotSet: true,
|
|
38
|
+
search_term: query[SEARCH_TERM],
|
|
39
|
+
rangeFilter: {
|
|
40
|
+
max: 8,
|
|
41
|
+
maxValue: 8,
|
|
42
|
+
min: 7,
|
|
43
|
+
minValue: 7,
|
|
44
|
+
step: 1
|
|
45
|
+
},
|
|
46
|
+
checkboxFilter: query.checkboxFilter,
|
|
47
|
+
emptySelect: null
|
|
48
|
+
});
|
|
49
|
+
});
|
|
30
50
|
});
|
|
@@ -30,6 +30,6 @@ describe('parseFilterValue helper function', () => {
|
|
|
30
30
|
expect(rangeValue).toEqual('rangeVal=10-20');
|
|
31
31
|
expect(checkboxArrayValue).toEqual('checkVal=check1&checkVal=check2');
|
|
32
32
|
expect(checkboxStringValue).toEqual('checkVal2=check3');
|
|
33
|
-
expect(selectValue).toEqual('selectVal=select
|
|
33
|
+
expect(selectValue).toEqual('selectVal=select%20value');
|
|
34
34
|
});
|
|
35
35
|
});
|
|
@@ -46,6 +46,18 @@ Object {
|
|
|
46
46
|
"$$typeof": Symbol(react.forward_ref),
|
|
47
47
|
"render": [Function],
|
|
48
48
|
},
|
|
49
|
+
"itemlistbutton": Object {
|
|
50
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
51
|
+
"render": [Function],
|
|
52
|
+
},
|
|
53
|
+
"itemlistcounter": Object {
|
|
54
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
55
|
+
"render": [Function],
|
|
56
|
+
},
|
|
57
|
+
"itemlistnew": Object {
|
|
58
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
59
|
+
"render": [Function],
|
|
60
|
+
},
|
|
49
61
|
"list": Object {
|
|
50
62
|
"$$typeof": Symbol(react.forward_ref),
|
|
51
63
|
"render": [Function],
|