@bytebrand/fe-ui-core 4.6.11 → 4.6.12
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/vehiclesProps/decoratedLightProps.tsx +1 -1
- package/source/framework/vehiclesProps/decoratedProps.tsx +21 -6
- package/source/framework/vehiclesProps/vehicleDetails.ts +3 -3
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) => (
|
|
@@ -115,7 +115,7 @@ const getDecoratedLightProps = (
|
|
|
115
115
|
const consumptionCombined = car.consumption.consumptionCombined;
|
|
116
116
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
117
117
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
118
|
-
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
118
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined || car.consumption.wltpWeightedCombined;
|
|
119
119
|
const wltpCo2 = car.environmentEmissions.wltpCo2 || car.consumption.wltpCo2;
|
|
120
120
|
|
|
121
121
|
const co2 = car.environmentEmissions.co2;
|
|
@@ -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
|
]
|