@bytebrand/fe-ui-core 4.2.96 → 4.2.97

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 (56) hide show
  1. package/package.json +1 -1
  2. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
  3. package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -2
  4. package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.jsx} +7 -12
  5. package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
  6. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -10
  7. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  8. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  9. package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
  10. package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +2 -2
  11. package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
  12. package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
  13. package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
  14. package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
  15. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
  16. package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
  17. package/source/components/SearchFilters/filters/Power.tsx +1 -1
  18. package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
  19. package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
  20. package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
  21. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
  22. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
  23. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
  24. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
  25. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
  26. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  27. package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
  28. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
  29. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
  30. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
  31. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
  32. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  33. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
  34. package/source/components/Stepper/Stepper.tsx +4 -3
  35. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +1 -1
  36. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +1 -4
  37. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
  38. package/source/components/_common/Chip/Chip.tsx +1 -3
  39. package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
  40. package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
  41. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
  42. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
  43. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +8 -11
  44. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
  45. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
  46. package/source/components/_common/Modal/Modal.tsx +2 -5
  47. package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
  48. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +7 -3
  49. package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
  50. package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
  51. package/source/components/_common/UserMenu/MaterialMenuItem.tsx +9 -6
  52. package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
  53. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +1 -1
  54. package/source/framework/constants/common.ts +9 -1
  55. package/source/framework/types/types.ts +3 -1
  56. package/source/framework/utils/DateUtils.ts +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.2.96",
3
+ "version": "4.2.97",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -15,7 +15,6 @@ import {
15
15
 
16
16
  import ExpansionPanel from '../_common/ExpansionPanel/ExpansionPanel';
17
17
  import Accordion from '../_common/AccordionWrapper/AccordionWrapper';
18
- // import AccordionItem from '../_common/AccordionWrapper/AccordionItem/AccordionItem';
19
18
  import VehicleProperty from '../VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty';
20
19
  import IconSVG from '../_common/IconSVG/IconSVG';
21
20
  import { getActualHighlights } from '../../framework/constants/highlights';
@@ -35,7 +34,7 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
35
34
  }
36
35
 
37
36
  handleChange =
38
- (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
37
+ (panel: string) => (_: React.SyntheticEvent, isExpanded: boolean) => {
39
38
  this.setState({ expanded: isExpanded ? panel : false });
40
39
  };
41
40
 
@@ -210,7 +209,6 @@ class AccordionWidget extends React.Component<IAccardionSectionProps, IAccardion
210
209
  onChange={this.handleChange}
211
210
  expanded={this.state.expanded}
212
211
  defaultExpanded={section.expanded}
213
- // titleClassName={styles.titleClassName}
214
212
  >
215
213
  {section.component}
216
214
  </ExpansionPanel>
@@ -23,8 +23,6 @@ const PanelConfig: React.FunctionComponent<IPanelConfigProps> = ({
23
23
  OfferBlockComponent,
24
24
  offerBlockProps,
25
25
  postfix,
26
- isOpenDetails,
27
- onToggleDetailsClick,
28
26
  isAlternative
29
27
  }) => {
30
28
  const requestOfferProps = {
@@ -3,11 +3,9 @@ import { createTheme } from '@mui/material/styles';
3
3
  export const theme = createTheme({
4
4
  components: {
5
5
  MuiToggleButton: {
6
- variants: [
7
- {
8
- props: { variant: 'sidebar' },
9
- style: {
10
- width: 40,
6
+ styleOverrides: {
7
+ root: ({ ownerState: { variant } }) => ({
8
+ ...(variant === 'sidebar' && {
11
9
  height: 41,
12
10
  color: '#333',
13
11
  width: '100%',
@@ -18,13 +16,10 @@ export const theme = createTheme({
18
16
  '&.Mui-selected:hover': {
19
17
  backgroundColor: '#005ccb',
20
18
  color: '#fff'
21
- },
22
- // '&:hover': {
23
- // backgroundColor: 'transparent'
24
- // }
25
- }
26
- }
27
- ]
19
+ }
20
+ })
21
+ })
22
+ }
28
23
  }
29
24
  }
30
25
  });
@@ -2,7 +2,7 @@ import React, { FC } from 'react';
2
2
  import _get from 'lodash/get';
3
3
  import styles from '../OfferPanel.styl';
4
4
  import { modalsTranslate } from '../../../locales/data';
5
- import ToggleButton from '@mui/material/ToggleButton';
5
+ import ToggleButton, { ToggleButtonProps } from '@mui/material/ToggleButton';
6
6
  import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
7
7
  import { ThemeProvider } from '@mui/material/styles';
8
8
  import { theme } from './MuiOfferPeriod.theme';
@@ -14,6 +14,24 @@ export interface IOfferPeriod {
14
14
  onChange: (key: string, value: number) => void;
15
15
  }
16
16
 
17
+ type ToggleButtonVariant =
18
+ | 'text'
19
+ | 'outlined'
20
+ | 'contained'
21
+ | 'sidebar';
22
+
23
+ interface CustomToggleButtonProps extends Omit<ToggleButtonProps, 'variant'> {
24
+ variant: ToggleButtonVariant;
25
+ }
26
+
27
+ const MyCustomToggleButton: FC<CustomToggleButtonProps> = (props) => {
28
+ return (
29
+ <ToggleButton {...props}>
30
+ {props.children}
31
+ </ToggleButton>
32
+ );
33
+ };
34
+
17
35
  const OfferPeriod: FC<IOfferPeriod> = ({ paybackPeriod, periods, t, onChange }) => {
18
36
 
19
37
  return (
@@ -27,13 +45,19 @@ const OfferPeriod: FC<IOfferPeriod> = ({ paybackPeriod, periods, t, onChange })
27
45
  color='primary'
28
46
  value={paybackPeriod}
29
47
  exclusive
30
- onChange={(e) => {
31
- onChange('paybackPeriod', +e.target.value);
48
+ onChange={(event) => {
49
+ onChange('paybackPeriod', +(event.target as HTMLInputElement).value);
32
50
  }}
33
51
  >
34
52
  {periods.map((period) => {
35
53
  return (
36
- <ToggleButton variant='sidebar' key={period} value={period}>{period}</ToggleButton>
54
+ <MyCustomToggleButton
55
+ variant={'sidebar'}
56
+ key={period}
57
+ value={period}
58
+ >
59
+ {period}
60
+ </MyCustomToggleButton>
37
61
  );
38
62
  })}
39
63
  </ToggleButtonGroup>
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import styles from './OfferCheckboxGroup.styl';
3
3
  import classnames from 'classnames';
4
4
  // import FormattedNumber from '../../FormattedNumber/FormattedNumber';
@@ -22,11 +22,13 @@ export interface ICheckboxProps {
22
22
  containerClassName?: string;
23
23
  checkboxClassName?: string;
24
24
  labelClassName?: string;
25
+ labelPlacement?: "end" | "start" | "top" | "bottom";
25
26
  tooltipDescription?: string;
26
27
  checkboxPriceValue: any;
27
28
  tooltipPosX?: string;
28
29
  error?: boolean;
29
- label?: JSX.Element | string | null | ReactNode;
30
+ description?: string;
31
+ label?: JSX.Element | string | null;
30
32
  }
31
33
 
32
34
  class CheckboxContainer extends React.Component<ICheckboxProps, {}> {
@@ -87,8 +89,8 @@ class CheckboxContainer extends React.Component<ICheckboxProps, {}> {
87
89
 
88
90
  render() {
89
91
  const {
90
- containerClassName, checkboxClassName, labelClassName, reversed,
91
- checked, disabled, value, error, label, tooltipDescription, checkboxPriceValue, tooltipPosX, labelPlacement,
92
+ containerClassName, labelClassName, reversed,
93
+ checked, disabled, error, label, tooltipDescription, labelPlacement,
92
94
  description
93
95
  } = this.props;
94
96
 
@@ -105,12 +107,6 @@ class CheckboxContainer extends React.Component<ICheckboxProps, {}> {
105
107
  labelClassName
106
108
  );
107
109
 
108
- const checkboxClasses = classnames(
109
- styles.checkbox,
110
- checkboxClassName,
111
- { [styles.withLabel]: !!label }
112
- );
113
-
114
110
  const wrapInputClasses = classnames(
115
111
  styles.wrapInput,
116
112
  { [styles.reversed]: reversed }
@@ -11,7 +11,7 @@ interface IOfferPeriod {
11
11
  transferInstallments?: any;
12
12
  }
13
13
 
14
- const OfferCheckboxGroup: FC<IOfferPeriod> = ({ additionalService, transferInstallments, isAboAccordionExpanded0 = true, priceTabIndex, labelClassname }) => {
14
+ const OfferCheckboxGroup: FC<IOfferPeriod> = ({ additionalService, transferInstallments, isAboAccordionExpanded0 = true, priceTabIndex }) => {
15
15
  const offerGroupClass = classNames(styles.checkboxWrapped, { [styles.checkBoxGroup]: priceTabIndex !== THREE });
16
16
  return (
17
17
  <div className={offerGroupClass}>
@@ -11,7 +11,7 @@ import CheckboxMaterial from '../_common/CheckboxMaterial/CheckboxMaterial';
11
11
  interface IFinalAdvice {
12
12
  checked: boolean;
13
13
  label: string;
14
- onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any) => void;
14
+ onChange?: (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any) => void;
15
15
  reversed?: boolean;
16
16
  value: string;
17
17
  }
@@ -1,6 +1,5 @@
1
1
  import React, { FC, ChangeEvent } from 'react';
2
2
  import _get from 'lodash/get';
3
- import classNames from 'classnames';
4
3
  import styles from './OfferPeriod.styl';
5
4
  import { modalsTranslate } from '../../../locales/data';
6
5
  import CheckboxMaterial from '../../_common/CheckboxMaterial/CheckboxMaterial';
@@ -22,9 +21,6 @@ const OfferPeriod: FC<IOfferPeriod> = ({ paybackPeriod, periods, t, onChange })
22
21
  <div className={styles.periods}>
23
22
  {periods.map((period: number) => {
24
23
  const isChecked = paybackPeriod === period;
25
- const labelClassName = classNames(
26
- { [styles.checked]: isChecked }
27
- );
28
24
  const inputProps = {
29
25
  type: 'period',
30
26
  name: 'duration',
@@ -157,8 +157,8 @@ class PriceRatingDetailed extends React.Component<IPriceRatingDetailedProps, IPr
157
157
  const MIN_PRICE = 500;
158
158
  const MARGIN_OFFSET = price >= MIN_PRICE ? MIN_PRICE : (price / 2);
159
159
  const strings = {
160
- general: `${getFormattedPrice(marginToLeft ? price - MARGIN_OFFSET : min)} – ${getFormattedPrice(marginToRight ? price + MARGIN_OFFSET : max)}\u00A0€`,
161
- compact: <>{getFormattedPrice(marginToLeft ? price - MARGIN_OFFSET : min)}<br />{t(`${i18nPrefix}priceTo`)} {getFormattedPrice(marginToRight ? price + MARGIN_OFFSET : max)} €</>
160
+ general: `${getFormattedPrice((marginToLeft ? price - MARGIN_OFFSET : min) as number)} – ${getFormattedPrice((marginToRight ? price + MARGIN_OFFSET : max) as number)}\u00A0€`,
161
+ compact: <>{getFormattedPrice((marginToLeft ? price - MARGIN_OFFSET : min) as number)}<br />{t(`${i18nPrefix}priceTo`)} {getFormattedPrice((marginToRight ? price + MARGIN_OFFSET : max) as number)} €</>
162
162
  };
163
163
 
164
164
  return (
@@ -14,7 +14,7 @@ export interface IDriveTypeProps {
14
14
  }
15
15
 
16
16
  class DriveType extends React.Component<IDriveTypeProps, {}> {
17
- onDriveTypeChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
17
+ onDriveTypeChange = (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any): void => {
18
18
  const { values } = this.props;
19
19
  event.stopPropagation();
20
20
  event.nativeEvent.stopImmediatePropagation();
@@ -11,7 +11,7 @@ export interface IEmissionStickerProps {
11
11
  }
12
12
 
13
13
  class EmissionSticker extends React.Component<IEmissionStickerProps, {}> {
14
- onFilterChange = (_event: any, value: string[]) => {
14
+ onFilterChange = (_event?: React.ChangeEvent<HTMLInputElement>, value?: any) => {
15
15
  this.props.onChange('OWNERS_OPTIONS', value);
16
16
  };
17
17
 
@@ -1,7 +1,6 @@
1
1
  import React, { memo } from 'react';
2
2
  import Slider from '../../_common/Slider/Slider';
3
3
  import _get from 'lodash/get';
4
- import { RANGE_FILTERS_DEFAULT_CONTROLS } from '../../../framework/constants/Search';
5
4
  import { sliceLessThan, sliceMoreThan } from '../../../framework/utils/CommonUtils';
6
5
  import { getSearchYears } from '../../../framework/utils/DateUtils';
7
6
  import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
@@ -16,7 +16,7 @@ export interface IInteriorColorProps {
16
16
  }
17
17
 
18
18
  const InteriorColor = ({ onChange, values, options, aggregation, t, className }: IInteriorColorProps) => {
19
- const onColorChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
19
+ const onColorChange = (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any): void => {
20
20
  event.stopPropagation();
21
21
  event.nativeEvent.stopImmediatePropagation();
22
22
  let _value = value;
@@ -11,12 +11,13 @@ interface IInteriorMaterialProps {
11
11
  values: any[];
12
12
  aggregation?: any;
13
13
  t: (key: string) => string;
14
+ isHorizontal?: boolean;
14
15
 
15
16
  onChange?: (event: any, value: string[]) => void;
16
17
  }
17
18
 
18
19
  const InteriorMaterial = ({ options, values, aggregation, t, onChange }: IInteriorMaterialProps) => {
19
- const onTypeChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
20
+ const onTypeChange = (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any): void => {
20
21
  event.stopPropagation();
21
22
  event.nativeEvent.stopImmediatePropagation();
22
23
  let _value = value;
@@ -2,7 +2,7 @@ import React, { memo } from 'react';
2
2
  import _get from 'lodash/get';
3
3
  import { isEqual } from 'lodash';
4
4
  import Slider from '../../_common/Slider/Slider';
5
- import { MILLAGE_FIX, RANGE_FILTERS_DEFAULT_CONTROLS } from '../../../framework/constants/Search';
5
+ import { MILLAGE_FIX } from '../../../framework/constants/Search';
6
6
  import { sliceLessThan, sliceMoreThan, numberWithDot } from '../../../framework/utils/CommonUtils';
7
7
  import styles from './commonFilters.styl';
8
8
  import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
@@ -5,7 +5,7 @@ import styles from './commonFilters.styl';
5
5
  import { isEqual } from 'lodash';
6
6
  import { RadioGroup } from '@mui/material';
7
7
  import CheckboxMaterial from '../../_common/CheckboxMaterial/CheckboxMaterial';
8
- import { POWER_FIX, RANGE_FILTERS_DEFAULT_CONTROLS } from '../../../framework/constants/Search';
8
+ import { POWER_FIX } from '../../../framework/constants/Search';
9
9
  import { sliceLessThan, sliceMoreThan } from '../../../framework/utils/CommonUtils';
10
10
 
11
11
  interface IPowerProps {
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
 
3
- import Checkbox from '../../_common/Checkbox/Checkbox';
4
3
  import styles from './StateOptions.styl';
5
4
  import FilterLabel from '../../_common/FilterLabel/FilterLabel';
6
5
  import CheckboxMaterial from '../../_common/CheckboxMaterial/CheckboxMaterial';
@@ -14,7 +14,7 @@ export interface ITransmissionProps {
14
14
  }
15
15
 
16
16
  class Transmission extends React.Component<ITransmissionProps, {}> {
17
- onTransmissionChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
17
+ onTransmissionChange = (event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any): void => {
18
18
  const { values } = this.props;
19
19
  event.stopPropagation();
20
20
  event.nativeEvent.stopImmediatePropagation();
@@ -5,7 +5,7 @@ import ChipFilter from '../ChipFilter/ChipFilter';
5
5
  import { SearchPage as SearchPageTranslate } from '../../../locales/data';
6
6
  import Chip from '@mui/material/Chip';
7
7
 
8
- import { getChipFilterValue, getFormattedPrice } from '../../../framework/utils/CommonUtils';
8
+ import { getChipFilterValue } from '../../../framework/utils/CommonUtils';
9
9
 
10
10
  export interface ISearchChipsProps {
11
11
  chips: any[];
@@ -21,9 +21,9 @@ class BodyType extends React.Component<IBodyTypeBlock> {
21
21
  || !_isEqual(aggregation, nextProps.aggregation)
22
22
  || t !== nextProps.t;
23
23
  }
24
- onBodyTypeCheckboxChange = (option: any) => (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => this.onFilterChange(checked, option);
24
+ onBodyTypeCheckboxChange = (option: any) => (_event?: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string) => this.onFilterChange(checked, option);
25
25
 
26
- onFilterChange = (_: boolean, fieldName: string): void => {
26
+ onFilterChange = (_: boolean | string, fieldName: string): void => {
27
27
  const { BODY_TYPE, onChange } = this.props;
28
28
  const bodyTypeField = 'BODY_TYPE';
29
29
  const values = [...BODY_TYPE.values];
@@ -37,7 +37,7 @@ class BodyType extends React.Component<IBodyTypeBlock> {
37
37
  onChange(bodyTypeField, values);
38
38
  };
39
39
 
40
- renderLabel = (option: string, isChecked: boolean): React.ReactNode => {
40
+ renderLabel = (option: string, isChecked: boolean): JSX.Element => {
41
41
  const { t, aggregation } = this.props;
42
42
  // const agg = aggregation && aggregation[option] || 0;
43
43
  const agg = aggregation && aggregation[option] ? aggregation[option] : 0;
@@ -1,4 +1,4 @@
1
- import React, { memo } from 'react';
1
+ import React from 'react';
2
2
  import _get from 'lodash/get';
3
3
 
4
4
  import styles from './Consumption.styl';
@@ -8,7 +8,7 @@ import { CONSUMPTION_FIX } from '../../../framework/constants/Search';
8
8
  export interface IConsumptionProps {
9
9
  values: any;
10
10
  options: any;
11
- controls: any;
11
+ controls?: any;
12
12
  shortTitle?: boolean;
13
13
  onChange: (fieldName: string, fieldValue: any) => void;
14
14
  t?: (phrase: string) => string;
@@ -25,7 +25,7 @@ class Doors extends React.Component<IDoorsProps, IDoorsState> {
25
25
  };
26
26
  }
27
27
 
28
- onFilterChange = (_: boolean, checked?: boolean, fieldName?: string): void => {
28
+ onFilterChange = (_:React.ChangeEvent<HTMLInputElement> | boolean, _checked?: string | boolean, fieldName?: any): void => {
29
29
  const { fieldValues } = this.props;
30
30
  let newValue: string[] = [...fieldValues];
31
31
 
@@ -1,4 +1,4 @@
1
- import React, { memo } from 'react';
1
+ import React from 'react';
2
2
  import _get from 'lodash/get';
3
3
  import styles from './MakeModel.styl';
4
4
  import MaterialSelect from '../../_common/MaterialSelect/MaterialSelect';
@@ -39,7 +39,7 @@ const BodyColorWidget = ({
39
39
 
40
40
  }: IBodyColorWidgetProps) => {
41
41
 
42
- const onColorChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
42
+ const onColorChange = (event?: React.ChangeEvent<HTMLInputElement>, checked?: string | boolean, value?: any): void => {
43
43
  event.stopPropagation();
44
44
  event.nativeEvent.stopImmediatePropagation();
45
45
  let _value = value;
@@ -55,7 +55,7 @@ const BodyColorWidget = ({
55
55
  onFilterChange('BODY_COLOR', _value);
56
56
  };
57
57
 
58
- const onCheckboxClick = (_: React.ChangeEvent<HTMLInputElement>, value: boolean): void => {
58
+ const onCheckboxClick = (_event?: React.ChangeEvent<HTMLInputElement>, value?: string | boolean): void => {
59
59
  onFilterChange('METALLIC', value ? 'exterior_metallic' : '');
60
60
  };
61
61
 
@@ -72,7 +72,7 @@ const BodyColorWidget = ({
72
72
  content: option,
73
73
  value: option,
74
74
  className: styles.color,
75
- labelPlacement: 'bottom',
75
+ labelPlacement: 'bottom' as 'bottom',
76
76
  checked: isChecked,
77
77
  label: <FilterLabel text={t(`cbd:${option}`)} agg={agg} isVertical={true}/>,
78
78
  onChange: onColorChange
@@ -50,7 +50,7 @@ const EnvironmentWidget: React.FC<IEnvironmentWidgetProps> = ({
50
50
  const getConsumption = _get(CONSUMPTION, 'values.to');
51
51
  const getEmissionClass = _get(EMISSION_CLASS, 'values');
52
52
 
53
- const onEmissionStickersChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any) => {
53
+ const onEmissionStickersChange = (event?: React.ChangeEvent<HTMLInputElement>, _checked?: string | boolean, value?: any) => {
54
54
  event.stopPropagation();
55
55
  event.nativeEvent.stopImmediatePropagation();
56
56
  const { values } = EMISSION_STICKER;
@@ -63,7 +63,7 @@ const EnvironmentWidget: React.FC<IEnvironmentWidgetProps> = ({
63
63
  onFilterChange(EMISSION_STICKER_KEY, value);
64
64
  };
65
65
 
66
- const onCheckboxClick = (_: React.ChangeEvent<HTMLElement>, value: boolean): void => {
66
+ const onCheckboxClick = (_: React.ChangeEvent<HTMLElement>, value?: boolean | string): void => {
67
67
  onFilterChange(PARTICULATE_FILTER_KEY, value ? 'engineData_particulateFilterDiesel' : '');
68
68
  };
69
69
 
@@ -132,7 +132,7 @@ const EnvironmentWidget: React.FC<IEnvironmentWidgetProps> = ({
132
132
  <MaterialAutocomplete
133
133
  size='custom'
134
134
  value={getConsumption ? getValue(getConsumption) : null}
135
- onChange={(value: string) => onFilterChange(CONSUMPTION_KEY, { from: void 0, to: value })}
135
+ onChange={(value: string) => onFilterChange(CONSUMPTION_KEY, { from: void 0, to: value } as any)}
136
136
  label={t('filters.consumption')}
137
137
  unit='l/100 km'
138
138
  items={getOptions(CONSUMPTION_FIX)}
@@ -29,7 +29,7 @@ export interface IHighlightsWidgetProps {
29
29
 
30
30
  class HighlightsWidget extends React.Component<IHighlightsWidgetProps, {}> {
31
31
 
32
- onFilterChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any) => {
32
+ onFilterChange = (event: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any) => {
33
33
  event.stopPropagation();
34
34
  event.nativeEvent.stopImmediatePropagation();
35
35
 
@@ -75,7 +75,7 @@ class HighlightsWidget extends React.Component<IHighlightsWidgetProps, {}> {
75
75
  };
76
76
 
77
77
  render(): JSX.Element {
78
- const { t, HIGHLIGHTS, Link } = this.props;
78
+ const { t, Link } = this.props;
79
79
 
80
80
  return (
81
81
  <div className={styles.highlights}>
@@ -1,7 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import Owners from '../../SearchFilters/filters/Owners';
3
3
  import MaterialSelect from '../../_common/MaterialSelect/MaterialSelect';
4
- import StateOptions from '../../SearchFilters/filters/StateOptions';
5
4
  import StateOptionsNew from '../../SearchFilters/filters/StateOptionsNew';
6
5
  import { VEHICLE_CONDITION_KEY, STATE_OPTIONS_KEY } from '../../../framework/constants/Search';
7
6
  import FilterLabel from '../../_common/FilterLabel/FilterLabel';
@@ -48,7 +47,7 @@ const StateWidget = (props: IStateWidgetProps) => {
48
47
  labelContainerClassName: styles.labelWrapper
49
48
  };
50
49
 
51
- const getCheckboxClickHandler = (name: string) => (_: React.ChangeEvent<HTMLInputElement>, value: boolean): void => {
50
+ const getCheckboxClickHandler = (name: string) => (_: React.ChangeEvent<HTMLInputElement>, value?: boolean | string): void => {
52
51
  const { VEHICLE_CONDITION: { values, options } } = props;
53
52
  const currentValues: any = {};
54
53
  options.forEach((key: string) => { currentValues[key] = values.includes(key); });
@@ -12,7 +12,7 @@ import Mileage from '../../SearchPageMobile/FiltersDetailed/Mileage';
12
12
  import Consumption from '../../SearchPageMobile/FiltersDetailed/Consumption';
13
13
  import FirstRegistration from '../../SearchPageMobile/FiltersDetailed/FirstRegistration';
14
14
  import MakeModel, { IMakeModelProps } from '../../SearchPageMobile/FiltersDetailed/MakeModel';
15
- import MakeModelExclude, { IMakeModelExcludeProps } from '../../SearchPageMobile/FiltersDetailed/MakeModelExclude';
15
+ import { IMakeModelExcludeProps } from '../../SearchPageMobile/FiltersDetailed/MakeModelExclude';
16
16
  import { COST_TYPE_DEFAULT, COST_TYPE_OPTIONS, RANGE_FILTERS, RANGE_FILTERS_DEFAULT_CONTROLS } from '../../../framework/constants/Search';
17
17
  import { OBJECT_FILTERS, RATE_DEFAULT_CONTROLS } from '../../../framework/constants/SearchWidget';
18
18
 
@@ -32,7 +32,7 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
32
32
  };
33
33
 
34
34
  shouldComponentUpdate(nextProps: any, nextState: any) {
35
- const { MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL, t, isNotDetailed } = this.props;
35
+ const { MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL, t } = this.props;
36
36
 
37
37
  const dataBlocks = {
38
38
  MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL
@@ -66,8 +66,8 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
66
66
  render(): React.ReactNode {
67
67
  const {
68
68
  MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL,
69
- onFilterChange, onChangeFilterControls, onAddMmsGroup, onRemoveMmsGroup, onDropDownFocus,
70
- MM_GROUPS_EXCLUDE, onAddMmExcludeGroup, onRemoveMmExcludeGroup, t, showModal, hideModal, onAddMmsGroupClick, isNotDetailed
69
+ onFilterChange, onChangeFilterControls, onRemoveMmsGroup, onDropDownFocus,
70
+ t, showModal, hideModal, onAddMmsGroupClick, isNotDetailed
71
71
  } = this.props;
72
72
  const commonProps = { t, onChange: onFilterChange };
73
73
 
@@ -39,7 +39,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
39
39
  CLIMATISATION, HEATER, MULTIMEDIA, SEATS_OPTIONS, WHEEL, LIGHTS, DOORS_OPTIONS, WINDOW_OPTIONS,
40
40
  MIRRORS_OPTIONS, LANDING_GEAR, EXTRAS_OPTIONS, DRIVER_SEATS, CO_DRIVER_SEATS, BACK_SEATS, HIGHLIGHTS,
41
41
  onFilterChange,
42
- onDropDownFocus,
42
+ // onDropDownFocus,
43
43
  onCategoryFocus,
44
44
  t } = props;
45
45
  const onCheckboxClick = (fieldName: string, categoryName: string, values: string[]): void => {
@@ -116,11 +116,11 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
116
116
  return onFilterChange(categoryName, values);
117
117
  };
118
118
 
119
- const onDropdownFocus = (fieldName: string) => {
120
- if (onDropDownFocus) {
121
- onDropDownFocus(fieldName);
122
- }
123
- };
119
+ // const onDropdownFocus = (fieldName: string) => {
120
+ // if (onDropDownFocus) {
121
+ // onDropDownFocus(fieldName);
122
+ // }
123
+ // };
124
124
 
125
125
  const getOptions = (options: any, categoryName?: string) => {
126
126
  const { [categoryName]: { aggregation } } = props;
@@ -134,16 +134,16 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
134
134
  });
135
135
  };
136
136
 
137
- const isDropDown = (name: string) => {
138
- switch (name) {
139
- case 'DRIVER_SEATS':
140
- case 'CO_DRIVER_SEATS':
141
- case 'BACK_SEATS':
142
- return true;
143
- default:
144
- return false;
145
- }
146
- };
137
+ // const isDropDown = (name: string) => {
138
+ // switch (name) {
139
+ // case 'DRIVER_SEATS':
140
+ // case 'CO_DRIVER_SEATS':
141
+ // case 'BACK_SEATS':
142
+ // return true;
143
+ // default:
144
+ // return false;
145
+ // }
146
+ // };
147
147
 
148
148
  const renderDropDown = (index: number, categoryName?: string, data?: any, isMobile?: boolean): React.ReactNode => {
149
149
  const { options, values } = data;
@@ -36,7 +36,7 @@ const HighlightsWidgetMobile = ({ onFilterChange, HIGHLIGHTS, t }: IHighlightsWi
36
36
  onFilterChange(HIGHLIGHTS_KEY, value);
37
37
  };
38
38
 
39
- const onHighlightsChange = (event: React.ChangeEvent<HTMLInputElement>, checked: boolean, value: any): void => {
39
+ const onHighlightsChange = (event: React.ChangeEvent<HTMLInputElement>, checked?: boolean | string, value?: any): void => {
40
40
  const { values } = HIGHLIGHTS;
41
41
  event.stopPropagation();
42
42
  event.nativeEvent.stopImmediatePropagation();
@@ -1,4 +1,4 @@
1
- import React, { memo } from 'react';
1
+ import React from 'react';
2
2
  import InteriorColor from '../../SearchFilters/filters/InteriorColor';
3
3
  import InteriorMaterial from '../../SearchFilters/filters/InteriorMaterial';
4
4
 
@@ -22,7 +22,7 @@ export interface ISafetyWidget {
22
22
  const AIRBAG_KEY = 'AIRBAG';
23
23
 
24
24
  const SafetyWidget = (props: ISafetyWidget) => {
25
- const { ASSISTANTS, AIRBAG, PARKING_ASSISTANTS, THEFT_PROTECTION, HIGHLIGHTS, onFilterChange, onDropDownFocus, t } = props;
25
+ const { ASSISTANTS, AIRBAG, PARKING_ASSISTANTS, THEFT_PROTECTION, HIGHLIGHTS, onFilterChange, t } = props;
26
26
  const onCheckboxClick = (fieldName: string, categoryName: string, values: string[]) => {
27
27
  const index = values.indexOf(fieldName);
28
28
 
@@ -40,11 +40,11 @@ const SafetyWidget = (props: ISafetyWidget) => {
40
40
  return onFilterChange(AIRBAG_KEY, values);
41
41
  };
42
42
 
43
- const onDropdownFocus = () => {
44
- if (onDropDownFocus) {
45
- onDropDownFocus(AIRBAG_KEY);
46
- }
47
- };
43
+ // const onDropdownFocus = () => {
44
+ // if (onDropDownFocus) {
45
+ // onDropDownFocus(AIRBAG_KEY);
46
+ // }
47
+ // };
48
48
 
49
49
  const getOptions = (_: string, options: any) => {
50
50
  const { aggregation } = AIRBAG;
@@ -12,14 +12,15 @@ export interface IProps {
12
12
  children: React.ReactElement<IStepProps>[];
13
13
  onStepChange?: (nextStep: number) => void;
14
14
  className?: string;
15
+ completed?: boolean;
15
16
  }
16
17
 
17
18
  const defaultStepsDivider: React.ReactElement<IStepsDividerProps> = <StepsDivider/>;
18
19
 
19
20
  const Stepper: React.FunctionComponent<IProps> = ({ currentStep, nonLinear, stepsDivider = defaultStepsDivider, onStepChange, children, className }) => {
20
- const childrenArray: React.ReactElement<IStepProps>[] = React.Children.toArray<React.ReactElement<IStepProps>>(children);
21
- const steps = childrenArray.map((child, index) => {
22
- if (!React.isValidElement(child)) {
21
+ const childrenArray: any | { props: IStepProps }[] = React.Children.toArray(children);
22
+ const steps = childrenArray.map((child: { props: IStepProps }, index: number) => {
23
+ if (!React.isValidElement<IStepProps>(child)) {
23
24
  throw new Error('Stepper component has invalid child');
24
25
  }
25
26
 
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useEffect, useState } from 'react';
2
2
  import styles from './OrderStatusSection.styl';
3
3
  import OrderStatusCard from './OrderStatusCard';
4
- import Image from '../../../_common/Image/Image';
4
+ // import Image from '../../../_common/Image/Image';
5
5
  import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
6
6
 
7
7
  // tslint:disable-next-line:interface-name
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react';
1
+ import React from 'react';
2
2
  import styles from './RequestedCarsSection.styl';
3
3
 
4
4
  import Slider from 'react-slick';
@@ -10,9 +10,6 @@ import { getFormattedPrice } from '../../../../framework/utils/CommonUtils';
10
10
  // import { history } from '../../../../../AppRouter';
11
11
  import Button from '../../../_common/Button/Button';
12
12
 
13
- interface IWithRouter {
14
- children?: JSX.Element;
15
- }
16
13
  // tslint:disable-next-line:interface-name
17
14
  interface TFunction {
18
15
  <T = string>(key: string, options?: object): T;
@@ -26,7 +26,7 @@ export interface ICheckboxProps {
26
26
  checkedIcon?: any;
27
27
  className?: string;
28
28
  type?: string;
29
- content?: string;
29
+ content?: string | JSX.Element;
30
30
  radio?: boolean;
31
31
  formControlClassName?: string;
32
32
  contentType?: string;
@@ -7,13 +7,12 @@ export interface IChip {
7
7
  }
8
8
 
9
9
  export interface IChipProps {
10
- className?: string;
11
10
  chip: IChip;
12
11
  onClick?: (event: React.MouseEvent, chip: IChip) => void;
13
12
  onDelete?: (event: React.MouseEvent, chip: IChip) => void;
14
13
  }
15
14
 
16
- const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onClick, onDelete }) => {
15
+ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, onClick, onDelete }) => {
17
16
  const { key, value } = chip;
18
17
  const onDeleteHandler = (event: any) => { event.stopPropagation(); onDelete(event, chip); };
19
18
  const onClickHandler = (event: any) => { event.stopPropagation(); onClick(event, chip); };
@@ -31,7 +30,6 @@ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onC
31
30
  };
32
31
 
33
32
  ChipLanding.defaultProps = {
34
- className: '',
35
33
  chip: { key: '', value: '' },
36
34
  onClick: () => {},
37
35
  onDelete: () => {}
@@ -8,10 +8,10 @@ import { ThemeProvider } from '@mui/material/styles';
8
8
  import { Theme } from './ExpansionPanel.styled';
9
9
 
10
10
  export interface IExpansionPanelProps {
11
- title?: string | JSX.Element;
11
+ title?: string;
12
12
  subTitle?: string;
13
13
  defaultExpanded?: boolean;
14
- onChange?: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;
14
+ onChange?: any; // TODO: understand how this onchange works and where it is used and write the correct types
15
15
  className?: string;
16
16
  children?: any;
17
17
  reactScrollName?: string; // property "name" for "Element" component of "react-scroll" library
@@ -71,7 +71,7 @@ class ExpansionPanel extends React.Component<IExpansionPanelProps> {
71
71
  <Accordion
72
72
  defaultExpanded={defaultExpanded}
73
73
  onChange={isCompare ? onChange : onChange && onChange(reactScrollName)}
74
- expanded={isCompare ? expanded : expanded && (expanded === reactScrollName)}
74
+ expanded={(isCompare && typeof expanded === 'boolean') ? expanded : expanded && (expanded === reactScrollName)}
75
75
  className={accordionClassName}
76
76
  >
77
77
  <AccordionSummary
@@ -1,5 +1,4 @@
1
1
  /* tslint:disable */
2
- import { fill } from "lodash";
3
2
  import * as React from "react";
4
3
 
5
4
  const SK = (props: any) => (
@@ -3,8 +3,7 @@ import { Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
3
3
  import IconSVG from '../IconSVG/IconSVG';
4
4
  import {
5
5
  ThemeProvider,
6
- createTheme,
7
- experimental_sx as sx
6
+ createTheme
8
7
  } from '@mui/material/styles';
9
8
 
10
9
  export interface IItem {
@@ -18,7 +17,9 @@ export interface IAccordionProps {
18
17
 
19
18
  defaultOpened?: number;
20
19
 
21
- variant?: string;
20
+ variant?: any;
21
+
22
+ expandedDefault?: string;
22
23
  }
23
24
 
24
25
  declare module '@mui/material/AccordionSummary' {
@@ -46,10 +47,9 @@ const MaterialAccordion = (
46
47
  const theme = createTheme({
47
48
  components: {
48
49
  MuiAccordion: {
49
- variants: [
50
- {
51
- props: { variant: 'searchDetailed' },
52
- style: {
50
+ styleOverrides: {
51
+ root: () => ({
52
+ ...(variant === 'searchDetailed' && {
53
53
  margin: 0,
54
54
  '&.Mui-expanded': {
55
55
  margin: 0
@@ -57,11 +57,8 @@ const MaterialAccordion = (
57
57
  '&.MuiAccordion-root:before': {
58
58
  opacity: 0
59
59
  }
60
- }
61
- },
62
- {
63
- props: { variant: 'searchDetailedSmall' },
64
- style: {
60
+ }),
61
+ ...(variant === 'searchDetailedSmall' && {
65
62
  margin: 0,
66
63
  boxShadow: 'none',
67
64
  '&.Mui-expanded': {
@@ -70,32 +67,28 @@ const MaterialAccordion = (
70
67
  '&.MuiAccordion-root:before': {
71
68
  opacity: 0
72
69
  }
73
- }
74
- }
75
- ]
70
+ })
71
+ })
72
+ }
76
73
  },
77
74
  MuiAccordionSummary: {
78
- variants: [
79
- {
80
- props: { variant: 'searchDetailed' },
81
- style: {
75
+ styleOverrides: {
76
+ root: () => ({
77
+ ...(variant === 'searchDetailed' && {
82
78
  color: '#005ccb',
83
79
  fontWeight: 'bold',
84
80
  fontSize: 14,
85
81
  '&.Mui-expanded': {
86
82
  borderBottom: '1px solid #e8e8e8'
87
83
  }
88
- }
89
- },
90
- {
91
- props: { variant: 'searchDetailedSmall' },
92
- style: {
84
+ }),
85
+ ...(variant === 'searchDetailedSmall' && {
93
86
  color: '1f1f1f',
94
87
  fontWeight: 'bold',
95
88
  fontSize: 14
96
- }
97
- }
98
- ]
89
+ })
90
+ })
91
+ }
99
92
  }
100
93
  }
101
94
  });
@@ -104,10 +97,10 @@ const MaterialAccordion = (
104
97
  const [expanded, setExpanded] = useState(expandedDefault || false);
105
98
 
106
99
  const handleChange =
107
- (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => {
100
+ (panel: string) => (_: React.SyntheticEvent, isExpanded: boolean) => {
108
101
  setExpanded(isExpanded ? panel : false);
109
102
  };
110
- return items.map((item: any, index: number) => {
103
+ return items.map((item: { title: string, content: any }, index: number) => {
111
104
  return (
112
105
  <ThemeProvider theme={theme}>
113
106
  <Accordion
@@ -120,7 +113,6 @@ const MaterialAccordion = (
120
113
  expandIcon={<IconSVG name={'arrowSelect'} customDimensions />}
121
114
  aria-controls={item.title}
122
115
  id={item.title}
123
- variant={variant}
124
116
  sx={{
125
117
  borderBottom: '1px solid #e8e8e8',
126
118
  borderImageWidth: 0
@@ -6,7 +6,6 @@ export const Theme = createTheme({
6
6
  styleOverrides: {
7
7
  input: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
8
8
  ...(size === 'smaller' && {
9
- // tslint:disable-line
10
9
  height: 28,
11
10
  boxSizing: 'border-box'
12
11
  }),
@@ -1,6 +1,6 @@
1
1
  import { createTheme } from '@mui/material/styles';
2
2
  import { IconButton } from '@mui/material';
3
- import { padding, styled } from '@mui/system';
3
+ import { styled } from '@mui/system';
4
4
  import IconSVG from '../IconSVG/IconSVG';
5
5
  import { isMobileOnly } from 'react-device-detect';
6
6
 
@@ -15,9 +15,9 @@ export const Theme = createTheme({
15
15
  },
16
16
  MuiInputLabel: {
17
17
  styleOverrides: {
18
- root: ({ ownerState }) => ({
18
+ root: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
19
19
  maxWidth: 'calc(100% - 38px)',
20
- ...(ownerState.size === 'custom' && { // tslint:disable-line
20
+ ...(size === 'custom' && {
21
21
  marginTop: isMobileOnly ? '0px' :'-4px',
22
22
  ['&.MuiInputLabel-shrink, &.Mui-focused']: {
23
23
  marginTop: 0
@@ -64,22 +64,19 @@ export const Theme = createTheme({
64
64
  },
65
65
  MuiOutlinedInput: {
66
66
  styleOverrides: {
67
- root: ({ ownerState }) => ({
68
- ...(ownerState.size === 'small' && {
67
+ root: ({ ownerState: { size } }: { ownerState: { size?: 'smaller' | 'custom' | 'normal' | 'small' | 'medium' } }) => ({
68
+ ...(size === 'small' && {
69
69
  paddingRight: '0 !important',
70
- flexWrap: 'nowrap !important',
71
- ['.Mui-disabled']: {
72
- // backgroundColor: '#e8e8e8'
73
- }
70
+ flexWrap: 'nowrap !important'
74
71
  }),
75
- ...(ownerState.size === 'custom' && {
72
+ ...(size === 'custom' && {
76
73
  height: isMobileOnly ? 56 : 48,
77
74
  boxSizing: 'border-box'
78
75
  }),
79
76
  ['&.Mui-disabled svg']: {
80
77
  opacity:'0.38'
81
78
  }
82
- })
79
+ } as any)
83
80
  }
84
81
  },
85
82
  MuiListItemText: {
@@ -9,7 +9,7 @@ import { isMobileOnly } from 'react-device-detect';
9
9
 
10
10
  export interface IItems {
11
11
  value: string | number;
12
- label: string;
12
+ label: string | JSX.Element;
13
13
  isDisabled?: boolean;
14
14
  isSeries?: boolean;
15
15
  }
@@ -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: IItems[];
35
+ items?: IItems[];
36
36
  selectClassName?: string;
37
37
  amountOfItems?: number;
38
38
  customDimensionsIcon?: boolean;
@@ -99,7 +99,7 @@ const MaterialSelect: React.FC<IVehicleModalProps> = ({
99
99
  onChange('' as string);
100
100
  };
101
101
 
102
- const getLabel = (label: string, disabled: boolean) => disabled ? <span>{label.toUpperCase()}</span> : label;
102
+ const getLabel = (label: string | JSX.Element, disabled: boolean) => disabled ? <span>{(label as string).toUpperCase()}</span> : label;
103
103
 
104
104
  const IconClassNames = classnames(
105
105
  classNameIcon
@@ -17,8 +17,8 @@ interface IMaterialTooltip {
17
17
 
18
18
  const LightTooltip = styled(({ className, ...props }: TooltipProps) => (
19
19
  <Tooltip {...props} classes={{ popper: className }} />
20
- ))(props => ({
21
- zIndex: props.zindex ? props.zindex : 9996,
20
+ ))(({ zindex }: { zindex: number }) => ({
21
+ zIndex: zindex ? zindex : 9996,
22
22
  [`& .${tooltipClasses.tooltip}`]: {
23
23
  backgroundColor: '#fff',
24
24
  color: '#4C4E64AD',
@@ -46,7 +46,7 @@ const MaterialTooltip = ({ text, placement, className, disabled, zindex }: IMate
46
46
  };
47
47
 
48
48
  const onHandleMenuToggle = debounce(
49
- (event: any) => {
49
+ (_: any) => {
50
50
  setIsOpen(() => !isOpen);
51
51
  },
52
52
  50
@@ -12,12 +12,9 @@ interface IBasicModal {
12
12
  }
13
13
 
14
14
  const BasicModal = ({ isVisible, toggleModal, name, modalProps, handleSentryInit }: IBasicModal) => {
15
- const { onClearModalState } = modalProps;
15
+ // const { onClearModalState } = modalProps;
16
16
  return (
17
- <Modal open={isVisible} onClose={() => {
18
- // toggleModal();
19
- // onClearModalState();
20
- }}>
17
+ <Modal open={isVisible}>
21
18
  <BaseModalWrapper>
22
19
  {ModalsConfig[name] && ModalsConfig[name]({ ...modalProps, toggleModal, handleSentryInit })}
23
20
  </BaseModalWrapper>
@@ -4,7 +4,11 @@ import TestModal from './modals/TestModal';
4
4
  import PreviewCookieModal from './modals/PreviewCookieModal/PreviewCookieModal';
5
5
  import ManageCookieModal from './modals/ManageCookieModal/ManageCookieModal';
6
6
 
7
- const ModalsConfig = {
7
+ interface ModalConfigProps {
8
+ [key: string]: (props: any) => JSX.Element;
9
+ }
10
+
11
+ const ModalsConfig: ModalConfigProps = {
8
12
  TEST_MODAL: (props: any) => {
9
13
  return <TestModal { ...props } />;
10
14
  },
@@ -16,11 +16,15 @@ interface IManageCookieModal {
16
16
  handleSentryInit?: () => void;
17
17
  }
18
18
 
19
+ interface IMarketingSwitches {
20
+ [key: string]: any;
21
+ }
22
+
19
23
  const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModal) => {
20
24
  const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(true);
21
25
  const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(true);
22
- const [analyticsSwitches, setAnalyticsSwitches] = useState({});
23
- const [marketingSwitches, setMarketingSwitches] = useState({});
26
+ const [analyticsSwitches, setAnalyticsSwitches] = useState<IMarketingSwitches>({});
27
+ const [marketingSwitches, setMarketingSwitches] = useState<IMarketingSwitches>({});
24
28
 
25
29
  useEffect(
26
30
  () => {
@@ -60,7 +64,7 @@ const ManageCookieModal = ({ toggleModal, handleSentryInit } : IManageCookieModa
60
64
  onChange: () => {}
61
65
  };
62
66
 
63
- const onAccept = (value?: object) => {
67
+ const onAccept = (value?: Record<string, any>) => {
64
68
  const cookieConfig = value || {
65
69
  marketing: Object.keys(marketingSwitches).filter(i => !marketingSwitches[i]) || [],
66
70
  analytics: Object.keys(analyticsSwitches).filter(i => !analyticsSwitches[i]) || []
@@ -1,6 +1,5 @@
1
1
  import { styled } from '@mui/system';
2
2
  import { createTheme } from '@mui/material/styles';
3
- import zIndex from '@mui/material/styles/zIndex';
4
3
 
5
4
  export const Theme = createTheme({
6
5
  components: {
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, MouseEvent } from 'react';
2
2
  import Menu from '@mui/material/Menu';
3
3
  import ListItem from './MaterialMenuItem';
4
4
  import { ThemeProvider } from '@mui/material/styles';
@@ -24,7 +24,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
24
24
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
25
25
  const [selectedIndex, setSelectedIndex] = React.useState(1);
26
26
  const open = Boolean(anchorEl);
27
- const handleClick = (event: React.MouseEvent<HTMLElement>) => {
27
+ const handleClick = (event: MouseEvent<HTMLDivElement>) => {
28
28
  setAnchorEl(event.currentTarget);
29
29
  };
30
30
  const handleClose = () => {
@@ -42,7 +42,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
42
42
  <ThemeProvider theme={Theme}>
43
43
  <div className={containerClassname}>
44
44
  <HeaderComponent
45
- onClick={(e) => {
45
+ onClick={(e: MouseEvent<HTMLDivElement>) => {
46
46
  if (anchorEl) {
47
47
  handleClose();
48
48
  } else {
@@ -10,7 +10,7 @@ interface IListItem {
10
10
  label: any;
11
11
  amount?: number;
12
12
  divider?: boolean;
13
- onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
13
+ onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
14
14
  href?: string;
15
15
  isComponent?: boolean;
16
16
  isSelect?: boolean;
@@ -20,6 +20,12 @@ interface IListItem {
20
20
  }
21
21
 
22
22
  const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose, isActive }: IListItem) => {
23
+
24
+ const onMenuItemClick = (e: React.MouseEvent<HTMLLIElement>) => {
25
+ onClick(e);
26
+ handleClose();
27
+ }
28
+
23
29
  return !!href ? (
24
30
  <Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
25
31
  <MenuItem
@@ -34,13 +40,10 @@ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Li
34
40
  </Link>
35
41
  ) : (
36
42
  <MenuItem
37
- onClick={(e: React.MouseEvent<HTMLSpanElement>) => {
38
- onClick(e);
39
- handleClose();
40
- }}
43
+ onClick={onMenuItemClick}
41
44
  divider={divider}
42
45
  disableRipple={isComponent ? true : false}
43
- isactive={!!isActive ? isActive.toString() : 'false'}
46
+ selected={!!isActive ? isActive : false}
44
47
  >
45
48
  {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
46
49
  <ListItemText>
@@ -17,7 +17,7 @@ export interface INestedMenuProps {
17
17
  const NestedMenu = ({ nestedItems, label, icon, amount }: INestedMenuProps) => {
18
18
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
19
19
  const open = Boolean(anchorEl);
20
- const handleClick = (event: React.MouseEvent<HTMLElement>) => {
20
+ const handleClick = (event: React.MouseEvent<HTMLLIElement>) => {
21
21
  setAnchorEl(event.currentTarget);
22
22
  };
23
23
  const handleClose = () => {
@@ -7,7 +7,7 @@ import { isEqual } from 'lodash';
7
7
  import { checkRangeValuesOnEqual, getGroupValuesForQuery } from '../../../../framework/utils/CommonUtils';
8
8
  import { FilterBlockFactory } from '../../../SearchFilters/common/FilterBlock/FilterBlockFactory';
9
9
  import { FilterGroups, IFilters } from '../../../SearchFilters/FiltersFactory';
10
- import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME, SUB_MODEL_KEY } from '../../../../framework/constants/Search';
10
+ import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME } from '../../../../framework/constants/Search';
11
11
  import { MMS_GROUPS_KEY, OBJECT_FILTERS } from '../../../../framework/constants/SearchWidget';
12
12
  import { resolveMmsValue } from '../../../../framework/utils/FiltersUtils';
13
13
  import FilterBlock from '../../../SearchFilters/common/FilterBlock/FilterBlock';
@@ -17,7 +17,15 @@ export const GOOGLE_BUNDLE_COOKIES = {
17
17
  };
18
18
 
19
19
  /* tslint:disable */
20
- export const COOKIE_SCHEMA = {
20
+ export interface INecessaryCookieSchema {
21
+ [key: string]: {
22
+ [key: string]: {
23
+ name: string;
24
+ }
25
+ };
26
+ }
27
+
28
+ export const COOKIE_SCHEMA: INecessaryCookieSchema = {
21
29
  necessary: {
22
30
  __cfruid: { name: 'Cloudflare' },
23
31
  cf_chl_2: { name: 'Cloudflare für Webverkehr zu identifizieren' },
@@ -186,7 +186,9 @@ export interface IVehicleDetailedSidebarPriceProps {
186
186
  isAlternative?: boolean;
187
187
  // currentSalesPrice?: number;
188
188
  originalSalesPrice?: number;
189
- common: { isStrikeShown?: boolean, currentSalesPrice?: number };
189
+ common?: { isStrikeShown?: boolean, currentSalesPrice?: number };
190
+ financing?: any;
191
+ currentSalesPrice?: number;
190
192
  }
191
193
  export interface ITabsProps {
192
194
  t?: (key: string, options?: object) => string;
@@ -8,10 +8,10 @@ export interface IFormatTimestamp {
8
8
 
9
9
  export const timestampToDate = (timestamp: number) => {
10
10
  if (!timestamp) return 'N/A';
11
- const date = new Date(timestamp * 1000);// tslint:disable-line
11
+ const date = new Date(timestamp * 1000);
12
12
  const year = date.getFullYear();
13
13
  const month = date.getMonth() + 1;
14
- const monthFormatted = month < 10 ? '0' + month : month;// tslint:disable-line
14
+ const monthFormatted = month < 10 ? '0' + month : month;
15
15
  return (`${monthFormatted}/${year}`);
16
16
  };
17
17