@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
@@ -32,7 +32,7 @@ export interface ICheckboxProps {
32
32
  contentType?: string;
33
33
  }
34
34
 
35
- const CheckboxMaterial = ({
35
+ const CheckboxMaterial = ({
36
36
  checked,
37
37
  value,
38
38
  disabled,
@@ -51,9 +51,12 @@ const CheckboxMaterial = ({
51
51
  }: ICheckboxProps) => {
52
52
  const [isChecked, setIsChecked] = useState(!!checked);
53
53
 
54
- useEffect(() => {
55
- setIsChecked(!!checked);
56
- }, [checked])
54
+ useEffect(
55
+ () => {
56
+ setIsChecked(!!checked);
57
+ },
58
+ [checked]
59
+ );
57
60
 
58
61
  const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
59
62
  const { checked } = event.target;
@@ -83,9 +86,9 @@ const CheckboxMaterial = ({
83
86
  styles.color,
84
87
  `auto-de-color-${content}`,
85
88
  { [styles.iconError]: error }
86
- )}></div>
89
+ )}></div>;
87
90
  case 'icon':
88
- return <IconSVG customDimensions name={icon} className={classnames(styles.interiorIcon, { [styles.iconError]: error })} />
91
+ return <IconSVG customDimensions name={icon} className={classnames(styles.interiorIcon, { [styles.iconError]: error })} />;
89
92
  case 'door':
90
93
  return (
91
94
  <div className={styles.doorsContainer}>
@@ -93,27 +96,27 @@ const CheckboxMaterial = ({
93
96
  <span className={styles.content}>{content}</span>
94
97
  </div>
95
98
  </div>
96
- )
99
+ );
97
100
  case 'text':
98
101
  return (
99
102
  <span className={classnames(styles.stickerTextContent, { [styles.iconError]: error })}>
100
103
  <span className={classnames(styles.inner, styles.textContent)}>{contentInner}</span>
101
104
  </span>
102
- )
105
+ );
103
106
  case 'sticker':
104
107
  return (
105
108
  <span className={classnames(styles.stickerContent, { [styles.iconError]: error })}>
106
109
  <span className={classnames(styles.inner, styles.stickerIcon)}>{contentInner}</span>
107
110
  </span>
108
- )
111
+ );
109
112
  case 'period':
110
113
  return (
111
114
  <div className={labelClassName} key={value}>
112
115
  <span>{value}</span>
113
116
  </div>
114
- )
117
+ );
115
118
  default:
116
- return
119
+ return;
117
120
  }
118
121
  };
119
122
 
@@ -129,7 +132,7 @@ const CheckboxMaterial = ({
129
132
  <IconSVG className={styles.interiorCheckedIcon} customDimensions name={icon} />
130
133
  <IconSVG className={styles.interiorCheckedIconCheck} customDimensions name='common_CheckBlue' />
131
134
  </div>
132
- )
135
+ );
133
136
  case 'door':
134
137
  return (
135
138
  <div className={styles.doorsContainer}>
@@ -137,55 +140,55 @@ const CheckboxMaterial = ({
137
140
  <span className={classnames(styles.content, styles.selected)}>{content}</span>
138
141
  </div>
139
142
  </div>
140
- )
143
+ );
141
144
  case 'text':
142
145
  return (
143
146
  <span className={styles.stickerTextContent}>
144
147
  {content ? <span className={classnames(styles.inner, styles.textContent)}>{contentInner}</span> : false}
145
148
  <IconSVG name='common_CheckBlue' className={classnames(styles.checkBlueIcon)} />
146
149
  </span>
147
- )
150
+ );
148
151
  case 'sticker':
149
152
  return (
150
153
  <span className={styles.stickerContent}>
151
154
  {content ? <span className={classnames(styles.inner, styles.stickerIcon)}>{contentInner}</span> : false}
152
155
  <IconSVG name='common_CheckBlue' className={classnames(styles.checkBlueIconSticker, styles.checkBlueIcon)} />
153
156
  </span>
154
- )
157
+ );
155
158
 
156
159
  case 'period':
157
160
  return (
158
161
  <div className={labelClassName} key={value}>
159
162
  <span>{value}</span>
160
163
  </div>
161
- )
164
+ );
162
165
  default:
163
- return
166
+ return;
164
167
  }
165
- }
168
+ };
166
169
 
167
170
  const checkboxLabel = <span className={styles.checkboxLabel}>{label} {aggregation}</span>;
168
171
 
169
172
  const checkboxProps = {
170
- checked: isChecked, // fix offerDetailedSection withFinalInstallment checkbox bug
171
173
  value,
174
+ className,
172
175
  disabled,
176
+ error,
173
177
  icon: renderIcon(),
174
178
  checkedIcon: renderCheckedIcon(),
175
- className,
176
179
  onChange: onChangeHandler,
177
- error
178
- }
180
+ checked: isChecked // fix offerDetailedSection withFinalInstallment checkbox bug
181
+ };
179
182
 
180
183
  const radioProps = {
181
184
  value,
185
+ error,
182
186
  label,
183
187
  disabled,
184
188
  className,
185
189
  icon: renderIcon(),
186
- checkedIcon: renderCheckedIcon(),
187
- error
188
- }
190
+ checkedIcon: renderCheckedIcon()
191
+ };
189
192
 
190
193
  return (
191
194
  <FormControlLabel
@@ -201,7 +204,7 @@ const CheckboxMaterial = ({
201
204
  labelPlacement={labelPlacement}
202
205
  className={formControlClassName}
203
206
  />
204
- )
205
- }
207
+ );
208
+ };
206
209
 
207
210
  export default CheckboxMaterial;
@@ -21,7 +21,7 @@ const ChipLanding: React.FunctionComponent<IChipProps> = ({ chip, className, onC
21
21
  return (
22
22
  <div key={key}>
23
23
  <Chip
24
- variant="outlined"
24
+ variant='outlined'
25
25
  label={value}
26
26
  onClick= {onClickHandler}
27
27
  onDelete={onDeleteHandler}
@@ -1,11 +1,10 @@
1
- import * as React from 'react';
1
+ import React, { FocusEventHandler } from 'react';
2
2
  import classnames from 'classnames';
3
3
  import Select from 'react-select';
4
4
  import Creatable, { CreatableProps } from 'react-select/creatable';
5
5
  // import { Props as SelectProps } from 'react-select/base';
6
6
  import { SelectComponentsConfig } from 'react-select/src/components';
7
7
  import { ActionMeta, ValueType, OptionsType } from 'react-select/src/types';
8
- import { FocusEventHandler } from 'react';
9
8
 
10
9
  import styles from './DropDown.styl';
11
10
  import { ClearIndicatorDefault } from './DropDownComponents';
@@ -10,13 +10,6 @@ export const Theme = createTheme({
10
10
  }
11
11
  }
12
12
  },
13
- // MuiCollapse: {
14
- // styleOverrides: {
15
- // root: {
16
-
17
- // }
18
- // }
19
- // },
20
13
  MuiAccordionSummary: {
21
14
  styleOverrides: {
22
15
  root: {
@@ -27,9 +20,9 @@ export const Theme = createTheme({
27
20
  fontSize: 13,
28
21
  margin: 0,
29
22
  padding: '12px 0',
30
- textTransform: 'uppercase',
23
+ textTransform: 'uppercase'
31
24
  }
32
25
  }
33
26
  }
34
27
  }
35
- });
28
+ });
@@ -603,7 +603,7 @@ const components: IComponentsProp = {
603
603
  copyIcon: CopyIcon,
604
604
  doneIcon: DoneIcon,
605
605
 
606
- //settings
606
+ // settings
607
607
  accountIcon: AccountIcon,
608
608
  securityIcon: SecurityIcon,
609
609
  dataUsageIcon: DataUsageIcon,
@@ -624,6 +624,8 @@ const components: IComponentsProp = {
624
624
  autocheck: Autocheck,
625
625
  shoppingCart: ShoppingCart,
626
626
  mobiledeLogo: MobileDeLogo
627
+
628
+ // user menu
627
629
  };
628
630
 
629
631
  export default components;
@@ -14,4 +14,4 @@ const SvgRemoveEye = (props: any) => (
14
14
  );
15
15
 
16
16
  export default SvgRemoveEye;
17
- /* tslint:enable */
17
+ /* tslint:enable */
@@ -4,7 +4,7 @@ import IconSVG from '../IconSVG/IconSVG';
4
4
  import {
5
5
  ThemeProvider,
6
6
  createTheme,
7
- experimental_sx as sx,
7
+ experimental_sx as sx
8
8
  } from '@mui/material/styles';
9
9
 
10
10
  export interface IItem {
@@ -22,14 +22,14 @@ export interface IAccordionProps {
22
22
  }
23
23
 
24
24
  declare module '@mui/material/AccordionSummary' {
25
- interface AccordionSummaryPropsVariantOverrides {
25
+ interface IAccordionSummaryPropsVariantOverrides {
26
26
  searchDetailed: true;
27
27
  searchDetailedSmall: true;
28
28
  }
29
29
  }
30
30
 
31
31
  declare module '@mui/material/Accordion' {
32
- interface AccordionPropsVariantOverrides {
32
+ interface IAccordionPropsVariantOverrides {
33
33
  searchDetailed: true;
34
34
  searchDetailedSmall: true;
35
35
  }
@@ -40,65 +40,65 @@ const MaterialAccordion = (
40
40
  defaultOpened,
41
41
  expandedDefault,
42
42
  items,
43
- variant,
43
+ variant
44
44
  }: IAccordionProps) => {
45
45
 
46
- const theme = createTheme({
47
- components: {
48
- MuiAccordion: {
49
- variants: [
50
- {
51
- props: { variant: 'searchDetailed' },
52
- style: {
53
- margin: 0,
54
- '&.Mui-expanded': {
55
- margin: 0
56
- },
57
- '&.MuiAccordion-root:before': {
58
- opacity: 0
59
- }
60
- }
61
- },
62
- {
63
- props: { variant: 'searchDetailedSmall' },
64
- style: {
65
- margin: 0,
66
- boxShadow: 'none',
67
- '&.Mui-expanded': {
68
- margin: 0
69
- },
70
- '&.MuiAccordion-root:before': {
71
- opacity: 0
72
- }
46
+ const theme = createTheme({
47
+ components: {
48
+ MuiAccordion: {
49
+ variants: [
50
+ {
51
+ props: { variant: 'searchDetailed' },
52
+ style: {
53
+ margin: 0,
54
+ '&.Mui-expanded': {
55
+ margin: 0
73
56
  },
57
+ '&.MuiAccordion-root:before': {
58
+ opacity: 0
59
+ }
74
60
  }
75
- ]
76
- },
77
- MuiAccordionSummary: {
78
- variants: [
79
- {
80
- props: { variant: 'searchDetailed' },
81
- style: {
82
- color: '#005ccb',
83
- fontWeight: 'bold',
84
- fontSize: 14,
85
- '&.Mui-expanded': {
86
- borderBottom: '1px solid #e8e8e8'
87
- }
88
- },
89
- },
90
- {
91
- props: { variant: 'searchDetailedSmall' },
92
- style: {
93
- color: '1f1f1f',
94
- fontWeight: 'bold',
95
- fontSize: 14
61
+ },
62
+ {
63
+ props: { variant: 'searchDetailedSmall' },
64
+ style: {
65
+ margin: 0,
66
+ boxShadow: 'none',
67
+ '&.Mui-expanded': {
68
+ margin: 0
96
69
  },
70
+ '&.MuiAccordion-root:before': {
71
+ opacity: 0
72
+ }
97
73
  }
98
- ],
99
- },
74
+ }
75
+ ]
100
76
  },
101
- });
77
+ MuiAccordionSummary: {
78
+ variants: [
79
+ {
80
+ props: { variant: 'searchDetailed' },
81
+ style: {
82
+ color: '#005ccb',
83
+ fontWeight: 'bold',
84
+ fontSize: 14,
85
+ '&.Mui-expanded': {
86
+ borderBottom: '1px solid #e8e8e8'
87
+ }
88
+ }
89
+ },
90
+ {
91
+ props: { variant: 'searchDetailedSmall' },
92
+ style: {
93
+ color: '1f1f1f',
94
+ fontWeight: 'bold',
95
+ fontSize: 14
96
+ }
97
+ }
98
+ ]
99
+ }
100
+ }
101
+ });
102
102
 
103
103
  const renderItems = (): React.ReactNode => {
104
104
  const [expanded, setExpanded] = useState(expandedDefault || false);
@@ -144,6 +144,6 @@ const MaterialAccordion = (
144
144
  {renderItems()}
145
145
  </div>
146
146
  );
147
- }
147
+ };
148
148
 
149
149
  export default MaterialAccordion;
@@ -11,17 +11,17 @@ export const Theme = createTheme({
11
11
  top: 'calc(50% - 12px)'
12
12
  },
13
13
  popupIndicator: {
14
- padding: 4,
14
+ padding: 4
15
15
  },
16
16
  root: ({ ownerState }) => ({
17
- ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-root']: {
17
+ ['&.Mui-focused + [data-popper-placement*=`bottom`] .MuiOutlinedInput-root']: {
18
18
  borderTopRightRadius: 0,
19
19
  borderTopLeftRadius: 0
20
20
  },
21
21
  ['&.Mui-focused + [data-popper-placement*="bottom"] .MuiOutlinedInput-notchedOutline']: {
22
22
  ...(ownerState.name === 'mobileSearch' && { // tslint:disable-line
23
23
  borderTop: isMobileOnly ? '2px solid #1976d2' : 0
24
- }),
24
+ })
25
25
  },
26
26
  ['&.Mui-focused .MuiInputLabel-root']: {
27
27
  zIndex: 9999
@@ -32,7 +32,7 @@ export const Theme = createTheme({
32
32
  borderLeft: '1px solid rgba(0, 0, 0, 0.23)',
33
33
  borderRight: '1px solid rgba(0, 0, 0, 0.23)',
34
34
  borderTop: '1px solid rgba(0, 0, 0, 0.23)',
35
- marginLeft: 0,
35
+ marginLeft: 0
36
36
  },
37
37
  ['&.Mui-focused + [data-popper-placement*="top"] > .MuiPaper-root']: {
38
38
  borderBottomLeftRadius: 0,
@@ -135,10 +135,10 @@ export const Theme = createTheme({
135
135
  backgroundColor: '#e8e8e8'
136
136
  },
137
137
  ['& > .MuiChip-root > span:after']: {
138
- content: "','"
138
+ content: `','`
139
139
  },
140
140
  ['& > .MuiChip-root + .MuiChip-root > span:after']: {
141
- content: "''"
141
+ content: `''`
142
142
  },
143
143
  ['&.Mui-disabled']: {
144
144
  pointerEvents: 'none',
@@ -150,36 +150,36 @@ export const Theme = createTheme({
150
150
  },
151
151
  ['& .MuiAutocomplete-input']: {
152
152
  ...(ownerState.name === 'mobileSearch' && {
153
- textAlign: isMobileOnly ? 'right !important' : 'left',
153
+ textAlign: isMobileOnly ? 'right !important' : 'left'
154
154
  })
155
155
  },
156
156
  ...(ownerState.size === 'custom' && {
157
- height: isMobileOnly ? 56 : 48,
158
- boxSizing: 'border-box',
159
- backgroundColor: '#fff',
160
- paddingRight: '42px !important',
157
+ height: isMobileOnly ? 56 : 48,
158
+ boxSizing: 'border-box',
159
+ backgroundColor: '#fff',
160
+ paddingRight: '42px !important',
161
161
 
162
- ['& .MuiOutlinedInput-input']: {
163
- padding: '5.5px 4px 7.5px 6px !important'
164
- }
162
+ ['& .MuiOutlinedInput-input']: {
163
+ padding: '5.5px 4px 7.5px 6px !important'
164
+ }
165
165
  }),
166
166
  ...(ownerState.name === 'mobileSearch' && {
167
- color: isMobileOnly ? '#005ccb' : 'rgba(0, 0, 0, 0.87)',
168
- backgroundColor: isMobileOnly ? 'transparent' : '#fff',
169
- paddingRight: isMobileOnly ? '33px !important' : '42px !important',
170
- textAlign: isMobileOnly ? 'right !important' : 'left',
171
- ['& .MuiOutlinedInput-notchedOutline']: {
172
- borderWidth: isMobileOnly ? 0 : 1
173
- },
174
- 'input': {
175
- ['&::placeholder']: {
176
- color: isMobileOnly ? '#005ccb !important' : 'rgba(0, 0, 0, 0.87) !important'
177
- },
178
- },
179
- ['&.Mui-focused .MuiOutlinedInput-notchedOutline']: {
180
- borderWidth: isMobileOnly ? 0 : 1
167
+ color: isMobileOnly ? '#005ccb' : 'rgba(0, 0, 0, 0.87)',
168
+ backgroundColor: isMobileOnly ? 'transparent' : '#fff',
169
+ paddingRight: isMobileOnly ? '33px !important' : '42px !important',
170
+ textAlign: isMobileOnly ? 'right !important' : 'left',
171
+ ['& .MuiOutlinedInput-notchedOutline']: {
172
+ borderWidth: isMobileOnly ? 0 : 1
173
+ },
174
+ input: {
175
+ ['&::placeholder']: {
176
+ color: isMobileOnly ? '#005ccb !important' : 'rgba(0, 0, 0, 0.87) !important'
181
177
  }
182
- })
178
+ },
179
+ ['&.Mui-focused .MuiOutlinedInput-notchedOutline']: {
180
+ borderWidth: isMobileOnly ? 0 : 1
181
+ }
182
+ })
183
183
  })
184
184
  }
185
185
  }
@@ -197,5 +197,5 @@ export const FlexWrap = styled('div')({
197
197
  });
198
198
 
199
199
  export const CheckboxLabel = styled('span')({
200
- whiteSpace: 'pre-line'
201
- })
200
+ whiteSpace: 'pre-line'
201
+ });
@@ -11,12 +11,12 @@ import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
11
11
  import { Theme, ArrowSelect, CheckboxLabel } from './MaterialAutocomplete.styled';
12
12
  import isEqual from 'lodash/isEqual';
13
13
 
14
- export interface Items {
14
+ export interface IItems {
15
15
  value: string | number;
16
16
  label: string;
17
17
  isDisabled?: boolean;
18
18
  isSeries?: boolean;
19
- };
19
+ }
20
20
 
21
21
  interface IFilmOptionType {
22
22
  inputValue?: string;
@@ -79,7 +79,7 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
79
79
  placeholder
80
80
  }: IMaterialAutocompleteProps) => {
81
81
  const filter = createFilterOptions<IFilmOptionType>();
82
-
82
+
83
83
  return (
84
84
  <ThemeProvider theme={Theme}>
85
85
  <Autocomplete
@@ -101,10 +101,10 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
101
101
  onChange(newValue);
102
102
  } else if (newValue && newValue.inputValue) {
103
103
  onChange(newValue.inputValue);
104
- } else {
104
+ } else {
105
105
  if (multiple) {
106
106
  if (_indexOf(value, details.option) !== -1) {
107
- onChange(_filter(newValue, (value) => details.option !== value));
107
+ onChange(_filter(newValue, value => details.option !== value));
108
108
  } else {
109
109
  onChange(newValue);
110
110
  }
@@ -115,15 +115,15 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
115
115
  }
116
116
  }
117
117
  }}
118
- getOptionDisabled={(option) => option.isDisabled || option.label === 'default'}
118
+ getOptionDisabled={option => option.isDisabled || option.label === 'default'}
119
119
  filterOptions={(options, params) => {
120
120
 
121
121
  const filtered = filter(options, params);
122
-
122
+
123
123
  const { inputValue } = params;
124
124
  // Suggest the creation of a new value
125
125
 
126
- const isExisting = options.some((option) => inputValue === option.label);
126
+ const isExisting = options.some(option => inputValue === option.label);
127
127
  if (inputValue !== '' && !isExisting && freeSolo) {
128
128
  filtered.push({
129
129
  value: inputValue,
@@ -158,26 +158,25 @@ const MaterialAutocomplete: React.FC<IMaterialAutocompleteProps> = ({
158
158
  <Checkbox checked={_indexOf(value, props.key) !== -1} />
159
159
  <CheckboxLabel>{t(`cbd:${option}`)}</CheckboxLabel>
160
160
  </li>
161
- )
162
- } else {
163
- const isSeries = (option.isDisabled && option.label !== 'No options') || option.isSeries;
164
- const label = isSeries ? option.label.toUpperCase() : option.label;
165
- return (
166
- <li
167
- {...props}
168
- key={_uniqueId(option.label)}
169
- style={isSeries ? {
170
- backgroundColor: 'rgba(58, 53, 65, 0.08)',
171
- color: 'rgba(76, 78, 100, 0.87)',
172
- fontWeight: 600
173
- } : null}
174
- >
175
- {label}
176
- </li>
177
- )
161
+ );
178
162
  }
163
+ const isSeries = (option.isDisabled && option.label !== 'No options') || option.isSeries;
164
+ const label = isSeries ? option.label.toUpperCase() : option.label;
165
+ return (
166
+ <li
167
+ {...props}
168
+ key={_uniqueId(option.label)}
169
+ style={isSeries ? {
170
+ backgroundColor: 'rgba(58, 53, 65, 0.08)',
171
+ color: 'rgba(76, 78, 100, 0.87)',
172
+ fontWeight: 600
173
+ } : null}
174
+ >
175
+ {label}
176
+ </li>
177
+ );
179
178
  }}
180
- renderInput={(params) => (
179
+ renderInput={params => (
181
180
  <TextField
182
181
  {...params}
183
182
  type={type}
@@ -222,5 +221,5 @@ export default memo(MaterialAutocomplete, (prevProps: any, nextProps: any) => {
222
221
  prevProps.error === nextProps.error &&
223
222
  prevProps.label === nextProps.label &&
224
223
  isEqual(prevProps.items, nextProps.items) &&
225
- (!_isEmpty(prevProps.items) ? prevProps.items[0].label === nextProps.items[0].label : false) // condition for radioButtons KW PS
224
+ (!_isEmpty(prevProps.items) ? prevProps.items[0].label === nextProps.items[0].label : false); // condition for radioButtons KW PS
226
225
  });
@@ -5,17 +5,17 @@ export const Theme = createTheme({
5
5
  MuiOutlinedInput: {
6
6
  styleOverrides: {
7
7
  input: ({ ownerState }) => ({
8
- ...(ownerState.size === "smaller" && {
8
+ ...(ownerState.size === 'smaller' && {
9
9
  // tslint:disable-line
10
10
  height: 28,
11
11
  boxSizing: 'border-box'
12
12
  }),
13
- ...(ownerState.size === "custom" && {
13
+ ...(ownerState.size === 'custom' && {
14
14
  height: isMobileOnly ? 56 : 48,
15
15
  boxSizing: 'border-box'
16
- }),
17
- }),
18
- },
19
- },
20
- },
16
+ })
17
+ })
18
+ }
19
+ }
20
+ }
21
21
  });
@@ -83,12 +83,12 @@ const MaterialField: React.FC<IVehicleModalProps> = ({
83
83
  placeholder={placeholder}
84
84
  InputProps={{
85
85
  endAdornment: type === 'password' ? (
86
- <InputAdornment position="end">
86
+ <InputAdornment position='end'>
87
87
  <IconButton
88
- aria-label="toggle password visibility"
88
+ aria-label='toggle password visibility'
89
89
  onClick={handleClickShowPassword}
90
90
  onMouseDown={handleMouseDownPassword}
91
- edge="end"
91
+ edge='end'
92
92
  >
93
93
  {showPassword ? <IconSVG name='removeEyeIcon' customDimensions /> : <IconSVG name='removeEyeIcon' customDimensions />}
94
94
  </IconButton>
@@ -65,7 +65,7 @@ export const Theme = createTheme({
65
65
  },
66
66
  ['::-webkit-scrollbar-thumb:hover']: {
67
67
  backgroundColor: 'grey'
68
- },
68
+ }
69
69
  }
70
70
  }
71
71
  },
@@ -124,10 +124,10 @@ export const FlexWrap = styled('div')({
124
124
 
125
125
  ['& > span:after']: {
126
126
  position: 'relative',
127
- content: "', '"
127
+ content: `', '`
128
128
  },
129
129
  ['& > span:last-of-type:after']: {
130
130
  position: 'relative',
131
- content: "''"
131
+ content: `''`
132
132
  }
133
133
  });