@bytebrand/fe-ui-core 4.6.3 → 4.6.5

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.6.3",
3
+ "version": "4.6.5",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -137,6 +137,7 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
137
137
  const engineProps = getVehicleDetails(consumption.fuel, 'engineData', engineData.hybridPlugin);
138
138
  const environmentProps = getVehicleDetails(consumption.fuel, 'environment', engineData.hybridPlugin);
139
139
  const wltpProps = getWltpValues(consumption.fuel, engineData.hybridPlugin);
140
+ // const costModelProps = getCostModelValues();
140
141
  const dimensionProps = dimensionDetails;
141
142
  const availAbilityProps = availAbilityDetails;
142
143
  const colorAndMaterialProps = colorAndMaterialDetails;
@@ -178,3 +178,42 @@
178
178
  background-color: #AC0A13
179
179
  .auto_de_selector_energyEfficiencyClass_g::after
180
180
  border-left-color: #AC0A13
181
+
182
+
183
+
184
+
185
+ :global
186
+ .auto_de_selector_energyEfficiencyClass_a_wltp
187
+ background-color: #4AA35A
188
+ .auto_de_selector_energyEfficiencyClass_a_wltp::after
189
+ border-left-color: #4AA35A
190
+
191
+ .auto_de_selector_energyEfficiencyClass_b_wltp
192
+ background-color: #6EBB4D
193
+ .auto_de_selector_energyEfficiencyClass_b_wltp::after
194
+ border-left-color: #6EBB4D
195
+
196
+ .auto_de_selector_energyEfficiencyClass_c_wltp
197
+ background-color: #BDDB4A
198
+ .auto_de_selector_energyEfficiencyClass_c_wltp::after
199
+ border-left-color: #BDDB4A
200
+
201
+ .auto_de_selector_energyEfficiencyClass_d_wltp
202
+ background-color: #FBF151
203
+ .auto_de_selector_energyEfficiencyClass_d_wltp::after
204
+ border-left-color: #FBF151
205
+
206
+ .auto_de_selector_energyEfficiencyClass_e_wltp
207
+ background-color: #EFB741
208
+ .auto_de_selector_energyEfficiencyClass_e_wltp::after
209
+ border-left-color: #EFB741
210
+
211
+ .auto_de_selector_energyEfficiencyClass_f_wltp
212
+ background-color: #E26733
213
+ .auto_de_selector_energyEfficiencyClass_f_wltp::after
214
+ border-left-color: #E26733
215
+
216
+ .auto_de_selector_energyEfficiencyClass_g_wltp
217
+ background-color: #DB3733
218
+ .auto_de_selector_energyEfficiencyClass_g_wltp::after
219
+ border-left-color: #DB3733
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { selectors } from '@bytebrand/car-schema-selectors';
4
+ import { WLTP_ENERGY_EFFICIENCY_CLASS } from '../../../framework/constants';
4
5
 
5
6
  import styles from './CO2Efficiency.styl';
6
7
 
@@ -14,6 +15,7 @@ interface ICO2EfficiencyProps {
14
15
  levelTitle?: string;
15
16
  wltpLevelTitle?: string;
16
17
  hybridPlugin?: boolean;
18
+ isWltp?: boolean;
17
19
  }
18
20
 
19
21
  // TODO: pass efficiency classes as a list into props.
@@ -24,7 +26,27 @@ class CO2Efficiency extends React.Component<ICO2EfficiencyProps> {
24
26
  };
25
27
 
26
28
  renderLevels = () => {
27
- const { level, wltpLevel, t, hybridPlugin } = this.props;
29
+ const { level, wltpLevel, t, hybridPlugin, isWltp = false } = this.props;
30
+
31
+ if (isWltp) {
32
+ return WLTP_ENERGY_EFFICIENCY_CLASS.map((key: string, i: number) => {
33
+ const width: string = `${(i + 1) * 10 + 13}px`; // tslint:disable-line
34
+ const isActive: boolean = key === level;
35
+ const isWltpActive: boolean = key === wltpLevel;
36
+ const className: string = classnames(styles.class, `auto_de_${key}_wltp`);
37
+ const translatedKey: string = t(`cbd:${key}`);
38
+
39
+ return key !== 'selector_unknown' ? (
40
+ <div key={key} className={styles.classContainer}>
41
+ <span className={className} style={{ width }}>
42
+ {translatedKey}
43
+ </span>
44
+ {isActive && <span className={styles.activeClass}>{translatedKey}</span>}
45
+ {isWltpActive && hybridPlugin && <span className={styles.secondActiveClass}>{translatedKey}</span>}
46
+ </div>
47
+ ) : false;
48
+ });
49
+ };
28
50
 
29
51
  return selectors.energyEfficiencyClass.map((key: string, i: number) => {
30
52
  const width: string = `${(i + 1) * 10 + 10}px`; // tslint:disable-line
@@ -54,6 +54,17 @@ export const DELIVERY_PERIODS_EXTRA = DELIVERY_PERIODS.map((val: string) => ({
54
54
  value: val
55
55
  }));
56
56
 
57
+
58
+ export const WLTP_ENERGY_EFFICIENCY_CLASS = [
59
+ "selector_energyEfficiencyClass_a",
60
+ "selector_energyEfficiencyClass_b",
61
+ "selector_energyEfficiencyClass_c",
62
+ "selector_energyEfficiencyClass_d",
63
+ "selector_energyEfficiencyClass_e",
64
+ "selector_energyEfficiencyClass_f",
65
+ "selector_energyEfficiencyClass_g"
66
+ ];
67
+
57
68
  export const offers = [
58
69
  {
59
70
  name: 'financing',
@@ -137,7 +137,7 @@ const getDecoratedLightProps = (
137
137
  : t('vehicleProps:value.na');
138
138
 
139
139
  if (wltpConsumptionValue && wltpCo2Value) {
140
- return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
140
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
141
141
  }
142
142
 
143
143
  return <>{consumptionValue} <br /> {co2Value}</>;
@@ -153,7 +153,7 @@ const getDecoratedLightProps = (
153
153
  const translatedUnit = t(`cbd:${consumptionUnit}`);
154
154
  const co2 = car.environmentEmissions.co2;
155
155
  const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
156
- const wltpCo2 = car.consumption.wltpCo2;
156
+ const wltpCo2 = car.consumption.wltpCo2 || car.environmentEmissions.wltpCo2;
157
157
 
158
158
  const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
159
159
  ? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
@@ -172,7 +172,7 @@ const getDecoratedLightProps = (
172
172
  : t('vehicleProps:value.na');
173
173
 
174
174
  if (wltpConsumptionValue && wltpCo2Value) {
175
- return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
175
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
176
176
  }
177
177
 
178
178
  return <>{consumptionValue} <br /> {co2Value} </>;
@@ -201,7 +201,7 @@ const getDecoratedLightProps = (
201
201
  : null;
202
202
 
203
203
  const co2 = car.environmentEmissions.co2;
204
- const wltpCo2 = car.consumption.wltpCo2;
204
+ const wltpCo2 = car.consumption.wltpCo2 || car.environmentEmissions.wltpCo2;
205
205
 
206
206
  const co2Value = Number.isFinite(co2)
207
207
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
@@ -215,7 +215,7 @@ const getDecoratedLightProps = (
215
215
 
216
216
  if (wltpConsumptionCombinedContent && wltpCo2Value) {
217
217
  return <React.Fragment>
218
- {wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent} - ` : ''}
218
+ {wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent}, ` : ''}
219
219
  {wltpConsumptionCombinedContent}, {wltpCo2Value}
220
220
  </React.Fragment>
221
221
  }
@@ -238,7 +238,7 @@ const getDecoratedLightProps = (
238
238
  const translatedUnit = t(`cbd:${consumptionUnit}`);
239
239
  const co2 = car.environmentEmissions.co2;
240
240
  const wltpConsumptionCombined = car.consumption.wltpCombined;
241
- const wltpCo2 = car.consumption.wltpCo2;
241
+ const wltpCo2 = car.consumption.wltpCo2 || car.environmentEmissions.wltpCo2;
242
242
 
243
243
  const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
244
244
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
@@ -256,7 +256,7 @@ const getDecoratedLightProps = (
256
256
  : null;
257
257
 
258
258
  if (wltpConsumptionValue && wltpCo2Value) {
259
- return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
259
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
260
260
  }
261
261
 
262
262
  return <>{consumptionValue} <br /> {co2Value}</>;
@@ -272,7 +272,7 @@ const getDecoratedLightProps = (
272
272
  const translatedUnit = t(`cbd:${consumptionUnit}`);
273
273
  const co2 = car.environmentEmissions.co2;
274
274
  const wltpConsumptionCombined = car.consumption.wltpCombined;
275
- const wltpCo2 = car.consumption.wltpCo2;
275
+ const wltpCo2 = car.consumption.wltpCo2 || car.environmentEmissions.wltpCo2;
276
276
 
277
277
  const consumptionValue = Number.isFinite(consumptionGasCombined)
278
278
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
@@ -291,7 +291,7 @@ const getDecoratedLightProps = (
291
291
  : null;
292
292
 
293
293
  if (wltpConsumptionValue && wltpCo2Value) {
294
- return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
294
+ return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
295
295
  }
296
296
 
297
297
  return <>{consumptionValue} <br /> {co2Value}</>;
@@ -8,6 +8,7 @@ import { formatMileage } from '../utils/CommonUtils';
8
8
  import { EMISSION_STICKERS_ICONS, WP_EMISSION_STICKERS_ICONS } from '../constants/Search';
9
9
  import { DELIVERY_PERIODS_EXTRA } from '../constants';
10
10
  import { IDecoratedProp, ICar } from '../types/types';
11
+ import { getFormattedPrice } from '../utils/CommonUtils';
11
12
 
12
13
  const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
13
14
  const count: number = +DELIVERY_PERIODS_EXTRA.find((period: any) => period.value === deliveryPeriod).label;
@@ -699,7 +700,7 @@ const getDecoratedProps = (
699
700
  : t('vehicleProps:value.na');
700
701
 
701
702
  if (wltpConsumptionValue && wltpCo2Value) {
702
- return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
703
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
703
704
  }
704
705
 
705
706
  return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
@@ -733,7 +734,7 @@ const getDecoratedProps = (
733
734
  : t('vehicleProps:value.na');
734
735
 
735
736
  if (wltpConsumptionValue && wltpCo2Value) {
736
- return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
737
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
737
738
  }
738
739
 
739
740
  return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
@@ -767,7 +768,7 @@ const getDecoratedProps = (
767
768
  : null;
768
769
 
769
770
  if (wltpConsumptionValue && wltpCo2Value) {
770
- return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
771
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
771
772
  }
772
773
 
773
774
  return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
@@ -802,7 +803,7 @@ const getDecoratedProps = (
802
803
  : null;
803
804
 
804
805
  if (wltpConsumptionValue && wltpCo2Value) {
805
- return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
806
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
806
807
  }
807
808
 
808
809
  return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
@@ -1138,10 +1139,19 @@ const getDecoratedProps = (
1138
1139
  : t('vehicleProps:value.na');
1139
1140
  }
1140
1141
  },
1142
+ wltpCo2Plugin: {
1143
+ title: t('vehicleProps:title.wltpCo2Plugin'),
1144
+ get value() {
1145
+ const c02 = car.environmentEmissions.wltpCo2;
1146
+ return Number.isFinite(c02)
1147
+ ? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
1148
+ : t('vehicleProps:value.na');
1149
+ }
1150
+ },
1141
1151
  wltpCo2Discharged: {
1142
1152
  title: t('vehicleProps:title.wltpCo2Discharged'),
1143
1153
  get value() {
1144
- const wltpCo2 = car.environmentEmissions.wltpCo2;
1154
+ const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
1145
1155
  return Number.isFinite(wltpCo2)
1146
1156
  ? t('vehicleProps:value.co2', { co2: wltpCo2.toLocaleString(language) })
1147
1157
  : t('vehicleProps:value.na');
@@ -1165,6 +1175,7 @@ const getDecoratedProps = (
1165
1175
  levelTitle={t('vehicleProps:title.wltpCO2WidgetComb')}
1166
1176
  wltpLevelTitle={t('vehicleProps:title.wltpCO2WidgetDischargedBattery')}
1167
1177
  hybridPlugin={hybridPlugin}
1178
+ isWltp
1168
1179
  /> : t('vehicleProps:value.na');
1169
1180
  }
1170
1181
  },
@@ -1173,7 +1184,7 @@ const getDecoratedProps = (
1173
1184
  subTitle: t('vehicleProps:title.subTitle'),
1174
1185
  get value() {
1175
1186
  const level = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
1176
- return isPropDefined(level) ? <CO2Efficiency level={level} t={t} /> : t('vehicleProps:value.na');
1187
+ return isPropDefined(level) ? <CO2Efficiency level={level} isWltp t={t} /> : t('vehicleProps:value.na');
1177
1188
  }
1178
1189
  },
1179
1190
  wltpRange: {
@@ -1216,7 +1227,7 @@ const getDecoratedProps = (
1216
1227
  wltpWeightedCombined: {
1217
1228
  title: t('vehicleProps:title.wltpWeightedCombined'),
1218
1229
  get value() {
1219
- const wltpWeightedCombined = car.consumption && car.consumption.wltpTotalRangeCity;
1230
+ const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
1220
1231
  return Number.isFinite(wltpWeightedCombined)
1221
1232
  ? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language) })
1222
1233
  : t('vehicleProps:value.na');
@@ -1233,6 +1244,17 @@ const getDecoratedProps = (
1233
1244
  : t('vehicleProps:value.na');
1234
1245
  }
1235
1246
  },
1247
+ wltpCombinedPlugin: {
1248
+ title: t('vehicleProps:title.wltpCombinedPlugin'),
1249
+ get value() {
1250
+ const wltpCombined = car.consumption.wltpCombined;
1251
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1252
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1253
+ return Number.isFinite(wltpCombined)
1254
+ ? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
1255
+ : t('vehicleProps:value.na');
1256
+ }
1257
+ },
1236
1258
  wltpSlow: {
1237
1259
  title: t('vehicleProps:title.wltpSlow'),
1238
1260
  get value() {
@@ -1244,6 +1266,17 @@ const getDecoratedProps = (
1244
1266
  : t('vehicleProps:value.na');
1245
1267
  }
1246
1268
  },
1269
+ wltpSlowPlugin: {
1270
+ title: t('vehicleProps:title.wltpSlowPlugin'),
1271
+ get value() {
1272
+ const wltpSlow = car.consumption.wltpSlow;
1273
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1274
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1275
+ return Number.isFinite(wltpSlow)
1276
+ ? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
1277
+ : t('vehicleProps:value.na');
1278
+ }
1279
+ },
1247
1280
  wltpMedium: {
1248
1281
  title: t('vehicleProps:title.wltpMedium'),
1249
1282
  get value() {
@@ -1255,6 +1288,17 @@ const getDecoratedProps = (
1255
1288
  : t('vehicleProps:value.na');
1256
1289
  }
1257
1290
  },
1291
+ wltpMediumPlugin: {
1292
+ title: t('vehicleProps:title.wltpMediumPlugin'),
1293
+ get value() {
1294
+ const wltpMedium = car.consumption.wltpMedium;
1295
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1296
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1297
+ return Number.isFinite(wltpMedium)
1298
+ ? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
1299
+ : t('vehicleProps:value.na');
1300
+ }
1301
+ },
1258
1302
  wltpFast: {
1259
1303
  title: t('vehicleProps:title.wltpFast'),
1260
1304
  get value() {
@@ -1266,6 +1310,17 @@ const getDecoratedProps = (
1266
1310
  : t('vehicleProps:value.na');
1267
1311
  }
1268
1312
  },
1313
+ wltpFastPlugin: {
1314
+ title: t('vehicleProps:title.wltpFastPlugin'),
1315
+ get value() {
1316
+ const wltpFast = car.consumption.wltpFast;
1317
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1318
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1319
+ return Number.isFinite(wltpFast)
1320
+ ? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
1321
+ : t('vehicleProps:value.na');
1322
+ }
1323
+ },
1269
1324
  wltpVeryFast: {
1270
1325
  title: t('vehicleProps:title.wltpVeryFast'),
1271
1326
  get value() {
@@ -1277,6 +1332,17 @@ const getDecoratedProps = (
1277
1332
  : t('vehicleProps:value.na');
1278
1333
  }
1279
1334
  },
1335
+ wltpVeryFastPlugin: {
1336
+ title: t('vehicleProps:title.wltpVeryFastPlugin'),
1337
+ get value() {
1338
+ const wltpVeryFast = car.consumption.wltpVeryFast;
1339
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1340
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1341
+ return Number.isFinite(wltpVeryFast)
1342
+ ? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
1343
+ : t('vehicleProps:value.na');
1344
+ }
1345
+ },
1280
1346
  wltpWeightedPowerCombined: {
1281
1347
  title: t('vehicleProps:title.wltpWeightedPowerCombined'),
1282
1348
  get value() {
@@ -1343,78 +1409,140 @@ const getDecoratedProps = (
1343
1409
  : t('vehicleProps:value.na');
1344
1410
  }
1345
1411
  },
1346
- fuelPrice: {
1347
- title: '',
1412
+ wltpPowerCombinedPlugin: {
1413
+ title: t('vehicleProps:title.wltpPowerCombinedPlugin'),
1348
1414
  get value() {
1349
- return ''
1415
+ const wltpPowerCombined = car.consumption.wltpPowerCombined;
1416
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1417
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1418
+ return Number.isFinite(wltpPowerCombined)
1419
+ ? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
1420
+ : t('vehicleProps:value.na');
1350
1421
  }
1351
1422
  },
1352
- powerPrice: {
1353
- title: '',
1423
+ wltpPowerSlowPlugin: {
1424
+ title: t('vehicleProps:title.wltpPowerSlowPlugin'),
1354
1425
  get value() {
1355
- return ''
1426
+ const wltpPowerSlow = car.consumption.wltpPowerSlow;
1427
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1428
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1429
+ return Number.isFinite(wltpPowerSlow)
1430
+ ? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
1431
+ : t('vehicleProps:value.na');
1356
1432
  }
1357
1433
  },
1358
- consumptionPriceYear: {
1359
- title: '',
1434
+ wltpPowerMediumPlugin: {
1435
+ title: t('vehicleProps:title.wltpPowerMediumPlugin'),
1360
1436
  get value() {
1361
- return ''
1437
+ const wltpPowerMedium = car.consumption.wltpPowerMedium;
1438
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1439
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1440
+ return Number.isFinite(wltpPowerMedium)
1441
+ ? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
1442
+ : t('vehicleProps:value.na');
1362
1443
  }
1363
1444
  },
1364
- co2CostLowBasePrice: {
1365
- title: '',
1445
+ wltpPowerFastPlugin: {
1446
+ title: t('vehicleProps:title.wltpPowerFastPlugin'),
1366
1447
  get value() {
1367
- return ''
1448
+ const wltpPowerFast = car.consumption.wltpPowerFast;
1449
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1450
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1451
+ return Number.isFinite(wltpPowerFast)
1452
+ ? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
1453
+ : t('vehicleProps:value.na');
1368
1454
  }
1369
1455
  },
1370
- co2CostMiddleBasePrice: {
1371
- title: '',
1456
+ wltpPowerVeryFastPlugin: {
1457
+ title: t('vehicleProps:title.wltpPowerVeryFastPlugin'),
1372
1458
  get value() {
1373
- return ''
1459
+ const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
1460
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1461
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1462
+ return Number.isFinite(wltpPowerVeryFast)
1463
+ ? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
1464
+ : t('vehicleProps:value.na');
1374
1465
  }
1375
1466
  },
1376
- co2CostHighBasePrice: {
1377
- title: '',
1467
+ // wltpEnergyCosts: {
1468
+ // title: t('vehicleProps:title.wltpEnergyCosts'),
1469
+ // get value() {
1470
+ // const { fuel } = car.consumption;
1471
+ // const { wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined } = car.consumption;
1472
+ // const { hybridPlugin } = car.engineData;
1473
+ // const consumption = {
1474
+ // wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined
1475
+ // }
1476
+ // const fuelCost = getFuelPrice(fuel, consumption, hybridPlugin);
1477
+ // return Number.isFinite(fuelCost)
1478
+ // ? t('vehicleProps:value.price', { price: getFormattedPrice(fuelCost, '$,.2f') })
1479
+ // : t('vehicleProps:value.na');
1480
+ // }
1481
+ // },
1482
+ wltpCo2CostsLow: {
1483
+ title: t('vehicleProps:title.wltpCo2LowPrice'),
1378
1484
  get value() {
1379
- return ''
1485
+ const { basePrice } = car.costModel.co2Costs.low;
1486
+ return Number.isFinite(basePrice)
1487
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(basePrice, '$,.2f') })
1488
+ : t('vehicleProps:value.na');
1380
1489
  }
1381
1490
  },
1382
- co2CostLowAccumulatedPrice: {
1383
- title: '',
1491
+ wltpCo2CostsMiddle: {
1492
+ title: t('vehicleProps:title.wltpCo2MidPrice'),
1384
1493
  get value() {
1385
- return ''
1494
+ const { basePrice } = car.costModel.co2Costs.middle;
1495
+ return Number.isFinite(basePrice)
1496
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(basePrice, '$,.2f') })
1497
+ : t('vehicleProps:value.na');
1386
1498
  }
1387
1499
  },
1388
- co2CostMiddleAccumulatedPrice: {
1389
- title: '',
1500
+ wltpCo2CostsHigh: {
1501
+ title: t('vehicleProps:title.wltpCo2HighPrice'),
1390
1502
  get value() {
1391
- return ''
1503
+ const { basePrice } = car.costModel.co2Costs.high;
1504
+ return Number.isFinite(basePrice)
1505
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(basePrice, '$,.2f') })
1506
+ : t('vehicleProps:value.na');
1392
1507
  }
1393
1508
  },
1394
- co2CostHighAccumulatedPrice: {
1395
- title: '',
1509
+ powerPrice: {
1510
+ title: t('vehicleProps:title.powerPrice'),
1396
1511
  get value() {
1397
- return ''
1512
+ const { powerPrice } = car.costModel;
1513
+ return Number.isFinite(powerPrice)
1514
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(powerPrice, '$,.2f') })
1515
+ : t('vehicleProps:value.na');
1398
1516
  }
1399
1517
  },
1400
- timeFrameFrom: {
1401
- title: '',
1518
+ fuelPrice: {
1519
+ title: t('vehicleProps:title.fuelPrice'),
1402
1520
  get value() {
1403
- return ''
1521
+ const { fuelPrice } = car.costModel;
1522
+ return Number.isFinite(fuelPrice)
1523
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(fuelPrice, '$,.2f') })
1524
+ : t('vehicleProps:value.na');
1404
1525
  }
1405
1526
  },
1406
- timeFrameT0: {
1407
- title: '',
1527
+ consumptionPriceYear: {
1528
+ title: t('vehicleProps:title.consumptionPriceYear'),
1408
1529
  get value() {
1409
- return ''
1530
+ const { consumptionPriceYear } = car.costModel;
1531
+ return Number.isFinite(consumptionPriceYear)
1532
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(consumptionPriceYear, '$,.2f') })
1533
+ : t('vehicleProps:value.na');
1410
1534
  }
1411
1535
  },
1412
- consumptionCosts: {
1413
- title: '',
1536
+ wltpCostModelTax: {
1537
+ title: t('vehicleProps:title.wltpVehicleTax'),
1414
1538
  get value() {
1415
- return ''
1539
+ const { tax } = car.costModel;
1540
+ return Number.isFinite(tax)
1541
+ ? t('vehicleProps:value.price', { price: getFormattedPrice(tax, '$,.2f') })
1542
+ : t('vehicleProps:value.na');
1416
1543
  }
1417
1544
  }
1545
+
1418
1546
  };
1419
1547
  return props;
1420
1548
  };
@@ -47,9 +47,7 @@ const environmentPluginHybridWLTP = ['wltpWeightedCombined', 'wltpTotalRange', '
47
47
  'wltpCombined', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass', 'wltpDischargedEnergyEfficiencyClass'];
48
48
  const environmentElectroBenzinDieselEthanolHybridWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
49
49
  const environmentHydrogenWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
50
- const costModel = ['fuelPrice', 'powerPrice', 'consumptionPriceYear', 'co2CostLowBasePrice', 'co2CostMiddleBasePrice',
51
- 'co2CostHighBasePrice', 'co2CostLowAccumulatedPrice', 'co2CostMiddleAccumulatedPrice', 'co2CostHighAccumulatedPrice',
52
- 'timeFrameFrom', 'timeFrameT0', 'consumptionCosts',]
50
+ // const costModel = ['wltpEnergyCosts', 'wltpCo2CostsLow',, 'wltpCo2CostsMiddle', 'wltpCo2CostsHigh', 'wltpCostModelTax'];
53
51
 
54
52
  export const engineDetails: IEngineDetails = [
55
53
  {
@@ -357,9 +355,9 @@ export const getWltpValues = (selector: any, hybridPlugin: any = false) => {
357
355
  }, []);
358
356
  };
359
357
 
360
- export const getCostModelValues = () => {
361
- return costModel;
362
- }
358
+ // export const getCostModelValues = () => {
359
+ // return costModel;
360
+ // }
363
361
 
364
362
  export const getOverviewDetails = (selector: any) => {
365
363
  if (Object.keys(filtered(selector)).length === 0) {