@bytebrand/fe-ui-core 4.1.23 → 4.1.24

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 (70) hide show
  1. package/package.json +1 -1
  2. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -1
  3. package/source/components/Alternative/DealerInfo.tsx +17 -12
  4. package/source/components/OfferPanel/AboAccordion/AboAccordion.tsx +1 -1
  5. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +1 -1
  6. package/source/components/RateSearchWidget/RateSearchWidget.tsx +4 -4
  7. package/source/components/SearchFilters/common/FilterBlock/FilterBlock.styled.tsx +1 -1
  8. package/source/components/SearchFilters/common/FilterBlock/FilterBlock.tsx +24 -24
  9. package/source/components/SearchFilters/common/RangeControlled/RangeControlled.tsx +4 -5
  10. package/source/components/SearchFilters/filters/Consumption.tsx +2 -2
  11. package/source/components/SearchFilters/filters/Cost.tsx +30 -28
  12. package/source/components/SearchFilters/filters/EmissionSticker.tsx +14 -14
  13. package/source/components/SearchFilters/filters/FirstRegistration.tsx +2 -2
  14. package/source/components/SearchFilters/filters/ImagesCount.tsx +3 -3
  15. package/source/components/SearchFilters/filters/InteriorColor.tsx +2 -2
  16. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -2
  17. package/source/components/SearchFilters/filters/MakeModel.tsx +1 -2
  18. package/source/components/SearchFilters/filters/Mileage.tsx +3 -4
  19. package/source/components/SearchFilters/filters/Owners.tsx +0 -1
  20. package/source/components/SearchFilters/filters/Power.tsx +3 -6
  21. package/source/components/SearchFilters/filters/PriceDifference.tsx +4 -5
  22. package/source/components/SearchPage/ChipFilter/ChipFilter.tsx +1 -1
  23. package/source/components/SearchPage/Filters/MakeModel/MakeModel.tsx +3 -3
  24. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +1 -1
  25. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +1 -1
  26. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +4 -4
  27. package/source/components/SearchPageMobile/FiltersDetailed/FirstRegistration.tsx +1 -1
  28. package/source/components/SearchPageMobile/FiltersDetailed/Fuel.tsx +1 -1
  29. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -2
  30. package/source/components/SearchPageMobile/FiltersDetailed/Mileage.tsx +2 -3
  31. package/source/components/SearchPageMobile/FiltersDetailed/Power.tsx +4 -4
  32. package/source/components/SearchPageMobile/FiltersDetailed/Price.tsx +3 -4
  33. package/source/components/SearchPageMobile/FiltersDetailed/Rate.tsx +2 -2
  34. package/source/components/SearchPageMobile/FiltersDetailed/Seats.tsx +2 -2
  35. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +1 -1
  36. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  37. package/source/components/SearchWidget/OfferDetalisWidget/OfferDetailsWidgetMobile.tsx +1 -1
  38. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +10 -7
  39. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +7 -7
  40. package/source/components/SearchWidgetsMobile/EngineTransDriveWidget/EngineTransDriveWidget.tsx +4 -5
  41. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.styled.tsx +2 -2
  42. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +8 -9
  43. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidgetCategory.tsx +17 -17
  44. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +2 -2
  45. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  46. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +5 -5
  47. package/source/components/SearchWidgetsMobile/StateWidget/StateWidget.tsx +14 -11
  48. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +1 -1
  49. package/source/components/_common/Checkbox/FormCheckbox.tsx +1 -1
  50. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +30 -27
  51. package/source/components/_common/Chip/Chip.tsx +1 -1
  52. package/source/components/_common/DropDown/DropDown.tsx +1 -2
  53. package/source/components/_common/ExpansionPanel/ExpansionPanel.styled.tsx +2 -9
  54. package/source/components/_common/IconSVG/IconSVGConfig.tsx +3 -1
  55. package/source/components/_common/IconSVG/SVG/settings/RemoveEye.tsx +1 -1
  56. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +56 -56
  57. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +31 -31
  58. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.tsx +26 -27
  59. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +7 -7
  60. package/source/components/_common/MaterialField/MaterialField.tsx +3 -3
  61. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +3 -3
  62. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +34 -32
  63. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.styled.tsx +3 -7
  64. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +1 -2
  65. package/source/components/_common/Range/Range.tsx +1 -1
  66. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +7 -2
  67. package/source/framework/constants/app.ts +1 -1
  68. package/source/framework/constants/highlights.ts +1 -1
  69. package/source/framework/types/types.ts +1 -1
  70. package/source/framework/utils/CommonUtils.ts +27 -15
@@ -7,12 +7,12 @@ import _isEmpty from 'lodash/isEmpty';
7
7
  import { Theme, ArrowSelect, CloseButton, FlexWrap } from './MaterialSelect.styled';
8
8
  import { isMobileOnly } from 'react-device-detect';
9
9
 
10
- export interface Items {
10
+ export interface IItems {
11
11
  value: string | number;
12
12
  label: string;
13
13
  isDisabled?: boolean;
14
14
  isSeries?: boolean;
15
- };
15
+ }
16
16
 
17
17
  export interface IVehicleModalProps {
18
18
  t?: (key: string, options?: object) => string;
@@ -32,7 +32,7 @@ export interface IVehicleModalProps {
32
32
  icon?: string;
33
33
  children?: JSX.Element | JSX.Element[];
34
34
  onChange: (value: any) => void;
35
- items: Items[];
35
+ items: IItems[];
36
36
  selectClassName?: string;
37
37
  }
38
38
 
@@ -59,19 +59,22 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
59
59
  selectClassName,
60
60
  required,
61
61
  items,
62
- icon,
62
+ icon
63
63
  }: IVehicleModalProps) => {
64
- const [ newValue, setValue ] = useState('');
65
- const [ multipleValue, setMultipleValue ] = React.useState([]);
64
+ const [newValue, setValue] = useState('');
65
+ const [multipleValue, setMultipleValue] = React.useState([]);
66
66
 
67
- useEffect(() => {
68
- setValue(value);
69
- setMultipleValue(value);
70
- }, [value]);
67
+ useEffect(
68
+ () => {
69
+ setValue(value);
70
+ setMultipleValue(value);
71
+ },
72
+ [value]
73
+ );
71
74
 
72
75
  const handleChange = (event: SelectChangeEvent<any>) => {
73
76
  const {
74
- target: { value },
77
+ target: { value }
75
78
  } = event;
76
79
 
77
80
  if (multiple) {
@@ -96,9 +99,9 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
96
99
  classNameIcon
97
100
  );
98
101
 
99
- const renderItems = (items: Items[]) => {
100
- if (_isEmpty(items)) return <MenuItem disabled>No options</MenuItem>
101
- return items.map(({ value, label, isDisabled = false, isSeries = false } : Items, index: number) => {
102
+ const renderItems = (items: IItems[]) => {
103
+ if (_isEmpty(items)) return <MenuItem disabled>No options</MenuItem>;
104
+ return items.map(({ value, label, isDisabled = false, isSeries = false } : IItems, index: number) => {
102
105
  const setDisabled = isDisabled || isSeries;
103
106
  if (multiple) {
104
107
  return (
@@ -106,23 +109,22 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
106
109
  <Checkbox checked={multipleValue.indexOf(value) > -1} />
107
110
  <ListItemText primary={label} />
108
111
  </MenuItem>
109
- )
110
- } else {
111
- return (
112
- <MenuItem
113
- key={`${value}_${index}`}
114
- value={value}
115
- disabled={setDisabled}
116
- sx={setDisabled ? {
117
- backgroundColor: '#e8e8e8',
118
- color: '#333',
119
- opacity: '1 !important'
120
- } : null}
121
- >
122
- {!!t ? t(`${namespace}${cbd ? ':' : '.'}${label}`) : getLabel(label, setDisabled)}
123
- </MenuItem>
124
- )
112
+ );
125
113
  }
114
+ return (
115
+ <MenuItem
116
+ key={`${value}_${index}`}
117
+ value={value}
118
+ disabled={setDisabled}
119
+ sx={setDisabled ? {
120
+ backgroundColor: '#e8e8e8',
121
+ color: '#333',
122
+ opacity: '1 !important'
123
+ } : null}
124
+ >
125
+ {!!t ? t(`${namespace}${cbd ? ':' : '.'}${label}`) : getLabel(label, setDisabled)}
126
+ </MenuItem>
127
+ );
126
128
  });
127
129
  };
128
130
 
@@ -156,7 +158,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
156
158
  <>
157
159
  {isClearable && (
158
160
  // tslint-disable-next-line
159
- <CloseButton sx={{ display: !!isValueEmpty ? 'block' : 'none'}} onClick={handleClearClick}>
161
+ <CloseButton sx={{ display: !!isValueEmpty ? 'block' : 'none' }} onClick={handleClearClick}>
160
162
  <IconSVG name='close' customDimensions />
161
163
  </CloseButton>
162
164
  )}
@@ -171,7 +173,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
171
173
  disableAutoFocus: true,
172
174
  elevation: 0,
173
175
  style: {
174
- position: "absolute",
176
+ position: 'absolute',
175
177
  marginTop: 'auto'
176
178
  },
177
179
  PaperProps: {
@@ -12,16 +12,12 @@ export const StyledButton = styled(Button)({
12
12
  alignItems: 'center',
13
13
  justifyContent: 'center',
14
14
  ['@media all and (min-width: 992px)'] :// and (min-height: $tablet)// -- set mobile layout for high resolution in a landscape mode ACF-3974
15
- {textTransform: 'uppercase'}
15
+ { textTransform: 'uppercase' }
16
16
  });
17
17
 
18
18
  export const StyledIconSVG = styled(IconSVG)({
19
19
  marginRight: 10,
20
20
  fill: 'white',
21
21
  width: '1.5em',
22
-
23
- path: {
24
- fill: ({color}) => (color ? color: '#fff')
25
- }
26
-
27
- });
22
+ path: { fill: ({ color }) => (color ? color : '#fff') }
23
+ });
@@ -8,7 +8,6 @@ import styles from './OfferRequestButtonWrapper.styl';
8
8
  import { supportPhoneLink } from '../../../framework/constants/app';
9
9
  import { StyledButton, StyledIconSVG } from './OfferRequestButtonWrapper.styled';
10
10
 
11
-
12
11
  const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapperProps> = ({
13
12
  t,
14
13
  car,
@@ -86,7 +85,7 @@ const OfferRequestBtnWrapper: React.FunctionComponent<IOfferRequestButtonWrapper
86
85
 
87
86
  {isAdditionalOption ? (
88
87
  <Visible xs sm md>
89
- <StyledButton onClick={() => location.href=`tel:${supportPhoneLink}`} variant='outlined' color='primary' className={classnames(styles.controlButton, styles.phoneButton)}>
88
+ <StyledButton onClick={() => location.href = `tel:${supportPhoneLink}`} variant='outlined' color='primary' className={classnames(styles.controlButton, styles.phoneButton)}>
90
89
  <StyledIconSVG name='popoverPhone' className={styles.phoneIcon} customDimensions />
91
90
  {t('sidebar.callUp')}
92
91
  </StyledButton>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormattedNumber from '../../FormattedNumber/FormattedNumber';
3
- import { Slider} from '@mui/material';
3
+ import { Slider } from '@mui/material';
4
4
  import { isMobileOnly } from 'react-device-detect';
5
5
  import { ThemeProvider } from '@mui/material/styles';
6
6
 
@@ -103,7 +103,7 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
103
103
  onFilterChange = (field: string, value: any, index?: number, isSeries?: boolean) => {
104
104
  const { addModelsToFilters, changeFilterValue, changeSeries, getModelsInfoByMaker } = this.props;
105
105
  let newValue = _get(value, 'value') || value;
106
-
106
+
107
107
  if (newValue && newValue.from === 0) {
108
108
  newValue.from = '0';
109
109
  }
@@ -370,7 +370,12 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
370
370
  if ((!isDealerSuperAdmin || isAlternative) && title === SUPER_ADMIN_FILTER_NAME) return null;
371
371
 
372
372
  return (
373
- <FilterBlock isAdminPanel={title === SUPER_ADMIN_FILTER_NAME} key={index} title={t(`SearchPage:filterGroups.${title}`)} expand={index === (isDealerSuperAdmin && !isAlternative ? 0 : 1)} className={title}>
373
+ <FilterBlock
374
+ isAdminPanel={title === SUPER_ADMIN_FILTER_NAME}
375
+ key={index} title={t(`SearchPage:filterGroups.${title}`)}
376
+ expand={index === (isDealerSuperAdmin && !isAlternative ? 0 : 1)}
377
+ className={title}
378
+ >
374
379
  {component}
375
380
  </FilterBlock>
376
381
  );
@@ -16,7 +16,7 @@ export const config: IConfig = {
16
16
  },
17
17
 
18
18
  production: {
19
- DOMAIN: productionDomain,
19
+ DOMAIN: productionDomain
20
20
  }
21
21
  };
22
22
 
@@ -66,7 +66,7 @@ export const parkingAssistants = {
66
66
  'selector_parkingAssistants_camera',
67
67
  'selector_parkingAssistants_360Camera',
68
68
  'selector_parkingAssistants_selfSteeringSystems',
69
- 'selector_parkingAssistants_other',
69
+ 'selector_parkingAssistants_other'
70
70
  ],
71
71
  endpointKey: 'assistants.parkingAssistants'
72
72
  };
@@ -175,7 +175,7 @@ export interface IVehicleDetailedSidebarPriceProps {
175
175
  isAlternative?: boolean;
176
176
  // currentSalesPrice?: number;
177
177
  originalSalesPrice?: number;
178
- common: { isStrikeShown?: boolean, currentSalesPrice?: number }
178
+ common: { isStrikeShown?: boolean, currentSalesPrice?: number };
179
179
  }
180
180
  export interface ITabsProps {
181
181
  t?: (key: string, options?: object) => string;
@@ -24,12 +24,18 @@ export const formatMileage = (millage: number | string) => {
24
24
  export const getFormattedNumber = (num: number) => Number.isFinite(num) ? num.toLocaleString('de-DE') : null;
25
25
 
26
26
  export const numberWithDot = (value: number | string) => {
27
- if (value === 'any' || value === 'beliebig') {
28
- return value;
29
- } else {
30
- return getFormattedNumber(+value);
27
+ switch (value) {
28
+ case 'any':
29
+ return value;
30
+ case 'beliebig':
31
+ return value;
32
+ default: return getFormattedNumber(+value);
31
33
  }
32
- }
34
+ // if (value === 'any' || value === 'beliebig') {
35
+ // return value;
36
+ // }
37
+ return getFormattedNumber(+value);
38
+ };
33
39
 
34
40
  export const arrToObj = (arr: string[]): { [key: string]: boolean } => {
35
41
  if (!Array.isArray(arr)) return {};
@@ -359,7 +365,10 @@ export const fixNumber = (num: number | string) => {
359
365
  export const getOfferSliders = (financingConfig: any, t: (key: string, options?: object) => string, priceTabIndex: null | number, componentType: string) => {
360
366
  const offerObj = offers[+priceTabIndex];
361
367
  const offerConfig = financingConfig[offerObj.name];
362
- const currentSalesPrice = financingConfig.common ? financingConfig.common.currentSalesPrice : financingConfig.currentSalesPrice; // TODO: fix deprecated. Correct is "financingConfig.common.currentSalesPrice"
368
+ const currentSalesPrice =
369
+ financingConfig.common ?
370
+ financingConfig.common.currentSalesPrice :
371
+ financingConfig.currentSalesPrice; // TODO: fix deprecated. Correct is "financingConfig.common.currentSalesPrice"
363
372
  return offerObj.sliders
364
373
  .map((slider: any, index) => {
365
374
  if (componentType === 'checkout' && index === 1 && priceTabIndex === 0) return; // remove checkout annual mileage for financing
@@ -393,7 +402,7 @@ export const getSupportedImageFormat = (IMAGE_URL: string, vehicleID: string, im
393
402
  return webpFeature ? `${vehicleImageURL}/${size}-cached.webp` : `${vehicleImageURL}/${size}-cached.jpeg`;
394
403
  };
395
404
 
396
- export function getChipFilterValue (chip: any, t: (key: string, options?: object) => string, language: string = 'de') {
405
+ export function getChipFilterValue(chip: any, t: (key: string, options?: object) => string, language: string = 'de') {
397
406
  let filterValue: string;
398
407
  let title: string;
399
408
  let from: string;
@@ -484,7 +493,7 @@ export function getChipFilterValue (chip: any, t: (key: string, options?: object
484
493
  filterValue = t(`cbd:${chipFilterValue}`);
485
494
  }
486
495
  return filterValue;
487
- };
496
+ }
488
497
 
489
498
  function getUtmQueryParameter() {
490
499
  const query = window.location.search;
@@ -493,15 +502,18 @@ function getUtmQueryParameter() {
493
502
 
494
503
  const queryString = /^[?]/.test(query) ? query.slice(1) : query;
495
504
 
496
- const result = queryString.split('&').reduce((params: any, param: string) => {
497
- const [key, value] = param.split('=');
505
+ const result = queryString.split('&').reduce(
506
+ (params: any, param: string) => {
507
+ const [key, value] = param.split('=');
498
508
 
499
- if (!/^source|^campaign|^medium|^content|^term|^reference|^gclid|^adgroupid|^keyword/.test(key)) { return params; }
509
+ if (!/^source|^campaign|^medium|^content|^term|^reference|^gclid|^adgroupid|^keyword/.test(key)) { return params; }
500
510
 
501
- params[key] = value ? decodeURIComponent(value.replace(/\+/g, ' ')) : '';
511
+ params[key] = value ? decodeURIComponent(value.replace(/\+/g, ' ')) : '';
502
512
 
503
- return params;
504
- }, {}); // eslint-disable-line indent,@typescript-eslint/indent
513
+ return params;
514
+ },
515
+ {}
516
+ ); // eslint-disable-line indent,@typescript-eslint/indent
505
517
 
506
518
  return result;
507
519
  }
@@ -517,4 +529,4 @@ export function setUtmParameters() {
517
529
  expiresDate.setDate(expiresDate.getDate() + 1);
518
530
 
519
531
  document.cookie = `marketing=${JSON.stringify(marketing)};expires=${expiresDate};domain=.${config.DOMAIN};path=/`;
520
- }
532
+ }