@bytebrand/fe-ui-core-autobahn 1.0.104 → 1.0.106
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 +2 -2
- package/vdp/VdpModules.tsx +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/fe-ui-core-autobahn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
4
4
|
"description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@bytebrand/car-schema-selectors": "^2.0.7",
|
|
13
|
-
"@bytebrand/fe-financing": "^5.14.
|
|
13
|
+
"@bytebrand/fe-financing": "^5.14.16",
|
|
14
14
|
"classnames": "2.2.6",
|
|
15
15
|
"clsx": "^2.1.1",
|
|
16
16
|
"d3-format": "1.4.5",
|
package/vdp/VdpModules.tsx
CHANGED
|
@@ -2089,6 +2089,11 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
2089
2089
|
totalRepaymentBase != null && totalRepaymentBase > 0
|
|
2090
2090
|
? down + totalRepaymentBase + (hasAddServices ? (addServicesCost as number) : hasAddServicesRow ? addServicesRowValue : 0)
|
|
2091
2091
|
: undefined;
|
|
2092
|
+
// Fahrzeugpreis/Anschaffungspreis disclosure line: the "no package" basePrice — but when the
|
|
2093
|
+
// package is bundled into the rate (toggle ON) the financed object includes it, so the shown
|
|
2094
|
+
// price does too. Same rule for financing and leasing (only the row labels differ).
|
|
2095
|
+
const packageInRate = !!withAddServices && addServicesCostRaw != null && addServicesCostRaw > 0;
|
|
2096
|
+
const displayVehiclePrice = (basePrice ?? price) + (packageInRate ? (addServicesCostRaw as number) : 0);
|
|
2092
2097
|
|
|
2093
2098
|
let rows: Array<[string, string, boolean?]>;
|
|
2094
2099
|
if (isLease) {
|
|
@@ -2103,11 +2108,14 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
2103
2108
|
// final grand total is mathematically identical to the financing total's own
|
|
2104
2109
|
// down + grossAmount + package formula, just built up in the two visible stages Figma shows.
|
|
2105
2110
|
const residual = finalInstallment != null && finalInstallment > 0 ? finalInstallment : 0;
|
|
2106
|
-
|
|
2111
|
+
// Σ Leasingraten = the full term × the monthly rate — exactly what the row label
|
|
2112
|
+
// "(N × amount)" states. (Previously derived as grossAmount − residual, which is
|
|
2113
|
+
// (N−1) × monthly for Restwertleasing and contradicted the label by one rate.)
|
|
2114
|
+
const ratesSum = monthly != null && monthly > 0 ? monthly * term : undefined;
|
|
2107
2115
|
const subtotalWithPackage = ratesSum != null ? ratesSum + down + (hasAddServicesRow ? addServicesRowValue : 0) : undefined;
|
|
2108
2116
|
const grandTotal = subtotalWithPackage != null ? subtotalWithPackage + residual : undefined;
|
|
2109
2117
|
rows = [
|
|
2110
|
-
[t('autobahn:modal.leaseVehiclePrice'), `${eurCents(
|
|
2118
|
+
[t('autobahn:modal.leaseVehiclePrice'), `${eurCents(displayVehiclePrice)} €`],
|
|
2111
2119
|
[t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
|
|
2112
2120
|
...(annualMileage != null ? ([[t('autobahn:modal.annualMileage'), `${eur(annualMileage)} km`]] as Array<[string, string]>) : []),
|
|
2113
2121
|
[t('autobahn:modal.leaseDownPayment'), `${eurCents(down)} €`],
|
|
@@ -2121,6 +2129,9 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
2121
2129
|
...(ratesSum != null && hasAddServicesRow
|
|
2122
2130
|
? ([[t('autobahn:modal.addServicesRowLease'), `${eurCents(addServicesRowValue)} €`]] as Array<[string, string]>)
|
|
2123
2131
|
: []),
|
|
2132
|
+
// The rates the calculation actually ran with (Figma): nominal + effective APR.
|
|
2133
|
+
...(nominalRate != null && nominalRate > 0 ? ([[t('autobahn:modal.nominalRate'), pct(nominalRate)]] as Array<[string, string]>) : []),
|
|
2134
|
+
...(apr != null && apr > 0 ? ([[t('autobahn:modal.effectiveRate'), pct(apr)]] as Array<[string, string]>) : []),
|
|
2124
2135
|
...(subtotalWithPackage != null
|
|
2125
2136
|
? ([[hasAddServicesRow ? t('autobahn:modal.subtotalWithPackage') : t('autobahn:modal.subtotalNoPackage'), `${eurCents(subtotalWithPackage)} €`, true]] as Array<
|
|
2126
2137
|
[string, string, boolean]
|
|
@@ -2143,7 +2154,7 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
|
|
|
2143
2154
|
// pass totalFinancingAmount yet.
|
|
2144
2155
|
const totalRepaymentValue = totalRepaymentBase;
|
|
2145
2156
|
rows = [
|
|
2146
|
-
[t('autobahn:modal.vehiclePrice'), `${eurCents(
|
|
2157
|
+
[t('autobahn:modal.vehiclePrice'), `${eurCents(displayVehiclePrice)} €`],
|
|
2147
2158
|
[t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],
|
|
2148
2159
|
[t('autobahn:modal.downPayment'), `${eurCents(down)} €`],
|
|
2149
2160
|
[t('autobahn:modal.monthlyRateCount', { count: regularRateCount }), `${eurCents(monthly)} €`],
|