@bytebrand/fe-ui-core 4.8.54 → 4.8.55

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.
Files changed (194) hide show
  1. package/.husky/pre-push +4 -0
  2. package/.storybook/addons.js +4 -0
  3. package/.storybook/config.js +64 -0
  4. package/.storybook/postcss.config.js +6 -0
  5. package/.storybook/preview-head.html +10 -0
  6. package/.storybook/webpack.config.js +130 -0
  7. package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +42 -0
  8. package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +50 -0
  9. package/__tests__/components/Checkout/RadioGroup.test.tsx +95 -0
  10. package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +53 -0
  11. package/__tests__/components/Checkout/Switcher.test.tsx +43 -0
  12. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
  13. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
  14. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +127 -0
  15. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +58 -0
  16. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +74 -0
  17. package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +62 -0
  18. package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +117 -0
  19. package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +58 -0
  20. package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +88 -0
  21. package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +91 -0
  22. package/__tests__/components/_common/Badge/Badge.test.tsx +15 -0
  23. package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +23 -0
  24. package/__tests__/components/_common/Image/Image.test.tsx +82 -0
  25. package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +49 -0
  26. package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +54 -0
  27. package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +58 -0
  28. package/__tests__/components/_common/StarButton/StarButton.test.tsx +46 -0
  29. package/__tests__/mockedData/financingConfig.js +202 -0
  30. package/__tests__/mockedData/mockedPendingRequestedCar.js +69 -0
  31. package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +18 -0
  32. package/__tests__/utils/CommonUtils/arrToObj.test.js +32 -0
  33. package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +17 -0
  34. package/__tests__/utils/CommonUtils/fixNumber.test.ts +20 -0
  35. package/__tests__/utils/CommonUtils/formatMileage.test.ts +8 -0
  36. package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +22 -0
  37. package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +19 -0
  38. package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +19 -0
  39. package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +51 -0
  40. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +64 -0
  41. package/__tests__/utils/CommonUtils/getPriceRating.test.ts +26 -0
  42. package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +33 -0
  43. package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +9 -0
  44. package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +23 -0
  45. package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +23 -0
  46. package/media/locales/de/promoSlider.json +1 -0
  47. package/media/locales/en/promoSlider.json +1 -0
  48. package/package.json +117 -120
  49. package/source/components/AccordionWidget/AccordionWidget.styl +1 -0
  50. package/source/components/AccordionWidget/AccordionWidget.tsx +8 -4
  51. package/source/components/AdvantageItem/AdvantageItem.story.js +23 -0
  52. package/source/components/Alternative/Dealer.story.js +32 -0
  53. package/source/components/Alternative/Dealer.story.styl +3 -0
  54. package/source/components/Breadcrumbs/Breadcrumbs.story.js +40 -0
  55. package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +45 -0
  56. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +243 -0
  57. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +21 -0
  58. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +105 -0
  59. package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +37 -0
  60. package/source/components/Checkout/Switcher/Switcher.story.js +41 -0
  61. package/source/components/Checkout/Switcher/Switcher.story.styl +2 -0
  62. package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +187 -0
  63. package/source/components/ContactForm/ContactForm.story.js +94 -0
  64. package/source/components/ContactForm/ContactForm.story.styl +0 -0
  65. package/source/components/ContactInfo/ContactInfo.story.js +58 -0
  66. package/source/components/CustomerQuote/CustomerQuote.story.js +41 -0
  67. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +73 -0
  68. package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +5 -0
  69. package/source/components/FormattedNumber/FormattedNumber.story.js +114 -0
  70. package/source/components/InfoBlocks/InfoBlockWrapper.story.js +101 -0
  71. package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +46 -0
  72. package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +97 -0
  73. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
  74. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +24 -0
  75. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +0 -1
  76. package/source/components/OfferPanel/OfferPanel.story.js +139 -0
  77. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  78. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +35 -0
  79. package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +3 -0
  80. package/source/components/PriceRating/PriceRating.story.js +39 -0
  81. package/source/components/PriceRating/PriceRating.story.styl +2 -0
  82. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +78 -0
  83. package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +11 -0
  84. package/source/components/RateSearchValue/RateSearchValue.story.js +78 -0
  85. package/source/components/RateSearchValue/RateSearchValue.story.styl +2 -0
  86. package/source/components/RateSearchWidget/RateSearchWidget.story.js +57 -0
  87. package/source/components/RateSearchWidget/RateSearchWidget.story.styl +12 -0
  88. package/source/components/SearchFilters/FiltersFactory.story.js +273 -0
  89. package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +12 -0
  90. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +834 -0
  91. package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +40 -0
  92. package/source/components/SearchWidget/SearchWidget.story.js +191 -0
  93. package/source/components/SearchWidget/SearchWidget.story.styl +6 -0
  94. package/source/components/Stepper/Stepper.story.js +119 -0
  95. package/source/components/Stepper/Stepper.story.styl +41 -0
  96. package/source/components/Theme.story.js +36 -0
  97. package/source/components/Theme.story.styl +85 -0
  98. package/source/components/TickerText/TickerText.story.js +17 -0
  99. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +95 -0
  100. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +97 -0
  101. package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +31 -0
  102. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +247 -0
  103. package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +30 -0
  104. package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +18 -0
  105. package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +19 -0
  106. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +44 -0
  107. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +23 -11
  108. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +120 -0
  109. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +2 -0
  110. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +7 -4
  111. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +42 -0
  112. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +62 -0
  113. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +42 -0
  114. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +5 -0
  115. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +3 -1
  116. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
  117. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +24 -11
  118. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +3 -2
  119. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +4 -1
  120. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +3 -2
  121. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  122. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +412 -0
  123. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +56 -0
  124. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +14 -3
  125. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +199 -0
  126. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +40 -0
  127. package/source/components/_common/Accordion/Accordion.story.js +36 -0
  128. package/source/components/_common/Badge/Badge.story.js +27 -0
  129. package/source/components/_common/Badge/Badge.story.styl +5 -0
  130. package/source/components/_common/Bubble/Bubble.story.js +52 -0
  131. package/source/components/_common/Button/Button.story.js +52 -0
  132. package/source/components/_common/Button/Button.story.styl +5 -0
  133. package/source/components/_common/ButtonOld/Button.story.js +54 -0
  134. package/source/components/_common/ButtonOld/Button.story.styl +5 -0
  135. package/source/components/_common/Checkbox/Checkbox.story.js +85 -0
  136. package/source/components/_common/Checkbox/Checkbox.story.styl +14 -0
  137. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +126 -0
  138. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +14 -0
  139. package/source/components/_common/Chip/Chip.story.js +43 -0
  140. package/source/components/_common/ChipList/ChipList.story.js +36 -0
  141. package/source/components/_common/DropDown/DropDown.story.js +35 -0
  142. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +41 -0
  143. package/source/components/_common/Histogram/Histogram.story.js +51 -0
  144. package/source/components/_common/IconSVG/IconSVG.story.js +21 -0
  145. package/source/components/_common/IconSVG/IconSVG.story.styl +25 -0
  146. package/source/components/_common/Image/Image.story.js +142 -0
  147. package/source/components/_common/Image/Image.story.styl +18 -0
  148. package/source/components/_common/ImagesSet/ImagesSet.story.js +34 -0
  149. package/source/components/_common/ImagesSet/ImagesSet.story.styl +4 -0
  150. package/source/components/_common/Loader/Loader.story.js +21 -0
  151. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +49 -0
  152. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +4 -1
  153. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +45 -0
  154. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +6 -0
  155. package/source/components/_common/MaterialField/MaterialField.story.js +87 -0
  156. package/source/components/_common/MaterialField/MaterialField.story.styl +34 -0
  157. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +52 -0
  158. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +6 -0
  159. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +47 -0
  160. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +6 -0
  161. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +17 -0
  162. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +10 -0
  163. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +4 -3
  164. package/source/components/_common/Modal/Modal.story.js +37 -0
  165. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +21 -0
  166. package/source/components/_common/PropertySelector/PSGroup.story.js +93 -0
  167. package/source/components/_common/PropertySelector/PSGroup.story.styl +25 -0
  168. package/source/components/_common/PropertySelector/ProperySelector.story.js +83 -0
  169. package/source/components/_common/Radio/FormRadioGroup.story.js +28 -0
  170. package/source/components/_common/Radio/FormRadioGroup.story.styl +2 -0
  171. package/source/components/_common/Radio/Radio.story.js +54 -0
  172. package/source/components/_common/Radio/RadioGroup.story.js +90 -0
  173. package/source/components/_common/Radio/RadioGroup.story.styl +39 -0
  174. package/source/components/_common/Range/Range.story.js +46 -0
  175. package/source/components/_common/Range/Range.story.styl +5 -0
  176. package/source/components/_common/SliderArrow/SliderArrow.story.js +18 -0
  177. package/source/components/_common/Tabs/Tabs.story.js +56 -0
  178. package/source/components/_common/TimePicker/TimePicker.story.js +37 -0
  179. package/source/components/_common/Tooltip/Tooltip.story.js +28 -0
  180. package/source/components/_common/UserMenu/MaterialMenu.story.js +73 -0
  181. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +99 -0
  182. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  183. package/source/components/_common/withLabel/withLabel.story.js +62 -0
  184. package/source/components/_common/withPopover/withPopover.story.js +48 -0
  185. package/source/components/_common/withPopover/withPopover.story.styl +54 -0
  186. package/source/components/_common/withStats/withStats.story.js +75 -0
  187. package/source/components/_common/withStats/withStats.styl +10 -0
  188. package/source/components/_common/withStats/withStats.tsx +2 -11
  189. package/source/framework/DataTransformers.ts +1 -0
  190. package/source/framework/constants/common.ts +8 -4
  191. package/source/framework/types/types.ts +1 -0
  192. package/source/framework/vehiclesProps/decoratedLightProps.tsx +48 -12
  193. package/source/framework/vehiclesProps/decoratedProps.tsx +35 -8
  194. package/source/locales/data.ts +3 -0
@@ -124,6 +124,10 @@ const getDecoratedLightProps = (
124
124
  const wltpConsumptionCombined = car.consumption.wltpCombined;
125
125
  const wltpCo2 = car.environmentEmissions.wltpCo2;
126
126
  const consumptionPowerCombined = car.consumption.consumptionCombined;
127
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
128
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
129
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
130
+ : null;
127
131
 
128
132
  const co2 = car.environmentEmissions.co2;
129
133
 
@@ -143,7 +147,9 @@ const getDecoratedLightProps = (
143
147
  ? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
144
148
  : t('vehicleProps:value.na');
145
149
 
146
- const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
150
+ const consumptionPowerCombinedContent = Number.isFinite(consumptionPowerCombined)
151
+ ? t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
152
+ : null;
147
153
 
148
154
  const co2Value = Number.isFinite(co2)
149
155
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
@@ -162,22 +168,24 @@ const getDecoratedLightProps = (
162
168
  {`${wltpWeightedPowerCombinedContent}, `}
163
169
  {`${wltpWeightedCombinedContent}, `}
164
170
  {wltpCo2PluginValue}
171
+ {co2ClassValue && <>, {co2ClassValue}</>}
165
172
  </React.Fragment>
166
173
  }
167
174
 
168
175
  return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
169
176
  ? <React.Fragment>
170
177
  {consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionValue} <br /> {co2Value}
178
+ {co2ClassValue && <>, {co2ClassValue}</>}
171
179
  </React.Fragment>
172
180
  : t('vehicleProps:value.na');
173
181
 
174
182
  }
175
183
 
176
184
  if (wltpConsumptionValue && wltpCo2Value) {
177
- return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
185
+ return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
178
186
  }
179
187
 
180
- return <>{consumptionValue} <br /> {co2Value}</>;
188
+ return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
181
189
  }
182
190
  },
183
191
  consumptionPowerCombinedAlternateView: {
@@ -191,6 +199,10 @@ const getDecoratedLightProps = (
191
199
  const co2 = car.environmentEmissions.co2;
192
200
  const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
193
201
  const wltpCo2 = car.environmentEmissions.wltpCo2;
202
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
203
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
204
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
205
+ : null;
194
206
 
195
207
  const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
196
208
  ? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
@@ -209,10 +221,10 @@ const getDecoratedLightProps = (
209
221
  : t('vehicleProps:value.na');
210
222
 
211
223
  if (wltpConsumptionValue && wltpCo2Value) {
212
- return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
224
+ return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
213
225
  }
214
226
 
215
- return <>{consumptionValue} <br /> {co2Value} </>;
227
+ return <>{consumptionValue} <br /> {co2Value} {co2ClassValue && <>, {co2ClassValue}</>}</>;
216
228
  }
217
229
  },
218
230
 
@@ -233,8 +245,12 @@ const getDecoratedLightProps = (
233
245
 
234
246
  const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
235
247
  const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
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 });
248
+ const wltpWeightedPowerCombinedContent = Number.isFinite(wltpWeightedPowerCombined)
249
+ ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
250
+ : null;
251
+ const wltpWeightedCombinedContent = Number.isFinite(wltpWeightedCombined)
252
+ ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
253
+ : null;
238
254
  const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
239
255
  ? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
240
256
  : null;
@@ -245,6 +261,10 @@ const getDecoratedLightProps = (
245
261
 
246
262
  const co2 = car.environmentEmissions.co2;
247
263
  const wltpCo2 = car.environmentEmissions.wltpCo2;
264
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
265
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
266
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
267
+ : null;
248
268
 
249
269
  const co2Value = Number.isFinite(co2)
250
270
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
@@ -266,6 +286,7 @@ const getDecoratedLightProps = (
266
286
  {`${wltpWeightedPowerCombinedContent}, `}
267
287
  {`${wltpWeightedCombinedContent}, `}
268
288
  {wltpCo2PluginValue}
289
+ {co2ClassValue && <>, {co2ClassValue}</>}
269
290
  </React.Fragment>
270
291
  }
271
292
  }
@@ -275,12 +296,14 @@ const getDecoratedLightProps = (
275
296
  {`${wltpConsumptionPowerCombinedContent}, `}
276
297
  {`${wltpWeightedCombinedContent}, `}
277
298
  {wltpCo2PluginValue}
299
+ {co2ClassValue && <>, {co2ClassValue}</>}
278
300
  </React.Fragment>
279
301
  }
280
302
 
281
303
  return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
282
304
  ? <React.Fragment>
283
305
  {consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
306
+ {co2ClassValue && <>, {co2ClassValue}</>}
284
307
  </React.Fragment>
285
308
  : t('vehicleProps:value.na');
286
309
  }
@@ -297,6 +320,10 @@ const getDecoratedLightProps = (
297
320
  const co2 = car.environmentEmissions.co2;
298
321
  const wltpConsumptionCombined = car.consumption.wltpCombined;
299
322
  const wltpCo2 = car.environmentEmissions.wltpCo2;
323
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
324
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
325
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
326
+ : null;
300
327
 
301
328
  const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
302
329
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
@@ -314,10 +341,10 @@ const getDecoratedLightProps = (
314
341
  : null;
315
342
 
316
343
  if (wltpConsumptionValue && wltpCo2Value) {
317
- return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
344
+ return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
318
345
  }
319
346
 
320
- return <>{consumptionValue} <br /> {co2Value}</>;
347
+ return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
321
348
  }
322
349
  },
323
350
  consumptionGasCombinedAlternateView: {
@@ -331,6 +358,10 @@ const getDecoratedLightProps = (
331
358
  const co2 = car.environmentEmissions.co2;
332
359
  const wltpConsumptionCombined = car.consumption.wltpCombined;
333
360
  const wltpCo2 = car.environmentEmissions.wltpCo2;
361
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
362
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
363
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
364
+ : null;
334
365
 
335
366
  const consumptionValue = Number.isFinite(consumptionGasCombined)
336
367
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
@@ -349,10 +380,10 @@ const getDecoratedLightProps = (
349
380
  : null;
350
381
 
351
382
  if (wltpConsumptionValue && wltpCo2Value) {
352
- return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
383
+ return <>{wltpConsumptionValue}, {wltpCo2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
353
384
  }
354
385
 
355
- return <>{consumptionValue} <br /> {co2Value}</>;
386
+ return <>{consumptionValue} <br /> {co2Value}{co2ClassValue && <>, {co2ClassValue}</>}</>;
356
387
  }
357
388
  },
358
389
  consumptionCombinedDealer: {
@@ -364,6 +395,7 @@ const getDecoratedLightProps = (
364
395
  const translatedUnit = t(`cbd:${consumptionUnit}`);
365
396
 
366
397
  const co2 = car.environmentEmissions.co2;
398
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
367
399
 
368
400
  const consumptionValue = Number.isFinite(consumptionCombined)
369
401
  ? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
@@ -373,7 +405,11 @@ const getDecoratedLightProps = (
373
405
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
374
406
  : t('vehicleProps:value.na');
375
407
 
376
- return <>{consumptionValue} | {co2Value}</>;
408
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
409
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
410
+ : null;
411
+
412
+ return <>{consumptionValue} | {co2Value}{co2ClassValue ? <> | {co2ClassValue}</> : null}</>;
377
413
  }
378
414
  },
379
415
  gearbox: {
@@ -680,6 +680,7 @@ const getDecoratedProps = (
680
680
  const translatedUnit = t(`cbd:${consumptionUnit}`);
681
681
  const wltpConsumptionCombined = car.consumption.wltpCombined;
682
682
  const wltpCo2 = car.environmentEmissions.wltpCo2;
683
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
683
684
 
684
685
  const co2 = car.environmentEmissions.co2;
685
686
 
@@ -699,11 +700,15 @@ const getDecoratedProps = (
699
700
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
700
701
  : t('vehicleProps:value.na');
701
702
 
703
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
704
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
705
+ : null;
706
+
702
707
  if (wltpConsumptionValue && wltpCo2Value) {
703
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
708
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
704
709
  }
705
710
 
706
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
711
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
707
712
  }
708
713
  },
709
714
  consumptionPowerCombinedAlternateView: {
@@ -716,6 +721,7 @@ const getDecoratedProps = (
716
721
  const co2 = car.environmentEmissions.co2;
717
722
  const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
718
723
  const wltpCo2 = car.environmentEmissions.wltpCo2;
724
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
719
725
 
720
726
  const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
721
727
  ? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
@@ -733,11 +739,15 @@ const getDecoratedProps = (
733
739
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
734
740
  : t('vehicleProps:value.na');
735
741
 
742
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
743
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
744
+ : null;
745
+
736
746
  if (wltpConsumptionValue && wltpCo2Value) {
737
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
747
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
738
748
  }
739
749
 
740
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
750
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
741
751
  }
742
752
  },
743
753
  consumptionHydrogenCombinedAlternateView: {
@@ -750,6 +760,7 @@ const getDecoratedProps = (
750
760
  const translatedUnit = t(`cbd:${consumptionUnit}`);
751
761
  const co2 = car.environmentEmissions.co2;
752
762
  const wltpCo2 = car.environmentEmissions.wltpCo2;
763
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
753
764
 
754
765
  const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
755
766
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
@@ -767,11 +778,15 @@ const getDecoratedProps = (
767
778
  ? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
768
779
  : null;
769
780
 
781
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
782
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
783
+ : null;
784
+
770
785
  if (wltpConsumptionValue && wltpCo2Value) {
771
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
786
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
772
787
  }
773
788
 
774
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
789
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
775
790
  }
776
791
  },
777
792
  consumptionGasCombinedAlternateView: {
@@ -785,6 +800,7 @@ const getDecoratedProps = (
785
800
 
786
801
  const co2 = car.environmentEmissions.co2;
787
802
  const wltpCo2 = car.environmentEmissions.wltpCo2;
803
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
788
804
 
789
805
  const consumptionValue = Number.isFinite(consumptionGasCombined)
790
806
  ? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
@@ -802,11 +818,15 @@ const getDecoratedProps = (
802
818
  ? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
803
819
  : null;
804
820
 
821
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
822
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
823
+ : null;
824
+
805
825
  if (wltpConsumptionValue && wltpCo2Value) {
806
- return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
826
+ return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
807
827
  }
808
828
 
809
- return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
829
+ return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
810
830
  }
811
831
  },
812
832
 
@@ -841,6 +861,7 @@ const getDecoratedProps = (
841
861
 
842
862
  const co2 = car.environmentEmissions.co2;
843
863
  const wltpCo2 = car.environmentEmissions.wltpCo2;
864
+ const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
844
865
  const co2Value = Number.isFinite(co2)
845
866
  ? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
846
867
  : t('vehicleProps:value.na');
@@ -850,6 +871,9 @@ const getDecoratedProps = (
850
871
  const wltpCo2PluginValue = Number.isFinite(wltpCo2)
851
872
  ? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
852
873
  : null;
874
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
875
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
876
+ : null;
853
877
  const hybridPlugin = car.engineData.hybridPlugin;
854
878
 
855
879
  if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
@@ -857,6 +881,7 @@ const getDecoratedProps = (
857
881
  {wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
858
882
  {wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
859
883
  {wrapValue(wltpCo2PluginValue)}
884
+ {co2ClassValue && <><br />{co2ClassValue}</>}
860
885
  </React.Fragment>
861
886
  }
862
887
 
@@ -864,6 +889,7 @@ const getDecoratedProps = (
864
889
  return <React.Fragment>
865
890
  {wrapValue(wltpConsumptionCombinedContent)}{', '}
866
891
  {wrapValue(wltpCo2Value)}
892
+ {co2ClassValue && <><br />{co2ClassValue}</>}
867
893
  </React.Fragment>
868
894
  }
869
895
 
@@ -873,6 +899,7 @@ const getDecoratedProps = (
873
899
  {consumptionPowerCombined && hybridPlugin ? <br /> : ''}
874
900
  {wrapValue(consumptionCombinedContent)} <br />
875
901
  {wrapValue(co2Value)}
902
+ {co2ClassValue && <><br />{co2ClassValue}</>}
876
903
  </React.Fragment>
877
904
  : t('vehicleProps:value.na');
878
905
  }
@@ -38,6 +38,8 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
38
38
  promoSlider: {
39
39
  consumptionCombined: `${vehicleOption.consumptionCombined}l/100km (komb)*`,
40
40
  co2: `${vehicleOption.co2} g CO2/km (komb)*`,
41
+ // wltpEnergyEfficiencyClass arrives as `selector_energyEfficiencyClass_X`; map to the bare letter via cbd dict.
42
+ co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
41
43
  new: 'neu',
42
44
  downPayment: '0€ Anzahlung',
43
45
  downPaymentShort: '0€ Anz.',
@@ -59,6 +61,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
59
61
  deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
60
62
  deliveryPeriodDays: `${count} Tag\nab Bestellung`,
61
63
  co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
64
+ co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
62
65
  co2: `${vehicleOption.co2} g/km `,
63
66
  na: 'N/A',
64
67
  priceSub: '/mtl.',