@bytebrand/fe-ui-core 4.5.2 → 4.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.5.2",
3
+ "version": "4.6.3",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -64,12 +64,15 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
64
64
  driveType
65
65
  },
66
66
  environmentEmissions: {
67
- co2: environmentEmissions.co2
67
+ co2: environmentEmissions.co2,
68
+ wltpCo2: environmentEmissions.wltpCo2 || consumption.wltpCo2
68
69
  },
69
70
  consumption: {
70
71
  fuel: consumption.fuel,
71
72
  consumptionCombined: consumption.consumptionCombined,
72
73
  consumptionPowerCombined: consumption.consumptionPowerCombined,
74
+ wltpCombined: consumption.wltpCombined,
75
+ wltpPowerCombined: consumption.wltpPowerCombined
73
76
  },
74
77
  };
75
78
 
@@ -67,7 +67,11 @@ export const transformDataForDecoratedCar = (car: any) => {
67
67
  maximumWeightCapacity: _get(car, 'sizeVolumeWeight.cargoCapacity', null),
68
68
  tareWeight: _get(car, 'sizeVolumeWeight.emptyWeight', null),
69
69
  bootCapacity: _get(car, 'sizeVolumeWeight.cargoCapacity', null),
70
- capacityLoad: _get(car, 'sizeVolumeWeight.completeCapacity', null)
70
+ capacityLoad: _get(car, 'sizeVolumeWeight.completeCapacity', null),
71
+ wltpCombined: _get(car, 'consumption.wltpCombined', null),
72
+ wltpPowerCombined: _get(car, 'consumption.wltpPowerCombined', null),
73
+ wltpCo2: _get(car, 'consumption.wltpCo2', _get(car, 'environmentEmissions.wltpCo2')),
74
+ pluginHybrid: _get(car, 'engineData.pluginHybrid', null)
71
75
  };
72
76
  };
73
77
 
@@ -116,7 +116,7 @@ const getDecoratedLightProps = (
116
116
  const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
117
117
  const translatedUnit = t(`cbd:${consumptionUnit}`);
118
118
  const wltpConsumptionCombined = car.consumption.wltpCombined;
119
- const wltpCo2 = car.consumption.wltpCo2;
119
+ const wltpCo2 = car.environmentEmissions.wltpCo2 || car.consumption.wltpCo2;
120
120
 
121
121
  const co2 = car.environmentEmissions.co2;
122
122
 
@@ -16,6 +16,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
16
16
  const count: number = vehicleOption.deliveryPeriod &&
17
17
  isOfferAvailable &&
18
18
  vehicleOption.deliveryPeriod !== 'selector_unknown' ? +DELIVERY_PERIODS_EXTRA.find((period: any) => period.value === vehicleOption.deliveryPeriod).label : 0;
19
+
19
20
  const monthsTo: number = moment.utc().diff(moment.utc().subtract(count, 'd'), 'M', true);
20
21
  return {
21
22
  ...cbd,
@@ -37,7 +38,9 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
37
38
  promoSlider: {
38
39
  consumptionCombined: `${vehicleOption.consumptionCombined}l/100km (komb)*`,
39
40
  co2: `${vehicleOption.co2} g CO2/km (komb)*`,
40
- new: 'neu'
41
+ new: 'neu',
42
+ wltpCo2: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb.)*`,
43
+ wltpConsumptionCombined: `${vehicleOption.consumptionCombined}l/100km`
41
44
  },
42
45
  value: {
43
46
  mileage: `${vehicleOption.mileage} km`,
@@ -80,8 +83,8 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
80
83
  no: 'Nein',
81
84
  yes: 'Ja',
82
85
  batteryCapacity: `${vehicleOption.batteryCapacity} kWh`,
83
- wltpCo2Combined: `${vehicleOption}g CO2/km (WLTP, comb)*`,
84
- wltpCo2WtdCombined: `${vehicleOption}g CO2/km (WLTP, gew., comb)*`
86
+ wltpCo2Combined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, comb)*`,
87
+ wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., comb)*`
85
88
 
86
89
  },
87
90
  title: {