@wayke-se/components-react 3.0.0-beta.11 → 3.0.0-beta.12
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 +4 -2
- package/.editorconfig +0 -10
- package/.eslintrc.js +0 -62
- package/.github/workflows/release-to-production.yaml +0 -40
- package/.github/workflows/release-to-test.yaml +0 -40
- package/.prettierrc +0 -12
- package/assets/ajax-loader.gif +0 -0
- package/assets/default.css +0 -1
- package/assets/fonts/slick.eot +0 -0
- package/assets/fonts/slick.svg +0 -14
- package/assets/fonts/slick.ttf +0 -0
- package/assets/fonts/slick.woff +0 -0
- package/codegen.yml +0 -19
- package/esbuild/build.js +0 -39
- package/esbuild/common.js +0 -15
- package/esbuild/start.js +0 -21
- package/esbuild/www/index.html +0 -32
- package/example/src/@types/global.d.ts +0 -7
- package/example/src/@types/react-panellum.d.ts +0 -1
- package/example/src/App.tsx +0 -77
- package/example/src/assets/style/ecom.css +0 -63
- package/example/src/assets/style/theme.css +0 -83
- package/example/src/index.html +0 -26
- package/example/src/index.tsx +0 -11
- package/example/src/routes/HashRoute/index.tsx +0 -30
- package/example/src/routes/Home/index.tsx +0 -33
- package/example/src/routes/NotFound/index.tsx +0 -5
- package/example/src/routes/PathRoute/index.tsx +0 -35
- package/example/src/routes/Search/index.tsx +0 -28
- package/example/src/routes/SearchItem/index.tsx +0 -28
- package/example/src/routes/index.tsx +0 -25
- package/src/@types/action.ts +0 -3
- package/src/@types/codegen/types.ts +0 -366
- package/src/@types/filter.ts +0 -18
- package/src/@types/queryFilter.ts +0 -5
- package/src/@types/react-panellum.d.ts +0 -1
- package/src/@types/search.ts +0 -118
- package/src/@types/theme.d.ts +0 -5
- package/src/@types/vehicle-properties.ts +0 -33
- package/src/State/CentralStorage/CentralStorageContext.ts +0 -10
- package/src/State/CentralStorage/CentralStorageProvider.tsx +0 -21
- package/src/State/CentralStorage/useCentralStorage.ts +0 -37
- package/src/State/Path/PathContext.ts +0 -11
- package/src/State/Path/PathProvider.tsx +0 -66
- package/src/State/Path/reducer.ts +0 -30
- package/src/State/Path/usePath.ts +0 -13
- package/src/State/RelatedSearch/RelatedSearchContext.ts +0 -18
- package/src/State/RelatedSearch/RelatedSearchProvider.tsx +0 -55
- package/src/State/RelatedSearch/useRelatedSearch.ts +0 -20
- package/src/State/Search/SearchContext.ts +0 -27
- package/src/State/Search/SearchProvider.tsx +0 -243
- package/src/State/Search/useSearch.ts +0 -6
- package/src/State/Settings/SettingsContext.ts +0 -15
- package/src/State/Settings/SettingsProvider.tsx +0 -23
- package/src/State/Settings/useSettings.ts +0 -7
- package/src/components/Accordion/index.tsx +0 -57
- package/src/components/Accordion/wrapper.tsx +0 -107
- package/src/components/ActionList/index.tsx +0 -48
- package/src/components/ActionList/toggle-item.tsx +0 -59
- package/src/components/Avatar/index.tsx +0 -12
- package/src/components/Avatar/wrapper.tsx +0 -21
- package/src/components/Badge/index.tsx +0 -12
- package/src/components/Badge/wrapper.tsx +0 -32
- package/src/components/Blockquote/index.tsx +0 -32
- package/src/components/Blockquote/wrapper.tsx +0 -52
- package/src/components/Button/index.tsx +0 -226
- package/src/components/CheckMarkList/index.tsx +0 -21
- package/src/components/CheckMarkList/wrapper.tsx +0 -31
- package/src/components/Checklist/index.tsx +0 -51
- package/src/components/Checklist/wrapper.tsx +0 -65
- package/src/components/ColorSelect/index.tsx +0 -63
- package/src/components/ColorSelect/wrapper.tsx +0 -82
- package/src/components/ColumnRow/index.tsx +0 -20
- package/src/components/Container/index.tsx +0 -11
- package/src/components/Container/wrapper.tsx +0 -14
- package/src/components/Content/index.tsx +0 -15
- package/src/components/Content/wrapper.tsx +0 -61
- package/src/components/ContentLogo/index.tsx +0 -27
- package/src/components/DataList/index.tsx +0 -25
- package/src/components/DataList/wrapper.tsx +0 -29
- package/src/components/DetailBox/index.tsx +0 -34
- package/src/components/DetailBox/wrapper.tsx +0 -34
- package/src/components/ExtendContent/index.tsx +0 -43
- package/src/components/ExtendContent/wrapper.tsx +0 -41
- package/src/components/ExtendInfo/index.tsx +0 -32
- package/src/components/ExtendInfo/wrapper.tsx +0 -63
- package/src/components/Filter/index.tsx +0 -108
- package/src/components/Filter/wrapper.tsx +0 -79
- package/src/components/FilterPanel/checkListFacet.tsx +0 -46
- package/src/components/FilterPanel/colorFacet.tsx +0 -47
- package/src/components/FilterPanel/faceSelector.tsx +0 -53
- package/src/components/FilterPanel/index.tsx +0 -79
- package/src/components/FilterPanel/rangeFacet.tsx +0 -128
- package/src/components/FinancialOptions/LoanModal.tsx +0 -223
- package/src/components/FinancialOptions/index.tsx +0 -29
- package/src/components/FinancialOptions/leasing.tsx +0 -77
- package/src/components/FinancialOptions/loan.tsx +0 -87
- package/src/components/Gallery/MediaButton.tsx +0 -19
- package/src/components/Gallery/index.tsx +0 -227
- package/src/components/Gallery/wrapper.tsx +0 -323
- package/src/components/Grid/index.tsx +0 -87
- package/src/components/Grid/wrapper.tsx +0 -30
- package/src/components/Heading/index.tsx +0 -72
- package/src/components/Icon/index.tsx +0 -87
- package/src/components/InputCheckbox/index.tsx +0 -30
- package/src/components/InputCheckbox/wrapper.tsx +0 -87
- package/src/components/InputGroup/index.tsx +0 -24
- package/src/components/InputLabel/index.tsx +0 -14
- package/src/components/InputLabel/wrapper.tsx +0 -10
- package/src/components/InputSearch/index.tsx +0 -51
- package/src/components/InputSearch/wrapper.tsx +0 -97
- package/src/components/InputSelect/index.tsx +0 -35
- package/src/components/InputSelect/wrapper.tsx +0 -59
- package/src/components/InputText/index.tsx +0 -27
- package/src/components/InputText/wrapper.tsx +0 -57
- package/src/components/InsuranceOptions/Insurance.tsx +0 -60
- package/src/components/InsuranceOptions/InsuranceFree.tsx +0 -59
- package/src/components/InsuranceOptions/InsuranceFreeModal.tsx +0 -49
- package/src/components/InsuranceOptions/InsuranceModal.tsx +0 -253
- package/src/components/InsuranceOptions/index.tsx +0 -27
- package/src/components/Lightbox/index.tsx +0 -51
- package/src/components/Lightbox/wrapper.tsx +0 -97
- package/src/components/Loader/index.tsx +0 -18
- package/src/components/Loader/wrapper.tsx +0 -50
- package/src/components/LogoBox/index.tsx +0 -22
- package/src/components/LogoBox/wrapper.tsx +0 -19
- package/src/components/Map/index.tsx +0 -62
- package/src/components/Map/wrapper.tsx +0 -29
- package/src/components/Modal/index.tsx +0 -51
- package/src/components/Modal/wrapper.tsx +0 -127
- package/src/components/OpeningHours/index.tsx +0 -145
- package/src/components/OptionBox/index.tsx +0 -23
- package/src/components/OptionBox/wrapper.tsx +0 -56
- package/src/components/OverflowBox/index.tsx +0 -11
- package/src/components/OverflowBox/wrapper.tsx +0 -7
- package/src/components/OverflowGrid/index.tsx +0 -70
- package/src/components/Page/index.tsx +0 -46
- package/src/components/Panel/index.tsx +0 -50
- package/src/components/Panel/wrapper.tsx +0 -155
- package/src/components/Pdf/index.tsx +0 -46
- package/src/components/Pdf/wrapper.tsx +0 -61
- package/src/components/PhoneNumber/index.tsx +0 -33
- package/src/components/Portal/index.ts +0 -5
- package/src/components/Portal/portal-element.tsx +0 -9
- package/src/components/Portal/portal-namespace.ts +0 -1
- package/src/components/Portal/portal.tsx +0 -36
- package/src/components/Price/index.tsx +0 -12
- package/src/components/PriceTable/index.tsx +0 -34
- package/src/components/PriceTable/wrapper.tsx +0 -27
- package/src/components/ProductCard/index.tsx +0 -133
- package/src/components/ProductCard/wrapper.tsx +0 -147
- package/src/components/ProductPage/index.tsx +0 -99
- package/src/components/ProgressBar/index.tsx +0 -31
- package/src/components/ProgressBar/wrapper.tsx +0 -29
- package/src/components/RangeSlider/RangeSliderSimple.tsx +0 -90
- package/src/components/RangeSlider/SliderWithLabel.tsx +0 -62
- package/src/components/RangeSlider/handle.tsx +0 -26
- package/src/components/RangeSlider/index.tsx +0 -132
- package/src/components/RangeSlider/track.tsx +0 -19
- package/src/components/RangeSlider/wrapper.tsx +0 -93
- package/src/components/RangeSliderLabel/index.tsx +0 -18
- package/src/components/RangeSliderLabel/wrapper.tsx +0 -33
- package/src/components/Repeat/index.tsx +0 -21
- package/src/components/Result/index.tsx +0 -91
- package/src/components/Result/wrapper.tsx +0 -39
- package/src/components/Root/index.tsx +0 -24
- package/src/components/SearchBar/index.tsx +0 -48
- package/src/components/SearchFilter/index.tsx +0 -31
- package/src/components/SearchTerm/index.tsx +0 -23
- package/src/components/SearchTerm/wrapper.tsx +0 -71
- package/src/components/SectionHeader/index.tsx +0 -25
- package/src/components/SectionHeader/wrapper.tsx +0 -17
- package/src/components/Snackbar/index.tsx +0 -35
- package/src/components/Snackbar/wrapper.tsx +0 -65
- package/src/components/SortSelect/index.tsx +0 -35
- package/src/components/SortSelect/wrapper.tsx +0 -54
- package/src/components/Sphere/Sphere.tsx +0 -49
- package/src/components/Sphere/SphereLightbox.tsx +0 -10
- package/src/components/Sphere/SphereViewer.tsx +0 -81
- package/src/components/Sphere/wrapper.tsx +0 -253
- package/src/components/SrOnly/index.tsx +0 -14
- package/src/components/SwitchBar/index.tsx +0 -55
- package/src/components/SwitchBar/wrapper.tsx +0 -80
- package/src/components/TableColumn/index.tsx +0 -18
- package/src/components/TableList/index.tsx +0 -39
- package/src/components/Tabs/index.tsx +0 -34
- package/src/components/Tabs/wrapper.tsx +0 -82
- package/src/components/ThreeSixty/Rotation.tsx +0 -136
- package/src/components/ThreeSixty/ThreeSixtLightbox.tsx +0 -34
- package/src/components/ThreeSixty/ThreeSixty.tsx +0 -53
- package/src/components/UspList/index.tsx +0 -47
- package/src/components/UspList/wrapper.tsx +0 -92
- package/src/components/Utility/index.tsx +0 -17
- package/src/components/Video/CustomPlayer.tsx +0 -28
- package/src/components/Video/EmbeddedVideoLightbox.tsx +0 -31
- package/src/components/Video/EmbededVideo.tsx +0 -72
- package/src/components/Video/QuickNavEmbeded.tsx +0 -35
- package/src/components/Video/QuickNavVideo.tsx +0 -14
- package/src/components/Video/Video.tsx +0 -18
- package/src/components/Video/VimeoPlayer.tsx +0 -21
- package/src/components/Video/YoutubePlayer.tsx +0 -21
- package/src/components/Video/useThumbnail.ts +0 -28
- package/src/components/Video/utils.ts +0 -47
- package/src/components/Video/wrapper.tsx +0 -29
- package/src/hooks/useFetch.ts +0 -88
- package/src/hooks/useHasBeenVisible.ts +0 -17
- package/src/hooks/useHashGuid.ts +0 -33
- package/src/hooks/useInsurance.ts +0 -22
- package/src/hooks/useLoan.ts +0 -21
- package/src/hooks/useOnScreen.ts +0 -20
- package/src/hooks/useOutsideClick.ts +0 -19
- package/src/hooks/usePrevious.ts +0 -11
- package/src/hooks/useSearchItem.ts +0 -11
- package/src/hooks/useSearchItemBranch.ts +0 -14
- package/src/hooks/useSessionStorage.ts +0 -32
- package/src/hooks/useVimeoThumbnail.ts +0 -31
- package/src/images/map/marker.png +0 -0
- package/src/images/placeholders/staticmap.jpg +0 -0
- package/src/index-dev.tsx +0 -42
- package/src/index-esbuild.ts +0 -74
- package/src/index.ts +0 -72
- package/src/layout/helpers.tsx +0 -6
- package/src/layout/keyframes.tsx +0 -23
- package/src/layout/theme.ts +0 -60
- package/src/layouts/WaykeComposite.tsx +0 -64
- package/src/layouts/WaykeCompositeWithProvider.tsx +0 -17
- package/src/layouts/search/index.tsx +0 -124
- package/src/layouts/searchItem/Branch.tsx +0 -97
- package/src/layouts/searchItem/BranchModal.tsx +0 -67
- package/src/layouts/searchItem/CheckList.tsx +0 -146
- package/src/layouts/searchItem/ManufacturerPackagesOption.tsx +0 -54
- package/src/layouts/searchItem/MetadataItem.tsx +0 -74
- package/src/layouts/searchItem/PackageOptionModal.tsx +0 -54
- package/src/layouts/searchItem/PackageOptions.tsx +0 -58
- package/src/layouts/searchItem/Page404.tsx +0 -17
- package/src/layouts/searchItem/PageLoading.tsx +0 -17
- package/src/layouts/searchItem/Property.tsx +0 -134
- package/src/layouts/searchItem/Related.tsx +0 -120
- package/src/layouts/searchItem/index.tsx +0 -342
- package/src/providers/WaykeItemProvidet.tsx +0 -63
- package/src/providers/WaykeProvider.tsx +0 -75
- package/src/providers/graphqlProvider.tsx +0 -9
- package/src/providers/themeProvider.tsx +0 -15
- package/src/queries/INSURANCE_CALCULATION.ts +0 -43
- package/src/queries/LOAN_CALCULATION.ts +0 -39
- package/src/queries/SEARCH_ITEM_BRANCH_QUERY.ts +0 -120
- package/src/queries/SEARCH_ITEM_QUERY.ts +0 -237
- package/src/utils/constants.ts +0 -34
- package/src/utils/converters.ts +0 -45
- package/src/utils/deep-copy.ts +0 -6
- package/src/utils/formats.ts +0 -83
- package/src/utils/metadata.min.ts +0 -87
- package/src/utils/phonenumbers.ts +0 -17
- package/src/utils/pubsub/Actions.ts +0 -20
- package/src/utils/pubsub/Events.ts +0 -79
- package/src/utils/pubsub/pubsub.ts +0 -151
- package/src/utils/regex.ts +0 -13
- package/src/utils/sortOptions.ts +0 -36
- package/src/utils/specification.ts +0 -581
- package/src/utils/ssn.ts +0 -1
- package/src/utils/url.ts +0 -1
- package/src/utils/vehicle-properties/compare-basic-properties.ts +0 -63
- package/src/utils/vehicle-properties/compare-categories.ts +0 -45
- package/src/utils/vehicle-properties/compare-properties.ts +0 -5
- package/src/utils/vehicle-properties/custom-property-adder.ts +0 -163
- package/src/utils/vehicle-properties/property-hint-enricher.ts +0 -230
- package/src/utils/vehicle-properties/property-remover.ts +0 -28
- package/src/utils/vehicle-properties/property-tree-creator.ts +0 -171
- package/src/utils/vehicle-properties/property-tree-sorter.ts +0 -20
- package/tsconfig.build.json +0 -10
- package/tsconfig.eslint.json +0 -11
- package/tsconfig.json +0 -18
- package/webpack.analyze.js +0 -10
- package/webpack.config.js +0 -95
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const Wrapper = styled.div`
|
|
6
|
-
text-align: center;
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
export const Description = styled.div`
|
|
10
|
-
margin-bottom: ${size(1.5)};
|
|
11
|
-
font-size: 0.875rem;
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
export const Bar = styled.div`
|
|
15
|
-
position: relative;
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 2px;
|
|
18
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
export const BarActive = styled.div.attrs(() => ({
|
|
22
|
-
role: 'progressbar',
|
|
23
|
-
}))`
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
height: 100%;
|
|
28
|
-
background-color: ${(props) => props.theme.color.textDark};
|
|
29
|
-
`;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Slider, Rail, Handles, Tracks } from 'react-compound-slider';
|
|
3
|
-
|
|
4
|
-
import { Bar, RangeSpan, RangeSpanItem, Slider as OwnSlider } from './wrapper';
|
|
5
|
-
import { Handle } from './handle';
|
|
6
|
-
import { Track } from './track';
|
|
7
|
-
import { numberSeparator } from '../../utils/formats';
|
|
8
|
-
|
|
9
|
-
interface RangeSliderProps {
|
|
10
|
-
loading: boolean;
|
|
11
|
-
domain: number[];
|
|
12
|
-
values: number[];
|
|
13
|
-
steps: number[];
|
|
14
|
-
unit?: string;
|
|
15
|
-
formatValues?: boolean;
|
|
16
|
-
onChange: (values: readonly number[]) => void;
|
|
17
|
-
onUpdate?: (values: readonly number[]) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const RangeSliderSimple = ({
|
|
21
|
-
loading,
|
|
22
|
-
values,
|
|
23
|
-
domain,
|
|
24
|
-
steps,
|
|
25
|
-
unit,
|
|
26
|
-
formatValues,
|
|
27
|
-
onChange,
|
|
28
|
-
onUpdate,
|
|
29
|
-
}: RangeSliderProps) => {
|
|
30
|
-
const first = steps[0];
|
|
31
|
-
const second = steps[1];
|
|
32
|
-
const step = second - first;
|
|
33
|
-
|
|
34
|
-
const currentMin = formatValues ? numberSeparator(domain[0]) : domain[0];
|
|
35
|
-
const currentMax = formatValues ? numberSeparator(domain[1]) : domain[1];
|
|
36
|
-
|
|
37
|
-
if (steps.length < 2) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
<OwnSlider>
|
|
44
|
-
<Slider
|
|
45
|
-
disabled={loading}
|
|
46
|
-
mode={1}
|
|
47
|
-
step={step}
|
|
48
|
-
domain={domain}
|
|
49
|
-
onChange={onChange}
|
|
50
|
-
onUpdate={onUpdate}
|
|
51
|
-
values={values}
|
|
52
|
-
rootStyle={{ position: 'relative' }}
|
|
53
|
-
>
|
|
54
|
-
<Rail>{({ getRailProps }) => <Bar {...getRailProps()} />}</Rail>
|
|
55
|
-
<Handles>
|
|
56
|
-
{({ handles, getHandleProps }) => (
|
|
57
|
-
<div className="slider-handles">
|
|
58
|
-
{handles.map((handle) => (
|
|
59
|
-
<Handle
|
|
60
|
-
key={handle.id}
|
|
61
|
-
handle={handle}
|
|
62
|
-
domain={domain}
|
|
63
|
-
getHandleProps={getHandleProps}
|
|
64
|
-
/>
|
|
65
|
-
))}
|
|
66
|
-
</div>
|
|
67
|
-
)}
|
|
68
|
-
</Handles>
|
|
69
|
-
<Tracks right={false}>
|
|
70
|
-
{({ tracks, getTrackProps }) => (
|
|
71
|
-
<div className="slider-tracks">
|
|
72
|
-
{tracks.map(({ id, source, target }) => (
|
|
73
|
-
<Track key={id} source={source} target={target} getTrackProps={getTrackProps} />
|
|
74
|
-
))}
|
|
75
|
-
</div>
|
|
76
|
-
)}
|
|
77
|
-
</Tracks>
|
|
78
|
-
</Slider>
|
|
79
|
-
</OwnSlider>
|
|
80
|
-
{false && (
|
|
81
|
-
<RangeSpan>
|
|
82
|
-
<RangeSpanItem>{`${currentMin}${unit ? ` ${unit}` : ''}`}</RangeSpanItem>
|
|
83
|
-
<RangeSpanItem>{`${currentMax}${unit ? ` ${unit}` : ''}`}</RangeSpanItem>
|
|
84
|
-
</RangeSpan>
|
|
85
|
-
)}
|
|
86
|
-
</>
|
|
87
|
-
);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export default RangeSliderSimple;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { numberSeparator } from '../../utils/formats';
|
|
3
|
-
import RangeSliderLabel from '../RangeSliderLabel/index';
|
|
4
|
-
import { RepeatTiny } from '../Repeat/index';
|
|
5
|
-
import RangeSliderSimple from './RangeSliderSimple';
|
|
6
|
-
|
|
7
|
-
interface SliderWithLabelProps {
|
|
8
|
-
label: string;
|
|
9
|
-
values: number[];
|
|
10
|
-
domain: number[];
|
|
11
|
-
steps: number[];
|
|
12
|
-
loading: boolean;
|
|
13
|
-
unit: string;
|
|
14
|
-
formatValues?: boolean;
|
|
15
|
-
onChange: (values: readonly number[]) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const SliderWithLabel = ({
|
|
19
|
-
label,
|
|
20
|
-
values,
|
|
21
|
-
domain,
|
|
22
|
-
steps,
|
|
23
|
-
loading,
|
|
24
|
-
unit,
|
|
25
|
-
formatValues,
|
|
26
|
-
onChange,
|
|
27
|
-
}: SliderWithLabelProps) => {
|
|
28
|
-
const [local, setLocal] = useState<number[] | undefined>(steps);
|
|
29
|
-
|
|
30
|
-
const onUpdate = useCallback((nextValues: readonly number[]) => {
|
|
31
|
-
setLocal([...nextValues]);
|
|
32
|
-
}, []);
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!loading) setLocal(undefined);
|
|
36
|
-
}, [loading]);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<>
|
|
40
|
-
<RepeatTiny>
|
|
41
|
-
<RangeSliderLabel
|
|
42
|
-
label={label}
|
|
43
|
-
value={`${numberSeparator(local?.[0] || values[0])}${unit ? ` ${unit}` : ''}`}
|
|
44
|
-
/>
|
|
45
|
-
</RepeatTiny>
|
|
46
|
-
<RepeatTiny>
|
|
47
|
-
<RangeSliderSimple
|
|
48
|
-
loading={loading}
|
|
49
|
-
values={values}
|
|
50
|
-
domain={domain}
|
|
51
|
-
steps={steps}
|
|
52
|
-
onChange={onChange}
|
|
53
|
-
onUpdate={onUpdate}
|
|
54
|
-
unit={unit}
|
|
55
|
-
formatValues={formatValues}
|
|
56
|
-
/>
|
|
57
|
-
</RepeatTiny>
|
|
58
|
-
</>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default SliderWithLabel;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Handle as OwnHandle } from './wrapper';
|
|
3
|
-
import { SliderItem, GetHandleProps } from 'react-compound-slider';
|
|
4
|
-
|
|
5
|
-
interface IHandleProps {
|
|
6
|
-
domain: number[];
|
|
7
|
-
handle: SliderItem;
|
|
8
|
-
getHandleProps: GetHandleProps;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Handle = ({
|
|
12
|
-
domain: [min, max],
|
|
13
|
-
handle: { id, value, percent },
|
|
14
|
-
getHandleProps,
|
|
15
|
-
}: IHandleProps) => (
|
|
16
|
-
<OwnHandle
|
|
17
|
-
role="slider"
|
|
18
|
-
aria-valuemin={min}
|
|
19
|
-
aria-valuemax={max}
|
|
20
|
-
aria-valuenow={value}
|
|
21
|
-
style={{
|
|
22
|
-
left: `${percent}%`,
|
|
23
|
-
}}
|
|
24
|
-
{...getHandleProps(id)}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import { Slider, Rail, Handles, Tracks } from 'react-compound-slider';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Bar,
|
|
6
|
-
RangeSpan,
|
|
7
|
-
RangeSpanItem,
|
|
8
|
-
Slider as OwnSlider,
|
|
9
|
-
Track as OwnTrack,
|
|
10
|
-
Handle as OwnHandle,
|
|
11
|
-
} from './wrapper';
|
|
12
|
-
import { Handle } from './handle';
|
|
13
|
-
import { Track } from './track';
|
|
14
|
-
import { numberSeparator } from '../../utils/formats';
|
|
15
|
-
|
|
16
|
-
const getSteps = (steps: number[]) => {
|
|
17
|
-
let current = Number.MAX_SAFE_INTEGER;
|
|
18
|
-
steps.forEach((step, index) => {
|
|
19
|
-
if (index !== 0) {
|
|
20
|
-
const c = step - steps[index - 1];
|
|
21
|
-
if (c < current) {
|
|
22
|
-
current = c;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return current;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
interface RangeSliderProps {
|
|
30
|
-
loading: boolean;
|
|
31
|
-
domain: number[];
|
|
32
|
-
values: number[];
|
|
33
|
-
steps: number[];
|
|
34
|
-
unit?: string;
|
|
35
|
-
formatValues?: boolean;
|
|
36
|
-
maxPrefix?: string;
|
|
37
|
-
onChange: (values: readonly number[]) => void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const RangeSlider = ({
|
|
41
|
-
loading,
|
|
42
|
-
values,
|
|
43
|
-
domain,
|
|
44
|
-
steps,
|
|
45
|
-
unit,
|
|
46
|
-
formatValues,
|
|
47
|
-
maxPrefix,
|
|
48
|
-
onChange,
|
|
49
|
-
}: RangeSliderProps) => {
|
|
50
|
-
const [current, setCurrent] = useState<number[]>(values);
|
|
51
|
-
const onUpdate = useCallback(
|
|
52
|
-
(nextValues: readonly number[]) => {
|
|
53
|
-
if (!isNaN(nextValues[0]) && !isNaN(nextValues[1])) {
|
|
54
|
-
setCurrent(nextValues.slice());
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[values]
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const step = getSteps(steps);
|
|
61
|
-
|
|
62
|
-
const currentMin = formatValues ? numberSeparator(current[0]) : current[0];
|
|
63
|
-
const currentMax = formatValues ? numberSeparator(current[1]) : current[1];
|
|
64
|
-
const equal = domain[0] === domain[1];
|
|
65
|
-
const _maxPrefix = maxPrefix && domain[1] === current[1] ? maxPrefix : undefined;
|
|
66
|
-
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
if (values[0] !== current[0] || values[1] !== current[1]) {
|
|
69
|
-
setCurrent(values);
|
|
70
|
-
}
|
|
71
|
-
}, [values]);
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<>
|
|
75
|
-
{equal ? (
|
|
76
|
-
<OwnSlider>
|
|
77
|
-
<Bar>
|
|
78
|
-
<OwnTrack style={{ left: '0', width: '100%' }} />
|
|
79
|
-
<OwnHandle role="slider" aria-disabled style={{ left: '0' }} />
|
|
80
|
-
<OwnHandle role="slider" aria-disabled style={{ left: '100%' }} />
|
|
81
|
-
</Bar>
|
|
82
|
-
</OwnSlider>
|
|
83
|
-
) : (
|
|
84
|
-
<OwnSlider>
|
|
85
|
-
<Slider
|
|
86
|
-
disabled={loading}
|
|
87
|
-
mode={1}
|
|
88
|
-
step={step}
|
|
89
|
-
domain={domain}
|
|
90
|
-
onChange={onChange}
|
|
91
|
-
onUpdate={onUpdate}
|
|
92
|
-
values={values}
|
|
93
|
-
rootStyle={{ position: 'relative' }}
|
|
94
|
-
>
|
|
95
|
-
<Rail>{({ getRailProps }) => <Bar {...getRailProps()} />}</Rail>
|
|
96
|
-
<Handles>
|
|
97
|
-
{({ handles, getHandleProps }) => (
|
|
98
|
-
<div className="slider-handles">
|
|
99
|
-
{handles.map((handle) => (
|
|
100
|
-
<Handle
|
|
101
|
-
key={handle.id}
|
|
102
|
-
handle={handle}
|
|
103
|
-
domain={domain}
|
|
104
|
-
getHandleProps={getHandleProps}
|
|
105
|
-
/>
|
|
106
|
-
))}
|
|
107
|
-
</div>
|
|
108
|
-
)}
|
|
109
|
-
</Handles>
|
|
110
|
-
<Tracks left={false} right={false}>
|
|
111
|
-
{({ tracks, getTrackProps }) => (
|
|
112
|
-
<div className="slider-tracks">
|
|
113
|
-
{tracks.map(({ id, source, target }) => (
|
|
114
|
-
<Track key={id} source={source} target={target} getTrackProps={getTrackProps} />
|
|
115
|
-
))}
|
|
116
|
-
</div>
|
|
117
|
-
)}
|
|
118
|
-
</Tracks>
|
|
119
|
-
</Slider>
|
|
120
|
-
</OwnSlider>
|
|
121
|
-
)}
|
|
122
|
-
<RangeSpan>
|
|
123
|
-
<RangeSpanItem>{`${currentMin}${unit ? ` ${unit}` : ''}`}</RangeSpanItem>
|
|
124
|
-
<RangeSpanItem>{`${currentMax}${_maxPrefix ? _maxPrefix : ''}${
|
|
125
|
-
unit ? ` ${unit}` : ''
|
|
126
|
-
}`}</RangeSpanItem>
|
|
127
|
-
</RangeSpan>
|
|
128
|
-
</>
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export default RangeSlider;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Track as OwnTrack } from './wrapper';
|
|
3
|
-
import { SliderItem, GetTrackProps } from 'react-compound-slider';
|
|
4
|
-
|
|
5
|
-
interface ITrackProps {
|
|
6
|
-
source: SliderItem;
|
|
7
|
-
target: SliderItem;
|
|
8
|
-
getTrackProps: GetTrackProps;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Track = ({ source, target, getTrackProps }: ITrackProps) => (
|
|
12
|
-
<OwnTrack
|
|
13
|
-
style={{
|
|
14
|
-
left: `${source.percent}%`,
|
|
15
|
-
width: `${target.percent - source.percent}%`,
|
|
16
|
-
}}
|
|
17
|
-
{...getTrackProps()}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const RangeSpan = styled.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
margin-top: ${size(1)};
|
|
9
|
-
user-select: none;
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
export const RangeSpanItem = styled.div`
|
|
13
|
-
font-size: 0.875rem;
|
|
14
|
-
color: ${(props) => props.theme.color.textDarkLighten};
|
|
15
|
-
|
|
16
|
-
:first-child {
|
|
17
|
-
flex: 1 1 auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
:last-child {
|
|
21
|
-
flex-shrink: 0;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
export const Slider = styled.div`
|
|
26
|
-
padding: 10px 12px;
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export const Bar = styled.div`
|
|
30
|
-
position: relative;
|
|
31
|
-
height: 4px;
|
|
32
|
-
|
|
33
|
-
:before {
|
|
34
|
-
content: '';
|
|
35
|
-
position: absolute;
|
|
36
|
-
top: 0;
|
|
37
|
-
bottom: 0;
|
|
38
|
-
left: -12px;
|
|
39
|
-
right: -12px;
|
|
40
|
-
background-color: ${(props) => props.theme.color.accentDark};
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
|
|
44
|
-
export const Track = styled.div.attrs(() => ({
|
|
45
|
-
className: 'wayke__theme wayke__color--primary-bg',
|
|
46
|
-
}))`
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 0;
|
|
49
|
-
height: 4px;
|
|
50
|
-
margin-left: -12px;
|
|
51
|
-
margin-right: -12px;
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export const Handle = styled.div.attrs(() => ({
|
|
55
|
-
role: 'slider',
|
|
56
|
-
className: 'wayke__theme wayke__color--primary-bg',
|
|
57
|
-
}))`
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 50%;
|
|
60
|
-
transform-origin: 50% 50%;
|
|
61
|
-
display: block;
|
|
62
|
-
width: 24px;
|
|
63
|
-
height: 24px;
|
|
64
|
-
margin-top: -12px;
|
|
65
|
-
margin-left: -12px;
|
|
66
|
-
border-radius: 50%;
|
|
67
|
-
cursor: move;
|
|
68
|
-
cursor: ew-resize;
|
|
69
|
-
cursor: -webkit-grab;
|
|
70
|
-
cursor: grab;
|
|
71
|
-
transition: transform 150ms ease;
|
|
72
|
-
|
|
73
|
-
:before {
|
|
74
|
-
content: '';
|
|
75
|
-
position: absolute;
|
|
76
|
-
top: 0;
|
|
77
|
-
bottom: 0;
|
|
78
|
-
left: 0;
|
|
79
|
-
right: 0;
|
|
80
|
-
border-radius: 50%;
|
|
81
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
82
|
-
opacity: 0;
|
|
83
|
-
transition: opacity 150ms ease;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
:active {
|
|
87
|
-
transform: scale(1.3);
|
|
88
|
-
|
|
89
|
-
:before {
|
|
90
|
-
opacity: 1;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Wrapper, Label, Value } from './wrapper';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
label: string;
|
|
7
|
-
value?: React.ReactNode;
|
|
8
|
-
highlight?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const RangeSliderLabel = ({ label, value, highlight }: Props) => (
|
|
12
|
-
<Wrapper>
|
|
13
|
-
<Label>{label}</Label>
|
|
14
|
-
{value && <Value isHighlighted={highlight}>{value}</Value>}
|
|
15
|
-
</Wrapper>
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export default RangeSliderLabel;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import styled, { css } from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const Wrapper = styled.div`
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: flex-end;
|
|
8
|
-
`;
|
|
9
|
-
|
|
10
|
-
export const Label = styled.div.attrs(() => ({
|
|
11
|
-
className: 'wayke__theme wayke__font--bold',
|
|
12
|
-
}))`
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
type ValueProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
17
|
-
isHighlighted?: boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const Value = styled.div.attrs(() => ({
|
|
21
|
-
className: 'wayke__theme wayke__font--bold wayke__color--primary-text',
|
|
22
|
-
}))<ValueProps>`
|
|
23
|
-
flex-shrink: 0;
|
|
24
|
-
padding-left: ${size(2)};
|
|
25
|
-
font-size: 1.125rem;
|
|
26
|
-
|
|
27
|
-
${({ isHighlighted }) =>
|
|
28
|
-
isHighlighted &&
|
|
29
|
-
css`
|
|
30
|
-
font-size: 1.375rem;
|
|
31
|
-
color: ${(props) => props.theme.color.textDark} !important;
|
|
32
|
-
`}
|
|
33
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const Repeat = styled.div`
|
|
6
|
-
& + & {
|
|
7
|
-
margin-top: ${size(3)};
|
|
8
|
-
}
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export const RepeatTiny = styled.div`
|
|
12
|
-
& + & {
|
|
13
|
-
margin-top: ${size(1)};
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
export const RepeatSmall = styled.div`
|
|
18
|
-
& + & {
|
|
19
|
-
margin-top: ${size(2)};
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Wrapper,
|
|
5
|
-
Header,
|
|
6
|
-
HeaderCount,
|
|
7
|
-
HeaderSort,
|
|
8
|
-
Body,
|
|
9
|
-
Footer,
|
|
10
|
-
FooterProgress,
|
|
11
|
-
FooterAction,
|
|
12
|
-
ResultCount,
|
|
13
|
-
} from './wrapper';
|
|
14
|
-
import ProgressBar from '../ProgressBar/index';
|
|
15
|
-
import { ButtonSecondary, ButtonContent } from '../Button/index';
|
|
16
|
-
import Loader from '../Loader/index';
|
|
17
|
-
import { numberSeparator } from '../../utils/formats';
|
|
18
|
-
import useSearch from '../../State/Search/useSearch';
|
|
19
|
-
import SortSelect, { OptionProps } from '../SortSelect/index';
|
|
20
|
-
import { getTranslatedSortOptionDisplayName } from '../../utils/sortOptions';
|
|
21
|
-
|
|
22
|
-
interface Props {
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const Result = ({ children }: Props) => {
|
|
27
|
-
const { loading, response, documents, queryFilter, onLoadMore, onFilterUpdate } = useSearch();
|
|
28
|
-
|
|
29
|
-
const onSortOptionChange = useCallback(
|
|
30
|
-
(e: React.ChangeEvent<HTMLSelectElement>) => onFilterUpdate(e.currentTarget.value),
|
|
31
|
-
[]
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const numberOfDocuments = documents?.length || 0;
|
|
35
|
-
const numberOfHits = response?.documentList.numberOfHits || 0;
|
|
36
|
-
const useSkeletons = !!queryFilter?.concatResult;
|
|
37
|
-
|
|
38
|
-
const selectedSortOption = response?.documentList.sortOptions.find((x) => x.selected)?.query;
|
|
39
|
-
const sortOptions = response?.documentList.sortOptions
|
|
40
|
-
.filter((x) => x.displayName !== 'relevance')
|
|
41
|
-
.map(
|
|
42
|
-
(so): OptionProps => ({
|
|
43
|
-
value: so.query,
|
|
44
|
-
displayName: getTranslatedSortOptionDisplayName(so.displayName),
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
if (loading && !useSkeletons) {
|
|
49
|
-
return <Loader />;
|
|
50
|
-
}
|
|
51
|
-
return (
|
|
52
|
-
<Wrapper>
|
|
53
|
-
<Header>
|
|
54
|
-
<HeaderCount>
|
|
55
|
-
<ResultCount>{`${numberSeparator(numberOfHits)} ${
|
|
56
|
-
numberOfHits === 1 ? 'bil' : 'bilar'
|
|
57
|
-
}`}</ResultCount>
|
|
58
|
-
</HeaderCount>
|
|
59
|
-
{sortOptions && selectedSortOption && (
|
|
60
|
-
<HeaderSort>
|
|
61
|
-
<SortSelect
|
|
62
|
-
value={selectedSortOption}
|
|
63
|
-
options={sortOptions}
|
|
64
|
-
onChange={onSortOptionChange}
|
|
65
|
-
/>
|
|
66
|
-
</HeaderSort>
|
|
67
|
-
)}
|
|
68
|
-
</Header>
|
|
69
|
-
<Body>{children}</Body>
|
|
70
|
-
<Footer>
|
|
71
|
-
<FooterProgress>
|
|
72
|
-
<ProgressBar unit="bilar" valueCurrent={numberOfDocuments} valueMax={numberOfHits} />
|
|
73
|
-
</FooterProgress>
|
|
74
|
-
{numberOfDocuments !== numberOfHits && (
|
|
75
|
-
<FooterAction>
|
|
76
|
-
<ButtonSecondary
|
|
77
|
-
disabled={loading}
|
|
78
|
-
onClick={onLoadMore}
|
|
79
|
-
title="Visa fler"
|
|
80
|
-
aria-label="Visa fler"
|
|
81
|
-
>
|
|
82
|
-
<ButtonContent>Visa fler</ButtonContent>
|
|
83
|
-
</ButtonSecondary>
|
|
84
|
-
</FooterAction>
|
|
85
|
-
)}
|
|
86
|
-
</Footer>
|
|
87
|
-
</Wrapper>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export default Result;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { size } from '../../layout/helpers';
|
|
4
|
-
|
|
5
|
-
export const Wrapper = styled.div``;
|
|
6
|
-
|
|
7
|
-
export const Header = styled.header`
|
|
8
|
-
display: flex;
|
|
9
|
-
margin-bottom: ${size(4)};
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
export const HeaderCount = styled.div`
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
export const HeaderSort = styled.div`
|
|
17
|
-
flex-shrink: 0;
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
export const Body = styled.div``;
|
|
21
|
-
|
|
22
|
-
export const Footer = styled.footer`
|
|
23
|
-
margin-top: ${size(8)};
|
|
24
|
-
text-align: center;
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
export const FooterProgress = styled.div`
|
|
28
|
-
max-width: 175px;
|
|
29
|
-
margin: 0 auto;
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
export const FooterAction = styled.div`
|
|
33
|
-
margin-top: ${size(3)};
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
export const ResultCount = styled.div`
|
|
37
|
-
color: ${(props) => props.theme.color.textDarkLighten};
|
|
38
|
-
font-size: 0.875rem;
|
|
39
|
-
`;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const Root = styled.div.attrs(() => ({
|
|
4
|
-
className: 'wayke__theme wayke__font--regular',
|
|
5
|
-
}))`
|
|
6
|
-
background-color: ${(props) => props.theme.color.bg};
|
|
7
|
-
color: ${(props) => props.theme.color.textDark};
|
|
8
|
-
font-size: 1rem;
|
|
9
|
-
line-height: 1.5;
|
|
10
|
-
-webkit-font-smoothing: antialiased;
|
|
11
|
-
-moz-osx-font-smoothing: grayscale;
|
|
12
|
-
|
|
13
|
-
*,
|
|
14
|
-
*:before,
|
|
15
|
-
*:after {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a img {
|
|
20
|
-
border: 0;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
export default Root;
|