@bytebrand/fe-ui-core-autobahn 1.0.178 → 1.0.179
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/CarCard.tsx +47 -10
- package/cards/CarRow.tsx +5 -1
- package/cards/cardParts.tsx +11 -1
- package/constants/app.ts +11 -1
- package/constants/core.ts +12 -1
- package/data/toAutobahnCar.ts +3 -3
- package/package.json +1 -1
- package/theme/md3.css +6 -3
- package/vehiclesProps/cbdSelectors.ts +6 -2
- package/vehiclesProps/decoratedLightProps.tsx +3 -2
- package/vehiclesProps/decoratedProps.tsx +11 -10
package/cards/CarCard.tsx
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
GalleryActivityPill,
|
|
39
39
|
cardSpec,
|
|
40
40
|
PaymentMode,
|
|
41
|
+
startPaymentMode,
|
|
41
42
|
callDealerSalesPhone,
|
|
42
43
|
DEALER_SALES_PHONE,
|
|
43
44
|
} from './cardParts';
|
|
@@ -98,6 +99,11 @@ export interface CarCardProps {
|
|
|
98
99
|
* (still onOpenRateAdjust).
|
|
99
100
|
*/
|
|
100
101
|
onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Tab the price block opens on (default Finanzierung) — e.g. the SRP's leasing-only results
|
|
104
|
+
* open every card on Leasing. Ignored for a car without a lease rate (it has no Leasing tab).
|
|
105
|
+
*/
|
|
106
|
+
initialMode?: PaymentMode;
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
@@ -113,8 +119,9 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
113
119
|
onCall,
|
|
114
120
|
onOpenRateAdjust,
|
|
115
121
|
onShowFinancingDetails,
|
|
122
|
+
initialMode,
|
|
116
123
|
}) => {
|
|
117
|
-
const [mode, setMode] = useState<PaymentMode>(
|
|
124
|
+
const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
|
|
118
125
|
const [photoIndex, setPhotoIndex] = useState(0);
|
|
119
126
|
const [viewerOpen, setViewerOpen] = useState(false);
|
|
120
127
|
const mediaRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -157,6 +164,8 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
157
164
|
// active that's already 3, so NEU is dropped rather than causing a 4th to overflow.
|
|
158
165
|
const activeDealChips = [showDrop || showSave, showPct, !!car.zeroDown].filter(Boolean).length;
|
|
159
166
|
const showNeu = asGoodAsNew && car.isNew && activeDealChips < 3;
|
|
167
|
+
// tabs the price block can switch to (PriceTabs shows Leasing only when the car has a lease rate)
|
|
168
|
+
const paymentModes: PaymentMode[] = car.lease != null ? ['financing', 'leasing', 'buy'] : ['financing', 'buy'];
|
|
160
169
|
return (
|
|
161
170
|
<article
|
|
162
171
|
className="mcard mcard--interactive cc-card"
|
|
@@ -277,18 +286,46 @@ const CarCard: React.FunctionComponent<CarCardProps> = ({
|
|
|
277
286
|
<div className="cc-price" style={{ marginTop: 0, borderTop: '1px solid var(--md-outline-variant)' }}>
|
|
278
287
|
<PriceTabs car={car} mode={mode} onModeChange={setMode} t={t} />
|
|
279
288
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8, marginTop: 10 }}>
|
|
280
|
-
|
|
289
|
+
{/* every tab's hero stacked in one grid cell (.cc-hero-stack), only the active one
|
|
290
|
+
visible, bottom-aligned — Kaufen's struck list price sits on its own line above
|
|
291
|
+
the price, so without this the row (and the card) grew/shrank by that line on
|
|
292
|
+
every tab switch. Same trick as .cc-terms-stack below. */}
|
|
293
|
+
<div className="cc-hero-stack">
|
|
294
|
+
{paymentModes.map((m) => (
|
|
295
|
+
<div
|
|
296
|
+
key={m}
|
|
297
|
+
className={'cc-hero-slot' + (m === mode ? '' : ' cc-hero-slot--hidden')}
|
|
298
|
+
aria-hidden={m === mode ? undefined : true}
|
|
299
|
+
>
|
|
300
|
+
<PriceHero car={car} mode={m} t={t} alwaysShowUnit />
|
|
301
|
+
</div>
|
|
302
|
+
))}
|
|
303
|
+
</div>
|
|
281
304
|
<PriceEvalCol car={car} t={t} />
|
|
282
305
|
</div>
|
|
283
306
|
{/* same fallback CardCtaRow already uses below: pages that haven't wired a real
|
|
284
|
-
"Rate anpassen" sheet yet still get a working "Details" link (opens the car).
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
307
|
+
"Rate anpassen" sheet yet still get a working "Details" link (opens the car).
|
|
308
|
+
Every tab's terms line is rendered into the same grid cell (.cc-terms-stack) and
|
|
309
|
+
only the active one is visible — the cell is as tall as the tallest line, so the
|
|
310
|
+
card keeps one height across Finanzierung/Leasing/Kaufen (Leasing's longer line
|
|
311
|
+
wraps to 2 lines on narrow phones). No change to the visible line itself. */}
|
|
312
|
+
<div className="cc-terms-stack">
|
|
313
|
+
{paymentModes.map((m) => (
|
|
314
|
+
<div
|
|
315
|
+
key={m}
|
|
316
|
+
className={'cc-terms-slot' + (m === mode ? '' : ' cc-terms-slot--hidden')}
|
|
317
|
+
aria-hidden={m === mode ? undefined : true}
|
|
318
|
+
>
|
|
319
|
+
<PriceTerms
|
|
320
|
+
car={car}
|
|
321
|
+
mode={m}
|
|
322
|
+
onOpenRateAdjust={onOpenRateAdjust || (() => onOpen(car))}
|
|
323
|
+
onShowDetails={onShowFinancingDetails ? () => onShowFinancingDetails(car, m) : undefined}
|
|
324
|
+
t={t}
|
|
325
|
+
/>
|
|
326
|
+
</div>
|
|
327
|
+
))}
|
|
328
|
+
</div>
|
|
292
329
|
</div>
|
|
293
330
|
{/* Mobile-only row (CardCtaRow itself carries the show-mobile class) — always
|
|
294
331
|
rendered, with real fallbacks the page can override once it wires its own
|
package/cards/CarRow.tsx
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
ZeroDownChip,
|
|
42
42
|
fmtKm,
|
|
43
43
|
PaymentMode,
|
|
44
|
+
startPaymentMode,
|
|
44
45
|
ratingTone,
|
|
45
46
|
} from './cardParts';
|
|
46
47
|
import { AutobahnCar } from './types';
|
|
@@ -80,6 +81,8 @@ export interface CarRowProps {
|
|
|
80
81
|
* links render as plain text (see PricePaths' own fallback).
|
|
81
82
|
*/
|
|
82
83
|
onShowFinancingDetails?: (car: AutobahnCar, mode: PaymentMode) => void;
|
|
84
|
+
/** Tab the mobile price tabs open on — see CarCard's identically-named prop. */
|
|
85
|
+
initialMode?: PaymentMode;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
const CarRow: React.FunctionComponent<CarRowProps> = ({
|
|
@@ -92,8 +95,9 @@ const CarRow: React.FunctionComponent<CarRowProps> = ({
|
|
|
92
95
|
t,
|
|
93
96
|
adminAction,
|
|
94
97
|
onShowFinancingDetails,
|
|
98
|
+
initialMode,
|
|
95
99
|
}) => {
|
|
96
|
-
const [mode, setMode] = useState<PaymentMode>(
|
|
100
|
+
const [mode, setMode] = useState<PaymentMode>(() => startPaymentMode(car, initialMode));
|
|
97
101
|
const [photoIndex, setPhotoIndex] = useState(0);
|
|
98
102
|
const mediaRef = useRef<HTMLDivElement | null>(null);
|
|
99
103
|
// always call the LATEST onMediaEnter without re-arming the observer on every render (the
|
package/cards/cardParts.tsx
CHANGED
|
@@ -489,6 +489,11 @@ export const PriceEvalCol: React.FunctionComponent<{ car: AutobahnCar; t: Transl
|
|
|
489
489
|
|
|
490
490
|
export type PaymentMode = 'financing' | 'leasing' | 'buy';
|
|
491
491
|
|
|
492
|
+
/** The tab a card opens on: the requested one (default Finanzierung), but never Leasing for a car
|
|
493
|
+
* without a lease rate — PriceTabs has no Leasing tab for it. */
|
|
494
|
+
export const startPaymentMode = (car: AutobahnCar, requested?: PaymentMode): PaymentMode =>
|
|
495
|
+
requested === 'leasing' && car.lease == null ? 'financing' : requested || 'financing';
|
|
496
|
+
|
|
492
497
|
export interface PriceTabsProps {
|
|
493
498
|
car: AutobahnCar;
|
|
494
499
|
mode: PaymentMode;
|
|
@@ -710,7 +715,12 @@ export const PriceTerms: React.FunctionComponent<{
|
|
|
710
715
|
onShowDetails?: () => void;
|
|
711
716
|
t: TranslationFunction;
|
|
712
717
|
}> = ({ car, mode, onOpenRateAdjust, onShowDetails, t }) => {
|
|
713
|
-
|
|
718
|
+
// Kaufen (buy): a cash purchase has no financing terms/details link — used to `return null`
|
|
719
|
+
// here, which collapsed .cc-terms to 0 height on that tab while Financing/Leasing rendered a
|
|
720
|
+
// real line, jumping the price row (and everything below it: rating pill, CTA row) up/down on
|
|
721
|
+
// every tab switch. Render an empty, still-present .cc-terms div instead — same fix as the VDP
|
|
722
|
+
// FinanceCalculator's .fin-cond (md3.css), which reserves its line's height the same way.
|
|
723
|
+
if (mode === 'buy') return <div className="cc-terms" />;
|
|
714
724
|
const finFirstInstallment =
|
|
715
725
|
car.finFirstInstallment != null ? car.finFirstInstallment.toLocaleString('de-DE') : _finFirstInstallment;
|
|
716
726
|
const finMonths = car.finMonths ?? _finMonths;
|
package/constants/app.ts
CHANGED
|
@@ -40,7 +40,17 @@ export const LOCAL_STORAGE_KEY = {
|
|
|
40
40
|
i18n_KEY: 'i18nLanguage'
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
// ADV-284: evaluated at import time — with site storage blocked, reading localStorage throws a
|
|
44
|
+
// SecurityError that took down the whole bundle. Blocked storage behaves like "nothing saved".
|
|
45
|
+
const readStoredLang = (): string | null => {
|
|
46
|
+
try {
|
|
47
|
+
return localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const DEFAULT_LANG: string = typeof window !== 'undefined' ? readStoredLang() : 'de';
|
|
44
54
|
|
|
45
55
|
// Default support contact phone
|
|
46
56
|
export const CONTACT_PHONE: string = '+498004030182';
|
package/constants/core.ts
CHANGED
|
@@ -35,7 +35,18 @@ export const LOCAL_STORAGE_KEY = {
|
|
|
35
35
|
i18n_KEY: 'i18nLanguage'
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
// ADV-284: evaluated at import time — with site storage blocked, merely reading
|
|
39
|
+
// window.localStorage throws a SecurityError, which took down the whole bundle (landing
|
|
40
|
+
// page never rendered). Treat blocked storage like "no language saved".
|
|
41
|
+
const readStoredLang = (): string | null => {
|
|
42
|
+
try {
|
|
43
|
+
return typeof window !== 'undefined' ? window.localStorage.getItem(LOCAL_STORAGE_KEY.i18n_KEY) : null;
|
|
44
|
+
} catch (e) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const DEFAULT_LANG: string = readStoredLang() ?? 'de';
|
|
39
50
|
|
|
40
51
|
export const ROW_STYLES = {
|
|
41
52
|
marginBottom: 10
|
package/data/toAutobahnCar.ts
CHANGED
|
@@ -103,13 +103,13 @@ function pos(v: any): number | undefined {
|
|
|
103
103
|
return n != null && n > 0 ? n : undefined;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
/**
|
|
107
|
-
const KG_FUELS = ['selector_fuel_naturalGas', '
|
|
106
|
+
/** fuels whose consumption is measured in kg/100 km (cbdConsumptionUnit set); Autogas/LPG is in litres. */
|
|
107
|
+
const KG_FUELS = ['selector_fuel_naturalGas', 'selector_fuel_hydrogen', 'selector_fuel_ethanol'];
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* EnVKV combined-consumption label, fuel-aware. Electric cars consume kWh — their
|
|
111
111
|
* l/100km fields (wltpCombined/consumptionCombined-as-liters) arrive as 0, so the
|
|
112
|
-
* flat `l/100 km` template printed "0 l/100 km" on every EV; gas/hydrogen cars
|
|
112
|
+
* flat `l/100 km` template printed "0 l/100 km" on every EV; natural gas/hydrogen cars
|
|
113
113
|
* measure kg. WLTP figure preferred, else NEDC — same order as before.
|
|
114
114
|
*/
|
|
115
115
|
function consumptionLabel(consumption: any, language?: string): string {
|
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.179",
|
|
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",
|
package/theme/md3.css
CHANGED
|
@@ -10100,7 +10100,8 @@ line-height: 31px;
|
|
|
10100
10100
|
z-index: 71;
|
|
10101
10101
|
background: var(--md-surface);
|
|
10102
10102
|
border-radius: var(--md-r-xl) var(--md-r-xl) 0 0;
|
|
10103
|
-
|
|
10103
|
+
/* % of the fixed containing block, not vh/dvh: on iOS vh is the toolbars-collapsed height, and Chrome on iOS does not shrink dvh while its toolbars are shown either, so a 92vh/92dvh bottom sheet grew under the address bar and hid its own header (title, download, close). The fixed box itself always matches the visible area. */
|
|
10104
|
+
max-height: 92%;
|
|
10104
10105
|
display: flex;
|
|
10105
10106
|
flex-direction: column;
|
|
10106
10107
|
box-shadow: 0 -8px 30px rgba(16, 22, 42, 0.22);
|
|
@@ -14258,7 +14259,8 @@ color: #005CFF;
|
|
|
14258
14259
|
flex-direction: column;
|
|
14259
14260
|
width: 100%;
|
|
14260
14261
|
max-width: 560px;
|
|
14261
|
-
|
|
14262
|
+
/* % of the scrim (fixed, inset 0, 16px padding) instead of calc(100vh - 32px): see the iOS note on the mobile .mmodal below */
|
|
14263
|
+
max-height: 100%;
|
|
14262
14264
|
background: var(--md-sc-lowest, #fff);
|
|
14263
14265
|
color: var(--md-on-surface);
|
|
14264
14266
|
border-radius: var(--md-r-lg);
|
|
@@ -14404,7 +14406,8 @@ color: #005CFF;
|
|
|
14404
14406
|
}
|
|
14405
14407
|
.md3 .mmodal {
|
|
14406
14408
|
max-width: 100%;
|
|
14407
|
-
|
|
14409
|
+
/* % of the fixed containing block, not vh/dvh: on iOS vh is the toolbars-collapsed height, and Chrome on iOS does not shrink dvh while its toolbars are shown either, so a 92vh/92dvh bottom sheet grew under the address bar and hid its own header (title, download, close). The fixed box itself always matches the visible area. */
|
|
14410
|
+
max-height: 92%;
|
|
14408
14411
|
border-radius: var(--md-r-lg) var(--md-r-lg) 0 0;
|
|
14409
14412
|
border-bottom: 0;
|
|
14410
14413
|
animation: mmodal-sheet-up 0.25s ease-out;
|
|
@@ -48,6 +48,10 @@ export const cbdFuel = (key: string) => {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
/** The consumptionGas* and wltp*Gas props are shared: Autogas/LPG is in litres, natural gas and hydrogen in kg. */
|
|
52
|
+
export const gasConsumptionTemplate = (fuel?: string) =>
|
|
53
|
+
fuel === 'selector_fuel_carGas' ? 'vehicleProps:value.consumption' : 'vehicleProps:value.consumptionGas';
|
|
54
|
+
|
|
51
55
|
export const cbdConsumptionUnit = (key: string) => {
|
|
52
56
|
switch (key) {
|
|
53
57
|
case 'selector_fuel_petrol':
|
|
@@ -60,7 +64,7 @@ export const cbdConsumptionUnit = (key: string) => {
|
|
|
60
64
|
return 'kg/100km';
|
|
61
65
|
break;
|
|
62
66
|
case 'selector_fuel_carGas':
|
|
63
|
-
return '
|
|
67
|
+
return 'l/100km';
|
|
64
68
|
break;
|
|
65
69
|
case 'selector_fuel_electrical':
|
|
66
70
|
return 'kWh/100km';
|
|
@@ -94,7 +98,7 @@ export const cbdConsumptionUnitWithKomb = (key: string) => {
|
|
|
94
98
|
return 'kg/100km (komb)*';
|
|
95
99
|
break;
|
|
96
100
|
case 'selector_fuel_carGas':
|
|
97
|
-
return '
|
|
101
|
+
return 'l/100km (komb)*';
|
|
98
102
|
break;
|
|
99
103
|
case 'selector_fuel_electrical':
|
|
100
104
|
return 'kWh/100km (komb)*';
|
|
@@ -7,6 +7,7 @@ import { DELIVERY_PERIODS_EXTRA } from '../constants/core';
|
|
|
7
7
|
import moment from 'moment';
|
|
8
8
|
import { IDecoratedProp } from '../types/types';
|
|
9
9
|
import { strictAccidentStatus } from './accidentDisclosure';
|
|
10
|
+
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
10
11
|
|
|
11
12
|
interface IDecoratedProps {
|
|
12
13
|
[key: string]: IDecoratedProp;
|
|
@@ -430,7 +431,7 @@ const getDecoratedLightProps = (
|
|
|
430
431
|
: null;
|
|
431
432
|
|
|
432
433
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
433
|
-
? t(
|
|
434
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
434
435
|
: t('vehicleProps:value.na');
|
|
435
436
|
|
|
436
437
|
const co2Value = Number.isFinite(co2)
|
|
@@ -438,7 +439,7 @@ const getDecoratedLightProps = (
|
|
|
438
439
|
: t('vehicleProps:value.na');
|
|
439
440
|
|
|
440
441
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
441
|
-
? t(
|
|
442
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
442
443
|
: null;
|
|
443
444
|
|
|
444
445
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
@@ -10,6 +10,7 @@ import { DELIVERY_PERIODS_EXTRA } from '../constants';
|
|
|
10
10
|
import { IDecoratedProp, ICar, IFinancingUtils } from '../types/types';
|
|
11
11
|
import { getFormattedPrice } from '../utils/CommonUtils';
|
|
12
12
|
import { strictAccidentStatus } from './accidentDisclosure';
|
|
13
|
+
import { gasConsumptionTemplate } from './cbdSelectors';
|
|
13
14
|
|
|
14
15
|
const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
|
|
15
16
|
const count: number = +DELIVERY_PERIODS_EXTRA.find((period: any) => period.value === deliveryPeriod).label;
|
|
@@ -538,7 +539,7 @@ const getDecoratedProps = (
|
|
|
538
539
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
539
540
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
540
541
|
return Number.isFinite(consumptionGasInner)
|
|
541
|
-
? t(
|
|
542
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: consumptionGasInner.toLocaleString(language), unit: translatedUnit })
|
|
542
543
|
: t('vehicleProps:value.na');
|
|
543
544
|
}
|
|
544
545
|
},
|
|
@@ -603,7 +604,7 @@ const getDecoratedProps = (
|
|
|
603
604
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
604
605
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
605
606
|
return Number.isFinite(consumptionGasOuter)
|
|
606
|
-
? t(
|
|
607
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: consumptionGasOuter.toLocaleString(language), unit: translatedUnit })
|
|
607
608
|
: t('vehicleProps:value.na');
|
|
608
609
|
}
|
|
609
610
|
},
|
|
@@ -668,7 +669,7 @@ const getDecoratedProps = (
|
|
|
668
669
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
669
670
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
670
671
|
return Number.isFinite(consumptionGasCombined)
|
|
671
|
-
? t(
|
|
672
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
672
673
|
: t('vehicleProps:value.na');
|
|
673
674
|
}
|
|
674
675
|
},
|
|
@@ -804,7 +805,7 @@ const getDecoratedProps = (
|
|
|
804
805
|
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
805
806
|
|
|
806
807
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
807
|
-
? t(
|
|
808
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
808
809
|
: t('vehicleProps:value.na');
|
|
809
810
|
|
|
810
811
|
const co2Value = Number.isFinite(co2)
|
|
@@ -812,7 +813,7 @@ const getDecoratedProps = (
|
|
|
812
813
|
: t('vehicleProps:value.na');
|
|
813
814
|
|
|
814
815
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
815
|
-
? t(
|
|
816
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
816
817
|
: null;
|
|
817
818
|
|
|
818
819
|
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
@@ -1340,7 +1341,7 @@ const getDecoratedProps = (
|
|
|
1340
1341
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1341
1342
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1342
1343
|
return Number.isFinite(wltpCombined)
|
|
1343
|
-
? t(
|
|
1344
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1344
1345
|
: t('vehicleProps:value.na');
|
|
1345
1346
|
}
|
|
1346
1347
|
},
|
|
@@ -1373,7 +1374,7 @@ const getDecoratedProps = (
|
|
|
1373
1374
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1374
1375
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1375
1376
|
return Number.isFinite(wltpSlow)
|
|
1376
|
-
? t(
|
|
1377
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1377
1378
|
: t('vehicleProps:value.na');
|
|
1378
1379
|
}
|
|
1379
1380
|
},
|
|
@@ -1406,7 +1407,7 @@ const getDecoratedProps = (
|
|
|
1406
1407
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1407
1408
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1408
1409
|
return Number.isFinite(wltpMedium)
|
|
1409
|
-
? t(
|
|
1410
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1410
1411
|
: t('vehicleProps:value.na');
|
|
1411
1412
|
}
|
|
1412
1413
|
},
|
|
@@ -1439,7 +1440,7 @@ const getDecoratedProps = (
|
|
|
1439
1440
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1440
1441
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1441
1442
|
return Number.isFinite(wltpFast)
|
|
1442
|
-
? t(
|
|
1443
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1443
1444
|
: t('vehicleProps:value.na');
|
|
1444
1445
|
}
|
|
1445
1446
|
},
|
|
@@ -1472,7 +1473,7 @@ const getDecoratedProps = (
|
|
|
1472
1473
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1473
1474
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1474
1475
|
return Number.isFinite(wltpVeryFast)
|
|
1475
|
-
? t(
|
|
1476
|
+
? t(gasConsumptionTemplate(car.consumption.fuel), { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1476
1477
|
: t('vehicleProps:value.na');
|
|
1477
1478
|
}
|
|
1478
1479
|
},
|