@wayke-se/components-react 3.4.0 → 3.5.0

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 CHANGED
@@ -182,7 +182,7 @@ const App = ({}) => {
182
182
  | pathRoute | string | |
183
183
  | hashRoute | boolean | |
184
184
  | filterList | SearchFilterTypes[] | |
185
- | initialQueryParams | URLSearchParams or string | query, manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price.min, price.max, mileage.min, mileage.max, modelYear.min, modelYear.max |
185
+ | initialQueryParams | URLSearchParams or string | query, manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price.min, price.max, mileage.min, mileage.max, modelYear.min, modelYear.max, leasingPrice.min, leasingPrice.max, businessLeasingPrice.min, businessLeasingPrice.max |
186
186
  | removeSearchBar | boolean | |
187
187
  | removeFilterOptions | boolean | |
188
188
  | placeholderImage | string | |
@@ -192,7 +192,7 @@ const App = ({}) => {
192
192
  * Optional
193
193
  * `pathRoute` - If set, then if a item is clicked it will use the provided url and append the guid. Supports both relative and absolute.
194
194
  * `hashRoute` - If set to true, then if a item is clicked it will append #guid to the url (is not used if `pathRoute` is set).
195
- * `filterList` - Select what filters that should be visible and in whiched order, drivingWheel, price, mileage, modelYear
195
+ * `filterList` - Select what filters that should be visible and in whiched order, drivingWheel, price, mileage, modelYear, leasingPrice, businessLeasingPrice
196
196
  * `initialQueryParams` - Set the default filter that should be applid upon init.
197
197
  * `removeSearchBar` - Removes search bar.
198
198
  * `removeFilterOptions` - Removes filter options.
@@ -271,7 +271,7 @@ WaykeSearchItem & WaykeSearch combined without `id`
271
271
  ### SearchFilterTypes
272
272
  | Property | Type | Required | Values |
273
273
  |-------------|-----------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------|
274
- | filterName | SearchFilterNameTypes | true | manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price, mileage, modelYear |
274
+ | filterName | SearchFilterNameTypes | true | manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price, mileage, modelYear, leasingPrice, businessLeasingPrice |
275
275
  | displayName | string | false | |
276
276
 
277
277
  * `displayName` override default translation of title
@@ -503,6 +503,7 @@ const PRICE = 'price';
503
503
  const MILEAGE = 'mileage';
504
504
  const MODEL_YEAR = 'modelYear';
505
505
  const LEASING_PRICE = 'leasingPrice';
506
+ const BUSINESS_LEASING_PRICE = 'businessLeasingPrice';
506
507
  const COLOR_WHITE = {
507
508
  displayName: 'Vit',
508
509
  hex: '#ffffff'
@@ -595,6 +596,8 @@ const FacetIdToTitle = f => {
595
596
  return 'Modellår';
596
597
  case LEASING_PRICE:
597
598
  return 'Privatleasing';
599
+ case BUSINESS_LEASING_PRICE:
600
+ return 'Företagsleasing';
598
601
  default:
599
602
  return f;
600
603
  }
@@ -1979,6 +1982,7 @@ const FacetSelector = ({
1979
1982
  unit: "kr",
1980
1983
  formatValues: true
1981
1984
  });
1985
+ case BUSINESS_LEASING_PRICE:
1982
1986
  case LEASING_PRICE:
1983
1987
  return React__default.createElement(RangeFacet, {
1984
1988
  facet: facet,
@@ -2035,6 +2039,8 @@ const isSelected = (f, searchParams) => {
2035
2039
  switch (f.id) {
2036
2040
  case PRICE:
2037
2041
  case MILEAGE:
2042
+ case LEASING_PRICE:
2043
+ case BUSINESS_LEASING_PRICE:
2038
2044
  case MODEL_YEAR:
2039
2045
  return searchParams.has(`${f.id}.min`) || searchParams.has(`${f.id}.max`) ? 1 : 0;
2040
2046
  default:
@@ -2377,6 +2383,7 @@ const ProductCard = ({
2377
2383
  price,
2378
2384
  oldPrice,
2379
2385
  leasingPrice,
2386
+ businessLeasingPrice,
2380
2387
  onClick
2381
2388
  }) => {
2382
2389
  const {
@@ -2413,7 +2420,7 @@ const ProductCard = ({
2413
2420
  }, title) : title), description && React__default.createElement(Description$1, null, description), uspList && React__default.createElement(Usp, null, React__default.createElement(UspList, {
2414
2421
  small: true,
2415
2422
  items: uspList
2416
- }))), React__default.createElement(ContentFooter, null, React__default.createElement(Price, null, React__default.createElement(PriceCell, null, oldPrice ? React__default.createElement(OldPrice, null, oldPrice) : React__default.createElement(Label$3, null, "Pris"), React__default.createElement(CurrentPrice, null, price)), leasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "Leasingpris"), React__default.createElement(CurrentPrice, null, leasingPrice))))));
2423
+ }))), React__default.createElement(ContentFooter, null, React__default.createElement(Price, null, React__default.createElement(PriceCell, null, oldPrice ? React__default.createElement(OldPrice, null, oldPrice) : React__default.createElement(Label$3, null, "Pris"), React__default.createElement(CurrentPrice, null, price)), leasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "Privatleasing"), React__default.createElement(CurrentPrice, null, leasingPrice)), businessLeasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "F\u00F6retagsleasing"), React__default.createElement(CurrentPrice, null, businessLeasingPrice))))));
2417
2424
  };
2418
2425
 
2419
2426
  const resolveImage = document => {
@@ -2473,8 +2480,9 @@ const Grid = ({
2473
2480
  title: document.fuelType
2474
2481
  }],
2475
2482
  price: `${numberSeparator(document.price)} kr`,
2476
- leasingPrice: document.leasingPrice !== undefined ? `${numberSeparator(document.leasingPrice)} kr` : undefined,
2477
- oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice ? `${numberSeparator(document.oldPrice)} kr` : undefined
2483
+ oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice ? `${numberSeparator(document.oldPrice)} kr` : undefined,
2484
+ leasingPrice: document.leasingPrice !== undefined ? `${numberSeparator(document.leasingPrice)} kr/mån` : undefined,
2485
+ businessLeasingPrice: document.businessLeasingPrice !== undefined ? `${numberSeparator(document.businessLeasingPrice)} kr/mån` : undefined
2478
2486
  }));
2479
2487
  })));
2480
2488
  };
@@ -6900,6 +6908,8 @@ const Related = ({
6900
6908
  }],
6901
6909
  price: `${numberSeparator(document.price)} kr`,
6902
6910
  oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice ? `${numberSeparator(document.oldPrice)} kr` : undefined,
6911
+ leasingPrice: document.leasingPrice !== undefined ? `${numberSeparator(document.leasingPrice)} kr/mån` : undefined,
6912
+ businessLeasingPrice: document.businessLeasingPrice !== undefined ? `${numberSeparator(document.businessLeasingPrice)} kr/mån` : undefined,
6903
6913
  pathRoute: pathRoute
6904
6914
  }));
6905
6915
  }))))));