@bytebrand/fe-ui-core 4.8.6 → 4.8.8
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
|
@@ -363,7 +363,7 @@ export interface IFinancingUtils {
|
|
|
363
363
|
co2DefaultCostsMedium: number;
|
|
364
364
|
co2DefaultCostsHigh: number;
|
|
365
365
|
getVehicleTax: (fuelType: string, cubicCapacity: number, co2: number, firstRegistration: number) => number;
|
|
366
|
-
getFuelPrice: (fuelSelector: string, consumption: IWltpConsumption, hybridPlugin?:
|
|
366
|
+
getFuelPrice: (fuelSelector: string, consumption: IWltpConsumption, hybridPlugin: boolean, powerCost: { fuelPrice?: number, powerPrice?: number }) => number;
|
|
367
367
|
getBaseFuelPrice: (fuelSelector: string, hybridPlugin?: boolean) => { fuelPrice: number, powerPrice?: number };
|
|
368
368
|
getCo2Price: (wltpCo2: number) => { co2PriceLow: number, co2PriceMedium: number, co2PriceHigh: number };
|
|
369
369
|
}
|
|
@@ -153,8 +153,8 @@ const getDecoratedLightProps = (
|
|
|
153
153
|
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
154
154
|
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
155
155
|
|
|
156
|
-
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.
|
|
157
|
-
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.
|
|
156
|
+
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
157
|
+
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
158
158
|
|
|
159
159
|
if (hybridPlugin) {
|
|
160
160
|
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent && wltpCo2PluginValue) {
|
|
@@ -233,8 +233,8 @@ const getDecoratedLightProps = (
|
|
|
233
233
|
|
|
234
234
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
235
235
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
236
|
-
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.
|
|
237
|
-
const wltpWeightedCombinedContent = t('vehicleProps:value.
|
|
236
|
+
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
237
|
+
const wltpWeightedCombinedContent = t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
238
238
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
239
239
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
240
240
|
: null;
|
|
@@ -1169,7 +1169,7 @@ const getDecoratedProps = (
|
|
|
1169
1169
|
wltpCo2Discharged: {
|
|
1170
1170
|
title: t('vehicleProps:title.wltpCo2Discharged'),
|
|
1171
1171
|
get value() {
|
|
1172
|
-
const wltpCo2 = car.environmentEmissions.
|
|
1172
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
|
|
1173
1173
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1174
1174
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1175
1175
|
return Number.isFinite(wltpCo2)
|
|
@@ -1544,12 +1544,17 @@ const getDecoratedProps = (
|
|
|
1544
1544
|
get value() {
|
|
1545
1545
|
const { fuel } = car.consumption;
|
|
1546
1546
|
const { wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined } = car.consumption;
|
|
1547
|
+
const { powerPrice, fuelPrice } = car.costModel;
|
|
1548
|
+
const powerCost = {
|
|
1549
|
+
fuelPrice,
|
|
1550
|
+
powerPrice
|
|
1551
|
+
}
|
|
1547
1552
|
const { hybridPlugin } = car.engineData;
|
|
1548
1553
|
const consumption = {
|
|
1549
1554
|
wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined
|
|
1550
1555
|
}
|
|
1551
1556
|
const { getFuelPrice } = financingUtils;
|
|
1552
|
-
const fuelCost = getFuelPrice(fuel, consumption, hybridPlugin);
|
|
1557
|
+
const fuelCost = getFuelPrice(fuel, consumption, hybridPlugin, powerCost);
|
|
1553
1558
|
return Number.isFinite(fuelCost)
|
|
1554
1559
|
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(fuelCost, '$,.2f') })
|
|
1555
1560
|
: t('vehicleProps:value.na');
|
|
@@ -1627,7 +1632,7 @@ const getDecoratedProps = (
|
|
|
1627
1632
|
|
|
1628
1633
|
const { getBaseFuelPrice } = financingUtils;
|
|
1629
1634
|
|
|
1630
|
-
const baseFuelPrice = getBaseFuelPrice(fuel, hybridPlugin).fuelPrice;
|
|
1635
|
+
const baseFuelPrice = getBaseFuelPrice(fuel, hybridPlugin) ? getBaseFuelPrice(fuel, hybridPlugin).fuelPrice : null;
|
|
1631
1636
|
|
|
1632
1637
|
const fuelPrice = car.costModel.fuelPrice ? car.costModel.fuelPrice : baseFuelPrice;
|
|
1633
1638
|
return Number.isFinite(fuelPrice)
|
|
@@ -1653,7 +1658,7 @@ const getDecoratedProps = (
|
|
|
1653
1658
|
const { getVehicleTax } = financingUtils;
|
|
1654
1659
|
const tax = car.costModel.tax ? car.costModel.tax : getVehicleTax(fuel, cubicCapacity, wltpCo2, firstRegistration);
|
|
1655
1660
|
return Number.isFinite(tax)
|
|
1656
|
-
? t('vehicleProps:value.
|
|
1661
|
+
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(tax, '$,.2f') })
|
|
1657
1662
|
: t('vehicleProps:value.na');
|
|
1658
1663
|
}
|
|
1659
1664
|
}
|
package/source/locales/data.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { sortingOptions } from './sortingOptions';
|
|
|
8
8
|
import { transformDataForDecoratedCar } from '../framework/DataTransformers'
|
|
9
9
|
import moment from 'moment';
|
|
10
10
|
import { DELIVERY_PERIODS_EXTRA } from '../framework/constants';
|
|
11
|
-
import { getFormattedPrice } from '../framework/utils/CommonUtils';
|
|
11
|
+
import { getFormattedNumber, getFormattedPrice } from '../framework/utils/CommonUtils';
|
|
12
12
|
|
|
13
13
|
export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
14
14
|
const vehicleOption = transformDataForDecoratedCar(car);
|
|
@@ -84,11 +84,13 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
84
84
|
no: 'Nein',
|
|
85
85
|
yes: 'Ja',
|
|
86
86
|
batteryCapacity: `${vehicleOption.batteryCapacity} kWh`,
|
|
87
|
-
wltpCo2Combined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb)*`,
|
|
88
|
-
wltpCo2WtdCombined: `${vehicleOption.wltpCo2}g CO2/km (WLTP, gew., komb)*`,
|
|
89
|
-
wltpCombined: `${vehicleOption.wltpCombined || vehicleOption.wltpWeightedCombined}l/100km`,
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
wltpCo2Combined: `${getFormattedNumber(vehicleOption.wltpCo2)}g CO2/km (WLTP, komb)*`,
|
|
88
|
+
wltpCo2WtdCombined: `${getFormattedNumber(vehicleOption.wltpCo2)}g CO2/km (WLTP, gew., komb)*`,
|
|
89
|
+
wltpCombined: `${getFormattedNumber(vehicleOption.wltpCombined) || getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km`,
|
|
90
|
+
wltpWeightedCombined: `${getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km`,
|
|
91
|
+
wltpWeightedPowerCombined: `${getFormattedNumber(vehicleOption.wltpWeightedPowerCombined)}kWh/100km`,
|
|
92
|
+
wltpPowerCombined: `${getFormattedNumber(vehicleOption.wltpPowerCombined) || getFormattedNumber(vehicleOption.wltpWeightedPowerCombined)}kWh/100km`,
|
|
93
|
+
wltpCombinedGas: `${getFormattedNumber(vehicleOption.wltpCombined) || getFormattedNumber(vehicleOption.wltpWeightedCombined)}kg/100km`
|
|
92
94
|
},
|
|
93
95
|
title: {
|
|
94
96
|
'addOfferToMainSlide': 'Zum Schieberegler hinzufügen',
|