@bytebrand/fe-ui-core 4.8.55 → 4.8.57
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/media/locales/de/promoSlider.json +0 -1
- package/media/locales/en/promoSlider.json +0 -1
- package/package.json +120 -117
- package/source/components/AccordionWidget/AccordionWidget.styl +0 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +0 -24
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -0
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -2
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -14
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -4
- package/source/components/_common/withStats/withStats.styl +0 -10
- package/source/components/_common/withStats/withStats.tsx +11 -2
- package/source/framework/DataTransformers.ts +0 -1
- package/source/framework/constants/common.ts +4 -8
- package/source/framework/types/types.ts +0 -1
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
- package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
- package/source/locales/data.ts +0 -3
- package/.husky/pre-push +0 -4
- package/.storybook/addons.js +0 -4
- package/.storybook/config.js +0 -64
- package/.storybook/postcss.config.js +0 -6
- package/.storybook/preview-head.html +0 -10
- package/.storybook/webpack.config.js +0 -130
- package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
- package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
- package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
- package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
- package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
- package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
- package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
- package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
- package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
- package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
- package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
- package/__tests__/components/_common/Image/Image.test.tsx +0 -82
- package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
- package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
- package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
- package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
- package/__tests__/mockedData/financingConfig.js +0 -202
- package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
- package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
- package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
- package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
- package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
- package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
- package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
- package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
- package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
- package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
- package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
- package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
- package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
- package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
- package/source/components/Alternative/Dealer.story.js +0 -32
- package/source/components/Alternative/Dealer.story.styl +0 -3
- package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
- package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
- package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
- package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
- package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
- package/source/components/ContactForm/ContactForm.story.js +0 -94
- package/source/components/ContactForm/ContactForm.story.styl +0 -0
- package/source/components/ContactInfo/ContactInfo.story.js +0 -58
- package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
- package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
- package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
- package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
- package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
- package/source/components/OfferPanel/OfferPanel.story.js +0 -139
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
- package/source/components/PriceRating/PriceRating.story.js +0 -39
- package/source/components/PriceRating/PriceRating.story.styl +0 -2
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
- package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
- package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
- package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
- package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
- package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
- package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
- package/source/components/SearchWidget/SearchWidget.story.js +0 -191
- package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
- package/source/components/Stepper/Stepper.story.js +0 -119
- package/source/components/Stepper/Stepper.story.styl +0 -41
- package/source/components/Theme.story.js +0 -36
- package/source/components/Theme.story.styl +0 -85
- package/source/components/TickerText/TickerText.story.js +0 -17
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
- package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
- package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
- package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
- package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
- package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
- package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
- package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
- package/source/components/_common/Accordion/Accordion.story.js +0 -36
- package/source/components/_common/Badge/Badge.story.js +0 -27
- package/source/components/_common/Badge/Badge.story.styl +0 -5
- package/source/components/_common/Bubble/Bubble.story.js +0 -52
- package/source/components/_common/Button/Button.story.js +0 -52
- package/source/components/_common/Button/Button.story.styl +0 -5
- package/source/components/_common/ButtonOld/Button.story.js +0 -54
- package/source/components/_common/ButtonOld/Button.story.styl +0 -5
- package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
- package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
- package/source/components/_common/Chip/Chip.story.js +0 -43
- package/source/components/_common/ChipList/ChipList.story.js +0 -36
- package/source/components/_common/DropDown/DropDown.story.js +0 -35
- package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
- package/source/components/_common/Histogram/Histogram.story.js +0 -51
- package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
- package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
- package/source/components/_common/Image/Image.story.js +0 -142
- package/source/components/_common/Image/Image.story.styl +0 -18
- package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
- package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
- package/source/components/_common/Loader/Loader.story.js +0 -21
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
- package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
- package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
- package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
- package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
- package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
- package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
- package/source/components/_common/Modal/Modal.story.js +0 -37
- package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
- package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
- package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
- package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
- package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
- package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
- package/source/components/_common/Radio/Radio.story.js +0 -54
- package/source/components/_common/Radio/RadioGroup.story.js +0 -90
- package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
- package/source/components/_common/Range/Range.story.js +0 -46
- package/source/components/_common/Range/Range.story.styl +0 -5
- package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
- package/source/components/_common/Tabs/Tabs.story.js +0 -56
- package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
- package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
- package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
- package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
- package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
- package/source/components/_common/withLabel/withLabel.story.js +0 -62
- package/source/components/_common/withPopover/withPopover.story.js +0 -48
- package/source/components/_common/withPopover/withPopover.story.styl +0 -54
- package/source/components/_common/withStats/withStats.story.js +0 -75
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import DropDown from './../_common/DropDown/DropDown';
|
|
5
|
-
import { FiltersFactory } from './FiltersFactory';
|
|
6
|
-
import FilterBlock from './common/FilterBlock/FilterBlock';
|
|
7
|
-
import { DAMAGED_OPTIONS, DOORS, OWNERS_OPTIONS, STATE_OPTIONS } from '../../framework/constants/Search';
|
|
8
|
-
import {
|
|
9
|
-
BODY_TYPES,
|
|
10
|
-
DRIVE_TYPES,
|
|
11
|
-
EMISSION_CLASS,
|
|
12
|
-
EMISSION_STICKERS,
|
|
13
|
-
EXTERIOR_COLORS,
|
|
14
|
-
FUEL_TYPES, HIGHLIGHTS_TYPES, INTERIOR_COLORS, INTERIOR_TYPES, TRANSMISSION_TYPES
|
|
15
|
-
} from '../../framework/constants/selectors';
|
|
16
|
-
import { FIRST_REGISTRATION_HISTOGRAM, MILEAGE_HISTOGRAM, POWER_HISTOGRAM, PRICE_HISTOGRAM } from '../../framework/data';
|
|
17
|
-
import { MMS_GROUPS } from '../../framework/constants/filters';
|
|
18
|
-
|
|
19
|
-
const t = (phrase, options = {}) => {
|
|
20
|
-
const dictionary = {
|
|
21
|
-
'filters.rateTitle': 'Price/Rate',
|
|
22
|
-
'filters.price': 'Price',
|
|
23
|
-
'filters.rate': 'Rate',
|
|
24
|
-
'rateSearchWidget.changeRateLink': 'open',
|
|
25
|
-
'rateSearchWidget.any': 'any',
|
|
26
|
-
'rateSearchWidget.defaultValue': 'any, 60 Months',
|
|
27
|
-
'rateSearchWidget.monthsValue': 'Months Value',
|
|
28
|
-
};
|
|
29
|
-
return dictionary[phrase];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const HIGHLIGHTS = {
|
|
33
|
-
aggregation: {},
|
|
34
|
-
values: [],
|
|
35
|
-
options: HIGHLIGHTS_TYPES
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const FILTERS = {
|
|
39
|
-
CONSUMPTION: {
|
|
40
|
-
values: { from: 1, to: 18 },
|
|
41
|
-
options: [{ from: 1, to: 18 }],
|
|
42
|
-
onChange: action('change consumption'),
|
|
43
|
-
t: () => ''
|
|
44
|
-
},
|
|
45
|
-
DAMAGED: {
|
|
46
|
-
values: '',
|
|
47
|
-
options: DAMAGED_OPTIONS,
|
|
48
|
-
onChange: action('change damaged'),
|
|
49
|
-
t: () => ''
|
|
50
|
-
},
|
|
51
|
-
DOORS: {
|
|
52
|
-
values: '',
|
|
53
|
-
options: DOORS,
|
|
54
|
-
onChange: action('change seats'),
|
|
55
|
-
t: () => ''
|
|
56
|
-
},
|
|
57
|
-
DRIVE_TYPE: {
|
|
58
|
-
aggregation: {},
|
|
59
|
-
values: [],
|
|
60
|
-
options: DRIVE_TYPES,
|
|
61
|
-
onChange: action('change drive type'),
|
|
62
|
-
t: () => ''
|
|
63
|
-
},
|
|
64
|
-
EMISSION_CLASS: {
|
|
65
|
-
values: '',
|
|
66
|
-
options: EMISSION_CLASS,
|
|
67
|
-
onChange: action('change emission class'),
|
|
68
|
-
t: () => ''
|
|
69
|
-
},
|
|
70
|
-
EMISSION_STICKER: {
|
|
71
|
-
value: '',
|
|
72
|
-
options: EMISSION_STICKERS,
|
|
73
|
-
onChange: action('change emission sticker'),
|
|
74
|
-
t: () => ''
|
|
75
|
-
},
|
|
76
|
-
EXTERIOR_COLOR: {
|
|
77
|
-
name: 'EXTERIOR_COLOR',
|
|
78
|
-
values: [],
|
|
79
|
-
options: EXTERIOR_COLORS,
|
|
80
|
-
onChange: action('change exterior color'),
|
|
81
|
-
t: () => ''
|
|
82
|
-
},
|
|
83
|
-
FIRST_REGISTRATION: {
|
|
84
|
-
name: 'FIRST_REGISTRATION',
|
|
85
|
-
values: { from: 1970, to: 2019 },
|
|
86
|
-
controls: { from: '', to: '' },
|
|
87
|
-
options: FIRST_REGISTRATION_HISTOGRAM,
|
|
88
|
-
onChange: action('change first registration'),
|
|
89
|
-
onChangeControls: action('change first registration'),
|
|
90
|
-
t: () => ''
|
|
91
|
-
},
|
|
92
|
-
FUEL: {
|
|
93
|
-
aggregation: {},
|
|
94
|
-
values: [],
|
|
95
|
-
options: FUEL_TYPES,
|
|
96
|
-
onChange: action('change fuel'),
|
|
97
|
-
t: () => ''
|
|
98
|
-
},
|
|
99
|
-
HIGHLIGHTS: {
|
|
100
|
-
HIGHLIGHTS: HIGHLIGHTS,
|
|
101
|
-
onFilterChange: action('change highlights'),
|
|
102
|
-
t: () => ''
|
|
103
|
-
},
|
|
104
|
-
INTERIOR_COLOR: {
|
|
105
|
-
name: 'INTERIOR_COLOR',
|
|
106
|
-
values: [],
|
|
107
|
-
options: INTERIOR_COLORS,
|
|
108
|
-
onChange: action('change interior color'),
|
|
109
|
-
t: () => ''
|
|
110
|
-
},
|
|
111
|
-
INTERIOR_TYPE: {
|
|
112
|
-
aggregation: {},
|
|
113
|
-
values: [],
|
|
114
|
-
options: INTERIOR_TYPES,
|
|
115
|
-
onChange: action('change interior material'),
|
|
116
|
-
t: () => ''
|
|
117
|
-
},
|
|
118
|
-
MAKE_MODEL: {
|
|
119
|
-
MMS_GROUPS,
|
|
120
|
-
BODY_TYPE: {
|
|
121
|
-
options: BODY_TYPES,
|
|
122
|
-
values: []
|
|
123
|
-
},
|
|
124
|
-
onAddMmsGroup: () => { },
|
|
125
|
-
onRemoveMmsGroup: (index) => { },
|
|
126
|
-
onChange: (field, value, index, isSeries) => { },
|
|
127
|
-
t: () => { }
|
|
128
|
-
},
|
|
129
|
-
MILEAGE: {
|
|
130
|
-
name: 'MILEAGE',
|
|
131
|
-
values: { from: 0, to: 150000 },
|
|
132
|
-
controls: { from: '', to: '' },
|
|
133
|
-
options: MILEAGE_HISTOGRAM,
|
|
134
|
-
onChange: action('change mileage'),
|
|
135
|
-
onChangeControls: action('change mileage'),
|
|
136
|
-
t: () => ''
|
|
137
|
-
},
|
|
138
|
-
OWNERS: {
|
|
139
|
-
value: '',
|
|
140
|
-
options: OWNERS_OPTIONS,
|
|
141
|
-
onChange: action('change owner'),
|
|
142
|
-
t: () => ''
|
|
143
|
-
},
|
|
144
|
-
POWER: {
|
|
145
|
-
name: 'POWER',
|
|
146
|
-
values: { from: 0, to: 600 },
|
|
147
|
-
controls: { from: '', to: '' },
|
|
148
|
-
options: POWER_HISTOGRAM,
|
|
149
|
-
onChange: action('change power'),
|
|
150
|
-
onChangeControls: action('change power'),
|
|
151
|
-
t: () => ''
|
|
152
|
-
},
|
|
153
|
-
COST: {
|
|
154
|
-
COST_TYPE: {
|
|
155
|
-
options: ['price', 'rate'],
|
|
156
|
-
values: 'rate'
|
|
157
|
-
},
|
|
158
|
-
PRICE: {
|
|
159
|
-
options: PRICE_HISTOGRAM,
|
|
160
|
-
values: { from: 0, to: 90000 },
|
|
161
|
-
controls: { from: '', to: '' }
|
|
162
|
-
},
|
|
163
|
-
RATE: {
|
|
164
|
-
values: { monthlyInstallmentFrom: 'any', monthlyInstallmentTo: 'any', firstInstallment: 0, paybackPeriod: 60 }
|
|
165
|
-
},
|
|
166
|
-
onChange: action('change'),
|
|
167
|
-
onChangeControls: action('change'),
|
|
168
|
-
getRateSearchPrice: (value) => ({ from: 1000, to: 5000 }),
|
|
169
|
-
t
|
|
170
|
-
},
|
|
171
|
-
PRICE: {
|
|
172
|
-
name: 'PRICE',
|
|
173
|
-
values: { from: 0, to: 90000 },
|
|
174
|
-
controls: { from: '', to: '' },
|
|
175
|
-
options: PRICE_HISTOGRAM,
|
|
176
|
-
onChange: action('change price'),
|
|
177
|
-
onChangeControls: action('change price'),
|
|
178
|
-
t: () => ''
|
|
179
|
-
},
|
|
180
|
-
RATE: {
|
|
181
|
-
values: { monthlyInstallmentFrom: 'any', monthlyInstallmentTo: 'any', firstInstallment: 0, paybackPeriod: 60 },
|
|
182
|
-
isRateWidgetOpened: false,
|
|
183
|
-
onRateWidgetOpen: action('widget open'),
|
|
184
|
-
onRateWidgetClose: action('widget close'),
|
|
185
|
-
onRateChange: action('change rate'),
|
|
186
|
-
t
|
|
187
|
-
},
|
|
188
|
-
SEATS: {
|
|
189
|
-
values: { from: 1, to: 12 },
|
|
190
|
-
options: [{ from: 1, to: 12 }],
|
|
191
|
-
onChange: action('change seats'),
|
|
192
|
-
t: () => ''
|
|
193
|
-
},
|
|
194
|
-
STATE_OPTIONS: {
|
|
195
|
-
fieldValues: [],
|
|
196
|
-
fieldOptions: STATE_OPTIONS,
|
|
197
|
-
onChange: action('change state'),
|
|
198
|
-
t: () => ''
|
|
199
|
-
},
|
|
200
|
-
TRANSMISSION: {
|
|
201
|
-
aggregation: {},
|
|
202
|
-
values: [],
|
|
203
|
-
options: TRANSMISSION_TYPES,
|
|
204
|
-
onChange: action('change transmission type'),
|
|
205
|
-
t: () => ''
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const containerStyles = {
|
|
210
|
-
width: '280px'
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const filterStyles = {
|
|
214
|
-
marginTop: '20px',
|
|
215
|
-
paddingTop: '20px',
|
|
216
|
-
borderTop: '1px solid #005CCB'
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
// Stateful container for testing interaction
|
|
220
|
-
class FiltersContainer extends React.Component {
|
|
221
|
-
constructor(props) {
|
|
222
|
-
super(props);
|
|
223
|
-
|
|
224
|
-
this.state = {
|
|
225
|
-
activeFilter: 'CONSUMPTION'
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
changeActiveFilter = (filter) => {
|
|
230
|
-
this.setState(() => ({
|
|
231
|
-
activeFilter: filter.value
|
|
232
|
-
}));
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
getOptions = (options) => options.map((option) => ({
|
|
236
|
-
value: option,
|
|
237
|
-
label: option
|
|
238
|
-
}));
|
|
239
|
-
|
|
240
|
-
render() {
|
|
241
|
-
const { activeFilter } = this.state;
|
|
242
|
-
|
|
243
|
-
const filterProps = FILTERS[activeFilter];
|
|
244
|
-
const filters = Object.keys(FILTERS);
|
|
245
|
-
const component = FiltersFactory[activeFilter](filterProps);
|
|
246
|
-
|
|
247
|
-
const ddProps = {
|
|
248
|
-
options: this.getOptions(filters),
|
|
249
|
-
onChange: this.changeActiveFilter
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
return (
|
|
253
|
-
<div>
|
|
254
|
-
<DropDown {...ddProps} />
|
|
255
|
-
<div style={filterStyles}>
|
|
256
|
-
<FilterBlock expand={true}>
|
|
257
|
-
{component}
|
|
258
|
-
</FilterBlock>
|
|
259
|
-
</div>
|
|
260
|
-
</div>
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
storiesOf('FiltersFactory', module)
|
|
267
|
-
.add('All available filters', () => (
|
|
268
|
-
<div style={containerStyles}>
|
|
269
|
-
<FiltersContainer />
|
|
270
|
-
</div>
|
|
271
|
-
));
|
|
272
|
-
|
|
273
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// import React from 'react';
|
|
2
|
-
// import { Resizable } from 're-resizable';
|
|
3
|
-
// import { storiesOf } from '@storybook/react';
|
|
4
|
-
// import { action } from '@storybook/addon-actions';
|
|
5
|
-
|
|
6
|
-
// import VehicleSmallCardForDealerships from './VehicleSmallCardForDealerships.tsx';
|
|
7
|
-
// import styles from './VehicleSmallCardForDealerships.story.styl';
|
|
8
|
-
|
|
9
|
-
// storiesOf('MakeModel', module)
|
|
10
|
-
// .add('MakeModel', () => (
|
|
11
|
-
// <MakeModelStory />
|
|
12
|
-
// ));
|