@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.
- package/package.json +1 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +1 -1
- package/source/components/Alternative/DealerInfo.tsx +17 -12
- package/source/components/OfferPanel/AboAccordion/AboAccordion.tsx +1 -1
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +1 -1
- package/source/components/RateSearchWidget/RateSearchWidget.tsx +4 -4
- package/source/components/SearchFilters/common/FilterBlock/FilterBlock.styled.tsx +1 -1
- package/source/components/SearchFilters/common/FilterBlock/FilterBlock.tsx +24 -24
- package/source/components/SearchFilters/common/RangeControlled/RangeControlled.tsx +4 -5
- package/source/components/SearchFilters/filters/Consumption.tsx +2 -2
- package/source/components/SearchFilters/filters/Cost.tsx +30 -28
- package/source/components/SearchFilters/filters/EmissionSticker.tsx +14 -14
- package/source/components/SearchFilters/filters/FirstRegistration.tsx +2 -2
- package/source/components/SearchFilters/filters/ImagesCount.tsx +3 -3
- package/source/components/SearchFilters/filters/InteriorColor.tsx +2 -2
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -2
- package/source/components/SearchFilters/filters/MakeModel.tsx +1 -2
- package/source/components/SearchFilters/filters/Mileage.tsx +3 -4
- package/source/components/SearchFilters/filters/Owners.tsx +0 -1
- package/source/components/SearchFilters/filters/Power.tsx +3 -6
- package/source/components/SearchFilters/filters/PriceDifference.tsx +4 -5
- package/source/components/SearchPage/ChipFilter/ChipFilter.tsx +1 -1
- package/source/components/SearchPage/Filters/MakeModel/MakeModel.tsx +3 -3
- package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +4 -4
- package/source/components/SearchPageMobile/FiltersDetailed/FirstRegistration.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/Fuel.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Mileage.tsx +2 -3
- package/source/components/SearchPageMobile/FiltersDetailed/Power.tsx +4 -4
- package/source/components/SearchPageMobile/FiltersDetailed/Price.tsx +3 -4
- package/source/components/SearchPageMobile/FiltersDetailed/Rate.tsx +2 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Seats.tsx +2 -2
- package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +1 -1
- package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
- package/source/components/SearchWidget/OfferDetalisWidget/OfferDetailsWidgetMobile.tsx +1 -1
- package/source/components/SearchWidget/StateWidget/StateWidget.tsx +10 -7
- package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +7 -7
- package/source/components/SearchWidgetsMobile/EngineTransDriveWidget/EngineTransDriveWidget.tsx +4 -5
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.styled.tsx +2 -2
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +8 -9
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidgetCategory.tsx +17 -17
- package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +2 -2
- package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
- package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +5 -5
- package/source/components/SearchWidgetsMobile/StateWidget/StateWidget.tsx +14 -11
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +1 -1
- package/source/components/_common/Checkbox/FormCheckbox.tsx +1 -1
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +30 -27
- package/source/components/_common/Chip/Chip.tsx +1 -1
- package/source/components/_common/DropDown/DropDown.tsx +1 -2
- package/source/components/_common/ExpansionPanel/ExpansionPanel.styled.tsx +2 -9
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +3 -1
- package/source/components/_common/IconSVG/SVG/settings/RemoveEye.tsx +1 -1
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +56 -56
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +31 -31
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.tsx +26 -27
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +7 -7
- package/source/components/_common/MaterialField/MaterialField.tsx +3 -3
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +3 -3
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +34 -32
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.styled.tsx +3 -7
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +1 -2
- package/source/components/_common/Range/Range.tsx +1 -1
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +7 -2
- package/source/framework/constants/app.ts +1 -1
- package/source/framework/constants/highlights.ts +1 -1
- package/source/framework/types/types.ts +1 -1
- package/source/framework/utils/CommonUtils.ts +27 -15
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import _get from 'lodash/get';
|
|
3
3
|
import { MILLAGE_FIX } from '../../../framework/constants/Search';
|
|
4
|
-
import { sliceLessThan, sliceMoreThan } from '../../../framework/utils/CommonUtils';
|
|
4
|
+
import { sliceLessThan, sliceMoreThan, numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
5
5
|
import styles from './HistogramSlider.styl';
|
|
6
6
|
import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
|
|
7
|
-
import { numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
8
7
|
|
|
9
8
|
export interface IMileageProps {
|
|
10
9
|
values: any;
|
|
@@ -77,5 +76,5 @@ class Mileage extends React.Component<IMileageProps, {}> {
|
|
|
77
76
|
export default memo(Mileage, (prevProps: any, nextProps: any) => {
|
|
78
77
|
return prevProps.controls.from === nextProps.controls.from &&
|
|
79
78
|
prevProps.controls.to === nextProps.controls.to &&
|
|
80
|
-
prevProps.t === nextProps.t
|
|
79
|
+
prevProps.t === nextProps.t;
|
|
81
80
|
});
|
|
@@ -31,7 +31,7 @@ const Power: React.FC<IPowerProps> = ({
|
|
|
31
31
|
const transformedValue = name === 'type' ? value.value : value;
|
|
32
32
|
const { from, to, type }: any = { ...controls, [name]: transformedValue };
|
|
33
33
|
const controlsObj = { from, to, type };
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
onChangeControls('POWER', controlsObj);
|
|
36
36
|
onChange('POWER', controlsObj);
|
|
37
37
|
};
|
|
@@ -41,7 +41,7 @@ const Power: React.FC<IPowerProps> = ({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const getLabel = (value: string, type: string = 'PS'): React.ReactNode => {
|
|
44
|
-
return `${parseInt(value, 10)} ${type}
|
|
44
|
+
return `${parseInt(value, 10)} ${type}`;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
const getOptions = (options: any) => {
|
|
@@ -54,7 +54,7 @@ const Power: React.FC<IPowerProps> = ({
|
|
|
54
54
|
const commonProps = {
|
|
55
55
|
type: 'number',
|
|
56
56
|
unit: type
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
|
|
59
59
|
const fromProps = {
|
|
60
60
|
...commonProps,
|
|
@@ -112,5 +112,5 @@ export default memo(Power, (prevProps: any, nextProps: any) => {
|
|
|
112
112
|
return prevProps.controls.from === nextProps.controls.from
|
|
113
113
|
&& prevProps.controls.to === nextProps.controls.to
|
|
114
114
|
&& prevProps.controls.type === nextProps.controls.type
|
|
115
|
-
&& prevProps.t === nextProps.t
|
|
115
|
+
&& prevProps.t === nextProps.t;
|
|
116
116
|
});
|
|
@@ -3,11 +3,10 @@ import _get from 'lodash/get';
|
|
|
3
3
|
import { isMobileOnly } from 'react-device-detect';
|
|
4
4
|
import styles from './HistogramSlider.styl';
|
|
5
5
|
import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
|
|
6
|
-
import { sliceLessThan, sliceMoreThan } from '../../../framework/utils/CommonUtils';
|
|
6
|
+
import { sliceLessThan, sliceMoreThan, numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
7
7
|
import { PRICES_FIX } from '../../../framework/constants/Search';
|
|
8
8
|
import { RadioGroup } from '@mui/material';
|
|
9
9
|
import CheckboxMaterial from '../../_common/CheckboxMaterial/CheckboxMaterial';
|
|
10
|
-
import { numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
11
10
|
|
|
12
11
|
export interface IPriceProps {
|
|
13
12
|
values: any;
|
|
@@ -126,5 +125,5 @@ class Price extends React.Component<IPriceProps, {}> {
|
|
|
126
125
|
export default memo(Price, (prevProps: any, nextProps: any) => {
|
|
127
126
|
return prevProps.controls.from === nextProps.controls.from &&
|
|
128
127
|
prevProps.controls.to === nextProps.controls.to &&
|
|
129
|
-
prevProps.t === nextProps.t
|
|
130
|
-
});
|
|
128
|
+
prevProps.t === nextProps.t;
|
|
129
|
+
});
|
|
@@ -186,7 +186,7 @@ class Rate extends React.Component<IRateProps, {}> {
|
|
|
186
186
|
const [monthlyInstallmentFrom, monthlyInstallmentTo, firstInstallment, paybackPeriod] = this.renderDropDowns();
|
|
187
187
|
return (
|
|
188
188
|
<>
|
|
189
|
-
<div className={styles.container} id={this.name}>
|
|
189
|
+
<div className={styles.container} id={this.name}>
|
|
190
190
|
{this.renderRadioGroup()}
|
|
191
191
|
<div className={styles.flexWrap}>
|
|
192
192
|
{monthlyInstallmentFrom}
|
|
@@ -248,5 +248,5 @@ export default memo(Rate, (prevProps: any, nextProps: any) => {
|
|
|
248
248
|
prevProps.controls.monthlyInstallmentTo === nextProps.controls.monthlyInstallmentTo &&
|
|
249
249
|
prevProps.controls.firstInstallment === nextProps.controls.firstInstallment &&
|
|
250
250
|
prevProps.t === nextProps.t &&
|
|
251
|
-
prevProps.controls.paybackPeriod === nextProps.controls.paybackPeriod
|
|
251
|
+
prevProps.controls.paybackPeriod === nextProps.controls.paybackPeriod;
|
|
252
252
|
});
|
|
@@ -81,5 +81,5 @@ class Seats extends React.Component<ISeatsProps, {}> {
|
|
|
81
81
|
export default memo(Seats, (prevProps: any, nextProps: any) => {
|
|
82
82
|
return prevProps.values.from === nextProps.values.from
|
|
83
83
|
&& prevProps.values.to === nextProps.values.to
|
|
84
|
-
&& prevProps.t === nextProps.t
|
|
85
|
-
});
|
|
84
|
+
&& prevProps.t === nextProps.t;
|
|
85
|
+
});
|
|
@@ -118,5 +118,5 @@ export default memo(BodyColorWidget, (prevProps: IBodyColorWidgetProps, nextProp
|
|
|
118
118
|
return isEqual(prevProps.BODY_COLOR.values.length, nextProps.BODY_COLOR.values.length) &&
|
|
119
119
|
isEqual(prevProps.BODY_COLOR.aggregation, nextProps.BODY_COLOR.aggregation) &&
|
|
120
120
|
prevProps.METALLIC.values === nextProps.METALLIC.values &&
|
|
121
|
-
prevProps.t === nextProps.t
|
|
121
|
+
prevProps.t === nextProps.t;
|
|
122
122
|
});
|
|
@@ -32,7 +32,7 @@ const Wrapper = styled('div')({
|
|
|
32
32
|
gridTemplateColumns: '1fr',
|
|
33
33
|
'@media(min-width: 768px)': {
|
|
34
34
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
35
|
-
padding: 15
|
|
35
|
+
padding: 15
|
|
36
36
|
},
|
|
37
37
|
'@media(min-width: 992px)': {
|
|
38
38
|
gridTemplateColumns: 'repeat(auto-fit, minmax(130px, 1fr))'
|
|
@@ -95,7 +95,7 @@ const EnvironmentWidget: React.FC<IEnvironmentWidgetProps> = ({
|
|
|
95
95
|
const icons = isDealerPage ? WP_EMISSION_STICKERS_ICONS : EMISSION_STICKERS_ICONS;
|
|
96
96
|
|
|
97
97
|
const props = {
|
|
98
|
-
type
|
|
98
|
+
type,
|
|
99
99
|
key: sticker,
|
|
100
100
|
name: sticker,
|
|
101
101
|
value: sticker,
|
|
@@ -172,4 +172,4 @@ export default memo(EnvironmentWidget, (prevProps, nextProps) =>
|
|
|
172
172
|
&& prevProps.EMISSION_CLASS.values === nextProps.EMISSION_CLASS.values
|
|
173
173
|
&& prevProps.EMISSION_STICKER.values === nextProps.EMISSION_STICKER.values
|
|
174
174
|
&& prevProps.PARTICULATE_FILTER.values === nextProps.PARTICULATE_FILTER.values
|
|
175
|
-
);
|
|
175
|
+
);
|
|
@@ -56,4 +56,4 @@ const OfferDetailsWidgetMobile: React.FC<IOfferDetailsWidgetProps> = ({
|
|
|
56
56
|
export default memo(OfferDetailsWidgetMobile, (prevProps: IOfferDetailsWidgetProps, nextProps: IOfferDetailsWidgetProps) =>
|
|
57
57
|
prevProps.t === nextProps.t
|
|
58
58
|
&& prevProps.ONLINE_SINCE.values === nextProps.ONLINE_SINCE.values
|
|
59
|
-
);
|
|
59
|
+
);
|
|
@@ -22,13 +22,16 @@ const StateWidget = (props: IStateWidgetProps) => {
|
|
|
22
22
|
const { OWNERS, STATE_OPTIONS, STATE_OPTIONS_NEW, onFilterChange, VEHICLE_CONDITION: { values }, t } = props;
|
|
23
23
|
const [disabled, setDisabled] = useState(true);
|
|
24
24
|
|
|
25
|
-
useEffect(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
useEffect(
|
|
26
|
+
() => {
|
|
27
|
+
if (values.includes('selector_condition_used')) {
|
|
28
|
+
setDisabled(false);
|
|
29
|
+
} else {
|
|
30
|
+
setDisabled(true);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[values]
|
|
34
|
+
);
|
|
32
35
|
|
|
33
36
|
const ownersProps = {
|
|
34
37
|
options: OWNERS.options,
|
package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx
CHANGED
|
@@ -35,13 +35,13 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
|
|
|
35
35
|
|
|
36
36
|
const dataBlocks = {
|
|
37
37
|
MMS_GROUPS, BODY_TYPE, FIRST_REGISTRATION, MILEAGE, POWER, RATE, PRICE, CONSUMPTION, SEATS, DOORS, FUEL
|
|
38
|
-
}
|
|
38
|
+
};
|
|
39
39
|
const newPropsDataBlocks = {
|
|
40
40
|
MMS_GROUPS: nextProps.MMS_GROUPS, BODY_TYPE: nextProps.BODY_TYPE,
|
|
41
41
|
FIRST_REGISTRATION: nextProps.FIRST_REGISTRATION, MILEAGE: nextProps.MILEAGE, POWER: nextProps.POWER,
|
|
42
42
|
RATE: nextProps.RATE, PRICE: nextProps.PRICE, CONSUMPTION: nextProps.CONSUMPTION, SEATS: nextProps.SEATS,
|
|
43
43
|
DOORS: nextProps.DOORS, FUEL: nextProps.FUEL
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
|
|
46
46
|
const result = JSON.stringify(dataBlocks) !== JSON.stringify(newPropsDataBlocks)
|
|
47
47
|
|| this.state.costType !== nextState.costType
|
|
@@ -72,12 +72,12 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
|
|
|
72
72
|
|
|
73
73
|
const makeModelProps = {
|
|
74
74
|
...commonProps,
|
|
75
|
+
onRemoveMmsGroup,
|
|
76
|
+
onDropDownFocus,
|
|
75
77
|
MMS_GROUPS,
|
|
76
78
|
BODY_TYPE,
|
|
77
79
|
onAddMmsGroup: onAddMmsGroupClick,
|
|
78
|
-
|
|
79
|
-
onDropDownFocus,
|
|
80
|
-
aggregation: BODY_TYPE.aggregation || {},
|
|
80
|
+
aggregation: BODY_TYPE.aggregation || {}
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
const bodyTypeProps = {
|
|
@@ -90,7 +90,7 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
|
|
|
90
90
|
const doorsProps = {
|
|
91
91
|
...commonProps,
|
|
92
92
|
fieldOptions: DOORS.options,
|
|
93
|
-
fieldValues: DOORS.values
|
|
93
|
+
fieldValues: DOORS.values
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
const fuelProps = {
|
|
@@ -98,7 +98,7 @@ class BasicDataWidgetMobile extends React.Component<IMakeModelProps & IMakeModel
|
|
|
98
98
|
onDropDownFocus,
|
|
99
99
|
options: FUEL.options,
|
|
100
100
|
values: FUEL.values,
|
|
101
|
-
aggregation: FUEL.aggregation || {}
|
|
101
|
+
aggregation: FUEL.aggregation || {}
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
const consumptionProps = {
|
package/source/components/SearchWidgetsMobile/EngineTransDriveWidget/EngineTransDriveWidget.tsx
CHANGED
|
@@ -6,12 +6,11 @@ import Transmission, { ITransmissionProps } from '../../SearchFilters/filters/Tr
|
|
|
6
6
|
import { CUBIC_CAPACITY_FIX, CUBIC_CAPACITY_KEY, FUEL_KEY } from '../../../framework/constants/Search';
|
|
7
7
|
import _get from 'lodash/get';
|
|
8
8
|
import FilterLabel from '../../_common/FilterLabel/FilterLabel';
|
|
9
|
-
import { sliceLessThan, sliceMoreThan } from '../../../framework/utils/CommonUtils';
|
|
9
|
+
import { sliceLessThan, sliceMoreThan, numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
10
10
|
import MaterialSelect from '../../_common/MaterialSelect/MaterialSelect';
|
|
11
11
|
import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
|
|
12
12
|
import styles from './EngineTransDriveWidget.styl';
|
|
13
13
|
import IconSVG from '../../_common/IconSVG/IconSVG';
|
|
14
|
-
import { numberWithDot } from '../../../framework/utils/CommonUtils';
|
|
15
14
|
import { isEqual } from 'lodash';
|
|
16
15
|
|
|
17
16
|
export interface IDriveTransmissionWidgetProps {
|
|
@@ -67,7 +66,7 @@ const EngineTransDriveWidget: React.FC<IDriveTransmissionWidgetProps> = ({
|
|
|
67
66
|
|
|
68
67
|
onChangeFilterControls(CUBIC_CAPACITY_KEY, controls);
|
|
69
68
|
onFilterChange(CUBIC_CAPACITY_KEY, controls);
|
|
70
|
-
}
|
|
69
|
+
};
|
|
71
70
|
|
|
72
71
|
const baseProps = {
|
|
73
72
|
t,
|
|
@@ -113,7 +112,7 @@ const EngineTransDriveWidget: React.FC<IDriveTransmissionWidgetProps> = ({
|
|
|
113
112
|
<Transmission {...TRANSMISSION} {...baseProps} />
|
|
114
113
|
</div>
|
|
115
114
|
);
|
|
116
|
-
}
|
|
115
|
+
};
|
|
117
116
|
// export default EngineTransDriveWidget;
|
|
118
117
|
export default memo(EngineTransDriveWidget, (prevProps: any, nextProps: any) => {
|
|
119
118
|
return (prevProps.CUBIC_CAPACITY.controls.from === nextProps.CUBIC_CAPACITY.controls.from &&
|
|
@@ -121,5 +120,5 @@ export default memo(EngineTransDriveWidget, (prevProps: any, nextProps: any) =>
|
|
|
121
120
|
isEqual(prevProps.DRIVE_TYPE.values, nextProps.DRIVE_TYPE.values) &&
|
|
122
121
|
isEqual(prevProps.TRANSMISSION.values, nextProps.TRANSMISSION.values) &&
|
|
123
122
|
prevProps.FUEL.values.length === nextProps.FUEL.values.length &&
|
|
124
|
-
prevProps.t === nextProps.t
|
|
123
|
+
prevProps.t === nextProps.t;
|
|
125
124
|
});
|
|
@@ -23,12 +23,12 @@ export const CheckboxesContainer = styled('div')({
|
|
|
23
23
|
'@media(min-width: 768px)': {
|
|
24
24
|
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
25
25
|
gridGap: '16px 24px',
|
|
26
|
-
gridColumn: '1 / span 3'
|
|
26
|
+
gridColumn: '1 / span 3'
|
|
27
27
|
},
|
|
28
28
|
'@media(min-width: 992px)': {
|
|
29
29
|
gridGap: '16px 24px',
|
|
30
30
|
gridTemplateColumns: 'repeat(3, 1fr)',
|
|
31
|
-
gridColumn: '1 / span 3'
|
|
31
|
+
gridColumn: '1 / span 3'
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export const CategoryTitle = styled('h3')({
|
|
@@ -56,7 +56,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
56
56
|
|
|
57
57
|
const onPanelFocus = (panelKey: any) => {
|
|
58
58
|
onCategoryFocus(panelKey);
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
60
|
|
|
61
61
|
const getAccordionItems = (categories: any[]) => {
|
|
62
62
|
const colLg = 3;
|
|
@@ -99,10 +99,10 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
99
99
|
|
|
100
100
|
const renderAccordionLayout = (categories: any[]): React.ReactNode => {
|
|
101
101
|
const accordionProps = {
|
|
102
|
+
onPanelFocus,
|
|
102
103
|
className: styles.accordion,
|
|
103
104
|
items: getAccordionItems(categories),
|
|
104
105
|
accordionName: 'equipmentAccordion',
|
|
105
|
-
onPanelFocus: onPanelFocus,
|
|
106
106
|
variant: 'searchDetailedSmall'
|
|
107
107
|
};
|
|
108
108
|
|
|
@@ -120,7 +120,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
120
120
|
if (onDropDownFocus) {
|
|
121
121
|
onDropDownFocus(fieldName);
|
|
122
122
|
}
|
|
123
|
-
}
|
|
123
|
+
};
|
|
124
124
|
|
|
125
125
|
const getOptions = (options: any, categoryName?: string) => {
|
|
126
126
|
const { [categoryName]: { aggregation } } = props;
|
|
@@ -143,7 +143,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
143
143
|
default:
|
|
144
144
|
return false;
|
|
145
145
|
}
|
|
146
|
-
}
|
|
146
|
+
};
|
|
147
147
|
|
|
148
148
|
const renderDropDown = (index: number, categoryName?: string, data?: any, isMobile?: boolean): React.ReactNode => {
|
|
149
149
|
const { options, values } = data;
|
|
@@ -239,7 +239,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
239
239
|
t={t}
|
|
240
240
|
onCheckboxClick={onCheckboxClick}
|
|
241
241
|
aggregation={aggObj}
|
|
242
|
-
|
|
242
|
+
/>;
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
const renderSimpleLayout = (categories: any[]): React.ReactNode => {
|
|
@@ -247,7 +247,6 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
247
247
|
category.name === 'SEATS_OPTIONS' ? renderDropDown(index, category.name, category.data) : getCategory(category.name, category.data));
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
-
|
|
251
250
|
const categories = [
|
|
252
251
|
{ name: 'CLIMATISATION', data: CLIMATISATION },
|
|
253
252
|
{ name: 'HEATER', data: HEATER },
|
|
@@ -273,7 +272,7 @@ const EquipmentsWidget = (props: IEquipmentsWidget) => {
|
|
|
273
272
|
/>
|
|
274
273
|
</Wrapper>
|
|
275
274
|
);
|
|
276
|
-
}
|
|
275
|
+
};
|
|
277
276
|
|
|
278
277
|
export default memo(EquipmentsWidget, (prevProps, nextProps) => {
|
|
279
278
|
return prevProps.t === nextProps.t &&
|
|
@@ -290,5 +289,5 @@ export default memo(EquipmentsWidget, (prevProps, nextProps) => {
|
|
|
290
289
|
prevProps.WINDOW_OPTIONS.values === nextProps.WINDOW_OPTIONS.values &&
|
|
291
290
|
prevProps.MIRRORS_OPTIONS.values === nextProps.MIRRORS_OPTIONS.values &&
|
|
292
291
|
prevProps.LANDING_GEAR.values === nextProps.LANDING_GEAR.values &&
|
|
293
|
-
prevProps.EXTRAS_OPTIONS.values === nextProps.EXTRAS_OPTIONS.values
|
|
294
|
-
});
|
|
292
|
+
prevProps.EXTRAS_OPTIONS.values === nextProps.EXTRAS_OPTIONS.values;
|
|
293
|
+
});
|
|
@@ -5,11 +5,11 @@ import CheckboxMaterial from '../../_common/CheckboxMaterial/CheckboxMaterial';
|
|
|
5
5
|
import { isEqual } from 'lodash';
|
|
6
6
|
|
|
7
7
|
interface IEquipmentsWidgetBlockProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
name: string;
|
|
9
|
+
data: any;
|
|
10
|
+
aggregation: any;
|
|
11
|
+
onCheckboxClick: (fieldName: string, categoryName: string, values: string[]) => void;
|
|
12
|
+
t: (phrase: string) => string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const EquipmentsWidgetCategory = ({ name, data, aggregation, onCheckboxClick, t }: IEquipmentsWidgetBlockProps) => {
|
|
@@ -29,16 +29,16 @@ const EquipmentsWidgetCategory = ({ name, data, aggregation, onCheckboxClick, t
|
|
|
29
29
|
: ''
|
|
30
30
|
}`}>{<FilterLabel text={t(`cbd:${fieldName}`)} agg={agg} />}</span>;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
return (
|
|
33
|
+
<CheckboxMaterial
|
|
34
|
+
containerClassName={styles.checkbox}
|
|
35
|
+
onChange={onClick}
|
|
36
|
+
checked={values.includes(fieldName)}
|
|
37
|
+
label={label}
|
|
38
|
+
key={fieldName}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
42
|
</div>
|
|
43
43
|
);
|
|
44
44
|
};
|
|
@@ -46,5 +46,5 @@ const EquipmentsWidgetCategory = ({ name, data, aggregation, onCheckboxClick, t
|
|
|
46
46
|
export default memo(EquipmentsWidgetCategory, (prevProps: IEquipmentsWidgetBlockProps, nextProps: IEquipmentsWidgetBlockProps) => {
|
|
47
47
|
return prevProps.t === nextProps.t
|
|
48
48
|
&& prevProps.data.values.length === nextProps.data.values.length
|
|
49
|
-
&& isEqual(prevProps.aggregation, nextProps.aggregation)
|
|
50
|
-
});
|
|
49
|
+
&& isEqual(prevProps.aggregation, nextProps.aggregation);
|
|
50
|
+
});
|
package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx
CHANGED
|
@@ -87,10 +87,10 @@ const HighlightsWidgetMobile = ({ onFilterChange, HIGHLIGHTS, t }: IHighlightsWi
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
return <div className={styles.highlights}>{renderHighlights()}</div>;
|
|
90
|
-
}
|
|
90
|
+
};
|
|
91
91
|
|
|
92
92
|
export default memo(HighlightsWidgetMobile, (prevProps: IHighlightsWidgetProps, nextProps: IHighlightsWidgetProps) => {
|
|
93
93
|
return isEqual(prevProps.HIGHLIGHTS.values, nextProps.HIGHLIGHTS.values) &&
|
|
94
94
|
isEqual(prevProps.HIGHLIGHTS.aggregation, nextProps.HIGHLIGHTS.aggregation) &&
|
|
95
|
-
prevProps.t === nextProps.t
|
|
95
|
+
prevProps.t === nextProps.t;
|
|
96
96
|
});
|
|
@@ -44,7 +44,7 @@ const SafetyWidget = (props: ISafetyWidget) => {
|
|
|
44
44
|
if (onDropDownFocus) {
|
|
45
45
|
onDropDownFocus(AIRBAG_KEY);
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
const getOptions = (_: string, options: any) => {
|
|
50
50
|
const { aggregation } = AIRBAG;
|
|
@@ -71,7 +71,7 @@ const SafetyWidget = (props: ISafetyWidget) => {
|
|
|
71
71
|
return (
|
|
72
72
|
<FilterLabel text={t(`cbd:${option}`)} agg={agg} />
|
|
73
73
|
);
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
|
|
76
76
|
const renderCategory = (categoryName: string, index: number): React.ReactNode => {
|
|
77
77
|
const { options, values } = props[categoryName];
|
|
@@ -107,9 +107,9 @@ const SafetyWidget = (props: ISafetyWidget) => {
|
|
|
107
107
|
|
|
108
108
|
const ddProps = {
|
|
109
109
|
t,
|
|
110
|
+
onChange,
|
|
110
111
|
size: 'custom',
|
|
111
112
|
label: t('SAFETY.airbagPlaceholder'),
|
|
112
|
-
onChange,
|
|
113
113
|
items: getOptions(AIRBAG_KEY, options),
|
|
114
114
|
value: values,
|
|
115
115
|
multiple: true
|
|
@@ -134,7 +134,7 @@ const SafetyWidget = (props: ISafetyWidget) => {
|
|
|
134
134
|
{categories.map((category: string, index: number) => category === AIRBAG_KEY ? renderAirBags(index) : renderCategory(category, index))}
|
|
135
135
|
</div>
|
|
136
136
|
);
|
|
137
|
-
}
|
|
137
|
+
};
|
|
138
138
|
|
|
139
139
|
export default memo(SafetyWidget, (prevProps, nextProps) => {
|
|
140
140
|
return isEqual(prevProps.ASSISTANTS.values, nextProps.ASSISTANTS.values)
|
|
@@ -145,5 +145,5 @@ export default memo(SafetyWidget, (prevProps, nextProps) => {
|
|
|
145
145
|
&& isEqual(prevProps.PARKING_ASSISTANTS.aggregation, nextProps.PARKING_ASSISTANTS.aggregation)
|
|
146
146
|
&& isEqual(prevProps.THEFT_PROTECTION.values, nextProps.THEFT_PROTECTION.values)
|
|
147
147
|
&& isEqual(prevProps.THEFT_PROTECTION.aggregation, nextProps.THEFT_PROTECTION.aggregation)
|
|
148
|
-
&& prevProps.t === nextProps.t
|
|
148
|
+
&& prevProps.t === nextProps.t;
|
|
149
149
|
});
|
|
@@ -26,13 +26,16 @@ const StateWidget = (props: IStateWidgetProps) => {
|
|
|
26
26
|
const [disabled, setDisabled] = useState(true);
|
|
27
27
|
const { OWNERS, STATE_OPTIONS, STATE_OPTIONS_NEW, GENERAL_INSPECTION, onFilterChange, VEHICLE_CONDITION, t } = props;
|
|
28
28
|
|
|
29
|
-
useEffect(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
useEffect(
|
|
30
|
+
() => {
|
|
31
|
+
if (_get(VEHICLE_CONDITION, 'values').includes('selector_condition_used')) {
|
|
32
|
+
setDisabled(false);
|
|
33
|
+
} else {
|
|
34
|
+
setDisabled(true);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[_get(VEHICLE_CONDITION, 'values')]
|
|
38
|
+
);
|
|
36
39
|
|
|
37
40
|
const ownersProps = {
|
|
38
41
|
options: OWNERS.options,
|
|
@@ -43,14 +46,14 @@ const StateWidget = (props: IStateWidgetProps) => {
|
|
|
43
46
|
const getValue = (value: string, translate: string) => {
|
|
44
47
|
let label = null;
|
|
45
48
|
if (translate === 'cbd') {
|
|
46
|
-
label = t(`${translate}:${value}`)
|
|
49
|
+
label = t(`${translate}:${value}`);
|
|
47
50
|
} else {
|
|
48
|
-
label = t(`${translate}.${value}`)
|
|
51
|
+
label = t(`${translate}.${value}`);
|
|
49
52
|
}
|
|
50
53
|
return {
|
|
51
54
|
value,
|
|
52
55
|
label
|
|
53
|
-
}
|
|
56
|
+
};
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
const onChange = (fieldName: string) => () => {
|
|
@@ -166,4 +169,4 @@ export default memo(StateWidget, (prevProps, nextProps) =>
|
|
|
166
169
|
&& prevProps.STATE_OPTIONS.values.length === nextProps.STATE_OPTIONS.values.length
|
|
167
170
|
&& prevProps.VEHICLE_CONDITION.values.length === nextProps.VEHICLE_CONDITION.values.length
|
|
168
171
|
&& prevProps.STATE_OPTIONS_NEW.values.length === nextProps.STATE_OPTIONS_NEW.values.length
|
|
169
|
-
);
|
|
172
|
+
);
|
|
@@ -353,4 +353,4 @@ export default memo(VehicleSmallCard, (props, nextProps) => { // shouldComponent
|
|
|
353
353
|
&& annualMileage === nextProps.price.financing.annualMileage
|
|
354
354
|
&& withFinalInstallment === nextProps.price.financing.withFinalInstallment
|
|
355
355
|
&& lMonthlyInstallment === nextProps.price.leasing.monthlyInstallment;
|
|
356
|
-
});
|
|
356
|
+
});
|
|
@@ -26,7 +26,7 @@ class FormCheckbox extends React.Component<IFormCheckboxProps> {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
render() {
|
|
29
|
-
const { field, label, className, checkboxClassName, labelClassName, customError
|
|
29
|
+
const { field, label, className, checkboxClassName, labelClassName, customError } = this.props;
|
|
30
30
|
|
|
31
31
|
// const customHasError = customError;
|
|
32
32
|
// const hasError = field.hasError;
|