@bytebrand/fe-ui-core 4.6.7 → 4.6.9

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.6.7",
3
+ "version": "4.6.9",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -84,7 +84,8 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
84
84
  icon: decoratedProps[prop].icon,
85
85
  description: decoratedProps[prop].value,
86
86
  className: styles[decoratedProps[prop].name],
87
- classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch
87
+ classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch,
88
+ hybridPlugin: engineData.hybridPlugin && prop === 'consumptionCombinedAlternateView' && vehicleComponentName === 'landing'
88
89
  }));
89
90
 
90
91
  return mainPropertiesList.map((property: any, index: number) => (
@@ -9,6 +9,10 @@
9
9
  align-items: center;
10
10
  border-bottom: 1px solid rgba(76, 78, 100, 0.12);
11
11
 
12
+ .smallProp
13
+ span
14
+ font-size: 9px !important
15
+
12
16
  .carIcon
13
17
  width: 28px;
14
18
  height: 30px;
@@ -5,6 +5,7 @@ import styles from './VehicleProperty.styl';
5
5
  export interface IVehicleProperty {
6
6
  className?: string;
7
7
  classNameIcon?: string;
8
+ hybridPlugin?: boolean;
8
9
  icon: string;
9
10
  description: React.ReactNode;
10
11
  }
@@ -16,8 +17,8 @@ class VehicleProperty extends React.Component<IVehicleProperty, {}> {
16
17
  };
17
18
 
18
19
  render(): React.ReactNode {
19
- const { className, classNameIcon, icon, description } = this.props;
20
- const propertyClass: string = `${styles.carProp} ${className ? className : ''}`;
20
+ const { className, classNameIcon, icon, description, hybridPlugin } = this.props;
21
+ const propertyClass: string = `${styles.carProp} ${className ? className : ''} ${hybridPlugin ? styles.smallProp : ''}`;
21
22
  const propertyClassIcon: string = `${styles.carIcon} ${classNameIcon ? classNameIcon : ''}`;
22
23
 
23
24
  return (
@@ -125,7 +125,7 @@ const getDecoratedLightProps = (
125
125
  : null;
126
126
 
127
127
  const wltpCo2PluginValue = Number.isFinite(wltpCo2)
128
- ? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
128
+ ? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
129
129
  : null;
130
130
 
131
131
  const wltpCo2Value = Number.isFinite(wltpCo2)
@@ -148,10 +148,10 @@ const getDecoratedLightProps = (
148
148
  const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
149
149
 
150
150
  if (hybridPlugin) {
151
- return <React.Fragment>
152
- {`${wltpWeightedPowerCombinedContent}, `}
153
- {wltpWeightedCombinedContent}, {wltpCo2PluginValue}
154
- </React.Fragment>
151
+ return <React.Fragment>
152
+ {`${wltpWeightedPowerCombinedContent}, `}
153
+ {wltpWeightedCombinedContent}, {wltpCo2PluginValue}
154
+ </React.Fragment>
155
155
  }
156
156
 
157
157
  if (wltpConsumptionValue && wltpCo2Value) {
@@ -1137,7 +1137,7 @@ const getDecoratedProps = (
1137
1137
  get value() {
1138
1138
  const c02 = car.environmentEmissions.wltpCo2;
1139
1139
  return Number.isFinite(c02)
1140
- ? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
1140
+ ? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
1141
1141
  : t('vehicleProps:value.na');
1142
1142
  }
1143
1143
  },
@@ -1146,7 +1146,7 @@ const getDecoratedProps = (
1146
1146
  get value() {
1147
1147
  const c02 = car.environmentEmissions.wltpCo2;
1148
1148
  return Number.isFinite(c02)
1149
- ? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
1149
+ ? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
1150
1150
  : t('vehicleProps:value.na');
1151
1151
  }
1152
1152
  },
@@ -1154,8 +1154,10 @@ const getDecoratedProps = (
1154
1154
  title: t('vehicleProps:title.wltpCo2Discharged'),
1155
1155
  get value() {
1156
1156
  const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
1157
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1158
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1157
1159
  return Number.isFinite(wltpCo2)
1158
- ? t('vehicleProps:value.co2', { co2: wltpCo2.toLocaleString(language) })
1160
+ ? t('vehicleProps:value.wltpCo2', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
1159
1161
  : t('vehicleProps:value.na');
1160
1162
  }
1161
1163
  },
@@ -1246,6 +1248,17 @@ const getDecoratedProps = (
1246
1248
  : t('vehicleProps:value.na');
1247
1249
  }
1248
1250
  },
1251
+ wltpCombinedGas: {
1252
+ title: t('vehicleProps:title.wltpCombined'),
1253
+ get value() {
1254
+ const wltpCombined = car.consumption.wltpCombined;
1255
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1256
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1257
+ return Number.isFinite(wltpCombined)
1258
+ ? t('vehicleProps:value.consumptionGas', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
1259
+ : t('vehicleProps:value.na');
1260
+ }
1261
+ },
1249
1262
  wltpCombinedPlugin: {
1250
1263
  title: t('vehicleProps:title.wltpCombinedPlugin'),
1251
1264
  get value() {
@@ -1268,6 +1281,17 @@ const getDecoratedProps = (
1268
1281
  : t('vehicleProps:value.na');
1269
1282
  }
1270
1283
  },
1284
+ wltpSlowGas: {
1285
+ title: t('vehicleProps:title.wltpSlow'),
1286
+ get value() {
1287
+ const wltpSlow = car.consumption.wltpSlow;
1288
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1289
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1290
+ return Number.isFinite(wltpSlow)
1291
+ ? t('vehicleProps:value.consumptionGas', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
1292
+ : t('vehicleProps:value.na');
1293
+ }
1294
+ },
1271
1295
  wltpSlowPlugin: {
1272
1296
  title: t('vehicleProps:title.wltpSlowPlugin'),
1273
1297
  get value() {
@@ -1290,6 +1314,17 @@ const getDecoratedProps = (
1290
1314
  : t('vehicleProps:value.na');
1291
1315
  }
1292
1316
  },
1317
+ wltpMediumGas: {
1318
+ title: t('vehicleProps:title.wltpMedium'),
1319
+ get value() {
1320
+ const wltpMedium = car.consumption.wltpMedium;
1321
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1322
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1323
+ return Number.isFinite(wltpMedium)
1324
+ ? t('vehicleProps:value.consumptionGas', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
1325
+ : t('vehicleProps:value.na');
1326
+ }
1327
+ },
1293
1328
  wltpMediumPlugin: {
1294
1329
  title: t('vehicleProps:title.wltpMediumPlugin'),
1295
1330
  get value() {
@@ -1312,6 +1347,17 @@ const getDecoratedProps = (
1312
1347
  : t('vehicleProps:value.na');
1313
1348
  }
1314
1349
  },
1350
+ wltpFastGas: {
1351
+ title: t('vehicleProps:title.wltpFast'),
1352
+ get value() {
1353
+ const wltpFast = car.consumption.wltpFast;
1354
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1355
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1356
+ return Number.isFinite(wltpFast)
1357
+ ? t('vehicleProps:value.consumptionGas', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
1358
+ : t('vehicleProps:value.na');
1359
+ }
1360
+ },
1315
1361
  wltpFastPlugin: {
1316
1362
  title: t('vehicleProps:title.wltpFastPlugin'),
1317
1363
  get value() {
@@ -1334,6 +1380,17 @@ const getDecoratedProps = (
1334
1380
  : t('vehicleProps:value.na');
1335
1381
  }
1336
1382
  },
1383
+ wltpVeryFastGas: {
1384
+ title: t('vehicleProps:title.wltpVeryFast'),
1385
+ get value() {
1386
+ const wltpVeryFast = car.consumption.wltpVeryFast;
1387
+ const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
1388
+ const translatedUnit = t(`cbd:${consumptionUnit}`);
1389
+ return Number.isFinite(wltpVeryFast)
1390
+ ? t('vehicleProps:value.consumptionGas', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
1391
+ : t('vehicleProps:value.na');
1392
+ }
1393
+ },
1337
1394
  wltpVeryFastPlugin: {
1338
1395
  title: t('vehicleProps:title.wltpVeryFastPlugin'),
1339
1396
  get value() {
@@ -1513,7 +1570,7 @@ const getDecoratedProps = (
1513
1570
  get value() {
1514
1571
  const { powerPrice } = car.costModel;
1515
1572
  return Number.isFinite(powerPrice)
1516
- ? t('vehicleProps:value.price', { price: getFormattedPrice(powerPrice, '$,.2f') })
1573
+ ? t('vehicleProps:value.powerPrice', { price: getFormattedPrice(powerPrice, '$,.2f') })
1517
1574
  : t('vehicleProps:value.na');
1518
1575
  }
1519
1576
  },
@@ -1522,7 +1579,7 @@ const getDecoratedProps = (
1522
1579
  get value() {
1523
1580
  const { fuelPrice } = car.costModel;
1524
1581
  return Number.isFinite(fuelPrice)
1525
- ? t('vehicleProps:value.price', { price: getFormattedPrice(fuelPrice, '$,.2f') })
1582
+ ? t('vehicleProps:value.fuelPrice', { price: getFormattedPrice(fuelPrice, '$,.2f') })
1526
1583
  : t('vehicleProps:value.na');
1527
1584
  }
1528
1585
  },
@@ -41,13 +41,13 @@ const consumptionCombinedHybridAlternateView = ['consumptionCombinedHybridAltern
41
41
  const consumptionGasCombinedAlternateView = ['consumptionGasCombinedAlternateView'];
42
42
  const consumptionHydrogenCombinedAlternateView = ['consumptionHydrogenCombinedAlternateView'];
43
43
  const environmentElectroWLTP = ['wltpPowerCombined', 'wltpCo2', 'wltpRange', 'wltpPowerSlow', 'wltpPowerMedium',
44
- 'wltpPowerFast', 'wltpPowerVeryFast', 'wltpEnergyEfficiencyClass'];
45
- const environmentPluginHybridWLTP = ['wltpWeightedCombined', 'wltpTotalRange', 'wltpWeightedPowerCombined', 'wltpCo2',
44
+ 'wltpPowerFast', 'wltpPowerVeryFast', 'powerPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
45
+ const environmentPluginHybridWLTP = ['wltpWeightedCombined', 'wltpTotalRange', 'wltpWeightedPowerCombined', 'wltpCo2Plugin',
46
46
  'wltpCo2Discharged', 'wltpPowerCombined', 'wltpPowerSlow', 'wltpPowerMedium', 'wltpPowerFast', 'wltpPowerVeryFast',
47
47
  'wltpPowerCombinedPlugin', 'wltpPowerSlowPlugin', 'wltpPowerMediumPlugin', 'wltpPowerFastPlugin',
48
48
  'fuelPrice', 'powerPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
49
49
  const environmentElectroBenzinDieselEthanolHybridWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'fuelPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
50
- const environmentHydrogenWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
50
+ const environmentHydrogenWLTP = ['wltpCombinedGas', 'wltpCo2', 'wltpSlowGas', 'wltpMediumGas', 'wltpFastGas', 'wltpVeryFastGas', 'fuelPrice', 'consumptionPriceYear', 'wltpEnergyEfficiencyClass'];
51
51
  // const costModel = ['wltpEnergyCosts', 'wltpCo2CostsLow',, 'wltpCo2CostsMiddle', 'wltpCo2CostsHigh', 'wltpCostModelTax'];
52
52
 
53
53
  export const engineDetails: IEngineDetails = [
@@ -46,7 +46,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
46
46
  mileage: `${vehicleOption.mileage} km`,
47
47
  consumption: `${vehicleOption.consumptionCombined}l/100km`,
48
48
  consumptionPower: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
49
- consumptionPowerCombined: `${vehicleOption.consumptionPowerCombined}kWh/100km (komb)*`,
49
+ consumptionPowerCombined: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
50
50
  consumptionGas: `${vehicleOption.consumptionCombined}kg/100km`,
51
51
  consumptionCombined: `${vehicleOption.consumptionCombined}l/100km`,
52
52
  power: `${vehicleOption.powerKW}\u00A0kW (${vehicleOption.powerPS}\u00A0PS)`,
@@ -83,8 +83,8 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
83
83
  no: 'Nein',
84
84
  yes: 'Ja',
85
85
  batteryCapacity: `${vehicleOption.batteryCapacity} kWh`,
86
- wltpCo2Combined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, comb)*`,
87
- wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., comb)*`
86
+ wltpCo2Combined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb)*`,
87
+ wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., komb)*`
88
88
 
89
89
  },
90
90
  title: {