@wayke-se/components-react 3.8.1 → 3.9.0-beta.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/README.md +20 -11
- package/dist/index.d.ts +3547 -0
- package/dist/index.js +3463 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +3463 -0
- package/dist/index.mjs.map +7 -0
- package/package.json +74 -27
- package/dist-node/index.js +0 -9483
- package/dist-node/index.js.map +0 -1
- package/dist-src/@types/action.js +0 -1
- package/dist-src/@types/codegen/types.js +0 -14
- package/dist-src/@types/filter.js +0 -1
- package/dist-src/@types/queryFilter.js +0 -1
- package/dist-src/@types/search.js +0 -1
- package/dist-src/@types/vehicle-properties.js +0 -1
- package/dist-src/State/CentralStorage/CentralStorageContext.js +0 -4
- package/dist-src/State/CentralStorage/CentralStorageProvider.js +0 -9
- package/dist-src/State/CentralStorage/useCentralStorage.js +0 -29
- package/dist-src/State/Path/PathContext.js +0 -2
- package/dist-src/State/Path/PathProvider.js +0 -47
- package/dist-src/State/Path/reducer.js +0 -15
- package/dist-src/State/Path/usePath.js +0 -10
- package/dist-src/State/RelatedSearch/RelatedSearchContext.js +0 -8
- package/dist-src/State/RelatedSearch/RelatedSearchProvider.js +0 -27
- package/dist-src/State/RelatedSearch/useRelatedSearch.js +0 -18
- package/dist-src/State/Search/SearchContext.js +0 -12
- package/dist-src/State/Search/SearchProvider.js +0 -178
- package/dist-src/State/Search/useSearch.js +0 -4
- package/dist-src/State/Settings/SettingsContext.js +0 -2
- package/dist-src/State/Settings/SettingsProvider.js +0 -4
- package/dist-src/State/Settings/useSettings.js +0 -4
- package/dist-src/components/AccessoryCard/index.js +0 -14
- package/dist-src/components/AccessoryCard/wrapper.js +0 -90
- package/dist-src/components/Accordion/index.js +0 -18
- package/dist-src/components/Accordion/wrapper.js +0 -92
- package/dist-src/components/ActionList/index.js +0 -18
- package/dist-src/components/ActionList/toggle-item.js +0 -24
- package/dist-src/components/Avatar/index.js +0 -4
- package/dist-src/components/Avatar/wrapper.js +0 -15
- package/dist-src/components/Badge/index.js +0 -4
- package/dist-src/components/Badge/wrapper.js +0 -24
- package/dist-src/components/Blockquote/index.js +0 -12
- package/dist-src/components/Blockquote/wrapper.js +0 -44
- package/dist-src/components/Button/index.js +0 -195
- package/dist-src/components/CheckMarkList/index.js +0 -9
- package/dist-src/components/CheckMarkList/wrapper.js +0 -26
- package/dist-src/components/Checklist/index.js +0 -14
- package/dist-src/components/Checklist/wrapper.js +0 -59
- package/dist-src/components/ColorSelect/index.js +0 -18
- package/dist-src/components/ColorSelect/wrapper.js +0 -69
- package/dist-src/components/ColumnRow/index.js +0 -17
- package/dist-src/components/Columns/index.js +0 -76
- package/dist-src/components/Container/index.js +0 -4
- package/dist-src/components/Container/wrapper.js +0 -12
- package/dist-src/components/Content/index.js +0 -4
- package/dist-src/components/Content/wrapper.js +0 -51
- package/dist-src/components/ContentLogo/index.js +0 -23
- package/dist-src/components/DataList/index.js +0 -6
- package/dist-src/components/DataList/wrapper.js +0 -24
- package/dist-src/components/DetailBox/index.js +0 -17
- package/dist-src/components/DetailBox/wrapper.js +0 -27
- package/dist-src/components/DocumentList/index.js +0 -23
- package/dist-src/components/DocumentList/wrapper.js +0 -55
- package/dist-src/components/ExtendContent/index.js +0 -24
- package/dist-src/components/ExtendContent/wrapper.js +0 -32
- package/dist-src/components/ExtendInfo/index.js +0 -15
- package/dist-src/components/ExtendInfo/wrapper.js +0 -56
- package/dist-src/components/Filter/index.js +0 -64
- package/dist-src/components/Filter/wrapper.js +0 -72
- package/dist-src/components/FilterPanel/checkListFacet.js +0 -29
- package/dist-src/components/FilterPanel/colorFacet.js +0 -29
- package/dist-src/components/FilterPanel/faceSelector.js +0 -32
- package/dist-src/components/FilterPanel/index.js +0 -24
- package/dist-src/components/FilterPanel/rangeFacet.js +0 -82
- package/dist-src/components/FinancialOptions/LoanModal.js +0 -127
- package/dist-src/components/FinancialOptions/index.js +0 -12
- package/dist-src/components/FinancialOptions/leasing.js +0 -56
- package/dist-src/components/FinancialOptions/loan.js +0 -54
- package/dist-src/components/Gallery/MediaButton.js +0 -7
- package/dist-src/components/Gallery/index.js +0 -122
- package/dist-src/components/Gallery/wrapper.js +0 -256
- package/dist-src/components/Grid/index.js +0 -61
- package/dist-src/components/Grid/wrapper.js +0 -26
- package/dist-src/components/Heading/index.js +0 -52
- package/dist-src/components/Icon/index.js +0 -38
- package/dist-src/components/Image/index.js +0 -5
- package/dist-src/components/InputCheckbox/index.js +0 -10
- package/dist-src/components/InputCheckbox/wrapper.js +0 -79
- package/dist-src/components/InputGroup/index.js +0 -21
- package/dist-src/components/InputLabel/index.js +0 -4
- package/dist-src/components/InputLabel/wrapper.js +0 -8
- package/dist-src/components/InputSearch/index.js +0 -12
- package/dist-src/components/InputSearch/wrapper.js +0 -90
- package/dist-src/components/InputSelect/index.js +0 -10
- package/dist-src/components/InputSelect/wrapper.js +0 -53
- package/dist-src/components/InputText/index.js +0 -5
- package/dist-src/components/InputText/wrapper.js +0 -54
- package/dist-src/components/InsuranceOptions/Insurance.js +0 -26
- package/dist-src/components/InsuranceOptions/InsuranceFree.js +0 -30
- package/dist-src/components/InsuranceOptions/InsuranceFreeModal.js +0 -19
- package/dist-src/components/InsuranceOptions/InsuranceModal.js +0 -105
- package/dist-src/components/InsuranceOptions/index.js +0 -15
- package/dist-src/components/Lightbox/index.js +0 -30
- package/dist-src/components/Lightbox/wrapper.js +0 -91
- package/dist-src/components/Link/index.js +0 -28
- package/dist-src/components/Loader/index.js +0 -7
- package/dist-src/components/Loader/wrapper.js +0 -37
- package/dist-src/components/LogoBox/index.js +0 -10
- package/dist-src/components/LogoBox/wrapper.js +0 -12
- package/dist-src/components/Map/index.js +0 -27
- package/dist-src/components/Map/wrapper.js +0 -25
- package/dist-src/components/Modal/index.js +0 -20
- package/dist-src/components/Modal/wrapper.js +0 -113
- package/dist-src/components/NavButton/index.js +0 -42
- package/dist-src/components/OpeningHours/index.js +0 -97
- package/dist-src/components/OptionBox/index.js +0 -7
- package/dist-src/components/OptionBox/wrapper.js +0 -49
- package/dist-src/components/OverflowBox/index.js +0 -4
- package/dist-src/components/OverflowBox/wrapper.js +0 -6
- package/dist-src/components/OverflowGrid/index.js +0 -56
- package/dist-src/components/OverflowGrid/wrapper.js +0 -144
- package/dist-src/components/Page/index.js +0 -30
- package/dist-src/components/Panel/index.js +0 -20
- package/dist-src/components/Panel/wrapper.js +0 -143
- package/dist-src/components/PhoneNumber/index.js +0 -13
- package/dist-src/components/Portal/index.js +0 -4
- package/dist-src/components/Portal/portal-element.js +0 -3
- package/dist-src/components/Portal/portal-namespace.js +0 -1
- package/dist-src/components/Portal/portal.js +0 -25
- package/dist-src/components/Price/index.js +0 -10
- package/dist-src/components/PriceBox/index.js +0 -6
- package/dist-src/components/PriceBox/wrapper.js +0 -34
- package/dist-src/components/PriceTable/index.js +0 -20
- package/dist-src/components/PriceTable/wrapper.js +0 -22
- package/dist-src/components/ProductCard/index.js +0 -45
- package/dist-src/components/ProductCard/wrapper.js +0 -134
- package/dist-src/components/ProductPage/index.js +0 -85
- package/dist-src/components/ProgressBar/index.js +0 -16
- package/dist-src/components/ProgressBar/wrapper.js +0 -24
- package/dist-src/components/RangeSlider/RangeSliderSimple.js +0 -26
- package/dist-src/components/RangeSlider/SliderWithLabel.js +0 -21
- package/dist-src/components/RangeSlider/handle.js +0 -5
- package/dist-src/components/RangeSlider/index.js +0 -50
- package/dist-src/components/RangeSlider/track.js +0 -6
- package/dist-src/components/RangeSlider/wrapper.js +0 -86
- package/dist-src/components/RangeSliderLabel/index.js +0 -6
- package/dist-src/components/RangeSliderLabel/wrapper.js +0 -24
- package/dist-src/components/Repeat/index.js +0 -17
- package/dist-src/components/Result/index.js +0 -40
- package/dist-src/components/Result/wrapper.js +0 -29
- package/dist-src/components/Root/index.js +0 -22
- package/dist-src/components/SearchBar/index.js +0 -18
- package/dist-src/components/SearchFilter/index.js +0 -23
- package/dist-src/components/SearchTerm/index.js +0 -8
- package/dist-src/components/SearchTerm/wrapper.js +0 -67
- package/dist-src/components/SectionHeader/index.js +0 -9
- package/dist-src/components/SectionHeader/wrapper.js +0 -13
- package/dist-src/components/Snackbar/index.js +0 -21
- package/dist-src/components/Snackbar/wrapper.js +0 -56
- package/dist-src/components/SortSelect/index.js +0 -10
- package/dist-src/components/SortSelect/wrapper.js +0 -48
- package/dist-src/components/Sphere/Sphere.js +0 -21
- package/dist-src/components/Sphere/SphereLightbox.js +0 -4
- package/dist-src/components/Sphere/SphereViewer.js +0 -54
- package/dist-src/components/Sphere/wrapper.js +0 -250
- package/dist-src/components/SrOnly/index.js +0 -13
- package/dist-src/components/StateIndicator/index.js +0 -23
- package/dist-src/components/SwitchBar/index.js +0 -23
- package/dist-src/components/SwitchBar/wrapper.js +0 -71
- package/dist-src/components/TableColumn/index.js +0 -14
- package/dist-src/components/TableList/index.js +0 -32
- package/dist-src/components/Tabs/index.js +0 -6
- package/dist-src/components/Tabs/wrapper.js +0 -68
- package/dist-src/components/ThreeSixty/Rotation.js +0 -95
- package/dist-src/components/ThreeSixty/ThreeSixtLightbox.js +0 -15
- package/dist-src/components/ThreeSixty/ThreeSixty.js +0 -25
- package/dist-src/components/UspList/index.js +0 -18
- package/dist-src/components/UspList/wrapper.js +0 -85
- package/dist-src/components/Utility/index.js +0 -13
- package/dist-src/components/Video/CustomPlayer.js +0 -8
- package/dist-src/components/Video/EmbeddedVideoLightbox.js +0 -18
- package/dist-src/components/Video/EmbededVideo.js +0 -38
- package/dist-src/components/Video/QuickNavEmbeded.js +0 -17
- package/dist-src/components/Video/QuickNavVideo.js +0 -6
- package/dist-src/components/Video/Video.js +0 -8
- package/dist-src/components/Video/VimeoPlayer.js +0 -6
- package/dist-src/components/Video/YoutubePlayer.js +0 -6
- package/dist-src/components/Video/useThumbnail.js +0 -25
- package/dist-src/components/Video/utils.js +0 -35
- package/dist-src/components/Video/wrapper.js +0 -19
- package/dist-src/hooks/useFetch.js +0 -69
- package/dist-src/hooks/useHasBeenVisible.js +0 -13
- package/dist-src/hooks/useHashGuid.js +0 -28
- package/dist-src/hooks/useInsurance.js +0 -12
- package/dist-src/hooks/useLoan.js +0 -12
- package/dist-src/hooks/useOnScreen.js +0 -15
- package/dist-src/hooks/useOutsideClick.js +0 -15
- package/dist-src/hooks/usePrevious.js +0 -9
- package/dist-src/hooks/useSearchItem.js +0 -7
- package/dist-src/hooks/useSearchItemBranch.js +0 -7
- package/dist-src/hooks/useSessionStorage.js +0 -23
- package/dist-src/hooks/useVimeoThumbnail.js +0 -18
- package/dist-src/index.js +0 -10
- package/dist-src/layout/helpers.js +0 -5
- package/dist-src/layout/keyframes.js +0 -20
- package/dist-src/layout/theme.js +0 -67
- package/dist-src/layouts/WaykeComposite.js +0 -23
- package/dist-src/layouts/WaykeCompositeWithProvider.js +0 -6
- package/dist-src/layouts/search/index.js +0 -55
- package/dist-src/layouts/searchItem/Accessories/AccessoryModal.js +0 -51
- package/dist-src/layouts/searchItem/Accessories/index.js +0 -32
- package/dist-src/layouts/searchItem/Branch.js +0 -55
- package/dist-src/layouts/searchItem/BranchModal.js +0 -36
- package/dist-src/layouts/searchItem/CheckList.js +0 -79
- package/dist-src/layouts/searchItem/DemoCarModal.js +0 -7
- package/dist-src/layouts/searchItem/Documents.js +0 -44
- package/dist-src/layouts/searchItem/ManufacturerPackagesOption.js +0 -25
- package/dist-src/layouts/searchItem/MetadataItem.js +0 -34
- package/dist-src/layouts/searchItem/PackageOptionModal.js +0 -15
- package/dist-src/layouts/searchItem/PackageOptions.js +0 -25
- package/dist-src/layouts/searchItem/Page404.js +0 -9
- package/dist-src/layouts/searchItem/PageLoading.js +0 -9
- package/dist-src/layouts/searchItem/Property.js +0 -51
- package/dist-src/layouts/searchItem/Related.js +0 -66
- package/dist-src/layouts/searchItem/index.js +0 -180
- package/dist-src/providers/WaykeItemProvidet.js +0 -16
- package/dist-src/providers/WaykeProvider.js +0 -18
- package/dist-src/providers/graphqlProvider.js +0 -7
- package/dist-src/providers/themeProvider.js +0 -5
- package/dist-src/queries/INSURANCE_CALCULATION.js +0 -41
- package/dist-src/queries/LOAN_CALCULATION.js +0 -36
- package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +0 -136
- package/dist-src/queries/SEARCH_ITEM_QUERY.js +0 -256
- package/dist-src/utils/constants.js +0 -31
- package/dist-src/utils/converters.js +0 -31
- package/dist-src/utils/deep-copy.js +0 -5
- package/dist-src/utils/formats.js +0 -62
- package/dist-src/utils/metadata.min.js +0 -86
- package/dist-src/utils/phonenumbers.js +0 -12
- package/dist-src/utils/pubsub/Actions.js +0 -1
- package/dist-src/utils/pubsub/Events.js +0 -1
- package/dist-src/utils/pubsub/pubsub.js +0 -93
- package/dist-src/utils/regex.js +0 -10
- package/dist-src/utils/sortOptions.js +0 -32
- package/dist-src/utils/specification.js +0 -495
- package/dist-src/utils/ssn.js +0 -1
- package/dist-src/utils/url.js +0 -1
- package/dist-src/utils/vehicle-properties/compare-basic-properties.js +0 -36
- package/dist-src/utils/vehicle-properties/compare-categories.js +0 -27
- package/dist-src/utils/vehicle-properties/compare-properties.js +0 -3
- package/dist-src/utils/vehicle-properties/custom-property-adder.js +0 -143
- package/dist-src/utils/vehicle-properties/property-hint-enricher.js +0 -192
- package/dist-src/utils/vehicle-properties/property-remover.js +0 -27
- package/dist-src/utils/vehicle-properties/property-tree-creator.js +0 -127
- package/dist-src/utils/vehicle-properties/property-tree-sorter.js +0 -18
- package/dist-types/@types/action.d.ts +0 -3
- package/dist-types/@types/codegen/types.d.ts +0 -369
- package/dist-types/@types/filter.d.ts +0 -5
- package/dist-types/@types/queryFilter.d.ts +0 -5
- package/dist-types/@types/search.d.ts +0 -106
- package/dist-types/@types/vehicle-properties.d.ts +0 -29
- package/dist-types/State/CentralStorage/CentralStorageContext.d.ts +0 -6
- package/dist-types/State/CentralStorage/CentralStorageProvider.d.ts +0 -6
- package/dist-types/State/CentralStorage/useCentralStorage.d.ts +0 -6
- package/dist-types/State/Path/PathContext.d.ts +0 -9
- package/dist-types/State/Path/PathProvider.d.ts +0 -6
- package/dist-types/State/Path/reducer.d.ts +0 -14
- package/dist-types/State/Path/usePath.d.ts +0 -3
- package/dist-types/State/RelatedSearch/RelatedSearchContext.d.ts +0 -10
- package/dist-types/State/RelatedSearch/RelatedSearchProvider.d.ts +0 -9
- package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +0 -2
- package/dist-types/State/Search/SearchContext.d.ts +0 -15
- package/dist-types/State/Search/SearchProvider.d.ts +0 -10
- package/dist-types/State/Search/useSearch.d.ts +0 -2
- package/dist-types/State/Settings/SettingsContext.d.ts +0 -13
- package/dist-types/State/Settings/SettingsProvider.d.ts +0 -10
- package/dist-types/State/Settings/useSettings.d.ts +0 -2
- package/dist-types/components/AccessoryCard/index.d.ts +0 -16
- package/dist-types/components/AccessoryCard/wrapper.d.ts +0 -18
- package/dist-types/components/Accordion/index.d.ts +0 -13
- package/dist-types/components/Accordion/wrapper.d.ts +0 -16
- package/dist-types/components/ActionList/index.d.ts +0 -8
- package/dist-types/components/ActionList/toggle-item.d.ts +0 -10
- package/dist-types/components/Avatar/index.d.ts +0 -7
- package/dist-types/components/Avatar/wrapper.d.ts +0 -7
- package/dist-types/components/Badge/index.d.ts +0 -7
- package/dist-types/components/Badge/wrapper.d.ts +0 -7
- package/dist-types/components/Blockquote/index.d.ts +0 -9
- package/dist-types/components/Blockquote/wrapper.d.ts +0 -9
- package/dist-types/components/Button/index.d.ts +0 -52
- package/dist-types/components/CheckMarkList/index.d.ts +0 -7
- package/dist-types/components/CheckMarkList/wrapper.d.ts +0 -6
- package/dist-types/components/Checklist/index.d.ts +0 -13
- package/dist-types/components/Checklist/wrapper.d.ts +0 -11
- package/dist-types/components/ColorSelect/index.d.ts +0 -14
- package/dist-types/components/ColorSelect/wrapper.d.ts +0 -11
- package/dist-types/components/ColumnRow/index.d.ts +0 -2
- package/dist-types/components/Columns/index.d.ts +0 -16
- package/dist-types/components/Container/index.d.ts +0 -6
- package/dist-types/components/Container/wrapper.d.ts +0 -1
- package/dist-types/components/Content/index.d.ts +0 -6
- package/dist-types/components/Content/wrapper.d.ts +0 -4
- package/dist-types/components/ContentLogo/index.d.ts +0 -3
- package/dist-types/components/DataList/index.d.ts +0 -10
- package/dist-types/components/DataList/wrapper.d.ts +0 -6
- package/dist-types/components/DetailBox/index.d.ts +0 -8
- package/dist-types/components/DetailBox/wrapper.d.ts +0 -13
- package/dist-types/components/DocumentList/index.d.ts +0 -11
- package/dist-types/components/DocumentList/wrapper.d.ts +0 -11
- package/dist-types/components/ExtendContent/index.d.ts +0 -8
- package/dist-types/components/ExtendContent/wrapper.d.ts +0 -6
- package/dist-types/components/ExtendInfo/index.d.ts +0 -7
- package/dist-types/components/ExtendInfo/wrapper.d.ts +0 -10
- package/dist-types/components/Filter/index.d.ts +0 -7
- package/dist-types/components/Filter/wrapper.d.ts +0 -8
- package/dist-types/components/FilterPanel/checkListFacet.d.ts +0 -7
- package/dist-types/components/FilterPanel/colorFacet.d.ts +0 -7
- package/dist-types/components/FilterPanel/faceSelector.d.ts +0 -7
- package/dist-types/components/FilterPanel/index.d.ts +0 -18
- package/dist-types/components/FilterPanel/rangeFacet.d.ts +0 -9
- package/dist-types/components/FinancialOptions/LoanModal.d.ts +0 -9
- package/dist-types/components/FinancialOptions/index.d.ts +0 -8
- package/dist-types/components/FinancialOptions/leasing.d.ts +0 -7
- package/dist-types/components/FinancialOptions/loan.d.ts +0 -8
- package/dist-types/components/Gallery/MediaButton.d.ts +0 -7
- package/dist-types/components/Gallery/index.d.ts +0 -8
- package/dist-types/components/Gallery/wrapper.d.ts +0 -22
- package/dist-types/components/Grid/index.d.ts +0 -12
- package/dist-types/components/Grid/wrapper.d.ts +0 -3
- package/dist-types/components/Heading/index.d.ts +0 -29
- package/dist-types/components/Icon/index.d.ts +0 -17
- package/dist-types/components/Image/index.d.ts +0 -1
- package/dist-types/components/InputCheckbox/index.d.ts +0 -7
- package/dist-types/components/InputCheckbox/wrapper.d.ts +0 -13
- package/dist-types/components/InputGroup/index.d.ts +0 -2
- package/dist-types/components/InputLabel/index.d.ts +0 -7
- package/dist-types/components/InputLabel/wrapper.d.ts +0 -3
- package/dist-types/components/InputSearch/index.d.ts +0 -11
- package/dist-types/components/InputSearch/wrapper.d.ts +0 -15
- package/dist-types/components/InputSelect/index.d.ts +0 -14
- package/dist-types/components/InputSelect/wrapper.d.ts +0 -6
- package/dist-types/components/InputText/index.d.ts +0 -8
- package/dist-types/components/InputText/wrapper.d.ts +0 -5
- package/dist-types/components/InsuranceOptions/Insurance.d.ts +0 -9
- package/dist-types/components/InsuranceOptions/InsuranceFree.d.ts +0 -7
- package/dist-types/components/InsuranceOptions/InsuranceFreeModal.d.ts +0 -8
- package/dist-types/components/InsuranceOptions/InsuranceModal.d.ts +0 -10
- package/dist-types/components/InsuranceOptions/index.d.ts +0 -9
- package/dist-types/components/Lightbox/index.d.ts +0 -9
- package/dist-types/components/Lightbox/wrapper.d.ts +0 -9
- package/dist-types/components/Link/index.d.ts +0 -7
- package/dist-types/components/Loader/index.d.ts +0 -7
- package/dist-types/components/Loader/wrapper.d.ts +0 -9
- package/dist-types/components/LogoBox/index.d.ts +0 -9
- package/dist-types/components/LogoBox/wrapper.d.ts +0 -4
- package/dist-types/components/Map/index.d.ts +0 -7
- package/dist-types/components/Map/wrapper.d.ts +0 -4
- package/dist-types/components/Modal/index.d.ts +0 -9
- package/dist-types/components/Modal/wrapper.d.ts +0 -21
- package/dist-types/components/NavButton/index.d.ts +0 -3
- package/dist-types/components/OpeningHours/index.d.ts +0 -7
- package/dist-types/components/OptionBox/index.d.ts +0 -9
- package/dist-types/components/OptionBox/wrapper.d.ts +0 -8
- package/dist-types/components/OverflowBox/index.d.ts +0 -6
- package/dist-types/components/OverflowBox/wrapper.d.ts +0 -1
- package/dist-types/components/OverflowGrid/index.d.ts +0 -12
- package/dist-types/components/OverflowGrid/wrapper.d.ts +0 -18
- package/dist-types/components/Page/index.d.ts +0 -7
- package/dist-types/components/Panel/index.d.ts +0 -10
- package/dist-types/components/Panel/wrapper.d.ts +0 -22
- package/dist-types/components/PhoneNumber/index.d.ts +0 -6
- package/dist-types/components/Portal/index.d.ts +0 -4
- package/dist-types/components/Portal/portal-element.d.ts +0 -6
- package/dist-types/components/Portal/portal-namespace.d.ts +0 -1
- package/dist-types/components/Portal/portal.d.ts +0 -7
- package/dist-types/components/Price/index.d.ts +0 -4
- package/dist-types/components/PriceBox/index.d.ts +0 -11
- package/dist-types/components/PriceBox/wrapper.d.ts +0 -10
- package/dist-types/components/PriceTable/index.d.ts +0 -7
- package/dist-types/components/PriceTable/wrapper.d.ts +0 -4
- package/dist-types/components/ProductCard/index.d.ts +0 -20
- package/dist-types/components/ProductCard/wrapper.d.ts +0 -22
- package/dist-types/components/ProductPage/index.d.ts +0 -9
- package/dist-types/components/ProgressBar/index.d.ts +0 -8
- package/dist-types/components/ProgressBar/wrapper.d.ts +0 -6
- package/dist-types/components/RangeSlider/RangeSliderSimple.d.ts +0 -13
- package/dist-types/components/RangeSlider/SliderWithLabel.d.ts +0 -13
- package/dist-types/components/RangeSlider/handle.d.ts +0 -9
- package/dist-types/components/RangeSlider/index.d.ts +0 -13
- package/dist-types/components/RangeSlider/track.d.ts +0 -9
- package/dist-types/components/RangeSlider/wrapper.d.ts +0 -11
- package/dist-types/components/RangeSliderLabel/index.d.ts +0 -8
- package/dist-types/components/RangeSliderLabel/wrapper.d.ts +0 -10
- package/dist-types/components/Repeat/index.d.ts +0 -3
- package/dist-types/components/Result/index.d.ts +0 -6
- package/dist-types/components/Result/wrapper.d.ts +0 -9
- package/dist-types/components/Root/index.d.ts +0 -4
- package/dist-types/components/SearchBar/index.d.ts +0 -8
- package/dist-types/components/SearchFilter/index.d.ts +0 -3
- package/dist-types/components/SearchTerm/index.d.ts +0 -8
- package/dist-types/components/SearchTerm/wrapper.d.ts +0 -7
- package/dist-types/components/SectionHeader/index.d.ts +0 -8
- package/dist-types/components/SectionHeader/wrapper.d.ts +0 -3
- package/dist-types/components/Snackbar/index.d.ts +0 -9
- package/dist-types/components/Snackbar/wrapper.d.ts +0 -11
- package/dist-types/components/SortSelect/index.d.ts +0 -14
- package/dist-types/components/SortSelect/wrapper.d.ts +0 -6
- package/dist-types/components/Sphere/Sphere.d.ts +0 -10
- package/dist-types/components/Sphere/SphereLightbox.d.ts +0 -6
- package/dist-types/components/Sphere/SphereViewer.d.ts +0 -10
- package/dist-types/components/Sphere/wrapper.d.ts +0 -1
- package/dist-types/components/SrOnly/index.d.ts +0 -1
- package/dist-types/components/StateIndicator/index.d.ts +0 -5
- package/dist-types/components/SwitchBar/index.d.ts +0 -10
- package/dist-types/components/SwitchBar/wrapper.d.ts +0 -14
- package/dist-types/components/TableColumn/index.d.ts +0 -3
- package/dist-types/components/TableList/index.d.ts +0 -6
- package/dist-types/components/Tabs/index.d.ts +0 -12
- package/dist-types/components/Tabs/wrapper.d.ts +0 -12
- package/dist-types/components/ThreeSixty/Rotation.d.ts +0 -6
- package/dist-types/components/ThreeSixty/ThreeSixtLightbox.d.ts +0 -6
- package/dist-types/components/ThreeSixty/ThreeSixty.d.ts +0 -9
- package/dist-types/components/UspList/index.d.ts +0 -11
- package/dist-types/components/UspList/wrapper.d.ts +0 -11
- package/dist-types/components/Utility/index.d.ts +0 -8
- package/dist-types/components/Video/CustomPlayer.d.ts +0 -10
- package/dist-types/components/Video/EmbeddedVideoLightbox.d.ts +0 -8
- package/dist-types/components/Video/EmbededVideo.d.ts +0 -8
- package/dist-types/components/Video/QuickNavEmbeded.d.ts +0 -7
- package/dist-types/components/Video/QuickNavVideo.d.ts +0 -7
- package/dist-types/components/Video/Video.d.ts +0 -5
- package/dist-types/components/Video/VimeoPlayer.d.ts +0 -7
- package/dist-types/components/Video/YoutubePlayer.d.ts +0 -7
- package/dist-types/components/Video/useThumbnail.d.ts +0 -2
- package/dist-types/components/Video/utils.d.ts +0 -9
- package/dist-types/components/Video/wrapper.d.ts +0 -11
- package/dist-types/hooks/useFetch.d.ts +0 -7
- package/dist-types/hooks/useHasBeenVisible.d.ts +0 -2
- package/dist-types/hooks/useHashGuid.d.ts +0 -2
- package/dist-types/hooks/useInsurance.d.ts +0 -4
- package/dist-types/hooks/useLoan.d.ts +0 -4
- package/dist-types/hooks/useOnScreen.d.ts +0 -2
- package/dist-types/hooks/useOutsideClick.d.ts +0 -2
- package/dist-types/hooks/usePrevious.d.ts +0 -2
- package/dist-types/hooks/useSearchItem.d.ts +0 -4
- package/dist-types/hooks/useSearchItemBranch.d.ts +0 -4
- package/dist-types/hooks/useSessionStorage.d.ts +0 -7
- package/dist-types/hooks/useVimeoThumbnail.d.ts +0 -2
- package/dist-types/index.d.ts +0 -18
- package/dist-types/layout/helpers.d.ts +0 -1
- package/dist-types/layout/keyframes.d.ts +0 -3
- package/dist-types/layout/theme.d.ts +0 -49
- package/dist-types/layouts/WaykeComposite.d.ts +0 -6
- package/dist-types/layouts/WaykeCompositeWithProvider.d.ts +0 -9
- package/dist-types/layouts/search/index.d.ts +0 -16
- package/dist-types/layouts/searchItem/Accessories/AccessoryModal.d.ts +0 -8
- package/dist-types/layouts/searchItem/Accessories/index.d.ts +0 -7
- package/dist-types/layouts/searchItem/Branch.d.ts +0 -9
- package/dist-types/layouts/searchItem/BranchModal.d.ts +0 -9
- package/dist-types/layouts/searchItem/CheckList.d.ts +0 -14
- package/dist-types/layouts/searchItem/DemoCarModal.d.ts +0 -6
- package/dist-types/layouts/searchItem/Documents.d.ts +0 -7
- package/dist-types/layouts/searchItem/ManufacturerPackagesOption.d.ts +0 -7
- package/dist-types/layouts/searchItem/MetadataItem.d.ts +0 -10
- package/dist-types/layouts/searchItem/PackageOptionModal.d.ts +0 -17
- package/dist-types/layouts/searchItem/PackageOptions.d.ts +0 -7
- package/dist-types/layouts/searchItem/Page404.d.ts +0 -3
- package/dist-types/layouts/searchItem/PageLoading.d.ts +0 -3
- package/dist-types/layouts/searchItem/Property.d.ts +0 -8
- package/dist-types/layouts/searchItem/Related.d.ts +0 -11
- package/dist-types/layouts/searchItem/index.d.ts +0 -13
- package/dist-types/providers/WaykeItemProvidet.d.ts +0 -22
- package/dist-types/providers/WaykeProvider.d.ts +0 -24
- package/dist-types/providers/graphqlProvider.d.ts +0 -6
- package/dist-types/providers/themeProvider.d.ts +0 -6
- package/dist-types/queries/INSURANCE_CALCULATION.d.ts +0 -2
- package/dist-types/queries/LOAN_CALCULATION.d.ts +0 -2
- package/dist-types/queries/SEARCH_ITEM_BRANCH_QUERY.d.ts +0 -2
- package/dist-types/queries/SEARCH_ITEM_QUERY.d.ts +0 -2
- package/dist-types/utils/constants.d.ts +0 -63
- package/dist-types/utils/converters.d.ts +0 -1
- package/dist-types/utils/deep-copy.d.ts +0 -5
- package/dist-types/utils/formats.d.ts +0 -8
- package/dist-types/utils/metadata.min.d.ts +0 -11
- package/dist-types/utils/phonenumbers.d.ts +0 -1
- package/dist-types/utils/pubsub/Actions.d.ts +0 -16
- package/dist-types/utils/pubsub/Events.d.ts +0 -51
- package/dist-types/utils/pubsub/pubsub.d.ts +0 -32
- package/dist-types/utils/regex.d.ts +0 -3
- package/dist-types/utils/sortOptions.d.ts +0 -13
- package/dist-types/utils/specification.d.ts +0 -28
- package/dist-types/utils/ssn.d.ts +0 -1
- package/dist-types/utils/url.d.ts +0 -1
- package/dist-types/utils/vehicle-properties/compare-basic-properties.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/compare-categories.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/compare-properties.d.ts +0 -3
- package/dist-types/utils/vehicle-properties/custom-property-adder.d.ts +0 -12
- package/dist-types/utils/vehicle-properties/property-hint-enricher.d.ts +0 -10
- package/dist-types/utils/vehicle-properties/property-remover.d.ts +0 -7
- package/dist-types/utils/vehicle-properties/property-tree-creator.d.ts +0 -31
- package/dist-types/utils/vehicle-properties/property-tree-sorter.d.ts +0 -3
- package/dist-web/index.js +0 -8197
- package/dist-web/index.js.map +0 -1
- /package/{assets → dist/assets}/ajax-loader.gif +0 -0
- /package/{assets → dist/assets}/default.css +0 -0
- /package/{assets → dist/assets}/fonts/slick.eot +0 -0
- /package/{assets → dist/assets}/fonts/slick.svg +0 -0
- /package/{assets → dist/assets}/fonts/slick.ttf +0 -0
- /package/{assets → dist/assets}/fonts/slick.woff +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useState, useEffect } from 'react';
|
|
2
|
-
import RangeSlider from '../RangeSlider/index';
|
|
3
|
-
import useSearch from '../../State/Search/useSearch';
|
|
4
|
-
const getInitialValues = (domain, facet, searchParams) => {
|
|
5
|
-
const facetMin = domain[0]; //parseInt(facet.filters[0].displayName, 10);
|
|
6
|
-
const _queryMin = searchParams?.get(`${facet.id}.min`) || null;
|
|
7
|
-
const facetMax = domain[domain.length - 1]; //parseInt(facet.filters[facet.filters.length - 1].displayName, 10);
|
|
8
|
-
const _queryMax = searchParams?.get(`${facet.id}.max`) || null;
|
|
9
|
-
const queryMin = parseInt(_queryMin === null ? `${facetMin}` : _queryMin, 10);
|
|
10
|
-
const min = facetMin > queryMin ? facetMin : queryMin;
|
|
11
|
-
const queryMax = parseInt(_queryMax === null ? `${facetMax}` : _queryMax, 10);
|
|
12
|
-
const max = queryMax > facetMax ? facetMin : queryMax;
|
|
13
|
-
return min || max ? [min ? min : domain[0], max ? max : domain[1]] : domain;
|
|
14
|
-
};
|
|
15
|
-
const averageDelta = ([x, ...xs]) => {
|
|
16
|
-
if (x === undefined)
|
|
17
|
-
return NaN;
|
|
18
|
-
return xs.reduce(([acc, last], x) => [acc + (x - last), x], [0, x])[0] / xs.length;
|
|
19
|
-
};
|
|
20
|
-
const getSteps = (initialAllValues) => {
|
|
21
|
-
const delta = averageDelta(initialAllValues);
|
|
22
|
-
const max = Math.floor(initialAllValues[initialAllValues.length - 1] * 1000) / 1000;
|
|
23
|
-
if (delta > 1000)
|
|
24
|
-
return new Array(max / 1000 + 1).fill('').map((x, i) => i * 1000);
|
|
25
|
-
if (delta <= 1000 && delta >= 500)
|
|
26
|
-
return new Array(max / 500 + 1).fill('').map((x, i) => i * 500);
|
|
27
|
-
return initialAllValues;
|
|
28
|
-
};
|
|
29
|
-
const RangeFacet = ({ facet, unit, formatValues }) => {
|
|
30
|
-
const { loading, queryFilter, initialFacets, onFilterUpdate } = useSearch();
|
|
31
|
-
const initialFacet = initialFacets?.find((x) => x.id === facet.id);
|
|
32
|
-
const maxPrefix = initialFacet?.filters[initialFacet?.filters.length - 1]?.displayName?.includes('+');
|
|
33
|
-
const [state, setValues] = useState(undefined);
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const _initialAllValues = initialFacet?.filters.map((f) => parseInt(f.displayName.replace(/[\<\>+-]+/g, ''), 10)) || [1, 2];
|
|
36
|
-
const _steps = getSteps(_initialAllValues);
|
|
37
|
-
const domain = [_steps[0], _steps[_steps.length - 1]];
|
|
38
|
-
setValues({
|
|
39
|
-
id: initialFacet?.id,
|
|
40
|
-
steps: _steps,
|
|
41
|
-
domain: [_steps[0], _steps[_steps.length - 1]],
|
|
42
|
-
values: initialFacet?.filters.length
|
|
43
|
-
? getInitialValues(domain, initialFacet, queryFilter.searchParams)
|
|
44
|
-
: [0, 0],
|
|
45
|
-
});
|
|
46
|
-
}, [initialFacet?.id]);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (state?.id) {
|
|
49
|
-
const init = initialFacet?.filters.length
|
|
50
|
-
? getInitialValues(state.domain, initialFacet, queryFilter.searchParams)
|
|
51
|
-
: [0, 0];
|
|
52
|
-
const minStr = queryFilter.searchParams?.get(`${facet.id}.min`);
|
|
53
|
-
const maxStr = queryFilter.searchParams?.get(`${facet.id}.max`);
|
|
54
|
-
const min = minStr ? parseFloat(minStr) : init[0];
|
|
55
|
-
const max = maxStr ? parseFloat(maxStr) : init[1];
|
|
56
|
-
if (min !== state.values[0] || max !== state.values[1]) {
|
|
57
|
-
onChange([min, max]);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, [queryFilter.searchParams?.toString()]);
|
|
61
|
-
const onChange = useCallback((nextValues) => {
|
|
62
|
-
if (state?.id) {
|
|
63
|
-
if (state.values[0] !== nextValues[0] || state.values[1] !== nextValues[1]) {
|
|
64
|
-
setValues({ ...state, values: nextValues.slice() });
|
|
65
|
-
const query = new URLSearchParams(queryFilter.searchParams);
|
|
66
|
-
query.set('hits', '30');
|
|
67
|
-
query.delete(`${facet.id}.min`);
|
|
68
|
-
query.delete(`${facet.id}.max`);
|
|
69
|
-
if (nextValues[0] !== state.domain[0]) {
|
|
70
|
-
query.set(`${facet.id}.min`, `${nextValues[0]}`);
|
|
71
|
-
}
|
|
72
|
-
if (nextValues[1] !== state.domain[1]) {
|
|
73
|
-
query.set(`${facet.id}.max`, `${nextValues[1]}`);
|
|
74
|
-
}
|
|
75
|
-
query.sort();
|
|
76
|
-
onFilterUpdate(query.toString());
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, [queryFilter.searchParams, state]);
|
|
80
|
-
return (React.createElement(React.Fragment, null, state && (React.createElement(RangeSlider, { loading: loading, domain: state.domain, values: state.values, maxPrefix: maxPrefix ? '+' : undefined, steps: state.steps, unit: unit, onChange: onChange, formatValues: formatValues }))));
|
|
81
|
-
};
|
|
82
|
-
export default RangeFacet;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import useLoanCalculation from '../../hooks/useLoan';
|
|
3
|
-
import Modal from '../Modal/index';
|
|
4
|
-
import { ModalFoldout, ModalFoldoutBody } from '../Modal/wrapper';
|
|
5
|
-
import Content from '../Content/index';
|
|
6
|
-
import LogoBox from '../LogoBox/index';
|
|
7
|
-
import { Repeat, RepeatSmall, RepeatTiny } from '../Repeat/index';
|
|
8
|
-
import { numberSeparator } from '../../utils/formats';
|
|
9
|
-
import { ButtonClear, ButtonContent } from '../Button/index';
|
|
10
|
-
import { ContentLogo, ContentLogoText, ContentLogoMedia } from '../ContentLogo/index';
|
|
11
|
-
import DataList from '../DataList/index';
|
|
12
|
-
import PubSub from '../../utils/pubsub/pubsub';
|
|
13
|
-
import SliderWithLabel from '../RangeSlider/SliderWithLabel';
|
|
14
|
-
const stepGenerator = (step, max, steps = [], current) => {
|
|
15
|
-
if (step === 0 && current === undefined)
|
|
16
|
-
return steps;
|
|
17
|
-
if (current !== undefined && current >= max && step !== 0) {
|
|
18
|
-
return steps;
|
|
19
|
-
}
|
|
20
|
-
const nextCurrent = current ? step + current : step;
|
|
21
|
-
steps.push(nextCurrent);
|
|
22
|
-
return stepGenerator(step, max, steps, nextCurrent);
|
|
23
|
-
};
|
|
24
|
-
const LoanModal = ({ id, financialOption, onClose }) => {
|
|
25
|
-
const [tmp, setTmp] = useState();
|
|
26
|
-
const [extend, setExtend] = React.useState(false);
|
|
27
|
-
const onToggleExtend = React.useCallback(() => {
|
|
28
|
-
if (!extend) {
|
|
29
|
-
PubSub.publish('FinanceInterest');
|
|
30
|
-
}
|
|
31
|
-
setExtend(!extend);
|
|
32
|
-
}, [extend]);
|
|
33
|
-
const [variables, setVariables] = useState({
|
|
34
|
-
duration: financialOption.duration?.current,
|
|
35
|
-
downPayment: financialOption.downPayment?.current,
|
|
36
|
-
residual: financialOption.residual?.current,
|
|
37
|
-
});
|
|
38
|
-
const { duration, downPayment, residual } = variables;
|
|
39
|
-
const { loading, data } = useLoanCalculation(id, duration, downPayment, residual);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
if (data) {
|
|
42
|
-
setTmp(data);
|
|
43
|
-
setVariables({
|
|
44
|
-
duration: data?.loan?.duration?.current || 0,
|
|
45
|
-
downPayment: data?.loan?.downPayment?.current || 0,
|
|
46
|
-
residual: data?.loan?.residual?.current || 0,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}, [data]);
|
|
50
|
-
const loan = data?.loan || tmp?.loan;
|
|
51
|
-
const downPaymentCurrent = loan?.downPayment?.current || 0;
|
|
52
|
-
const downPaymentMin = loan?.downPayment?.min || 0;
|
|
53
|
-
const downPaymentMax = loan?.downPayment?.max || 0;
|
|
54
|
-
const downPaymentStep = loan?.downPayment?.step || 0;
|
|
55
|
-
const downPaymentSteps = stepGenerator(downPaymentStep, downPaymentMax);
|
|
56
|
-
const onDownPaymentChange = useCallback((values) => {
|
|
57
|
-
PubSub.publish('FinanceInterest');
|
|
58
|
-
setVariables({ ...variables, downPayment: values[0] });
|
|
59
|
-
}, [variables]);
|
|
60
|
-
const durationCurrent = loan?.duration?.current || 0;
|
|
61
|
-
const durationMin = loan?.duration?.min || 0;
|
|
62
|
-
const durationMax = loan?.duration?.max || 0;
|
|
63
|
-
const durationStep = loan?.duration?.step || 0;
|
|
64
|
-
const durationSteps = stepGenerator(durationStep, durationMax);
|
|
65
|
-
const onDurationChange = useCallback((values) => {
|
|
66
|
-
PubSub.publish('FinanceInterest');
|
|
67
|
-
setVariables({ ...variables, duration: values[0] });
|
|
68
|
-
}, [variables]);
|
|
69
|
-
const residualCurrent = (loan?.residual?.current || 0) * 100 || 0;
|
|
70
|
-
const residualMin = (loan?.residual?.min || 0) * 100 || 0;
|
|
71
|
-
const residualMax = (loan?.residual?.max || 0) * 100 || 0;
|
|
72
|
-
const residualStep = (loan?.residual?.step || 0) * 100 || 0;
|
|
73
|
-
const residualSteps = stepGenerator(residualStep, residualMax);
|
|
74
|
-
const onResidualChange = useCallback((values) => {
|
|
75
|
-
PubSub.publish('FinanceInterest');
|
|
76
|
-
setVariables({ ...variables, residual: values[0] / 100 });
|
|
77
|
-
}, [variables]);
|
|
78
|
-
const interestText = ((loan?.interest || 0) * 100).toFixed(2);
|
|
79
|
-
const effectiveInterestText = ((loan?.effectiveInterest || 0) * 100).toFixed(2);
|
|
80
|
-
return (React.createElement(Modal, { title: "L\u00E5nealternativ", onClose: onClose },
|
|
81
|
-
React.createElement(Repeat, null,
|
|
82
|
-
React.createElement(ContentLogo, null,
|
|
83
|
-
financialOption?.description && (React.createElement(ContentLogoText, null,
|
|
84
|
-
React.createElement(Content, null,
|
|
85
|
-
React.createElement("p", null, financialOption.description)))),
|
|
86
|
-
financialOption?.image && (React.createElement(ContentLogoMedia, null,
|
|
87
|
-
React.createElement(LogoBox, { logo: financialOption.image, alt: financialOption.name || 'Logotyp', wide: true }))))),
|
|
88
|
-
React.createElement(Repeat, null,
|
|
89
|
-
React.createElement(RepeatSmall, null,
|
|
90
|
-
React.createElement(SliderWithLabel, { label: "Kontantinsatts", values: [downPaymentCurrent], domain: [downPaymentMin, downPaymentMax], steps: downPaymentSteps, unit: "kr", formatValues: true, loading: loading, onChange: onDownPaymentChange })),
|
|
91
|
-
React.createElement(RepeatSmall, null,
|
|
92
|
-
React.createElement(SliderWithLabel, { label: "Avbetalning", values: [durationCurrent], domain: [durationMin, durationMax], steps: durationSteps, unit: "m\u00E5n", loading: loading, onChange: onDurationChange })),
|
|
93
|
-
residual !== undefined && residualMax !== 0 && (React.createElement(RepeatSmall, null,
|
|
94
|
-
React.createElement(SliderWithLabel, { label: "Restskuld", values: [residualCurrent], domain: [residualMin, residualMax], steps: residualSteps, unit: "%", loading: loading, onChange: onResidualChange }))),
|
|
95
|
-
React.createElement(RepeatSmall, null,
|
|
96
|
-
React.createElement(RepeatTiny, null,
|
|
97
|
-
React.createElement(Content, { small: true },
|
|
98
|
-
React.createElement("p", null, `*Beräknat på ${interestText} % ränta (effektivt ${effectiveInterestText} %)${loan?.mileage !== null ? `och en årlig körsträcka om ${loan?.mileage} mil.` : ''}`)))),
|
|
99
|
-
React.createElement(RepeatSmall, null,
|
|
100
|
-
React.createElement(ButtonClear, { onClick: onToggleExtend, title: extend ? 'Visa mindre information' : 'Visa mer information' },
|
|
101
|
-
React.createElement(ButtonContent, null, extend ? 'Mindre information' : 'Mer information'))),
|
|
102
|
-
React.createElement(React.Fragment, null, extend && (React.createElement(ModalFoldout, null,
|
|
103
|
-
React.createElement(ModalFoldoutBody, null,
|
|
104
|
-
React.createElement(DataList, { items: [
|
|
105
|
-
{
|
|
106
|
-
label: 'Ränta',
|
|
107
|
-
value: `${interestText} %`,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
label: 'Effektiv ränta',
|
|
111
|
-
value: `${effectiveInterestText} %`,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
label: 'Uppläggningskostnad',
|
|
115
|
-
value: `${numberSeparator(financialOption?.setupFee || 0)} kr`,
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
label: 'Administrativa avgifter',
|
|
119
|
-
value: `${numberSeparator(financialOption?.administrationFee || 0)} kr/mån`,
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
label: 'Total kreditkostnad',
|
|
123
|
-
value: `${numberSeparator(loan?.totalCreditCost || 0)} kr`,
|
|
124
|
-
},
|
|
125
|
-
] }))))))));
|
|
126
|
-
};
|
|
127
|
-
export default LoanModal;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
2
|
-
import { Repeat, RepeatTiny } from '../Repeat/index';
|
|
3
|
-
import { VisualHeading } from '../Heading/index';
|
|
4
|
-
import Leasing from './leasing';
|
|
5
|
-
import Loan from './loan';
|
|
6
|
-
const FinancialOptions = ({ id, financialOptions }) => (React.createElement(Repeat, null,
|
|
7
|
-
React.createElement(RepeatTiny, null,
|
|
8
|
-
React.createElement(VisualHeading, null, "Andra finansieringsalternativ")),
|
|
9
|
-
React.createElement(RepeatTiny, null, financialOptions.map((financialOption, index) => (React.createElement(Fragment, { key: index },
|
|
10
|
-
(financialOption.type === 'leasing' || financialOption.type === 'business-leasing') && (React.createElement(Leasing, { financialOption: financialOption })),
|
|
11
|
-
financialOption.type === 'loan' && React.createElement(Loan, { id: id, financialOption: financialOption })))))));
|
|
12
|
-
export default FinancialOptions;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import OptionBox from '../OptionBox/index';
|
|
3
|
-
import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
|
|
4
|
-
import { UtilityTextPrimary } from '../Utility/index';
|
|
5
|
-
import { ButtonInline } from '../Button/index';
|
|
6
|
-
import { numberSeparator } from '../../utils/formats';
|
|
7
|
-
import Modal from '../Modal/index';
|
|
8
|
-
import { Image, ModalFoldout, ModalFoldoutBody } from '../Modal/wrapper';
|
|
9
|
-
import Content from '../Content/index';
|
|
10
|
-
import DataList from '../DataList/index';
|
|
11
|
-
const Leasing = ({ financialOption }) => {
|
|
12
|
-
const [modal, setModal] = useState(false);
|
|
13
|
-
const toggleModal = useCallback(() => setModal(!modal), [modal]);
|
|
14
|
-
const { image, description, monthlyCost, duration, mileage, type, name } = financialOption;
|
|
15
|
-
const title = type === 'leasing' ? 'Privatleasa' : type === 'business-leasing' ? 'Företagsleasa' : type;
|
|
16
|
-
return (React.createElement(React.Fragment, null,
|
|
17
|
-
modal && (React.createElement(Modal, { title: title, onClose: toggleModal },
|
|
18
|
-
image && React.createElement(Image, { src: image, alt: title }),
|
|
19
|
-
description && React.createElement(Content, { dangerouslySetInnerHTML: { __html: description } }),
|
|
20
|
-
React.createElement(ModalFoldout, null,
|
|
21
|
-
React.createElement(ModalFoldoutBody, null,
|
|
22
|
-
React.createElement(DataList, { items: [
|
|
23
|
-
{
|
|
24
|
-
label: 'Månadskostnad',
|
|
25
|
-
value: `${numberSeparator(monthlyCost || 0)} kr/mån`,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: 'Bindningstid',
|
|
29
|
-
value: `${duration?.current} månader`,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'Årlig körsträcka',
|
|
33
|
-
value: `${numberSeparator(mileage?.current || 0)} mil/år`,
|
|
34
|
-
},
|
|
35
|
-
] }))))),
|
|
36
|
-
React.createElement(OptionBox, null,
|
|
37
|
-
React.createElement(React.Fragment, null, monthlyCost !== null && monthlyCost !== undefined && (React.createElement(OptionBoxHeading, null, `ca ${numberSeparator(monthlyCost)} kr/mån`))),
|
|
38
|
-
React.createElement(OptionBoxContent, null,
|
|
39
|
-
React.createElement("p", null,
|
|
40
|
-
title,
|
|
41
|
-
' ',
|
|
42
|
-
mileage?.current && duration?.current && (React.createElement(React.Fragment, null,
|
|
43
|
-
React.createElement(UtilityTextPrimary, null,
|
|
44
|
-
numberSeparator(mileage?.current),
|
|
45
|
-
" mil/\u00E5r"),
|
|
46
|
-
' ',
|
|
47
|
-
"i ",
|
|
48
|
-
React.createElement(UtilityTextPrimary, null,
|
|
49
|
-
duration?.current,
|
|
50
|
-
" m\u00E5n"),
|
|
51
|
-
".",
|
|
52
|
-
' '))),
|
|
53
|
-
name && (React.createElement("p", null,
|
|
54
|
-
React.createElement(ButtonInline, { onClick: toggleModal }, "L\u00E4s mer")))))));
|
|
55
|
-
};
|
|
56
|
-
export default Leasing;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import OptionBox from '../OptionBox/index';
|
|
3
|
-
import { OptionBoxHeading, OptionBoxContent } from '../OptionBox/wrapper';
|
|
4
|
-
import { UtilityTextPrimary } from '../Utility/index';
|
|
5
|
-
import { ButtonInline } from '../Button/index';
|
|
6
|
-
import { numberSeparator } from '../../utils/formats';
|
|
7
|
-
import useLoanCalculation from '../../hooks/useLoan';
|
|
8
|
-
import LoanModal from './LoanModal';
|
|
9
|
-
const Loan = ({ id, financialOption }) => {
|
|
10
|
-
const [modal, setModal] = useState(false);
|
|
11
|
-
const toggleModal = useCallback(() => setModal(!modal), [modal]);
|
|
12
|
-
const { data } = useLoanCalculation(id, financialOption.duration?.current, financialOption.downPayment?.current, financialOption.residual?.current);
|
|
13
|
-
const interest = data?.loan?.interest;
|
|
14
|
-
const duration = data?.loan?.duration?.current;
|
|
15
|
-
const monthlyCost = data?.loan?.monthlyCost;
|
|
16
|
-
const logo = financialOption?.logotype || 'https://placehold.it/67x10';
|
|
17
|
-
// Skeleton?
|
|
18
|
-
if (financialOption.loanAmount === undefined ||
|
|
19
|
-
financialOption.loanAmount === null ||
|
|
20
|
-
interest === undefined ||
|
|
21
|
-
duration === undefined ||
|
|
22
|
-
monthlyCost === undefined ||
|
|
23
|
-
interest === null ||
|
|
24
|
-
duration === null ||
|
|
25
|
-
monthlyCost === null) {
|
|
26
|
-
return (React.createElement(OptionBox, { logo: logo, logoAlt: "Logotyp" },
|
|
27
|
-
React.createElement(OptionBoxHeading, null, "Laddar..."),
|
|
28
|
-
React.createElement(OptionBoxContent, null,
|
|
29
|
-
React.createElement("p", null, "Laddar..."))));
|
|
30
|
-
}
|
|
31
|
-
return (React.createElement(React.Fragment, null,
|
|
32
|
-
modal && React.createElement(LoanModal, { id: id, financialOption: financialOption, onClose: toggleModal }),
|
|
33
|
-
React.createElement(OptionBox, { logo: logo, logoAlt: "Logotyp" },
|
|
34
|
-
React.createElement(React.Fragment, null,
|
|
35
|
-
React.createElement(OptionBoxHeading, null, `${numberSeparator(monthlyCost)} kr/mån*`),
|
|
36
|
-
React.createElement(OptionBoxContent, null,
|
|
37
|
-
React.createElement("p", null,
|
|
38
|
-
"Delbetala",
|
|
39
|
-
' ',
|
|
40
|
-
financialOption.loanAmount && duration && (React.createElement(React.Fragment, null,
|
|
41
|
-
React.createElement(UtilityTextPrimary, null,
|
|
42
|
-
numberSeparator(financialOption.loanAmount),
|
|
43
|
-
" kr"),
|
|
44
|
-
' ',
|
|
45
|
-
"i ",
|
|
46
|
-
React.createElement(UtilityTextPrimary, null,
|
|
47
|
-
duration,
|
|
48
|
-
" m\u00E5n"),
|
|
49
|
-
"."))),
|
|
50
|
-
React.createElement("p", null,
|
|
51
|
-
`*Beräknat på ${(interest * 100).toFixed(2)}% ränta. `,
|
|
52
|
-
React.createElement(ButtonInline, { onClick: toggleModal }, "L\u00E4s mer")))))));
|
|
53
|
-
};
|
|
54
|
-
export default Loan;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MediaButtonWrapper } from './wrapper';
|
|
3
|
-
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
4
|
-
const MediaButton = ({ text, onClick }) => (React.createElement(MediaButtonWrapper, null,
|
|
5
|
-
React.createElement(ButtonSecondary, { onClick: onClick, title: text },
|
|
6
|
-
React.createElement(ButtonContent, null, text))));
|
|
7
|
-
export default MediaButton;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useRef, useMemo } from 'react';
|
|
2
|
-
import Slider from 'react-slick';
|
|
3
|
-
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
4
|
-
import { Wrapper, SliderWrapper, Item, Image, ArrowLeft, ArrowRight, Main, Alt, QuickNav, QuickNavItem, QuickNavBtn, QuickNavImg, EnableNavigationButton, } from './wrapper';
|
|
5
|
-
import { IconChevronLeft, IconChevronRight } from '../Icon/index';
|
|
6
|
-
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
7
|
-
import { NavButton } from '../NavButton/index';
|
|
8
|
-
import Lightbox from '../Lightbox/index';
|
|
9
|
-
import EmbededVideo from '../Video/EmbededVideo';
|
|
10
|
-
import QuickNavEmbeded from '../Video/QuickNavEmbeded';
|
|
11
|
-
import Sphere from '../Sphere/Sphere';
|
|
12
|
-
import { notEmpty } from '../../utils/formats';
|
|
13
|
-
import ThreeSixty from '../ThreeSixty/ThreeSixty';
|
|
14
|
-
import PubSub from '../../utils/pubsub/pubsub';
|
|
15
|
-
import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
|
|
16
|
-
const sliderSettings = {
|
|
17
|
-
dots: false,
|
|
18
|
-
arrows: false,
|
|
19
|
-
infinite: true,
|
|
20
|
-
speed: 300,
|
|
21
|
-
slidesToShow: 1,
|
|
22
|
-
slidesToScroll: 1,
|
|
23
|
-
};
|
|
24
|
-
const Gallery = ({ media, placeholderImage }) => {
|
|
25
|
-
const slider = useRef(null);
|
|
26
|
-
const quickNavRef = useRef(null);
|
|
27
|
-
const isDragging = useRef(false);
|
|
28
|
-
const [index, setIndex] = useState(0);
|
|
29
|
-
const [lightbox, setLightbox] = useState(false);
|
|
30
|
-
const [navigationDisabled, setNavigationDisabled] = useState(false);
|
|
31
|
-
const beforeChange = useCallback((_, newIndex) => {
|
|
32
|
-
const element = quickNavRef.current?.querySelectorAll('li')?.[newIndex];
|
|
33
|
-
if (element) {
|
|
34
|
-
scrollIntoView(element, { scrollMode: 'if-needed', block: 'nearest', inline: 'nearest' });
|
|
35
|
-
}
|
|
36
|
-
setIndex(newIndex);
|
|
37
|
-
}, []);
|
|
38
|
-
const onMouseDown = useCallback(() => {
|
|
39
|
-
if (isDragging.current) {
|
|
40
|
-
isDragging.current = false;
|
|
41
|
-
}
|
|
42
|
-
}, []);
|
|
43
|
-
const onMouseMove = useCallback(() => {
|
|
44
|
-
if (!isDragging.current) {
|
|
45
|
-
isDragging.current = true;
|
|
46
|
-
}
|
|
47
|
-
}, []);
|
|
48
|
-
const onClick = useCallback(() => {
|
|
49
|
-
PubSub.publish('ImagesClick');
|
|
50
|
-
if (!isDragging.current && !lightbox && !!media?.length) {
|
|
51
|
-
setLightbox(true);
|
|
52
|
-
}
|
|
53
|
-
}, [lightbox, media]);
|
|
54
|
-
const nextImage = useCallback(() => {
|
|
55
|
-
if (!slider || !slider.current) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
slider.current.slickNext();
|
|
59
|
-
}, [slider]);
|
|
60
|
-
const prevImage = useCallback(() => {
|
|
61
|
-
if (!slider || !slider.current) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
slider.current.slickPrev();
|
|
65
|
-
}, [slider]);
|
|
66
|
-
const goTo = (target) => {
|
|
67
|
-
if (!slider || !slider.current) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (slider.current) {
|
|
71
|
-
setIndex(target);
|
|
72
|
-
slider.current.slickGoTo(target);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const onDisableNavigation = () => {
|
|
76
|
-
if (!isDragging.current)
|
|
77
|
-
setNavigationDisabled(true);
|
|
78
|
-
};
|
|
79
|
-
const onEnableNavigation = (e) => {
|
|
80
|
-
e.stopPropagation();
|
|
81
|
-
isDragging.current = false;
|
|
82
|
-
setNavigationDisabled(false);
|
|
83
|
-
};
|
|
84
|
-
const onToggleLightbox = useCallback(() => setLightbox(!lightbox), [lightbox]);
|
|
85
|
-
const mediaLength = media?.length || 0;
|
|
86
|
-
const placeholder = useMemo(() => placeholderImage || DEFAULT_PLACEHOLDER_IMAGE, [placeholderImage]);
|
|
87
|
-
return (React.createElement(React.Fragment, null,
|
|
88
|
-
React.createElement(Wrapper, null,
|
|
89
|
-
React.createElement(Main, null,
|
|
90
|
-
React.createElement(SliderWrapper, { onMouseDown: onMouseDown, onMouseMove: onMouseMove, onClick: onClick },
|
|
91
|
-
React.createElement(Slider, { ...sliderSettings, swipe: !navigationDisabled, touchMove: !navigationDisabled, swipeToSlide: !navigationDisabled, ref: slider, beforeChange: beforeChange }, !!media?.length ? (media.map((m, i) => (React.createElement(Item, { key: m.files[0].url || i },
|
|
92
|
-
m.type === 'image' && (React.createElement(Image, { src: m.files[0].formats.filter(notEmpty).find((x) => x.format === '1170x')?.url, alt: `Bild ${i + 1}` })),
|
|
93
|
-
m.type === 'threesixty' && (React.createElement(ThreeSixty, { urls: m.files.map((x) => x.url), visible: i === index, onDisableNavigation: onDisableNavigation, navigationDisabled: navigationDisabled })),
|
|
94
|
-
m.type === 'embedded' && React.createElement(EmbededVideo, { src: m.files[0].url, index: i + 1 }),
|
|
95
|
-
m.type === 'sphere' && (React.createElement(Sphere, { visible: i === index, url: m.files[0].url, preview: m.files[0].url, onDisableNavigation: onDisableNavigation, navigationDisabled: navigationDisabled })))))) : (React.createElement(Item, { key: placeholder },
|
|
96
|
-
React.createElement(Image, { src: placeholder, alt: `Bild 1` })))),
|
|
97
|
-
navigationDisabled && mediaLength > 1 && (React.createElement(EnableNavigationButton, null,
|
|
98
|
-
React.createElement(ButtonSecondary, { onClick: onEnableNavigation, title: "St\u00E4ng" },
|
|
99
|
-
React.createElement(ButtonContent, null, "St\u00E4ng"))))),
|
|
100
|
-
!navigationDisabled && mediaLength > 1 && (React.createElement(React.Fragment, null,
|
|
101
|
-
React.createElement(ArrowLeft, null,
|
|
102
|
-
React.createElement(NavButton, { onClick: prevImage, title: "F\u00F6reg\u00E5ende bild" },
|
|
103
|
-
React.createElement(IconChevronLeft, { block: true }))),
|
|
104
|
-
React.createElement(ArrowRight, null,
|
|
105
|
-
React.createElement(NavButton, { onClick: nextImage, title: "N\u00E4sta bild" },
|
|
106
|
-
React.createElement(IconChevronRight, { block: true })))))),
|
|
107
|
-
React.createElement(Alt, null,
|
|
108
|
-
React.createElement(QuickNav, { ref: quickNavRef }, !!media?.length ? (media.map((m, i) => {
|
|
109
|
-
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === '225x150')?.url ||
|
|
110
|
-
m.files[0].url;
|
|
111
|
-
return (React.createElement(QuickNavItem, { key: src || i, active: index === i },
|
|
112
|
-
React.createElement(QuickNavBtn, { onClick: () => goTo(i), title: `Gå till bild ${i + 1}` },
|
|
113
|
-
m.type === 'image' && React.createElement(QuickNavImg, { src: src, alt: `Bild ${i + 1}` }),
|
|
114
|
-
m.type === 'threesixty' && React.createElement(QuickNavImg, { src: src, alt: `Bild ${i + 1}` }),
|
|
115
|
-
m.type === 'embedded' && React.createElement(QuickNavEmbeded, { src: src, index: i }),
|
|
116
|
-
m.type === 'sphere' && (React.createElement(QuickNavImg, { src: m.files[0].url, alt: `Bild ${i + 1}` })))));
|
|
117
|
-
})) : (React.createElement(QuickNavItem, { key: placeholder, active: true },
|
|
118
|
-
React.createElement(QuickNavBtn, { onClick: () => goTo(0), title: `Gå till bild 0` },
|
|
119
|
-
React.createElement(QuickNavImg, { src: placeholder, alt: `Bild 1` }))))))),
|
|
120
|
-
lightbox && !!media?.length && (React.createElement(Lightbox, { media: media, index: index, onClose: onToggleLightbox }))));
|
|
121
|
-
};
|
|
122
|
-
export default Gallery;
|