@bytebrand/fe-ui-core-autobahn 1.0.205 → 1.0.207
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/cards/cardParts.tsx +35 -2
- package/cards/types.ts +8 -0
- package/data/toAutobahnCar.ts +22 -0
- package/locales/de/autobahn.json +4 -0
- package/locales/en/autobahn.json +4 -0
- package/package.json +1 -1
- package/theme/md3.css +5 -0
- package/ui/CreditKeyFigures.tsx +100 -4
- package/ui/index.ts +2 -2
- package/vdp/FinanceCalculator.tsx +1148 -1141
- package/vdp/VdpModules.tsx +11 -5
package/vdp/VdpModules.tsx
CHANGED
|
@@ -1089,6 +1089,9 @@ export interface VdpBottomBarProps {
|
|
|
1089
1089
|
* least one is real they replace the "0 € Anzahlung · 60 Monate" .fin-cond text and the bar
|
|
1090
1090
|
* switches to content height (.vdp-bottom-bar--kf). Omit to keep the old line. */
|
|
1091
1091
|
creditKeyFigures?: CreditKeyFiguresData;
|
|
1092
|
+
/** ADV-405 follow-up (leasing, 19.11): leasing key figures of the current leasing calculation —
|
|
1093
|
+
* see FinanceCalculatorProps.leasingKeyFigures (same values, same rule). Leasing tab only. */
|
|
1094
|
+
leasingKeyFigures?: CreditKeyFiguresData;
|
|
1092
1095
|
/** opens the Finanzierungs-/Leasingdetails popup (expanded); when omitted the link is hidden. */
|
|
1093
1096
|
onShowDetails?: () => void;
|
|
1094
1097
|
/** whether leasing is actually offered for this car — see FinanceCalculatorProps.leasingAvailable
|
|
@@ -1118,6 +1121,7 @@ export const VdpBottomBar: React.FunctionComponent<VdpBottomBarProps> = ({
|
|
|
1118
1121
|
term,
|
|
1119
1122
|
annualMileage,
|
|
1120
1123
|
creditKeyFigures,
|
|
1124
|
+
leasingKeyFigures,
|
|
1121
1125
|
onShowDetails,
|
|
1122
1126
|
leasingAvailable = true,
|
|
1123
1127
|
t,
|
|
@@ -1126,10 +1130,12 @@ export const VdpBottomBar: React.FunctionComponent<VdpBottomBarProps> = ({
|
|
|
1126
1130
|
const isCash = mode === 'cash';
|
|
1127
1131
|
// ADV-405 follow-up: financing shows the key figures instead of the conditions text below —
|
|
1128
1132
|
// only when at least one figure is real (else the old line stays, and the bar its fixed height).
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
//
|
|
1132
|
-
|
|
1133
|
+
const tabKeyFigures = mode === 'fin' ? creditKeyFigures : mode === 'leasing' ? leasingKeyFigures : undefined;
|
|
1134
|
+
const keyFigures = tabKeyFigures && hasCreditKeyFigures(tabKeyFigures) ? tabKeyFigures : undefined;
|
|
1135
|
+
// the bar's height follows whether the CAR has key figures (financing or leasing), not the active
|
|
1136
|
+
// tab, so the tab row (the bar's top edge) does not move under the finger when switching tabs.
|
|
1137
|
+
const tallBar =
|
|
1138
|
+
!!(creditKeyFigures && hasCreditKeyFigures(creditKeyFigures)) || !!(leasingAvailable && leasingKeyFigures && hasCreditKeyFigures(leasingKeyFigures));
|
|
1133
1139
|
const rate = monthly != null ? monthly : vehicle.monthly;
|
|
1134
1140
|
const tierIdx = TIER_LABELS.indexOf(ratingLabel as (typeof TIER_LABELS)[number]);
|
|
1135
1141
|
const evalTier = tierIdx >= 0 ? tierIdx : 1;
|
|
@@ -1349,7 +1355,7 @@ export const VdpBottomBar: React.FunctionComponent<VdpBottomBarProps> = ({
|
|
|
1349
1355
|
details={
|
|
1350
1356
|
onShowDetails && (
|
|
1351
1357
|
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
1352
|
-
{t('autobahn:finance.financingDetails')}
|
|
1358
|
+
{mode === 'leasing' ? t('autobahn:card.price.detailsLink') : t('autobahn:finance.financingDetails')}
|
|
1353
1359
|
</button>
|
|
1354
1360
|
)
|
|
1355
1361
|
}
|