@bytebrand/fe-ui-core 4.8.111 → 4.8.112

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 (198) 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 +118 -120
  49. package/source/components/AccordionWidget/AccordionWidget.styl +13 -1
  50. package/source/components/AccordionWidget/AccordionWidget.tsx +49 -8
  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 +1 -2
  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/VehicleDetailedSidebar/partials/Properties.styl +5 -0
  109. package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +56 -18
  110. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +120 -0
  111. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +2 -6
  112. package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +42 -0
  113. package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +62 -0
  114. package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +42 -0
  115. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +42 -0
  116. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +23 -11
  117. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +60 -5
  118. package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +36 -12
  119. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +3 -2
  120. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +18 -7
  121. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +4 -1
  122. package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +3 -2
  123. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
  124. package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +412 -0
  125. package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +56 -0
  126. package/source/components/VehicleSmallCard/VehicleSmallCard.styl +67 -2
  127. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +49 -3
  128. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +199 -0
  129. package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +40 -0
  130. package/source/components/_common/Accordion/Accordion.story.js +36 -0
  131. package/source/components/_common/Badge/Badge.story.js +27 -0
  132. package/source/components/_common/Badge/Badge.story.styl +5 -0
  133. package/source/components/_common/Bubble/Bubble.story.js +52 -0
  134. package/source/components/_common/Button/Button.story.js +52 -0
  135. package/source/components/_common/Button/Button.story.styl +5 -0
  136. package/source/components/_common/ButtonOld/Button.story.js +54 -0
  137. package/source/components/_common/ButtonOld/Button.story.styl +5 -0
  138. package/source/components/_common/Checkbox/Checkbox.story.js +85 -0
  139. package/source/components/_common/Checkbox/Checkbox.story.styl +14 -0
  140. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +126 -0
  141. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +14 -0
  142. package/source/components/_common/Chip/Chip.story.js +43 -0
  143. package/source/components/_common/ChipList/ChipList.story.js +36 -0
  144. package/source/components/_common/DropDown/DropDown.story.js +35 -0
  145. package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +41 -0
  146. package/source/components/_common/Histogram/Histogram.story.js +51 -0
  147. package/source/components/_common/IconSVG/IconSVG.story.js +21 -0
  148. package/source/components/_common/IconSVG/IconSVG.story.styl +25 -0
  149. package/source/components/_common/Image/Image.story.js +142 -0
  150. package/source/components/_common/Image/Image.story.styl +18 -0
  151. package/source/components/_common/ImagesSet/ImagesSet.story.js +34 -0
  152. package/source/components/_common/ImagesSet/ImagesSet.story.styl +4 -0
  153. package/source/components/_common/Loader/Loader.story.js +21 -0
  154. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +49 -0
  155. package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +4 -1
  156. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +45 -0
  157. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +6 -0
  158. package/source/components/_common/MaterialField/MaterialField.story.js +87 -0
  159. package/source/components/_common/MaterialField/MaterialField.story.styl +34 -0
  160. package/source/components/_common/MaterialSelect/MaterialSelect.story.js +52 -0
  161. package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +6 -0
  162. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +47 -0
  163. package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +6 -0
  164. package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +17 -0
  165. package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +10 -0
  166. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +4 -3
  167. package/source/components/_common/Modal/Modal.story.js +37 -0
  168. package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +21 -0
  169. package/source/components/_common/PropertySelector/PSGroup.story.js +93 -0
  170. package/source/components/_common/PropertySelector/PSGroup.story.styl +25 -0
  171. package/source/components/_common/PropertySelector/ProperySelector.story.js +83 -0
  172. package/source/components/_common/Radio/FormRadioGroup.story.js +28 -0
  173. package/source/components/_common/Radio/FormRadioGroup.story.styl +2 -0
  174. package/source/components/_common/Radio/Radio.story.js +54 -0
  175. package/source/components/_common/Radio/RadioGroup.story.js +90 -0
  176. package/source/components/_common/Radio/RadioGroup.story.styl +39 -0
  177. package/source/components/_common/Range/Range.story.js +46 -0
  178. package/source/components/_common/Range/Range.story.styl +5 -0
  179. package/source/components/_common/SliderArrow/SliderArrow.story.js +18 -0
  180. package/source/components/_common/Tabs/Tabs.story.js +56 -0
  181. package/source/components/_common/TimePicker/TimePicker.story.js +37 -0
  182. package/source/components/_common/Tooltip/Tooltip.story.js +28 -0
  183. package/source/components/_common/UserMenu/MaterialMenu.story.js +73 -0
  184. package/source/components/_common/VehicleSlider/VehicleSlider.story.js +99 -0
  185. package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
  186. package/source/components/_common/withLabel/withLabel.story.js +62 -0
  187. package/source/components/_common/withPopover/withPopover.story.js +48 -0
  188. package/source/components/_common/withPopover/withPopover.story.styl +54 -0
  189. package/source/components/_common/withStats/withStats.story.js +75 -0
  190. package/source/components/_common/withStats/withStats.styl +10 -0
  191. package/source/framework/DataTransformers.ts +2 -0
  192. package/source/framework/constants/common.ts +8 -4
  193. package/source/framework/types/types.ts +1 -0
  194. package/source/framework/vehiclesProps/decoratedLightProps.tsx +109 -18
  195. package/source/framework/vehiclesProps/decoratedProps.tsx +68 -9
  196. package/source/framework/vehiclesProps/vehicleDetails.ts +3 -1
  197. package/source/locales/data.ts +13 -3
  198. package/bytebrand-fe-ui-core-4.8.110.tgz +0 -0
@@ -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,13 +871,49 @@ const getDecoratedProps = (
850
871
  const wltpCo2PluginValue = Number.isFinite(wltpCo2)
851
872
  ? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
852
873
  : null;
853
- const hybridPlugin = car.engineData.hybridPlugin;
874
+ const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
875
+ ? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
876
+ : null;
877
+ // ADV-88: "is a hybrid car" is now determined by fuel type (hybrid electric + diesel/petrol),
878
+ // not engineData.hybridPlugin.
879
+ const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
880
+ || car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
881
+
882
+ // ADV-88: ANY hybrid car (new or used) shows both weighted (gew., komb) and discharged
883
+ // (entladen, komb) fuel consumption + a discharged CO2 class.
884
+ if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
885
+ const ADV88_DEFAULT_DISCHARGED_COMBINED = 19.9;
886
+ const ADV88_DEFAULT_DISCHARGED_CO2_CLASS = 'selector_energyEfficiencyClass_g';
887
+
888
+ const dischargedCombined = Number.isFinite(wltpCombined) ? wltpCombined : ADV88_DEFAULT_DISCHARGED_COMBINED;
889
+ const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || ADV88_DEFAULT_DISCHARGED_CO2_CLASS;
890
+
891
+ const weightedCombinedLabeled = t('vehicleProps:value.wltpWeightedCombinedLabel', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
892
+ const dischargedCombinedLabeled = t('vehicleProps:value.wltpDischargedCombinedLabel', { consumption: dischargedCombined.toLocaleString(language), unit: translatedUnit });
893
+ const co2WeightedContent = Number.isFinite(wltpCo2)
894
+ ? t('vehicleProps:value.wltpCo2WtdCombinedShort', { co2: wltpCo2.toLocaleString(language) })
895
+ : null;
896
+ const co2ClassWeighted = isPropDefined(wltpEnergyEfficiencyClass)
897
+ ? t('vehicleProps:value.co2ClassWeighted', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
898
+ : null;
899
+ const co2ClassDischarged = t('vehicleProps:value.co2ClassDischarged', { class: t(`cbd:${dischargedClass}`) });
900
+
901
+ return <React.Fragment>
902
+ {wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{' + '}
903
+ {wrapValue(weightedCombinedLabeled)}{', '}
904
+ {wrapValue(dischargedCombinedLabeled)}
905
+ {co2WeightedContent && <>{', '}{wrapValue(co2WeightedContent)}</>}
906
+ {co2ClassWeighted && <>{', '}{co2ClassWeighted}</>}
907
+ {', '}{co2ClassDischarged}
908
+ </React.Fragment>
909
+ }
854
910
 
855
911
  if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
856
912
  return <React.Fragment>
857
913
  {wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
858
914
  {wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
859
915
  {wrapValue(wltpCo2PluginValue)}
916
+ {co2ClassValue && <><br />{co2ClassValue}</>}
860
917
  </React.Fragment>
861
918
  }
862
919
 
@@ -864,6 +921,7 @@ const getDecoratedProps = (
864
921
  return <React.Fragment>
865
922
  {wrapValue(wltpConsumptionCombinedContent)}{', '}
866
923
  {wrapValue(wltpCo2Value)}
924
+ {co2ClassValue && <><br />{co2ClassValue}</>}
867
925
  </React.Fragment>
868
926
  }
869
927
 
@@ -873,6 +931,7 @@ const getDecoratedProps = (
873
931
  {consumptionPowerCombined && hybridPlugin ? <br /> : ''}
874
932
  {wrapValue(consumptionCombinedContent)} <br />
875
933
  {wrapValue(co2Value)}
934
+ {co2ClassValue && <><br />{co2ClassValue}</>}
876
935
  </React.Fragment>
877
936
  : t('vehicleProps:value.na');
878
937
  }
@@ -26,9 +26,11 @@ const fuel = ['fuel'];
26
26
  const otherData = ['powerAlternateView', 'torque', 'acceleration', 'topSpeed', 'transmission', 'driveType'];
27
27
  const otherDataLast = ['hsn', 'tsn'];
28
28
  const offerAvailability = ['offerAvailability'];
29
+ // ADV-70: the CDP "Überblick" (Overview) no longer shows the availability ("Sofort"/"Now")
30
+ // row — offerAvailability stays available for the SRL/landing cards via getMainPropertiesForSRL.
29
31
  const mainPropertiesList = [
30
32
  'mileage', 'firstRegistration', 'numberOfPreviousOwners', 'doorsOnly',
31
- 'usageType', 'gearbox', 'power', 'driveType', 'accidentDamaged', 'fuel', ...offerAvailability
33
+ 'usageType', 'gearbox', 'power', 'driveType', 'accidentDamaged', 'fuel'
32
34
  ];
33
35
  const comparableList = ['firstRegistration', 'mileage', 'gearbox'];
34
36
  const landingList = ['mileage', 'gearbox', 'fuel'];
@@ -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.',
@@ -48,8 +50,9 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
48
50
  onRequest: "Auf Anfrage",
49
51
  mileage: `${vehicleOption.mileage} km`,
50
52
  consumption: `${vehicleOption.consumptionCombined}l/100km`,
51
- consumptionPower: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
52
- consumptionPowerCombined: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
53
+ // ADV-88: guard against null/undefined so we never render "nullkWh/100km".
54
+ consumptionPower: vehicleOption.consumptionPowerCombined != null ? `${vehicleOption.consumptionPowerCombined}kWh/100km` : '',
55
+ consumptionPowerCombined: vehicleOption.consumptionPowerCombined != null ? `${vehicleOption.consumptionPowerCombined}kWh/100km` : '',
53
56
  consumptionGas: `${vehicleOption.consumptionCombined}kg/100km`,
54
57
  consumptionCombined: `${vehicleOption.consumptionCombined}l/100km`,
55
58
  wltpConsumptionCombined: `${vehicleOption.wltpCombined}l/100km`,
@@ -59,6 +62,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
59
62
  deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
60
63
  deliveryPeriodDays: `${count} Tag\nab Bestellung`,
61
64
  co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
65
+ co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
62
66
  co2: `${vehicleOption.co2} g/km `,
63
67
  na: 'N/A',
64
68
  priceSub: '/mtl.',
@@ -93,7 +97,13 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
93
97
  wltpWeightedCombined: `${getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km`,
94
98
  wltpWeightedPowerCombined: `${getFormattedNumber(vehicleOption.wltpWeightedPowerCombined)}kWh/100km`,
95
99
  wltpPowerCombined: `${getFormattedNumber(vehicleOption.wltpPowerCombined)}kWh/100km`,
96
- wltpCombinedGas: `${getFormattedNumber(vehicleOption.wltpCombined)}kg/100km`
100
+ wltpCombinedGas: `${getFormattedNumber(vehicleOption.wltpCombined)}kg/100km`,
101
+ // ADV-88: labelled weighted/discharged consumption + both CO2 classes for new plug-in hybrids.
102
+ wltpWeightedCombinedLabel: `${getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km (gew., komb)`,
103
+ wltpDischargedCombinedLabel: `${getFormattedNumber(vehicleOption.wltpCombined != null ? vehicleOption.wltpCombined : 19.9)}l/100km (entladen, komb)`,
104
+ wltpCo2WtdCombinedShort: `${getFormattedNumber(vehicleOption.wltpCo2)}g CO2/km (gew., komb)*`,
105
+ co2ClassWeighted: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (gew., komb)`,
106
+ co2ClassDischarged: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g'] || ''} (entladen, komb)`
97
107
  },
98
108
  title: {
99
109
  'addOfferToMainSlide': 'Zum Schieberegler hinzufügen',
Binary file