@uncinc/uncinc-react-kitchen-sink 2.3.3 → 2.3.5

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 (118) hide show
  1. package/dist/Context/withMapping.js +1 -6
  2. package/dist/components/AbbreviationAnnotation/index.js +47 -0
  3. package/dist/components/AbbreviationAnnotation/stories.js +23 -0
  4. package/dist/components/AbbreviationAnnotation/stories.scss +39 -0
  5. package/dist/components/AbbreviationAnnotation/style.scss +33 -0
  6. package/dist/components/Accordion/AccordionItem/index.js +0 -5
  7. package/dist/components/Accordion/AccordionItemVariant/index.js +0 -5
  8. package/dist/components/Accordion/index.js +0 -2
  9. package/dist/components/ApiAutocomplete/index.js +6 -12
  10. package/dist/components/Button/index.js +4 -10
  11. package/dist/components/Cookie/Checkbox/index.js +0 -2
  12. package/dist/components/Cookie/index.js +39 -34
  13. package/dist/components/FontSizeSwitcher/index.js +2 -8
  14. package/dist/components/Form/Checkbox/index.js +1 -4
  15. package/dist/components/Form/Checkbox/stories.js +0 -2
  16. package/dist/components/Form/Checkboxes/index.js +1 -7
  17. package/dist/components/Form/Checkboxes/index.test.js +8 -4
  18. package/dist/components/Form/Checkboxes/stories.js +1 -4
  19. package/dist/components/Form/Date/index.js +1 -4
  20. package/dist/components/Form/Date/stories.js +0 -2
  21. package/dist/components/Form/DatePicker/index.js +0 -2
  22. package/dist/components/Form/DatePicker/stories.js +0 -2
  23. package/dist/components/Form/DateSelect/index.js +110 -85
  24. package/dist/components/Form/DateSelect/stories.js +24 -15
  25. package/dist/components/Form/DateSelect/style.scss +10 -4
  26. package/dist/components/Form/Email/index.js +1 -4
  27. package/dist/components/Form/Email/stories.js +0 -2
  28. package/dist/components/Form/FormikWrapper/index.js +9 -15
  29. package/dist/components/Form/GenericFormElement/index.js +0 -2
  30. package/dist/components/Form/Number/index.js +12 -13
  31. package/dist/components/Form/Number/stories.js +0 -2
  32. package/dist/components/Form/RadioButtons/index.js +1 -7
  33. package/dist/components/Form/RadioButtons/index.test.js +8 -4
  34. package/dist/components/Form/RadioButtons/stories.js +1 -4
  35. package/dist/components/Form/SearchField/index.js +0 -2
  36. package/dist/components/Form/Select/Input/index.js +6 -14
  37. package/dist/components/Form/Select/index.js +1 -4
  38. package/dist/components/Form/Select/stories.js +0 -4
  39. package/dist/components/Form/TextField/index.js +0 -6
  40. package/dist/components/Form/TextField/index.test.js +8 -4
  41. package/dist/components/Form/TextField/stories.js +1 -4
  42. package/dist/components/Form/Textarea/index.js +0 -2
  43. package/dist/components/Form/Textarea/stories.js +0 -2
  44. package/dist/components/Hamburger/index.js +0 -2
  45. package/dist/components/Header/index.js +4 -9
  46. package/dist/components/Image/Background/index.js +1 -7
  47. package/dist/components/Image/LazyLoadWrapper/index.js +0 -12
  48. package/dist/components/Image/Picture/index.js +4 -19
  49. package/dist/components/Image/index.js +0 -4
  50. package/dist/components/InlineMenu/index.js +0 -9
  51. package/dist/components/Layout/Container/index.js +1 -4
  52. package/dist/components/Layout/Container/stories.js +0 -3
  53. package/dist/components/Layout/QuickLayout/Auto/index.js +0 -2
  54. package/dist/components/Layout/QuickLayout/Center/index.js +0 -2
  55. package/dist/components/Layout/QuickLayout/Clamp/index.js +0 -2
  56. package/dist/components/Layout/QuickLayout/Sidebar/index.js +0 -2
  57. package/dist/components/Layout/QuickLayout/SpaceBetween/index.js +0 -2
  58. package/dist/components/Layout/QuickLayout/Stack/index.js +1 -4
  59. package/dist/components/Layout/QuickLayout/Wrap/index.js +0 -2
  60. package/dist/components/Layout/QuickLayout/index.js +0 -9
  61. package/dist/components/Lottie/LottieAnimation/index.js +12 -17
  62. package/dist/components/Lottie/LottieAnimationWithMousePosition.js +8 -9
  63. package/dist/components/Lottie/index.js +3 -3
  64. package/dist/components/Lottie/stories.js +10 -5
  65. package/dist/components/MagicLine/index.js +0 -14
  66. package/dist/components/MagicLine/stories.js +0 -2
  67. package/dist/components/NavigationScroll/index.js +2 -12
  68. package/dist/components/Pagination/index.js +0 -7
  69. package/dist/components/SearchKit/Facets/ChipFacet/index.js +0 -2
  70. package/dist/components/SearchKit/Facets/HierarchicalFilterFacet/index.js +0 -2
  71. package/dist/components/SearchKit/Facets/HierarchicalMenuFacet/index.js +0 -2
  72. package/dist/components/SearchKit/Facets/SelectFacet/index.js +0 -6
  73. package/dist/components/SearchKit/Query/index.js +3 -6
  74. package/dist/components/SearchKit/SearchFacets/index.js +0 -7
  75. package/dist/components/SearchKit/SearchField/index.js +0 -9
  76. package/dist/components/SearchKit/SearchLoadMore/index.js +0 -7
  77. package/dist/components/SearchKit/SearchPage/index.js +3 -9
  78. package/dist/components/SearchKit/SearchPagination/index.js +0 -5
  79. package/dist/components/SearchKit/SearchReset/index.js +0 -2
  80. package/dist/components/SearchKit/SearchResults/index.js +9 -16
  81. package/dist/components/SearchKit/SearchSelectedFilters/index.js +0 -4
  82. package/dist/components/SearchKit/SearchSorting/index.js +2 -4
  83. package/dist/components/SearchKit/index.js +0 -3
  84. package/dist/components/SearchKit/stories.js +2 -7
  85. package/dist/components/Share/index.js +0 -3
  86. package/dist/components/Sliders/SliderRelated/index.js +1 -6
  87. package/dist/components/Sliders/SliderRelated/stories.js +1 -4
  88. package/dist/components/Webform/WebformActions/index.js +0 -2
  89. package/dist/components/Webform/WebformCheckbox/index.js +1 -8
  90. package/dist/components/Webform/WebformCheckboxes/index.js +1 -9
  91. package/dist/components/Webform/WebformContainer/index.js +5 -6
  92. package/dist/components/Webform/WebformDate/index.js +12 -18
  93. package/dist/components/Webform/WebformMapper/index.js +1 -18
  94. package/dist/components/Webform/WebformNumber/index.js +1 -4
  95. package/dist/components/Webform/WebformRadioButtons/index.js +1 -9
  96. package/dist/components/Webform/WebformSelect/index.js +1 -9
  97. package/dist/components/Webform/WebformTextField/index.js +1 -8
  98. package/dist/components/Webform/WebformTextarea/index.js +1 -8
  99. package/dist/components/Webform/WebformWizardPage/index.js +6 -8
  100. package/dist/components/Webform/index.js +1 -8
  101. package/dist/components/Webform/withStates.js +6 -19
  102. package/dist/components/WysiwygField/index.js +1 -8
  103. package/dist/components/WysiwygField/stories.js +4 -14
  104. package/dist/config/constants.js +3 -4
  105. package/dist/config/i18next/index.js +23 -0
  106. package/dist/config/i18next/locales/en.json +22 -0
  107. package/dist/config/i18next/locales/nl.json +22 -0
  108. package/dist/helpers/gtm.js +11 -15
  109. package/dist/helpers/link.js +0 -4
  110. package/dist/helpers/useValueForCurrentViewPort.js +20 -14
  111. package/dist/hooks/useOnScreen.js +2 -2
  112. package/dist/hooks/usePrevious.js +3 -2
  113. package/dist/hooks/useScrollPosition.js +0 -3
  114. package/dist/hooks/useWindowDimensions.js +0 -3
  115. package/dist/index.js +2 -1
  116. package/dist/styles/assets/_base.scss +0 -1
  117. package/package.json +14 -5
  118. package/dist/pages/api/graphql.js +0 -25
@@ -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;
@@ -1,7 +1,6 @@
1
1
  import React, { useState, useCallback, useEffect } from 'react';
2
2
  import moment from 'moment';
3
3
  import SelectInput from '../../Form/Select/Input';
4
-
5
4
  const WebformDate = ({
6
5
  entity,
7
6
  setFieldValue,
@@ -22,28 +21,27 @@ const WebformDate = ({
22
21
  const dateMax = parseInt(entity.get('#date_date_max')) || 2070;
23
22
  const placeholderDay = 'Dag';
24
23
  const placeholderMonth = 'Maand';
25
- const placeholderYear = 'Jaar'; // Render all day options possible.
24
+ const placeholderYear = 'Jaar';
26
25
 
26
+ // Render all day options possible.
27
27
  const renderDayOptions = useCallback(placeholder => {
28
28
  const options = [];
29
-
30
29
  if (placeholder) {
31
30
  options.push({
32
31
  value: placeholder,
33
32
  label: placeholder
34
33
  });
35
34
  }
36
-
37
35
  for (let index = 1; index <= 31; index++) {
38
36
  options.push({
39
37
  value: index,
40
38
  label: index
41
39
  });
42
40
  }
43
-
44
41
  return options;
45
- }, []); // Render all options possible for months.
42
+ }, []);
46
43
 
44
+ // Render all options possible for months.
47
45
  const renderMonthOptions = useCallback(() => {
48
46
  const months = ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'October', 'November', 'December'];
49
47
  return months.map((e, i) => {
@@ -52,19 +50,18 @@ const WebformDate = ({
52
50
  label: e
53
51
  };
54
52
  });
55
- }, []); // Render all options for possible years from
56
- // the DateMin and DateMax variables.
53
+ }, []);
57
54
 
55
+ // Render all options for possible years from
56
+ // the DateMin and DateMax variables.
58
57
  const renderYearOptions = useCallback(() => {
59
58
  const options = [];
60
-
61
59
  for (let index = dateMin; index <= dateMax; index++) {
62
60
  options.push({
63
61
  value: index,
64
62
  label: index
65
63
  });
66
64
  }
67
-
68
65
  return options;
69
66
  }, [dateMax, dateMin]);
70
67
  useEffect(() => {
@@ -73,28 +70,26 @@ const WebformDate = ({
73
70
  errors[key] = requiredError || 'Dit is geen geldige geboortedatum.';
74
71
  return;
75
72
  }
76
-
77
73
  if (day === placeholderDay || month === placeholderMonth || year === placeholderYear) {
78
74
  errors[key] = requiredError || 'Dit is geen geldige geboortedatum.';
79
75
  return;
80
- } // Transform state items to date object.
81
-
76
+ }
82
77
 
78
+ // Transform state items to date object.
83
79
  const birthdate = moment(`${year}-${month}-${day}`, 'YYYY-MM-DD');
84
80
  setFieldValue(key, birthdate.format('YYYY-MM-DD'));
85
- }, [day, month, year, key, setFieldValue, errors, requiredError]); // If birthday is invalid, like 2000/02/30,
86
- // set an error.
81
+ }, [day, month, year, key, setFieldValue, errors, requiredError]);
87
82
 
83
+ // If birthday is invalid, like 2000/02/30,
84
+ // set an error.
88
85
  if (moment(values[key])._isValid === false || day === placeholderDay || month === placeholderMonth || year === placeholderYear) {
89
86
  errors[key] = requiredError || 'Dit is geen geldige geboortedatum.';
90
87
  } else {
91
88
  delete errors[key];
92
89
  }
93
-
94
90
  if (!day || !month || !year) {
95
91
  errors[key] = requiredError || 'Dit is een vereist veld.';
96
92
  }
97
-
98
93
  return /*#__PURE__*/React.createElement("div", {
99
94
  className: "WebformDate",
100
95
  onClick: () => {
@@ -132,5 +127,4 @@ const WebformDate = ({
132
127
  className: "WebformDate_error WebformComponent--error"
133
128
  }, errors[key]) : null);
134
129
  };
135
-
136
130
  export default WebformDate;
@@ -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 Immutable from 'immutable';
5
4
  import WysiwygField from '../../WysiwygField';
@@ -14,7 +13,6 @@ import WebformActions from '../WebformActions';
14
13
  import WebformContainer from '../WebformContainer';
15
14
  import WebformNumber from '../WebformNumber';
16
15
  import WebformWizardPage from '../WebformWizardPage';
17
-
18
16
  const WebformMapper = props => {
19
17
  const {
20
18
  entities,
@@ -23,7 +21,6 @@ const WebformMapper = props => {
23
21
  return entities.entrySeq().map(([key, entity]) => {
24
22
  const mappedEntity = new Immutable.OrderedMap(entity);
25
23
  const type = mappedEntity.get('#type');
26
-
27
24
  if (overriddenComponents && overriddenComponents[type]) {
28
25
  const OverriddenComponent = overriddenComponents[type];
29
26
  return /*#__PURE__*/React.createElement(OverriddenComponent, _extends({}, props, {
@@ -31,7 +28,6 @@ const WebformMapper = props => {
31
28
  entity: mappedEntity
32
29
  }));
33
30
  }
34
-
35
31
  switch (type) {
36
32
  case 'textfield':
37
33
  {
@@ -40,7 +36,6 @@ const WebformMapper = props => {
40
36
  entity: mappedEntity
41
37
  }));
42
38
  }
43
-
44
39
  case 'textarea':
45
40
  {
46
41
  return /*#__PURE__*/React.createElement(WebformTextarea, _extends({}, props, {
@@ -48,7 +43,6 @@ const WebformMapper = props => {
48
43
  entity: mappedEntity
49
44
  }));
50
45
  }
51
-
52
46
  case 'checkbox':
53
47
  {
54
48
  return /*#__PURE__*/React.createElement(WebformCheckbox, _extends({}, props, {
@@ -56,7 +50,6 @@ const WebformMapper = props => {
56
50
  entity: mappedEntity
57
51
  }));
58
52
  }
59
-
60
53
  case 'radios':
61
54
  {
62
55
  return /*#__PURE__*/React.createElement(WebformRadioButtons, _extends({}, props, {
@@ -64,7 +57,6 @@ const WebformMapper = props => {
64
57
  entity: mappedEntity
65
58
  }));
66
59
  }
67
-
68
60
  case 'checkboxes':
69
61
  {
70
62
  return /*#__PURE__*/React.createElement(WebformCheckboxes, _extends({}, props, {
@@ -72,7 +64,6 @@ const WebformMapper = props => {
72
64
  entity: mappedEntity
73
65
  }));
74
66
  }
75
-
76
67
  case 'select':
77
68
  {
78
69
  return /*#__PURE__*/React.createElement(WebformSelect, _extends({}, props, {
@@ -80,7 +71,6 @@ const WebformMapper = props => {
80
71
  entity: mappedEntity
81
72
  }));
82
73
  }
83
-
84
74
  case 'date':
85
75
  {
86
76
  return /*#__PURE__*/React.createElement(WebformDate, _extends({}, props, {
@@ -88,7 +78,6 @@ const WebformMapper = props => {
88
78
  entity: mappedEntity
89
79
  }));
90
80
  }
91
-
92
81
  case 'webform_actions':
93
82
  {
94
83
  return /*#__PURE__*/React.createElement(WebformActions, _extends({}, props, {
@@ -96,7 +85,6 @@ const WebformMapper = props => {
96
85
  entity: mappedEntity
97
86
  }));
98
87
  }
99
-
100
88
  case 'container':
101
89
  {
102
90
  return /*#__PURE__*/React.createElement(WebformContainer, _extends({}, props, {
@@ -105,7 +93,6 @@ const WebformMapper = props => {
105
93
  WebformMapper: WebformMapper
106
94
  }));
107
95
  }
108
-
109
96
  case 'number':
110
97
  {
111
98
  return /*#__PURE__*/React.createElement(WebformNumber, _extends({}, props, {
@@ -113,7 +100,6 @@ const WebformMapper = props => {
113
100
  entity: mappedEntity
114
101
  }));
115
102
  }
116
-
117
103
  case 'wizard_page':
118
104
  case 'webform_wizard_page':
119
105
  {
@@ -123,7 +109,6 @@ const WebformMapper = props => {
123
109
  WebformMapper: WebformMapper
124
110
  }));
125
111
  }
126
-
127
112
  case 'processed_text':
128
113
  {
129
114
  return /*#__PURE__*/React.createElement(WysiwygField, {
@@ -133,7 +118,6 @@ const WebformMapper = props => {
133
118
  html: mappedEntity.get('#text', '')
134
119
  });
135
120
  }
136
-
137
121
  default:
138
122
  {
139
123
  return /*#__PURE__*/React.createElement("pre", {
@@ -143,5 +127,4 @@ const WebformMapper = props => {
143
127
  }
144
128
  });
145
129
  };
146
-
147
130
  export default WebformMapper;
@@ -1,9 +1,7 @@
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 FormikTextField from '../../Form/Number';
5
4
  import withStates from '../withStates';
6
-
7
5
  const WebformNumber = props => {
8
6
  const {
9
7
  entity,
@@ -38,5 +36,4 @@ const WebformNumber = props => {
38
36
  value: props.values[key]
39
37
  })));
40
38
  };
41
-
42
39
  export default withStates(WebformNumber);
@@ -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 RadioButtons from '../../Form/RadioButtons';
7
6
  import withStates from '../withStates';
8
-
9
7
  const WebformRadioButtons = props => {
10
8
  const {
11
9
  entity,
@@ -26,21 +24,16 @@ const WebformRadioButtons = 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: "WebformRadioButtons"
46
39
  }, /*#__PURE__*/React.createElement(RadioButtons, _extends({}, fieldProps, {
@@ -58,5 +51,4 @@ const WebformRadioButtons = props => {
58
51
  otherPlaceholder: otherPlaceholder
59
52
  })));
60
53
  };
61
-
62
54
  export default withStates(WebformRadioButtons);
@@ -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 Select from '../../Form/Select';
7
6
  import withStates from '../withStates';
8
-
9
7
  const WebformSelect = props => {
10
8
  const {
11
9
  entity,
@@ -26,21 +24,16 @@ const WebformSelect = 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: "WebformSelect"
46
39
  }, /*#__PURE__*/React.createElement(Select, _extends({}, fieldProps, {
@@ -58,5 +51,4 @@ const WebformSelect = props => {
58
51
  otherPlaceholder: otherPlaceholder
59
52
  })));
60
53
  };
61
-
62
54
  export default withStates(WebformSelect);
@@ -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 FormikTextField from '../../Form/TextField';
6
5
  import withStates from '../withStates';
7
-
8
6
  const WebformTextField = props => {
9
7
  const {
10
8
  entity,
@@ -21,17 +19,13 @@ const WebformTextField = props => {
21
19
  const requiredError = entity.get('#required_error');
22
20
  const key = entity.get('#webform_key');
23
21
  const type = props.type || "text";
24
-
25
22
  const validation = props.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: "WebformTextField"
37
31
  }, /*#__PURE__*/React.createElement(FormikTextField, _extends({}, fieldProps, {
@@ -47,5 +41,4 @@ const WebformTextField = props => {
47
41
  value: props.values[key]
48
42
  })));
49
43
  };
50
-
51
44
  export default withStates(WebformTextField);
@@ -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 FormikTextarea from '../../Form/Textarea';
6
5
  import withStates from '../withStates';
7
-
8
6
  const WebformTextarea = props => {
9
7
  const {
10
8
  entity,
@@ -21,17 +19,13 @@ const WebformTextarea = 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: "WebformTextarea"
37
31
  }, /*#__PURE__*/React.createElement(FormikTextarea, _extends({}, fieldProps, {
@@ -46,5 +40,4 @@ const WebformTextarea = props => {
46
40
  value: props.values[key]
47
41
  })));
48
42
  };
49
-
50
43
  export default withStates(WebformTextarea);
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import Immutable from 'immutable';
4
4
  import Button from '../../Button';
5
- import WebformContainer from '../WebformContainer'; // import WebformStepCounter from '../WebformStepCounter';
5
+ import WebformContainer from '../WebformContainer';
6
+ // import WebformStepCounter from '../WebformStepCounter';
6
7
 
7
8
  const WebformWizardPage = props => {
8
9
  const {
@@ -19,12 +20,12 @@ const WebformWizardPage = props => {
19
20
  const classes = classnames('WebformWizardPage', {
20
21
  hidden: currentPage !== entity.get('#webform_key')
21
22
  });
22
-
23
23
  const collectInitialValuesFlat = entity => {
24
24
  let output = new Immutable.List();
25
25
  const mappedEntity = Immutable.fromJS(entity);
26
- output = output.push(mappedEntity.get('#webform_key')); // Collect child items.
26
+ output = output.push(mappedEntity.get('#webform_key'));
27
27
 
28
+ // Collect child items.
28
29
  let children = Immutable.fromJS(entity);
29
30
  children.keySeq().forEach(k => {
30
31
  if (k.indexOf('#') === 0) {
@@ -37,15 +38,15 @@ const WebformWizardPage = props => {
37
38
  });
38
39
  return output;
39
40
  };
40
-
41
41
  const onNextButton = () => {
42
42
  const {
43
43
  setFieldTouched,
44
44
  validateForm,
45
45
  entity,
46
46
  onNextPage
47
- } = props; // Determine all children in this page.
47
+ } = props;
48
48
 
49
+ // Determine all children in this page.
49
50
  const fieldsInThisPage = collectInitialValuesFlat(entity);
50
51
  validateForm().then(validation => {
51
52
  let validated = true;
@@ -56,13 +57,11 @@ const WebformWizardPage = props => {
56
57
  setFieldTouched(invalidField);
57
58
  }
58
59
  });
59
-
60
60
  if (validated) {
61
61
  onNextPage();
62
62
  }
63
63
  });
64
64
  };
65
-
66
65
  return /*#__PURE__*/React.createElement("div", {
67
66
  className: classes
68
67
  }, /*#__PURE__*/React.createElement("h2", {
@@ -81,5 +80,4 @@ const WebformWizardPage = props => {
81
80
  onClick: onNextButton
82
81
  }, labelNext)));
83
82
  };
84
-
85
83
  export default WebformWizardPage;