@bytebrand/fe-ui-core 4.6.5 → 4.6.7
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 +32 -2
- 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
|
|
|
@@ -124,6 +124,10 @@ const getDecoratedLightProps = (
|
|
|
124
124
|
? t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
125
125
|
: null;
|
|
126
126
|
|
|
127
|
+
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
128
|
+
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
129
|
+
: null;
|
|
130
|
+
|
|
127
131
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
128
132
|
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
129
133
|
: null;
|
|
@@ -136,6 +140,20 @@ const getDecoratedLightProps = (
|
|
|
136
140
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
137
141
|
: t('vehicleProps:value.na');
|
|
138
142
|
|
|
143
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
144
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
145
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
146
|
+
|
|
147
|
+
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
148
|
+
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
149
|
+
|
|
150
|
+
if (hybridPlugin) {
|
|
151
|
+
return <React.Fragment>
|
|
152
|
+
{`${wltpWeightedPowerCombinedContent}, `}
|
|
153
|
+
{wltpWeightedCombinedContent}, {wltpCo2PluginValue}
|
|
154
|
+
</React.Fragment>
|
|
155
|
+
}
|
|
156
|
+
|
|
139
157
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
140
158
|
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
141
159
|
}
|
|
@@ -189,13 +207,17 @@ const getDecoratedLightProps = (
|
|
|
189
207
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
190
208
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
191
209
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
210
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
211
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
192
212
|
|
|
193
213
|
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
|
-
|
|
214
|
+
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
215
|
+
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
216
|
+
const wltpWeightedCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
196
217
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
197
218
|
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
198
219
|
: null;
|
|
220
|
+
|
|
199
221
|
const wltpConsumptionCombinedContent = wltpConsumptionCombined ?
|
|
200
222
|
t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
201
223
|
: null;
|
|
@@ -214,7 +236,15 @@ const getDecoratedLightProps = (
|
|
|
214
236
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
215
237
|
|
|
216
238
|
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
239
|
+
if (hybridPlugin) {
|
|
240
|
+
return <React.Fragment>
|
|
241
|
+
{`${wltpWeightedPowerCombinedContent}, `}
|
|
242
|
+
{`${wltpWeightedCombinedContent}, `}
|
|
243
|
+
{wltpConsumptionCombinedContent}, {wltpCo2Value}
|
|
244
|
+
</React.Fragment>
|
|
245
|
+
}
|
|
217
246
|
return <React.Fragment>
|
|
247
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent}, ` : ''}
|
|
218
248
|
{wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent}, ` : ''}
|
|
219
249
|
{wltpConsumptionCombinedContent}, {wltpCo2Value}
|
|
220
250
|
</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
|
|