@bytebrand/fe-ui-core 4.8.110 → 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 +54 -4
  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/components/_common/withStats/withStats.tsx +9 -4
  192. package/source/framework/DataTransformers.ts +2 -0
  193. package/source/framework/constants/common.ts +8 -4
  194. package/source/framework/types/types.ts +1 -0
  195. package/source/framework/vehiclesProps/decoratedLightProps.tsx +109 -18
  196. package/source/framework/vehiclesProps/decoratedProps.tsx +68 -9
  197. package/source/framework/vehiclesProps/vehicleDetails.ts +3 -1
  198. package/source/locales/data.ts +13 -3
@@ -1,6 +1,7 @@
1
1
  import React, { memo, FunctionComponent, ReactNode, MouseEvent, createElement } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import _get from 'lodash/get';
4
+ import getCardDecoratedProps from '../../framework/vehiclesProps/decoratedLightProps';
4
5
  import LazyLoad from 'react-lazyload';
5
6
  import withLabel from '../_common/withLabel/withLabel';
6
7
  import withStats, { IStatsWrapperProps } from '../_common/withStats/withStats';
@@ -12,6 +13,7 @@ import VehicleTitle from './VehicleData/VehicleTitle/VehicleTitle';
12
13
  import SeoText from './SeoText/SeoText';
13
14
  import VehicleInfo from './VehicleData/VehicleInfo/VehicleInfo';
14
15
  import VehiclePrice from './VehicleData/VehiclePrice/VehiclePrice';
16
+ import { PLACEHOLDER_IMAGE_SMALL_URL } from '../../framework/constants/common';
15
17
  import {
16
18
  IVehicleInfo,
17
19
  IPrice,
@@ -38,6 +40,7 @@ interface IVehicleSmallCardProps {
38
40
  isReferenceSearch?: boolean;
39
41
  dashboardButtonText?: string;
40
42
  showNewLabel?: boolean;
43
+ disableDownPaymentLocalStorage?: boolean;
41
44
  CircularProgressbar?: any;
42
45
  slider?: IVehicleSliderProps | IVehicleSliderForSRLProps;
43
46
  stats?: IStatsWrapperProps;
@@ -108,6 +111,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
108
111
  price,
109
112
  seoText,
110
113
  showNewLabel,
114
+ disableDownPaymentLocalStorage,
111
115
  linkTag = 'a',
112
116
  language,
113
117
  className,
@@ -147,6 +151,32 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
147
151
 
148
152
  const combineRefAlternative = isAlternative || isReferenceSearch;
149
153
 
154
+ // ADV-88: on the narrow landing/main recommendation cards the long plug-in consumption line
155
+ // doesn't fit the slim `info` column — render it as its own full-width row below the price
156
+ // block (under "Zum Angebot") instead, and suppress it inside VehicleInfo to avoid duplication.
157
+ // ADV-88: ANY plug-in hybrid (new or used) carries the long weighted+discharged consumption/CO2
158
+ // line — externalise it to a full-width row so it doesn't overflow the narrow info column. Gated
159
+ // on hybridPlugin only, no condition check.
160
+ // ADV-88: "is a hybrid car" is determined by fuel type (hybrid electric + diesel/petrol), not hybridPlugin.
161
+ const cardFuel = consumption ? (consumption as any).fuel : undefined;
162
+ const isPlugin = cardFuel === 'selector_fuel_hybridElectricalDiesel'
163
+ || cardFuel === 'selector_fuel_hybridElectricalPetrol';
164
+ const externalizeConsumption = isPlugin
165
+ && (vehicleComponentName === 'landing' || vehicleComponentName === 'main'
166
+ || vehicleComponentName === 'search' || vehicleComponentName === 'comparable'
167
+ || vehicleComponentName === 'favorite');
168
+ let pluginConsumptionNode: ReactNode = null;
169
+ if (externalizeConsumption) {
170
+ const decoCar = {
171
+ consumption,
172
+ environmentEmissions,
173
+ engineData,
174
+ mainData: { condition: _get(info, 'condition') }
175
+ };
176
+ const deco = getCardDecoratedProps(decoCar, t, language) as any;
177
+ pluginConsumptionNode = _get(deco, 'consumptionCombinedAlternateView.value', null);
178
+ }
179
+
150
180
  const label = {
151
181
  labelVisible: isTop,
152
182
  labelWrapperClassName: styles.labelWrapper
@@ -161,6 +191,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
161
191
  { [styles.vehicleWrapMyVeicles]: vehicleComponentName === 'myVehicles' },
162
192
  { [styles.vehicleWrapFavorite]: vehicleComponentName === 'favorite' },
163
193
  { [styles.vehicleWrapRecently]: vehicleComponentName === 'recently' },
194
+ { [styles.vehicleWrapNewPlugin]: externalizeConsumption },
164
195
  { [styles.topVehicle]: isTop },
165
196
  { [styles.disableBorder]: minimizeData },
166
197
  { [styles.isFirstReferenceCar]: isReferenceSearch && index === 0 },
@@ -180,7 +211,8 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
180
211
  isReferenceSearch,
181
212
  isAlternative,
182
213
  typeAlternative,
183
- showDownPayment: !!(offer as any)?.showDownPayment
214
+ showDownPayment: !!(offer as any)?.showDownPayment,
215
+ disableDownPaymentLocalStorage,
184
216
  };
185
217
 
186
218
  const favoriteProps = {
@@ -214,6 +246,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
214
246
  target,
215
247
  rel,
216
248
  engineData,
249
+ suppressConsumption: externalizeConsumption,
217
250
  ...price,
218
251
  ...info
219
252
  };
@@ -240,6 +273,9 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
240
273
  typeAlternative,
241
274
  isAlternative,
242
275
  showCompareCheckboxes,
276
+ // ADV-88: hide the "monatlich z.B." price-column header on exactly the cards that show
277
+ // the externalised consumption row (new plug-in hybrids) so the price column rises.
278
+ suppressMonthlyFrom: externalizeConsumption && !!pluginConsumptionNode,
243
279
  ...price,
244
280
  ...compareProps
245
281
  };
@@ -261,6 +297,7 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
261
297
  price,
262
298
  showNewLabel,
263
299
  showDownPayment: !!(offer as any)?.showDownPayment,
300
+ disableDownPaymentLocalStorage,
264
301
  ...stats
265
302
  };
266
303
 
@@ -281,7 +318,12 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
281
318
  target,
282
319
  rel,
283
320
  className: `${styles.redirectClassLink} ${styles.gridAreaTitle}`,
284
- onClick: () => localStorage.setItem('activeTabCDP', t('vehicleProps:title.financing')),
321
+ onClick: () => localStorage.setItem(
322
+ 'activeTabCDP',
323
+ _get(price, 'leasing.isActive', false)
324
+ ? t('vehicleProps:title.leasing')
325
+ : t('vehicleProps:title.financing')
326
+ ),
285
327
  href: url
286
328
  })}
287
329
 
@@ -334,11 +376,19 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
334
376
  target,
335
377
  rel,
336
378
  className: `${styles.redirectClassLink} ${styles.gridAreaImage}`,
337
- onClick: () => localStorage.setItem('activeTabCDP', t('vehicleProps:title.financing')),
379
+ onClick: () => localStorage.setItem(
380
+ 'activeTabCDP',
381
+ _get(price, 'leasing.isActive', false)
382
+ ? t('vehicleProps:title.leasing')
383
+ : t('vehicleProps:title.financing')
384
+ ),
338
385
  href: url
339
386
  })}
340
387
  <VehicleInfo {...vehicleInfoProps} />
341
388
  <VehiclePrice {...vehiclePriceProps} />
389
+ {externalizeConsumption && pluginConsumptionNode ? (
390
+ <div className={styles.gridAreaConsumption}>{pluginConsumptionNode}</div>
391
+ ) : null}
342
392
  {seoText ? (
343
393
  <a className={`${styles.redirectClassLink} ${styles.gridAreaSeoText}`} href={url}>
344
394
  <SeoText seoText={seoText} />
@@ -366,7 +416,7 @@ VehicleSmallCard.defaultProps = {
366
416
  baseUrl: '',
367
417
  typeAlternative: '',
368
418
  offerSource: '',
369
- src: 'https://images.auto.de/noimage/small',
419
+ src: PLACEHOLDER_IMAGE_SMALL_URL,
370
420
  environmentEmissions: null,
371
421
  language: 'en',
372
422
  consumption: null,
@@ -0,0 +1,199 @@
1
+ import React from 'react';
2
+ import i18next from 'i18next';
3
+ import { Resizable } from 're-resizable';
4
+ // import * as CheckboxTree from 'react-checkbox-tree';
5
+ import { withNamespaces } from 'react-i18next';
6
+ import { storiesOf } from '@storybook/react';
7
+ import { action } from '@storybook/addon-actions';
8
+
9
+ import VehicleSmallCardForDealerships from './VehicleSmallCardForDealerships.tsx';
10
+ import styles from './VehicleSmallCardForDealerships.story.styl';
11
+
12
+
13
+ i18next.addResourceBundle('de', 'vehicleProps', {
14
+ value: {
15
+ mileage: "{{mileage}} km",
16
+ consumption: "{{consumption}}l/100km",
17
+ consumptionPower: "{{consumption}}kWh/100km",
18
+ consumptionPowerCombined: "{{consumption}}kWh/100km (komb)*",
19
+ consumptionGas: "{{consumption}}kg/100km",
20
+ consumptionCombined: "{{consumption}}l/100km",
21
+ power: "{{powerKW}}\u00A0kW ({{powerPS}}\u00A0PS)",
22
+ powerPS: "{{powerPS}} PS",
23
+ deliveryPeriodMonths: "{{count}} Monat\nab Bestellung",
24
+ deliveryPeriodDays: "{{count}} Tag\nab Bestellung",
25
+ co2Combined: "{{co2}}g CO2/km (komb)*",
26
+ co2: "{{co2}} g/km ",
27
+ na: "N/A"
28
+ },
29
+ priceRating: {
30
+ noRating: 'KEINE BEWERTUNG',
31
+ highPrice: 'HOHER PREIS',
32
+ increasedPrice: 'ERHÖHTER PREIS',
33
+ fairPrice: 'FAIRER PREIS',
34
+ goodPrice: 'GUTER PREIS',
35
+ topPrice: 'TOP PREIS'
36
+ },
37
+ promoSlider: {
38
+ consumptionCombined: `{{consumptionCombined}} l/100km (komb)*`,
39
+ co2: `{{co2}} g CO2/km (komb)*`,
40
+ new: 'neu'
41
+ },
42
+ title: {
43
+ addOfferToMainSlide: 'Zum Schieberegler hinzufügen',
44
+ toOffer: 'zum Angebot',
45
+ monthlyFrom: 'monatlich ab',
46
+ financing: 'Finanzierung',
47
+ leasing: 'Leasing',
48
+ abo: 'Abo',
49
+ buy: 'Kaufen',
50
+ financingDescription: `Bei der Finanzierung zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil.
51
+ Zum Vertragsende können Sie entscheiden, ob Sie den Restbetrag ablösen oder weiter finanzieren wollen.`,
52
+ leasingDescription: `Beim Leasing zahlen Sie lediglich die Zinsen des Darlehens und einen geringen
53
+ Tilgungsanteil. Zum Vertragsende geben Sie das Auto einfach wieder zurück.`,
54
+ aboDescription: `Bei diesem Auto-Abo ist bereits alles an Bord. Teil- und
55
+ Vollkasko sowie Haftpflicht sind inklusive, ebenso wie Wartungs- und Verschleißreparaturen.
56
+ Sie zahlen also nur Ihre Rate und Kraftstoff.`,
57
+ buyDescription: `Nach Kaufabschluss haben Sie die sofortigen
58
+ Eigentumsrechte und keine Finanzierungskosten. Als Eigentümer können Sie Ihr Fahrzeug zu
59
+ eigenen Konditionen weiter verkaufen und Änderungen vornehmen.`
60
+ }
61
+ });
62
+
63
+ const resizableProps = {
64
+ minWidth: 150,
65
+ defaultSize: { width: 360, height: 'auto' }
66
+ };
67
+
68
+ const IMAGE_URL = 'https://picsum.photos/400/300/?random';
69
+ const images = [];
70
+ for (let i = 0; i <= 10; i++) {
71
+ images.push({ url: `${IMAGE_URL}&tag=${Math.random()}`, description: '' });
72
+ }
73
+
74
+ const VehicleSmallCardStory = withNamespaces('vehicleProps')(({ t }) => {
75
+ const dealershipsProps = {
76
+ language: 'de',
77
+ vehicleComponentName: 'landing',
78
+ showSlider: true,
79
+ showNewLabel: true,
80
+ src: 'http://placehold.jp/400x300.png?text=mainImage',
81
+ stats: {
82
+ imagesCount: 100,
83
+ isFavoured: true,
84
+ statsData: {
85
+ totalCarImpCount: 10,
86
+ totalFavCount: 20,
87
+ },
88
+ statsSize: 'xs'
89
+ },
90
+ title: {
91
+ make: 'Audi',
92
+ model: 'A4',
93
+ subModel: 'Shooting Brake',
94
+ },
95
+ info: {
96
+ mileage: 10464,
97
+ regDate: 1535760000,
98
+ gearbox: 'selector_gearbox_automatic'
99
+ },
100
+ environmentEmissions: {
101
+ co2: 8.7
102
+ },
103
+ consumption: {
104
+ consumptionCombined: 9.6,
105
+ consumptionPowerCombined: null,
106
+ fuel: 'selector_fuel_hybridElectricalDiesel'
107
+ },
108
+ engineData: {
109
+ cubicCapacity: 1968,
110
+ cylinders: 0,
111
+ particulateFilterDiesel: true,
112
+ powerKW: 140,
113
+ powerPS: 190,
114
+ startStopSystem: true,
115
+ },
116
+ offer : {
117
+ availabilityFrom: null,
118
+ availabilityMode: "selector_availabilityMode_always",
119
+ deliveryPeriod: "selector_unknown"
120
+ },
121
+ price: {
122
+ monthlyInstallment: 29,
123
+ oldMonthlyInstallment: 49,
124
+ isStrikeShown: true,
125
+ currency: "EUR",
126
+ currentSalesPrice: 16160,
127
+ historyPriceDifference: 5629.6,
128
+ historyPriceDifferencePerCent: 26,
129
+ mlCurrentSalesPriceCategory: null,
130
+ mlCurrentSalesPriceDiffPercent: null,
131
+ mlCurrentSalesPricePredicted: 100,
132
+ totalCurrent: 50,
133
+ originalSalesPrice: 13467,
134
+ priceDate: null,
135
+ priceId: null,
136
+ recomendedRetailPrice: null,
137
+ retailToCurrentPriceDifference: 0,
138
+ vatDeductible: null,
139
+ vatRate: 7,
140
+ wasPrice: 10000,
141
+ financing: {
142
+ annualPercentageRate: "",
143
+ bank: "",
144
+ closingCosts: null,
145
+ conditions: null,
146
+ finalInstallment: null,
147
+ financingBank: "",
148
+ firstInstallment: 0,
149
+ grossLoanAmount: "",
150
+ monthlyInstallment: 108,
151
+ netLoanAmount: "",
152
+ nominalInterestRate: "",
153
+ paybackPeriod: "24",
154
+ paymentProtectionInsurance: "",
155
+ platformFinancingId: null,
156
+ transportationCosts: "",
157
+ typeOfNominalInterestRate: null
158
+ },
159
+ leasing: {
160
+ RWG: 10,
161
+ addServicesCost: 799,
162
+ annualMileage: null,
163
+ closingCosts: null,
164
+ financialInstitution: null,
165
+ firstInstallment: null,
166
+ leasingMode: "default",
167
+ maxAge: null,
168
+ maxMileage: null,
169
+ nominalInterestRate: null,
170
+ paybackPeriod: null,
171
+ paymentProtectionInsurance: null,
172
+ purchasePrice: null,
173
+ santanderPayBackMin: 250,
174
+ transportationCost: null
175
+ },
176
+ buy: {
177
+ currentSalesPriceExtra: 16110,
178
+ highestPriceExtra: 19349
179
+ }
180
+ },
181
+ seoText: 'Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008,Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Small Car, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008, Diesel, Manual, Gear Box, HU 06/2008',
182
+ onFinancingClick: action('financing click'),
183
+ onContainerClick: action('container click'),
184
+ onFavoriteClick: action('favorite click'),
185
+ };
186
+
187
+ return (
188
+ <>
189
+ <div className={styles.wrapper}>
190
+ <Resizable {...resizableProps}>
191
+ <VehicleSmallCardForDealerships {...dealershipsProps} />
192
+ </Resizable>
193
+ </div>
194
+ </>
195
+ );
196
+
197
+ });
198
+
199
+ storiesOf('VehicleSmallCardForDealerships', module).add('VehicleSmallCardForDealerships', () => <VehicleSmallCardStory />);
@@ -0,0 +1,40 @@
1
+ @import '../../theme/theme.styl';
2
+
3
+ .wrapper
4
+ // position: fixed
5
+ width: 100%
6
+ height: 100%
7
+ left: 0px
8
+ background-color: red;
9
+ top: 0px
10
+ display: flex
11
+ background-color #CBCBCB
12
+ font-family: $font-style-arial
13
+
14
+ .resizable
15
+ margin-top: 0;
16
+ width: 375px;
17
+ padding: 100px;
18
+
19
+ .propsContainer
20
+ overflow-y: auto
21
+
22
+ .title
23
+ text-align: center
24
+ font-size: 22px
25
+ font-weight: bold
26
+
27
+ .input
28
+ display: inline-block !important
29
+ margin-left: 10px
30
+ position: absolute
31
+ right: 0
32
+
33
+ :global
34
+ .react-checkbox-tree
35
+ width: 550px
36
+ margin-right: 10px
37
+ padding-right: 10px
38
+ .rct-node
39
+ margin: 10px 0
40
+ position: relative
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { storiesOf } from '@storybook/react';
3
+ import { action } from '@storybook/addon-actions';
4
+
5
+ import Accordion from './Accordion';
6
+
7
+ const Label = ({ opened }) => (
8
+ <div style={{ padding: 10, borderBottom: '1px solid lightgray' }}>
9
+ {opened ? '-' : '+'} Some label here.
10
+ </div>
11
+ );
12
+
13
+ const Content = ({ opened }) => (
14
+ <div style={{ padding: 10 }}>
15
+ Wow some expandable content.
16
+ </div>
17
+ );
18
+
19
+ const item = {
20
+ content: <Content />,
21
+ title: <Label />
22
+ };
23
+
24
+ const props = {
25
+ // toggleMany: true,
26
+ defaultOpened: 0,
27
+ items: [item, item, item],
28
+ accordionName: 'storybookAccordion',
29
+ onPanelFocus: (panelKey) => action(`onPanelFocus ${panelKey}`),
30
+ onToggle: action('state changed')
31
+ };
32
+
33
+ storiesOf('_Common_UI', module)
34
+ .add('Accordion', () => (
35
+ <Accordion {...props} />
36
+ ));
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+
3
+ import { storiesOf } from '@storybook/react';
4
+ import { ROW_STYLES } from '../../../framework/constants';
5
+ import styles from './Badge.story.styl';
6
+ import Badge from './Badge';
7
+
8
+ storiesOf('_Common_UI', module)
9
+ .add('Badge', () => (
10
+ <div>
11
+ <div style={ROW_STYLES}>
12
+ <Badge>Push me </Badge>
13
+ </div>
14
+ <div style={ROW_STYLES}>
15
+ <Badge type='blue'>And then just</Badge>
16
+ </div>
17
+ <div style={ROW_STYLES}>
18
+ <Badge type='grey'>Touch me</Badge>
19
+ </div>
20
+ <div style={ROW_STYLES}>
21
+ <Badge type='green'>Until i get my</Badge>
22
+ </div>
23
+ <div style={ROW_STYLES}>
24
+ <Badge type='green' className={styles.customClass}>Until i get my</Badge>
25
+ </div>
26
+ </div>
27
+ ));
@@ -0,0 +1,5 @@
1
+ .customClass
2
+ width: 200px
3
+ height: 40px
4
+ font-size: 20px
5
+ line-height: 38px
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { storiesOf } from '@storybook/react';
3
+
4
+ import Bubble from './Bubble';
5
+
6
+ const stories = [
7
+ {
8
+ props: {
9
+ size: 'large',
10
+ type: 'orange',
11
+ children: <div style={{ display: 'flex', flexDirection: 'column' }}>
12
+ <span style={{ fontSize: 40, fontWeight: 700 }}>30 %</span>
13
+ <span style={{ fontSize: 24, fontWeight: 700 }}>SPAREN</span>
14
+ </div>
15
+ }
16
+ },
17
+ {
18
+ props: {
19
+ size: 'medium',
20
+ type: 'green',
21
+ children: <div style={{ display: 'flex', flexDirection: 'column', textAlign: 'center' }}>
22
+ <span style={{ fontSize: 24, fontWeight: 700 }}>Jahre</span>
23
+ <span style={{ fontSize: 14 }}>GARANTIE</span>
24
+ </div>
25
+ }
26
+ },
27
+ {
28
+ props: {
29
+ size: 'small',
30
+ type: 'yellow',
31
+ children: <span>0</span>
32
+ }
33
+ },
34
+ {
35
+ props: {
36
+ size: 'tiny',
37
+ type: 'orange',
38
+ children: <span style={{ fontSize: 12 }}>0</span>
39
+ }
40
+ }
41
+ ]
42
+
43
+ storiesOf('_Common_UI', module)
44
+ .add('Bubble', () => (
45
+ <div style={{ display: 'flex', flexDirection: 'column' }}>
46
+ {stories.map(({ props }) => (
47
+ <div>
48
+ <Bubble {...props} />
49
+ </div>
50
+ ))}
51
+ </div>
52
+ ));
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+
3
+ import { storiesOf } from '@storybook/react';
4
+ import { action } from '@storybook/addon-actions';
5
+ import { ROW_STYLES } from '../../../framework/constants';
6
+
7
+ import Button from './Button.tsx';
8
+ import styles from './Button.story.styl';
9
+
10
+ const btnDefault = {
11
+ loading: false,
12
+ disabled: false,
13
+
14
+ onClick: action('button click'),
15
+ onHover: action('button hover'),
16
+
17
+ onMouseEnter: action('button mouse enter'),
18
+ onMouseLeave: action('button mouse leave')
19
+ };
20
+ const btnSecondary = Object.assign({}, btnDefault, { color: 'primary' });
21
+ const btnDanger = Object.assign({}, btnDefault, { color: 'secondary' });
22
+ const btnGhost = Object.assign({}, btnDefault, { color: 'primary', variant: 'outlined' });
23
+ const btnLoading = Object.assign({}, btnDefault, { loading: true });
24
+ const btnDisabled = Object.assign({}, btnDefault, { disabled: true });
25
+ const btnCustomSize = Object.assign({}, btnDefault, { className: styles.button });
26
+
27
+ storiesOf('_Common_UI', module)
28
+ .add('Button', () => (
29
+ <div>
30
+ <div style={ROW_STYLES}>
31
+ <Button {...btnDefault }>Push me </Button>
32
+ </div>
33
+ <div style={ROW_STYLES}>
34
+ <Button {...btnSecondary}>And then just</Button>
35
+ </div>
36
+ <div style={ROW_STYLES}>
37
+ <Button {...btnDanger} color='secondary'>Touch me</Button>
38
+ </div>
39
+ <div style={ROW_STYLES}>
40
+ <Button {...btnGhost} color='primary' variant='outlined'>Touch me</Button>
41
+ </div>
42
+ <div style={ROW_STYLES}>
43
+ <Button {...btnDisabled}>Until i get my</Button>
44
+ </div>
45
+ <div style={ROW_STYLES}>
46
+ <Button {...btnLoading}>Until i get my</Button>
47
+ </div>
48
+ <div style={ROW_STYLES}>
49
+ <Button {...btnCustomSize}>satisfaction, satisfaction, satisfaction</Button>
50
+ </div>
51
+ </div>
52
+ ));
@@ -0,0 +1,5 @@
1
+ .button
2
+ width: 280px
3
+ height: 50px
4
+ background-color: #BADA55
5
+ text-transform: uppercase
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+
3
+ import { storiesOf } from '@storybook/react';
4
+ import { action } from '@storybook/addon-actions';
5
+ import { ROW_STYLES } from '../../../framework/constants';
6
+
7
+ import Button from './Button.tsx';
8
+ import styles from './Button.story.styl';
9
+
10
+ const btnDefault = {
11
+ type: 'primary',
12
+
13
+ loading: false,
14
+ disabled: false,
15
+
16
+ onClick: action('button click'),
17
+ onHover: action('button hover'),
18
+
19
+ onMouseEnter: action('button mouse enter'),
20
+ onMouseLeave: action('button mouse leave')
21
+ };
22
+ const btnSecondary = Object.assign({}, btnDefault, { type: 'secondary' });
23
+ const btnDanger = Object.assign({}, btnDefault, { type: 'danger' });
24
+ const btnGhost = Object.assign({}, btnDefault, { type: 'ghost' });
25
+ const btnLoading = Object.assign({}, btnDefault, { loading: true });
26
+ const btnDisabled = Object.assign({}, btnDefault, { disabled: true });
27
+ const btnCustomSize = Object.assign({}, btnDefault, { className: styles.button });
28
+
29
+ storiesOf('_Common_UI', module)
30
+ .add('ButtonOld', () => (
31
+ <div>
32
+ <div style={ROW_STYLES}>
33
+ <Button {...btnDefault}>Push me </Button>
34
+ </div>
35
+ <div style={ROW_STYLES}>
36
+ <Button {...btnSecondary}>And then just</Button>
37
+ </div>
38
+ <div style={ROW_STYLES}>
39
+ <Button {...btnDanger}>Touch me</Button>
40
+ </div>
41
+ <div style={ROW_STYLES}>
42
+ <Button {...btnGhost}>Touch me</Button>
43
+ </div>
44
+ <div style={ROW_STYLES}>
45
+ <Button {...btnDisabled}>Until i get my</Button>
46
+ </div>
47
+ <div style={ROW_STYLES}>
48
+ <Button {...btnLoading}>Until i get my</Button>
49
+ </div>
50
+ <div style={ROW_STYLES}>
51
+ <Button {...btnCustomSize}>satisfaction, satisfaction, satisfaction</Button>
52
+ </div>
53
+ </div>
54
+ ));
@@ -0,0 +1,5 @@
1
+ .button
2
+ width: 280px
3
+ height: 50px
4
+ background-color: #BADA55
5
+ text-transform: uppercase