@bytebrand/fe-ui-core 4.6.12 → 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
CHANGED
|
@@ -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');
|
|
@@ -121,7 +127,7 @@ const getDecoratedLightProps = (
|
|
|
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) })
|
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',
|