@bytebrand/fe-ui-core 4.8.32 → 4.8.33
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/media/locales/de/promoSlider.json +1 -0
- package/media/locales/en/promoSlider.json +1 -0
- package/package.json +1 -1
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +13 -8
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +3 -0
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +3 -2
- package/source/framework/DataTransformers.ts +1 -0
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +39 -9
- package/source/locales/data.ts +2 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"consumptionCombined": "{{consumptionCombined}}l/100km (komb)*",
|
|
3
3
|
"co2": "{{co2}}g CO2/km (komb)*",
|
|
4
|
+
"co2Class": "CO2-Klasse {{class}} (komb)",
|
|
4
5
|
"weDeliverMagdeburg": "Wir liefern Ihr Auto zu Ihnen nach Magdeburg!",
|
|
5
6
|
"weDeliverToYou": "Wir liefern Ihr Auto zu Ihnen!",
|
|
6
7
|
"withoutDeposit": "ohne Anzahlung",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"consumptionCombined": "{{consumptionCombined}}/100km (comb)*",
|
|
3
3
|
"co2": "{{co2}}g CO2/km (comb)*",
|
|
4
|
+
"co2Class": "CO2-class {{class}} (comb)",
|
|
4
5
|
"weDeliverMagdeburg": "We will deliver your car to Magdeburg!",
|
|
5
6
|
"weDeliverToYou": "We deliver your car to you!",
|
|
6
7
|
"withoutDeposit": "Without Deposit",
|
package/package.json
CHANGED
|
@@ -82,14 +82,19 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
82
82
|
|
|
83
83
|
const decoratedProps = getDecoratedProps(dataDecoratedProps, t, language);
|
|
84
84
|
const renderProperty = (renderProperties: any, vehicleComponentName?: any) => {
|
|
85
|
-
const mainPropertiesList = renderProperties(dataDecoratedProps.consumption.fuel, combineRefAlternative).map((prop: string) =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
const mainPropertiesList = renderProperties(dataDecoratedProps.consumption.fuel, combineRefAlternative).map((prop: string) => {
|
|
86
|
+
const isConsumption = decoratedProps[prop].name === 'consumptionCombined';
|
|
87
|
+
// On non-SRL cards drop the fuel-pump icon next to the consumption row to free up space for the CO2-class line.
|
|
88
|
+
const hideConsumptionIcon = isConsumption && vehicleComponentName !== 'search';
|
|
89
|
+
return {
|
|
90
|
+
icon: hideConsumptionIcon ? '' : decoratedProps[prop].icon,
|
|
91
|
+
description: decoratedProps[prop].value,
|
|
92
|
+
className: styles[decoratedProps[prop].name],
|
|
93
|
+
classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch,
|
|
94
|
+
smalltext: isConsumption && (vehicleComponentName !== 'search'),
|
|
95
|
+
hybridPlugin: engineData.hybridPlugin && isConsumption && vehicleComponentName !== 'search'
|
|
96
|
+
};
|
|
97
|
+
});
|
|
93
98
|
|
|
94
99
|
return mainPropertiesList.map((property: any, index: number) => (
|
|
95
100
|
<VehicleProperty {...property} key={index} />
|
|
@@ -19,12 +19,13 @@ class VehicleProperty extends React.Component<IVehicleProperty, {}> {
|
|
|
19
19
|
|
|
20
20
|
render(): React.ReactNode {
|
|
21
21
|
const { className, classNameIcon, icon, description, smalltext, hybridPlugin } = this.props;
|
|
22
|
-
const
|
|
22
|
+
const noIcon: boolean = !icon;
|
|
23
|
+
const propertyClass: string = `${styles.carProp} ${className ? className : ''} ${smalltext ? styles.smallProp : ''} ${hybridPlugin ? styles.pluginVal : ''} ${noIcon ? styles.noIcon : ''}`;
|
|
23
24
|
const propertyClassIcon: string = `${styles.carIcon} ${classNameIcon ? classNameIcon : ''}`;
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<div className={propertyClass}>
|
|
27
|
-
<IconSVG className={propertyClassIcon} name={icon} customDimensions />
|
|
28
|
+
{!noIcon && <IconSVG className={propertyClassIcon} name={icon} customDimensions />}
|
|
28
29
|
<span>{description}</span>
|
|
29
30
|
</div>
|
|
30
31
|
);
|
|
@@ -69,6 +69,7 @@ export const transformDataForDecoratedCar = (car: any) => {
|
|
|
69
69
|
bootCapacity: _get(car, 'sizeVolumeWeight.cargoCapacity', null),
|
|
70
70
|
capacityLoad: _get(car, 'sizeVolumeWeight.completeCapacity', null),
|
|
71
71
|
wltpCo2: _get(car, 'environmentEmissions.wltpCo2', null),
|
|
72
|
+
wltpEnergyEfficiencyClass: _get(car, 'environmentEmissions.wltpEnergyEfficiencyClass', null),
|
|
72
73
|
pluginHybrid: _get(car, 'engineData.pluginHybrid', null),
|
|
73
74
|
wltpCombined: _get(car, 'consumption.wltpCombined', null),
|
|
74
75
|
wltpPowerCombined: _get(car, 'consumption.wltpPowerCombined', null),
|
|
@@ -124,6 +124,10 @@ const getDecoratedLightProps = (
|
|
|
124
124
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
125
125
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
126
126
|
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
127
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
128
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
129
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
130
|
+
: null;
|
|
127
131
|
|
|
128
132
|
const co2 = car.environmentEmissions.co2;
|
|
129
133
|
|
|
@@ -164,22 +168,24 @@ const getDecoratedLightProps = (
|
|
|
164
168
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
165
169
|
{`${wltpWeightedCombinedContent}, `}
|
|
166
170
|
{wltpCo2PluginValue}
|
|
171
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
167
172
|
</React.Fragment>
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
171
176
|
? <React.Fragment>
|
|
172
177
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionValue} <br /> {co2Value}
|
|
178
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
173
179
|
</React.Fragment>
|
|
174
180
|
: t('vehicleProps:value.na');
|
|
175
181
|
|
|
176
182
|
}
|
|
177
183
|
|
|
178
184
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
179
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
185
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
180
186
|
}
|
|
181
187
|
|
|
182
|
-
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
188
|
+
return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
183
189
|
}
|
|
184
190
|
},
|
|
185
191
|
consumptionPowerCombinedAlternateView: {
|
|
@@ -193,6 +199,10 @@ const getDecoratedLightProps = (
|
|
|
193
199
|
const co2 = car.environmentEmissions.co2;
|
|
194
200
|
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
195
201
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
202
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
203
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
204
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
205
|
+
: null;
|
|
196
206
|
|
|
197
207
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
198
208
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -211,10 +221,10 @@ const getDecoratedLightProps = (
|
|
|
211
221
|
: t('vehicleProps:value.na');
|
|
212
222
|
|
|
213
223
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
214
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
224
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
215
225
|
}
|
|
216
226
|
|
|
217
|
-
return <>{consumptionValue} <br /> {co2Value} </>;
|
|
227
|
+
return <>{consumptionValue} <br /> {co2Value} {co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
218
228
|
}
|
|
219
229
|
},
|
|
220
230
|
|
|
@@ -251,6 +261,10 @@ const getDecoratedLightProps = (
|
|
|
251
261
|
|
|
252
262
|
const co2 = car.environmentEmissions.co2;
|
|
253
263
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
264
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
265
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
266
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
267
|
+
: null;
|
|
254
268
|
|
|
255
269
|
const co2Value = Number.isFinite(co2)
|
|
256
270
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
@@ -272,6 +286,7 @@ const getDecoratedLightProps = (
|
|
|
272
286
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
273
287
|
{`${wltpWeightedCombinedContent}, `}
|
|
274
288
|
{wltpCo2PluginValue}
|
|
289
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
275
290
|
</React.Fragment>
|
|
276
291
|
}
|
|
277
292
|
}
|
|
@@ -281,12 +296,14 @@ const getDecoratedLightProps = (
|
|
|
281
296
|
{`${wltpConsumptionPowerCombinedContent}, `}
|
|
282
297
|
{`${wltpWeightedCombinedContent}, `}
|
|
283
298
|
{wltpCo2PluginValue}
|
|
299
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
284
300
|
</React.Fragment>
|
|
285
301
|
}
|
|
286
302
|
|
|
287
303
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
288
304
|
? <React.Fragment>
|
|
289
305
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
|
|
306
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
290
307
|
</React.Fragment>
|
|
291
308
|
: t('vehicleProps:value.na');
|
|
292
309
|
}
|
|
@@ -303,6 +320,10 @@ const getDecoratedLightProps = (
|
|
|
303
320
|
const co2 = car.environmentEmissions.co2;
|
|
304
321
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
305
322
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
323
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
324
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
325
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
326
|
+
: null;
|
|
306
327
|
|
|
307
328
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
308
329
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -320,10 +341,10 @@ const getDecoratedLightProps = (
|
|
|
320
341
|
: null;
|
|
321
342
|
|
|
322
343
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
323
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
344
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
324
345
|
}
|
|
325
346
|
|
|
326
|
-
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
347
|
+
return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
327
348
|
}
|
|
328
349
|
},
|
|
329
350
|
consumptionGasCombinedAlternateView: {
|
|
@@ -337,6 +358,10 @@ const getDecoratedLightProps = (
|
|
|
337
358
|
const co2 = car.environmentEmissions.co2;
|
|
338
359
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
339
360
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
361
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
362
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
363
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
364
|
+
: null;
|
|
340
365
|
|
|
341
366
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
342
367
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -355,10 +380,10 @@ const getDecoratedLightProps = (
|
|
|
355
380
|
: null;
|
|
356
381
|
|
|
357
382
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
358
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
383
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
359
384
|
}
|
|
360
385
|
|
|
361
|
-
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
386
|
+
return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
362
387
|
}
|
|
363
388
|
},
|
|
364
389
|
consumptionCombinedDealer: {
|
|
@@ -370,6 +395,7 @@ const getDecoratedLightProps = (
|
|
|
370
395
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
371
396
|
|
|
372
397
|
const co2 = car.environmentEmissions.co2;
|
|
398
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
373
399
|
|
|
374
400
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
375
401
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -379,7 +405,11 @@ const getDecoratedLightProps = (
|
|
|
379
405
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
380
406
|
: t('vehicleProps:value.na');
|
|
381
407
|
|
|
382
|
-
|
|
408
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
409
|
+
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
410
|
+
: null;
|
|
411
|
+
|
|
412
|
+
return <>{consumptionValue} | {co2Value}{co2ClassValue ? <> | {co2ClassValue}</> : null}</>;
|
|
383
413
|
}
|
|
384
414
|
},
|
|
385
415
|
gearbox: {
|
package/source/locales/data.ts
CHANGED
|
@@ -38,6 +38,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
38
38
|
promoSlider: {
|
|
39
39
|
consumptionCombined: `${vehicleOption.consumptionCombined}l/100km (komb)*`,
|
|
40
40
|
co2: `${vehicleOption.co2} g CO2/km (komb)*`,
|
|
41
|
+
co2Class: `CO2-Klasse ${vehicleOption.wltpEnergyEfficiencyClass} (komb)`,
|
|
41
42
|
new: 'neu',
|
|
42
43
|
wltpCo2: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb.)*`,
|
|
43
44
|
wltpConsumptionCombined: `${vehicleOption.consumptionCombined}l/100km`
|
|
@@ -57,6 +58,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
57
58
|
deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
|
|
58
59
|
deliveryPeriodDays: `${count} Tag\nab Bestellung`,
|
|
59
60
|
co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
|
|
61
|
+
co2Class: `CO2-Klasse ${vehicleOption.wltpEnergyEfficiencyClass} (komb)`,
|
|
60
62
|
co2: `${vehicleOption.co2} g/km `,
|
|
61
63
|
na: 'N/A',
|
|
62
64
|
priceSub: '/mtl.',
|