@bytebrand/fe-ui-core 4.6.4 → 4.6.6
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 +1 -1
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +3 -1
- package/source/components/_common/Co2Widget/CO2Efficiency.styl +39 -0
- package/source/components/_common/Co2Widget/CO2Efficiency.tsx +23 -1
- package/source/framework/constants.ts +11 -0
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +29 -3
- package/source/framework/vehiclesProps/decoratedProps.tsx +165 -16
- package/source/framework/vehiclesProps/vehicleDetails.ts +4 -3
package/package.json
CHANGED
|
@@ -72,7 +72,9 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
72
72
|
consumptionCombined: consumption.consumptionCombined,
|
|
73
73
|
consumptionPowerCombined: consumption.consumptionPowerCombined,
|
|
74
74
|
wltpCombined: consumption.wltpCombined,
|
|
75
|
-
wltpPowerCombined: consumption.wltpPowerCombined
|
|
75
|
+
wltpPowerCombined: consumption.wltpPowerCombined,
|
|
76
|
+
wltpWeightedPowerCombined: consumption.wltpWeightedPowerCombined,
|
|
77
|
+
wltpWeightedCombined: consumption.wltpWeightedCombined,
|
|
76
78
|
},
|
|
77
79
|
};
|
|
78
80
|
|
|
@@ -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',
|
|
@@ -125,7 +125,7 @@ const getDecoratedLightProps = (
|
|
|
125
125
|
: null;
|
|
126
126
|
|
|
127
127
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
128
|
-
? t('vehicleProps:value.
|
|
128
|
+
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
129
129
|
: null;
|
|
130
130
|
|
|
131
131
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
@@ -136,6 +136,20 @@ const getDecoratedLightProps = (
|
|
|
136
136
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
137
137
|
: t('vehicleProps:value.na');
|
|
138
138
|
|
|
139
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
140
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
141
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
142
|
+
|
|
143
|
+
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
144
|
+
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
145
|
+
|
|
146
|
+
if (hybridPlugin) {
|
|
147
|
+
return <React.Fragment>
|
|
148
|
+
{`${wltpWeightedPowerCombinedContent}, `}
|
|
149
|
+
{wltpWeightedCombinedContent}, {wltpCo2Value}
|
|
150
|
+
</React.Fragment>
|
|
151
|
+
}
|
|
152
|
+
|
|
139
153
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
140
154
|
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
141
155
|
}
|
|
@@ -189,13 +203,17 @@ const getDecoratedLightProps = (
|
|
|
189
203
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
190
204
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
191
205
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
206
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
207
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
192
208
|
|
|
193
209
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
194
|
-
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
195
|
-
|
|
210
|
+
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
211
|
+
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
212
|
+
const wltpWeightedCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
196
213
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
197
214
|
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
198
215
|
: null;
|
|
216
|
+
|
|
199
217
|
const wltpConsumptionCombinedContent = wltpConsumptionCombined ?
|
|
200
218
|
t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
201
219
|
: null;
|
|
@@ -214,7 +232,15 @@ const getDecoratedLightProps = (
|
|
|
214
232
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
215
233
|
|
|
216
234
|
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
235
|
+
if (hybridPlugin) {
|
|
236
|
+
return <React.Fragment>
|
|
237
|
+
{`${wltpWeightedPowerCombinedContent}, `}
|
|
238
|
+
{`${wltpWeightedCombinedContent}, `}
|
|
239
|
+
{wltpConsumptionCombinedContent}, {wltpCo2Value}
|
|
240
|
+
</React.Fragment>
|
|
241
|
+
}
|
|
217
242
|
return <React.Fragment>
|
|
243
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent}, ` : ''}
|
|
218
244
|
{wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent}, ` : ''}
|
|
219
245
|
{wltpConsumptionCombinedContent}, {wltpCo2Value}
|
|
220
246
|
</React.Fragment>
|
|
@@ -610,10 +610,9 @@ const getDecoratedProps = (
|
|
|
610
610
|
icon: 'fuelConsumption',
|
|
611
611
|
title: t('vehicleProps:title.сonsumptionCombined'),
|
|
612
612
|
get value() {
|
|
613
|
-
const consumptionCombined = car.consumption.
|
|
613
|
+
const consumptionCombined = car.consumption.consumptionCombined;
|
|
614
614
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
615
615
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
616
|
-
console.log('qqqqq consumptionCombined =====', t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit }));
|
|
617
616
|
return Number.isFinite(consumptionCombined)
|
|
618
617
|
? t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
619
618
|
: t('vehicleProps:value.na');
|
|
@@ -815,19 +814,19 @@ const getDecoratedProps = (
|
|
|
815
814
|
get value() {
|
|
816
815
|
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
817
816
|
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
818
|
-
const
|
|
819
|
-
const
|
|
817
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
818
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
820
819
|
|
|
821
820
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
822
821
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
823
822
|
|
|
824
823
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
825
|
-
const wltpConsumptionPowerCombinedContent =
|
|
826
|
-
? t('vehicleProps:value.consumptionPowerCombined', { consumption:
|
|
824
|
+
const wltpConsumptionPowerCombinedContent = wltpWeightedPowerCombined
|
|
825
|
+
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
827
826
|
: null;
|
|
828
827
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
829
|
-
const wltpConsumptionCombinedContent =
|
|
830
|
-
t('vehicleProps:value.consumptionCombined', { consumption:
|
|
828
|
+
const wltpConsumptionCombinedContent = wltpWeightedCombined ?
|
|
829
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
831
830
|
: null;
|
|
832
831
|
|
|
833
832
|
const co2 = car.environmentEmissions.co2;
|
|
@@ -835,17 +834,20 @@ const getDecoratedProps = (
|
|
|
835
834
|
const co2Value = Number.isFinite(co2)
|
|
836
835
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
837
836
|
: t('vehicleProps:value.na');
|
|
838
|
-
const wltpCo2Value = Number.isFinite(
|
|
839
|
-
? t('vehicleProps:value.
|
|
837
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
838
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
839
|
+
: null;
|
|
840
|
+
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
841
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
840
842
|
: null;
|
|
841
843
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
842
844
|
|
|
843
845
|
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
844
846
|
return <React.Fragment>
|
|
845
847
|
{wltpConsumptionPowerCombinedContent && hybridPlugin ? wrapValue(wltpConsumptionPowerCombinedContent) : ''}
|
|
846
|
-
{wltpConsumptionPowerCombinedContent && hybridPlugin ?
|
|
847
|
-
{wrapValue(wltpConsumptionCombinedContent)}
|
|
848
|
-
{wrapValue(wltpCo2Value)}
|
|
848
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? ', ' : ''}
|
|
849
|
+
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
850
|
+
{hybridPlugin ? wrapValue(wltpCo2PluginValue) : wrapValue(wltpCo2Value)}
|
|
849
851
|
</React.Fragment>
|
|
850
852
|
}
|
|
851
853
|
|
|
@@ -1139,10 +1141,19 @@ const getDecoratedProps = (
|
|
|
1139
1141
|
: t('vehicleProps:value.na');
|
|
1140
1142
|
}
|
|
1141
1143
|
},
|
|
1144
|
+
wltpCo2Plugin: {
|
|
1145
|
+
title: t('vehicleProps:title.wltpCo2Plugin'),
|
|
1146
|
+
get value() {
|
|
1147
|
+
const c02 = car.environmentEmissions.wltpCo2;
|
|
1148
|
+
return Number.isFinite(c02)
|
|
1149
|
+
? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
|
|
1150
|
+
: t('vehicleProps:value.na');
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1142
1153
|
wltpCo2Discharged: {
|
|
1143
1154
|
title: t('vehicleProps:title.wltpCo2Discharged'),
|
|
1144
1155
|
get value() {
|
|
1145
|
-
const wltpCo2 = car.environmentEmissions.
|
|
1156
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
|
|
1146
1157
|
return Number.isFinite(wltpCo2)
|
|
1147
1158
|
? t('vehicleProps:value.co2', { co2: wltpCo2.toLocaleString(language) })
|
|
1148
1159
|
: t('vehicleProps:value.na');
|
|
@@ -1166,6 +1177,7 @@ const getDecoratedProps = (
|
|
|
1166
1177
|
levelTitle={t('vehicleProps:title.wltpCO2WidgetComb')}
|
|
1167
1178
|
wltpLevelTitle={t('vehicleProps:title.wltpCO2WidgetDischargedBattery')}
|
|
1168
1179
|
hybridPlugin={hybridPlugin}
|
|
1180
|
+
isWltp
|
|
1169
1181
|
/> : t('vehicleProps:value.na');
|
|
1170
1182
|
}
|
|
1171
1183
|
},
|
|
@@ -1174,7 +1186,7 @@ const getDecoratedProps = (
|
|
|
1174
1186
|
subTitle: t('vehicleProps:title.subTitle'),
|
|
1175
1187
|
get value() {
|
|
1176
1188
|
const level = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1177
|
-
return isPropDefined(level) ? <CO2Efficiency level={level} t={t} /> : t('vehicleProps:value.na');
|
|
1189
|
+
return isPropDefined(level) ? <CO2Efficiency level={level} isWltp t={t} /> : t('vehicleProps:value.na');
|
|
1178
1190
|
}
|
|
1179
1191
|
},
|
|
1180
1192
|
wltpRange: {
|
|
@@ -1217,7 +1229,7 @@ const getDecoratedProps = (
|
|
|
1217
1229
|
wltpWeightedCombined: {
|
|
1218
1230
|
title: t('vehicleProps:title.wltpWeightedCombined'),
|
|
1219
1231
|
get value() {
|
|
1220
|
-
const wltpWeightedCombined = car.consumption
|
|
1232
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
1221
1233
|
return Number.isFinite(wltpWeightedCombined)
|
|
1222
1234
|
? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language) })
|
|
1223
1235
|
: t('vehicleProps:value.na');
|
|
@@ -1234,6 +1246,17 @@ const getDecoratedProps = (
|
|
|
1234
1246
|
: t('vehicleProps:value.na');
|
|
1235
1247
|
}
|
|
1236
1248
|
},
|
|
1249
|
+
wltpCombinedPlugin: {
|
|
1250
|
+
title: t('vehicleProps:title.wltpCombinedPlugin'),
|
|
1251
|
+
get value() {
|
|
1252
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
1253
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1254
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1255
|
+
return Number.isFinite(wltpCombined)
|
|
1256
|
+
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1257
|
+
: t('vehicleProps:value.na');
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1237
1260
|
wltpSlow: {
|
|
1238
1261
|
title: t('vehicleProps:title.wltpSlow'),
|
|
1239
1262
|
get value() {
|
|
@@ -1245,6 +1268,17 @@ const getDecoratedProps = (
|
|
|
1245
1268
|
: t('vehicleProps:value.na');
|
|
1246
1269
|
}
|
|
1247
1270
|
},
|
|
1271
|
+
wltpSlowPlugin: {
|
|
1272
|
+
title: t('vehicleProps:title.wltpSlowPlugin'),
|
|
1273
|
+
get value() {
|
|
1274
|
+
const wltpSlow = car.consumption.wltpSlow;
|
|
1275
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1276
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1277
|
+
return Number.isFinite(wltpSlow)
|
|
1278
|
+
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1279
|
+
: t('vehicleProps:value.na');
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1248
1282
|
wltpMedium: {
|
|
1249
1283
|
title: t('vehicleProps:title.wltpMedium'),
|
|
1250
1284
|
get value() {
|
|
@@ -1256,6 +1290,17 @@ const getDecoratedProps = (
|
|
|
1256
1290
|
: t('vehicleProps:value.na');
|
|
1257
1291
|
}
|
|
1258
1292
|
},
|
|
1293
|
+
wltpMediumPlugin: {
|
|
1294
|
+
title: t('vehicleProps:title.wltpMediumPlugin'),
|
|
1295
|
+
get value() {
|
|
1296
|
+
const wltpMedium = car.consumption.wltpMedium;
|
|
1297
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1298
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1299
|
+
return Number.isFinite(wltpMedium)
|
|
1300
|
+
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1301
|
+
: t('vehicleProps:value.na');
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1259
1304
|
wltpFast: {
|
|
1260
1305
|
title: t('vehicleProps:title.wltpFast'),
|
|
1261
1306
|
get value() {
|
|
@@ -1267,6 +1312,17 @@ const getDecoratedProps = (
|
|
|
1267
1312
|
: t('vehicleProps:value.na');
|
|
1268
1313
|
}
|
|
1269
1314
|
},
|
|
1315
|
+
wltpFastPlugin: {
|
|
1316
|
+
title: t('vehicleProps:title.wltpFastPlugin'),
|
|
1317
|
+
get value() {
|
|
1318
|
+
const wltpFast = car.consumption.wltpFast;
|
|
1319
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1320
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1321
|
+
return Number.isFinite(wltpFast)
|
|
1322
|
+
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1323
|
+
: t('vehicleProps:value.na');
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1270
1326
|
wltpVeryFast: {
|
|
1271
1327
|
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1272
1328
|
get value() {
|
|
@@ -1278,6 +1334,17 @@ const getDecoratedProps = (
|
|
|
1278
1334
|
: t('vehicleProps:value.na');
|
|
1279
1335
|
}
|
|
1280
1336
|
},
|
|
1337
|
+
wltpVeryFastPlugin: {
|
|
1338
|
+
title: t('vehicleProps:title.wltpVeryFastPlugin'),
|
|
1339
|
+
get value() {
|
|
1340
|
+
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1341
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1342
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1343
|
+
return Number.isFinite(wltpVeryFast)
|
|
1344
|
+
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1345
|
+
: t('vehicleProps:value.na');
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1281
1348
|
wltpWeightedPowerCombined: {
|
|
1282
1349
|
title: t('vehicleProps:title.wltpWeightedPowerCombined'),
|
|
1283
1350
|
get value() {
|
|
@@ -1344,6 +1411,61 @@ const getDecoratedProps = (
|
|
|
1344
1411
|
: t('vehicleProps:value.na');
|
|
1345
1412
|
}
|
|
1346
1413
|
},
|
|
1414
|
+
wltpPowerCombinedPlugin: {
|
|
1415
|
+
title: t('vehicleProps:title.wltpPowerCombinedPlugin'),
|
|
1416
|
+
get value() {
|
|
1417
|
+
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1418
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1419
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1420
|
+
return Number.isFinite(wltpPowerCombined)
|
|
1421
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1422
|
+
: t('vehicleProps:value.na');
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
wltpPowerSlowPlugin: {
|
|
1426
|
+
title: t('vehicleProps:title.wltpPowerSlowPlugin'),
|
|
1427
|
+
get value() {
|
|
1428
|
+
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1429
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1430
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1431
|
+
return Number.isFinite(wltpPowerSlow)
|
|
1432
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1433
|
+
: t('vehicleProps:value.na');
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1436
|
+
wltpPowerMediumPlugin: {
|
|
1437
|
+
title: t('vehicleProps:title.wltpPowerMediumPlugin'),
|
|
1438
|
+
get value() {
|
|
1439
|
+
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1440
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1441
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1442
|
+
return Number.isFinite(wltpPowerMedium)
|
|
1443
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1444
|
+
: t('vehicleProps:value.na');
|
|
1445
|
+
}
|
|
1446
|
+
},
|
|
1447
|
+
wltpPowerFastPlugin: {
|
|
1448
|
+
title: t('vehicleProps:title.wltpPowerFastPlugin'),
|
|
1449
|
+
get value() {
|
|
1450
|
+
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1451
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1452
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1453
|
+
return Number.isFinite(wltpPowerFast)
|
|
1454
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1455
|
+
: t('vehicleProps:value.na');
|
|
1456
|
+
}
|
|
1457
|
+
},
|
|
1458
|
+
wltpPowerVeryFastPlugin: {
|
|
1459
|
+
title: t('vehicleProps:title.wltpPowerVeryFastPlugin'),
|
|
1460
|
+
get value() {
|
|
1461
|
+
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1462
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1463
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1464
|
+
return Number.isFinite(wltpPowerVeryFast)
|
|
1465
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1466
|
+
: t('vehicleProps:value.na');
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1347
1469
|
// wltpEnergyCosts: {
|
|
1348
1470
|
// title: t('vehicleProps:title.wltpEnergyCosts'),
|
|
1349
1471
|
// get value() {
|
|
@@ -1386,6 +1508,33 @@ const getDecoratedProps = (
|
|
|
1386
1508
|
: t('vehicleProps:value.na');
|
|
1387
1509
|
}
|
|
1388
1510
|
},
|
|
1511
|
+
powerPrice: {
|
|
1512
|
+
title: t('vehicleProps:title.powerPrice'),
|
|
1513
|
+
get value() {
|
|
1514
|
+
const { powerPrice } = car.costModel;
|
|
1515
|
+
return Number.isFinite(powerPrice)
|
|
1516
|
+
? t('vehicleProps:value.price', { price: getFormattedPrice(powerPrice, '$,.2f') })
|
|
1517
|
+
: t('vehicleProps:value.na');
|
|
1518
|
+
}
|
|
1519
|
+
},
|
|
1520
|
+
fuelPrice: {
|
|
1521
|
+
title: t('vehicleProps:title.fuelPrice'),
|
|
1522
|
+
get value() {
|
|
1523
|
+
const { fuelPrice } = car.costModel;
|
|
1524
|
+
return Number.isFinite(fuelPrice)
|
|
1525
|
+
? t('vehicleProps:value.price', { price: getFormattedPrice(fuelPrice, '$,.2f') })
|
|
1526
|
+
: t('vehicleProps:value.na');
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
consumptionPriceYear: {
|
|
1530
|
+
title: t('vehicleProps:title.consumptionPriceYear'),
|
|
1531
|
+
get value() {
|
|
1532
|
+
const { consumptionPriceYear } = car.costModel;
|
|
1533
|
+
return Number.isFinite(consumptionPriceYear)
|
|
1534
|
+
? consumptionPriceYear
|
|
1535
|
+
: t('vehicleProps:value.na');
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1389
1538
|
wltpCostModelTax: {
|
|
1390
1539
|
title: t('vehicleProps:title.wltpVehicleTax'),
|
|
1391
1540
|
get value() {
|
|
@@ -43,9 +43,10 @@ const consumptionHydrogenCombinedAlternateView = ['consumptionHydrogenCombinedAl
|
|
|
43
43
|
const environmentElectroWLTP = ['wltpPowerCombined', 'wltpCo2', 'wltpRange', 'wltpPowerSlow', 'wltpPowerMedium',
|
|
44
44
|
'wltpPowerFast', 'wltpPowerVeryFast', 'wltpEnergyEfficiencyClass'];
|
|
45
45
|
const environmentPluginHybridWLTP = ['wltpWeightedCombined', 'wltpTotalRange', 'wltpWeightedPowerCombined', 'wltpCo2',
|
|
46
|
-
'wltpCo2Discharged', '
|
|
47
|
-
'
|
|
48
|
-
|
|
46
|
+
'wltpCo2Discharged', 'wltpPowerCombined', 'wltpPowerSlow', 'wltpPowerMedium', 'wltpPowerFast', 'wltpPowerVeryFast',
|
|
47
|
+
'wltpPowerCombinedPlugin', 'wltpPowerSlowPlugin', 'wltpPowerMediumPlugin', 'wltpPowerFastPlugin',
|
|
48
|
+
'fuelPrice', 'powerPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
|
|
49
|
+
const environmentElectroBenzinDieselEthanolHybridWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'fuelPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
|
|
49
50
|
const environmentHydrogenWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
|
|
50
51
|
// const costModel = ['wltpEnergyCosts', 'wltpCo2CostsLow',, 'wltpCo2CostsMiddle', 'wltpCo2CostsHigh', 'wltpCostModelTax'];
|
|
51
52
|
|