@uncinc/uncinc-react-kitchen-sink 2.3.2 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/Context/withMapping.js +1 -6
  2. package/dist/components/Accordion/AccordionItem/index.js +0 -5
  3. package/dist/components/Accordion/AccordionItemVariant/index.js +0 -5
  4. package/dist/components/Accordion/index.js +0 -2
  5. package/dist/components/ApiAutocomplete/index.js +6 -12
  6. package/dist/components/Button/index.js +4 -10
  7. package/dist/components/Cookie/Checkbox/index.js +0 -2
  8. package/dist/components/Cookie/index.js +39 -34
  9. package/dist/components/FontSizeSwitcher/index.js +2 -8
  10. package/dist/components/Form/Checkbox/index.js +1 -4
  11. package/dist/components/Form/Checkbox/stories.js +0 -2
  12. package/dist/components/Form/Checkboxes/index.js +1 -7
  13. package/dist/components/Form/Checkboxes/index.test.js +8 -4
  14. package/dist/components/Form/Checkboxes/stories.js +1 -4
  15. package/dist/components/Form/Date/index.js +1 -4
  16. package/dist/components/Form/Date/stories.js +0 -2
  17. package/dist/components/Form/DatePicker/index.js +0 -2
  18. package/dist/components/Form/DatePicker/stories.js +0 -2
  19. package/dist/components/Form/DateSelect/index.js +110 -85
  20. package/dist/components/Form/DateSelect/stories.js +24 -15
  21. package/dist/components/Form/DateSelect/style.scss +10 -4
  22. package/dist/components/Form/Email/index.js +1 -4
  23. package/dist/components/Form/Email/stories.js +0 -2
  24. package/dist/components/Form/FormikWrapper/index.js +9 -15
  25. package/dist/components/Form/GenericFormElement/index.js +0 -2
  26. package/dist/components/Form/Number/index.js +1 -10
  27. package/dist/components/Form/Number/stories.js +0 -2
  28. package/dist/components/Form/RadioButtons/index.js +1 -7
  29. package/dist/components/Form/RadioButtons/index.test.js +8 -4
  30. package/dist/components/Form/RadioButtons/stories.js +1 -4
  31. package/dist/components/Form/SearchField/index.js +0 -2
  32. package/dist/components/Form/Select/Input/index.js +4 -14
  33. package/dist/components/Form/Select/index.js +1 -4
  34. package/dist/components/Form/Select/stories.js +0 -4
  35. package/dist/components/Form/TextField/index.js +0 -6
  36. package/dist/components/Form/TextField/index.test.js +8 -4
  37. package/dist/components/Form/TextField/stories.js +1 -4
  38. package/dist/components/Form/Textarea/index.js +0 -2
  39. package/dist/components/Form/Textarea/stories.js +0 -2
  40. package/dist/components/Hamburger/index.js +0 -2
  41. package/dist/components/Header/index.js +4 -9
  42. package/dist/components/Image/Background/index.js +1 -7
  43. package/dist/components/Image/LazyLoadWrapper/index.js +0 -12
  44. package/dist/components/Image/Picture/index.js +4 -19
  45. package/dist/components/Image/index.js +0 -4
  46. package/dist/components/InlineMenu/index.js +0 -9
  47. package/dist/components/Layout/Container/index.js +1 -4
  48. package/dist/components/Layout/Container/stories.js +0 -3
  49. package/dist/components/Layout/QuickLayout/Auto/index.js +0 -2
  50. package/dist/components/Layout/QuickLayout/Center/index.js +0 -2
  51. package/dist/components/Layout/QuickLayout/Clamp/index.js +0 -2
  52. package/dist/components/Layout/QuickLayout/Sidebar/index.js +0 -2
  53. package/dist/components/Layout/QuickLayout/SpaceBetween/index.js +0 -2
  54. package/dist/components/Layout/QuickLayout/Stack/index.js +1 -4
  55. package/dist/components/Layout/QuickLayout/Wrap/index.js +0 -2
  56. package/dist/components/Layout/QuickLayout/index.js +0 -9
  57. package/dist/components/Lottie/LottieAnimation/index.js +12 -17
  58. package/dist/components/Lottie/LottieAnimationWithMousePosition.js +8 -9
  59. package/dist/components/Lottie/index.js +3 -3
  60. package/dist/components/Lottie/stories.js +10 -5
  61. package/dist/components/MagicLine/index.js +0 -14
  62. package/dist/components/MagicLine/stories.js +0 -2
  63. package/dist/components/NavigationScroll/index.js +2 -12
  64. package/dist/components/Pagination/index.js +0 -7
  65. package/dist/components/SearchKit/Facets/ChipFacet/index.js +0 -2
  66. package/dist/components/SearchKit/Facets/HierarchicalFilterFacet/index.js +0 -2
  67. package/dist/components/SearchKit/Facets/HierarchicalMenuFacet/index.js +0 -2
  68. package/dist/components/SearchKit/Facets/SelectFacet/index.js +0 -6
  69. package/dist/components/SearchKit/Query/index.js +3 -6
  70. package/dist/components/SearchKit/SearchFacets/index.js +0 -7
  71. package/dist/components/SearchKit/SearchField/index.js +36 -18
  72. package/dist/components/SearchKit/SearchLoadMore/index.js +0 -7
  73. package/dist/components/SearchKit/SearchPage/index.js +3 -9
  74. package/dist/components/SearchKit/SearchPagination/index.js +0 -5
  75. package/dist/components/SearchKit/SearchReset/index.js +0 -2
  76. package/dist/components/SearchKit/SearchResults/index.js +44 -17
  77. package/dist/components/SearchKit/SearchSelectedFilters/index.js +0 -4
  78. package/dist/components/SearchKit/SearchSorting/index.js +0 -2
  79. package/dist/components/SearchKit/index.js +0 -3
  80. package/dist/components/SearchKit/stories.js +2 -7
  81. package/dist/components/Share/index.js +0 -3
  82. package/dist/components/Sliders/SliderRelated/index.js +1 -6
  83. package/dist/components/Sliders/SliderRelated/stories.js +1 -4
  84. package/dist/components/Webform/WebformActions/index.js +0 -2
  85. package/dist/components/Webform/WebformCheckbox/index.js +1 -8
  86. package/dist/components/Webform/WebformCheckboxes/index.js +1 -9
  87. package/dist/components/Webform/WebformContainer/index.js +5 -6
  88. package/dist/components/Webform/WebformDate/index.js +12 -18
  89. package/dist/components/Webform/WebformMapper/index.js +1 -18
  90. package/dist/components/Webform/WebformNumber/index.js +1 -4
  91. package/dist/components/Webform/WebformRadioButtons/index.js +1 -9
  92. package/dist/components/Webform/WebformSelect/index.js +1 -9
  93. package/dist/components/Webform/WebformTextField/index.js +1 -8
  94. package/dist/components/Webform/WebformTextarea/index.js +1 -8
  95. package/dist/components/Webform/WebformWizardPage/index.js +6 -8
  96. package/dist/components/Webform/index.js +1 -8
  97. package/dist/components/Webform/withStates.js +6 -19
  98. package/dist/components/WysiwygField/index.js +1 -8
  99. package/dist/components/WysiwygField/stories.js +0 -3
  100. package/dist/config/constants.js +3 -4
  101. package/dist/config/i18next/index.js +23 -0
  102. package/dist/config/i18next/locales/en.json +22 -0
  103. package/dist/config/i18next/locales/nl.json +22 -0
  104. package/dist/helpers/gtm.js +11 -15
  105. package/dist/helpers/link.js +0 -4
  106. package/dist/helpers/useValueForCurrentViewPort.js +20 -14
  107. package/dist/hooks/useOnScreen.js +2 -2
  108. package/dist/hooks/usePrevious.js +3 -2
  109. package/dist/hooks/useScrollPosition.js +0 -3
  110. package/dist/hooks/useWindowDimensions.js +0 -3
  111. package/package.json +16 -7
  112. package/dist/components/WysiwygField/stories.scss +0 -3
  113. package/dist/helpers/makeSafeForCSS.js +0 -5
@@ -1,43 +1,61 @@
1
- import React, { useRef } from 'react';
2
- import { useSearchkit, useSearchkitQueryValue } from '@searchkit/client';
3
- import TextField from '../../Form/TextField';
1
+ import React, { useRef } from "react";
2
+ import { useSearchkit, useSearchkitQueryValue } from "@searchkit/client";
4
3
  import FormikWrapper from '../../Form/FormikWrapper';
5
-
4
+ import Button from '../../Button';
5
+ import TextField from '../../Form/TextField';
6
6
  const SearchField = ({
7
- timeout
7
+ timeout,
8
+ autoSearch = true,
9
+ buttonText,
10
+ placeholder
8
11
  }) => {
9
12
  const [query, setQuery] = useSearchkitQueryValue();
10
13
  const api = useSearchkit();
11
14
  const timeoutRef = useRef();
12
-
15
+ const fieldLabel = false;
16
+ const searchQuery = query => {
17
+ setQuery(query);
18
+ api.setQuery(query);
19
+ api.search();
20
+ };
21
+ const onSubmit = (values, form) => {
22
+ searchQuery(values.query);
23
+ };
13
24
  const onChange = e => {
14
25
  e.persist();
15
-
16
26
  if (timeoutRef.current) {
17
27
  clearTimeout(timeoutRef.current);
18
28
  }
19
-
20
29
  timeoutRef.current = setTimeout(() => {
21
- setQuery(e.target.value);
22
- api.setQuery(e.target.value);
23
- api.search();
30
+ searchQuery(e.target.value);
24
31
  }, timeout);
25
32
  };
26
-
33
+ const handleEnter = event => {
34
+ if (event.key === 'Enter') {
35
+ onSubmit();
36
+ }
37
+ };
27
38
  return /*#__PURE__*/React.createElement(FormikWrapper, {
28
39
  initialValues: {
29
40
  query: query
30
41
  },
31
42
  displayRequiredIndicator: "required",
32
- enableReinitialize: true
43
+ enableReinitialize: true,
44
+ onSubmit: onSubmit
33
45
  }, /*#__PURE__*/React.createElement(TextField, {
34
46
  fieldName: "query",
35
- title: "Search",
36
- onChange: onChange
37
- }));
47
+ title: fieldLabel,
48
+ placeholder: placeholder,
49
+ onChange: autoSearch ? () => onChange : () => handleEnter
50
+ }), !autoSearch && /*#__PURE__*/React.createElement(Button, {
51
+ type: "submit",
52
+ primary: true
53
+ }, buttonText));
38
54
  };
39
-
40
55
  SearchField.defaultProps = {
41
- timeout: 1000
56
+ timeout: 1000,
57
+ autoSearch: true,
58
+ buttonText: '',
59
+ placeholder: ''
42
60
  };
43
61
  export default SearchField;
@@ -1,18 +1,15 @@
1
1
  import React from 'react';
2
2
  import { useSearchkit } from '@searchkit/client';
3
3
  import Button from '../../Button';
4
-
5
4
  const SearchLoadMore = ({
6
5
  data,
7
6
  label,
8
7
  className
9
8
  }) => {
10
9
  const api = useSearchkit();
11
-
12
10
  if (!data) {
13
11
  return null;
14
12
  }
15
-
16
13
  const setNextPage = () => {
17
14
  if (data) {
18
15
  api.setPage({
@@ -22,19 +19,15 @@ const SearchLoadMore = ({
22
19
  api.search();
23
20
  }
24
21
  };
25
-
26
22
  const currentPage = data.results.hits.page.pageNumber;
27
23
  const lastPage = data.results.hits.page.totalPages;
28
-
29
24
  if (currentPage + 1 >= lastPage) {
30
25
  return null;
31
26
  }
32
-
33
27
  return /*#__PURE__*/React.createElement("div", {
34
28
  className: className
35
29
  }, /*#__PURE__*/React.createElement(Button, {
36
30
  onClick: setNextPage
37
31
  }, label));
38
32
  };
39
-
40
33
  export default SearchLoadMore;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
2
  import { withSearchkitRouting } from '@searchkit/client';
3
3
  import { EuiPage } from '@elastic/eui';
4
-
5
4
  const SearchPage = ({
6
5
  children
7
6
  }) => /*#__PURE__*/React.createElement(EuiPage, null, children);
8
-
9
7
  export const routeToStateFn = routeState => {
10
8
  const value = {
11
9
  query: routeState.query || '',
@@ -15,37 +13,33 @@ export const routeToStateFn = routeState => {
15
13
  size: Number(routeState.size) || 10,
16
14
  from: Number(routeState.from) || 0
17
15
  }
18
- }; // Map Number values for min and max filters. By default they
16
+ };
17
+
18
+ // Map Number values for min and max filters. By default they
19
19
  // are parsed as strings, which does not comply to the schema.
20
20
  // The 'qs' package is at fault here.
21
21
  // @see https://github.com/ljharb/qs/issues/91
22
-
23
22
  value.filters = value.filters.map(item => {
24
23
  if (item.min) {
25
24
  item.min = Number(item.min);
26
25
  }
27
-
28
26
  if (item.max) {
29
27
  item.max = Number(item.max);
30
28
  }
31
-
32
29
  if (item.boolValue) {
33
30
  item.boolValue = !!item.boolValue;
34
31
  }
35
-
36
32
  if (item.geoBoundingBox) {
37
33
  item.geoBoundingBox.topLeft.lat = Number(item.geoBoundingBox.topLeft.lat);
38
34
  item.geoBoundingBox.topLeft.lon = Number(item.geoBoundingBox.topLeft.lon);
39
35
  item.geoBoundingBox.bottomRight.lat = Number(item.geoBoundingBox.bottomRight.lat);
40
36
  item.geoBoundingBox.bottomRight.lon = Number(item.geoBoundingBox.bottomRight.lon);
41
37
  }
42
-
43
38
  if (item.geoRadius) {
44
39
  item.geoRadius.radius = Number(item.geoRadius.radius);
45
40
  item.geoRadius.center.lat = Number(item.geoRadius.center.lat);
46
41
  item.geoRadius.center.lon = Number(item.geoRadius.center.lon);
47
42
  }
48
-
49
43
  return item;
50
44
  });
51
45
  return value;
@@ -1,16 +1,13 @@
1
1
  import React from 'react';
2
2
  import { useSearchkit } from '@searchkit/client';
3
3
  import Pagination from '../../Pagination';
4
-
5
4
  const SearchPagination = ({
6
5
  data
7
6
  }) => {
8
7
  const api = useSearchkit();
9
-
10
8
  if (!data) {
11
9
  return null;
12
10
  }
13
-
14
11
  const setCurrentPage = page => {
15
12
  if (data && page) {
16
13
  api.setPage({
@@ -20,12 +17,10 @@ const SearchPagination = ({
20
17
  api.search();
21
18
  }
22
19
  };
23
-
24
20
  return /*#__PURE__*/React.createElement(Pagination, {
25
21
  setCurrentPage: setCurrentPage,
26
22
  totalPages: data.results.hits.page.totalPages,
27
23
  currentPage: data.results.hits.page.pageNumber + 1
28
24
  });
29
25
  };
30
-
31
26
  export default SearchPagination;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ResetSearchButton } from '@searchkit/elastic-ui';
3
-
4
3
  const SearchReset = ({
5
4
  data,
6
5
  loading
@@ -11,5 +10,4 @@ const SearchReset = ({
11
10
  loading: loading
12
11
  }));
13
12
  };
14
-
15
13
  export default SearchReset;
@@ -1,23 +1,22 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import usePrevious from '../../../hooks/usePrevious';
3
3
  import { useSearchkitVariables } from '@searchkit/client';
4
-
4
+ import PropTypes from 'prop-types';
5
5
  const SearchResultItemDefault = ({
6
6
  item
7
7
  }) => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, item.fields.title[0]));
8
-
9
8
  const SearchResultHeaderDefault = ({
10
9
  data
11
10
  }) => /*#__PURE__*/React.createElement("h2", null, data.results.summary.total, " Results");
12
-
13
11
  const SearchResults = ({
14
12
  data,
15
13
  renderItem,
16
14
  renderHeader,
17
- appendResults = false
15
+ appendResults = false,
16
+ scrollView = null
18
17
  }) => {
19
- const SearchResultItem = renderItem || SearchResultItemDefault;
20
- const SearchResultHeader = renderHeader || SearchResultHeaderDefault;
18
+ const SearchResultItem = renderItem;
19
+ const SearchResultHeader = renderHeader;
21
20
  const variables = useSearchkitVariables();
22
21
  const [items, setItems] = useState([]);
23
22
  const [currentPage, setCurrentPage] = useState(-1);
@@ -30,12 +29,15 @@ const SearchResults = ({
30
29
  const previousItems = usePrevious(items);
31
30
  useEffect(() => {
32
31
  if (typeof data.results === 'undefined') return;
33
-
32
+ setCurrentPage(data.results.hits.page.pageNumber);
33
+ setPreviousQuery(variables.query);
34
+ setPreviousSortBy(variables.sortBy);
35
+ setPreviousActiveFilters(variables.filters);
36
+ setCurrentData(JSON.stringify(data));
34
37
  if (!appendResults) {
35
38
  // Set items directly if not appendResults
36
39
  return setItems([...data.results.hits.items]);
37
40
  }
38
-
39
41
  const currentPageNumber = data.results.hits.page.pageNumber;
40
42
  const currentQuery = variables.query;
41
43
  const currentFiltersLength = variables.filters.length;
@@ -45,8 +47,9 @@ const SearchResults = ({
45
47
  const filtersChanged = previousActiveFilters.length !== currentFiltersLength;
46
48
  const sortByChanged = currentSortBy !== previousSortBy;
47
49
  const pageChanged = currentPageNumber !== previousPage;
48
- const dataChanged = currentData !== newData; // Determine if we have to reset the results, or should append them to the results
50
+ const dataChanged = currentData !== newData;
49
51
 
52
+ // Determine if we have to reset the results, or should append them to the results
50
53
  if (dataChanged && (queryChanged || filtersChanged || pageChanged || sortByChanged)) {
51
54
  if (typeof previousItems === 'undefined' || queryChanged || filtersChanged || sortByChanged) {
52
55
  // Overwrite data when Query, Filters or SortBy has changed
@@ -55,25 +58,49 @@ const SearchResults = ({
55
58
  // Append data if the page has changed and we have previousItems
56
59
  setItems([...previousItems, ...data.results.hits.items]);
57
60
  }
58
-
59
- setCurrentPage(data.results.hits.page.pageNumber);
60
- setPreviousQuery(variables.query);
61
- setPreviousSortBy(variables.sortBy);
62
- setPreviousActiveFilters(variables.filters);
63
- setCurrentData(JSON.stringify(data));
64
61
  }
65
- }, [data, appendResults, variables]); // Set the search results when items have changed
62
+ }, [data, appendResults, variables]);
66
63
 
64
+ // Set the search results when items have changed
67
65
  useEffect(() => {
68
66
  setSearchResultItems(items.map(item => /*#__PURE__*/React.createElement(SearchResultItem, {
67
+ key: item.id,
69
68
  item: item
70
69
  })));
71
70
  }, [items]);
71
+
72
+ // Scroll to top on every page.
73
+ useEffect(() => {
74
+ if (!currentData) {
75
+ return;
76
+ }
77
+ const currentPageNumber = currentData.results.hits.page.pageNumber;
78
+ if (appendResults === false && scrollView && scrollView.current && currentPageNumber !== 0) {
79
+ scrollView.current.scrollIntoView({
80
+ behavior: 'smooth',
81
+ block: 'start'
82
+ });
83
+ }
84
+ }, [currentData]);
72
85
  return /*#__PURE__*/React.createElement("div", {
73
86
  className: "SearchResults"
74
87
  }, data && /*#__PURE__*/React.createElement(SearchResultHeader, {
75
88
  data: data
76
89
  }), searchResultItems);
77
90
  };
78
-
91
+ SearchResults.defaultProps = {
92
+ renderItem: SearchResultItemDefault,
93
+ renderHeader: SearchResultHeaderDefault,
94
+ appendResults: false,
95
+ scrollView: null
96
+ };
97
+ SearchResults.propTypes = {
98
+ // its turned off due to complex struxture of the object
99
+ // eslint-disable-next-line react/forbid-prop-types
100
+ data: PropTypes.object.isRequired,
101
+ renderItem: PropTypes.elementType,
102
+ renderHeader: PropTypes.elementType,
103
+ appendResults: PropTypes.bool,
104
+ scrollView: PropTypes.element
105
+ };
79
106
  export default SearchResults;
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { useSearchkit } from '@searchkit/client';
3
3
  import { SelectedFilters } from '@searchkit/elastic-ui';
4
4
  import Button from '../../Button';
5
-
6
5
  const SearchSelectedFilters = ({
7
6
  data,
8
7
  loading
@@ -19,11 +18,9 @@ const SearchSelectedFilters = ({
19
18
  }
20
19
  }, filter.label, ": ", filter.value);
21
20
  };
22
-
23
21
  if (!data) {
24
22
  return null;
25
23
  }
26
-
27
24
  return /*#__PURE__*/React.createElement("div", {
28
25
  className: "SearchSelectedFilters"
29
26
  }, /*#__PURE__*/React.createElement(SelectedFilters, {
@@ -37,5 +34,4 @@ const SearchSelectedFilters = ({
37
34
  }
38
35
  }));
39
36
  };
40
-
41
37
  export default SearchSelectedFilters;
@@ -3,14 +3,12 @@ import React, { useState, useEffect } from 'react';
3
3
  import SelectStyled from 'react-select';
4
4
  import FormikWrapper from '../../Form/FormikWrapper';
5
5
  import Select from '../../Form/Select';
6
-
7
6
  const useInitialValues = () => {
8
7
  const parsed = useSearchkitVariables();
9
8
  return {
10
9
  'sortBy': parsed.sortBy
11
10
  };
12
11
  };
13
-
14
12
  export const SearchSorting = ({
15
13
  data,
16
14
  loading
@@ -8,7 +8,6 @@ import SearchPagination from './SearchPagination';
8
8
  import SearchResults from './SearchResults';
9
9
  import SearchFacets from './SearchFacets';
10
10
  import SearchSelectedFilters from './SearchFacets';
11
-
12
11
  const defaultChildren = (data, loading) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchField, null), /*#__PURE__*/React.createElement(SearchFacets, {
13
12
  data: data,
14
13
  loading: loading
@@ -20,7 +19,6 @@ const defaultChildren = (data, loading) => /*#__PURE__*/React.createElement(Reac
20
19
  }), /*#__PURE__*/React.createElement(SearchPagination, {
21
20
  data: data
22
21
  }));
23
-
24
22
  const SearchKit = ({
25
23
  query,
26
24
  uri,
@@ -60,7 +58,6 @@ const SearchKit = ({
60
58
  useRouting: useRouting
61
59
  }, (data, loading) => children ? children(data, loading) : defaultChildren(data, loading))));
62
60
  };
63
-
64
61
  SearchKit.propTypes = {
65
62
  queryString: PropTypes.string,
66
63
  uri: PropTypes.string,
@@ -91,15 +91,12 @@ const query = `
91
91
  }
92
92
  }
93
93
  `;
94
-
95
94
  const SearchItem = ({
96
95
  item
97
96
  }) => /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, item.fields.title[0]));
98
-
99
97
  const SearchHeader = ({
100
98
  data
101
99
  }) => /*#__PURE__*/React.createElement("h2", null, data.results.summary.total, " Resultaten");
102
-
103
100
  export const Default = () => /*#__PURE__*/React.createElement(SearchKit, {
104
101
  uri: "http://localhost:4000/api/graphql",
105
102
  query: query
@@ -121,7 +118,6 @@ export const Default = () => /*#__PURE__*/React.createElement(SearchKit, {
121
118
  }), /*#__PURE__*/React.createElement(SearchPagination, {
122
119
  data: data
123
120
  })));
124
-
125
121
  const ListFacet = ({
126
122
  facet
127
123
  }) => {
@@ -153,7 +149,6 @@ const ListFacet = ({
153
149
  }, "- ", entry.label, " (", entry.count, ")"));
154
150
  })));
155
151
  };
156
-
157
152
  ListFacet.DISPLAY = 'ListFacet';
158
153
  export const CustomFacets = () => {
159
154
  const customFacets = [ListFacet];
@@ -221,7 +216,8 @@ export const LoadMore = () => {
221
216
  const api = useSearchkit();
222
217
  return /*#__PURE__*/React.createElement(SearchKit, {
223
218
  uri: "http://localhost:4000/api/graphql",
224
- query: query // useRouting={false}
219
+ query: query
220
+ // useRouting={false}
225
221
  ,
226
222
  pageSize: 5
227
223
  }, (data, loading) => {
@@ -232,7 +228,6 @@ export const LoadMore = () => {
232
228
  });
233
229
  api.search();
234
230
  };
235
-
236
231
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
237
232
  onClick: toggleFilter
238
233
  }, "Toggle"), /*#__PURE__*/React.createElement(SearchResults, {
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EmailShareButton, FacebookShareButton, LinkedinShareButton, TwitterShareButton, WhatsappShareButton } from "react-share";
3
3
  import './style.scss';
4
-
5
4
  const ShareButton = ({
6
5
  type,
7
6
  pageTitle,
@@ -28,7 +27,6 @@ const ShareButton = ({
28
27
  className: `icon icon-${type} icon-variant-3`
29
28
  }))));
30
29
  };
31
-
32
30
  const Share = ({
33
31
  title,
34
32
  pageTitle,
@@ -56,7 +54,6 @@ const Share = ({
56
54
  className: "Share__buttons"
57
55
  }, buttons)));
58
56
  };
59
-
60
57
  Share.defaultProps = {
61
58
  title: "Share this page:",
62
59
  pageTitle: "",
@@ -1,10 +1,8 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import Slider from "react-slick";
5
4
  import useValueForCurrentViewPort from '../../../helpers/useValueForCurrentViewPort';
6
5
  import './style.scss';
7
-
8
6
  const SliderNextArrow = ({
9
7
  onClick
10
8
  }) => {
@@ -13,7 +11,6 @@ const SliderNextArrow = ({
13
11
  onClick: onClick
14
12
  });
15
13
  };
16
-
17
14
  const SliderPrevArrow = ({
18
15
  onClick
19
16
  }) => {
@@ -22,7 +19,6 @@ const SliderPrevArrow = ({
22
19
  onClick: onClick
23
20
  });
24
21
  };
25
-
26
22
  const SliderRelated = props => {
27
23
  const {
28
24
  children,
@@ -38,7 +34,6 @@ const SliderRelated = props => {
38
34
  ref: sliderRef
39
35
  }), children);
40
36
  };
41
-
42
37
  SliderRelated.defaultProps = {
43
38
  title: null,
44
39
  slidesToShow: 3,
@@ -1,5 +1,4 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import SliderRelated from '.';
5
4
  import Button from '../../Button';
@@ -16,7 +15,6 @@ export default d;
16
15
  const defaultProps = {
17
16
  autoplay: false
18
17
  };
19
-
20
18
  const Teaser = ({
21
19
  title,
22
20
  image,
@@ -51,7 +49,6 @@ const Teaser = ({
51
49
  primary: false,
52
50
  href: buttonLink
53
51
  }, buttonText))));
54
-
55
52
  const children = Array.from(Array(6).keys()).map(i => {
56
53
  const image = ["https://dummyimage.com/600x400/000/fff", "https://dummyimage.com/600x400/f00/fff", "https://dummyimage.com/600x400/ddd/fff"];
57
54
  const title = "Title";
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import c from 'classnames';
3
3
  import Button from '../../Button';
4
-
5
4
  const WebformActions = props => {
6
5
  const {
7
6
  entity,
@@ -17,5 +16,4 @@ const WebformActions = props => {
17
16
  type: "submit"
18
17
  }, entity.get('#submit__label')));
19
18
  };
20
-
21
19
  export default WebformActions;
@@ -1,10 +1,8 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
4
  import Checkbox from '../../Form/Checkbox';
6
5
  import withStates from '../withStates';
7
-
8
6
  const WebformCheckbox = props => {
9
7
  const {
10
8
  entity,
@@ -21,17 +19,13 @@ const WebformCheckbox = props => {
21
19
  const placeholder = entity.get('#placeholder');
22
20
  const requiredError = entity.get('#required_error');
23
21
  const key = entity.get('#webform_key');
24
-
25
22
  function validation(value) {
26
23
  let error;
27
-
28
24
  if (required && !value) {
29
25
  error = requiredError || t('Dit is een vereist veld.');
30
26
  }
31
-
32
27
  return error;
33
28
  }
34
-
35
29
  return /*#__PURE__*/React.createElement("div", {
36
30
  className: "WebformCheckbox"
37
31
  }, /*#__PURE__*/React.createElement(Checkbox, _extends({}, fieldProps, {
@@ -46,5 +40,4 @@ const WebformCheckbox = props => {
46
40
  value: props.values[key]
47
41
  })));
48
42
  };
49
-
50
43
  export default withStates(WebformCheckbox);
@@ -1,11 +1,9 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
3
  import { useTranslation } from 'react-i18next';
5
4
  import Immutable from 'immutable';
6
5
  import Checkboxes from '../../Form/Checkboxes';
7
6
  import withStates from '../withStates';
8
-
9
7
  const WebformCheckboxes = props => {
10
8
  const {
11
9
  entity,
@@ -26,21 +24,16 @@ const WebformCheckboxes = props => {
26
24
  const otherLabel = entity.get('#other__option_label');
27
25
  const otherPlaceholder = entity.get('#other__placeholder');
28
26
  let options = entity.get('#options', Immutable.Map());
29
-
30
27
  if (showOther) {
31
28
  options = options.set('__other__', 'Anders');
32
29
  }
33
-
34
30
  function validation(value) {
35
31
  let error;
36
-
37
32
  if (required && !value) {
38
33
  error = requiredError || t('Dit is een vereist veld.');
39
34
  }
40
-
41
35
  return error;
42
36
  }
43
-
44
37
  return /*#__PURE__*/React.createElement("div", {
45
38
  className: "WebformCheckboxes"
46
39
  }, /*#__PURE__*/React.createElement(Checkboxes, _extends({}, fieldProps, {
@@ -58,5 +51,4 @@ const WebformCheckboxes = props => {
58
51
  otherPlaceholder: otherPlaceholder
59
52
  })));
60
53
  };
61
-
62
54
  export default withStates(WebformCheckboxes);
@@ -1,25 +1,24 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
2
  import React from 'react';
4
-
5
3
  const WebformContainer = props => {
6
4
  const {
7
5
  entity,
8
6
  WebformMapper
9
- } = props; // Remove all non-element children.
7
+ } = props;
10
8
 
9
+ // Remove all non-element children.
11
10
  let children = entity;
12
11
  children.keySeq().forEach(k => {
13
12
  if (k.indexOf('#') === 0) {
14
13
  children = children.delete(k);
15
14
  }
16
- }); // Recursively render children.
15
+ });
17
16
 
17
+ // Recursively render children.
18
18
  return /*#__PURE__*/React.createElement("div", {
19
19
  className: "WebformContainer"
20
20
  }, /*#__PURE__*/React.createElement(WebformMapper, _extends({}, props, {
21
21
  entities: children
22
22
  })));
23
23
  };
24
-
25
24
  export default WebformContainer;