@wayke-se/components-react 3.5.3 → 3.6.0-beta.1
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 +51 -43
- package/dist-node/index.js +692 -128
- package/dist-node/index.js.map +1 -1
- package/dist-src/components/AccessoryCard/index.js +14 -0
- package/dist-src/components/AccessoryCard/wrapper.js +90 -0
- package/dist-src/components/DocumentList/wrapper.js +1 -1
- package/dist-src/components/Gallery/index.js +7 -4
- package/dist-src/components/Gallery/wrapper.js +71 -39
- package/dist-src/components/Icon/index.js +2 -0
- package/dist-src/components/Image/index.js +5 -0
- package/dist-src/components/Link/index.js +28 -0
- package/dist-src/components/NavButton/index.js +42 -0
- package/dist-src/components/OverflowGrid/index.js +56 -66
- package/dist-src/components/OverflowGrid/wrapper.js +144 -0
- package/dist-src/components/PriceBox/index.js +6 -0
- package/dist-src/components/PriceBox/wrapper.js +34 -0
- package/dist-src/layout/theme.js +8 -0
- package/dist-src/layouts/searchItem/Accessories/AccessoryModal.js +51 -0
- package/dist-src/layouts/searchItem/Accessories/index.js +32 -0
- package/dist-src/layouts/searchItem/Related.js +23 -25
- package/dist-src/layouts/searchItem/index.js +3 -1
- package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +18 -0
- package/dist-src/queries/SEARCH_ITEM_QUERY.js +18 -0
- package/dist-types/@types/codegen/types.d.ts +17 -0
- package/dist-types/components/AccessoryCard/index.d.ts +16 -0
- package/dist-types/components/AccessoryCard/wrapper.d.ts +18 -0
- package/dist-types/components/Gallery/wrapper.d.ts +2 -6
- package/dist-types/components/Icon/index.d.ts +1 -0
- package/dist-types/components/Image/index.d.ts +1 -0
- package/dist-types/components/Link/index.d.ts +7 -0
- package/dist-types/components/NavButton/index.d.ts +3 -0
- package/dist-types/components/OverflowGrid/index.d.ts +12 -3
- package/dist-types/components/OverflowGrid/wrapper.d.ts +18 -0
- package/dist-types/components/PriceBox/index.d.ts +11 -0
- package/dist-types/components/PriceBox/wrapper.d.ts +10 -0
- package/dist-types/layout/theme.d.ts +8 -0
- package/dist-types/layouts/searchItem/Accessories/AccessoryModal.d.ts +8 -0
- package/dist-types/layouts/searchItem/Accessories/index.d.ts +7 -0
- package/dist-web/index.js +605 -123
- package/dist-web/index.js.map +1 -1
- package/package.json +2 -4
- package/assets/ajax-loader.gif +0 -0
- package/assets/default.css +0 -1
- package/assets/fonts/slick.eot +0 -0
- package/assets/fonts/slick.svg +0 -14
- package/assets/fonts/slick.ttf +0 -0
- package/assets/fonts/slick.woff +0 -0
package/dist-web/index.js
CHANGED
|
@@ -66,6 +66,14 @@ const theme = {
|
|
|
66
66
|
Lg: '@media (min-width: 1200px)',
|
|
67
67
|
LtLg: '@media (max-width: 1199px)',
|
|
68
68
|
},
|
|
69
|
+
mask: {
|
|
70
|
+
gradient: {
|
|
71
|
+
toTop: 'linear-gradient(to top, #000, transparent)',
|
|
72
|
+
toBottom: 'linear-gradient(to bottom, #000, transparent)',
|
|
73
|
+
toLeft: 'linear-gradient(to left, #000, transparent)',
|
|
74
|
+
toRight: 'linear-gradient(to right, #000, transparent)',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
69
77
|
distances: {
|
|
70
78
|
baseUnit: '8px',
|
|
71
79
|
inputHeight: '48px',
|
|
@@ -650,6 +658,8 @@ const IconExclamationCircle = ({ block }) => (createElement(Icon$1, { viewBox: "
|
|
|
650
658
|
createElement("path", { d: "M14.482 21.893c0-0.857 0.694-1.551 1.551-1.551s1.551 0.694 1.551 1.551c0 0.857-0.694 1.551-1.551 1.551s-1.551-0.694-1.551-1.551zM16.033 2.838c-7.271 0-13.187 5.916-13.187 13.187s5.916 13.187 13.187 13.187 13.187-5.916 13.187-13.187c0-7.271-5.916-13.187-13.187-13.187zM16.033 27.203c-6.163 0-11.178-5.015-11.178-11.178s5.015-11.178 11.178-11.178c6.164 0 11.178 5.015 11.178 11.178s-5.014 11.178-11.178 11.178zM16.033 8.308c-0.555 0-1.004 0.45-1.004 1.004v8.227c0 0.555 0.45 1.004 1.004 1.004s1.004-0.45 1.004-1.004v-8.227c0-0.555-0.45-1.004-1.004-1.004z" })));
|
|
651
659
|
const IconExclamationTriangle = ({ block }) => (createElement(Icon$1, { viewBox: "0 0 32 32", block: block },
|
|
652
660
|
createElement("path", { d: "M15.951 19.663c-0.457 0-0.828-0.37-0.828-0.828v-4.357c0-0.457 0.37-0.828 0.828-0.828s0.828 0.37 0.828 0.828v4.357c0 0.457-0.371 0.828-0.828 0.828zM15.952 22.906c-0.305 0-0.606-0.126-0.821-0.341s-0.338-0.514-0.338-0.818 0.122-0.606 0.338-0.821c0.431-0.43 1.209-0.43 1.639 0 0.215 0.215 0.341 0.516 0.341 0.821s-0.126 0.603-0.341 0.818c-0.215 0.215-0.513 0.341-0.818 0.341zM27.049 27.070h-22.196c-0.352 0-0.677-0.186-0.855-0.489s-0.184-0.677-0.014-0.985l11.098-20.105c0.175-0.317 0.508-0.513 0.87-0.513s0.695 0.197 0.87 0.513l11.098 20.105c0.17 0.308 0.165 0.683-0.014 0.985s-0.504 0.489-0.856 0.489zM6.536 25.083h18.83l-9.415-17.056-9.415 17.056z" })));
|
|
661
|
+
const IconImage = ({ block }) => (createElement(Icon$1, { viewBox: "0 0 16 16", block: block },
|
|
662
|
+
createElement("path", { d: "M14.4 1.6H1.6C.7 1.6 0 2.3 0 3.2v9.6c0 .9.7 1.6 1.6 1.6h12.8c.9 0 1.6-.7 1.6-1.6V3.2c0-.9-.7-1.6-1.6-1.6zm0 11.2H1.6V3.2h12.8v9.6zM3.2 6c0-.7.5-1.2 1.2-1.2s1.2.5 1.2 1.2-.5 1.2-1.2 1.2S3.2 6.7 3.2 6zm.2 4.5l6.2-4.4c.4-.3.9-.2 1.1.2v.1l2.4 4.2c.1.2 0 .4-.1.5-.1 0-.1.1-.2.1H3.7c-.2 0-.4-.2-.4-.4 0-.1 0-.3.1-.3z", fillRule: "evenodd", clipRule: "evenodd" })));
|
|
653
663
|
|
|
654
664
|
const SortSelect = ({ value, options, onChange, unit }) => (React__default.createElement(Wrapper$4, null,
|
|
655
665
|
React__default.createElement(Select, { value: value, onChange: onChange, title: "Sortering", "aria-label": "Sortering" }, options.map((option) => (React__default.createElement(Option, { key: option.value, value: option.value },
|
|
@@ -2821,6 +2831,76 @@ const SliderWrapper = styled.div `
|
|
|
2821
2831
|
bottom: 0;
|
|
2822
2832
|
left: 0;
|
|
2823
2833
|
right: 0;
|
|
2834
|
+
user-select: none;
|
|
2835
|
+
touch-action: pan-y;
|
|
2836
|
+
-webkit-tap-highlight-color: transparent;
|
|
2837
|
+
|
|
2838
|
+
.slick-list,
|
|
2839
|
+
.slick-track {
|
|
2840
|
+
transform: translate3d(0, 0, 0);
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
.slick-list {
|
|
2845
|
+
position: relative;
|
|
2846
|
+
display: block;
|
|
2847
|
+
margin: 0;
|
|
2848
|
+
padding: 0;
|
|
2849
|
+
overflow: hidden;
|
|
2850
|
+
|
|
2851
|
+
&:focus {
|
|
2852
|
+
outline: none;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
&.dragging {
|
|
2856
|
+
cursor: pointer;
|
|
2857
|
+
cursor: hand;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
.slick-track {
|
|
2862
|
+
position: relative;
|
|
2863
|
+
top: 0;
|
|
2864
|
+
left: 0;
|
|
2865
|
+
display: block;
|
|
2866
|
+
margin-left: auto;
|
|
2867
|
+
margin-right: auto;
|
|
2868
|
+
|
|
2869
|
+
&::before,
|
|
2870
|
+
&::after {
|
|
2871
|
+
content: '';
|
|
2872
|
+
display: table;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
&::after {
|
|
2876
|
+
clear: both;
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2879
|
+
|
|
2880
|
+
.slick-slide {
|
|
2881
|
+
display: none;
|
|
2882
|
+
float: left;
|
|
2883
|
+
min-height: 1px;
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
.slick-loading {
|
|
2887
|
+
.slick-track {
|
|
2888
|
+
visibility: hidden;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
img {
|
|
2892
|
+
display: none;
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
.slick-initialized {
|
|
2897
|
+
.slick-slide {
|
|
2898
|
+
display: block;
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
.slick-slide.dragging img {
|
|
2903
|
+
pointer-events: none;
|
|
2824
2904
|
}
|
|
2825
2905
|
|
|
2826
2906
|
${(props) => props.theme.breakpoint.LtMd} {
|
|
@@ -2833,7 +2913,6 @@ const SliderWrapper = styled.div `
|
|
|
2833
2913
|
|
|
2834
2914
|
.slick-slide {
|
|
2835
2915
|
border-right: ${size(1)} solid ${(props) => props.theme.color.bg};
|
|
2836
|
-
//transform: scale(0.95);
|
|
2837
2916
|
transform-origin: 0 50%;
|
|
2838
2917
|
transition: transform 150ms ease;
|
|
2839
2918
|
}
|
|
@@ -2871,47 +2950,10 @@ const ImageFull = styled.img `
|
|
|
2871
2950
|
object-fit: cover;
|
|
2872
2951
|
`;
|
|
2873
2952
|
// Arrow Nav
|
|
2874
|
-
const Arrow = styled
|
|
2953
|
+
const Arrow = styled.div `
|
|
2875
2954
|
position: absolute;
|
|
2876
2955
|
top: 50%;
|
|
2877
2956
|
transform: translateY(-50%);
|
|
2878
|
-
display: flex;
|
|
2879
|
-
align-items: center;
|
|
2880
|
-
justify-content: center;
|
|
2881
|
-
width: ${size(4)};
|
|
2882
|
-
height: ${size(4)};
|
|
2883
|
-
border-radius: 50%;
|
|
2884
|
-
font-size: 1rem;
|
|
2885
|
-
line-height: 1;
|
|
2886
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
2887
|
-
backdrop-filter: blur(5px);
|
|
2888
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
2889
|
-
color: ${(props) => props.theme.color.textDark};
|
|
2890
|
-
transform-origin: 50% 50%;
|
|
2891
|
-
transition: transform 200ms ease;
|
|
2892
|
-
|
|
2893
|
-
:before {
|
|
2894
|
-
content: '';
|
|
2895
|
-
position: absolute;
|
|
2896
|
-
top: 0;
|
|
2897
|
-
bottom: 0;
|
|
2898
|
-
left: 0;
|
|
2899
|
-
right: 0;
|
|
2900
|
-
border-radius: 50%;
|
|
2901
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
2902
|
-
opacity: 0;
|
|
2903
|
-
transition: opacity 200ms ease;
|
|
2904
|
-
}
|
|
2905
|
-
|
|
2906
|
-
:hover {
|
|
2907
|
-
:before {
|
|
2908
|
-
opacity: 1;
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
|
|
2912
|
-
:active {
|
|
2913
|
-
transform: translateY(-50%) scale(0.95);
|
|
2914
|
-
}
|
|
2915
2957
|
|
|
2916
2958
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
2917
2959
|
display: none;
|
|
@@ -3014,6 +3056,46 @@ const EnableNavigationButton = styled.div `
|
|
|
3014
3056
|
z-index: 1;
|
|
3015
3057
|
`;
|
|
3016
3058
|
|
|
3059
|
+
const NavButton = styled(ButtonReset) `
|
|
3060
|
+
position: relative;
|
|
3061
|
+
display: flex;
|
|
3062
|
+
align-items: center;
|
|
3063
|
+
justify-content: center;
|
|
3064
|
+
width: ${size(4)};
|
|
3065
|
+
height: ${size(4)};
|
|
3066
|
+
border-radius: 50%;
|
|
3067
|
+
background-color: ${(props) => props.theme.color.bg};
|
|
3068
|
+
color: ${(props) => props.theme.color.textDark};
|
|
3069
|
+
font-size: 0.75rem;
|
|
3070
|
+
box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
|
|
3071
|
+
transition: transform 200ms ease;
|
|
3072
|
+
|
|
3073
|
+
&::before {
|
|
3074
|
+
content: '';
|
|
3075
|
+
position: absolute;
|
|
3076
|
+
top: 0;
|
|
3077
|
+
bottom: 0;
|
|
3078
|
+
left: 0;
|
|
3079
|
+
right: 0;
|
|
3080
|
+
border-radius: 50%;
|
|
3081
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
3082
|
+
opacity: 0;
|
|
3083
|
+
transition: opacity 200ms ease;
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
&:enabled {
|
|
3087
|
+
&:hover {
|
|
3088
|
+
&::before {
|
|
3089
|
+
opacity: 1;
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
&:active {
|
|
3095
|
+
transform: scale(0.95);
|
|
3096
|
+
}
|
|
3097
|
+
`;
|
|
3098
|
+
|
|
3017
3099
|
const Wrapper$h = styled.div `
|
|
3018
3100
|
position: fixed;
|
|
3019
3101
|
top: 0;
|
|
@@ -4020,10 +4102,12 @@ const Gallery = ({ media, placeholderImage }) => {
|
|
|
4020
4102
|
React__default.createElement(ButtonSecondary, { onClick: onEnableNavigation, title: "St\u00E4ng" },
|
|
4021
4103
|
React__default.createElement(ButtonContent, null, "St\u00E4ng"))))),
|
|
4022
4104
|
!navigationDisabled && mediaLength > 1 && (React__default.createElement(React__default.Fragment, null,
|
|
4023
|
-
React__default.createElement(ArrowLeft,
|
|
4024
|
-
React__default.createElement(
|
|
4025
|
-
|
|
4026
|
-
|
|
4105
|
+
React__default.createElement(ArrowLeft, null,
|
|
4106
|
+
React__default.createElement(NavButton, { onClick: prevImage, title: "F\u00F6reg\u00E5ende bild" },
|
|
4107
|
+
React__default.createElement(IconChevronLeft, { block: true }))),
|
|
4108
|
+
React__default.createElement(ArrowRight, null,
|
|
4109
|
+
React__default.createElement(NavButton, { onClick: nextImage, title: "N\u00E4sta bild" },
|
|
4110
|
+
React__default.createElement(IconChevronRight, { block: true })))))),
|
|
4027
4111
|
React__default.createElement(Alt, null,
|
|
4028
4112
|
React__default.createElement(QuickNav, { ref: quickNavRef }, !!media?.length ? (media.map((m, i) => {
|
|
4029
4113
|
const src = m.files[0].formats.filter(notEmpty).find((x) => x.format === '225x150')?.url ||
|
|
@@ -4149,6 +4233,24 @@ const SEARCH_ITEM_QUERY = gql `
|
|
|
4149
4233
|
phonenumber
|
|
4150
4234
|
avatar
|
|
4151
4235
|
}
|
|
4236
|
+
accessories {
|
|
4237
|
+
articleNumber
|
|
4238
|
+
description
|
|
4239
|
+
excerpt
|
|
4240
|
+
id
|
|
4241
|
+
images
|
|
4242
|
+
logotype
|
|
4243
|
+
manufacturer
|
|
4244
|
+
model
|
|
4245
|
+
name
|
|
4246
|
+
price
|
|
4247
|
+
assemblyPrice
|
|
4248
|
+
productPage {
|
|
4249
|
+
title
|
|
4250
|
+
url
|
|
4251
|
+
}
|
|
4252
|
+
salePrice
|
|
4253
|
+
}
|
|
4152
4254
|
manufacturer {
|
|
4153
4255
|
description
|
|
4154
4256
|
logotype
|
|
@@ -5826,69 +5928,200 @@ const SectionHeader = ({ children, onClick, actionTitle }) => (React__default.cr
|
|
|
5826
5928
|
React__default.createElement(ButtonClear, { as: "a", href: "#", onClick: onClick },
|
|
5827
5929
|
React__default.createElement(ButtonContent, null, actionTitle))))));
|
|
5828
5930
|
|
|
5829
|
-
const
|
|
5830
|
-
${(
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
}
|
|
5931
|
+
const Wrapper$v = styled.div `
|
|
5932
|
+
--container-gutter: ${size(2)};
|
|
5933
|
+
--bg: ${(props) => props.theme.color.bg};
|
|
5934
|
+
|
|
5935
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5936
|
+
--container-gutter: ${size(3)};
|
|
5835
5937
|
}
|
|
5836
5938
|
|
|
5939
|
+
position: relative;
|
|
5940
|
+
|
|
5941
|
+
${({ $accentBg }) => $accentBg &&
|
|
5942
|
+
css `
|
|
5943
|
+
--bg: ${(props) => props.theme.color.accent};
|
|
5944
|
+
`}
|
|
5945
|
+
`;
|
|
5946
|
+
const Item$b = styled.li `
|
|
5947
|
+
flex: 1 0 auto;
|
|
5948
|
+
width: 100%;
|
|
5949
|
+
max-width: 100%;
|
|
5950
|
+
scroll-snap-align: start;
|
|
5951
|
+
|
|
5837
5952
|
${(props) => props.theme.breakpoint.LtSm} {
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5953
|
+
&:is(:only-child, #important) {
|
|
5954
|
+
width: 100%;
|
|
5955
|
+
max-width: 100%;
|
|
5841
5956
|
}
|
|
5842
5957
|
}
|
|
5843
5958
|
`;
|
|
5844
|
-
const
|
|
5959
|
+
const List$9 = styled.ul `
|
|
5845
5960
|
display: flex;
|
|
5846
|
-
align-items:
|
|
5961
|
+
align-items: stretch;
|
|
5847
5962
|
list-style: none;
|
|
5848
|
-
padding: 0;
|
|
5849
|
-
margin:
|
|
5963
|
+
padding: 0 var(--container-gutter);
|
|
5964
|
+
margin: 0;
|
|
5965
|
+
overflow: auto;
|
|
5966
|
+
scroll-snap-type: x mandatory;
|
|
5967
|
+
scroll-padding-left: var(--container-gutter);
|
|
5968
|
+
scrollbar-width: none;
|
|
5969
|
+
-ms-overflow-style: none;
|
|
5850
5970
|
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
-webkit-overflow-scrolling: touch;
|
|
5855
|
-
padding: 0 ${size(3)};
|
|
5971
|
+
&::-webkit-scrollbar {
|
|
5972
|
+
display: none;
|
|
5973
|
+
}
|
|
5856
5974
|
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
width: ${
|
|
5975
|
+
${({ $columns }) => $columns &&
|
|
5976
|
+
css `
|
|
5977
|
+
${Item$b} {
|
|
5978
|
+
width: ${100 / $columns}%;
|
|
5979
|
+
max-width: ${100 / $columns}%;
|
|
5862
5980
|
}
|
|
5863
|
-
}
|
|
5864
|
-
}
|
|
5981
|
+
`}
|
|
5865
5982
|
|
|
5866
|
-
${(
|
|
5867
|
-
|
|
5868
|
-
|
|
5983
|
+
${({ $columnsSm }) => $columnsSm &&
|
|
5984
|
+
css `
|
|
5985
|
+
${(props) => props.theme.breakpoint.Sm} {
|
|
5986
|
+
${Item$b} {
|
|
5987
|
+
width: ${100 / $columnsSm}%;
|
|
5988
|
+
max-width: ${100 / $columnsSm}%;
|
|
5989
|
+
}
|
|
5990
|
+
}
|
|
5991
|
+
`}
|
|
5869
5992
|
|
|
5870
|
-
|
|
5871
|
-
|
|
5993
|
+
${({ $columnsMd }) => $columnsMd &&
|
|
5994
|
+
css `
|
|
5995
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
5996
|
+
${Item$b} {
|
|
5997
|
+
width: ${100 / $columnsMd}%;
|
|
5998
|
+
max-width: ${100 / $columnsMd}%;
|
|
5999
|
+
}
|
|
5872
6000
|
}
|
|
5873
|
-
}
|
|
5874
|
-
}
|
|
6001
|
+
`}
|
|
5875
6002
|
`;
|
|
5876
|
-
const
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
padding: ${size(1)};
|
|
6003
|
+
const ListWrapper = styled.div `
|
|
6004
|
+
position: relative;
|
|
6005
|
+
overflow: hidden;
|
|
6006
|
+
margin: 0 calc(var(--container-gutter) * -1);
|
|
5881
6007
|
|
|
5882
|
-
${(props) => props.theme.breakpoint.
|
|
5883
|
-
|
|
5884
|
-
|
|
6008
|
+
${(props) => props.theme.breakpoint.Md} {
|
|
6009
|
+
&::before,
|
|
6010
|
+
&::after {
|
|
6011
|
+
content: '';
|
|
6012
|
+
position: absolute;
|
|
6013
|
+
top: 0;
|
|
6014
|
+
bottom: 0;
|
|
6015
|
+
width: var(--container-gutter);
|
|
6016
|
+
background-color: var(--bg);
|
|
6017
|
+
z-index: 1;
|
|
6018
|
+
}
|
|
6019
|
+
|
|
6020
|
+
&::before {
|
|
6021
|
+
left: 0;
|
|
6022
|
+
|
|
6023
|
+
${({ $spacing }) => $spacing
|
|
6024
|
+
? css `
|
|
6025
|
+
mask-image: linear-gradient(to right, #000 ${size($spacing)}, transparent);
|
|
6026
|
+
`
|
|
6027
|
+
: css `
|
|
6028
|
+
mask-image: ${(props) => props.theme.mask.gradient.toRight};
|
|
6029
|
+
`}
|
|
6030
|
+
}
|
|
6031
|
+
|
|
6032
|
+
&::after {
|
|
6033
|
+
right: 0;
|
|
6034
|
+
|
|
6035
|
+
${({ $spacing }) => $spacing
|
|
6036
|
+
? css `
|
|
6037
|
+
mask-image: linear-gradient(to left, #000 ${size($spacing)}, transparent);
|
|
6038
|
+
`
|
|
6039
|
+
: css `
|
|
6040
|
+
mask-image: ${(props) => props.theme.mask.gradient.toLeft};
|
|
6041
|
+
`}
|
|
6042
|
+
}
|
|
5885
6043
|
}
|
|
5886
6044
|
|
|
5887
|
-
${(
|
|
5888
|
-
|
|
5889
|
-
|
|
6045
|
+
${({ $spacing }) => $spacing &&
|
|
6046
|
+
css `
|
|
6047
|
+
${List$9} {
|
|
6048
|
+
margin: 0 -${size($spacing / 2)};
|
|
6049
|
+
}
|
|
6050
|
+
|
|
6051
|
+
${Item$b} {
|
|
6052
|
+
padding: 0 ${size($spacing / 2)};
|
|
6053
|
+
}
|
|
6054
|
+
`}
|
|
6055
|
+
`;
|
|
6056
|
+
const NavBtn = styled.div `
|
|
6057
|
+
position: absolute;
|
|
6058
|
+
top: 50%;
|
|
6059
|
+
z-index: 2;
|
|
6060
|
+
|
|
6061
|
+
${(props) => props.theme.breakpoint.LtSm} {
|
|
6062
|
+
display: none;
|
|
5890
6063
|
}
|
|
5891
6064
|
`;
|
|
6065
|
+
const PrevBtn = styled(NavBtn) `
|
|
6066
|
+
left: 0;
|
|
6067
|
+
transform: translate(-50%, -50%);
|
|
6068
|
+
`;
|
|
6069
|
+
const NextBtn = styled(NavBtn) `
|
|
6070
|
+
right: 0;
|
|
6071
|
+
transform: translate(50%, -50%);
|
|
6072
|
+
`;
|
|
6073
|
+
|
|
6074
|
+
const OverflowGrid = ({ items, itemKeyBase, spacing, columns, columnsSm, columnsMd, accentBg, }) => {
|
|
6075
|
+
const overflowElement = useRef(null);
|
|
6076
|
+
const onPrev = useCallback(() => {
|
|
6077
|
+
const itemWidth = overflowElement.current?.children[0].clientWidth || 0;
|
|
6078
|
+
const scrollLeft = overflowElement.current?.scrollLeft || 0;
|
|
6079
|
+
if (scrollLeft > 0) {
|
|
6080
|
+
overflowElement.current?.scroll({
|
|
6081
|
+
left: scrollLeft - itemWidth,
|
|
6082
|
+
behavior: 'smooth',
|
|
6083
|
+
});
|
|
6084
|
+
}
|
|
6085
|
+
}, []);
|
|
6086
|
+
const onNext = useCallback(() => {
|
|
6087
|
+
const itemWidth = overflowElement.current?.children[0].clientWidth || 0;
|
|
6088
|
+
const scrollWidth = overflowElement.current?.scrollWidth || 0;
|
|
6089
|
+
const scrollLeft = overflowElement.current?.scrollLeft || 0;
|
|
6090
|
+
const overflowElementWidth = overflowElement.current?.offsetWidth || 0;
|
|
6091
|
+
const overflowElementScrollWidth = scrollWidth - overflowElementWidth;
|
|
6092
|
+
if (overflowElementScrollWidth !== scrollLeft) {
|
|
6093
|
+
overflowElement.current?.scroll({
|
|
6094
|
+
left: scrollLeft + itemWidth,
|
|
6095
|
+
behavior: 'smooth',
|
|
6096
|
+
});
|
|
6097
|
+
}
|
|
6098
|
+
}, []);
|
|
6099
|
+
// Hide navigation buttons depending on scroll position
|
|
6100
|
+
const [hidePrevNav, setHidePrevNav] = useState(true);
|
|
6101
|
+
const [hideNextNav, setHideNextNav] = useState(true);
|
|
6102
|
+
const onScroll = () => {
|
|
6103
|
+
const scrollLeft = overflowElement.current?.scrollLeft || 0;
|
|
6104
|
+
const scrollWidth = overflowElement.current?.scrollWidth || 0;
|
|
6105
|
+
const overflowElementWidth = overflowElement.current?.offsetWidth || 0;
|
|
6106
|
+
const overflowElementScrollWidth = scrollWidth - overflowElementWidth;
|
|
6107
|
+
setHidePrevNav(scrollLeft == 0 ? true : false);
|
|
6108
|
+
setHideNextNav(overflowElementScrollWidth == scrollLeft ? true : false);
|
|
6109
|
+
};
|
|
6110
|
+
useEffect(() => {
|
|
6111
|
+
onScroll();
|
|
6112
|
+
overflowElement.current?.addEventListener('scroll', onScroll);
|
|
6113
|
+
return () => overflowElement.current?.removeEventListener('scroll', onScroll);
|
|
6114
|
+
}, []);
|
|
6115
|
+
return (React__default.createElement(Wrapper$v, { "$accentBg": accentBg },
|
|
6116
|
+
React__default.createElement(ListWrapper, { "$spacing": spacing },
|
|
6117
|
+
React__default.createElement(List$9, { ref: overflowElement, "$columns": columns, "$columnsSm": columnsSm, "$columnsMd": columnsMd }, items.map((item, i) => (React__default.createElement(Item$b, { key: itemKeyBase ? `${itemKeyBase}-${i}` : `overflow-grid-item-${i}` }, item))))),
|
|
6118
|
+
!hidePrevNav && (React__default.createElement(PrevBtn, null,
|
|
6119
|
+
React__default.createElement(NavButton, { onClick: onPrev, title: "Previous" },
|
|
6120
|
+
React__default.createElement(IconChevronLeft, null)))),
|
|
6121
|
+
!hideNextNav && (React__default.createElement(NextBtn, null,
|
|
6122
|
+
React__default.createElement(NavButton, { onClick: onNext, title: "Next" },
|
|
6123
|
+
React__default.createElement(IconChevronRight, null))))));
|
|
6124
|
+
};
|
|
5892
6125
|
|
|
5893
6126
|
const RelatedSearchContext = createContext({
|
|
5894
6127
|
moreLikeThisUrl: false,
|
|
@@ -5946,8 +6179,7 @@ const Related = ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchNa
|
|
|
5946
6179
|
React__default.createElement(SectionHeader, { onClick: () => { }, actionTitle: "Visa alla" },
|
|
5947
6180
|
React__default.createElement(H2, { noMargin: true }, "Senast inkomna")))),
|
|
5948
6181
|
React__default.createElement(Repeat, null,
|
|
5949
|
-
React__default.createElement(OverflowGrid,
|
|
5950
|
-
React__default.createElement(OverflowGridList, null, response?.documentList.documents.map((document) => {
|
|
6182
|
+
React__default.createElement(OverflowGrid, { accentBg: true, columns: 1.05, columnsSm: 2.1, columnsMd: 3, spacing: 2, items: response?.documentList.documents.map((document) => {
|
|
5951
6183
|
const prefix = pathRoute ? `/${pathRoute}` : '/';
|
|
5952
6184
|
const r = regexPathGuid();
|
|
5953
6185
|
const pathRouteUrl = window.location.pathname === '/'
|
|
@@ -5955,28 +6187,27 @@ const Related = ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchNa
|
|
|
5955
6187
|
: r.test(`${pathRoute}${id}`)
|
|
5956
6188
|
? window.location.pathname.replace(r, document._id)
|
|
5957
6189
|
: `${window.location.pathname}${prefix}${document._id}`;
|
|
5958
|
-
return (React__default.createElement(
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
{
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
})))))));
|
|
6190
|
+
return (React__default.createElement(ProductCard, { key: document._id, id: document._id, onClick: onItemClicked, title: document.title, href: pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined, image: document.featuredImage?.files?.[0]?.url, description: document.shortDescription, branchName: displayBranchName ? document.branches?.[0]?.name : undefined, uspList: [
|
|
6191
|
+
{
|
|
6192
|
+
title: document.modelYear,
|
|
6193
|
+
},
|
|
6194
|
+
{
|
|
6195
|
+
title: `${numberSeparator(document.mileage)} mil`,
|
|
6196
|
+
},
|
|
6197
|
+
{
|
|
6198
|
+
title: document.gearboxType,
|
|
6199
|
+
},
|
|
6200
|
+
{
|
|
6201
|
+
title: document.fuelType,
|
|
6202
|
+
},
|
|
6203
|
+
], price: `${numberSeparator(document.price)} kr`, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
|
|
6204
|
+
? `${numberSeparator(document.oldPrice)} kr`
|
|
6205
|
+
: undefined, leasingPrice: document.leasingPrice !== undefined
|
|
6206
|
+
? `${numberSeparator(document.leasingPrice)} kr/mån`
|
|
6207
|
+
: undefined, businessLeasingPrice: document.businessLeasingPrice !== undefined
|
|
6208
|
+
? `${numberSeparator(document.businessLeasingPrice)} kr/mån`
|
|
6209
|
+
: undefined, pathRoute: pathRoute }));
|
|
6210
|
+
}) })))));
|
|
5980
6211
|
};
|
|
5981
6212
|
|
|
5982
6213
|
const PackageOptions = ({ packageOptions }) => {
|
|
@@ -6019,7 +6250,7 @@ const getBg = (severity) => {
|
|
|
6019
6250
|
}
|
|
6020
6251
|
return bg;
|
|
6021
6252
|
};
|
|
6022
|
-
const Wrapper$
|
|
6253
|
+
const Wrapper$w = styled.div.attrs(() => ({
|
|
6023
6254
|
className: 'wayke__theme wayke__font--bold',
|
|
6024
6255
|
})) `
|
|
6025
6256
|
display: inline-block;
|
|
@@ -6031,7 +6262,7 @@ const Wrapper$v = styled.div.attrs(() => ({
|
|
|
6031
6262
|
line-height: 1.2;
|
|
6032
6263
|
`;
|
|
6033
6264
|
|
|
6034
|
-
const Badge = ({ label, severity }) => React__default.createElement(Wrapper$
|
|
6265
|
+
const Badge = ({ label, severity }) => React__default.createElement(Wrapper$w, { severity: severity }, label);
|
|
6035
6266
|
|
|
6036
6267
|
const KeyOrder = [
|
|
6037
6268
|
'monday',
|
|
@@ -6139,7 +6370,7 @@ const SettingsContext = createContext({});
|
|
|
6139
6370
|
|
|
6140
6371
|
const useSettings = () => useContext(SettingsContext);
|
|
6141
6372
|
|
|
6142
|
-
const Wrapper$
|
|
6373
|
+
const Wrapper$x = styled.a `
|
|
6143
6374
|
display: block;
|
|
6144
6375
|
`;
|
|
6145
6376
|
const Image$3 = styled.img `
|
|
@@ -6178,7 +6409,7 @@ const StaticMap = ({ position }) => {
|
|
|
6178
6409
|
}
|
|
6179
6410
|
const { latitude, longitude } = position;
|
|
6180
6411
|
if (visible && googleMapsApiKey) {
|
|
6181
|
-
return (React__default.createElement(Wrapper$
|
|
6412
|
+
return (React__default.createElement(Wrapper$x, { href: `http://maps.google.com/maps?q=${latitude},${longitude}`, title: "Visa p\u00E5 Google Maps", target: "_blank", rel: "nofollow noopener noreferrer" },
|
|
6182
6413
|
React__default.createElement(Image$3, { src: `https://maps.googleapis.com/maps/api/staticmap?center=${latitude},${longitude}&zoom=10&size=640x280&maptype=roadmap&markers=${googleMapsMarker ? `icon:${encodeURIComponent(googleMapsMarker)}` : ''}%7C${latitude},${longitude}&key=${googleMapsApiKey}`, alt: "Karta" })));
|
|
6183
6414
|
}
|
|
6184
6415
|
return (React__default.createElement(Placeholder, { href: `http://maps.google.com/maps?q=${latitude},${longitude}`, target: "_blank", rel: "noopener noreferrer nofollow", onClick: onShowMap },
|
|
@@ -6245,6 +6476,24 @@ const SEARCH_ITEM_BRANCH_QUERY = gql `
|
|
|
6245
6476
|
phonenumber
|
|
6246
6477
|
avatar
|
|
6247
6478
|
}
|
|
6479
|
+
accessories {
|
|
6480
|
+
articleNumber
|
|
6481
|
+
description
|
|
6482
|
+
excerpt
|
|
6483
|
+
id
|
|
6484
|
+
images
|
|
6485
|
+
logotype
|
|
6486
|
+
manufacturer
|
|
6487
|
+
model
|
|
6488
|
+
name
|
|
6489
|
+
price
|
|
6490
|
+
assemblyPrice
|
|
6491
|
+
productPage {
|
|
6492
|
+
title
|
|
6493
|
+
url
|
|
6494
|
+
}
|
|
6495
|
+
salePrice
|
|
6496
|
+
}
|
|
6248
6497
|
branch {
|
|
6249
6498
|
connections {
|
|
6250
6499
|
id
|
|
@@ -7015,7 +7264,7 @@ const MetadataItem = ({ name, hint, value, unit }) => {
|
|
|
7015
7264
|
React__default.createElement(Content$2, { dangerouslySetInnerHTML: { __html: hint } })))));
|
|
7016
7265
|
};
|
|
7017
7266
|
|
|
7018
|
-
const Wrapper$
|
|
7267
|
+
const Wrapper$y = styled.div `
|
|
7019
7268
|
overflow: hidden;
|
|
7020
7269
|
margin-top: ${size(-1)};
|
|
7021
7270
|
margin-left: ${size(-1)};
|
|
@@ -7026,7 +7275,7 @@ const Wrapper$x = styled.div `
|
|
|
7026
7275
|
margin-right: ${size(-2)};
|
|
7027
7276
|
}
|
|
7028
7277
|
`;
|
|
7029
|
-
const List$
|
|
7278
|
+
const List$a = styled.ul `
|
|
7030
7279
|
list-style: none;
|
|
7031
7280
|
padding: 0;
|
|
7032
7281
|
margin: 0;
|
|
@@ -7040,7 +7289,7 @@ const List$9 = styled.ul `
|
|
|
7040
7289
|
padding-right: ${size(1)};
|
|
7041
7290
|
}
|
|
7042
7291
|
`;
|
|
7043
|
-
const Item$
|
|
7292
|
+
const Item$c = styled.li `
|
|
7044
7293
|
display: inline-block;
|
|
7045
7294
|
vertical-align: bottom;
|
|
7046
7295
|
font-size: 1rem;
|
|
@@ -7081,8 +7330,8 @@ const Action$8 = styled(ButtonReset).attrs(() => ({
|
|
|
7081
7330
|
`}
|
|
7082
7331
|
`;
|
|
7083
7332
|
|
|
7084
|
-
const Tabs = ({ tabs, active, onClick }) => (createElement(Wrapper$
|
|
7085
|
-
createElement(List$
|
|
7333
|
+
const Tabs = ({ tabs, active, onClick }) => (createElement(Wrapper$y, null,
|
|
7334
|
+
createElement(List$a, null, tabs.map((tab) => (createElement(Item$c, { key: tab.name },
|
|
7086
7335
|
createElement(Action$8, { title: tab.displayName, onClick: onClick ? () => onClick(tab.name) : undefined, active: tab.name === active ? 'true' : undefined }, tab.displayName)))))));
|
|
7087
7336
|
|
|
7088
7337
|
const MetadataSubCategory = ({ name, properties }) => (React__default.createElement(Repeat, null,
|
|
@@ -7139,7 +7388,7 @@ const PdfListItem = styled.li.attrs(() => ({
|
|
|
7139
7388
|
flex: 0 0 100%;
|
|
7140
7389
|
}
|
|
7141
7390
|
`;
|
|
7142
|
-
const List$
|
|
7391
|
+
const List$b = styled.ul `
|
|
7143
7392
|
list-style: none;
|
|
7144
7393
|
padding: 0;
|
|
7145
7394
|
display: flex;
|
|
@@ -7167,7 +7416,7 @@ const PdfSubtitle = styled.div `
|
|
|
7167
7416
|
color: ${(props) => props.theme.color.textDarkLighten};
|
|
7168
7417
|
`;
|
|
7169
7418
|
const PdfColumn = styled.div `
|
|
7170
|
-
flex 0 0 auto;
|
|
7419
|
+
flex: 0 0 auto;
|
|
7171
7420
|
&:first-child {
|
|
7172
7421
|
flex: 1 1 auto;
|
|
7173
7422
|
}
|
|
@@ -7202,7 +7451,7 @@ const PdfDownloadItem = ({ document }) => {
|
|
|
7202
7451
|
React__default.createElement(PdfColumn, null,
|
|
7203
7452
|
React__default.createElement(PdfLink, { href: document.url, rel: "noopener noreferrer nofollow", target: "_blank" }, "\u00D6ppna")))));
|
|
7204
7453
|
};
|
|
7205
|
-
const DocumentList = ({ documents }) => (React__default.createElement(List$
|
|
7454
|
+
const DocumentList = ({ documents }) => (React__default.createElement(List$b, null, documents.map((document, i) => (React__default.createElement(PdfDownloadItem, { key: `${document.url}-${i}`, document: document })))));
|
|
7206
7455
|
|
|
7207
7456
|
const Translation = {
|
|
7208
7457
|
'tyre-label': 'Energideklaration för däck',
|
|
@@ -7243,6 +7492,238 @@ const Documents = ({ documents }) => {
|
|
|
7243
7492
|
React__default.createElement(DocumentList, { documents: group.documents }))))));
|
|
7244
7493
|
};
|
|
7245
7494
|
|
|
7495
|
+
const Wrapper$z = styled.div `
|
|
7496
|
+
display: flex;
|
|
7497
|
+
flex-direction: column;
|
|
7498
|
+
gap: ${size(2)};
|
|
7499
|
+
height: 100%;
|
|
7500
|
+
`;
|
|
7501
|
+
const imageBaseStyling = css `
|
|
7502
|
+
flex-shrink: 0;
|
|
7503
|
+
aspect-ratio: 16 / 9;
|
|
7504
|
+
border-radius: 3px;
|
|
7505
|
+
`;
|
|
7506
|
+
const Image$4 = styled.img `
|
|
7507
|
+
${imageBaseStyling};
|
|
7508
|
+
display: block;
|
|
7509
|
+
width: 100%;
|
|
7510
|
+
object-fit: cover;
|
|
7511
|
+
`;
|
|
7512
|
+
const ImageaPlaceholder = styled.div `
|
|
7513
|
+
${imageBaseStyling};
|
|
7514
|
+
display: flex;
|
|
7515
|
+
align-items: center;
|
|
7516
|
+
justify-content: center;
|
|
7517
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
7518
|
+
font-size: 2rem;
|
|
7519
|
+
background-color: ${(props) => props.theme.color.accent};
|
|
7520
|
+
`;
|
|
7521
|
+
const Body$5 = styled.div `
|
|
7522
|
+
flex: 1 1 auto;
|
|
7523
|
+
display: flex;
|
|
7524
|
+
align-items: flex-start;
|
|
7525
|
+
flex-direction: column;
|
|
7526
|
+
gap: ${size(1)};
|
|
7527
|
+
`;
|
|
7528
|
+
const Heading$7 = styled.div `
|
|
7529
|
+
display: flex;
|
|
7530
|
+
align-items: center;
|
|
7531
|
+
justify-content: space-between;
|
|
7532
|
+
gap: ${size(2)};
|
|
7533
|
+
`;
|
|
7534
|
+
const Title$2 = styled.div.attrs(() => ({
|
|
7535
|
+
className: 'wayke__theme wayke__font--bold',
|
|
7536
|
+
})) `
|
|
7537
|
+
font-size: 1.125rem;
|
|
7538
|
+
`;
|
|
7539
|
+
const Branding = styled.img `
|
|
7540
|
+
display: block;
|
|
7541
|
+
`;
|
|
7542
|
+
const Price$2 = styled.div.attrs(() => ({
|
|
7543
|
+
className: 'wayke__theme wayke__font--bold',
|
|
7544
|
+
})) ``;
|
|
7545
|
+
const Preamble = styled.div `
|
|
7546
|
+
--preamble-max-height: ${size(6)};
|
|
7547
|
+
--preamble-gradient-height: calc(var(--preamble-max-height) / 2);
|
|
7548
|
+
|
|
7549
|
+
position: relative;
|
|
7550
|
+
max-height: var(--preamble-max-height);
|
|
7551
|
+
overflow: hidden;
|
|
7552
|
+
display: -webkit-box;
|
|
7553
|
+
-webkit-box-orient: vertical;
|
|
7554
|
+
-webkit-line-clamp: 2;
|
|
7555
|
+
white-space: pre-wrap;
|
|
7556
|
+
|
|
7557
|
+
&::before {
|
|
7558
|
+
content: '';
|
|
7559
|
+
position: absolute;
|
|
7560
|
+
top: var(--preamble-max-height);
|
|
7561
|
+
left: 0;
|
|
7562
|
+
width: 100%;
|
|
7563
|
+
height: var(--preamble-gradient-height);
|
|
7564
|
+
transform: translateY(-100%); // Only visible if Preamble reaches max height
|
|
7565
|
+
color: ${(props) => props.theme.color.bg};
|
|
7566
|
+
mask-image: ${(props) => props.theme.mask.gradient.toTop};
|
|
7567
|
+
pointer-events: none;
|
|
7568
|
+
}
|
|
7569
|
+
`;
|
|
7570
|
+
const ReadMoreBtn = styled(ButtonReset).attrs(() => ({
|
|
7571
|
+
className: 'wayke__theme wayke__font--bold wayke__color--primary-text',
|
|
7572
|
+
})) `
|
|
7573
|
+
margin-top: auto;
|
|
7574
|
+
display: block;
|
|
7575
|
+
color: ${(props) => props.theme.color.link};
|
|
7576
|
+
font-size: 0.875rem;
|
|
7577
|
+
|
|
7578
|
+
&:hover {
|
|
7579
|
+
text-decoration: underline;
|
|
7580
|
+
}
|
|
7581
|
+
`;
|
|
7582
|
+
|
|
7583
|
+
const AccessoryCard = ({ title, image, branding, price, preamble, readMoreCta, }) => (React__default.createElement(Wrapper$z, null,
|
|
7584
|
+
image ? (React__default.createElement(Image$4, { src: image.src, srcSet: image.srcSet, alt: image.alt })) : (React__default.createElement(ImageaPlaceholder, null,
|
|
7585
|
+
React__default.createElement(IconImage, null))),
|
|
7586
|
+
React__default.createElement(Body$5, null,
|
|
7587
|
+
React__default.createElement(Heading$7, null,
|
|
7588
|
+
React__default.createElement(Title$2, null, title),
|
|
7589
|
+
branding && React__default.createElement(Branding, { src: branding.src, srcSet: branding.srcSet, alt: branding.alt })),
|
|
7590
|
+
price && React__default.createElement(Price$2, null, price),
|
|
7591
|
+
preamble && React__default.createElement(Preamble, null, preamble),
|
|
7592
|
+
readMoreCta && React__default.createElement(ReadMoreBtn, { onClick: readMoreCta }, "L\u00E4s mer"))));
|
|
7593
|
+
|
|
7594
|
+
const Image$5 = styled.img `
|
|
7595
|
+
display: block;
|
|
7596
|
+
width: 100%;
|
|
7597
|
+
`;
|
|
7598
|
+
|
|
7599
|
+
const Link$1 = styled.a.attrs(() => ({
|
|
7600
|
+
className: 'wayke__theme wayke__color--primary-text',
|
|
7601
|
+
})) `
|
|
7602
|
+
text-decoration: none;
|
|
7603
|
+
cursor: pointer;
|
|
7604
|
+
text-decoration: underline;
|
|
7605
|
+
|
|
7606
|
+
:not(:hover) {
|
|
7607
|
+
color: ${(props) => props.theme.color.textDark};
|
|
7608
|
+
}
|
|
7609
|
+
|
|
7610
|
+
&:hover {
|
|
7611
|
+
text-decoration: underline;
|
|
7612
|
+
}
|
|
7613
|
+
|
|
7614
|
+
${({ $hoverGhost }) => $hoverGhost &&
|
|
7615
|
+
css `
|
|
7616
|
+
&:before {
|
|
7617
|
+
content: '';
|
|
7618
|
+
position: absolute;
|
|
7619
|
+
top: 0;
|
|
7620
|
+
left: 0;
|
|
7621
|
+
width: 100%;
|
|
7622
|
+
height: 100%;
|
|
7623
|
+
}
|
|
7624
|
+
`}
|
|
7625
|
+
`;
|
|
7626
|
+
|
|
7627
|
+
const Wrapper$A = styled.ul `
|
|
7628
|
+
--price-box-gutter: ${size(2)};
|
|
7629
|
+
|
|
7630
|
+
list-style: none;
|
|
7631
|
+
padding: var(--price-box-gutter);
|
|
7632
|
+
margin: 0;
|
|
7633
|
+
border: 1px solid ${(props) => props.theme.color.border};
|
|
7634
|
+
`;
|
|
7635
|
+
const Row = styled.li `
|
|
7636
|
+
display: flex;
|
|
7637
|
+
align-items: center;
|
|
7638
|
+
justify-content: space-between;
|
|
7639
|
+
gap: var(--price-box-gutter);
|
|
7640
|
+
|
|
7641
|
+
& + & {
|
|
7642
|
+
margin-top: calc(var(--price-box-gutter) / 4);
|
|
7643
|
+
}
|
|
7644
|
+
|
|
7645
|
+
${({ $oldPrice }) => $oldPrice &&
|
|
7646
|
+
css `
|
|
7647
|
+
--price-text-decoration: line-through;
|
|
7648
|
+
|
|
7649
|
+
color: ${(props) => props.theme.color.textDarkLighten};
|
|
7650
|
+
font-size: 0.875rem;
|
|
7651
|
+
`}
|
|
7652
|
+
`;
|
|
7653
|
+
const Label$a = styled.div ``;
|
|
7654
|
+
const Price$3 = styled.div.attrs(() => ({
|
|
7655
|
+
className: 'wayke__theme wayke__font--bold',
|
|
7656
|
+
})) `
|
|
7657
|
+
text-decoration: var(--price-text-decoration);
|
|
7658
|
+
`;
|
|
7659
|
+
|
|
7660
|
+
const PriceBox = ({ prices }) => (React__default.createElement(Wrapper$A, null, prices?.map((item, i) => (React__default.createElement(Row, { key: `${item.label}-${i}`, "$oldPrice": item.oldPrice },
|
|
7661
|
+
React__default.createElement(Label$a, null, item.label),
|
|
7662
|
+
React__default.createElement(Price$3, null, item.price))))));
|
|
7663
|
+
|
|
7664
|
+
const AccesoryModal = ({ accessory, onClose }) => {
|
|
7665
|
+
const priceList = [
|
|
7666
|
+
{
|
|
7667
|
+
label: 'Kontantpris',
|
|
7668
|
+
price: `${numberSeparator(accessory.price)} kr`,
|
|
7669
|
+
oldPrice: false,
|
|
7670
|
+
},
|
|
7671
|
+
];
|
|
7672
|
+
if (accessory.salePrice) {
|
|
7673
|
+
priceList.push({
|
|
7674
|
+
label: 'Tidigare pris',
|
|
7675
|
+
price: `${numberSeparator(accessory.salePrice)} kr`,
|
|
7676
|
+
oldPrice: true,
|
|
7677
|
+
});
|
|
7678
|
+
}
|
|
7679
|
+
if (accessory.assemblyPrice) {
|
|
7680
|
+
priceList.push({
|
|
7681
|
+
label: 'Monteringskostnad',
|
|
7682
|
+
price: `${numberSeparator(accessory.assemblyPrice)} kr`,
|
|
7683
|
+
oldPrice: false,
|
|
7684
|
+
});
|
|
7685
|
+
}
|
|
7686
|
+
return (React__default.createElement(Modal, { title: accessory.name, onClose: onClose },
|
|
7687
|
+
accessory.images?.[0] && (React__default.createElement(Repeat, null,
|
|
7688
|
+
React__default.createElement(Image$5, { src: `${accessory.images[0]}?w=632`, alt: `${accessory.name}` }))),
|
|
7689
|
+
accessory.logotype && (React__default.createElement(Repeat, null,
|
|
7690
|
+
React__default.createElement(LogoBox, { logo: `${accessory.logotype}?w=160`, logo2x: `${accessory.logotype}?w=320`, alt: accessory.manufacturer || 'Logotyp', wide: true }))),
|
|
7691
|
+
React__default.createElement(Repeat, null,
|
|
7692
|
+
React__default.createElement(PriceBox, { prices: priceList })),
|
|
7693
|
+
React__default.createElement(Repeat, null,
|
|
7694
|
+
React__default.createElement(Content$2, { dangerouslySetInnerHTML: { __html: marked(accessory.description) } })),
|
|
7695
|
+
accessory.articleNumber && (React__default.createElement(Repeat, null,
|
|
7696
|
+
React__default.createElement(UtilityTextBold, { as: "div" }, "Art. nr."),
|
|
7697
|
+
React__default.createElement("div", null, accessory.articleNumber))),
|
|
7698
|
+
accessory.productPage && accessory.productPage.url && (React__default.createElement(Repeat, null,
|
|
7699
|
+
React__default.createElement(Link$1, { href: accessory.productPage.url, title: `Mer information om ${accessory.name}`, target: "_blank", rel: "noopener noreferrer nofollow" },
|
|
7700
|
+
accessory.productPage.title || 'Läs mer',
|
|
7701
|
+
" (\u00F6ppnas i ny flik)")))));
|
|
7702
|
+
};
|
|
7703
|
+
|
|
7704
|
+
const AccessoriesSection = ({ accessories }) => {
|
|
7705
|
+
const [modal, setModal] = useState();
|
|
7706
|
+
const onOpenModal = (accessory) => setModal(accessory);
|
|
7707
|
+
const onCloseModal = () => setModal(undefined);
|
|
7708
|
+
if (!accessories?.length)
|
|
7709
|
+
return null;
|
|
7710
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
7711
|
+
modal && React__default.createElement(AccesoryModal, { accessory: modal, onClose: onCloseModal }),
|
|
7712
|
+
React__default.createElement(ProductPageMainSection, null,
|
|
7713
|
+
React__default.createElement(Repeat, null,
|
|
7714
|
+
React__default.createElement(H2, { noMargin: true }, "Tillbeh\u00F6r")),
|
|
7715
|
+
React__default.createElement(Repeat, null,
|
|
7716
|
+
React__default.createElement(Content$2, null,
|
|
7717
|
+
React__default.createElement("p", null, "Tillbeh\u00F6r som passar till detta fordon."))),
|
|
7718
|
+
React__default.createElement(Repeat, null,
|
|
7719
|
+
React__default.createElement(OverflowGrid, { columns: 1.05, columnsSm: 2.1, columnsMd: 2, spacing: 2, items: accessories.map((accessory) => (React__default.createElement(AccessoryCard, { key: accessory.id, title: accessory.name, image: accessory.images?.[0]
|
|
7720
|
+
? {
|
|
7721
|
+
src: `${accessory.images?.[0]}?w=539&h=303`,
|
|
7722
|
+
alt: accessory.name,
|
|
7723
|
+
}
|
|
7724
|
+
: undefined, price: `${numberSeparator(accessory.price)} kr`, preamble: accessory.excerpt, readMoreCta: () => onOpenModal(accessory) }))) })))));
|
|
7725
|
+
};
|
|
7726
|
+
|
|
7246
7727
|
const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, displayBranchName, onClickSearchItem, }) => {
|
|
7247
7728
|
const { ecomSettings } = useSettings();
|
|
7248
7729
|
const ecomContext = useRef();
|
|
@@ -7296,7 +7777,7 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
7296
7777
|
const { vehicle } = result;
|
|
7297
7778
|
const contact = centralStorageVehicle?.contact;
|
|
7298
7779
|
const branch = centralStorageVehicle?.branch;
|
|
7299
|
-
const { title, shortDescription, media, description, price, discount, financialOptions, manufacturer, ecommerce, packageOptions, publishedAt, documents, availableFrom, flags, } = vehicle;
|
|
7780
|
+
const { title, accessories, shortDescription, media, description, price, discount, financialOptions, manufacturer, ecommerce, packageOptions, publishedAt, documents, availableFrom, flags, } = vehicle;
|
|
7300
7781
|
const insuranceOptions = centralStorageVehicle?.insuranceOptions
|
|
7301
7782
|
? centralStorageVehicle.insuranceOptions
|
|
7302
7783
|
: vehicle.insuranceOptions;
|
|
@@ -7379,6 +7860,7 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
|
|
|
7379
7860
|
React__default.createElement(Branch, { branch: branch, displayBranchName: displayBranchName, loading: loadingCentralStorageVehicle }),
|
|
7380
7861
|
ecommerce && ecommerce.enabled && (React__default.createElement(Repeat, null,
|
|
7381
7862
|
React__default.createElement(ButtonPrimary, { disabled: !!ecommerce.reserved, title: "K\u00F6p bilen online", onClick: () => ecomContext.current?.start() }, "K\u00F6p bilen online")))),
|
|
7863
|
+
React__default.createElement(AccessoriesSection, { accessories: accessories }),
|
|
7382
7864
|
React__default.createElement(PackageOptions, { packageOptions: packageOptions }),
|
|
7383
7865
|
React__default.createElement(ManufacturerPackageOption, { packageOption: manufacturer?.packageOption }))))),
|
|
7384
7866
|
React__default.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, authorizedReseller: !!branch?.flags?.authorizedReseller, displayBranchName: displayBranchName, onClickSearchItem: onClickSearchItem })),
|