@blaze-cms/react-page-builder 0.113.0-alpha.7 → 0.114.0-alpha.0
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/CHANGELOG.md +41 -0
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js +57 -24
- package/lib/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib/components/SearchFilter/SearchFilterContainer.js +19 -12
- package/lib/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib/components/SearchFilter/constants.js +13 -1
- package/lib/components/SearchFilter/constants.js.map +1 -1
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js +29 -0
- package/lib/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -0
- package/lib/components/SearchFilter/helpers/index.js +8 -0
- package/lib/components/SearchFilter/helpers/index.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js +51 -25
- package/lib-es/components/SearchFilter/SearchFilter/SearchFilter.js.map +1 -1
- package/lib-es/components/SearchFilter/SearchFilterContainer.js +12 -9
- package/lib-es/components/SearchFilter/SearchFilterContainer.js.map +1 -1
- package/lib-es/components/SearchFilter/constants.js +12 -1
- package/lib-es/components/SearchFilter/constants.js.map +1 -1
- package/lib-es/components/SearchFilter/helpers/get-responsive-filter-classnames.js +20 -0
- package/lib-es/components/SearchFilter/helpers/get-responsive-filter-classnames.js.map +1 -0
- package/lib-es/components/SearchFilter/helpers/index.js +2 -1
- package/lib-es/components/SearchFilter/helpers/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/SearchFilter/SearchFilter/SearchFilter.js +75 -29
- package/src/components/SearchFilter/SearchFilterContainer.js +15 -8
- package/src/components/SearchFilter/constants.js +14 -1
- package/src/components/SearchFilter/helpers/get-responsive-filter-classnames.js +22 -0
- package/src/components/SearchFilter/helpers/index.js +2 -0
- package/tests/unit/src/components/SearchFilter/SearchFilter/SearchFilter.test.js +29 -3
- package/tests/unit/src/components/SearchFilter/SearchFilter/__snapshots__/SearchFilter.test.js.snap +304 -6
- package/tests/unit/src/components/SearchFilter/__snapshots__/SearchFilterContainer.test.js.snap +7 -1
|
@@ -3,11 +3,16 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import debounce from 'lodash.debounce';
|
|
5
5
|
import FiltersList from './FiltersList';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isDeviceDesktop,
|
|
8
|
+
buildQuery,
|
|
9
|
+
getInitialFilterValues,
|
|
10
|
+
getResponsiveFilterClassnames
|
|
11
|
+
} from '../helpers';
|
|
7
12
|
import CloseMobileForm from './CloseMobileForm';
|
|
8
13
|
import ResetDesktopForm from './ResetDesktopForm';
|
|
9
14
|
import MobileFormToolbar from './MobileFormToolbar';
|
|
10
|
-
import { SEARCH, REFINE } from '../constants';
|
|
15
|
+
import { SEARCH, REFINE, MORE_FILTERS_CLASSES } from '../constants';
|
|
11
16
|
|
|
12
17
|
const reducer = (state, action) => {
|
|
13
18
|
const { newValues, type, shouldSearch = true } = action;
|
|
@@ -36,13 +41,20 @@ const SearchFilter = ({
|
|
|
36
41
|
displaySearchFilter,
|
|
37
42
|
setDisplaySearchFilter,
|
|
38
43
|
initialFilterValues,
|
|
39
|
-
|
|
44
|
+
groupAfterDesktop,
|
|
45
|
+
groupAfterMobile
|
|
40
46
|
}) => {
|
|
41
47
|
const [isDesktop, setIsDesktop] = useState(true);
|
|
42
48
|
const [pageWidth, setPageWidth] = useState(null);
|
|
43
|
-
const [
|
|
49
|
+
const [moreFiltersMobileCollapsed, setMoreFiltersMobileCollapsed] = useState(true);
|
|
50
|
+
const [moreFiltersDesktopCollapsed, setMoreFiltersDesktopCollapsed] = useState(true);
|
|
44
51
|
const [filterValues, dispatch] = useReducer(reducer, initialFilterValues);
|
|
45
52
|
|
|
53
|
+
const handleSubmit = debounce(newValues => {
|
|
54
|
+
const newQuery = buildQuery(newValues, filters);
|
|
55
|
+
handleSearch(newQuery);
|
|
56
|
+
}, 200);
|
|
57
|
+
|
|
46
58
|
useEffect(
|
|
47
59
|
() => {
|
|
48
60
|
if (window && !pageWidth) {
|
|
@@ -86,13 +98,12 @@ const SearchFilter = ({
|
|
|
86
98
|
'filter__form filter__form--mobile': isMobileFormDisplayed
|
|
87
99
|
});
|
|
88
100
|
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
101
|
+
const {
|
|
102
|
+
moreFiltersMobileWrapperClass,
|
|
103
|
+
moreFiltersMobileTogglerClass,
|
|
104
|
+
moreFiltersDesktopWrapperClass,
|
|
105
|
+
moreFiltersDesktopTogglerClass
|
|
106
|
+
} = getResponsiveFilterClassnames(moreFiltersDesktopCollapsed, moreFiltersMobileCollapsed);
|
|
96
107
|
|
|
97
108
|
const formId = `filter-${name}-form`;
|
|
98
109
|
|
|
@@ -106,10 +117,7 @@ const SearchFilter = ({
|
|
|
106
117
|
dispatch({ newValues, shouldSearch, type: 'update' });
|
|
107
118
|
};
|
|
108
119
|
|
|
109
|
-
const
|
|
110
|
-
const newQuery = buildQuery(newValues, filters);
|
|
111
|
-
handleSearch(newQuery);
|
|
112
|
-
}, 200);
|
|
120
|
+
const shouldGroup = !!(groupAfterDesktop || groupAfterMobile);
|
|
113
121
|
|
|
114
122
|
return (
|
|
115
123
|
<>
|
|
@@ -132,7 +140,7 @@ const SearchFilter = ({
|
|
|
132
140
|
{isDesktopFormDisplayed && <ResetDesktopForm handleReset={handleReset} />}
|
|
133
141
|
|
|
134
142
|
<div className="filter__wrapper filter__wrapper--search-refine">
|
|
135
|
-
{!
|
|
143
|
+
{!shouldGroup && (
|
|
136
144
|
<FiltersList
|
|
137
145
|
data={data}
|
|
138
146
|
filters={filters}
|
|
@@ -143,37 +151,74 @@ const SearchFilter = ({
|
|
|
143
151
|
/>
|
|
144
152
|
)}
|
|
145
153
|
|
|
146
|
-
{
|
|
154
|
+
{shouldGroup && (
|
|
147
155
|
<>
|
|
148
156
|
<FiltersList
|
|
149
157
|
data={data}
|
|
150
|
-
filters={filters.slice(0,
|
|
158
|
+
filters={filters.slice(0, groupAfterMobile)}
|
|
151
159
|
hasUrl={hasUrl}
|
|
152
160
|
entity={entity}
|
|
153
161
|
filterValues={filterValues}
|
|
154
162
|
updateFilterValues={updateFilterValues}
|
|
155
163
|
/>
|
|
156
164
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
{!!groupAfterMobile && (
|
|
166
|
+
<button
|
|
167
|
+
className={moreFiltersMobileTogglerClass}
|
|
168
|
+
type="button"
|
|
169
|
+
onClick={() => setMoreFiltersMobileCollapsed(!moreFiltersMobileCollapsed)}>
|
|
170
|
+
Filters
|
|
171
|
+
</button>
|
|
172
|
+
)}
|
|
163
173
|
|
|
164
|
-
<div className={
|
|
165
|
-
<div className=
|
|
174
|
+
<div className={moreFiltersMobileWrapperClass}>
|
|
175
|
+
<div className={MORE_FILTERS_CLASSES.MOBILE_CONTENT}>
|
|
166
176
|
<FiltersList
|
|
167
177
|
data={data}
|
|
168
|
-
filters={filters.slice(
|
|
178
|
+
filters={filters.slice(
|
|
179
|
+
groupAfterMobile,
|
|
180
|
+
groupAfterDesktop ? groupAfterDesktop - 1 : 0
|
|
181
|
+
)}
|
|
169
182
|
hasUrl={hasUrl}
|
|
170
183
|
entity={entity}
|
|
171
184
|
filterValues={filterValues}
|
|
172
185
|
updateFilterValues={updateFilterValues}
|
|
173
186
|
/>
|
|
187
|
+
|
|
188
|
+
{!!groupAfterDesktop && (
|
|
189
|
+
<button
|
|
190
|
+
className={moreFiltersDesktopTogglerClass}
|
|
191
|
+
type="button"
|
|
192
|
+
onClick={() =>
|
|
193
|
+
setMoreFiltersDesktopCollapsed(!moreFiltersDesktopCollapsed)
|
|
194
|
+
}>
|
|
195
|
+
More filters
|
|
196
|
+
</button>
|
|
197
|
+
)}
|
|
198
|
+
|
|
199
|
+
<div className={moreFiltersDesktopWrapperClass}>
|
|
200
|
+
<div className={MORE_FILTERS_CLASSES.DESKTOP_CONTENT}>
|
|
201
|
+
<FiltersList
|
|
202
|
+
data={data}
|
|
203
|
+
filters={filters.slice(groupAfterDesktop)}
|
|
204
|
+
hasUrl={hasUrl}
|
|
205
|
+
entity={entity}
|
|
206
|
+
filterValues={filterValues}
|
|
207
|
+
updateFilterValues={updateFilterValues}
|
|
208
|
+
/>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div className={MORE_FILTERS_CLASSES.DESKTOP_BUTTONS}>
|
|
212
|
+
<ResetDesktopForm handleReset={handleReset} />
|
|
213
|
+
|
|
214
|
+
<button className="button button--full-width" type="submit">
|
|
215
|
+
{SEARCH}
|
|
216
|
+
</button>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
174
219
|
</div>
|
|
175
220
|
|
|
176
|
-
<div className=
|
|
221
|
+
<div className={MORE_FILTERS_CLASSES.MOBILE_BUTTONS}>
|
|
177
222
|
<ResetDesktopForm handleReset={handleReset} />
|
|
178
223
|
|
|
179
224
|
<button className="button button--full-width" type="submit">
|
|
@@ -224,7 +269,8 @@ SearchFilter.propTypes = {
|
|
|
224
269
|
displaySearchFilter: PropTypes.bool.isRequired,
|
|
225
270
|
setDisplaySearchFilter: PropTypes.func.isRequired,
|
|
226
271
|
isCollapsedOnResponsive: PropTypes.bool.isRequired,
|
|
227
|
-
|
|
272
|
+
groupAfterDesktop: PropTypes.number.isRequired,
|
|
273
|
+
groupAfterMobile: PropTypes.number.isRequired,
|
|
228
274
|
initialFilterValues: PropTypes.object.isRequired
|
|
229
275
|
};
|
|
230
276
|
|
|
@@ -23,7 +23,8 @@ const SearchFilterContainer = ({
|
|
|
23
23
|
filters,
|
|
24
24
|
name,
|
|
25
25
|
isCollapsedOnResponsive,
|
|
26
|
-
|
|
26
|
+
groupAfterMobile,
|
|
27
|
+
groupAfterDesktop
|
|
27
28
|
}) => {
|
|
28
29
|
const router = useRouter();
|
|
29
30
|
const searchFilterRef = useRef(null);
|
|
@@ -61,11 +62,14 @@ const SearchFilterContainer = ({
|
|
|
61
62
|
variables: { rawQueryStringified, limit: 0 }, // we only want aggs so limit=0 for no search results
|
|
62
63
|
skip: !rawQueryStringified
|
|
63
64
|
});
|
|
64
|
-
|
|
65
|
+
|
|
66
|
+
if (loading) return null;
|
|
65
67
|
if (error) return error.message;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
if (!filters.length) return null;
|
|
69
|
+
|
|
70
|
+
const { searchPublishedContent: { rawResults: { aggregations: filterData = {} } = {} } = {} } =
|
|
71
|
+
data || {};
|
|
72
|
+
|
|
69
73
|
const initialFilterValues = getInitialFilterValues(filterData, filters, query);
|
|
70
74
|
|
|
71
75
|
const handleSearch = newQuery => {
|
|
@@ -110,7 +114,8 @@ const SearchFilterContainer = ({
|
|
|
110
114
|
isCollapsedOnResponsive={isCollapsedOnResponsive}
|
|
111
115
|
displaySearchFilter={displaySearchFilter}
|
|
112
116
|
setDisplaySearchFilter={setDisplaySearchFilter}
|
|
113
|
-
|
|
117
|
+
groupAfterMobile={groupAfterMobile}
|
|
118
|
+
groupAfterDesktop={groupAfterDesktop}
|
|
114
119
|
/>
|
|
115
120
|
);
|
|
116
121
|
};
|
|
@@ -121,7 +126,8 @@ SearchFilterContainer.propTypes = {
|
|
|
121
126
|
filters: PropTypes.array,
|
|
122
127
|
name: PropTypes.string.isRequired,
|
|
123
128
|
isCollapsedOnResponsive: PropTypes.bool,
|
|
124
|
-
|
|
129
|
+
groupAfterMobile: PropTypes.number,
|
|
130
|
+
groupAfterDesktop: PropTypes.number
|
|
125
131
|
};
|
|
126
132
|
|
|
127
133
|
SearchFilterContainer.defaultProps = {
|
|
@@ -129,7 +135,8 @@ SearchFilterContainer.defaultProps = {
|
|
|
129
135
|
filters: [],
|
|
130
136
|
entity: '',
|
|
131
137
|
isCollapsedOnResponsive: true,
|
|
132
|
-
|
|
138
|
+
groupAfterMobile: 0,
|
|
139
|
+
groupAfterDesktop: 0
|
|
133
140
|
};
|
|
134
141
|
|
|
135
142
|
export default withTitle(SearchFilterContainer);
|
|
@@ -24,6 +24,18 @@ const SEARCH = 'Search';
|
|
|
24
24
|
const REFINE = `Refine Search`;
|
|
25
25
|
const MOBILE_REFINEMENT_TITLE = 'Search refinement';
|
|
26
26
|
|
|
27
|
+
const MORE_FILTERS_CLASSES_BASE = 'filter__more-filters';
|
|
28
|
+
const MORE_FILTERS_CLASSES = {
|
|
29
|
+
MOBILE_WRAPPER: `${MORE_FILTERS_CLASSES_BASE}-mobile-wrapper`,
|
|
30
|
+
MOBILE_CONTENT: `${MORE_FILTERS_CLASSES_BASE}-mobile-content`,
|
|
31
|
+
MOBILE_TOGGLER: `${MORE_FILTERS_CLASSES_BASE}-mobile-toggler`,
|
|
32
|
+
MOBILE_BUTTONS: `${MORE_FILTERS_CLASSES_BASE}-mobile-buttons`,
|
|
33
|
+
DESKTOP_WRAPPER: `${MORE_FILTERS_CLASSES_BASE}-desktop-wrapper`,
|
|
34
|
+
DESKTOP_CONTENT: `${MORE_FILTERS_CLASSES_BASE}-desktop-content`,
|
|
35
|
+
DESKTOP_TOGGLER: `${MORE_FILTERS_CLASSES_BASE}-desktop-toggler`,
|
|
36
|
+
DESKTOP_BUTTONS: `${MORE_FILTERS_CLASSES_BASE}-desktop-buttons`
|
|
37
|
+
};
|
|
38
|
+
|
|
27
39
|
export {
|
|
28
40
|
CHECKBOX,
|
|
29
41
|
SELECT,
|
|
@@ -49,5 +61,6 @@ export {
|
|
|
49
61
|
RESET,
|
|
50
62
|
SEARCH,
|
|
51
63
|
REFINE,
|
|
52
|
-
MOBILE_REFINEMENT_TITLE
|
|
64
|
+
MOBILE_REFINEMENT_TITLE,
|
|
65
|
+
MORE_FILTERS_CLASSES
|
|
53
66
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import classnames from 'classnames';
|
|
2
|
+
import { MORE_FILTERS_CLASSES } from '../constants';
|
|
3
|
+
|
|
4
|
+
const getResponsiveFilterClassnames = (
|
|
5
|
+
moreFiltersDesktopCollapsed,
|
|
6
|
+
moreFiltersMobileCollapsed
|
|
7
|
+
) => ({
|
|
8
|
+
moreFiltersMobileWrapperClass: classnames(MORE_FILTERS_CLASSES.MOBILE_WRAPPER, {
|
|
9
|
+
[`${MORE_FILTERS_CLASSES.MOBILE_WRAPPER}--open`]: !moreFiltersMobileCollapsed
|
|
10
|
+
}),
|
|
11
|
+
moreFiltersMobileTogglerClass: classnames(MORE_FILTERS_CLASSES.MOBILE_TOGGLER, {
|
|
12
|
+
[`${MORE_FILTERS_CLASSES.MOBILE_TOGGLER}--open`]: !moreFiltersMobileCollapsed
|
|
13
|
+
}),
|
|
14
|
+
moreFiltersDesktopWrapperClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_WRAPPER, {
|
|
15
|
+
[`${MORE_FILTERS_CLASSES.DESKTOP_WRAPPER}--open`]: !moreFiltersDesktopCollapsed
|
|
16
|
+
}),
|
|
17
|
+
moreFiltersDesktopTogglerClass: classnames(MORE_FILTERS_CLASSES.DESKTOP_TOGGLER, {
|
|
18
|
+
[`${MORE_FILTERS_CLASSES.DESKTOP_TOGGLER}--open`]: !moreFiltersDesktopCollapsed
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default getResponsiveFilterClassnames;
|
|
@@ -2,6 +2,7 @@ import buildNewQuery from './build-new-query';
|
|
|
2
2
|
import buildRawQueryStringified from './build-raw-query-stringified';
|
|
3
3
|
import { decodeValue, encodeValue } from './decode-encode';
|
|
4
4
|
import checkIfRangeUpdated from './check-if-range-updated';
|
|
5
|
+
import getResponsiveFilterClassnames from './get-responsive-filter-classnames';
|
|
5
6
|
import getDisplayValue from './get-display-value';
|
|
6
7
|
import calculateStep from './calculate-step';
|
|
7
8
|
import calculateMinMax from './calculate-min-max';
|
|
@@ -20,6 +21,7 @@ export {
|
|
|
20
21
|
decodeValue,
|
|
21
22
|
encodeValue,
|
|
22
23
|
checkIfRangeUpdated,
|
|
24
|
+
getResponsiveFilterClassnames,
|
|
23
25
|
getDisplayValue,
|
|
24
26
|
calculateStep,
|
|
25
27
|
calculateMinMax,
|
|
@@ -22,7 +22,8 @@ const mockedProps = {
|
|
|
22
22
|
handleSearch: jest.fn(),
|
|
23
23
|
resetFilters: jest.fn(),
|
|
24
24
|
name: 'test',
|
|
25
|
-
|
|
25
|
+
groupAfterMobile: 0,
|
|
26
|
+
groupAfterDesktop: 0,
|
|
26
27
|
isCollapsedOnResponsive: true,
|
|
27
28
|
displaySearchFilter: false
|
|
28
29
|
};
|
|
@@ -139,10 +140,35 @@ describe('SearchFilter component', () => {
|
|
|
139
140
|
});
|
|
140
141
|
});
|
|
141
142
|
|
|
142
|
-
describe('when
|
|
143
|
+
describe('when groupAfterMobile > 0 and groupAfterDesktop = 0', () => {
|
|
143
144
|
const specificMockedProps = {
|
|
144
145
|
...mockedProps,
|
|
145
|
-
|
|
146
|
+
groupAfterMobile: 1
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
it('should render without throwing error and match snapshot', () => {
|
|
150
|
+
const { asFragment } = renderComponent(SearchFilter, specificMockedProps);
|
|
151
|
+
expect(asFragment()).toMatchSnapshot();
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
describe('when groupAfterMobile = 0 and groupAfterDesktop > 0', () => {
|
|
156
|
+
const specificMockedProps = {
|
|
157
|
+
...mockedProps,
|
|
158
|
+
groupAfterDesktop: 1
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
it('should render without throwing error and match snapshot', () => {
|
|
162
|
+
const { asFragment } = renderComponent(SearchFilter, specificMockedProps);
|
|
163
|
+
expect(asFragment()).toMatchSnapshot();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe('when groupAfterMobile > 0 and groupAfterDesktop > 0', () => {
|
|
168
|
+
const specificMockedProps = {
|
|
169
|
+
...mockedProps,
|
|
170
|
+
groupAfterMobile: 1,
|
|
171
|
+
groupAfterDesktop: 1
|
|
146
172
|
};
|
|
147
173
|
|
|
148
174
|
it('should render without throwing error and match snapshot', () => {
|
package/tests/unit/src/components/SearchFilter/SearchFilter/__snapshots__/SearchFilter.test.js.snap
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`SearchFilter component when
|
|
3
|
+
exports[`SearchFilter component when groupAfterMobile > 0 and groupAfterDesktop = 0 should render without throwing error and match snapshot 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<form
|
|
6
6
|
class=""
|
|
@@ -34,19 +34,317 @@ exports[`SearchFilter component when groupAfter > 0 should render without throwi
|
|
|
34
34
|
class="filter__wrapper filter__wrapper--search-refine"
|
|
35
35
|
>
|
|
36
36
|
<button
|
|
37
|
-
class="filter__more-filters-toggler"
|
|
37
|
+
class="filter__more-filters-mobile-toggler"
|
|
38
38
|
type="button"
|
|
39
39
|
>
|
|
40
|
-
|
|
40
|
+
Filters
|
|
41
41
|
</button>
|
|
42
42
|
<div
|
|
43
|
-
class="filter__more-filters-wrapper"
|
|
43
|
+
class="filter__more-filters-mobile-wrapper"
|
|
44
44
|
>
|
|
45
45
|
<div
|
|
46
|
-
class="filter__more-filters-content"
|
|
46
|
+
class="filter__more-filters-mobile-content"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="filter__more-filters-desktop-wrapper"
|
|
50
|
+
>
|
|
51
|
+
<div
|
|
52
|
+
class="filter__more-filters-desktop-content"
|
|
53
|
+
/>
|
|
54
|
+
<div
|
|
55
|
+
class="filter__more-filters-desktop-buttons"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
class="filter__reset"
|
|
59
|
+
>
|
|
60
|
+
<button
|
|
61
|
+
class="icon-button icon-button--reset"
|
|
62
|
+
data-testid="reset-icon"
|
|
63
|
+
title="reset--button"
|
|
64
|
+
type="button"
|
|
65
|
+
>
|
|
66
|
+
<i
|
|
67
|
+
class="fas fa-redo-alt"
|
|
68
|
+
/>
|
|
69
|
+
</button>
|
|
70
|
+
<div
|
|
71
|
+
data-testid="reset-button"
|
|
72
|
+
role="button"
|
|
73
|
+
>
|
|
74
|
+
Reset all filters
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<button
|
|
78
|
+
class="button button--full-width"
|
|
79
|
+
type="submit"
|
|
80
|
+
>
|
|
81
|
+
Search
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div
|
|
87
|
+
class="filter__more-filters-mobile-buttons"
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
class="filter__reset"
|
|
91
|
+
>
|
|
92
|
+
<button
|
|
93
|
+
class="icon-button icon-button--reset"
|
|
94
|
+
data-testid="reset-icon"
|
|
95
|
+
title="reset--button"
|
|
96
|
+
type="button"
|
|
97
|
+
>
|
|
98
|
+
<i
|
|
99
|
+
class="fas fa-redo-alt"
|
|
100
|
+
/>
|
|
101
|
+
</button>
|
|
102
|
+
<div
|
|
103
|
+
data-testid="reset-button"
|
|
104
|
+
role="button"
|
|
105
|
+
>
|
|
106
|
+
Reset all filters
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<button
|
|
110
|
+
class="button button--full-width"
|
|
111
|
+
type="submit"
|
|
112
|
+
>
|
|
113
|
+
Search
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<br />
|
|
118
|
+
<button
|
|
119
|
+
class="button button--full-width"
|
|
120
|
+
type="submit"
|
|
121
|
+
>
|
|
122
|
+
Search
|
|
123
|
+
</button>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</form>
|
|
127
|
+
</DocumentFragment>
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
exports[`SearchFilter component when groupAfterMobile = 0 and groupAfterDesktop > 0 should render without throwing error and match snapshot 1`] = `
|
|
131
|
+
<DocumentFragment>
|
|
132
|
+
<form
|
|
133
|
+
class=""
|
|
134
|
+
data-testid="filter-test-form"
|
|
135
|
+
id="filter-test-form"
|
|
136
|
+
>
|
|
137
|
+
<div
|
|
138
|
+
class="filter filter--search-refine"
|
|
139
|
+
>
|
|
140
|
+
<div
|
|
141
|
+
class="filter__reset"
|
|
142
|
+
>
|
|
143
|
+
<button
|
|
144
|
+
class="icon-button icon-button--reset"
|
|
145
|
+
data-testid="reset-icon"
|
|
146
|
+
title="reset--button"
|
|
147
|
+
type="button"
|
|
148
|
+
>
|
|
149
|
+
<i
|
|
150
|
+
class="fas fa-redo-alt"
|
|
151
|
+
/>
|
|
152
|
+
</button>
|
|
153
|
+
<div
|
|
154
|
+
data-testid="reset-button"
|
|
155
|
+
role="button"
|
|
156
|
+
>
|
|
157
|
+
Reset all filters
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<div
|
|
161
|
+
class="filter__wrapper filter__wrapper--search-refine"
|
|
162
|
+
>
|
|
163
|
+
<div
|
|
164
|
+
class="filter__more-filters-mobile-wrapper"
|
|
165
|
+
>
|
|
166
|
+
<div
|
|
167
|
+
class="filter__more-filters-mobile-content"
|
|
168
|
+
>
|
|
169
|
+
<button
|
|
170
|
+
class="filter__more-filters-desktop-toggler"
|
|
171
|
+
type="button"
|
|
172
|
+
>
|
|
173
|
+
More filters
|
|
174
|
+
</button>
|
|
175
|
+
<div
|
|
176
|
+
class="filter__more-filters-desktop-wrapper"
|
|
177
|
+
>
|
|
178
|
+
<div
|
|
179
|
+
class="filter__more-filters-desktop-content"
|
|
180
|
+
/>
|
|
181
|
+
<div
|
|
182
|
+
class="filter__more-filters-desktop-buttons"
|
|
183
|
+
>
|
|
184
|
+
<div
|
|
185
|
+
class="filter__reset"
|
|
186
|
+
>
|
|
187
|
+
<button
|
|
188
|
+
class="icon-button icon-button--reset"
|
|
189
|
+
data-testid="reset-icon"
|
|
190
|
+
title="reset--button"
|
|
191
|
+
type="button"
|
|
192
|
+
>
|
|
193
|
+
<i
|
|
194
|
+
class="fas fa-redo-alt"
|
|
195
|
+
/>
|
|
196
|
+
</button>
|
|
197
|
+
<div
|
|
198
|
+
data-testid="reset-button"
|
|
199
|
+
role="button"
|
|
200
|
+
>
|
|
201
|
+
Reset all filters
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
<button
|
|
205
|
+
class="button button--full-width"
|
|
206
|
+
type="submit"
|
|
207
|
+
>
|
|
208
|
+
Search
|
|
209
|
+
</button>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<div
|
|
214
|
+
class="filter__more-filters-mobile-buttons"
|
|
215
|
+
>
|
|
216
|
+
<div
|
|
217
|
+
class="filter__reset"
|
|
218
|
+
>
|
|
219
|
+
<button
|
|
220
|
+
class="icon-button icon-button--reset"
|
|
221
|
+
data-testid="reset-icon"
|
|
222
|
+
title="reset--button"
|
|
223
|
+
type="button"
|
|
224
|
+
>
|
|
225
|
+
<i
|
|
226
|
+
class="fas fa-redo-alt"
|
|
227
|
+
/>
|
|
228
|
+
</button>
|
|
229
|
+
<div
|
|
230
|
+
data-testid="reset-button"
|
|
231
|
+
role="button"
|
|
232
|
+
>
|
|
233
|
+
Reset all filters
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
<button
|
|
237
|
+
class="button button--full-width"
|
|
238
|
+
type="submit"
|
|
239
|
+
>
|
|
240
|
+
Search
|
|
241
|
+
</button>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
<br />
|
|
245
|
+
<button
|
|
246
|
+
class="button button--full-width"
|
|
247
|
+
type="submit"
|
|
248
|
+
>
|
|
249
|
+
Search
|
|
250
|
+
</button>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</form>
|
|
254
|
+
</DocumentFragment>
|
|
255
|
+
`;
|
|
256
|
+
|
|
257
|
+
exports[`SearchFilter component when groupAfterMobile > 0 and groupAfterDesktop > 0 should render without throwing error and match snapshot 1`] = `
|
|
258
|
+
<DocumentFragment>
|
|
259
|
+
<form
|
|
260
|
+
class=""
|
|
261
|
+
data-testid="filter-test-form"
|
|
262
|
+
id="filter-test-form"
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
class="filter filter--search-refine"
|
|
266
|
+
>
|
|
267
|
+
<div
|
|
268
|
+
class="filter__reset"
|
|
269
|
+
>
|
|
270
|
+
<button
|
|
271
|
+
class="icon-button icon-button--reset"
|
|
272
|
+
data-testid="reset-icon"
|
|
273
|
+
title="reset--button"
|
|
274
|
+
type="button"
|
|
275
|
+
>
|
|
276
|
+
<i
|
|
277
|
+
class="fas fa-redo-alt"
|
|
47
278
|
/>
|
|
279
|
+
</button>
|
|
280
|
+
<div
|
|
281
|
+
data-testid="reset-button"
|
|
282
|
+
role="button"
|
|
283
|
+
>
|
|
284
|
+
Reset all filters
|
|
285
|
+
</div>
|
|
286
|
+
</div>
|
|
287
|
+
<div
|
|
288
|
+
class="filter__wrapper filter__wrapper--search-refine"
|
|
289
|
+
>
|
|
290
|
+
<button
|
|
291
|
+
class="filter__more-filters-mobile-toggler"
|
|
292
|
+
type="button"
|
|
293
|
+
>
|
|
294
|
+
Filters
|
|
295
|
+
</button>
|
|
296
|
+
<div
|
|
297
|
+
class="filter__more-filters-mobile-wrapper"
|
|
298
|
+
>
|
|
299
|
+
<div
|
|
300
|
+
class="filter__more-filters-mobile-content"
|
|
301
|
+
>
|
|
302
|
+
<button
|
|
303
|
+
class="filter__more-filters-desktop-toggler"
|
|
304
|
+
type="button"
|
|
305
|
+
>
|
|
306
|
+
More filters
|
|
307
|
+
</button>
|
|
308
|
+
<div
|
|
309
|
+
class="filter__more-filters-desktop-wrapper"
|
|
310
|
+
>
|
|
311
|
+
<div
|
|
312
|
+
class="filter__more-filters-desktop-content"
|
|
313
|
+
/>
|
|
314
|
+
<div
|
|
315
|
+
class="filter__more-filters-desktop-buttons"
|
|
316
|
+
>
|
|
317
|
+
<div
|
|
318
|
+
class="filter__reset"
|
|
319
|
+
>
|
|
320
|
+
<button
|
|
321
|
+
class="icon-button icon-button--reset"
|
|
322
|
+
data-testid="reset-icon"
|
|
323
|
+
title="reset--button"
|
|
324
|
+
type="button"
|
|
325
|
+
>
|
|
326
|
+
<i
|
|
327
|
+
class="fas fa-redo-alt"
|
|
328
|
+
/>
|
|
329
|
+
</button>
|
|
330
|
+
<div
|
|
331
|
+
data-testid="reset-button"
|
|
332
|
+
role="button"
|
|
333
|
+
>
|
|
334
|
+
Reset all filters
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
<button
|
|
338
|
+
class="button button--full-width"
|
|
339
|
+
type="submit"
|
|
340
|
+
>
|
|
341
|
+
Search
|
|
342
|
+
</button>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
48
346
|
<div
|
|
49
|
-
class="filter__more-filters-buttons"
|
|
347
|
+
class="filter__more-filters-mobile-buttons"
|
|
50
348
|
>
|
|
51
349
|
<div
|
|
52
350
|
class="filter__reset"
|