@bytebrand/fe-ui-core 4.6.5 → 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/framework/vehiclesProps/decoratedLightProps.tsx +29 -3
- package/source/framework/vehiclesProps/decoratedProps.tsx +16 -14
- 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
|
|
|
@@ -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
|
|
|
@@ -1529,7 +1531,7 @@ const getDecoratedProps = (
|
|
|
1529
1531
|
get value() {
|
|
1530
1532
|
const { consumptionPriceYear } = car.costModel;
|
|
1531
1533
|
return Number.isFinite(consumptionPriceYear)
|
|
1532
|
-
?
|
|
1534
|
+
? consumptionPriceYear
|
|
1533
1535
|
: t('vehicleProps:value.na');
|
|
1534
1536
|
}
|
|
1535
1537
|
},
|
|
@@ -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
|
|