@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
|
@@ -19,6 +19,8 @@ require("core-js/modules/es.object.to-string.js");
|
|
|
19
19
|
|
|
20
20
|
require("core-js/modules/es.array.map.js");
|
|
21
21
|
|
|
22
|
+
require("core-js/modules/es.array.concat.js");
|
|
23
|
+
|
|
22
24
|
var _react = _interopRequireDefault(require("react"));
|
|
23
25
|
|
|
24
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -36,12 +38,22 @@ var SelectFilter = function SelectFilter(_ref) {
|
|
|
36
38
|
updateFilterValues = _ref.updateFilterValues,
|
|
37
39
|
filterValues = _ref.filterValues,
|
|
38
40
|
shouldSearch = _ref.shouldSearch,
|
|
39
|
-
displayLabelAsPlaceholder = _ref.displayLabelAsPlaceholder
|
|
41
|
+
displayLabelAsPlaceholder = _ref.displayLabelAsPlaceholder,
|
|
42
|
+
displayFilterCount = _ref.displayFilterCount;
|
|
40
43
|
var filterValue = filterValues[prop] || '';
|
|
41
|
-
var
|
|
42
|
-
|
|
44
|
+
var disabledOptions = [];
|
|
45
|
+
|
|
46
|
+
var _ref2 = data[prop] || {},
|
|
47
|
+
_ref2$buckets = _ref2.buckets,
|
|
48
|
+
buckets = _ref2$buckets === void 0 ? [] : _ref2$buckets;
|
|
49
|
+
|
|
50
|
+
var options = buckets.map(function (_ref3) {
|
|
51
|
+
var key = _ref3.key,
|
|
52
|
+
count = _ref3.doc_count;
|
|
53
|
+
if (!count) disabledOptions.push(key);
|
|
54
|
+
var optionLabel = displayFilterCount ? "".concat(key, " (").concat(count, ")") : key;
|
|
55
|
+
return [key, optionLabel];
|
|
43
56
|
}).filter(Boolean).sort();
|
|
44
|
-
var optionsJoined = options;
|
|
45
57
|
var labelText = label || prop;
|
|
46
58
|
var labelToUse = labelText;
|
|
47
59
|
var defaultTextValue = _constants.DEFAULT_OPTION;
|
|
@@ -56,30 +68,34 @@ var SelectFilter = function SelectFilter(_ref) {
|
|
|
56
68
|
value: filterValue,
|
|
57
69
|
id: prop,
|
|
58
70
|
"data-testid": "filter-".concat(prop),
|
|
59
|
-
options:
|
|
71
|
+
options: options,
|
|
60
72
|
defaultTextValue: defaultTextValue,
|
|
61
|
-
onChange: function onChange(
|
|
62
|
-
var value =
|
|
73
|
+
onChange: function onChange(_ref4) {
|
|
74
|
+
var value = _ref4.value;
|
|
63
75
|
var valueToUse = value;
|
|
64
76
|
if (value === defaultTextValue) valueToUse = '';
|
|
65
77
|
updateFilterValues((0, _defineProperty2["default"])({}, prop, valueToUse), shouldSearch);
|
|
66
|
-
}
|
|
78
|
+
},
|
|
79
|
+
disabled: disabledOptions
|
|
67
80
|
});
|
|
68
81
|
};
|
|
69
82
|
|
|
70
83
|
SelectFilter.propTypes = {
|
|
71
84
|
data: _propTypes["default"].object.isRequired,
|
|
72
85
|
prop: _propTypes["default"].string.isRequired,
|
|
73
|
-
filterValues: _propTypes["default"].object
|
|
86
|
+
filterValues: _propTypes["default"].object,
|
|
74
87
|
updateFilterValues: _propTypes["default"].func.isRequired,
|
|
75
88
|
shouldSearch: _propTypes["default"].bool,
|
|
76
89
|
label: _propTypes["default"].string,
|
|
77
|
-
displayLabelAsPlaceholder: _propTypes["default"].bool
|
|
90
|
+
displayLabelAsPlaceholder: _propTypes["default"].bool,
|
|
91
|
+
displayFilterCount: _propTypes["default"].bool
|
|
78
92
|
};
|
|
79
93
|
SelectFilter.defaultProps = {
|
|
94
|
+
filterValues: {},
|
|
80
95
|
shouldSearch: false,
|
|
81
96
|
label: '',
|
|
82
|
-
displayLabelAsPlaceholder: false
|
|
97
|
+
displayLabelAsPlaceholder: false,
|
|
98
|
+
displayFilterCount: false
|
|
83
99
|
};
|
|
84
100
|
|
|
85
101
|
var _default = (0, _HOC.withTitle)(SelectFilter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["SelectFilter","data","label","prop","updateFilterValues","filterValues","shouldSearch","displayLabelAsPlaceholder","filterValue","
|
|
1
|
+
{"version":3,"file":"Select.js","names":["SelectFilter","data","label","prop","updateFilterValues","filterValues","shouldSearch","displayLabelAsPlaceholder","displayFilterCount","filterValue","disabledOptions","buckets","options","map","key","count","doc_count","push","optionLabel","filter","Boolean","sort","labelText","labelToUse","defaultTextValue","DEFAULT_OPTION","value","valueToUse","propTypes","PropTypes","object","isRequired","string","func","bool","defaultProps","withTitle"],"sources":["../../../../src/components/SearchFilter/components/Select.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Select from '@blaze-react/select';\nimport { withTitle } from '../../../HOC';\nimport { DEFAULT_OPTION } from '../constants';\n\nconst SelectFilter = ({\n data,\n label,\n prop,\n updateFilterValues,\n filterValues,\n shouldSearch,\n displayLabelAsPlaceholder,\n displayFilterCount\n}) => {\n const filterValue = filterValues[prop] || '';\n const disabledOptions = [];\n const { buckets = [] } = data[prop] || {};\n const options = buckets\n .map(({ key, doc_count: count }) => {\n if (!count) disabledOptions.push(key);\n const optionLabel = displayFilterCount ? `${key} (${count})` : key;\n return [key, optionLabel];\n })\n .filter(Boolean)\n .sort();\n\n const labelText = label || prop;\n let labelToUse = labelText;\n let defaultTextValue = DEFAULT_OPTION;\n if (displayLabelAsPlaceholder) {\n defaultTextValue = labelToUse;\n labelToUse = null;\n }\n\n return (\n <Select\n label={labelToUse}\n value={filterValue}\n id={prop}\n data-testid={`filter-${prop}`}\n options={options}\n defaultTextValue={defaultTextValue}\n onChange={({ value }) => {\n let valueToUse = value;\n if (value === defaultTextValue) valueToUse = '';\n updateFilterValues({ [prop]: valueToUse }, shouldSearch);\n }}\n disabled={disabledOptions}\n />\n );\n};\n\nSelectFilter.propTypes = {\n data: PropTypes.object.isRequired,\n prop: PropTypes.string.isRequired,\n filterValues: PropTypes.object,\n updateFilterValues: PropTypes.func.isRequired,\n shouldSearch: PropTypes.bool,\n label: PropTypes.string,\n displayLabelAsPlaceholder: PropTypes.bool,\n displayFilterCount: PropTypes.bool\n};\n\nSelectFilter.defaultProps = {\n filterValues: {},\n shouldSearch: false,\n label: '',\n displayLabelAsPlaceholder: false,\n displayFilterCount: false\n};\n\nexport default withTitle(SelectFilter);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OASf;EAAA,IARJC,IAQI,QARJA,IAQI;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,IANJC,IAMI,QANJA,IAMI;EAAA,IALJC,kBAKI,QALJA,kBAKI;EAAA,IAJJC,YAII,QAJJA,YAII;EAAA,IAHJC,YAGI,QAHJA,YAGI;EAAA,IAFJC,yBAEI,QAFJA,yBAEI;EAAA,IADJC,kBACI,QADJA,kBACI;EACJ,IAAMC,WAAW,GAAGJ,YAAY,CAACF,IAAD,CAAZ,IAAsB,EAA1C;EACA,IAAMO,eAAe,GAAG,EAAxB;;EACA,YAAyBT,IAAI,CAACE,IAAD,CAAJ,IAAc,EAAvC;EAAA,0BAAQQ,OAAR;EAAA,IAAQA,OAAR,8BAAkB,EAAlB;;EACA,IAAMC,OAAO,GAAGD,OAAO,CACpBE,GADa,CACT,iBAA+B;IAAA,IAA5BC,GAA4B,SAA5BA,GAA4B;IAAA,IAAZC,KAAY,SAAvBC,SAAuB;IAClC,IAAI,CAACD,KAAL,EAAYL,eAAe,CAACO,IAAhB,CAAqBH,GAArB;IACZ,IAAMI,WAAW,GAAGV,kBAAkB,aAAMM,GAAN,eAAcC,KAAd,SAAyBD,GAA/D;IACA,OAAO,CAACA,GAAD,EAAMI,WAAN,CAAP;EACD,CALa,EAMbC,MANa,CAMNC,OANM,EAObC,IAPa,EAAhB;EASA,IAAMC,SAAS,GAAGpB,KAAK,IAAIC,IAA3B;EACA,IAAIoB,UAAU,GAAGD,SAAjB;EACA,IAAIE,gBAAgB,GAAGC,yBAAvB;;EACA,IAAIlB,yBAAJ,EAA+B;IAC7BiB,gBAAgB,GAAGD,UAAnB;IACAA,UAAU,GAAG,IAAb;EACD;;EAED,oBACE,gCAAC,kBAAD;IACE,KAAK,EAAEA,UADT;IAEE,KAAK,EAAEd,WAFT;IAGE,EAAE,EAAEN,IAHN;IAIE,gCAAuBA,IAAvB,CAJF;IAKE,OAAO,EAAES,OALX;IAME,gBAAgB,EAAEY,gBANpB;IAOE,QAAQ,EAAE,yBAAe;MAAA,IAAZE,KAAY,SAAZA,KAAY;MACvB,IAAIC,UAAU,GAAGD,KAAjB;MACA,IAAIA,KAAK,KAAKF,gBAAd,EAAgCG,UAAU,GAAG,EAAb;MAChCvB,kBAAkB,sCAAID,IAAJ,EAAWwB,UAAX,GAAyBrB,YAAzB,CAAlB;IACD,CAXH;IAYE,QAAQ,EAAEI;EAZZ,EADF;AAgBD,CA9CD;;AAgDAV,YAAY,CAAC4B,SAAb,GAAyB;EACvB3B,IAAI,EAAE4B,qBAAA,CAAUC,MAAV,CAAiBC,UADA;EAEvB5B,IAAI,EAAE0B,qBAAA,CAAUG,MAAV,CAAiBD,UAFA;EAGvB1B,YAAY,EAAEwB,qBAAA,CAAUC,MAHD;EAIvB1B,kBAAkB,EAAEyB,qBAAA,CAAUI,IAAV,CAAeF,UAJZ;EAKvBzB,YAAY,EAAEuB,qBAAA,CAAUK,IALD;EAMvBhC,KAAK,EAAE2B,qBAAA,CAAUG,MANM;EAOvBzB,yBAAyB,EAAEsB,qBAAA,CAAUK,IAPd;EAQvB1B,kBAAkB,EAAEqB,qBAAA,CAAUK;AARP,CAAzB;AAWAlC,YAAY,CAACmC,YAAb,GAA4B;EAC1B9B,YAAY,EAAE,EADY;EAE1BC,YAAY,EAAE,KAFY;EAG1BJ,KAAK,EAAE,EAHmB;EAI1BK,yBAAyB,EAAE,KAJD;EAK1BC,kBAAkB,EAAE;AALM,CAA5B;;eAQe,IAAA4B,cAAA,EAAUpC,YAAV,C"}
|
|
@@ -26,9 +26,7 @@ var _constants = require("../constants");
|
|
|
26
26
|
var TextSearch = function TextSearch(_ref) {
|
|
27
27
|
var label = _ref.label,
|
|
28
28
|
searchValue = _ref.searchValue,
|
|
29
|
-
updateFilterValues = _ref.updateFilterValues
|
|
30
|
-
handleSubmit = _ref.handleSubmit,
|
|
31
|
-
filterValues = _ref.filterValues;
|
|
29
|
+
updateFilterValues = _ref.updateFilterValues;
|
|
32
30
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
33
31
|
className: "search"
|
|
34
32
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -54,10 +52,8 @@ var TextSearch = function TextSearch(_ref) {
|
|
|
54
52
|
};
|
|
55
53
|
|
|
56
54
|
TextSearch.propTypes = {
|
|
57
|
-
filterValues: _propTypes["default"].object.isRequired,
|
|
58
55
|
searchValue: _propTypes["default"].string.isRequired,
|
|
59
56
|
updateFilterValues: _propTypes["default"].func.isRequired,
|
|
60
|
-
handleSubmit: _propTypes["default"].func.isRequired,
|
|
61
57
|
label: _propTypes["default"].string
|
|
62
58
|
};
|
|
63
59
|
TextSearch.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSearch.js","names":["TextSearch","label","searchValue","updateFilterValues","
|
|
1
|
+
{"version":3,"file":"TextSearch.js","names":["TextSearch","label","searchValue","updateFilterValues","SEARCH_TERM","eValue","value","e","preventDefault","propTypes","PropTypes","string","isRequired","func","defaultProps","withTitle"],"sources":["../../../../src/components/SearchFilter/components/TextSearch.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport Input from '@blaze-react/input';\nimport { MdSearch } from 'react-icons/md';\nimport { withTitle } from '../../../HOC';\nimport { SEARCH_TERM } from '../constants';\n\nconst TextSearch = ({ label, searchValue, updateFilterValues }) => (\n <div className=\"search\">\n <div className=\"search__wrapper\">\n <div className=\"form-field form-field--input form-field--search\">\n <Input\n id={SEARCH_TERM}\n value={searchValue}\n placeholder={label || 'Search'}\n onChange={({ value: eValue }) => {\n updateFilterValues({ [SEARCH_TERM]: eValue }, false);\n }}\n />\n </div>\n <button\n type=\"button\"\n className=\"icon-button icon-button--search\"\n onClick={e => {\n e.preventDefault();\n updateFilterValues({ [SEARCH_TERM]: searchValue }, true);\n }}>\n <i>\n <MdSearch />\n </i>\n </button>\n </div>\n </div>\n);\n\nTextSearch.propTypes = {\n searchValue: PropTypes.string.isRequired,\n updateFilterValues: PropTypes.func.isRequired,\n label: PropTypes.string\n};\n\nTextSearch.defaultProps = {\n label: ''\n};\n\nexport default withTitle(TextSearch);\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa;EAAA,IAAGC,KAAH,QAAGA,KAAH;EAAA,IAAUC,WAAV,QAAUA,WAAV;EAAA,IAAuBC,kBAAvB,QAAuBA,kBAAvB;EAAA,oBACjB;IAAK,SAAS,EAAC;EAAf,gBACE;IAAK,SAAS,EAAC;EAAf,gBACE;IAAK,SAAS,EAAC;EAAf,gBACE,gCAAC,iBAAD;IACE,EAAE,EAAEC,sBADN;IAEE,KAAK,EAAEF,WAFT;IAGE,WAAW,EAAED,KAAK,IAAI,QAHxB;IAIE,QAAQ,EAAE,yBAAuB;MAAA,IAAbI,MAAa,SAApBC,KAAoB;MAC/BH,kBAAkB,sCAAIC,sBAAJ,EAAkBC,MAAlB,GAA4B,KAA5B,CAAlB;IACD;EANH,EADF,CADF,eAWE;IACE,IAAI,EAAC,QADP;IAEE,SAAS,EAAC,iCAFZ;IAGE,OAAO,EAAE,iBAAAE,CAAC,EAAI;MACZA,CAAC,CAACC,cAAF;MACAL,kBAAkB,sCAAIC,sBAAJ,EAAkBF,WAAlB,GAAiC,IAAjC,CAAlB;IACD;EANH,gBAOE,wDACE,gCAAC,YAAD,OADF,CAPF,CAXF,CADF,CADiB;AAAA,CAAnB;;AA4BAF,UAAU,CAACS,SAAX,GAAuB;EACrBP,WAAW,EAAEQ,qBAAA,CAAUC,MAAV,CAAiBC,UADT;EAErBT,kBAAkB,EAAEO,qBAAA,CAAUG,IAAV,CAAeD,UAFd;EAGrBX,KAAK,EAAES,qBAAA,CAAUC;AAHI,CAAvB;AAMAX,UAAU,CAACc,YAAX,GAA0B;EACxBb,KAAK,EAAE;AADiB,CAA1B;;eAIe,IAAAc,cAAA,EAAUf,UAAV,C"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
require("core-js/modules/es.number.constructor.js");
|
|
17
|
+
|
|
18
|
+
require("core-js/modules/es.array.is-array.js");
|
|
19
|
+
|
|
20
|
+
require("core-js/modules/es.array.for-each.js");
|
|
21
|
+
|
|
22
|
+
require("core-js/modules/es.object.to-string.js");
|
|
23
|
+
|
|
24
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.object.keys.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.array.includes.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.string.includes.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
33
|
+
|
|
34
|
+
require("core-js/modules/es.string.split.js");
|
|
35
|
+
|
|
36
|
+
require("core-js/modules/es.array.index-of.js");
|
|
37
|
+
|
|
38
|
+
var QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];
|
|
39
|
+
|
|
40
|
+
var builFilterObject = function builFilterObject(queryKey, value, filters, isRange) {
|
|
41
|
+
if (isRange) {
|
|
42
|
+
// don't add to query if value matches range values
|
|
43
|
+
if (value.min !== value.minValue && value.max !== value.maxValue) {
|
|
44
|
+
filters.push({
|
|
45
|
+
range: (0, _defineProperty2["default"])({}, queryKey, {
|
|
46
|
+
gte: Number(value.min),
|
|
47
|
+
lte: Number(value.max)
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var key = isRange ? queryKey : "".concat(queryKey, ".keyword");
|
|
56
|
+
var isArray = Array.isArray(value);
|
|
57
|
+
|
|
58
|
+
if (!isArray) {
|
|
59
|
+
var singleFilterObj = {
|
|
60
|
+
match: (0, _defineProperty2["default"])({}, key, value)
|
|
61
|
+
};
|
|
62
|
+
filters.push(singleFilterObj);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
value.forEach(function (filterValue) {
|
|
67
|
+
filters.push({
|
|
68
|
+
match: (0, _defineProperty2["default"])({}, key, filterValue)
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var buildFiltersQuery = function buildFiltersQuery(query, filterBy, filterByProperty, rangeValues) {
|
|
74
|
+
var mustFilters = [];
|
|
75
|
+
Object.keys(query).forEach(function (queryKey) {
|
|
76
|
+
if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;
|
|
77
|
+
if (!queryKey || !query[queryKey]) return;
|
|
78
|
+
var queryValue = query[queryKey];
|
|
79
|
+
var isRange = rangeValues.includes(queryKey);
|
|
80
|
+
builFilterObject(queryKey, queryValue, mustFilters, isRange);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
if (filterByProperty && filterByProperty.length) {
|
|
84
|
+
filterByProperty && filterByProperty.forEach(function (filterByPropOption) {
|
|
85
|
+
var _filterByPropOption$s = filterByPropOption.split('/'),
|
|
86
|
+
_filterByPropOption$s2 = (0, _slicedToArray2["default"])(_filterByPropOption$s, 1),
|
|
87
|
+
filterByPropKey = _filterByPropOption$s2[0];
|
|
88
|
+
|
|
89
|
+
filterBy.forEach(function (filterByOption) {
|
|
90
|
+
if (filterByOption.indexOf(filterByPropKey) === -1) return;
|
|
91
|
+
|
|
92
|
+
var _filterByOption$split = filterByOption.split('/'),
|
|
93
|
+
_filterByOption$split2 = (0, _slicedToArray2["default"])(_filterByOption$split, 2),
|
|
94
|
+
filteryByValue = _filterByOption$split2[1];
|
|
95
|
+
|
|
96
|
+
var filterByKeyword = "".concat(filterByPropKey, ".keyword");
|
|
97
|
+
if (!filteryByValue) return;
|
|
98
|
+
mustFilters.push({
|
|
99
|
+
match: (0, _defineProperty2["default"])({}, filterByKeyword, filteryByValue)
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return mustFilters;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var _default = buildFiltersQuery;
|
|
109
|
+
exports["default"] = _default;
|
|
110
|
+
//# sourceMappingURL=build-filters-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-filters-query.js","names":["QUERY_KEYS_TO_IGNORE","builFilterObject","queryKey","value","filters","isRange","min","minValue","max","maxValue","push","range","gte","Number","lte","key","isArray","Array","singleFilterObj","match","forEach","filterValue","buildFiltersQuery","query","filterBy","filterByProperty","rangeValues","mustFilters","Object","keys","includes","queryValue","length","filterByPropOption","split","filterByPropKey","filterByOption","indexOf","filteryByValue","filterByKeyword"],"sources":["../../../../src/components/SearchFilter/helpers/build-filters-query.js"],"sourcesContent":["const QUERY_KEYS_TO_IGNORE = ['dataNotSet', 'shouldSearch', 'search_term'];\n\nconst builFilterObject = (queryKey, value, filters, isRange) => {\n if (isRange) {\n // don't add to query if value matches range values\n if (value.min !== value.minValue && value.max !== value.maxValue) {\n filters.push({\n range: {\n [queryKey]: {\n gte: Number(value.min),\n lte: Number(value.max)\n }\n }\n });\n }\n return;\n }\n\n const key = isRange ? queryKey : `${queryKey}.keyword`;\n\n const isArray = Array.isArray(value);\n if (!isArray) {\n const singleFilterObj = { match: { [key]: value } };\n filters.push(singleFilterObj);\n return;\n }\n\n value.forEach(filterValue => {\n filters.push({ match: { [key]: filterValue } });\n });\n};\nconst buildFiltersQuery = (query, filterBy, filterByProperty, rangeValues) => {\n const mustFilters = [];\n Object.keys(query).forEach(queryKey => {\n if (QUERY_KEYS_TO_IGNORE.includes(queryKey)) return;\n if (!queryKey || !query[queryKey]) return;\n const queryValue = query[queryKey];\n\n const isRange = rangeValues.includes(queryKey);\n builFilterObject(queryKey, queryValue, mustFilters, isRange);\n });\n\n if (filterByProperty && filterByProperty.length) {\n filterByProperty &&\n filterByProperty.forEach(filterByPropOption => {\n const [filterByPropKey] = filterByPropOption.split('/');\n filterBy.forEach(filterByOption => {\n if (filterByOption.indexOf(filterByPropKey) === -1) return;\n const [, filteryByValue] = filterByOption.split('/');\n const filterByKeyword = `${filterByPropKey}.keyword`;\n if (!filteryByValue) return;\n mustFilters.push({ match: { [filterByKeyword]: filteryByValue } });\n });\n });\n }\n\n return mustFilters;\n};\n\nexport default buildFiltersQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,oBAAoB,GAAG,CAAC,YAAD,EAAe,cAAf,EAA+B,aAA/B,CAA7B;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,QAAD,EAAWC,KAAX,EAAkBC,OAAlB,EAA2BC,OAA3B,EAAuC;EAC9D,IAAIA,OAAJ,EAAa;IACX;IACA,IAAIF,KAAK,CAACG,GAAN,KAAcH,KAAK,CAACI,QAApB,IAAgCJ,KAAK,CAACK,GAAN,KAAcL,KAAK,CAACM,QAAxD,EAAkE;MAChEL,OAAO,CAACM,IAAR,CAAa;QACXC,KAAK,uCACFT,QADE,EACS;UACVU,GAAG,EAAEC,MAAM,CAACV,KAAK,CAACG,GAAP,CADD;UAEVQ,GAAG,EAAED,MAAM,CAACV,KAAK,CAACK,GAAP;QAFD,CADT;MADM,CAAb;IAQD;;IACD;EACD;;EAED,IAAMO,GAAG,GAAGV,OAAO,GAAGH,QAAH,aAAiBA,QAAjB,aAAnB;EAEA,IAAMc,OAAO,GAAGC,KAAK,CAACD,OAAN,CAAcb,KAAd,CAAhB;;EACA,IAAI,CAACa,OAAL,EAAc;IACZ,IAAME,eAAe,GAAG;MAAEC,KAAK,uCAAKJ,GAAL,EAAWZ,KAAX;IAAP,CAAxB;IACAC,OAAO,CAACM,IAAR,CAAaQ,eAAb;IACA;EACD;;EAEDf,KAAK,CAACiB,OAAN,CAAc,UAAAC,WAAW,EAAI;IAC3BjB,OAAO,CAACM,IAAR,CAAa;MAAES,KAAK,uCAAKJ,GAAL,EAAWM,WAAX;IAAP,CAAb;EACD,CAFD;AAGD,CA5BD;;AA6BA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,KAAD,EAAQC,QAAR,EAAkBC,gBAAlB,EAAoCC,WAApC,EAAoD;EAC5E,IAAMC,WAAW,GAAG,EAApB;EACAC,MAAM,CAACC,IAAP,CAAYN,KAAZ,EAAmBH,OAAnB,CAA2B,UAAAlB,QAAQ,EAAI;IACrC,IAAIF,oBAAoB,CAAC8B,QAArB,CAA8B5B,QAA9B,CAAJ,EAA6C;IAC7C,IAAI,CAACA,QAAD,IAAa,CAACqB,KAAK,CAACrB,QAAD,CAAvB,EAAmC;IACnC,IAAM6B,UAAU,GAAGR,KAAK,CAACrB,QAAD,CAAxB;IAEA,IAAMG,OAAO,GAAGqB,WAAW,CAACI,QAAZ,CAAqB5B,QAArB,CAAhB;IACAD,gBAAgB,CAACC,QAAD,EAAW6B,UAAX,EAAuBJ,WAAvB,EAAoCtB,OAApC,CAAhB;EACD,CAPD;;EASA,IAAIoB,gBAAgB,IAAIA,gBAAgB,CAACO,MAAzC,EAAiD;IAC/CP,gBAAgB,IACdA,gBAAgB,CAACL,OAAjB,CAAyB,UAAAa,kBAAkB,EAAI;MAC7C,4BAA0BA,kBAAkB,CAACC,KAAnB,CAAyB,GAAzB,CAA1B;MAAA;MAAA,IAAOC,eAAP;;MACAX,QAAQ,CAACJ,OAAT,CAAiB,UAAAgB,cAAc,EAAI;QACjC,IAAIA,cAAc,CAACC,OAAf,CAAuBF,eAAvB,MAA4C,CAAC,CAAjD,EAAoD;;QACpD,4BAA2BC,cAAc,CAACF,KAAf,CAAqB,GAArB,CAA3B;QAAA;QAAA,IAASI,cAAT;;QACA,IAAMC,eAAe,aAAMJ,eAAN,aAArB;QACA,IAAI,CAACG,cAAL,EAAqB;QACrBX,WAAW,CAACjB,IAAZ,CAAiB;UAAES,KAAK,uCAAKoB,eAAL,EAAuBD,cAAvB;QAAP,CAAjB;MACD,CAND;IAOD,CATD,CADF;EAWD;;EAED,OAAOX,WAAP;AACD,CA1BD;;eA4BeL,iB"}
|
|
@@ -27,7 +27,7 @@ var _parseFilterValue = _interopRequireDefault(require("./parse-filter-value"));
|
|
|
27
27
|
|
|
28
28
|
var buildQuery = function buildQuery(filterValues, filters) {
|
|
29
29
|
var newQuery = [];
|
|
30
|
-
var searchValue = filterValues[_constants.SEARCH_TERM];
|
|
30
|
+
var searchValue = filterValues[_constants.SEARCH_TERM] ? encodeURIComponent(filterValues[_constants.SEARCH_TERM]) : '';
|
|
31
31
|
if (searchValue) newQuery.push("".concat(_constants.SEARCH_TERM, "=").concat(searchValue));
|
|
32
32
|
filters.forEach(function (_ref) {
|
|
33
33
|
var propsToDisplay = _ref.propsToDisplay,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-query.js","names":["buildQuery","filterValues","filters","newQuery","searchValue","SEARCH_TERM","push","forEach","propsToDisplay","type","TEXT_SEARCH","prop","value","parsedValue","includes","join"],"sources":["../../../../src/components/SearchFilter/helpers/build-query.js"],"sourcesContent":["import { SEARCH_TERM, TEXT_SEARCH } from '../constants';\nimport parseFilterValue from './parse-filter-value';\n\nconst buildQuery = (filterValues, filters) => {\n const newQuery = [];\n const searchValue = filterValues[SEARCH_TERM];\n if (searchValue) newQuery.push(`${SEARCH_TERM}=${searchValue}`);\n\n filters.forEach(({ propsToDisplay, type }) => {\n if (type === TEXT_SEARCH) return;\n\n propsToDisplay.forEach(prop => {\n const value = filterValues[prop];\n const parsedValue = parseFilterValue(prop, type, value);\n if (parsedValue && !newQuery.includes(parsedValue)) {\n newQuery.push(parsedValue);\n }\n });\n });\n\n return newQuery.join('&');\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAeC,OAAf,EAA2B;EAC5C,IAAMC,QAAQ,GAAG,EAAjB;EACA,IAAMC,WAAW,GAAGH,YAAY,CAACI,sBAAD,
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["buildQuery","filterValues","filters","newQuery","searchValue","SEARCH_TERM","encodeURIComponent","push","forEach","propsToDisplay","type","TEXT_SEARCH","prop","value","parsedValue","parseFilterValue","includes","join"],"sources":["../../../../src/components/SearchFilter/helpers/build-query.js"],"sourcesContent":["import { SEARCH_TERM, TEXT_SEARCH } from '../constants';\nimport parseFilterValue from './parse-filter-value';\n\nconst buildQuery = (filterValues, filters) => {\n const newQuery = [];\n const searchValue = filterValues[SEARCH_TERM]\n ? encodeURIComponent(filterValues[SEARCH_TERM])\n : '';\n if (searchValue) newQuery.push(`${SEARCH_TERM}=${searchValue}`);\n\n filters.forEach(({ propsToDisplay, type }) => {\n if (type === TEXT_SEARCH) return;\n\n propsToDisplay.forEach(prop => {\n const value = filterValues[prop];\n const parsedValue = parseFilterValue(prop, type, value);\n if (parsedValue && !newQuery.includes(parsedValue)) {\n newQuery.push(parsedValue);\n }\n });\n });\n\n return newQuery.join('&');\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,YAAD,EAAeC,OAAf,EAA2B;EAC5C,IAAMC,QAAQ,GAAG,EAAjB;EACA,IAAMC,WAAW,GAAGH,YAAY,CAACI,sBAAD,CAAZ,GAChBC,kBAAkB,CAACL,YAAY,CAACI,sBAAD,CAAb,CADF,GAEhB,EAFJ;EAGA,IAAID,WAAJ,EAAiBD,QAAQ,CAACI,IAAT,WAAiBF,sBAAjB,cAAgCD,WAAhC;EAEjBF,OAAO,CAACM,OAAR,CAAgB,gBAA8B;IAAA,IAA3BC,cAA2B,QAA3BA,cAA2B;IAAA,IAAXC,IAAW,QAAXA,IAAW;IAC5C,IAAIA,IAAI,KAAKC,sBAAb,EAA0B;IAE1BF,cAAc,CAACD,OAAf,CAAuB,UAAAI,IAAI,EAAI;MAC7B,IAAMC,KAAK,GAAGZ,YAAY,CAACW,IAAD,CAA1B;MACA,IAAME,WAAW,GAAG,IAAAC,4BAAA,EAAiBH,IAAjB,EAAuBF,IAAvB,EAA6BG,KAA7B,CAApB;;MACA,IAAIC,WAAW,IAAI,CAACX,QAAQ,CAACa,QAAT,CAAkBF,WAAlB,CAApB,EAAoD;QAClDX,QAAQ,CAACI,IAAT,CAAcO,WAAd;MACD;IACF,CAND;EAOD,CAVD;EAYA,OAAOX,QAAQ,CAACc,IAAT,CAAc,GAAd,CAAP;AACD,CApBD;;eAsBejB,U"}
|
|
@@ -18,6 +18,7 @@ require("core-js/modules/es.array.concat.js");
|
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
|
|
20
20
|
var buildRawQueryStringified = function buildRawQueryStringified(checkboxSelectValues, rangeValues, entity) {
|
|
21
|
+
var mustFilters = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
21
22
|
if (!checkboxSelectValues.length && !rangeValues.length) return '';
|
|
22
23
|
var aggs = {};
|
|
23
24
|
checkboxSelectValues.forEach(function (fieldName) {
|
|
@@ -35,20 +36,26 @@ var buildRawQueryStringified = function buildRawQueryStringified(checkboxSelectV
|
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
});
|
|
39
|
+
var boolFilter = {
|
|
40
|
+
should: [{
|
|
41
|
+
match: {
|
|
42
|
+
docType: entity
|
|
43
|
+
}
|
|
44
|
+
}],
|
|
45
|
+
minimum_should_match: 1
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
if (mustFilters.length) {
|
|
49
|
+
boolFilter.must = mustFilters;
|
|
50
|
+
}
|
|
51
|
+
|
|
38
52
|
return JSON.stringify({
|
|
39
53
|
aggs: aggs,
|
|
40
54
|
size: 0,
|
|
41
55
|
query: {
|
|
42
56
|
bool: {
|
|
43
57
|
filter: {
|
|
44
|
-
bool:
|
|
45
|
-
should: [{
|
|
46
|
-
match: {
|
|
47
|
-
docType: entity
|
|
48
|
-
}
|
|
49
|
-
}],
|
|
50
|
-
minimum_should_match: 1
|
|
51
|
-
}
|
|
58
|
+
bool: boolFilter
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-raw-query-stringified.js","names":["buildRawQueryStringified","checkboxSelectValues","rangeValues","entity","length","aggs","forEach","fieldName","terms","field","KEYWORD","size","SIZE","stats","
|
|
1
|
+
{"version":3,"file":"build-raw-query-stringified.js","names":["buildRawQueryStringified","checkboxSelectValues","rangeValues","entity","mustFilters","length","aggs","forEach","fieldName","terms","field","KEYWORD","size","SIZE","stats","boolFilter","should","match","docType","minimum_should_match","must","JSON","stringify","query","bool","filter"],"sources":["../../../../src/components/SearchFilter/helpers/build-raw-query-stringified.js"],"sourcesContent":["import { KEYWORD, SIZE } from '../constants';\n\nconst buildRawQueryStringified = (checkboxSelectValues, rangeValues, entity, mustFilters = []) => {\n if (!checkboxSelectValues.length && !rangeValues.length) return '';\n\n const aggs = {};\n\n checkboxSelectValues.forEach(fieldName => {\n aggs[fieldName] = {\n terms: {\n field: `${fieldName}.${KEYWORD}`,\n size: SIZE\n }\n };\n });\n\n rangeValues.forEach(fieldName => {\n aggs[fieldName] = {\n stats: {\n field: fieldName\n }\n };\n });\n\n const boolFilter = {\n should: [\n {\n match: {\n docType: entity\n }\n }\n ],\n minimum_should_match: 1\n };\n\n if (mustFilters.length) {\n boolFilter.must = mustFilters;\n }\n\n return JSON.stringify({\n aggs,\n size: 0,\n query: {\n bool: {\n filter: {\n bool: boolFilter\n }\n }\n }\n });\n};\n\nexport default buildRawQueryStringified;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,oBAAD,EAAuBC,WAAvB,EAAoCC,MAApC,EAAiE;EAAA,IAArBC,WAAqB,uEAAP,EAAO;EAChG,IAAI,CAACH,oBAAoB,CAACI,MAAtB,IAAgC,CAACH,WAAW,CAACG,MAAjD,EAAyD,OAAO,EAAP;EAEzD,IAAMC,IAAI,GAAG,EAAb;EAEAL,oBAAoB,CAACM,OAArB,CAA6B,UAAAC,SAAS,EAAI;IACxCF,IAAI,CAACE,SAAD,CAAJ,GAAkB;MAChBC,KAAK,EAAE;QACLC,KAAK,YAAKF,SAAL,cAAkBG,kBAAlB,CADA;QAELC,IAAI,EAAEC;MAFD;IADS,CAAlB;EAMD,CAPD;EASAX,WAAW,CAACK,OAAZ,CAAoB,UAAAC,SAAS,EAAI;IAC/BF,IAAI,CAACE,SAAD,CAAJ,GAAkB;MAChBM,KAAK,EAAE;QACLJ,KAAK,EAAEF;MADF;IADS,CAAlB;EAKD,CAND;EAQA,IAAMO,UAAU,GAAG;IACjBC,MAAM,EAAE,CACN;MACEC,KAAK,EAAE;QACLC,OAAO,EAAEf;MADJ;IADT,CADM,CADS;IAQjBgB,oBAAoB,EAAE;EARL,CAAnB;;EAWA,IAAIf,WAAW,CAACC,MAAhB,EAAwB;IACtBU,UAAU,CAACK,IAAX,GAAkBhB,WAAlB;EACD;;EAED,OAAOiB,IAAI,CAACC,SAAL,CAAe;IACpBhB,IAAI,EAAJA,IADoB;IAEpBM,IAAI,EAAE,CAFc;IAGpBW,KAAK,EAAE;MACLC,IAAI,EAAE;QACJC,MAAM,EAAE;UACND,IAAI,EAAET;QADA;MADJ;IADD;EAHa,CAAf,CAAP;AAWD,CAhDD;;eAkDef,wB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate-min-max.js","names":["calculateMinMax","filterAggregations","rangeInterval","min","max","Math","floor","Number","ceil","step"],"sources":["../../../../src/components/SearchFilter/helpers/calculate-min-max.js"],"sourcesContent":["import calculateStep from './calculate-step';\n\nconst calculateMinMax = (filterAggregations, rangeInterval) => {\n let { min, max } = filterAggregations;\n min = Math.floor(Number(min));\n max = Math.ceil(Number(max));\n min -= min % rangeInterval;\n const step = calculateStep(max, rangeInterval);\n max += step;\n return { min, max };\n};\n\nexport default calculateMinMax;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,kBAAD,EAAqBC,aAArB,EAAuC;EAC7D,IAAMC,GAAN,GAAmBF,kBAAnB,CAAME,GAAN;EAAA,IAAWC,GAAX,GAAmBH,kBAAnB,CAAWG,GAAX;EACAD,GAAG,GAAGE,IAAI,CAACC,KAAL,CAAWC,MAAM,CAACJ,GAAD,CAAjB,CAAN;EACAC,GAAG,GAAGC,IAAI,CAACG,IAAL,CAAUD,MAAM,CAACH,GAAD,CAAhB,CAAN;EACAD,GAAG,IAAIA,GAAG,GAAGD,aAAb;EACA,IAAMO,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"calculate-min-max.js","names":["calculateMinMax","filterAggregations","rangeInterval","min","max","Math","floor","Number","ceil","step","calculateStep"],"sources":["../../../../src/components/SearchFilter/helpers/calculate-min-max.js"],"sourcesContent":["import calculateStep from './calculate-step';\n\nconst calculateMinMax = (filterAggregations, rangeInterval) => {\n let { min, max } = filterAggregations;\n min = Math.floor(Number(min));\n max = Math.ceil(Number(max));\n min -= min % rangeInterval;\n const step = calculateStep(max, rangeInterval);\n max += step;\n return { min, max };\n};\n\nexport default calculateMinMax;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,kBAAD,EAAqBC,aAArB,EAAuC;EAC7D,IAAMC,GAAN,GAAmBF,kBAAnB,CAAME,GAAN;EAAA,IAAWC,GAAX,GAAmBH,kBAAnB,CAAWG,GAAX;EACAD,GAAG,GAAGE,IAAI,CAACC,KAAL,CAAWC,MAAM,CAACJ,GAAD,CAAjB,CAAN;EACAC,GAAG,GAAGC,IAAI,CAACG,IAAL,CAAUD,MAAM,CAACH,GAAD,CAAhB,CAAN;EACAD,GAAG,IAAIA,GAAG,GAAGD,aAAb;EACA,IAAMO,IAAI,GAAG,IAAAC,yBAAA,EAAcN,GAAd,EAAmBF,aAAnB,CAAb;EACAE,GAAG,IAAIK,IAAP;EACA,OAAO;IAAEN,GAAG,EAAHA,GAAF;IAAOC,GAAG,EAAHA;EAAP,CAAP;AACD,CARD;;eAUeJ,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-if-range-updated.js","names":["checkIfRangeUpdated","value","min","max","minValue","maxValue"],"sources":["../../../../src/components/SearchFilter/helpers/check-if-range-updated.js"],"sourcesContent":["import { isBrowser } from '../../../helpers';\n\nconst checkIfRangeUpdated = (value, min, max) => {\n const { minValue, maxValue } = value;\n return isBrowser() && (minValue !== min || maxValue !== max);\n};\n\nexport default checkIfRangeUpdated;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD,EAAQC,GAAR,EAAaC,GAAb,EAAqB;EAC/C,IAAQC,QAAR,GAA+BH,KAA/B,CAAQG,QAAR;EAAA,IAAkBC,QAAlB,GAA+BJ,KAA/B,CAAkBI,QAAlB;EACA,OAAO,
|
|
1
|
+
{"version":3,"file":"check-if-range-updated.js","names":["checkIfRangeUpdated","value","min","max","minValue","maxValue","isBrowser"],"sources":["../../../../src/components/SearchFilter/helpers/check-if-range-updated.js"],"sourcesContent":["import { isBrowser } from '../../../helpers';\n\nconst checkIfRangeUpdated = (value, min, max) => {\n const { minValue, maxValue } = value;\n return isBrowser() && (minValue !== min || maxValue !== max);\n};\n\nexport default checkIfRangeUpdated;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,KAAD,EAAQC,GAAR,EAAaC,GAAb,EAAqB;EAC/C,IAAQC,QAAR,GAA+BH,KAA/B,CAAQG,QAAR;EAAA,IAAkBC,QAAlB,GAA+BJ,KAA/B,CAAkBI,QAAlB;EACA,OAAO,IAAAC,kBAAA,QAAgBF,QAAQ,KAAKF,GAAb,IAAoBG,QAAQ,KAAKF,GAAjD,CAAP;AACD,CAHD;;eAKeH,mB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-filter-value-from-query.js","names":["getFilterValueFromQuery","key","filterProps","filterData","query","min","max","rangeInterval","type","queryValue","RANGE","CHECKBOX","map","val","SELECT"],"sources":["../../../../src/components/SearchFilter/helpers/get-filter-value-from-query.js"],"sourcesContent":["import { RANGE, CHECKBOX, SELECT } from '../constants';\nimport getRangeValue from './get-range-value';\nimport { decodeValue } from './decode-encode';\n\nconst getFilterValueFromQuery = (key, filterProps, filterData, query) => {\n const { min, max } = filterData;\n const { rangeInterval, type } = filterProps;\n const queryValue = query[key];\n if (!queryValue && type !== RANGE) return null;\n\n switch (type) {\n case RANGE:\n return getRangeValue(queryValue, rangeInterval, min, max);\n case CHECKBOX:\n return typeof queryValue === 'string'\n ? [decodeValue(queryValue)]\n : queryValue.map(val => decodeValue(val));\n case SELECT:\n return decodeValue(queryValue);\n\n default:\n return null;\n }\n};\n\nexport default getFilterValueFromQuery;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAA0B,CAACC,GAAD,EAAMC,WAAN,EAAmBC,UAAnB,EAA+BC,KAA/B,EAAyC;EACvE,IAAQC,GAAR,GAAqBF,UAArB,CAAQE,GAAR;EAAA,IAAaC,GAAb,GAAqBH,UAArB,CAAaG,GAAb;EACA,IAAQC,aAAR,GAAgCL,WAAhC,CAAQK,aAAR;EAAA,IAAuBC,IAAvB,GAAgCN,WAAhC,CAAuBM,IAAvB;EACA,IAAMC,UAAU,GAAGL,KAAK,CAACH,GAAD,CAAxB;EACA,IAAI,CAACQ,UAAD,IAAeD,IAAI,KAAKE,gBAA5B,EAAmC,OAAO,IAAP;;EAEnC,QAAQF,IAAR;IACE,KAAKE,gBAAL;MACE,OAAO
|
|
1
|
+
{"version":3,"file":"get-filter-value-from-query.js","names":["getFilterValueFromQuery","key","filterProps","filterData","query","min","max","rangeInterval","type","queryValue","RANGE","getRangeValue","CHECKBOX","decodeValue","map","val","SELECT"],"sources":["../../../../src/components/SearchFilter/helpers/get-filter-value-from-query.js"],"sourcesContent":["import { RANGE, CHECKBOX, SELECT } from '../constants';\nimport getRangeValue from './get-range-value';\nimport { decodeValue } from './decode-encode';\n\nconst getFilterValueFromQuery = (key, filterProps, filterData, query) => {\n const { min, max } = filterData;\n const { rangeInterval, type } = filterProps;\n const queryValue = query[key];\n if (!queryValue && type !== RANGE) return null;\n\n switch (type) {\n case RANGE:\n return getRangeValue(queryValue, rangeInterval, min, max);\n case CHECKBOX:\n return typeof queryValue === 'string'\n ? [decodeValue(queryValue)]\n : queryValue.map(val => decodeValue(val));\n case SELECT:\n return decodeValue(queryValue);\n\n default:\n return null;\n }\n};\n\nexport default getFilterValueFromQuery;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAA0B,CAACC,GAAD,EAAMC,WAAN,EAAmBC,UAAnB,EAA+BC,KAA/B,EAAyC;EACvE,IAAQC,GAAR,GAAqBF,UAArB,CAAQE,GAAR;EAAA,IAAaC,GAAb,GAAqBH,UAArB,CAAaG,GAAb;EACA,IAAQC,aAAR,GAAgCL,WAAhC,CAAQK,aAAR;EAAA,IAAuBC,IAAvB,GAAgCN,WAAhC,CAAuBM,IAAvB;EACA,IAAMC,UAAU,GAAGL,KAAK,CAACH,GAAD,CAAxB;EACA,IAAI,CAACQ,UAAD,IAAeD,IAAI,KAAKE,gBAA5B,EAAmC,OAAO,IAAP;;EAEnC,QAAQF,IAAR;IACE,KAAKE,gBAAL;MACE,OAAO,IAAAC,yBAAA,EAAcF,UAAd,EAA0BF,aAA1B,EAAyCF,GAAzC,EAA8CC,GAA9C,CAAP;;IACF,KAAKM,mBAAL;MACE,OAAO,OAAOH,UAAP,KAAsB,QAAtB,GACH,CAAC,IAAAI,yBAAA,EAAYJ,UAAZ,CAAD,CADG,GAEHA,UAAU,CAACK,GAAX,CAAe,UAAAC,GAAG;QAAA,OAAI,IAAAF,yBAAA,EAAYE,GAAZ,CAAJ;MAAA,CAAlB,CAFJ;;IAGF,KAAKC,iBAAL;MACE,OAAO,IAAAH,yBAAA,EAAYJ,UAAZ,CAAP;;IAEF;MACE,OAAO,IAAP;EAXJ;AAaD,CAnBD;;eAqBeT,uB"}
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
12
14
|
require("core-js/modules/es.array.for-each.js");
|
|
13
15
|
|
|
14
16
|
require("core-js/modules/es.object.to-string.js");
|
|
@@ -25,6 +27,19 @@ var _getFilterValueFromQuery = _interopRequireDefault(require("./get-filter-valu
|
|
|
25
27
|
|
|
26
28
|
var getInitialFilterValues = function getInitialFilterValues(filterData, filters, query) {
|
|
27
29
|
var filterValues = {};
|
|
30
|
+
filterValues[_constants.SEARCH_TERM] = query[_constants.SEARCH_TERM] || '';
|
|
31
|
+
|
|
32
|
+
if (!filterData) {
|
|
33
|
+
filters.forEach(function (filterProps) {
|
|
34
|
+
var _filterProps$propsToD = (0, _slicedToArray2["default"])(filterProps.propsToDisplay, 1),
|
|
35
|
+
key = _filterProps$propsToD[0];
|
|
36
|
+
|
|
37
|
+
filterValues[key] = query[key] ? (0, _getFilterValueFromQuery["default"])(key, filterProps, {}, query) : null;
|
|
38
|
+
});
|
|
39
|
+
filterValues.dataNotSet = true;
|
|
40
|
+
return filterValues;
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
Object.keys(filterData).forEach(function (key) {
|
|
29
44
|
var filterProps = filters.find(function (_ref) {
|
|
30
45
|
var propsToDisplay = _ref.propsToDisplay;
|
|
@@ -34,7 +49,7 @@ var getInitialFilterValues = function getInitialFilterValues(filterData, filters
|
|
|
34
49
|
}) || {};
|
|
35
50
|
filterValues[key] = (0, _getFilterValueFromQuery["default"])(key, filterProps, filterData[key], query);
|
|
36
51
|
});
|
|
37
|
-
filterValues
|
|
52
|
+
filterValues.dataNotSet = false;
|
|
38
53
|
return filterValues;
|
|
39
54
|
};
|
|
40
55
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-initial-filter-values.js","names":["getInitialFilterValues","filterData","filters","query","filterValues","
|
|
1
|
+
{"version":3,"file":"get-initial-filter-values.js","names":["getInitialFilterValues","filterData","filters","query","filterValues","SEARCH_TERM","forEach","filterProps","propsToDisplay","key","getFilterValueFromQuery","dataNotSet","Object","keys","find","prop"],"sources":["../../../../src/components/SearchFilter/helpers/get-initial-filter-values.js"],"sourcesContent":["import { SEARCH_TERM } from '../constants';\nimport getFilterValueFromQuery from './get-filter-value-from-query';\n\nconst getInitialFilterValues = (filterData, filters, query) => {\n const filterValues = {};\n filterValues[SEARCH_TERM] = query[SEARCH_TERM] || '';\n\n if (!filterData) {\n filters.forEach(filterProps => {\n const {\n propsToDisplay: [key]\n } = filterProps;\n filterValues[key] = query[key] ? getFilterValueFromQuery(key, filterProps, {}, query) : null;\n });\n filterValues.dataNotSet = true;\n return filterValues;\n }\n\n Object.keys(filterData).forEach(key => {\n const filterProps =\n filters.find(({ propsToDisplay }) => propsToDisplay.find(prop => key === prop)) || {};\n filterValues[key] = getFilterValueFromQuery(key, filterProps, filterData[key], query);\n });\n\n filterValues.dataNotSet = false;\n\n return filterValues;\n};\n\nexport default getInitialFilterValues;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAyB,CAACC,UAAD,EAAaC,OAAb,EAAsBC,KAAtB,EAAgC;EAC7D,IAAMC,YAAY,GAAG,EAArB;EACAA,YAAY,CAACC,sBAAD,CAAZ,GAA4BF,KAAK,CAACE,sBAAD,CAAL,IAAsB,EAAlD;;EAEA,IAAI,CAACJ,UAAL,EAAiB;IACfC,OAAO,CAACI,OAAR,CAAgB,UAAAC,WAAW,EAAI;MAC7B,4DAEIA,WAFJ,CACEC,cADF;MAAA,IACmBC,GADnB;;MAGAL,YAAY,CAACK,GAAD,CAAZ,GAAoBN,KAAK,CAACM,GAAD,CAAL,GAAa,IAAAC,mCAAA,EAAwBD,GAAxB,EAA6BF,WAA7B,EAA0C,EAA1C,EAA8CJ,KAA9C,CAAb,GAAoE,IAAxF;IACD,CALD;IAMAC,YAAY,CAACO,UAAb,GAA0B,IAA1B;IACA,OAAOP,YAAP;EACD;;EAEDQ,MAAM,CAACC,IAAP,CAAYZ,UAAZ,EAAwBK,OAAxB,CAAgC,UAAAG,GAAG,EAAI;IACrC,IAAMF,WAAW,GACfL,OAAO,CAACY,IAAR,CAAa;MAAA,IAAGN,cAAH,QAAGA,cAAH;MAAA,OAAwBA,cAAc,CAACM,IAAf,CAAoB,UAAAC,IAAI;QAAA,OAAIN,GAAG,KAAKM,IAAZ;MAAA,CAAxB,CAAxB;IAAA,CAAb,KAAmF,EADrF;IAEAX,YAAY,CAACK,GAAD,CAAZ,GAAoB,IAAAC,mCAAA,EAAwBD,GAAxB,EAA6BF,WAA7B,EAA0CN,UAAU,CAACQ,GAAD,CAApD,EAA2DN,KAA3D,CAApB;EACD,CAJD;EAMAC,YAAY,CAACO,UAAb,GAA0B,KAA1B;EAEA,OAAOP,YAAP;AACD,CAxBD;;eA0BeJ,sB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-intersected-prop.js","names":["getIntersectedProp","rangeQueryValues","propsToDisplay","Object","keys"],"sources":["../../../../src/components/SearchFilter/helpers/get-intersected-prop.js"],"sourcesContent":["import intersection from 'lodash.intersection';\n\nconst getIntersectedProp = (rangeQueryValues, propsToDisplay) =>\n intersection(Object.keys(rangeQueryValues), propsToDisplay)[0];\n\nexport default getIntersectedProp;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,gBAAD,EAAmBC,cAAnB;EAAA,OACzB,
|
|
1
|
+
{"version":3,"file":"get-intersected-prop.js","names":["getIntersectedProp","rangeQueryValues","propsToDisplay","intersection","Object","keys"],"sources":["../../../../src/components/SearchFilter/helpers/get-intersected-prop.js"],"sourcesContent":["import intersection from 'lodash.intersection';\n\nconst getIntersectedProp = (rangeQueryValues, propsToDisplay) =>\n intersection(Object.keys(rangeQueryValues), propsToDisplay)[0];\n\nexport default getIntersectedProp;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,gBAAD,EAAmBC,cAAnB;EAAA,OACzB,IAAAC,kBAAA,EAAaC,MAAM,CAACC,IAAP,CAAYJ,gBAAZ,CAAb,EAA4CC,cAA5C,EAA4D,CAA5D,CADyB;AAAA,CAA3B;;eAGeF,kB"}
|
|
@@ -17,6 +17,8 @@ require("core-js/modules/es.string.split.js");
|
|
|
17
17
|
|
|
18
18
|
require("core-js/modules/es.number.constructor.js");
|
|
19
19
|
|
|
20
|
+
require("core-js/modules/es.number.is-nan.js");
|
|
21
|
+
|
|
20
22
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
23
|
|
|
22
24
|
var _calculateMinMax2 = _interopRequireDefault(require("./calculate-min-max"));
|
|
@@ -38,8 +40,8 @@ var getRangeValue = function getRangeValue(rawQueryProp, rangeInterval, _min, _m
|
|
|
38
40
|
var updatedMinValue = Number(queryParamMin);
|
|
39
41
|
var updatedMaxValue = Number(queryParamMax);
|
|
40
42
|
return {
|
|
41
|
-
min: min,
|
|
42
|
-
max: max,
|
|
43
|
+
min: Number.isNaN(min) ? updatedMinValue : min,
|
|
44
|
+
max: Number.isNaN(max) ? updatedMaxValue : max,
|
|
43
45
|
step: rangeInterval,
|
|
44
46
|
maxValue: updatedMaxValue,
|
|
45
47
|
minValue: updatedMinValue
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-range-value.js","names":["getRangeValue","rawQueryProp","rangeInterval","_min","_max","min","max","Array","isArray","split","queryParamMin","queryParamMax","updatedMinValue","Number","updatedMaxValue","step","maxValue","minValue"],"sources":["../../../../src/components/SearchFilter/helpers/get-range-value.js"],"sourcesContent":["import calculateMinMax from './calculate-min-max';\n\nconst getRangeValue = (rawQueryProp, rangeInterval, _min, _max) => {\n const { min, max } = calculateMinMax({ min: _min, max: _max }, rangeInterval);\n\n if (rawQueryProp) {\n const [queryParamMin, queryParamMax] = Array.isArray(rawQueryProp)\n ? rawQueryProp[0].split('-')\n : rawQueryProp.split('-');\n const updatedMinValue = Number(queryParamMin);\n const updatedMaxValue = Number(queryParamMax);\n\n return {\n min,\n max,\n step: rangeInterval,\n maxValue: updatedMaxValue,\n minValue: updatedMinValue\n };\n }\n\n return {\n max,\n min,\n step: rangeInterval,\n maxValue: max,\n minValue: min\n };\n};\n\nexport default getRangeValue;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-range-value.js","names":["getRangeValue","rawQueryProp","rangeInterval","_min","_max","calculateMinMax","min","max","Array","isArray","split","queryParamMin","queryParamMax","updatedMinValue","Number","updatedMaxValue","isNaN","step","maxValue","minValue"],"sources":["../../../../src/components/SearchFilter/helpers/get-range-value.js"],"sourcesContent":["import calculateMinMax from './calculate-min-max';\n\nconst getRangeValue = (rawQueryProp, rangeInterval, _min, _max) => {\n const { min, max } = calculateMinMax({ min: _min, max: _max }, rangeInterval);\n\n if (rawQueryProp) {\n const [queryParamMin, queryParamMax] = Array.isArray(rawQueryProp)\n ? rawQueryProp[0].split('-')\n : rawQueryProp.split('-');\n const updatedMinValue = Number(queryParamMin);\n const updatedMaxValue = Number(queryParamMax);\n\n return {\n min: Number.isNaN(min) ? updatedMinValue : min,\n max: Number.isNaN(max) ? updatedMaxValue : max,\n step: rangeInterval,\n maxValue: updatedMaxValue,\n minValue: updatedMinValue\n };\n }\n\n return {\n max,\n min,\n step: rangeInterval,\n maxValue: max,\n minValue: min\n };\n};\n\nexport default getRangeValue;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,YAAD,EAAeC,aAAf,EAA8BC,IAA9B,EAAoCC,IAApC,EAA6C;EACjE,uBAAqB,IAAAC,4BAAA,EAAgB;IAAEC,GAAG,EAAEH,IAAP;IAAaI,GAAG,EAAEH;EAAlB,CAAhB,EAA0CF,aAA1C,CAArB;EAAA,IAAQI,GAAR,oBAAQA,GAAR;EAAA,IAAaC,GAAb,oBAAaA,GAAb;;EAEA,IAAIN,YAAJ,EAAkB;IAChB,WAAuCO,KAAK,CAACC,OAAN,CAAcR,YAAd,IACnCA,YAAY,CAAC,CAAD,CAAZ,CAAgBS,KAAhB,CAAsB,GAAtB,CADmC,GAEnCT,YAAY,CAACS,KAAb,CAAmB,GAAnB,CAFJ;IAAA;IAAA,IAAOC,aAAP;IAAA,IAAsBC,aAAtB;;IAGA,IAAMC,eAAe,GAAGC,MAAM,CAACH,aAAD,CAA9B;IACA,IAAMI,eAAe,GAAGD,MAAM,CAACF,aAAD,CAA9B;IAEA,OAAO;MACLN,GAAG,EAAEQ,MAAM,CAACE,KAAP,CAAaV,GAAb,IAAoBO,eAApB,GAAsCP,GADtC;MAELC,GAAG,EAAEO,MAAM,CAACE,KAAP,CAAaT,GAAb,IAAoBQ,eAApB,GAAsCR,GAFtC;MAGLU,IAAI,EAAEf,aAHD;MAILgB,QAAQ,EAAEH,eAJL;MAKLI,QAAQ,EAAEN;IALL,CAAP;EAOD;;EAED,OAAO;IACLN,GAAG,EAAHA,GADK;IAELD,GAAG,EAAHA,GAFK;IAGLW,IAAI,EAAEf,aAHD;IAILgB,QAAQ,EAAEX,GAJL;IAKLY,QAAQ,EAAEb;EALL,CAAP;AAOD,CA1BD;;eA4BeN,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-responsive-filter-classnames.js","names":["getResponsiveFilterClassnames","moreFiltersDesktopCollapsed","moreFiltersMobileCollapsed","moreFiltersMobileWrapperClass","MORE_FILTERS_CLASSES","MOBILE_WRAPPER","moreFiltersMobileTogglerClass","MOBILE_TOGGLER","moreFiltersDesktopWrapperClass","DESKTOP_WRAPPER","moreFiltersDesktopTogglerClass","DESKTOP_TOGGLER"],"sources":["../../../../src/components/SearchFilter/helpers/get-responsive-filter-classnames.js"],"sourcesContent":["import classnames from 'classnames';\nimport { MORE_FILTERS_CLASSES } from '../constants';\n\nconst getResponsiveFilterClassnames = (\n moreFiltersDesktopCollapsed,\n moreFiltersMobileCollapsed\n) => ({\n moreFiltersMobileWrapperClass: classnames(MORE_FILTERS_CLASSES.MOBILE_WRAPPER, {\n [`${MORE_FILTERS_CLASSES.MOBILE_WRAPPER}--open`]: !moreFiltersMobileCollapsed\n }),\n moreFiltersMobileTogglerClass: classnames(MORE_FILTERS_CLASSES.MOBILE_TOGGLER, {\n [`${MORE_FILTERS_CLASSES.MOBILE_TOGGLER}--open`]: !moreFiltersMobileCollapsed\n }),\n moreFiltersDesktopWrapperClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_WRAPPER, {\n [`${MORE_FILTERS_CLASSES.DESKTOP_WRAPPER}--open`]: !moreFiltersDesktopCollapsed\n }),\n moreFiltersDesktopTogglerClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_TOGGLER, {\n [`${MORE_FILTERS_CLASSES.DESKTOP_TOGGLER}--open`]: !moreFiltersDesktopCollapsed\n })\n});\n\nexport default getResponsiveFilterClassnames;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,6BAA6B,GAAG,SAAhCA,6BAAgC,CACpCC,2BADoC,EAEpCC,0BAFoC;EAAA,OAGhC;IACJC,6BAA6B,EAAE,
|
|
1
|
+
{"version":3,"file":"get-responsive-filter-classnames.js","names":["getResponsiveFilterClassnames","moreFiltersDesktopCollapsed","moreFiltersMobileCollapsed","moreFiltersMobileWrapperClass","classnames","MORE_FILTERS_CLASSES","MOBILE_WRAPPER","moreFiltersMobileTogglerClass","MOBILE_TOGGLER","moreFiltersDesktopWrapperClass","DESKTOP_WRAPPER","moreFiltersDesktopTogglerClass","DESKTOP_TOGGLER"],"sources":["../../../../src/components/SearchFilter/helpers/get-responsive-filter-classnames.js"],"sourcesContent":["import classnames from 'classnames';\nimport { MORE_FILTERS_CLASSES } from '../constants';\n\nconst getResponsiveFilterClassnames = (\n moreFiltersDesktopCollapsed,\n moreFiltersMobileCollapsed\n) => ({\n moreFiltersMobileWrapperClass: classnames(MORE_FILTERS_CLASSES.MOBILE_WRAPPER, {\n [`${MORE_FILTERS_CLASSES.MOBILE_WRAPPER}--open`]: !moreFiltersMobileCollapsed\n }),\n moreFiltersMobileTogglerClass: classnames(MORE_FILTERS_CLASSES.MOBILE_TOGGLER, {\n [`${MORE_FILTERS_CLASSES.MOBILE_TOGGLER}--open`]: !moreFiltersMobileCollapsed\n }),\n moreFiltersDesktopWrapperClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_WRAPPER, {\n [`${MORE_FILTERS_CLASSES.DESKTOP_WRAPPER}--open`]: !moreFiltersDesktopCollapsed\n }),\n moreFiltersDesktopTogglerClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_TOGGLER, {\n [`${MORE_FILTERS_CLASSES.DESKTOP_TOGGLER}--open`]: !moreFiltersDesktopCollapsed\n })\n});\n\nexport default getResponsiveFilterClassnames;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,6BAA6B,GAAG,SAAhCA,6BAAgC,CACpCC,2BADoC,EAEpCC,0BAFoC;EAAA,OAGhC;IACJC,6BAA6B,EAAE,IAAAC,uBAAA,EAAWC,+BAAA,CAAqBC,cAAhC,iDACzBD,+BAAA,CAAqBC,cADI,aACqB,CAACJ,0BADtB,EAD3B;IAIJK,6BAA6B,EAAE,IAAAH,uBAAA,EAAWC,+BAAA,CAAqBG,cAAhC,iDACzBH,+BAAA,CAAqBG,cADI,aACqB,CAACN,0BADtB,EAJ3B;IAOJO,8BAA8B,EAAE,IAAAL,uBAAA,EAAWC,+BAAA,CAAqBK,eAAhC,iDAC1BL,+BAAA,CAAqBK,eADK,aACqB,CAACT,2BADtB,EAP5B;IAUJU,8BAA8B,EAAE,IAAAP,uBAAA,EAAWC,+BAAA,CAAqBO,eAAhC,iDAC1BP,+BAAA,CAAqBO,eADK,aACqB,CAACX,2BADtB;EAV5B,CAHgC;AAAA,CAAtC;;eAkBeD,6B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-select-options.js","names":["getSelectOptions","entitySchema","propsToDisplay","length","properties","dynamicProperties","map","propToDisplay","displayValue"],"sources":["../../../../src/components/SearchFilter/helpers/get-select-options.js"],"sourcesContent":["import getDisplayValue from './get-display-value';\n\nconst getSelectOptions = (entitySchema, propsToDisplay) => {\n if (!propsToDisplay || !propsToDisplay.length) return [];\n\n const { properties = {}, dynamicProperties = {} } = entitySchema;\n\n return propsToDisplay.map(propToDisplay => {\n const displayValue =\n getDisplayValue(propToDisplay, properties) ||\n getDisplayValue(propToDisplay, dynamicProperties) ||\n propToDisplay;\n\n return [propToDisplay, displayValue];\n });\n};\n\nexport default getSelectOptions;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,YAAD,EAAeC,cAAf,EAAkC;EACzD,IAAI,CAACA,cAAD,IAAmB,CAACA,cAAc,CAACC,MAAvC,EAA+C,OAAO,EAAP;EAE/C,4BAAoDF,YAApD,CAAQG,UAAR;EAAA,IAAQA,UAAR,sCAAqB,EAArB;EAAA,4BAAoDH,YAApD,CAAyBI,iBAAzB;EAAA,IAAyBA,iBAAzB,sCAA6C,EAA7C;EAEA,OAAOH,cAAc,CAACI,GAAf,CAAmB,UAAAC,aAAa,EAAI;IACzC,IAAMC,YAAY,GAChB,
|
|
1
|
+
{"version":3,"file":"get-select-options.js","names":["getSelectOptions","entitySchema","propsToDisplay","length","properties","dynamicProperties","map","propToDisplay","displayValue","getDisplayValue"],"sources":["../../../../src/components/SearchFilter/helpers/get-select-options.js"],"sourcesContent":["import getDisplayValue from './get-display-value';\n\nconst getSelectOptions = (entitySchema, propsToDisplay) => {\n if (!propsToDisplay || !propsToDisplay.length) return [];\n\n const { properties = {}, dynamicProperties = {} } = entitySchema;\n\n return propsToDisplay.map(propToDisplay => {\n const displayValue =\n getDisplayValue(propToDisplay, properties) ||\n getDisplayValue(propToDisplay, dynamicProperties) ||\n propToDisplay;\n\n return [propToDisplay, displayValue];\n });\n};\n\nexport default getSelectOptions;\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,YAAD,EAAeC,cAAf,EAAkC;EACzD,IAAI,CAACA,cAAD,IAAmB,CAACA,cAAc,CAACC,MAAvC,EAA+C,OAAO,EAAP;EAE/C,4BAAoDF,YAApD,CAAQG,UAAR;EAAA,IAAQA,UAAR,sCAAqB,EAArB;EAAA,4BAAoDH,YAApD,CAAyBI,iBAAzB;EAAA,IAAyBA,iBAAzB,sCAA6C,EAA7C;EAEA,OAAOH,cAAc,CAACI,GAAf,CAAmB,UAAAC,aAAa,EAAI;IACzC,IAAMC,YAAY,GAChB,IAAAC,2BAAA,EAAgBF,aAAhB,EAA+BH,UAA/B,KACA,IAAAK,2BAAA,EAAgBF,aAAhB,EAA+BF,iBAA/B,CADA,IAEAE,aAHF;IAKA,OAAO,CAACA,aAAD,EAAgBC,YAAhB,CAAP;EACD,CAPM,CAAP;AAQD,CAbD;;eAeeR,gB"}
|
|
@@ -7,6 +7,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
+
Object.defineProperty(exports, "buildFiltersQuery", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _buildFiltersQuery["default"];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
10
16
|
Object.defineProperty(exports, "buildNewQuery", {
|
|
11
17
|
enumerable: true,
|
|
12
18
|
get: function get() {
|
|
@@ -133,4 +139,6 @@ var _getInitialFilterValues = _interopRequireDefault(require("./get-initial-filt
|
|
|
133
139
|
var _getFilterValueFromQuery = _interopRequireDefault(require("./get-filter-value-from-query"));
|
|
134
140
|
|
|
135
141
|
var _buildQuery = _interopRequireDefault(require("./build-query"));
|
|
142
|
+
|
|
143
|
+
var _buildFiltersQuery = _interopRequireDefault(require("./build-filters-query"));
|
|
136
144
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/SearchFilter/helpers/index.js"],"sourcesContent":["import buildNewQuery from './build-new-query';\nimport buildRawQueryStringified from './build-raw-query-stringified';\nimport { decodeValue, encodeValue } from './decode-encode';\nimport checkIfRangeUpdated from './check-if-range-updated';\nimport getResponsiveFilterClassnames from './get-responsive-filter-classnames';\nimport getDisplayValue from './get-display-value';\nimport calculateStep from './calculate-step';\nimport calculateMinMax from './calculate-min-max';\nimport getIntersectedProp from './get-intersected-prop';\nimport getRangeValue from './get-range-value';\nimport getSelectOptions from './get-select-options';\nimport isDeviceDesktop from './is-device-desktop';\nimport getInitialFilterValues from './get-initial-filter-values';\nimport getFilterValueFromQuery from './get-filter-value-from-query';\nimport buildQuery from './build-query';\n\nexport {\n buildQuery,\n buildNewQuery,\n buildRawQueryStringified,\n decodeValue,\n encodeValue,\n checkIfRangeUpdated,\n getResponsiveFilterClassnames,\n getDisplayValue,\n calculateStep,\n calculateMinMax,\n getIntersectedProp,\n getRangeValue,\n getSelectOptions,\n isDeviceDesktop,\n getInitialFilterValues,\n getFilterValueFromQuery\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/SearchFilter/helpers/index.js"],"sourcesContent":["import buildNewQuery from './build-new-query';\nimport buildRawQueryStringified from './build-raw-query-stringified';\nimport { decodeValue, encodeValue } from './decode-encode';\nimport checkIfRangeUpdated from './check-if-range-updated';\nimport getResponsiveFilterClassnames from './get-responsive-filter-classnames';\nimport getDisplayValue from './get-display-value';\nimport calculateStep from './calculate-step';\nimport calculateMinMax from './calculate-min-max';\nimport getIntersectedProp from './get-intersected-prop';\nimport getRangeValue from './get-range-value';\nimport getSelectOptions from './get-select-options';\nimport isDeviceDesktop from './is-device-desktop';\nimport getInitialFilterValues from './get-initial-filter-values';\nimport getFilterValueFromQuery from './get-filter-value-from-query';\nimport buildQuery from './build-query';\nimport buildFiltersQuery from './build-filters-query';\n\nexport {\n buildQuery,\n buildNewQuery,\n buildRawQueryStringified,\n decodeValue,\n encodeValue,\n checkIfRangeUpdated,\n getResponsiveFilterClassnames,\n getDisplayValue,\n calculateStep,\n calculateMinMax,\n getIntersectedProp,\n getRangeValue,\n getSelectOptions,\n isDeviceDesktop,\n getInitialFilterValues,\n getFilterValueFromQuery,\n buildFiltersQuery\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -13,10 +13,6 @@ require("core-js/modules/es.array.join.js");
|
|
|
13
13
|
|
|
14
14
|
require("core-js/modules/es.array.map.js");
|
|
15
15
|
|
|
16
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.string.replace.js");
|
|
19
|
-
|
|
20
16
|
var _constants = require("../constants");
|
|
21
17
|
|
|
22
18
|
var parseFilterValue = function parseFilterValue(key, type, value) {
|
|
@@ -28,14 +24,14 @@ var parseFilterValue = function parseFilterValue(key, type, value) {
|
|
|
28
24
|
return "".concat(key, "=").concat(value.minValue, "-").concat(value.maxValue);
|
|
29
25
|
|
|
30
26
|
case _constants.CHECKBOX:
|
|
31
|
-
if (typeof value === 'string') return "".concat(key, "=").concat(value);
|
|
27
|
+
if (typeof value === 'string') return "".concat(key, "=").concat(encodeURIComponent(value));
|
|
32
28
|
return value.map(function (val) {
|
|
33
|
-
return "".concat(key, "=").concat(val);
|
|
29
|
+
return "".concat(key, "=").concat(encodeURIComponent(val));
|
|
34
30
|
}).join('&');
|
|
35
31
|
|
|
36
32
|
case _constants.SELECT:
|
|
37
33
|
{
|
|
38
|
-
var parsedValue = value
|
|
34
|
+
var parsedValue = encodeURIComponent(value);
|
|
39
35
|
return "".concat(key, "=").concat(parsedValue);
|
|
40
36
|
}
|
|
41
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-filter-value.js","names":["parseFilterValue","key","type","value","RANGE","minValue","min","maxValue","max","CHECKBOX","map","val","join","SELECT","parsedValue"
|
|
1
|
+
{"version":3,"file":"parse-filter-value.js","names":["parseFilterValue","key","type","value","RANGE","minValue","min","maxValue","max","CHECKBOX","encodeURIComponent","map","val","join","SELECT","parsedValue"],"sources":["../../../../src/components/SearchFilter/helpers/parse-filter-value.js"],"sourcesContent":["import { RANGE, CHECKBOX, SELECT } from '../constants';\n\nconst parseFilterValue = (key, type, value) => {\n if (!value) return null;\n\n switch (type) {\n case RANGE:\n if (value.minValue === value.min && value.maxValue === value.max) return null;\n return `${key}=${value.minValue}-${value.maxValue}`;\n case CHECKBOX:\n if (typeof value === 'string') return `${key}=${encodeURIComponent(value)}`;\n return value.map(val => `${key}=${encodeURIComponent(val)}`).join('&');\n case SELECT: {\n const parsedValue = encodeURIComponent(value);\n return `${key}=${parsedValue}`;\n }\n\n default:\n return null;\n }\n};\n\nexport default parseFilterValue;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,GAAD,EAAMC,IAAN,EAAYC,KAAZ,EAAsB;EAC7C,IAAI,CAACA,KAAL,EAAY,OAAO,IAAP;;EAEZ,QAAQD,IAAR;IACE,KAAKE,gBAAL;MACE,IAAID,KAAK,CAACE,QAAN,KAAmBF,KAAK,CAACG,GAAzB,IAAgCH,KAAK,CAACI,QAAN,KAAmBJ,KAAK,CAACK,GAA7D,EAAkE,OAAO,IAAP;MAClE,iBAAUP,GAAV,cAAiBE,KAAK,CAACE,QAAvB,cAAmCF,KAAK,CAACI,QAAzC;;IACF,KAAKE,mBAAL;MACE,IAAI,OAAON,KAAP,KAAiB,QAArB,EAA+B,iBAAUF,GAAV,cAAiBS,kBAAkB,CAACP,KAAD,CAAnC;MAC/B,OAAOA,KAAK,CAACQ,GAAN,CAAU,UAAAC,GAAG;QAAA,iBAAOX,GAAP,cAAcS,kBAAkB,CAACE,GAAD,CAAhC;MAAA,CAAb,EAAsDC,IAAtD,CAA2D,GAA3D,CAAP;;IACF,KAAKC,iBAAL;MAAa;QACX,IAAMC,WAAW,GAAGL,kBAAkB,CAACP,KAAD,CAAtC;QACA,iBAAUF,GAAV,cAAiBc,WAAjB;MACD;;IAED;MACE,OAAO,IAAP;EAbJ;AAeD,CAlBD;;eAoBef,gB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchFilterSort.js","names":["SearchFilterSort","router","filters","elementLabel","selectLabel","id","asPath","url","query","sort","sortby","selectedValue","defaultTextValue","DEFAULT_SORT","options","map","optionLabel","label","propsToDisplay","sortValue","setSortValue","value","propTypes","PropTypes","object","isRequired","array","string","defaultProps"],"sources":["../../../src/components/SearchFilterSort/SearchFilterSort.js"],"sourcesContent":["import React from 'react';\nimport Select from '@blaze-react/select';\nimport { withRouter } from 'next/router';\nimport { parseUrl } from 'query-string';\nimport PropTypes from 'prop-types';\nimport { DEFAULT_SORT } from './constants';\nimport { handleSortUpdate } from './helpers';\nimport { withTitle } from '../../HOC';\n\nconst SearchFilterSort = ({ router, filters, elementLabel, selectLabel, id }) => {\n const { asPath } = router;\n const { url, query, query: { sort, sortby } = {} } = parseUrl(asPath);\n const selectedValue = `${sortby}:${sort}` || '';\n const defaultTextValue = selectLabel || DEFAULT_SORT;\n const options = filters.map(({ label: optionLabel, propsToDisplay, sort: sortValue }) => [\n `${propsToDisplay[0]}:${sortValue}`,\n optionLabel\n ]);\n\n const setSortValue = ({ value }) => handleSortUpdate(router, value, query, url, selectLabel);\n\n return (\n <div className=\"sort-by\">\n <Select\n label={elementLabel}\n defaultTextValue={defaultTextValue}\n value={selectedValue}\n id={id}\n options={options}\n onChange={setSortValue}\n />\n </div>\n );\n};\n\nSearchFilterSort.propTypes = {\n router: PropTypes.object.isRequired,\n filters: PropTypes.array,\n elementLabel: PropTypes.string,\n selectLabel: PropTypes.string,\n id: PropTypes.string\n};\n\nSearchFilterSort.defaultProps = {\n filters: [],\n elementLabel: '',\n selectLabel: '',\n id: ''\n};\n\nexport default withRouter(withTitle(SearchFilterSort));\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAwD;EAAA,IAArDC,MAAqD,QAArDA,MAAqD;EAAA,IAA7CC,OAA6C,QAA7CA,OAA6C;EAAA,IAApCC,YAAoC,QAApCA,YAAoC;EAAA,IAAtBC,WAAsB,QAAtBA,WAAsB;EAAA,IAATC,EAAS,QAATA,EAAS;EAC/E,IAAQC,MAAR,GAAmBL,MAAnB,CAAQK,MAAR;;EACA,gBAAqD,
|
|
1
|
+
{"version":3,"file":"SearchFilterSort.js","names":["SearchFilterSort","router","filters","elementLabel","selectLabel","id","asPath","parseUrl","url","query","sort","sortby","selectedValue","defaultTextValue","DEFAULT_SORT","options","map","optionLabel","label","propsToDisplay","sortValue","setSortValue","value","handleSortUpdate","propTypes","PropTypes","object","isRequired","array","string","defaultProps","withRouter","withTitle"],"sources":["../../../src/components/SearchFilterSort/SearchFilterSort.js"],"sourcesContent":["import React from 'react';\nimport Select from '@blaze-react/select';\nimport { withRouter } from 'next/router';\nimport { parseUrl } from 'query-string';\nimport PropTypes from 'prop-types';\nimport { DEFAULT_SORT } from './constants';\nimport { handleSortUpdate } from './helpers';\nimport { withTitle } from '../../HOC';\n\nconst SearchFilterSort = ({ router, filters, elementLabel, selectLabel, id }) => {\n const { asPath } = router;\n const { url, query, query: { sort, sortby } = {} } = parseUrl(asPath);\n const selectedValue = `${sortby}:${sort}` || '';\n const defaultTextValue = selectLabel || DEFAULT_SORT;\n const options = filters.map(({ label: optionLabel, propsToDisplay, sort: sortValue }) => [\n `${propsToDisplay[0]}:${sortValue}`,\n optionLabel\n ]);\n\n const setSortValue = ({ value }) => handleSortUpdate(router, value, query, url, selectLabel);\n\n return (\n <div className=\"sort-by\">\n <Select\n label={elementLabel}\n defaultTextValue={defaultTextValue}\n value={selectedValue}\n id={id}\n options={options}\n onChange={setSortValue}\n />\n </div>\n );\n};\n\nSearchFilterSort.propTypes = {\n router: PropTypes.object.isRequired,\n filters: PropTypes.array,\n elementLabel: PropTypes.string,\n selectLabel: PropTypes.string,\n id: PropTypes.string\n};\n\nSearchFilterSort.defaultProps = {\n filters: [],\n elementLabel: '',\n selectLabel: '',\n id: ''\n};\n\nexport default withRouter(withTitle(SearchFilterSort));\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAwD;EAAA,IAArDC,MAAqD,QAArDA,MAAqD;EAAA,IAA7CC,OAA6C,QAA7CA,OAA6C;EAAA,IAApCC,YAAoC,QAApCA,YAAoC;EAAA,IAAtBC,WAAsB,QAAtBA,WAAsB;EAAA,IAATC,EAAS,QAATA,EAAS;EAC/E,IAAQC,MAAR,GAAmBL,MAAnB,CAAQK,MAAR;;EACA,gBAAqD,IAAAC,qBAAA,EAASD,MAAT,CAArD;EAAA,IAAQE,GAAR,aAAQA,GAAR;EAAA,IAAaC,KAAb,aAAaA,KAAb;EAAA,gCAAoBA,KAApB;;EAAA,+CAA8C,EAA9C;EAAA,IAA6BC,IAA7B,mBAA6BA,IAA7B;EAAA,IAAmCC,MAAnC,mBAAmCA,MAAnC;EACA,IAAMC,aAAa,GAAG,UAAGD,MAAH,cAAaD,IAAb,KAAuB,EAA7C;EACA,IAAMG,gBAAgB,GAAGT,WAAW,IAAIU,uBAAxC;EACA,IAAMC,OAAO,GAAGb,OAAO,CAACc,GAAR,CAAY;IAAA,IAAUC,WAAV,SAAGC,KAAH;IAAA,IAAuBC,cAAvB,SAAuBA,cAAvB;IAAA,IAA6CC,SAA7C,SAAuCV,IAAvC;IAAA,OAA6D,WACpFS,cAAc,CAAC,CAAD,CADsE,cAC/DC,SAD+D,GAEvFH,WAFuF,CAA7D;EAAA,CAAZ,CAAhB;;EAKA,IAAMI,YAAY,GAAG,SAAfA,YAAe;IAAA,IAAGC,KAAH,SAAGA,KAAH;IAAA,OAAe,IAAAC,yBAAA,EAAiBtB,MAAjB,EAAyBqB,KAAzB,EAAgCb,KAAhC,EAAuCD,GAAvC,EAA4CJ,WAA5C,CAAf;EAAA,CAArB;;EAEA,oBACE;IAAK,SAAS,EAAC;EAAf,gBACE,gCAAC,kBAAD;IACE,KAAK,EAAED,YADT;IAEE,gBAAgB,EAAEU,gBAFpB;IAGE,KAAK,EAAED,aAHT;IAIE,EAAE,EAAEP,EAJN;IAKE,OAAO,EAAEU,OALX;IAME,QAAQ,EAAEM;EANZ,EADF,CADF;AAYD,CAxBD;;AA0BArB,gBAAgB,CAACwB,SAAjB,GAA6B;EAC3BvB,MAAM,EAAEwB,qBAAA,CAAUC,MAAV,CAAiBC,UADE;EAE3BzB,OAAO,EAAEuB,qBAAA,CAAUG,KAFQ;EAG3BzB,YAAY,EAAEsB,qBAAA,CAAUI,MAHG;EAI3BzB,WAAW,EAAEqB,qBAAA,CAAUI,MAJI;EAK3BxB,EAAE,EAAEoB,qBAAA,CAAUI;AALa,CAA7B;AAQA7B,gBAAgB,CAAC8B,YAAjB,GAAgC;EAC9B5B,OAAO,EAAE,EADqB;EAE9BC,YAAY,EAAE,EAFgB;EAG9BC,WAAW,EAAE,EAHiB;EAI9BC,EAAE,EAAE;AAJ0B,CAAhC;;eAOe,IAAA0B,kBAAA,EAAW,IAAAC,cAAA,EAAUhC,gBAAV,CAAX,C"}
|