@bytebrand/fe-ui-core 4.4.1 → 4.5.2
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 +1 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +6 -4
- package/source/components/_common/Co2Widget/CO2Efficiency.styl +70 -4
- package/source/components/_common/Co2Widget/CO2Efficiency.tsx +27 -5
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +79 -0
- package/source/framework/vehiclesProps/decoratedProps.tsx +367 -1
- package/source/framework/vehiclesProps/vehicleDetails.ts +98 -0
- package/source/locales/data.ts +26 -1
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import { Visible } from 'react-grid-system';
|
|
|
4
4
|
import _get from 'lodash/get';
|
|
5
5
|
|
|
6
6
|
import { getPowerLabel } from '../../framework/vehiclesProps/decoratedProps';
|
|
7
|
-
import { getVehicleDetails, getOverviewDetails, dimensionDetails, availAbilityDetails, colorAndMaterialDetails } from '../../framework/vehiclesProps/vehicleDetails';
|
|
7
|
+
import { getVehicleDetails, getOverviewDetails, dimensionDetails, availAbilityDetails, colorAndMaterialDetails, getWltpValues } from '../../framework/vehiclesProps/vehicleDetails';
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
IEquipmentProps,
|
|
@@ -64,11 +64,11 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
|
|
|
64
64
|
{propsList.map((prop, i) => {
|
|
65
65
|
const { title, subTitle, value, isVisible = true, isLongTitle = false } = decoratedProps[prop];
|
|
66
66
|
return isVisible && (
|
|
67
|
-
<div key={i} className={styles.tr}>
|
|
68
|
-
<div className={classnames(styles.th, isLongTitle ? styles.longTitle : '')}>
|
|
67
|
+
<div key={i} className={title ? styles.tr : ''}>
|
|
68
|
+
{title && <div className={classnames(styles.th, isLongTitle ? styles.longTitle : '')}>
|
|
69
69
|
<span className={styles.title}>{title}</span>
|
|
70
70
|
{subTitle ? <p className={styles.subTitle}>{subTitle}</p> : null}
|
|
71
|
-
</div>
|
|
71
|
+
</div>}
|
|
72
72
|
<div className={styles.td}>{value}</div>
|
|
73
73
|
</div>
|
|
74
74
|
);
|
|
@@ -136,6 +136,7 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
|
|
|
136
136
|
const { t, car: { consumption, engineData }, decoratedProps, carEquipment } = this.props;
|
|
137
137
|
const engineProps = getVehicleDetails(consumption.fuel, 'engineData', engineData.hybridPlugin);
|
|
138
138
|
const environmentProps = getVehicleDetails(consumption.fuel, 'environment', engineData.hybridPlugin);
|
|
139
|
+
const wltpProps = getWltpValues(consumption.fuel, engineData.hybridPlugin);
|
|
139
140
|
const dimensionProps = dimensionDetails;
|
|
140
141
|
const availAbilityProps = availAbilityDetails;
|
|
141
142
|
const colorAndMaterialProps = colorAndMaterialDetails;
|
|
@@ -144,6 +145,7 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
|
|
|
144
145
|
<div className={styles.wrapGrid}>
|
|
145
146
|
{this.renderTable(decoratedProps, engineProps, t('accordion.tableEngine'))}
|
|
146
147
|
{this.renderTable(decoratedProps, dimensionProps, t('accordion.tableDimensions'))}
|
|
148
|
+
{this.renderTable(decoratedProps, wltpProps, t('accordion.tableEnvironmentWLTP'))}
|
|
147
149
|
{this.renderTable(decoratedProps, environmentProps, t('accordion.tableEnvironment'))}
|
|
148
150
|
{this.renderTable(decoratedProps, availAbilityProps, t('accordion.tableAvailability'))}
|
|
149
151
|
{this.renderTable(decoratedProps, colorAndMaterialProps, t('accordion.tableMaterial'))}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.classContainer
|
|
18
18
|
position: relative
|
|
19
19
|
width 100%
|
|
20
|
-
height
|
|
20
|
+
height 14px
|
|
21
21
|
|
|
22
22
|
.classContainer:not(:last-child)
|
|
23
23
|
margin-bottom: 3px
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.class
|
|
26
26
|
position: relative
|
|
27
27
|
display: block
|
|
28
|
-
height
|
|
28
|
+
height 14px
|
|
29
29
|
color white
|
|
30
30
|
font-size 7px
|
|
31
31
|
line-height 10px
|
|
@@ -41,9 +41,28 @@
|
|
|
41
41
|
width 0
|
|
42
42
|
height 0
|
|
43
43
|
border-style solid
|
|
44
|
-
border-width
|
|
44
|
+
border-width 8px 0 5px 5px
|
|
45
45
|
border-color transparent
|
|
46
46
|
|
|
47
|
+
.title
|
|
48
|
+
font-size: 15px
|
|
49
|
+
font-weight: 700
|
|
50
|
+
color: #000000DE
|
|
51
|
+
|
|
52
|
+
.subTitle
|
|
53
|
+
font-size: 12px
|
|
54
|
+
margin: 5px 0 24px
|
|
55
|
+
font-weight: 400
|
|
56
|
+
color: #000000DE
|
|
57
|
+
|
|
58
|
+
.divider
|
|
59
|
+
position: absolute
|
|
60
|
+
width: 1px
|
|
61
|
+
background-color: black
|
|
62
|
+
top: 0
|
|
63
|
+
left: 161px
|
|
64
|
+
height: 127px
|
|
65
|
+
|
|
47
66
|
.activeClass
|
|
48
67
|
@extends .class
|
|
49
68
|
position: absolute
|
|
@@ -51,6 +70,8 @@
|
|
|
51
70
|
right -20px
|
|
52
71
|
padding 0 5px
|
|
53
72
|
background-color $grey-3
|
|
73
|
+
display: flex
|
|
74
|
+
align-items: center
|
|
54
75
|
.activeClass::before
|
|
55
76
|
content ''
|
|
56
77
|
position absolute
|
|
@@ -59,9 +80,54 @@
|
|
|
59
80
|
width 0
|
|
60
81
|
height 0
|
|
61
82
|
border-style solid
|
|
62
|
-
border-width
|
|
83
|
+
border-width 7px 5px 6px 0
|
|
63
84
|
border-color transparent $grey-3 transparent transparent
|
|
64
85
|
|
|
86
|
+
.secondActiveClass
|
|
87
|
+
@extends .class
|
|
88
|
+
position: absolute
|
|
89
|
+
top: 0
|
|
90
|
+
right -60px
|
|
91
|
+
padding 0 5px
|
|
92
|
+
background-color $grey-3
|
|
93
|
+
display: flex
|
|
94
|
+
align-items: center
|
|
95
|
+
.secondActiveClass::before
|
|
96
|
+
content ''
|
|
97
|
+
position absolute
|
|
98
|
+
top 0
|
|
99
|
+
left -5px
|
|
100
|
+
width 0
|
|
101
|
+
height 0
|
|
102
|
+
border-style solid
|
|
103
|
+
border-width 7px 5px 6px 0
|
|
104
|
+
border-color transparent $grey-3 transparent transparent
|
|
105
|
+
|
|
106
|
+
.levelsContainer
|
|
107
|
+
position relative
|
|
108
|
+
|
|
109
|
+
.container
|
|
110
|
+
position relative
|
|
111
|
+
|
|
112
|
+
.levelTitle
|
|
113
|
+
top: -21px;
|
|
114
|
+
left: 78px;
|
|
115
|
+
position: absolute;
|
|
116
|
+
width: 74px;
|
|
117
|
+
font-size: 9px;
|
|
118
|
+
text-align: right;
|
|
119
|
+
|
|
120
|
+
.wltpLevelTitle
|
|
121
|
+
width: 80px;
|
|
122
|
+
top: -21px
|
|
123
|
+
left: 172px
|
|
124
|
+
position: absolute
|
|
125
|
+
font-size: 9px
|
|
126
|
+
|
|
127
|
+
.wltpLevelsContainer
|
|
128
|
+
padding: 13.5px 7.5px
|
|
129
|
+
border-top: 1px solid #e8e8e8;
|
|
130
|
+
|
|
65
131
|
:global
|
|
66
132
|
.auto_de_selector_energyEfficiencyClass_appp
|
|
67
133
|
background-color: #1D9453
|
|
@@ -6,8 +6,14 @@ import styles from './CO2Efficiency.styl';
|
|
|
6
6
|
|
|
7
7
|
interface ICO2EfficiencyProps {
|
|
8
8
|
level: string;
|
|
9
|
+
wltpLevel?: string;
|
|
9
10
|
className?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
subTitle?: string;
|
|
10
13
|
t?: (key: string, options?: object) => string;
|
|
14
|
+
levelTitle?: string;
|
|
15
|
+
wltpLevelTitle?: string;
|
|
16
|
+
hybridPlugin?: boolean;
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
// TODO: pass efficiency classes as a list into props.
|
|
@@ -18,11 +24,12 @@ class CO2Efficiency extends React.Component<ICO2EfficiencyProps> {
|
|
|
18
24
|
};
|
|
19
25
|
|
|
20
26
|
renderLevels = () => {
|
|
21
|
-
const { level, t } = this.props;
|
|
27
|
+
const { level, wltpLevel, t, hybridPlugin } = this.props;
|
|
22
28
|
|
|
23
29
|
return selectors.energyEfficiencyClass.map((key: string, i: number) => {
|
|
24
30
|
const width: string = `${(i + 1) * 10 + 10}px`; // tslint:disable-line
|
|
25
31
|
const isActive: boolean = key === level;
|
|
32
|
+
const isWltpActive: boolean = key === wltpLevel;
|
|
26
33
|
const className: string = classnames(styles.class, `auto_de_${key}`);
|
|
27
34
|
const translatedKey: string = t(`cbd:${key}`);
|
|
28
35
|
|
|
@@ -32,15 +39,30 @@ class CO2Efficiency extends React.Component<ICO2EfficiencyProps> {
|
|
|
32
39
|
{translatedKey}
|
|
33
40
|
</span>
|
|
34
41
|
{isActive && <span className={styles.activeClass}>{translatedKey}</span>}
|
|
42
|
+
{isWltpActive && hybridPlugin && <span className={styles.secondActiveClass}>{translatedKey}</span>}
|
|
35
43
|
</div>
|
|
36
44
|
) : false;
|
|
37
|
-
})
|
|
38
|
-
};
|
|
45
|
+
})}
|
|
39
46
|
|
|
40
47
|
render(): JSX.Element {
|
|
48
|
+
const { title, subTitle, wltpLevel, levelTitle, wltpLevelTitle, hybridPlugin } = this.props;
|
|
49
|
+
const wltpLevelsContainerClassNames = classnames(
|
|
50
|
+
{ [styles.wltpLevelsContainer]: wltpLevel }
|
|
51
|
+
)
|
|
41
52
|
return (
|
|
42
|
-
<div className={
|
|
43
|
-
{
|
|
53
|
+
<div className={wltpLevelsContainerClassNames}>
|
|
54
|
+
{wltpLevel && <div className={styles.title}>{title}</div>}
|
|
55
|
+
{wltpLevel && <div className={styles.subTitle}>{subTitle}</div>}
|
|
56
|
+
<div className={styles.container}>
|
|
57
|
+
{wltpLevel && hybridPlugin && <div className={styles.levelTitle}>{levelTitle}</div>}
|
|
58
|
+
{wltpLevel && hybridPlugin && <div className={styles.wltpLevelTitle}>{wltpLevelTitle}</div>}
|
|
59
|
+
</div>
|
|
60
|
+
<div className={styles.levelsContainer}>
|
|
61
|
+
<div className={styles.co2Efficiency}>
|
|
62
|
+
{this.renderLevels()}
|
|
63
|
+
</div>
|
|
64
|
+
{wltpLevel && hybridPlugin && <div className={styles.divider}></div>}
|
|
65
|
+
</div>
|
|
44
66
|
</div>
|
|
45
67
|
);
|
|
46
68
|
}
|
|
@@ -115,9 +115,19 @@ const getDecoratedLightProps = (
|
|
|
115
115
|
const consumptionCombined = car.consumption.consumptionCombined;
|
|
116
116
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
117
117
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
118
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
119
|
+
const wltpCo2 = car.consumption.wltpCo2;
|
|
118
120
|
|
|
119
121
|
const co2 = car.environmentEmissions.co2;
|
|
120
122
|
|
|
123
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
124
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
125
|
+
: null;
|
|
126
|
+
|
|
127
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
128
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
129
|
+
: null;
|
|
130
|
+
|
|
121
131
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
122
132
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
123
133
|
: t('vehicleProps:value.na');
|
|
@@ -126,6 +136,10 @@ const getDecoratedLightProps = (
|
|
|
126
136
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
127
137
|
: t('vehicleProps:value.na');
|
|
128
138
|
|
|
139
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
140
|
+
return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
|
|
141
|
+
}
|
|
142
|
+
|
|
129
143
|
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
130
144
|
}
|
|
131
145
|
},
|
|
@@ -138,6 +152,16 @@ const getDecoratedLightProps = (
|
|
|
138
152
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
139
153
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
140
154
|
const co2 = car.environmentEmissions.co2;
|
|
155
|
+
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
156
|
+
const wltpCo2 = car.consumption.wltpCo2;
|
|
157
|
+
|
|
158
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
159
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
160
|
+
: null;
|
|
161
|
+
|
|
162
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
163
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
164
|
+
: null;
|
|
141
165
|
|
|
142
166
|
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
143
167
|
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -147,6 +171,10 @@ const getDecoratedLightProps = (
|
|
|
147
171
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
148
172
|
: t('vehicleProps:value.na');
|
|
149
173
|
|
|
174
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
175
|
+
return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
|
|
176
|
+
}
|
|
177
|
+
|
|
150
178
|
return <>{consumptionValue} <br /> {co2Value} </>;
|
|
151
179
|
}
|
|
152
180
|
},
|
|
@@ -157,17 +185,41 @@ const getDecoratedLightProps = (
|
|
|
157
185
|
get value() {
|
|
158
186
|
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
159
187
|
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
188
|
+
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
189
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
160
190
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
161
191
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
162
192
|
|
|
163
193
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
164
194
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
165
195
|
|
|
196
|
+
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
197
|
+
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
198
|
+
: null;
|
|
199
|
+
const wltpConsumptionCombinedContent = wltpConsumptionCombined ?
|
|
200
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
201
|
+
: null;
|
|
202
|
+
|
|
166
203
|
const co2 = car.environmentEmissions.co2;
|
|
204
|
+
const wltpCo2 = car.consumption.wltpCo2;
|
|
205
|
+
|
|
167
206
|
const co2Value = Number.isFinite(co2)
|
|
168
207
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
169
208
|
: t('vehicleProps:value.na');
|
|
170
209
|
|
|
210
|
+
const wltpCo2Value = Number.isFinite(co2)
|
|
211
|
+
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
212
|
+
: null;
|
|
213
|
+
|
|
214
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
215
|
+
|
|
216
|
+
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
217
|
+
return <React.Fragment>
|
|
218
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? `${wltpConsumptionPowerCombinedContent} - ` : ''}
|
|
219
|
+
{wltpConsumptionCombinedContent}, {wltpCo2Value}
|
|
220
|
+
</React.Fragment>
|
|
221
|
+
}
|
|
222
|
+
|
|
171
223
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
172
224
|
? <React.Fragment>
|
|
173
225
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
|
|
@@ -185,6 +237,8 @@ const getDecoratedLightProps = (
|
|
|
185
237
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
186
238
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
187
239
|
const co2 = car.environmentEmissions.co2;
|
|
240
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
241
|
+
const wltpCo2 = car.consumption.wltpCo2;
|
|
188
242
|
|
|
189
243
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
190
244
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -194,6 +248,17 @@ const getDecoratedLightProps = (
|
|
|
194
248
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
195
249
|
: t('vehicleProps:value.na');
|
|
196
250
|
|
|
251
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
252
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
253
|
+
: null;
|
|
254
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
255
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
256
|
+
: null;
|
|
257
|
+
|
|
258
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
259
|
+
return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
|
|
260
|
+
}
|
|
261
|
+
|
|
197
262
|
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
198
263
|
}
|
|
199
264
|
},
|
|
@@ -206,6 +271,8 @@ const getDecoratedLightProps = (
|
|
|
206
271
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
207
272
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
208
273
|
const co2 = car.environmentEmissions.co2;
|
|
274
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
275
|
+
const wltpCo2 = car.consumption.wltpCo2;
|
|
209
276
|
|
|
210
277
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
211
278
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -215,6 +282,18 @@ const getDecoratedLightProps = (
|
|
|
215
282
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
216
283
|
: t('vehicleProps:value.na');
|
|
217
284
|
|
|
285
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
286
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
287
|
+
: null;
|
|
288
|
+
|
|
289
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
290
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
291
|
+
: null;
|
|
292
|
+
|
|
293
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
294
|
+
return <>{wltpConsumptionValue} - {wltpCo2Value}</>;
|
|
295
|
+
}
|
|
296
|
+
|
|
218
297
|
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
219
298
|
}
|
|
220
299
|
},
|
|
@@ -609,9 +609,10 @@ const getDecoratedProps = (
|
|
|
609
609
|
icon: 'fuelConsumption',
|
|
610
610
|
title: t('vehicleProps:title.сonsumptionCombined'),
|
|
611
611
|
get value() {
|
|
612
|
-
const consumptionCombined = car.consumption.consumptionCombined;
|
|
612
|
+
const consumptionCombined = car.consumption.wltpCombined || car.consumption.consumptionCombined;
|
|
613
613
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
614
614
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
615
|
+
console.log('qqqqq consumptionCombined =====', t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit }));
|
|
615
616
|
return Number.isFinite(consumptionCombined)
|
|
616
617
|
? t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
617
618
|
: t('vehicleProps:value.na');
|
|
@@ -676,9 +677,19 @@ const getDecoratedProps = (
|
|
|
676
677
|
const consumptionCombined = car.consumption.consumptionCombined;
|
|
677
678
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
678
679
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
680
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
681
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
679
682
|
|
|
680
683
|
const co2 = car.environmentEmissions.co2;
|
|
681
684
|
|
|
685
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
686
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
687
|
+
: null;
|
|
688
|
+
|
|
689
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
690
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
691
|
+
: null;
|
|
692
|
+
|
|
682
693
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
683
694
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
684
695
|
: t('vehicleProps:value.na');
|
|
@@ -687,6 +698,10 @@ const getDecoratedProps = (
|
|
|
687
698
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
688
699
|
: t('vehicleProps:value.na');
|
|
689
700
|
|
|
701
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
702
|
+
return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
|
|
703
|
+
}
|
|
704
|
+
|
|
690
705
|
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
691
706
|
}
|
|
692
707
|
},
|
|
@@ -698,6 +713,16 @@ const getDecoratedProps = (
|
|
|
698
713
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
699
714
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
700
715
|
const co2 = car.environmentEmissions.co2;
|
|
716
|
+
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
717
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
718
|
+
|
|
719
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
720
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
721
|
+
: null;
|
|
722
|
+
|
|
723
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
724
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
725
|
+
: null;
|
|
701
726
|
|
|
702
727
|
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
703
728
|
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -707,6 +732,10 @@ const getDecoratedProps = (
|
|
|
707
732
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
708
733
|
: t('vehicleProps:value.na');
|
|
709
734
|
|
|
735
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
736
|
+
return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
|
|
737
|
+
}
|
|
738
|
+
|
|
710
739
|
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
711
740
|
}
|
|
712
741
|
},
|
|
@@ -715,18 +744,32 @@ const getDecoratedProps = (
|
|
|
715
744
|
title: t('vehicleProps:title.consumptionHydrogenCombined'),
|
|
716
745
|
get value() {
|
|
717
746
|
const consumptionHydrogenCombined = car.consumption.consumptionCombined;
|
|
747
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
718
748
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
719
749
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
720
750
|
const co2 = car.environmentEmissions.co2;
|
|
751
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
721
752
|
|
|
722
753
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
723
754
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
724
755
|
: t('vehicleProps:value.na');
|
|
725
756
|
|
|
757
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
758
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
759
|
+
: null;
|
|
760
|
+
|
|
726
761
|
const co2Value = Number.isFinite(co2)
|
|
727
762
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
728
763
|
: t('vehicleProps:value.na');
|
|
729
764
|
|
|
765
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
766
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
767
|
+
: null;
|
|
768
|
+
|
|
769
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
770
|
+
return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
|
|
771
|
+
}
|
|
772
|
+
|
|
730
773
|
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
731
774
|
}
|
|
732
775
|
},
|
|
@@ -735,10 +778,12 @@ const getDecoratedProps = (
|
|
|
735
778
|
title: t('vehicleProps:title.consumptionGasCombined'),
|
|
736
779
|
get value() {
|
|
737
780
|
const consumptionGasCombined = car.consumption.consumptionCombined;
|
|
781
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
738
782
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
739
783
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
740
784
|
|
|
741
785
|
const co2 = car.environmentEmissions.co2;
|
|
786
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
742
787
|
|
|
743
788
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
744
789
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -748,6 +793,18 @@ const getDecoratedProps = (
|
|
|
748
793
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
749
794
|
: t('vehicleProps:value.na');
|
|
750
795
|
|
|
796
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
797
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
798
|
+
: null;
|
|
799
|
+
|
|
800
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
801
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
802
|
+
: null;
|
|
803
|
+
|
|
804
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
805
|
+
return <>{wrapValue(wltpConsumptionValue)} - {wrapValue(wltpCo2Value)}</>;
|
|
806
|
+
}
|
|
807
|
+
|
|
751
808
|
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
752
809
|
}
|
|
753
810
|
},
|
|
@@ -757,17 +814,40 @@ const getDecoratedProps = (
|
|
|
757
814
|
get value() {
|
|
758
815
|
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
759
816
|
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
817
|
+
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
818
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
819
|
+
|
|
760
820
|
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
761
821
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
762
822
|
|
|
763
823
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
824
|
+
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
825
|
+
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
826
|
+
: null;
|
|
764
827
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
828
|
+
const wltpConsumptionCombinedContent = wltpConsumptionCombined ?
|
|
829
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
830
|
+
: null;
|
|
765
831
|
|
|
766
832
|
const co2 = car.environmentEmissions.co2;
|
|
833
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
767
834
|
const co2Value = Number.isFinite(co2)
|
|
768
835
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
769
836
|
: t('vehicleProps:value.na');
|
|
837
|
+
const wltpCo2Value = Number.isFinite(co2)
|
|
838
|
+
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
839
|
+
: null;
|
|
770
840
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
841
|
+
|
|
842
|
+
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
843
|
+
return <React.Fragment>
|
|
844
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? wrapValue(wltpConsumptionPowerCombinedContent) : ''}
|
|
845
|
+
{wltpConsumptionPowerCombinedContent && hybridPlugin ? <br /> : ''}
|
|
846
|
+
{wrapValue(wltpConsumptionCombinedContent)} <br />
|
|
847
|
+
{wrapValue(wltpCo2Value)}
|
|
848
|
+
</React.Fragment>
|
|
849
|
+
}
|
|
850
|
+
|
|
771
851
|
return Number.isFinite(consumptionCombined) && Number.isFinite(consumptionPowerCombined)
|
|
772
852
|
? <React.Fragment>
|
|
773
853
|
{consumptionPowerCombined && hybridPlugin ? wrapValue(consumptionPowerCombinedContent) : ''}
|
|
@@ -1048,6 +1128,292 @@ const getDecoratedProps = (
|
|
|
1048
1128
|
return t('vehicleProps:value.countryVersionName', { countryName });
|
|
1049
1129
|
}
|
|
1050
1130
|
}
|
|
1131
|
+
},
|
|
1132
|
+
wltpCo2: {
|
|
1133
|
+
title: t('vehicleProps:title.wltpCo2'),
|
|
1134
|
+
get value() {
|
|
1135
|
+
const c02 = car.environmentEmissions.wltpCo2;
|
|
1136
|
+
return Number.isFinite(c02)
|
|
1137
|
+
? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
|
|
1138
|
+
: t('vehicleProps:value.na');
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
wltpCo2Discharged: {
|
|
1142
|
+
title: t('vehicleProps:title.wltpCo2Discharged'),
|
|
1143
|
+
get value() {
|
|
1144
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1145
|
+
return Number.isFinite(wltpCo2)
|
|
1146
|
+
? t('vehicleProps:value.co2', { co2: wltpCo2.toLocaleString(language) })
|
|
1147
|
+
: t('vehicleProps:value.na');
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
wltpEnergyEfficiencyClass: {
|
|
1151
|
+
// title: t('vehicleProps:title.wltpEnergyEfficiencyClass'),
|
|
1152
|
+
// subTitle: t('vehicleProps:title.subTitle'),
|
|
1153
|
+
get value() {
|
|
1154
|
+
const level = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
1155
|
+
const wltpLevel = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1156
|
+
const { hybridPlugin } = car.engineData;
|
|
1157
|
+
const subtitle = hybridPlugin ? t('vehicleProps:title.wltpCO2SubTitle') : t('vehicleProps:title.wltpCO2SubTitleComb');
|
|
1158
|
+
return isPropDefined(level) ?
|
|
1159
|
+
<CO2Efficiency
|
|
1160
|
+
title={t('vehicleProps:title.wltpCO2Title')}
|
|
1161
|
+
subTitle={subtitle}
|
|
1162
|
+
wltpLevel={wltpLevel}
|
|
1163
|
+
level={level}
|
|
1164
|
+
t={t}
|
|
1165
|
+
levelTitle={t('vehicleProps:title.wltpCO2WidgetComb')}
|
|
1166
|
+
wltpLevelTitle={t('vehicleProps:title.wltpCO2WidgetDischargedBattery')}
|
|
1167
|
+
hybridPlugin={hybridPlugin}
|
|
1168
|
+
/> : t('vehicleProps:value.na');
|
|
1169
|
+
}
|
|
1170
|
+
},
|
|
1171
|
+
wltpDischargedEnergyEfficiencyClass: {
|
|
1172
|
+
title: t('vehicleProps:title.wltpDischargedEnergyEfficiencyClass'),
|
|
1173
|
+
subTitle: t('vehicleProps:title.subTitle'),
|
|
1174
|
+
get value() {
|
|
1175
|
+
const level = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1176
|
+
return isPropDefined(level) ? <CO2Efficiency level={level} t={t} /> : t('vehicleProps:value.na');
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
wltpRange: {
|
|
1180
|
+
title: t('vehicleProps:title.wltpRange'),
|
|
1181
|
+
get value() {
|
|
1182
|
+
const wltpRange = car.battery && car.battery.wltpRange;
|
|
1183
|
+
return Number.isFinite(wltpRange)
|
|
1184
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRange.toLocaleString(language) })
|
|
1185
|
+
: t('vehicleProps:value.na');
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
wltpTotalRange: {
|
|
1189
|
+
title: t('vehicleProps:title.wltpTotalRange'),
|
|
1190
|
+
get value() {
|
|
1191
|
+
const wltpTotalRange = car.battery && car.battery.wltpTotalRange;
|
|
1192
|
+
return Number.isFinite(wltpTotalRange)
|
|
1193
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRange.toLocaleString(language) })
|
|
1194
|
+
: t('vehicleProps:value.na');
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
|
|
1198
|
+
wltpRangeCity: {
|
|
1199
|
+
title: t('vehicleProps:title.wltpRangeCity'),
|
|
1200
|
+
get value() {
|
|
1201
|
+
const wltpRangeCity = car.battery && car.battery.wltpRangeCity;
|
|
1202
|
+
return Number.isFinite(wltpRangeCity)
|
|
1203
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRangeCity.toLocaleString(language) })
|
|
1204
|
+
: t('vehicleProps:value.na');
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
wltpTotalRangeCity: {
|
|
1208
|
+
title: t('vehicleProps:title.wltpTotalRangeCity'),
|
|
1209
|
+
get value() {
|
|
1210
|
+
const wltpTotalRangeCity = car.battery && car.battery.wltpTotalRangeCity;
|
|
1211
|
+
return Number.isFinite(wltpTotalRangeCity)
|
|
1212
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRangeCity.toLocaleString(language) })
|
|
1213
|
+
: t('vehicleProps:value.na');
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
wltpWeightedCombined: {
|
|
1217
|
+
title: t('vehicleProps:title.wltpWeightedCombined'),
|
|
1218
|
+
get value() {
|
|
1219
|
+
const wltpWeightedCombined = car.consumption && car.consumption.wltpTotalRangeCity;
|
|
1220
|
+
return Number.isFinite(wltpWeightedCombined)
|
|
1221
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language) })
|
|
1222
|
+
: t('vehicleProps:value.na');
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
wltpCombined: {
|
|
1226
|
+
title: t('vehicleProps:title.wltpCombined'),
|
|
1227
|
+
get value() {
|
|
1228
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
1229
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1230
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1231
|
+
return Number.isFinite(wltpCombined)
|
|
1232
|
+
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1233
|
+
: t('vehicleProps:value.na');
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1236
|
+
wltpSlow: {
|
|
1237
|
+
title: t('vehicleProps:title.wltpSlow'),
|
|
1238
|
+
get value() {
|
|
1239
|
+
const wltpSlow = car.consumption.wltpSlow;
|
|
1240
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1241
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1242
|
+
return Number.isFinite(wltpSlow)
|
|
1243
|
+
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1244
|
+
: t('vehicleProps:value.na');
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
wltpMedium: {
|
|
1248
|
+
title: t('vehicleProps:title.wltpMedium'),
|
|
1249
|
+
get value() {
|
|
1250
|
+
const wltpMedium = car.consumption.wltpMedium;
|
|
1251
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1252
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1253
|
+
return Number.isFinite(wltpMedium)
|
|
1254
|
+
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1255
|
+
: t('vehicleProps:value.na');
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
wltpFast: {
|
|
1259
|
+
title: t('vehicleProps:title.wltpFast'),
|
|
1260
|
+
get value() {
|
|
1261
|
+
const wltpFast = car.consumption.wltpFast;
|
|
1262
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1263
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1264
|
+
return Number.isFinite(wltpFast)
|
|
1265
|
+
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1266
|
+
: t('vehicleProps:value.na');
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
wltpVeryFast: {
|
|
1270
|
+
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1271
|
+
get value() {
|
|
1272
|
+
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1273
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1274
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1275
|
+
return Number.isFinite(wltpVeryFast)
|
|
1276
|
+
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1277
|
+
: t('vehicleProps:value.na');
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
wltpWeightedPowerCombined: {
|
|
1281
|
+
title: t('vehicleProps:title.wltpWeightedPowerCombined'),
|
|
1282
|
+
get value() {
|
|
1283
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
1284
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1285
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1286
|
+
return Number.isFinite(wltpWeightedPowerCombined)
|
|
1287
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1288
|
+
: t('vehicleProps:value.na');
|
|
1289
|
+
}
|
|
1290
|
+
},
|
|
1291
|
+
wltpPowerCombined: {
|
|
1292
|
+
title: t('vehicleProps:title.wltpPowerCombined'),
|
|
1293
|
+
get value() {
|
|
1294
|
+
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1295
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1296
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1297
|
+
return Number.isFinite(wltpPowerCombined)
|
|
1298
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1299
|
+
: t('vehicleProps:value.na');
|
|
1300
|
+
}
|
|
1301
|
+
},
|
|
1302
|
+
wltpPowerSlow: {
|
|
1303
|
+
title: t('vehicleProps:title.wltpPowerSlow'),
|
|
1304
|
+
get value() {
|
|
1305
|
+
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1306
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1307
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1308
|
+
return Number.isFinite(wltpPowerSlow)
|
|
1309
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1310
|
+
: t('vehicleProps:value.na');
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1313
|
+
wltpPowerMedium: {
|
|
1314
|
+
title: t('vehicleProps:title.wltpPowerMedium'),
|
|
1315
|
+
get value() {
|
|
1316
|
+
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1317
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1318
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1319
|
+
return Number.isFinite(wltpPowerMedium)
|
|
1320
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1321
|
+
: t('vehicleProps:value.na');
|
|
1322
|
+
}
|
|
1323
|
+
},
|
|
1324
|
+
wltpPowerFast: {
|
|
1325
|
+
title: t('vehicleProps:title.wltpPowerFast'),
|
|
1326
|
+
get value() {
|
|
1327
|
+
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1328
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1329
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1330
|
+
return Number.isFinite(wltpPowerFast)
|
|
1331
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1332
|
+
: t('vehicleProps:value.na');
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
wltpPowerVeryFast: {
|
|
1336
|
+
title: t('vehicleProps:title.wltpPowerVeryFast'),
|
|
1337
|
+
get value() {
|
|
1338
|
+
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1339
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1340
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1341
|
+
return Number.isFinite(wltpPowerVeryFast)
|
|
1342
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1343
|
+
: t('vehicleProps:value.na');
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
fuelPrice: {
|
|
1347
|
+
title: '',
|
|
1348
|
+
get value() {
|
|
1349
|
+
return ''
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
powerPrice: {
|
|
1353
|
+
title: '',
|
|
1354
|
+
get value() {
|
|
1355
|
+
return ''
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
consumptionPriceYear: {
|
|
1359
|
+
title: '',
|
|
1360
|
+
get value() {
|
|
1361
|
+
return ''
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
co2CostLowBasePrice: {
|
|
1365
|
+
title: '',
|
|
1366
|
+
get value() {
|
|
1367
|
+
return ''
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
co2CostMiddleBasePrice: {
|
|
1371
|
+
title: '',
|
|
1372
|
+
get value() {
|
|
1373
|
+
return ''
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
co2CostHighBasePrice: {
|
|
1377
|
+
title: '',
|
|
1378
|
+
get value() {
|
|
1379
|
+
return ''
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
co2CostLowAccumulatedPrice: {
|
|
1383
|
+
title: '',
|
|
1384
|
+
get value() {
|
|
1385
|
+
return ''
|
|
1386
|
+
}
|
|
1387
|
+
},
|
|
1388
|
+
co2CostMiddleAccumulatedPrice: {
|
|
1389
|
+
title: '',
|
|
1390
|
+
get value() {
|
|
1391
|
+
return ''
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
co2CostHighAccumulatedPrice: {
|
|
1395
|
+
title: '',
|
|
1396
|
+
get value() {
|
|
1397
|
+
return ''
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
timeFrameFrom: {
|
|
1401
|
+
title: '',
|
|
1402
|
+
get value() {
|
|
1403
|
+
return ''
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
timeFrameT0: {
|
|
1407
|
+
title: '',
|
|
1408
|
+
get value() {
|
|
1409
|
+
return ''
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
consumptionCosts: {
|
|
1413
|
+
title: '',
|
|
1414
|
+
get value() {
|
|
1415
|
+
return ''
|
|
1416
|
+
}
|
|
1051
1417
|
}
|
|
1052
1418
|
};
|
|
1053
1419
|
return props;
|
|
@@ -40,6 +40,16 @@ const consumptionPowerCombinedAlternateView = ['consumptionPowerCombinedAlternat
|
|
|
40
40
|
const consumptionCombinedHybridAlternateView = ['consumptionCombinedHybridAlternateView'];
|
|
41
41
|
const consumptionGasCombinedAlternateView = ['consumptionGasCombinedAlternateView'];
|
|
42
42
|
const consumptionHydrogenCombinedAlternateView = ['consumptionHydrogenCombinedAlternateView'];
|
|
43
|
+
const environmentElectroWLTP = ['wltpPowerCombined', 'wltpCo2', 'wltpRange', 'wltpPowerSlow', 'wltpPowerMedium',
|
|
44
|
+
'wltpPowerFast', 'wltpPowerVeryFast', 'wltpEnergyEfficiencyClass'];
|
|
45
|
+
const environmentPluginHybridWLTP = ['wltpWeightedCombined', 'wltpTotalRange', 'wltpWeightedPowerCombined', 'wltpCo2',
|
|
46
|
+
'wltpCo2Discharged', 'wltpPowerSlow', 'wltpPowerMedium', 'wltpPowerFast', 'wltpPowerCombined', 'wltpPowerVeryFast',
|
|
47
|
+
'wltpCombined', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass', 'wltpDischargedEnergyEfficiencyClass'];
|
|
48
|
+
const environmentElectroBenzinDieselEthanolHybridWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
|
|
49
|
+
const environmentHydrogenWLTP = ['wltpCombined', 'wltpCo2', 'wltpSlow', 'wltpMedium', 'wltpFast', 'wltpVeryFast', 'wltpEnergyEfficiencyClass'];
|
|
50
|
+
const costModel = ['fuelPrice', 'powerPrice', 'consumptionPriceYear', 'co2CostLowBasePrice', 'co2CostMiddleBasePrice',
|
|
51
|
+
'co2CostHighBasePrice', 'co2CostLowAccumulatedPrice', 'co2CostMiddleAccumulatedPrice', 'co2CostHighAccumulatedPrice',
|
|
52
|
+
'timeFrameFrom', 'timeFrameT0', 'consumptionCosts',]
|
|
43
53
|
|
|
44
54
|
export const engineDetails: IEngineDetails = [
|
|
45
55
|
{
|
|
@@ -67,6 +77,9 @@ export const engineDetails: IEngineDetails = [
|
|
|
67
77
|
],
|
|
68
78
|
consumptionCombined: [
|
|
69
79
|
...consumptionPowerCombinedAlternateView
|
|
80
|
+
],
|
|
81
|
+
wltp: [
|
|
82
|
+
...environmentElectroWLTP
|
|
70
83
|
]
|
|
71
84
|
},
|
|
72
85
|
{
|
|
@@ -108,6 +121,9 @@ export const engineDetails: IEngineDetails = [
|
|
|
108
121
|
],
|
|
109
122
|
consumptionCombined: [
|
|
110
123
|
...consumptionCombinedAlternateView
|
|
124
|
+
],
|
|
125
|
+
wltp: [
|
|
126
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
111
127
|
]
|
|
112
128
|
},
|
|
113
129
|
{
|
|
@@ -149,6 +165,9 @@ export const engineDetails: IEngineDetails = [
|
|
|
149
165
|
],
|
|
150
166
|
consumptionCombined: [
|
|
151
167
|
...consumptionCombinedAlternateView
|
|
168
|
+
],
|
|
169
|
+
wltp: [
|
|
170
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
152
171
|
]
|
|
153
172
|
},
|
|
154
173
|
{
|
|
@@ -175,6 +194,9 @@ export const engineDetails: IEngineDetails = [
|
|
|
175
194
|
],
|
|
176
195
|
consumptionCombined: [
|
|
177
196
|
...consumptionHydrogenCombinedAlternateView
|
|
197
|
+
],
|
|
198
|
+
wltp: [
|
|
199
|
+
...environmentHydrogenWLTP
|
|
178
200
|
]
|
|
179
201
|
},
|
|
180
202
|
{
|
|
@@ -203,6 +225,9 @@ export const engineDetails: IEngineDetails = [
|
|
|
203
225
|
],
|
|
204
226
|
consumptionCombined: [
|
|
205
227
|
...consumptionGasCombinedAlternateView
|
|
228
|
+
],
|
|
229
|
+
wltp: [
|
|
230
|
+
...environmentHydrogenWLTP
|
|
206
231
|
]
|
|
207
232
|
},
|
|
208
233
|
{
|
|
@@ -231,10 +256,70 @@ export const engineDetails: IEngineDetails = [
|
|
|
231
256
|
],
|
|
232
257
|
consumptionCombined: [
|
|
233
258
|
...consumptionGasCombinedAlternateView
|
|
259
|
+
],
|
|
260
|
+
wltp: [
|
|
261
|
+
...environmentHydrogenWLTP
|
|
234
262
|
]
|
|
235
263
|
}
|
|
236
264
|
];
|
|
237
265
|
|
|
266
|
+
export const wltpDetails = [
|
|
267
|
+
{
|
|
268
|
+
selector: 'selector_fuel_diesel',
|
|
269
|
+
wltp: [
|
|
270
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
selector: 'selector_fuel_electrical',
|
|
275
|
+
wltp: [
|
|
276
|
+
...environmentElectroWLTP
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
selector: 'selector_fuel_electrical',
|
|
281
|
+
wltp: [
|
|
282
|
+
...environmentElectroWLTP
|
|
283
|
+
]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
selector: 'selector_fuel_hybridElectricalPetrol',
|
|
287
|
+
wltp: [
|
|
288
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
selector: 'selector_fuel_naturalGas',
|
|
293
|
+
wltp: [
|
|
294
|
+
...environmentHydrogenWLTP
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
selector: 'selector_fuel_carGas',
|
|
299
|
+
wltp: [
|
|
300
|
+
...environmentHydrogenWLTP
|
|
301
|
+
]
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
selector: 'selector_fuel_petrol',
|
|
305
|
+
wltp: [
|
|
306
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
selector: 'selector_fuel_ethanol',
|
|
311
|
+
wltp: [
|
|
312
|
+
...environmentElectroBenzinDieselEthanolHybridWLTP
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
selector: 'selector_fuel_hydrogen',
|
|
317
|
+
wltp: [
|
|
318
|
+
...environmentHydrogenWLTP
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
|
|
238
323
|
export const dimensionDetails = [
|
|
239
324
|
'category', 'length', 'width', 'height', 'base', 'capacityLoad', 'bootCapacity',
|
|
240
325
|
'doors', 'seats', 'tare', 'maximumWeight', 'trailerWeightBraked', 'trailerWeightUnbraked'
|
|
@@ -263,6 +348,19 @@ export const getVehicleDetails = (selector: any, dataType: string, hybridPlugin:
|
|
|
263
348
|
}, []); //tslint:disable-line
|
|
264
349
|
};
|
|
265
350
|
|
|
351
|
+
export const getWltpValues = (selector: any, hybridPlugin: any = false) => {
|
|
352
|
+
if (hybridPlugin) {
|
|
353
|
+
return [...environmentPluginHybridWLTP];
|
|
354
|
+
}
|
|
355
|
+
return _filter(wltpDetails, key => key.selector === selector).reduce((_selector, item) => {
|
|
356
|
+
return item.wltp;
|
|
357
|
+
}, []);
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
export const getCostModelValues = () => {
|
|
361
|
+
return costModel;
|
|
362
|
+
}
|
|
363
|
+
|
|
266
364
|
export const getOverviewDetails = (selector: any) => {
|
|
267
365
|
if (Object.keys(filtered(selector)).length === 0) {
|
|
268
366
|
return [...mainPropertiesList, ...consumptionCombinedAlternateView];
|
package/source/locales/data.ts
CHANGED
|
@@ -80,6 +80,8 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
80
80
|
no: 'Nein',
|
|
81
81
|
yes: 'Ja',
|
|
82
82
|
batteryCapacity: `${vehicleOption.batteryCapacity} kWh`,
|
|
83
|
+
wltpCo2Combined: `${vehicleOption}g CO2/km (WLTP, comb)*`,
|
|
84
|
+
wltpCo2WtdCombined: `${vehicleOption}g CO2/km (WLTP, gew., comb)*`
|
|
83
85
|
|
|
84
86
|
},
|
|
85
87
|
title: {
|
|
@@ -169,7 +171,30 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
169
171
|
'financingDescription': 'Bei der Finanzierung zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende können Sie entscheiden, ob Sie den Restbetrag ablösen oder weiter finanzieren wollen.',
|
|
170
172
|
'leasingDescription': 'Beim Leasing zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende geben Sie das Auto einfach wieder zurück.',
|
|
171
173
|
'aboDescription': 'Bei diesem Auto-Abo ist bereits alles an Bord. Teil- und Vollkasko sowie Haftpflicht sind inklusive, ebenso wie Wartungs- und Verschleißreparaturen. Sie zahlen also nur Ihre Rate und Kraftstoff.',
|
|
172
|
-
'buyDescription': 'Nach Kaufabschluss haben Sie die sofortigen Eigentumsrechte und keine Finanzierungskosten. Als Eigentümer können Sie Ihr Fahrzeug zu eigenen Konditionen weiter verkaufen und Änderungen vornehmen.'
|
|
174
|
+
'buyDescription': 'Nach Kaufabschluss haben Sie die sofortigen Eigentumsrechte und keine Finanzierungskosten. Als Eigentümer können Sie Ihr Fahrzeug zu eigenen Konditionen weiter verkaufen und Änderungen vornehmen.',
|
|
175
|
+
'wltpCo2': 'CO2-Ausstoß (WLTP, komb.)',
|
|
176
|
+
'wltpCo2Discharged': 'CO2-Ausstoß (WLTP, bei entladener Batterie)',
|
|
177
|
+
'wltpEnergyEfficiencyClass': 'CO2-Klasse *Auf der Grundlage der CO-2 Emissionen (kombiniert)',
|
|
178
|
+
'wltpDischargedEnergyEfficiencyClass': 'CO2-Klasse *Auf der Grundlage der CO-2 Emissionen (bei entladener Batterie)',
|
|
179
|
+
'wltpTotalRange': 'Reichweite (EAER) (WLTP, rein elektrisch)',
|
|
180
|
+
'wltpRange': 'Reichweite (WLTP, rein elektrisch)',
|
|
181
|
+
'wltpWeightedCombined': 'Verbrauch (WLTP, gew., komb.)',
|
|
182
|
+
'wltpCombined': 'Verbrauch (WLTP, komb.)',
|
|
183
|
+
'wltpSlow': 'Verbrauch Innenstadt (WLTP)',
|
|
184
|
+
'wltpMedium': 'Verbrauch Stadtrand(WLTP)',
|
|
185
|
+
'wltpFast': 'Verbrauch Landstraße(WLTP)',
|
|
186
|
+
'wltpVeryFast': 'Verbrauch Autobahn (WLTP)',
|
|
187
|
+
'wltpWeightedPowerCombined': 'Electricity consumption (WLTP, wtd. comb.)',
|
|
188
|
+
'wltpPowerCombined': 'Stromverbrauch (WLTP, gew., komb.)',
|
|
189
|
+
'wltpPowerSlow': 'Stromverbrauch Innenstadt(WLTP)',
|
|
190
|
+
'wltpPowerMedium': 'Stromverbrauch Stadtrand(WLTP)',
|
|
191
|
+
'wltpPowerFast': 'Stromverbrauch Landstraße(WLTP)',
|
|
192
|
+
'wltpPowerVeryFast': 'Stromverbrauch Autobahn (WLTP)',
|
|
193
|
+
'wltpCO2Title': 'CO2-Klasse',
|
|
194
|
+
'wltpCO2SubTitle': '*Auf der Grundlage der CO-2 Emissionen',
|
|
195
|
+
'wltpCO2WidgetDischargedBattery': 'bei entladener Batterie',
|
|
196
|
+
'wltpCO2WidgetComb': 'gewichtet kombiniert',
|
|
197
|
+
'wltpCO2SubTitleComb': '*Auf der Grundlage der CO-2 Emissionen (kombiniert)'
|
|
173
198
|
}
|
|
174
199
|
},
|
|
175
200
|
sidebar: {
|