@bytebrand/fe-ui-core 4.6.11 → 4.6.13
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 +2 -2
- package/source/framework/DataTransformers.ts +5 -3
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +21 -14
- package/source/framework/vehiclesProps/decoratedProps.tsx +21 -6
- package/source/framework/vehiclesProps/vehicleDetails.ts +3 -3
- package/source/locales/data.ts +5 -2
package/package.json
CHANGED
|
@@ -85,8 +85,8 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
85
85
|
description: decoratedProps[prop].value,
|
|
86
86
|
className: styles[decoratedProps[prop].name],
|
|
87
87
|
classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch,
|
|
88
|
-
smalltext: prop === 'consumptionCombinedAlternateView',
|
|
89
|
-
hybridPlugin: engineData.hybridPlugin
|
|
88
|
+
smalltext: prop === ('consumptionCombinedAlternateView' || prop === 'consumptionHydrogenCombinedAlternateView') && vehicleComponentName !== 'search',
|
|
89
|
+
hybridPlugin: engineData.hybridPlugin && prop === 'consumptionCombinedAlternateView' && vehicleComponentName !== 'search'
|
|
90
90
|
}));
|
|
91
91
|
|
|
92
92
|
return mainPropertiesList.map((property: any, index: number) => (
|
|
@@ -68,10 +68,12 @@ export const transformDataForDecoratedCar = (car: any) => {
|
|
|
68
68
|
tareWeight: _get(car, 'sizeVolumeWeight.emptyWeight', null),
|
|
69
69
|
bootCapacity: _get(car, 'sizeVolumeWeight.cargoCapacity', null),
|
|
70
70
|
capacityLoad: _get(car, 'sizeVolumeWeight.completeCapacity', null),
|
|
71
|
-
wltpCombined: _get(car, 'consumption.wltpCombined', null),
|
|
72
|
-
wltpPowerCombined: _get(car, 'consumption.wltpPowerCombined', null),
|
|
73
71
|
wltpCo2: _get(car, 'consumption.wltpCo2', _get(car, 'environmentEmissions.wltpCo2')),
|
|
74
|
-
pluginHybrid: _get(car, 'engineData.pluginHybrid', null)
|
|
72
|
+
pluginHybrid: _get(car, 'engineData.pluginHybrid', null),
|
|
73
|
+
wltpCombined: _get(car, 'consumption.wltpCombined', _get(car, 'consumption.wltpWeightedCombined', null)),
|
|
74
|
+
wltpPowerCombined: _get(car, 'consumption.wltpPowerCombined', _get(car, 'consumption.wltpWeightedPowerCombined', null)),
|
|
75
|
+
wltpWeightedCombined: _get(car, 'consumption.wltpWeightedCombined', null),
|
|
76
|
+
wltpWeightedPowerCombined: _get(car, 'consumption.wltpWeightedPowerCombined', null)
|
|
75
77
|
};
|
|
76
78
|
};
|
|
77
79
|
|
|
@@ -103,6 +103,12 @@ const getDecoratedLightProps = (
|
|
|
103
103
|
const consumptionCombined = car.consumption.consumptionCombined;
|
|
104
104
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
105
105
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
106
|
+
const wltpCombined = car.consumption.wltpCombined || car.consumption.wltpWeightedCombined;
|
|
107
|
+
if (wltpCombined) {
|
|
108
|
+
return Number.isFinite(wltpCombined)
|
|
109
|
+
? t('vehicleProps:value.wltpCombined', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
110
|
+
: t('vehicleProps:value.na');
|
|
111
|
+
}
|
|
106
112
|
return Number.isFinite(consumptionCombined)
|
|
107
113
|
? t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
108
114
|
: t('vehicleProps:value.na');
|
|
@@ -115,13 +121,13 @@ const getDecoratedLightProps = (
|
|
|
115
121
|
const consumptionCombined = car.consumption.consumptionCombined;
|
|
116
122
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
117
123
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
118
|
-
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
124
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined || car.consumption.wltpWeightedCombined;
|
|
119
125
|
const wltpCo2 = car.environmentEmissions.wltpCo2 || car.consumption.wltpCo2;
|
|
120
126
|
|
|
121
127
|
const co2 = car.environmentEmissions.co2;
|
|
122
128
|
|
|
123
129
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
124
|
-
? t('vehicleProps:value.
|
|
130
|
+
? t('vehicleProps:value.wltpCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
125
131
|
: null;
|
|
126
132
|
|
|
127
133
|
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
@@ -144,13 +150,14 @@ const getDecoratedLightProps = (
|
|
|
144
150
|
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
145
151
|
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
146
152
|
|
|
147
|
-
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.
|
|
148
|
-
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.
|
|
153
|
+
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
154
|
+
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.wltpCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
149
155
|
|
|
150
156
|
if (hybridPlugin) {
|
|
151
157
|
return <React.Fragment>
|
|
152
|
-
{`${wltpWeightedPowerCombinedContent}, `}
|
|
153
|
-
{wltpWeightedCombinedContent},
|
|
158
|
+
{wltpWeightedPowerCombinedContent ? `${wltpWeightedPowerCombinedContent}, ` : ''}
|
|
159
|
+
{wltpWeightedCombinedContent ? `${wltpWeightedCombinedContent}, ` : ''}
|
|
160
|
+
{wltpCo2PluginValue}
|
|
154
161
|
</React.Fragment>
|
|
155
162
|
}
|
|
156
163
|
|
|
@@ -174,7 +181,7 @@ const getDecoratedLightProps = (
|
|
|
174
181
|
const wltpCo2 = car.consumption.wltpCo2 || car.environmentEmissions.wltpCo2;
|
|
175
182
|
|
|
176
183
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
177
|
-
? t('vehicleProps:value.
|
|
184
|
+
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
178
185
|
: null;
|
|
179
186
|
|
|
180
187
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
@@ -212,14 +219,14 @@ const getDecoratedLightProps = (
|
|
|
212
219
|
|
|
213
220
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
214
221
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
215
|
-
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.
|
|
216
|
-
const wltpWeightedCombinedContent = t('vehicleProps:value.
|
|
222
|
+
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.wltpPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
223
|
+
const wltpWeightedCombinedContent = t('vehicleProps:value.wltpCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
217
224
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
218
|
-
? t('vehicleProps:value.
|
|
225
|
+
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
219
226
|
: null;
|
|
220
227
|
|
|
221
228
|
const wltpConsumptionCombinedContent = wltpConsumptionCombined ?
|
|
222
|
-
t('vehicleProps:value.
|
|
229
|
+
t('vehicleProps:value.wltpCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
223
230
|
: null;
|
|
224
231
|
|
|
225
232
|
const co2 = car.environmentEmissions.co2;
|
|
@@ -235,12 +242,12 @@ const getDecoratedLightProps = (
|
|
|
235
242
|
|
|
236
243
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
237
244
|
|
|
238
|
-
if (
|
|
245
|
+
if (wltpWeightedCombinedContent && wltpWeightedPowerCombinedContent && wltpCo2Value) {
|
|
239
246
|
if (hybridPlugin) {
|
|
240
247
|
return <React.Fragment>
|
|
241
248
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
242
249
|
{`${wltpWeightedCombinedContent}, `}
|
|
243
|
-
{
|
|
250
|
+
{wltpCo2Value}
|
|
244
251
|
</React.Fragment>
|
|
245
252
|
}
|
|
246
253
|
return <React.Fragment>
|
|
@@ -279,7 +286,7 @@ const getDecoratedLightProps = (
|
|
|
279
286
|
: t('vehicleProps:value.na');
|
|
280
287
|
|
|
281
288
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
282
|
-
? t('vehicleProps:value.
|
|
289
|
+
? t('vehicleProps:value.wltpCombinedGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
283
290
|
: null;
|
|
284
291
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
285
292
|
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
@@ -814,18 +814,27 @@ const getDecoratedProps = (
|
|
|
814
814
|
get value() {
|
|
815
815
|
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
816
816
|
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
817
|
-
const
|
|
817
|
+
// const wltpPowerCombined = car.consumption.wltpPowerCombined || car.consumption.wltpWeightedPowerCombined;
|
|
818
|
+
const wltpCombined = car.consumption.wltpCombined || car.consumption.wltpWeightedCombined;
|
|
818
819
|
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
820
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
819
821
|
|
|
820
822
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
821
823
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
822
824
|
|
|
823
825
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
824
|
-
const wltpConsumptionPowerCombinedContent =
|
|
826
|
+
// const wltpConsumptionPowerCombinedContent = wltpPowerCombined
|
|
827
|
+
// ? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
828
|
+
// : null;
|
|
829
|
+
|
|
830
|
+
const wltpConsumptionWeightedPowerCombinedContent = wltpWeightedPowerCombined
|
|
825
831
|
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
826
832
|
: null;
|
|
827
833
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
828
|
-
const wltpConsumptionCombinedContent =
|
|
834
|
+
const wltpConsumptionCombinedContent = wltpCombined ?
|
|
835
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
836
|
+
: null;
|
|
837
|
+
const wltpConsumptionWeightedCombinedContent = wltpWeightedCombined ?
|
|
829
838
|
t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
830
839
|
: null;
|
|
831
840
|
|
|
@@ -842,12 +851,18 @@ const getDecoratedProps = (
|
|
|
842
851
|
: null;
|
|
843
852
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
844
853
|
|
|
854
|
+
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
855
|
+
return <React.Fragment>
|
|
856
|
+
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
|
|
857
|
+
{wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
|
|
858
|
+
{wrapValue(wltpCo2PluginValue)}
|
|
859
|
+
</React.Fragment>
|
|
860
|
+
}
|
|
861
|
+
|
|
845
862
|
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
846
863
|
return <React.Fragment>
|
|
847
|
-
{wltpConsumptionPowerCombinedContent && hybridPlugin ? wrapValue(wltpConsumptionPowerCombinedContent) : ''}
|
|
848
|
-
{wltpConsumptionPowerCombinedContent && hybridPlugin ? ', ' : ''}
|
|
849
864
|
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
850
|
-
{
|
|
865
|
+
{wrapValue(wltpCo2Value)}
|
|
851
866
|
</React.Fragment>
|
|
852
867
|
}
|
|
853
868
|
|
|
@@ -276,13 +276,13 @@ export const wltpDetails = [
|
|
|
276
276
|
]
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
|
-
selector: '
|
|
279
|
+
selector: 'selector_fuel_hybridElectricalPetrol',
|
|
280
280
|
wltp: [
|
|
281
|
-
...
|
|
281
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
282
282
|
]
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
|
-
selector: '
|
|
285
|
+
selector: 'selector_fuel_hybridElectricalDiesel',
|
|
286
286
|
wltp: [
|
|
287
287
|
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
288
288
|
]
|
package/source/locales/data.ts
CHANGED
|
@@ -49,6 +49,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
49
49
|
consumptionPowerCombined: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
|
|
50
50
|
consumptionGas: `${vehicleOption.consumptionCombined}kg/100km`,
|
|
51
51
|
consumptionCombined: `${vehicleOption.consumptionCombined}l/100km`,
|
|
52
|
+
wltpConsumptionCombined: `${vehicleOption.wltpCombined}l/100km`,
|
|
52
53
|
power: `${vehicleOption.powerKW}\u00A0kW (${vehicleOption.powerPS}\u00A0PS)`,
|
|
53
54
|
powerAlternateView: `${vehicleOption.powerKW}\u00A0kW (${vehicleOption.powerPS}\u00A0PS)`,
|
|
54
55
|
powerPS: `${vehicleOption.powerPS} PS`,
|
|
@@ -84,8 +85,10 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
84
85
|
yes: 'Ja',
|
|
85
86
|
batteryCapacity: `${vehicleOption.batteryCapacity} kWh`,
|
|
86
87
|
wltpCo2Combined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb)*`,
|
|
87
|
-
wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., komb)
|
|
88
|
-
|
|
88
|
+
wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., komb)*`,
|
|
89
|
+
wltpCombined: `${vehicleOption.wltpCombined || vehicleOption.wltpWeightedCombined}l/100km`,
|
|
90
|
+
wltpPowerCombined: `${vehicleOption.wltpPowerCombined || vehicleOption.wltpWeightedPowerCombined}kWh/100km`,
|
|
91
|
+
wltpCombinedGas: `${vehicleOption.wltpCombined || vehicleOption.wltpWeightedCombined}g/100km`
|
|
89
92
|
},
|
|
90
93
|
title: {
|
|
91
94
|
'addOfferToMainSlide': 'Zum Schieberegler hinzufügen',
|