@wayke-se/components-react 3.4.0 → 3.5.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.
Files changed (37) hide show
  1. package/README.md +8 -4
  2. package/dist-node/index.js +62 -21
  3. package/dist-node/index.js.map +1 -1
  4. package/dist-src/State/RelatedSearch/useRelatedSearch.js +4 -1
  5. package/dist-src/components/ActionList/toggle-item.js +1 -4
  6. package/dist-src/components/Filter/index.js +3 -1
  7. package/dist-src/components/FilterPanel/faceSelector.js +2 -1
  8. package/dist-src/components/Grid/index.js +7 -5
  9. package/dist-src/components/ProductCard/index.js +8 -4
  10. package/dist-src/components/ProductCard/wrapper.js +6 -1
  11. package/dist-src/layouts/WaykeComposite.js +2 -2
  12. package/dist-src/layouts/search/index.js +2 -2
  13. package/dist-src/layouts/searchItem/Branch.js +6 -4
  14. package/dist-src/layouts/searchItem/Related.js +7 -3
  15. package/dist-src/layouts/searchItem/index.js +3 -9
  16. package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +1 -0
  17. package/dist-src/utils/constants.js +1 -0
  18. package/dist-src/utils/formats.js +3 -1
  19. package/dist-src/utils/sortOptions.js +6 -0
  20. package/dist-src/utils/vehicle-properties/property-hint-enricher.js +2 -0
  21. package/dist-types/@types/codegen/types.d.ts +5 -0
  22. package/dist-types/@types/filter.d.ts +1 -1
  23. package/dist-types/@types/search.d.ts +1 -0
  24. package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +1 -1
  25. package/dist-types/components/Grid/index.d.ts +2 -1
  26. package/dist-types/components/ProductCard/index.d.ts +3 -1
  27. package/dist-types/components/ProductCard/wrapper.d.ts +1 -0
  28. package/dist-types/layouts/WaykeComposite.d.ts +1 -1
  29. package/dist-types/layouts/search/index.d.ts +2 -1
  30. package/dist-types/layouts/searchItem/Branch.d.ts +2 -1
  31. package/dist-types/layouts/searchItem/Related.d.ts +3 -1
  32. package/dist-types/layouts/searchItem/index.d.ts +2 -1
  33. package/dist-types/utils/constants.d.ts +1 -0
  34. package/dist-types/utils/sortOptions.d.ts +3 -1
  35. package/dist-web/index.js +60 -29
  36. package/dist-web/index.js.map +1 -1
  37. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { useContext, useEffect } from 'react';
2
2
  import { RelatedSearchContext } from './RelatedSearchContext';
3
- const useRelatedSearch = (id) => {
3
+ const useRelatedSearch = (id, authorizedReseller) => {
4
4
  const data = useContext(RelatedSearchContext);
5
5
  useEffect(() => {
6
6
  const searchParams = new URLSearchParams();
@@ -8,6 +8,9 @@ const useRelatedSearch = (id) => {
8
8
  if (data.moreLikeThisUrl && id) {
9
9
  searchParams.set('id', id);
10
10
  }
11
+ if (authorizedReseller) {
12
+ searchParams.set('isAuthorizedResellerForManufacturer', 'true');
13
+ }
11
14
  data.fetchRelated(searchParams);
12
15
  }, [id]);
13
16
  return data;
@@ -1,10 +1,8 @@
1
1
  import React, { useState, useCallback } from 'react';
2
2
  import { ButtonSecondary, ButtonContent } from '../Button/index';
3
3
  import { RepeatTiny } from '../Repeat/index';
4
- const initialValue = {};
5
- const getInitialValue = (title) => title && !!initialValue[title];
6
4
  const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
7
- const [visible, setVisible] = useState(() => getInitialValue(type));
5
+ const [visible, setVisible] = useState(false);
8
6
  const _onClickValue = useCallback(() => {
9
7
  if (onClickValue) {
10
8
  onClickValue();
@@ -12,7 +10,6 @@ const ToggleItem = ({ title, value, type, onClickVisible, onClickValue }) => {
12
10
  }, []);
13
11
  const onClick = useCallback(() => {
14
12
  if (!visible) {
15
- initialValue[type] = true;
16
13
  setVisible(true);
17
14
  if (onClickVisible) {
18
15
  onClickVisible();
@@ -1,13 +1,15 @@
1
1
  import React, { useState, useCallback } from 'react';
2
2
  import { List, Item, Action, Label, Indicator, IndicatorValue } from './wrapper';
3
3
  import { FacetIdToTitle } from '../../utils/formats';
4
- import { PRICE, MILEAGE, MODEL_YEAR } from '../../utils/constants';
4
+ import { PRICE, MILEAGE, MODEL_YEAR, LEASING_PRICE, BUSINESS_LEASING_PRICE, } from '../../utils/constants';
5
5
  import useSearch from '../../State/Search/useSearch';
6
6
  import FilterPanel from '../FilterPanel/index';
7
7
  const isSelected = (f, searchParams) => {
8
8
  switch (f.id) {
9
9
  case PRICE:
10
10
  case MILEAGE:
11
+ case LEASING_PRICE:
12
+ case BUSINESS_LEASING_PRICE:
11
13
  case MODEL_YEAR:
12
14
  return searchParams.has(`${f.id}.min`) || searchParams.has(`${f.id}.max`) ? 1 : 0;
13
15
  default:
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import CheckListFacet from './checkListFacet';
3
3
  import ColorSelectFacet from './colorFacet';
4
4
  import RangeFacet from './rangeFacet';
5
- import { MANUFACTURER, MODEL_SERIES, FUEL_TYPE, GEARBOX_TYPE, ENVIRONMENT_CLASS, SEGMENT, DRIVING_WHEEL, COLOR, PRICE, BRANCH, MILEAGE, MODEL_YEAR, LEASING_PRICE, } from '../../utils/constants';
5
+ import { MANUFACTURER, MODEL_SERIES, FUEL_TYPE, GEARBOX_TYPE, ENVIRONMENT_CLASS, SEGMENT, DRIVING_WHEEL, COLOR, PRICE, BRANCH, MILEAGE, MODEL_YEAR, LEASING_PRICE, BUSINESS_LEASING_PRICE, } from '../../utils/constants';
6
6
  const FacetSelector = ({ facet }) => {
7
7
  switch (facet.id) {
8
8
  case MANUFACTURER:
@@ -18,6 +18,7 @@ const FacetSelector = ({ facet }) => {
18
18
  return React.createElement(ColorSelectFacet, { facet: facet });
19
19
  case PRICE:
20
20
  return React.createElement(RangeFacet, { facet: facet, unit: "kr", formatValues: true });
21
+ case BUSINESS_LEASING_PRICE:
21
22
  case LEASING_PRICE:
22
23
  return React.createElement(RangeFacet, { facet: facet, unit: "kr/m\u00E5n", formatValues: true });
23
24
  case MILEAGE:
@@ -9,7 +9,7 @@ const resolveImage = (document) => {
9
9
  }
10
10
  return undefined;
11
11
  };
12
- const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }) => {
12
+ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }) => {
13
13
  if (!documents) {
14
14
  return null;
15
15
  }
@@ -36,7 +36,7 @@ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }
36
36
  */
37
37
  const _pathRoute = pathRoute ? `${pathRoute}/${document._id}` : undefined;
38
38
  return (React.createElement(Item, { key: document._id },
39
- React.createElement(ProductCard, { id: document._id, onClick: onClickItem, title: document.title, pathRoute: pathRoute, href: _pathRoute ? _pathRoute : hashRoute ? `#${document._id}` : undefined, image: resolveImage(document), placeholderImage: placeholderImage, description: document.shortDescription, uspList: [
39
+ React.createElement(ProductCard, { id: document._id, onClick: onClickItem, title: document.title, pathRoute: pathRoute, href: _pathRoute ? _pathRoute : hashRoute ? `#${document._id}` : undefined, image: resolveImage(document), placeholderImage: placeholderImage, description: document.shortDescription, branchName: displayBranchName ? document.branches?.[0]?.name : undefined, uspList: [
40
40
  {
41
41
  title: document.modelYear,
42
42
  },
@@ -49,10 +49,12 @@ const Grid = ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }
49
49
  {
50
50
  title: document.fuelType,
51
51
  },
52
- ], price: `${numberSeparator(document.price)} kr`, leasingPrice: document.leasingPrice !== undefined
53
- ? `${numberSeparator(document.leasingPrice)} kr`
54
- : undefined, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
52
+ ], price: `${numberSeparator(document.price)} kr`, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
55
53
  ? `${numberSeparator(document.oldPrice)} kr`
54
+ : undefined, leasingPrice: document.leasingPrice !== undefined
55
+ ? `${numberSeparator(document.leasingPrice)} kr/mån`
56
+ : undefined, businessLeasingPrice: document.businessLeasingPrice !== undefined
57
+ ? `${numberSeparator(document.businessLeasingPrice)} kr/mån`
56
58
  : undefined })));
57
59
  }))));
58
60
  };
@@ -1,10 +1,10 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
2
  import LazyLoad from 'react-lazyload';
3
- import { Wrapper, Image, Picture, Source, Img, Content, ContentBody, ContentFooter, Heading, Link, Description, Usp, Price, CurrentPrice, OldPrice, PriceCell, Label, } from './wrapper';
3
+ import { Wrapper, Image, Picture, Source, Img, Content, ContentBody, ContentFooter, Heading, Link, Description, Usp, Price, CurrentPrice, OldPrice, PriceCell, Label, PreHeading, } from './wrapper';
4
4
  import UspList from '../UspList/index';
5
5
  import { DEFAULT_PLACEHOLDER_IMAGE } from '../../utils/constants';
6
6
  import usePath from '../../State/Path/usePath';
7
- const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, description, uspList, price, oldPrice, leasingPrice, onClick, }) => {
7
+ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, branchName, description, uspList, price, oldPrice, leasingPrice, businessLeasingPrice, onClick, }) => {
8
8
  const { pushState } = usePath();
9
9
  const _onClick = useMemo(() => (onClick ? () => onClick(id) : undefined), [id]);
10
10
  const onHrefClick = useCallback((e) => {
@@ -25,6 +25,7 @@ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, desc
25
25
  React.createElement(Img, { src: placeholderImage || DEFAULT_PLACEHOLDER_IMAGE }))))),
26
26
  React.createElement(Content, null,
27
27
  React.createElement(ContentBody, null,
28
+ branchName && React.createElement(PreHeading, null, branchName),
28
29
  React.createElement(Heading, null, href ? (React.createElement(Link, { onClick: onHrefClick, href: href, title: title, "aria-label": title }, title)) : (title)),
29
30
  description && React.createElement(Description, null, description),
30
31
  uspList && (React.createElement(Usp, null,
@@ -35,7 +36,10 @@ const ProductCard = ({ id, title, href, image, pathRoute, placeholderImage, desc
35
36
  oldPrice ? React.createElement(OldPrice, null, oldPrice) : React.createElement(Label, null, "Pris"),
36
37
  React.createElement(CurrentPrice, null, price)),
37
38
  leasingPrice && (React.createElement(PriceCell, null,
38
- React.createElement(Label, null, "Leasingpris"),
39
- React.createElement(CurrentPrice, null, leasingPrice))))))));
39
+ React.createElement(Label, null, "Privatleasing"),
40
+ React.createElement(CurrentPrice, null, leasingPrice))),
41
+ businessLeasingPrice && (React.createElement(PriceCell, null,
42
+ React.createElement(Label, null, "F\u00F6retagsleasing"),
43
+ React.createElement(CurrentPrice, null, businessLeasingPrice))))))));
40
44
  };
41
45
  export default ProductCard;
@@ -61,6 +61,11 @@ export const ContentFooter = styled.div `
61
61
  margin-top: auto;
62
62
  padding-top: ${size(1)};
63
63
  `;
64
+ export const PreHeading = styled.div `
65
+ margin-bottom: ${size(0.25)};
66
+ color: ${(props) => props.theme.color.textDarkLighten};
67
+ font-size: 0.75rem;
68
+ `;
64
69
  export const Heading = styled.h1.attrs(() => ({
65
70
  className: 'wayke__theme wayke__font--bold',
66
71
  })) `
@@ -125,5 +130,5 @@ export const OldPrice = styled.div `
125
130
  `;
126
131
  export const Label = styled.label `
127
132
  color: ${(props) => props.theme.color.disabledText};
128
- font-size: 0.875rem;
133
+ font-size: 0.75rem;
129
134
  `;
@@ -4,7 +4,7 @@ import PubSub from '../utils/pubsub/pubsub';
4
4
  import WaykeSearch from './search/index';
5
5
  import WaykeSearchItem from './searchItem/index';
6
6
  import usePath from '../State/Path/usePath';
7
- const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, }) => {
7
+ const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, displayBranchName, }) => {
8
8
  const hashId = useHashGuid();
9
9
  const { id: pathId } = usePath();
10
10
  useEffect(() => {
@@ -18,6 +18,6 @@ const WaykeComposite = ({ filterList, initialQueryParams, removeSearchBar, remov
18
18
  }
19
19
  }, [hashId]);
20
20
  const id = pathId || hashId;
21
- return (React.createElement(React.Fragment, null, id ? (React.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem })) : (React.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch }))));
21
+ return (React.createElement(React.Fragment, null, id ? (React.createElement(WaykeSearchItem, { id: id, hashRoute: !pathRoute, disableResetScrollOnInit: disableResetScrollOnInit, placeholderImage: placeholderImage, pathRoute: pathRoute, modifyDocumentTitleItem: modifyDocumentTitleItem, displayBranchName: displayBranchName })) : (React.createElement(WaykeSearch, { filterList: filterList, initialQueryParams: initialQueryParams, removeSearchBar: removeSearchBar, hashRoute: !pathRoute, placeholderImage: placeholderImage, pathRoute: pathRoute, removeFilterOptions: removeFilterOptions, modifyDocumentTitleSearch: modifyDocumentTitleSearch, displayBranchName: displayBranchName }))));
22
22
  };
23
23
  export default WaykeComposite;
@@ -10,7 +10,7 @@ import SearchFilter from '../../components/SearchFilter/index';
10
10
  import Snackbar from '../../components/Snackbar/index';
11
11
  import useSearch from '../../State/Search/useSearch';
12
12
  import PubSub from '../../utils/pubsub/pubsub';
13
- const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, onClickSearchItem, }) => {
13
+ const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, displayBranchName, onClickSearchItem, }) => {
14
14
  const { error, documents, queryFilter, onFilterUpdate, onInitialize } = useSearch();
15
15
  useEffect(() => {
16
16
  if (modifyDocumentTitleSearch) {
@@ -48,7 +48,7 @@ const WaykeSearch = ({ filterList, initialQueryParams, hashRoute, pathRoute, rem
48
48
  React.createElement(Result, null,
49
49
  React.createElement(React.Fragment, null,
50
50
  error && (React.createElement(Snackbar, { severity: "error", icon: true, heading: "Ett fel har intr\u00E4ffat" }, "V\u00E4nligen f\u00F6rs\u00F6k igen.")),
51
- !error && documents && documents.length > 0 && (React.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage })),
51
+ !error && documents && documents.length > 0 && (React.createElement(Grid, { hashRoute: hashRoute, pathRoute: pathRoute, onClickItem: onItemClicked, documents: documents, placeholderImage: placeholderImage, displayBranchName: displayBranchName })),
52
52
  !error && documents && documents.length === 0 && (React.createElement(Snackbar, { severity: "warning", icon: true, heading: "Inga resultat" }, "Det finns inga resultat som matchar din s\u00F6kning."))))))),
53
53
  React.createElement(PortalElement, { id: PortalNamespace.DefaultPortal })));
54
54
  };
@@ -10,7 +10,7 @@ import PhoneNumber from '../../components/PhoneNumber/index';
10
10
  import Map from '../../components/Map/index';
11
11
  import BranchModal from './BranchModal';
12
12
  import { formatPhonenumber } from '../../utils/phonenumbers';
13
- const Branch = ({ branch, loading }) => {
13
+ const Branch = ({ branch, loading, displayBranchName }) => {
14
14
  const [modal, setModal] = useState(false);
15
15
  const openModal = useCallback(() => setModal(true), []);
16
16
  const closeModal = useCallback(() => setModal(false), []);
@@ -25,9 +25,11 @@ const Branch = ({ branch, loading }) => {
25
25
  return (React.createElement(React.Fragment, null,
26
26
  modal && (React.createElement(BranchModal, { loading: loading, connections: branch?.connections, onClose: closeModal })),
27
27
  React.createElement(Repeat, null,
28
- React.createElement(H2, { noMargin: true }, branch?.location?.city
29
- ? `Den här bilen finns på vår anläggning i ${branch?.location?.city}`
30
- : 'Kontakt')),
28
+ React.createElement(H2, { noMargin: true }, displayBranchName
29
+ ? `Den här bilen finns på ${branch.name}`
30
+ : branch?.location?.city
31
+ ? `Den här bilen finns på vår anläggning i ${branch?.location?.city}`
32
+ : 'Kontakt')),
31
33
  React.createElement(Repeat, null,
32
34
  React.createElement(Map, { position: branch?.location?.position })),
33
35
  (branch?.connections?.length || 0) > 1 && (React.createElement(Repeat, null,
@@ -11,8 +11,8 @@ import Loader from '../../components/Loader/index';
11
11
  import { numberSeparator } from '../../utils/formats';
12
12
  import PubSub from '../../utils/pubsub/pubsub';
13
13
  import { regexPathGuid } from '../../utils/regex';
14
- const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
15
- const { loading, response, moreLikeThisUrl } = useRelatedSearch(id);
14
+ const Related = ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchName, onClickSearchItem, }) => {
15
+ const { loading, response, moreLikeThisUrl } = useRelatedSearch(id, !!authorizedReseller);
16
16
  const onItemClicked = useCallback((id) => {
17
17
  PubSub.publish('ItemClicked', id);
18
18
  if (onClickSearchItem) {
@@ -43,7 +43,7 @@ const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
43
43
  ? window.location.pathname.replace(r, document._id)
44
44
  : `${window.location.pathname}${prefix}${document._id}`;
45
45
  return (React.createElement(OverflowGridItem, { key: document._id },
46
- React.createElement(ProductCard, { id: document._id, onClick: onItemClicked, title: document.title, href: pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined, image: document.featuredImage?.files?.[0]?.url, description: document.shortDescription, uspList: [
46
+ React.createElement(ProductCard, { 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: [
47
47
  {
48
48
  title: document.modelYear,
49
49
  },
@@ -58,6 +58,10 @@ const Related = ({ id, hashRoute, pathRoute, onClickSearchItem }) => {
58
58
  },
59
59
  ], price: `${numberSeparator(document.price)} kr`, oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice
60
60
  ? `${numberSeparator(document.oldPrice)} kr`
61
+ : undefined, leasingPrice: document.leasingPrice !== undefined
62
+ ? `${numberSeparator(document.leasingPrice)} kr/mån`
63
+ : undefined, businessLeasingPrice: document.businessLeasingPrice !== undefined
64
+ ? `${numberSeparator(document.businessLeasingPrice)} kr/mån`
61
65
  : undefined, pathRoute: pathRoute })));
62
66
  })))))));
63
67
  };
@@ -18,7 +18,6 @@ import { IconChevronLeft } from '../../components/Icon/index';
18
18
  import useSearchItem from '../../hooks/useSearchItem';
19
19
  import { notEmpty, numberSeparator, dateTimeFormat } from '../../utils/formats';
20
20
  import { PortalNamespace, PortalElement } from '../../components/Portal/index';
21
- import Modal from '../../components/Modal/index';
22
21
  import FinancialOptions from '../../components/FinancialOptions/index';
23
22
  import InsuranceOptions from '../../components/InsuranceOptions/index';
24
23
  import ManufacturerPackageOption from './ManufacturerPackagesOption';
@@ -34,7 +33,7 @@ import Property from './Property';
34
33
  import DemoCarModal from './DemoCarModal';
35
34
  import useSettings from '../../State/Settings/useSettings';
36
35
  import Documents from './Documents';
37
- const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }) => {
36
+ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, displayBranchName, onClickSearchItem, }) => {
38
37
  const { ecomSettings } = useSettings();
39
38
  const ecomContext = useRef();
40
39
  const { loading, data: result } = useSearchItem(id);
@@ -167,17 +166,12 @@ const WaykeSearchItem = ({ id, hashRoute, pathRoute, disableResetScrollOnInit, p
167
166
  React.createElement(UspList, { items: options }))))),
168
167
  React.createElement(Documents, { documents: documents }),
169
168
  React.createElement(ProductPageMainSection, null,
170
- React.createElement(Branch, { branch: branch, loading: loadingCentralStorageVehicle }),
169
+ React.createElement(Branch, { branch: branch, displayBranchName: displayBranchName, loading: loadingCentralStorageVehicle }),
171
170
  ecommerce && ecommerce.enabled && (React.createElement(Repeat, null,
172
171
  React.createElement(ButtonPrimary, { disabled: !!ecommerce.reserved, title: "K\u00F6p bilen online", onClick: () => ecomContext.current?.start() }, "K\u00F6p bilen online")))),
173
172
  React.createElement(PackageOptions, { packageOptions: packageOptions }),
174
173
  React.createElement(ManufacturerPackageOption, { packageOption: manufacturer?.packageOption }))))),
175
- React.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, onClickSearchItem: onClickSearchItem })),
176
- false && (React.createElement(Modal, { title: "Modal", onClose: () => { } },
177
- React.createElement(Content, null,
178
- React.createElement("p", null,
179
- "Priset \u00E4r ett cirkapris och baserat p\u00E5 ditt avtals antal m\u00E5nader och din ber\u00E4knade \u00E5rliga k\u00F6rstr\u00E4cka. Kostnad f\u00F6r f\u00F6rs\u00E4kring och serviceavtal tillkommer. Kontakta s\u00E4ljare f\u00F6r komplett kostnadsf\u00F6rslag.",
180
- ' ')))),
174
+ React.createElement(Related, { id: id, hashRoute: hashRoute, pathRoute: pathRoute, authorizedReseller: !!branch?.flags?.authorizedReseller, displayBranchName: displayBranchName, onClickSearchItem: onClickSearchItem })),
181
175
  React.createElement(PortalElement, { id: PortalNamespace.DefaultPortal }),
182
176
  demoCarModal && React.createElement(DemoCarModal, { onClose: onToggleDemoCarModal })));
183
177
  };
@@ -43,6 +43,7 @@ const SEARCH_ITEM_BRANCH_QUERY = gql `
43
43
  mrf
44
44
  centralStorage
45
45
  ecommerce
46
+ authorizedReseller
46
47
  }
47
48
  logotype
48
49
  openingHours {
@@ -11,6 +11,7 @@ export const PRICE = 'price';
11
11
  export const MILEAGE = 'mileage';
12
12
  export const MODEL_YEAR = 'modelYear';
13
13
  export const LEASING_PRICE = 'leasingPrice';
14
+ export const BUSINESS_LEASING_PRICE = 'businessLeasingPrice';
14
15
  export const COLOR_WHITE = { displayName: 'Vit', hex: '#ffffff' };
15
16
  export const COLOR_BLACK = { displayName: 'Svart', hex: '#000000' };
16
17
  export const COLOR_GRAY = { displayName: 'Grå', hex: '#808080' };
@@ -10,7 +10,7 @@ export const numberSeparator = (value, n = 0, x = 3, s = ' ', c = '.') => {
10
10
  const num = value.toFixed(Math.max(0, ~~n));
11
11
  return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), `$&${s || ','}`);
12
12
  };
13
- import { MANUFACTURER, MODEL_SERIES, FUEL_TYPE, GEARBOX_TYPE, ENVIRONMENT_CLASS, SEGMENT, DRIVING_WHEEL, COLOR, PRICE, BRANCH, MILEAGE, MODEL_YEAR, LEASING_PRICE, } from './constants';
13
+ import { MANUFACTURER, MODEL_SERIES, FUEL_TYPE, GEARBOX_TYPE, ENVIRONMENT_CLASS, SEGMENT, DRIVING_WHEEL, COLOR, PRICE, BRANCH, MILEAGE, MODEL_YEAR, LEASING_PRICE, BUSINESS_LEASING_PRICE, } from './constants';
14
14
  export const FacetIdToTitle = (f) => {
15
15
  switch (f) {
16
16
  case MANUFACTURER:
@@ -39,6 +39,8 @@ export const FacetIdToTitle = (f) => {
39
39
  return 'Modellår';
40
40
  case LEASING_PRICE:
41
41
  return 'Privatleasing';
42
+ case BUSINESS_LEASING_PRICE:
43
+ return 'Företagsleasing';
42
44
  default:
43
45
  return f;
44
46
  }
@@ -5,6 +5,8 @@ const SortOptionDisplayName = {
5
5
  Pricedesc: 'price-desc',
6
6
  ModelAsc: 'model-asc',
7
7
  Modeldesc: 'model-desc',
8
+ MileageAsc: 'mileage-asc',
9
+ Mileagedesc: 'mileage-desc',
8
10
  };
9
11
  export const getTranslatedSortOptionDisplayName = (str) => {
10
12
  switch (str) {
@@ -20,6 +22,10 @@ export const getTranslatedSortOptionDisplayName = (str) => {
20
22
  return 'Årsmodell äldst';
21
23
  case SortOptionDisplayName.Modeldesc:
22
24
  return 'Årsmodell nyast';
25
+ case SortOptionDisplayName.MileageAsc:
26
+ return 'Miltal lägst';
27
+ case SortOptionDisplayName.Mileagedesc:
28
+ return 'Miltal högst';
23
29
  default:
24
30
  return str;
25
31
  }
@@ -70,6 +70,8 @@ export const HINTS = Object.freeze({
70
70
  finish: '',
71
71
  fuelConsumptionCityDriving: 'Bränsleförbrukning vid stadskörning.',
72
72
  fuelConsumptionCountryRoadDriving: 'Bränsleförbrukning vid landsvägskörning.',
73
+ fuelConsumptionMixedDrivingNEDC: 'Bränsleförbrukning vid blandad körning.',
74
+ fuelConsumptionMixedDrivingWLTP: 'Bränsleförbrukning vid blandad körning.',
73
75
  fuelConsumptionMixedDriving: 'Bränsleförbrukning vid blandad körning. Dvs. stadskörning och landsvägskörning under en och samma färd.',
74
76
  fuelType: 'Vad bilen ska tankas med och drivs av.',
75
77
  gearboxName: '',
@@ -60,6 +60,7 @@ export declare type BranchConnection = {
60
60
  };
61
61
  export declare type BranchFlags = {
62
62
  __typename?: 'BranchFlags';
63
+ authorizedReseller?: Maybe<Scalars['Boolean']>;
63
64
  centralStorage?: Maybe<Scalars['Boolean']>;
64
65
  ecommerce?: Maybe<Scalars['Boolean']>;
65
66
  mrf?: Maybe<Scalars['Boolean']>;
@@ -345,3 +346,7 @@ export declare type VehicleFlags = {
345
346
  demoVersion?: Maybe<Scalars['Boolean']>;
346
347
  testDrive?: Maybe<Scalars['Boolean']>;
347
348
  };
349
+ export declare type _Service = {
350
+ __typename?: '_Service';
351
+ sdl: Scalars['String'];
352
+ };
@@ -1,4 +1,4 @@
1
- export declare type SearchFilterNameTypes = 'manufacturer' | 'modelSeries' | 'fuelType' | 'gearboxType' | 'branch' | 'color' | 'environmentClass' | 'properties.segment' | 'drivingWheel' | 'price' | 'mileage' | 'modelYear';
1
+ export declare type SearchFilterNameTypes = 'manufacturer' | 'modelSeries' | 'fuelType' | 'gearboxType' | 'branch' | 'color' | 'environmentClass' | 'properties.segment' | 'drivingWheel' | 'price' | 'mileage' | 'modelYear' | 'leasingPrice' | 'businessLeasingPrice';
2
2
  export declare type SearchFilterTypes = {
3
3
  filterName: SearchFilterNameTypes;
4
4
  displayName?: string;
@@ -73,6 +73,7 @@ export interface Document {
73
73
  shortDescription: string;
74
74
  title: string;
75
75
  leasingPrice?: number;
76
+ businessLeasingPrice?: number;
76
77
  }
77
78
  export interface FacetFilter {
78
79
  displayName: string;
@@ -1,2 +1,2 @@
1
- declare const useRelatedSearch: (id: string) => import("./RelatedSearchContext").RelatedSearchContextProps;
1
+ declare const useRelatedSearch: (id: string, authorizedReseller?: boolean) => import("./RelatedSearchContext").RelatedSearchContextProps;
2
2
  export default useRelatedSearch;
@@ -5,7 +5,8 @@ interface GridProps {
5
5
  hashRoute?: boolean;
6
6
  pathRoute?: string;
7
7
  placeholderImage?: string;
8
+ displayBranchName?: boolean;
8
9
  onClickItem?: (id: string) => void;
9
10
  }
10
- declare const Grid: ({ documents, placeholderImage, hashRoute, pathRoute, onClickItem }: GridProps) => JSX.Element | null;
11
+ declare const Grid: ({ documents, placeholderImage, hashRoute, pathRoute, displayBranchName, onClickItem, }: GridProps) => JSX.Element | null;
11
12
  export default Grid;
@@ -12,7 +12,9 @@ interface Props {
12
12
  price: string;
13
13
  leasingPrice?: string;
14
14
  oldPrice?: string;
15
+ branchName?: string;
16
+ businessLeasingPrice?: string;
15
17
  onClick?: (id: string) => void;
16
18
  }
17
- declare const ProductCard: ({ id, title, href, image, pathRoute, placeholderImage, description, uspList, price, oldPrice, leasingPrice, onClick, }: Props) => JSX.Element;
19
+ declare const ProductCard: ({ id, title, href, image, pathRoute, placeholderImage, branchName, description, uspList, price, oldPrice, leasingPrice, businessLeasingPrice, onClick, }: Props) => JSX.Element;
18
20
  export default ProductCard;
@@ -6,6 +6,7 @@ export declare const Img: import("styled-components").StyledComponent<"img", imp
6
6
  export declare const Content: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
7
  export declare const ContentBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
8
  export declare const ContentFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
+ export declare const PreHeading: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
9
10
  export declare const Heading: import("styled-components").StyledComponent<"h1", import("styled-components").DefaultTheme, {
10
11
  className: "wayke__theme wayke__font--bold";
11
12
  }, "className">;
@@ -2,5 +2,5 @@
2
2
  import { WaykeSearchProps } from './search/index';
3
3
  import { WaykeSearchItemProps } from './searchItem/index';
4
4
  export declare type WaykeCompositeProps = Omit<WaykeSearchProps & WaykeSearchItemProps, 'id'>;
5
- declare const WaykeComposite: ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, }: WaykeCompositeProps) => JSX.Element;
5
+ declare const WaykeComposite: ({ filterList, initialQueryParams, removeSearchBar, removeFilterOptions, disableResetScrollOnInit, placeholderImage, pathRoute, modifyDocumentTitleItem, modifyDocumentTitleSearch, displayBranchName, }: WaykeCompositeProps) => JSX.Element;
6
6
  export default WaykeComposite;
@@ -9,7 +9,8 @@ export interface WaykeSearchProps {
9
9
  hashRoute?: boolean;
10
10
  pathRoute?: string;
11
11
  modifyDocumentTitleSearch?: string;
12
+ displayBranchName?: boolean;
12
13
  onClickSearchItem?: (id: string) => void;
13
14
  }
14
- declare const WaykeSearch: ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, onClickSearchItem, }: WaykeSearchProps) => JSX.Element;
15
+ declare const WaykeSearch: ({ filterList, initialQueryParams, hashRoute, pathRoute, removeSearchBar, placeholderImage, removeFilterOptions, modifyDocumentTitleSearch, displayBranchName, onClickSearchItem, }: WaykeSearchProps) => JSX.Element;
15
16
  export default WaykeSearch;
@@ -3,6 +3,7 @@ import { Branch, Maybe } from '../../@types/codegen/types';
3
3
  interface BranchProps {
4
4
  branch?: Maybe<Branch>;
5
5
  loading: boolean;
6
+ displayBranchName?: boolean;
6
7
  }
7
- declare const Branch: ({ branch, loading }: BranchProps) => JSX.Element | null;
8
+ declare const Branch: ({ branch, loading, displayBranchName }: BranchProps) => JSX.Element | null;
8
9
  export default Branch;
@@ -3,7 +3,9 @@ interface RelatedProps {
3
3
  id: string;
4
4
  hashRoute?: boolean;
5
5
  pathRoute?: string;
6
+ authorizedReseller?: boolean;
7
+ displayBranchName?: boolean;
6
8
  onClickSearchItem?: (id: string) => void;
7
9
  }
8
- declare const Related: ({ id, hashRoute, pathRoute, onClickSearchItem }: RelatedProps) => JSX.Element | null;
10
+ declare const Related: ({ id, hashRoute, pathRoute, authorizedReseller, displayBranchName, onClickSearchItem, }: RelatedProps) => JSX.Element | null;
9
11
  export default Related;
@@ -6,7 +6,8 @@ export interface WaykeSearchItemProps {
6
6
  disableResetScrollOnInit?: boolean;
7
7
  placeholderImage?: string;
8
8
  modifyDocumentTitleItem?: boolean;
9
+ displayBranchName?: boolean;
9
10
  onClickSearchItem?: (id: string) => void;
10
11
  }
11
- declare const WaykeSearchItem: ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, onClickSearchItem, }: WaykeSearchItemProps) => JSX.Element;
12
+ declare const WaykeSearchItem: ({ id, hashRoute, pathRoute, disableResetScrollOnInit, placeholderImage, modifyDocumentTitleItem, displayBranchName, onClickSearchItem, }: WaykeSearchItemProps) => JSX.Element;
12
13
  export default WaykeSearchItem;
@@ -11,6 +11,7 @@ export declare const PRICE = "price";
11
11
  export declare const MILEAGE = "mileage";
12
12
  export declare const MODEL_YEAR = "modelYear";
13
13
  export declare const LEASING_PRICE = "leasingPrice";
14
+ export declare const BUSINESS_LEASING_PRICE = "businessLeasingPrice";
14
15
  export declare const COLOR_WHITE: {
15
16
  displayName: string;
16
17
  hex: string;
@@ -5,7 +5,9 @@ declare const SortOptionDisplayName: {
5
5
  Pricedesc: string;
6
6
  ModelAsc: string;
7
7
  Modeldesc: string;
8
+ MileageAsc: string;
9
+ Mileagedesc: string;
8
10
  };
9
- declare type SortOptionDisplayName = 'relevance' | 'published-asc' | 'published-desc' | 'price-asc' | 'price-desc' | 'model-asc' | 'model-desc';
11
+ declare type SortOptionDisplayName = 'relevance' | 'published-asc' | 'published-desc' | 'price-asc' | 'price-desc' | 'model-asc' | 'model-desc' | 'mileage-asc' | 'mileage-desc';
10
12
  export declare const getTranslatedSortOptionDisplayName: (str: string | SortOptionDisplayName) => string;
11
13
  export {};