@dhis2/ui-forms 9.11.0 → 9.11.1-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/build/cjs/CheckboxFieldFF/{CheckboxFieldFF.stories.e2e.js → CheckboxFieldFF.e2e.stories.js} +22 -15
  2. package/build/cjs/CheckboxFieldFF/CheckboxFieldFF.js +2 -12
  3. package/build/cjs/CheckboxFieldFF/{CheckboxFieldFF.stories.js → CheckboxFieldFF.prod.stories.js} +29 -24
  4. package/build/cjs/CheckboxFieldFF/features/can_toggle_a_boolean/index.js +0 -1
  5. package/build/cjs/CheckboxFieldFF/features/can_toggle_a_value/index.js +0 -1
  6. package/build/cjs/CheckboxFieldFF/features/common/index.js +0 -1
  7. package/build/cjs/CheckboxFieldFF/features/displays_error/index.js +0 -2
  8. package/build/cjs/FieldGroupFF/FieldGroupFF.js +1 -10
  9. package/build/cjs/FieldGroupFF/{FieldGroupFF.stories.js → FieldGroupFF.prod.stories.js} +11 -12
  10. package/build/cjs/FileInputFieldFF/{FileInputFieldFF.stories.e2e.js → FileInputFieldFF.e2e.stories.js} +45 -56
  11. package/build/cjs/FileInputFieldFF/FileInputFieldFF.js +2 -19
  12. package/build/cjs/FileInputFieldFF/{FileInputFieldFF.stories.js → FileInputFieldFF.prod.stories.js} +29 -22
  13. package/build/cjs/FileInputFieldFF/features/accepts_file/index.js +0 -1
  14. package/build/cjs/FileInputFieldFF/features/common/index.js +0 -1
  15. package/build/cjs/FileInputFieldFF/features/displays_error/index.js +0 -1
  16. package/build/cjs/InputFieldFF/InputFieldFF.e2e.stories.js +30 -0
  17. package/build/cjs/InputFieldFF/InputFieldFF.js +2 -12
  18. package/build/cjs/InputFieldFF/{InputFieldFF.stories.js → InputFieldFF.prod.stories.js} +29 -22
  19. package/build/cjs/InputFieldFF/features/can_set_a_value/index.js +0 -1
  20. package/build/cjs/InputFieldFF/features/displays_error/index.js +0 -2
  21. package/build/cjs/MultiSelectFieldFF/{MultiSelectFieldFF.stories.e2e.js → MultiSelectFieldFF.e2e.stories.js} +15 -17
  22. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.js +3 -15
  23. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.prod.stories.js +107 -0
  24. package/build/cjs/MultiSelectFieldFF/features/can_set_a_value/index.js +0 -1
  25. package/build/cjs/MultiSelectFieldFF/features/common/index.js +1 -2
  26. package/build/cjs/MultiSelectFieldFF/features/displays_error/index.js +0 -2
  27. package/build/cjs/RadioFieldFF/RadioFieldFF.e2e.stories.js +45 -0
  28. package/build/cjs/RadioFieldFF/RadioFieldFF.js +2 -12
  29. package/build/cjs/RadioFieldFF/{RadioFieldFF.stories.js → RadioFieldFF.prod.stories.js} +29 -16
  30. package/build/cjs/RadioFieldFF/features/can_set_a_value/index.js +0 -1
  31. package/build/cjs/RadioFieldFF/features/common/index.js +0 -1
  32. package/build/cjs/RadioFieldFF/features/displays_error/index.js +0 -2
  33. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.e2e.stories.js +39 -0
  34. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.js +2 -12
  35. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.prod.stories.js +106 -0
  36. package/build/cjs/SingleSelectFieldFF/features/can_set_a_value/index.js +0 -1
  37. package/build/cjs/SingleSelectFieldFF/features/common/index.js +0 -1
  38. package/build/cjs/SingleSelectFieldFF/features/displays_error/index.js +0 -2
  39. package/build/cjs/SwitchFieldFF/SwitchFieldFF.e2e.stories.js +56 -0
  40. package/build/cjs/SwitchFieldFF/SwitchFieldFF.js +2 -12
  41. package/build/cjs/SwitchFieldFF/{SwitchFieldFF.stories.js → SwitchFieldFF.prod.stories.js} +29 -24
  42. package/build/cjs/SwitchFieldFF/features/can_toggle_a_boolean/index.js +0 -1
  43. package/build/cjs/SwitchFieldFF/features/can_toggle_a_value/index.js +0 -1
  44. package/build/cjs/SwitchFieldFF/features/common/index.js +0 -1
  45. package/build/cjs/SwitchFieldFF/features/displays_error/index.js +0 -2
  46. package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.e2e.stories.js +30 -0
  47. package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.js +2 -12
  48. package/build/cjs/TextAreaFieldFF/{TextAreaFieldFF.stories.js → TextAreaFieldFF.prod.stories.js} +29 -24
  49. package/build/cjs/TextAreaFieldFF/features/can_set_a_value/index.js +0 -1
  50. package/build/cjs/TextAreaFieldFF/features/displays_error/index.js +0 -2
  51. package/build/cjs/__tests__/__snapshots__/index.test.js.snap +3 -0
  52. package/build/cjs/__tests__/index.test.js +1 -1
  53. package/build/cjs/formDecorator.js +6 -21
  54. package/build/cjs/index.js +2 -21
  55. package/build/cjs/locales/index.js +3 -75
  56. package/build/cjs/shared/helpers/createBlurHandler.js +0 -3
  57. package/build/cjs/shared/helpers/createChangeHandler.js +0 -2
  58. package/build/cjs/shared/helpers/createFocusHandler.js +0 -3
  59. package/build/cjs/shared/helpers/createSelectChangeHandler.js +0 -2
  60. package/build/cjs/shared/helpers/createToggleChangeHandler.js +0 -3
  61. package/build/cjs/shared/helpers/getValidationText.js +0 -6
  62. package/build/cjs/shared/helpers/hasError.js +0 -2
  63. package/build/cjs/shared/helpers/isLoading.js +0 -2
  64. package/build/cjs/shared/helpers/isValid.js +0 -2
  65. package/build/cjs/shared/helpers.js +0 -9
  66. package/build/cjs/shared/propTypes.js +7 -20
  67. package/build/cjs/transformers/arrayWithIdObjects.js +2 -6
  68. package/build/cjs/transformers/index.js +0 -1
  69. package/build/cjs/validators/__tests__/alphaNumeric.test.js +0 -2
  70. package/build/cjs/validators/__tests__/boolean.test.js +0 -2
  71. package/build/cjs/validators/__tests__/composeValidators.test.js +0 -3
  72. package/build/cjs/validators/__tests__/createCharacterLengthRange.test.js +6 -6
  73. package/build/cjs/validators/__tests__/createEqualTo.test.js +0 -3
  74. package/build/cjs/validators/__tests__/createMaxCharacterLength.test.js +1 -2
  75. package/build/cjs/validators/__tests__/createMaxNumber.test.js +1 -2
  76. package/build/cjs/validators/__tests__/createMinCharacterLength.test.js +1 -2
  77. package/build/cjs/validators/__tests__/createMinNumber.test.js +1 -2
  78. package/build/cjs/validators/__tests__/createNumberRange.test.js +0 -3
  79. package/build/cjs/validators/__tests__/createPattern.test.js +1 -3
  80. package/build/cjs/validators/__tests__/dhis2Password.test.js +0 -2
  81. package/build/cjs/validators/__tests__/dhis2Username.test.js +0 -2
  82. package/build/cjs/validators/__tests__/email.test.js +7 -6
  83. package/build/cjs/validators/__tests__/hasValue.test.js +0 -2
  84. package/build/cjs/validators/__tests__/integer.test.js +0 -2
  85. package/build/cjs/validators/__tests__/internationalPhoneNumber.test.js +6 -5
  86. package/build/cjs/validators/__tests__/number.test.js +0 -2
  87. package/build/cjs/validators/__tests__/string.test.js +0 -2
  88. package/build/cjs/validators/__tests__/url.test.js +1 -2
  89. package/build/cjs/validators/alphaNumeric.js +2 -11
  90. package/build/cjs/validators/boolean.js +2 -10
  91. package/build/cjs/validators/composeValidators.js +0 -4
  92. package/build/cjs/validators/createCharacterLengthRange.js +1 -8
  93. package/build/cjs/validators/createEqualTo.js +1 -8
  94. package/build/cjs/validators/createMaxCharacterLength.js +1 -6
  95. package/build/cjs/validators/createMaxNumber.js +1 -6
  96. package/build/cjs/validators/createMinCharacterLength.js +1 -6
  97. package/build/cjs/validators/createMinNumber.js +1 -6
  98. package/build/cjs/validators/createNumberRange.js +1 -8
  99. package/build/cjs/validators/createPattern.js +2 -10
  100. package/build/cjs/validators/dhis2Password.js +6 -28
  101. package/build/cjs/validators/dhis2Username.js +2 -11
  102. package/build/cjs/validators/email.js +3 -11
  103. package/build/cjs/validators/hasValue.js +2 -10
  104. package/build/cjs/validators/helpers/index.js +1 -16
  105. package/build/cjs/validators/index.js +0 -20
  106. package/build/cjs/validators/integer.js +3 -10
  107. package/build/cjs/validators/internationalPhoneNumber.js +8 -14
  108. package/build/cjs/validators/number.js +2 -10
  109. package/build/cjs/validators/string.js +2 -10
  110. package/build/cjs/validators/test-helpers/index.js +1 -6
  111. package/build/cjs/validators/url.js +2 -11
  112. package/build/es/CheckboxFieldFF/{CheckboxFieldFF.stories.e2e.js → CheckboxFieldFF.e2e.stories.js} +14 -7
  113. package/build/es/CheckboxFieldFF/CheckboxFieldFF.js +1 -3
  114. package/build/es/CheckboxFieldFF/{CheckboxFieldFF.stories.js → CheckboxFieldFF.prod.stories.js} +29 -3
  115. package/build/es/FieldGroupFF/FieldGroupFF.js +0 -2
  116. package/build/es/FieldGroupFF/{FieldGroupFF.stories.js → FieldGroupFF.prod.stories.js} +11 -1
  117. package/build/es/FileInputFieldFF/{FileInputFieldFF.stories.e2e.js → FileInputFieldFF.e2e.stories.js} +14 -16
  118. package/build/es/FileInputFieldFF/FileInputFieldFF.js +1 -8
  119. package/build/es/FileInputFieldFF/{FileInputFieldFF.stories.js → FileInputFieldFF.prod.stories.js} +29 -3
  120. package/build/es/InputFieldFF/{InputFieldFF.stories.e2e.js → InputFieldFF.e2e.stories.js} +8 -4
  121. package/build/es/InputFieldFF/InputFieldFF.js +1 -3
  122. package/build/es/InputFieldFF/{InputFieldFF.stories.js → InputFieldFF.prod.stories.js} +29 -3
  123. package/build/es/MultiSelectFieldFF/{MultiSelectFieldFF.stories.e2e.js → MultiSelectFieldFF.e2e.stories.js} +7 -7
  124. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.js +2 -6
  125. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.prod.stories.js +98 -0
  126. package/build/es/MultiSelectFieldFF/features/common/index.js +1 -1
  127. package/build/es/RadioFieldFF/{RadioFieldFF.stories.e2e.js → RadioFieldFF.e2e.stories.js} +6 -3
  128. package/build/es/RadioFieldFF/RadioFieldFF.js +1 -3
  129. package/build/es/RadioFieldFF/{RadioFieldFF.stories.js → RadioFieldFF.prod.stories.js} +29 -3
  130. package/build/es/SingleSelectFieldFF/{SingleSelectFieldFF.stories.e2e.js → SingleSelectFieldFF.e2e.stories.js} +10 -6
  131. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.js +1 -3
  132. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.prod.stories.js +97 -0
  133. package/build/es/SwitchFieldFF/{SwitchFieldFF.stories.e2e.js → SwitchFieldFF.e2e.stories.js} +14 -7
  134. package/build/es/SwitchFieldFF/SwitchFieldFF.js +1 -3
  135. package/build/es/SwitchFieldFF/{SwitchFieldFF.stories.js → SwitchFieldFF.prod.stories.js} +29 -3
  136. package/build/es/TextAreaFieldFF/{TextAreaFieldFF.stories.e2e.js → TextAreaFieldFF.e2e.stories.js} +8 -4
  137. package/build/es/TextAreaFieldFF/TextAreaFieldFF.js +1 -3
  138. package/build/es/TextAreaFieldFF/{TextAreaFieldFF.stories.js → TextAreaFieldFF.prod.stories.js} +29 -3
  139. package/build/es/__tests__/__snapshots__/index.test.js.snap +3 -0
  140. package/build/es/__tests__/index.test.js +1 -0
  141. package/build/es/formDecorator.js +5 -12
  142. package/build/es/index.js +2 -2
  143. package/build/es/shared/helpers/createBlurHandler.js +0 -2
  144. package/build/es/shared/helpers/createChangeHandler.js +0 -2
  145. package/build/es/shared/helpers/createFocusHandler.js +0 -2
  146. package/build/es/shared/helpers/createSelectChangeHandler.js +0 -1
  147. package/build/es/shared/helpers/createToggleChangeHandler.js +0 -2
  148. package/build/es/shared/helpers/getValidationText.js +0 -5
  149. package/build/es/shared/helpers/hasError.js +0 -1
  150. package/build/es/shared/helpers/isLoading.js +0 -1
  151. package/build/es/shared/helpers/isValid.js +0 -1
  152. package/build/es/transformers/arrayWithIdObjects.js +0 -2
  153. package/build/es/validators/__tests__/createCharacterLengthRange.test.js +6 -3
  154. package/build/es/validators/__tests__/createMaxCharacterLength.test.js +1 -0
  155. package/build/es/validators/__tests__/createMaxNumber.test.js +1 -0
  156. package/build/es/validators/__tests__/createMinCharacterLength.test.js +1 -0
  157. package/build/es/validators/__tests__/createMinNumber.test.js +1 -0
  158. package/build/es/validators/__tests__/createPattern.test.js +1 -1
  159. package/build/es/validators/__tests__/email.test.js +7 -4
  160. package/build/es/validators/__tests__/internationalPhoneNumber.test.js +6 -3
  161. package/build/es/validators/__tests__/url.test.js +1 -0
  162. package/build/es/validators/alphaNumeric.js +0 -2
  163. package/build/es/validators/boolean.js +0 -2
  164. package/build/es/validators/composeValidators.js +0 -2
  165. package/build/es/validators/createCharacterLengthRange.js +0 -2
  166. package/build/es/validators/createEqualTo.js +0 -2
  167. package/build/es/validators/createMaxCharacterLength.js +0 -2
  168. package/build/es/validators/createMaxNumber.js +0 -2
  169. package/build/es/validators/createMinCharacterLength.js +0 -2
  170. package/build/es/validators/createMinNumber.js +0 -2
  171. package/build/es/validators/createNumberRange.js +0 -2
  172. package/build/es/validators/createPattern.js +0 -3
  173. package/build/es/validators/dhis2Password.js +3 -12
  174. package/build/es/validators/dhis2Username.js +0 -2
  175. package/build/es/validators/email.js +1 -2
  176. package/build/es/validators/hasValue.js +0 -2
  177. package/build/es/validators/integer.js +3 -4
  178. package/build/es/validators/internationalPhoneNumber.js +7 -7
  179. package/build/es/validators/number.js +0 -2
  180. package/build/es/validators/string.js +0 -2
  181. package/build/es/validators/test-helpers/index.js +1 -4
  182. package/build/es/validators/url.js +2 -3
  183. package/package.json +13 -13
  184. package/build/cjs/InputFieldFF/InputFieldFF.stories.e2e.js +0 -27
  185. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +0 -91
  186. package/build/cjs/RadioFieldFF/RadioFieldFF.stories.e2e.js +0 -45
  187. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.e2e.js +0 -37
  188. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +0 -90
  189. package/build/cjs/SwitchFieldFF/SwitchFieldFF.stories.e2e.js +0 -49
  190. package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.stories.e2e.js +0 -27
  191. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +0 -70
  192. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +0 -69
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
 
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.UncheckedWithValue = exports.Unchecked = exports.CheckedWithValue = exports.Checked = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
7
8
  var _reactFinalForm = require("react-final-form");
8
-
9
9
  var _formDecorator = require("../formDecorator.js");
10
-
11
10
  var _index = require("../validators/index.js");
12
-
13
11
  var _CheckboxFieldFF = require("./CheckboxFieldFF.js");
14
-
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
-
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
13
  // https://github.com/final-form/react-final-form-arrays/issues/111
18
14
  const initialValue = ['yes'];
19
- (0, _react.storiesOf)('Testing:Checkbox', module).addDecorator(_formDecorator.formDecorator).add('Unchecked', () => /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
15
+ var _default = exports.default = {
16
+ title: 'Testing:Checkbox',
17
+ decorators: [_formDecorator.formDecorator]
18
+ };
19
+ const Unchecked = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
20
20
  type: "checkbox",
21
21
  component: _CheckboxFieldFF.CheckboxFieldFF,
22
22
  className: "checkbox",
@@ -24,21 +24,27 @@ const initialValue = ['yes'];
24
24
  label: "Label text",
25
25
  validate: _index.hasValue,
26
26
  required: true
27
- })).add('Checked ', () => /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
27
+ });
28
+ exports.Unchecked = Unchecked;
29
+ const Checked = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
28
30
  type: "checkbox",
29
31
  component: _CheckboxFieldFF.CheckboxFieldFF,
30
32
  className: "checkbox",
31
33
  name: "checkbox",
32
34
  label: "Label text",
33
35
  initialValue: true
34
- })).add('Unchecked with value', () => /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
36
+ });
37
+ exports.Checked = Checked;
38
+ const UncheckedWithValue = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
35
39
  type: "checkbox",
36
40
  component: _CheckboxFieldFF.CheckboxFieldFF,
37
41
  className: "checkbox",
38
42
  name: "checkbox",
39
43
  label: "Label text",
40
44
  value: "yes"
41
- })).add('Checked with value', () => /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
45
+ });
46
+ exports.UncheckedWithValue = UncheckedWithValue;
47
+ const CheckedWithValue = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
42
48
  type: "checkbox",
43
49
  component: _CheckboxFieldFF.CheckboxFieldFF,
44
50
  className: "checkbox",
@@ -46,4 +52,5 @@ const initialValue = ['yes'];
46
52
  label: "Label text",
47
53
  value: "yes",
48
54
  initialValue: initialValue
49
- }));
55
+ });
56
+ exports.CheckedWithValue = CheckedWithValue;
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CheckboxFieldFF = void 0;
7
-
8
7
  var _checkbox = require("@dhis2-ui/checkbox");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  var _helpers = require("../shared/helpers.js");
15
-
16
11
  var _propTypes2 = require("../shared/propTypes.js");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- 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); }
21
-
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
22
14
  const CheckboxFieldFF = _ref => {
23
15
  let {
24
16
  error,
@@ -43,12 +35,10 @@ const CheckboxFieldFF = _ref => {
43
35
  onBlur: (0, _helpers.createBlurHandler)(input, onBlur)
44
36
  }));
45
37
  };
46
-
47
38
  exports.CheckboxFieldFF = CheckboxFieldFF;
48
39
  CheckboxFieldFF.propTypes = {
49
40
  /** Provided by Final Form `Field` */
50
41
  input: _propTypes2.inputPropType.isRequired,
51
-
52
42
  /** Provided by Final Form `Field` */
53
43
  meta: _propTypes2.metaPropType.isRequired,
54
44
  error: _propTypes.default.bool,
@@ -4,23 +4,39 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.ValueWhenChecked = exports.Statuses = exports.RequiredWithValidate = exports.HelpText = exports.Disabled = exports.Default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactFinalForm = require("react-final-form");
11
-
12
9
  var _formDecorator = require("../formDecorator.js");
13
-
14
10
  var _propTypes = require("../shared/propTypes.js");
15
-
16
11
  var _index = require("../validators/index.js");
17
-
18
12
  var _CheckboxFieldFF = require("./CheckboxFieldFF.js");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const description = `
15
+ The \`CheckboxFieldFF\` is a wrapper around a \`CheckboxField\` that enables it to work with Final Form, the preferred library for form validation and utilities in DHIS 2 apps.
16
+
17
+ #### Final Form
18
+
19
+ See how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).
20
+
21
+ Inside a Final Form \`<Form>\` component, these 'FF' UI components are intended to be used in the \`component\` prop of the [Final Form \`<Field>\` components](https://final-form.org/docs/react-final-form/api/Field) where they will receive some props from the Field, e.g. \`<Field component={CheckboxFieldFF} />\`. See the code samples below for examples.
22
+
23
+ #### Props
24
+
25
+ The props shown in the table below are generally provided to the \`CheckboxFieldFF\` wrapper by the Final Form \`Field\`.
26
+
27
+ Note that any props beyond the API of the \`Field\` component will be spread to the \`CheckboxFieldFF\`, which passes any extra props to the underlying \`CheckboxField\` using \`{...rest}\`.
28
+
29
+ Therefore, to add any props to the \`CheckboxFieldFF\` or \`CheckboxField\`, add those props to the parent Final Form \`Field\` component.
19
30
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+ Also see \`Checkbox\` and \`CheckboxField\` for notes about props and implementation.
21
32
 
22
- const description = "\nThe `CheckboxFieldFF` is a wrapper around a `CheckboxField` that enables it to work with Final Form, the preferred library for form validation and utilities in DHIS 2 apps.\n\n#### Final Form\n\nSee how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).\n\nInside a Final Form `<Form>` component, these 'FF' UI components are intended to be used in the `component` prop of the [Final Form `<Field>` components](https://final-form.org/docs/react-final-form/api/Field) where they will receive some props from the Field, e.g. `<Field component={CheckboxFieldFF} />`. See the code samples below for examples.\n\n#### Props\n\nThe props shown in the table below are generally provided to the `CheckboxFieldFF` wrapper by the Final Form `Field`.\n\nNote that any props beyond the API of the `Field` component will be spread to the `CheckboxFieldFF`, which passes any extra props to the underlying `CheckboxField` using `{...rest}`.\n\nTherefore, to add any props to the `CheckboxFieldFF` or `CheckboxField`, add those props to the parent Final Form `Field` component.\n\nAlso see `Checkbox` and `CheckboxField` for notes about props and implementation.\n\n```js\nimport { CheckboxFieldFF } from '@dhis2/ui'\n```\n\nPress **Submit** to see the form values logged to the console.\n";
23
- var _default = {
33
+ \`\`\`js
34
+ import { CheckboxFieldFF } from '@dhis2/ui'
35
+ \`\`\`
36
+
37
+ Press **Submit** to see the form values logged to the console.
38
+ `;
39
+ var _default = exports.default = {
24
40
  title: 'Checkbox Field (Final Form)',
25
41
  component: _CheckboxFieldFF.CheckboxFieldFF,
26
42
  decorators: [_formDecorator.formDecorator],
@@ -32,23 +48,21 @@ var _default = {
32
48
  }
33
49
  },
34
50
  argTypes: {
35
- input: { ..._propTypes.inputArgType
51
+ input: {
52
+ ..._propTypes.inputArgType
36
53
  },
37
- meta: { ..._propTypes.metaArgType
54
+ meta: {
55
+ ..._propTypes.metaArgType
38
56
  }
39
57
  }
40
58
  };
41
- exports.default = _default;
42
-
43
59
  const Default = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
44
60
  type: "checkbox",
45
61
  component: _CheckboxFieldFF.CheckboxFieldFF,
46
62
  name: "agree",
47
63
  label: "Do you agree?"
48
64
  });
49
-
50
65
  exports.Default = Default;
51
-
52
66
  const RequiredWithValidate = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
53
67
  type: "checkbox",
54
68
  name: "agree",
@@ -58,9 +72,7 @@ const RequiredWithValidate = () => /*#__PURE__*/_react.default.createElement(_re
58
72
  label: "Do you agree?",
59
73
  value: "yes"
60
74
  });
61
-
62
75
  exports.RequiredWithValidate = RequiredWithValidate;
63
-
64
76
  const Disabled = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
65
77
  type: "checkbox",
66
78
  name: "agree",
@@ -68,9 +80,7 @@ const Disabled = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm
68
80
  disabled: true,
69
81
  label: "Do you agree?"
70
82
  });
71
-
72
83
  exports.Disabled = Disabled;
73
-
74
84
  const HelpText = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
75
85
  type: "checkbox",
76
86
  name: "agree",
@@ -78,10 +88,8 @@ const HelpText = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm
78
88
  label: "Do you agree?",
79
89
  helpText: "Click to agree"
80
90
  });
81
-
82
91
  exports.HelpText = HelpText;
83
92
  HelpText.storyName = 'Help text';
84
-
85
93
  const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
86
94
  type: "checkbox",
87
95
  name: "valid",
@@ -104,9 +112,7 @@ const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.
104
112
  error: true,
105
113
  validationText: "Validation text"
106
114
  }));
107
-
108
115
  exports.Statuses = Statuses;
109
-
110
116
  const ValueWhenChecked = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
111
117
  type: "checkbox",
112
118
  name: "bool",
@@ -128,5 +134,4 @@ const ValueWhenChecked = () => /*#__PURE__*/_react.default.createElement(_react.
128
134
  value: "another-checked-value",
129
135
  helpText: "Click submit and check the console"
130
136
  }));
131
-
132
137
  exports.ValueWhenChecked = ValueWhenChecked;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  (0, _cypressCucumberPreprocessor.Given)('an unchecked Checkbox without value is rendered', () => {
6
5
  cy.visitStory('Testing:Checkbox', 'Unchecked');
7
6
  cy.verifyFormValue('checkbox', undefined);
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  (0, _cypressCucumberPreprocessor.Given)('an unchecked Checkbox with a value is rendered', () => {
6
5
  cy.visitStory('Testing:Checkbox', 'Unchecked with value');
7
6
  cy.verifyFormValue('checkbox', undefined);
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  (0, _cypressCucumberPreprocessor.When)('the user clicks on the Checkbox', () => {
6
5
  cy.get('[data-test="dhis2-uicore-checkbox"]').click();
7
6
  });
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
4
-
5
4
  var _hasValue = require("../../../validators/hasValue.js");
6
-
7
5
  (0, _cypressCucumberPreprocessor.Given)('an unchecked Checkbox is rendered', () => {
8
6
  cy.visitStory('Testing:Checkbox', 'Unchecked');
9
7
  cy.verifyFormValue('checkbox', undefined);
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.FieldGroupFF = void 0;
7
-
8
7
  var _field = require("@dhis2-ui/field");
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _react = _interopRequireDefault(require("react"));
13
-
14
10
  var _reactFinalForm = require("react-final-form");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
12
  const FieldGroupFF = _ref => {
19
13
  let {
20
14
  name,
@@ -35,7 +29,6 @@ const FieldGroupFF = _ref => {
35
29
  });
36
30
  const isError = !!error && !!touched;
37
31
  let errorText;
38
-
39
32
  if (isError) {
40
33
  if (typeof error === 'string') {
41
34
  errorText = error;
@@ -45,7 +38,6 @@ const FieldGroupFF = _ref => {
45
38
  errorText = null;
46
39
  }
47
40
  }
48
-
49
41
  return /*#__PURE__*/_react.default.createElement(_field.FieldGroup, {
50
42
  label: label,
51
43
  required: required,
@@ -54,7 +46,6 @@ const FieldGroupFF = _ref => {
54
46
  validationText: errorText
55
47
  }, children);
56
48
  };
57
-
58
49
  exports.FieldGroupFF = FieldGroupFF;
59
50
  FieldGroupFF.propTypes = {
60
51
  children: _propTypes.default.node,
@@ -4,23 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.Default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _reactFinalForm = require("react-final-form");
11
-
12
9
  var _CheckboxFieldFF = require("../CheckboxFieldFF/CheckboxFieldFF.js");
13
-
14
10
  var _formDecorator = require("../formDecorator.js");
15
-
16
11
  var _index = require("../validators/index.js");
17
-
18
12
  var _FieldGroupFF = require("./FieldGroupFF.js");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const description = `
15
+ This component is intended for use with [Final Form](https://final-form.org/docs/react-final-form/getting-started), the preferred library for form validation and utilities in DHIS 2 apps.
16
+
17
+ \`FieldGroupFF\` groups related fields (using the Final Form \`<Field>\`), like checkboxes, and adds a label and name.
19
18
 
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ \`\`\`js
20
+ import { FieldGroupFF } from '@dhis2/ui'
21
+ \`\`\`
21
22
 
22
- const description = "\nThis component is intended for use with [Final Form](https://final-form.org/docs/react-final-form/getting-started), the preferred library for form validation and utilities in DHIS 2 apps.\n\n`FieldGroupFF` groups related fields (using the Final Form `<Field>`), like checkboxes, and adds a label and name.\n\n```js\nimport { FieldGroupFF } from '@dhis2/ui'\n```\n\nPress **Submit** to see the form values logged to the console.\n";
23
- var _default = {
23
+ Press **Submit** to see the form values logged to the console.
24
+ `;
25
+ var _default = exports.default = {
24
26
  title: 'Field Group (Final Form)',
25
27
  component: _FieldGroupFF.FieldGroupFF,
26
28
  decorators: [_formDecorator.formDecorator],
@@ -32,8 +34,6 @@ var _default = {
32
34
  }
33
35
  }
34
36
  };
35
- exports.default = _default;
36
-
37
37
  const Default = () => /*#__PURE__*/_react.default.createElement(_FieldGroupFF.FieldGroupFF, {
38
38
  label: "Group label",
39
39
  required: true,
@@ -55,5 +55,4 @@ const Default = () => /*#__PURE__*/_react.default.createElement(_FieldGroupFF.Fi
55
55
  value: "two",
56
56
  validationText: null
57
57
  }));
58
-
59
58
  exports.Default = Default;
@@ -1,44 +1,32 @@
1
1
  "use strict";
2
2
 
3
- var _react = require("@storybook/react");
4
-
5
- var _react2 = _interopRequireDefault(require("react"));
6
-
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.StandardForm = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
7
8
  var _reactFinalForm = require("react-final-form");
8
-
9
9
  var _CheckboxFieldFF = require("../CheckboxFieldFF/CheckboxFieldFF.js");
10
-
11
10
  var _FieldGroupFF = require("../FieldGroupFF/FieldGroupFF.js");
12
-
13
11
  var _formDecorator = require("../formDecorator.js");
14
-
15
12
  var _InputFieldFF = require("../InputFieldFF/InputFieldFF.js");
16
-
17
13
  var _MultiSelectFieldFF = require("../MultiSelectFieldFF/MultiSelectFieldFF.js");
18
-
19
14
  var _RadioFieldFF = require("../RadioFieldFF/RadioFieldFF.js");
20
-
21
15
  var _SingleSelectFieldFF = require("../SingleSelectFieldFF/SingleSelectFieldFF.js");
22
-
23
16
  var _SwitchFieldFF = require("../SwitchFieldFF/SwitchFieldFF.js");
24
-
25
17
  var _TextAreaFieldFF = require("../TextAreaFieldFF/TextAreaFieldFF.js");
26
-
27
18
  var _index = require("../validators/index.js");
28
-
29
19
  var _FileInputFieldFF = require("./FileInputFieldFF.js");
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
-
33
- const StandardForm = _ref => {
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
+ const Form = _ref => {
34
22
  let {
35
23
  values
36
24
  } = _ref;
37
- return /*#__PURE__*/_react2.default.createElement("div", {
25
+ return /*#__PURE__*/_react.default.createElement("div", {
38
26
  style: {
39
27
  maxWidth: 830
40
28
  }
41
- }, /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
29
+ }, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
42
30
  name: "gender",
43
31
  label: "Gender",
44
32
  component: _SingleSelectFieldFF.SingleSelectFieldFF,
@@ -59,27 +47,27 @@ const StandardForm = _ref => {
59
47
  value: 'unknown',
60
48
  label: "I'd rather not say"
61
49
  }]
62
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
50
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
63
51
  required: true,
64
52
  label: "First name",
65
53
  name: "fname",
66
54
  validate: _index.hasValue,
67
55
  component: _InputFieldFF.InputFieldFF,
68
56
  helpText: "Please enter your first name, excluding middle names"
69
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
57
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
70
58
  required: true,
71
59
  label: "Last name",
72
60
  name: "lname",
73
61
  validate: _index.hasValue,
74
62
  component: _InputFieldFF.InputFieldFF,
75
63
  helpText: "Please enter your first name, excluding middle names"
76
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
64
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
77
65
  name: "subscribe",
78
66
  initialValue: true,
79
67
  type: "checkbox",
80
68
  label: "I want to receive updated and notifications about the latest changes?",
81
69
  component: _SwitchFieldFF.SwitchFieldFF
82
- }), values.subscribe && /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
70
+ }), values.subscribe && /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
83
71
  required: values.subscribe,
84
72
  label: "E-mail address",
85
73
  name: "email1",
@@ -90,7 +78,7 @@ const StandardForm = _ref => {
90
78
  }),
91
79
  component: _InputFieldFF.InputFieldFF,
92
80
  helpText: "Please enter the e-mail address you want us to send the updates to"
93
- }), values.subscribe && /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
81
+ }), values.subscribe && /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
94
82
  disabled: !values.subscribe,
95
83
  required: values.subscribe,
96
84
  label: "E-mail address confirmation",
@@ -98,12 +86,12 @@ const StandardForm = _ref => {
98
86
  validate: (0, _index.composeValidators)(_index.email, _index.hasValue),
99
87
  component: _InputFieldFF.InputFieldFF,
100
88
  helpText: "Please confirm your e-mail address"
101
- }), /*#__PURE__*/_react2.default.createElement(_FieldGroupFF.FieldGroupFF, {
89
+ }), /*#__PURE__*/_react.default.createElement(_FieldGroupFF.FieldGroupFF, {
102
90
  name: "food",
103
91
  label: "Food",
104
92
  required: true,
105
93
  helpText: "If we ever gather for food, what meal type would you like to eat"
106
- }, /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
94
+ }, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
107
95
  type: "radio",
108
96
  name: "food",
109
97
  required: true,
@@ -111,7 +99,7 @@ const StandardForm = _ref => {
111
99
  value: "anything",
112
100
  label: "Don't care",
113
101
  validate: _index.hasValue
114
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
102
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
115
103
  type: "radio",
116
104
  name: "food",
117
105
  component: _RadioFieldFF.RadioFieldFF,
@@ -119,7 +107,7 @@ const StandardForm = _ref => {
119
107
  value: "vegan",
120
108
  label: "Vegan",
121
109
  validate: _index.hasValue
122
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
110
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
123
111
  type: "radio",
124
112
  name: "food",
125
113
  component: _RadioFieldFF.RadioFieldFF,
@@ -127,7 +115,7 @@ const StandardForm = _ref => {
127
115
  value: "vegetarian",
128
116
  label: "Vegetarian",
129
117
  validate: _index.hasValue
130
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
118
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
131
119
  type: "radio",
132
120
  name: "food",
133
121
  component: _RadioFieldFF.RadioFieldFF,
@@ -135,7 +123,7 @@ const StandardForm = _ref => {
135
123
  value: "fish",
136
124
  label: "Fish",
137
125
  validate: _index.hasValue
138
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
126
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
139
127
  type: "radio",
140
128
  name: "food",
141
129
  required: true,
@@ -143,41 +131,41 @@ const StandardForm = _ref => {
143
131
  value: "Halal",
144
132
  label: "halal",
145
133
  validate: _index.hasValue
146
- })), /*#__PURE__*/_react2.default.createElement(_FieldGroupFF.FieldGroupFF, {
134
+ })), /*#__PURE__*/_react.default.createElement(_FieldGroupFF.FieldGroupFF, {
147
135
  name: "pizzaToppings",
148
136
  label: "Pizza toppings",
149
137
  helpText: "If we ever order pizza, what ingredients would you like on top"
150
- }, /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
138
+ }, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
151
139
  type: "checkbox",
152
140
  name: "pizzaToppings",
153
141
  component: _CheckboxFieldFF.CheckboxFieldFF,
154
142
  label: "Everything",
155
143
  value: "everything"
156
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
144
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
157
145
  type: "checkbox",
158
146
  name: "pizzaToppings",
159
147
  component: _CheckboxFieldFF.CheckboxFieldFF,
160
148
  label: "Ham",
161
149
  value: "ham"
162
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
150
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
163
151
  type: "checkbox",
164
152
  name: "pizzaToppings",
165
153
  component: _CheckboxFieldFF.CheckboxFieldFF,
166
154
  label: "Salami",
167
155
  value: "salami"
168
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
156
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
169
157
  type: "checkbox",
170
158
  name: "pizzaToppings",
171
159
  component: _CheckboxFieldFF.CheckboxFieldFF,
172
160
  label: "Pineapple",
173
161
  value: "pineapple"
174
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
162
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
175
163
  type: "checkbox",
176
164
  name: "pizzaToppings",
177
165
  component: _CheckboxFieldFF.CheckboxFieldFF,
178
166
  label: "Bellpepper",
179
167
  value: "bellpepper"
180
- })), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
168
+ })), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
181
169
  label: "Sandwich toppings",
182
170
  name: "sandwhichToppings",
183
171
  component: _MultiSelectFieldFF.MultiSelectFieldFF,
@@ -198,11 +186,11 @@ const StandardForm = _ref => {
198
186
  label: 'Bellpepper'
199
187
  }],
200
188
  helpText: "If we ever order sandwiches, what ingredients would you like on top"
201
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
189
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
202
190
  name: "message",
203
191
  label: "If you want to tell us anything, just add your message here",
204
192
  component: _TextAreaFieldFF.TextAreaFieldFF
205
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
193
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
206
194
  name: "fileTxt",
207
195
  accept: ".txt",
208
196
  label: "If you want to send us a txt file, please attach it here",
@@ -211,15 +199,13 @@ const StandardForm = _ref => {
211
199
  if (!files) {
212
200
  return undefined;
213
201
  }
214
-
215
202
  const [file] = files;
216
-
217
203
  if (file.type !== 'text/plain') {
218
- return "The file you provided is not a txt file, received \"".concat(file.type, "\"");
204
+ return `The file you provided is not a txt file, received "${file.type}"`;
219
205
  }
220
206
  },
221
207
  component: _FileInputFieldFF.FileInputFieldFF
222
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
208
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
223
209
  multiple: true,
224
210
  accept: "image/jpg",
225
211
  name: "fileJpgs",
@@ -228,19 +214,17 @@ const StandardForm = _ref => {
228
214
  if (!files) {
229
215
  return undefined;
230
216
  }
231
-
232
217
  return files.reduce((error, file) => {
233
218
  if (error) {
234
219
  return error;
235
220
  }
236
-
237
221
  if (file.type !== 'application/jpg') {
238
- return "One of the files is not a jpg, received \"".concat(file.type, "\"");
222
+ return `One of the files is not a jpg, received "${file.type}"`;
239
223
  }
240
224
  }, undefined);
241
225
  },
242
226
  component: _FileInputFieldFF.FileInputFieldFF
243
- }), /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
227
+ }), /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
244
228
  required: true,
245
229
  name: "tnc",
246
230
  label: "I accept the terms and conditions",
@@ -250,14 +234,19 @@ const StandardForm = _ref => {
250
234
  className: "checkbox"
251
235
  }));
252
236
  };
253
-
254
- (0, _react.storiesOf)('Testing:FileInput', module).addDecorator(_formDecorator.formDecorator).addParameters({
255
- options: {
256
- showPanel: false
237
+ var _default = exports.default = {
238
+ title: 'Testing:FileInput',
239
+ decorators: [_formDecorator.formDecorator],
240
+ parameters: {
241
+ options: {
242
+ showPanel: false
243
+ }
257
244
  }
258
- }).add('Standard form', (_, _ref2) => {
245
+ };
246
+ const StandardForm = (_, _ref2) => {
259
247
  let {
260
248
  formRenderProps
261
249
  } = _ref2;
262
- return /*#__PURE__*/_react2.default.createElement(StandardForm, formRenderProps);
263
- });
250
+ return /*#__PURE__*/_react.default.createElement(Form, formRenderProps);
251
+ };
252
+ exports.StandardForm = StandardForm;