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

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,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 Switch is rendered', () => {
8
6
  cy.visitStory('Testing:SwitchFieldFF', 'Unchecked');
9
7
  cy.verifyFormValue('switch', undefined);
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Required = exports.Default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactFinalForm = require("react-final-form");
9
+ var _formDecorator = require("../formDecorator.js");
10
+ var _index = require("../validators/index.js");
11
+ var _TextAreaFieldFF = require("./TextAreaFieldFF.js");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ var _default = exports.default = {
14
+ title: 'TextArea',
15
+ decorators: [_formDecorator.formDecorator]
16
+ };
17
+ const Default = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
18
+ component: _TextAreaFieldFF.TextAreaFieldFF,
19
+ name: "comment",
20
+ label: "Do you have any comments?"
21
+ });
22
+ exports.Default = Default;
23
+ const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
24
+ required: true,
25
+ name: "comment",
26
+ component: _TextAreaFieldFF.TextAreaFieldFF,
27
+ validate: _index.hasValue,
28
+ label: "Do you have any comments?"
29
+ });
30
+ exports.Required = Required;
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TextAreaFieldFF = void 0;
7
-
8
7
  var _textArea = require("@dhis2-ui/text-area");
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 TextAreaFieldFF = _ref => {
23
15
  let {
24
16
  input,
@@ -45,12 +37,10 @@ const TextAreaFieldFF = _ref => {
45
37
  value: input.value
46
38
  }));
47
39
  };
48
-
49
40
  exports.TextAreaFieldFF = TextAreaFieldFF;
50
41
  TextAreaFieldFF.propTypes = {
51
42
  /** `input` props received from Final Form `Field` */
52
43
  input: _propTypes2.inputPropType.isRequired,
53
-
54
44
  /** `meta` props received from Final Form `Field` */
55
45
  meta: _propTypes2.metaPropType.isRequired,
56
46
  error: _propTypes.default.bool,
@@ -4,23 +4,39 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.Statuses = exports.Required = exports.HelpText = exports.Disabled = exports.Default = exports.Autogrow = 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 _TextAreaFieldFF = require("./TextAreaFieldFF.js");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const description = `
15
+ The \`TextAreaFieldFF\` is a wrapper around a \`TextAreaField\` 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={TextAreaFieldFF} />\`. See the code samples below for examples.
22
+
23
+ #### Props
24
+
25
+ The props shown in the table below are generally provided to the \`TextAreaFieldFF\` wrapper by the Final Form \`Field\`.
26
+
27
+ Note that any props beyond the API of the \`Field\` component will be spread to the \`TextAreaFieldFF\`, which passes any extra props to the underlying \`TextAreaField\` using \`{...rest}\`.
28
+
29
+ Therefore, to add any props to the \`TextAreaFieldFF\` or \`TextAreaField\`, 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 \`TextArea\` and \`TextAreaField\` for notes about props and implementation.
21
32
 
22
- const description = "\nThe `TextAreaFieldFF` is a wrapper around a `TextAreaField` 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={TextAreaFieldFF} />`. See the code samples below for examples.\n\n#### Props\n\nThe props shown in the table below are generally provided to the `TextAreaFieldFF` wrapper by the Final Form `Field`.\n\nNote that any props beyond the API of the `Field` component will be spread to the `TextAreaFieldFF`, which passes any extra props to the underlying `TextAreaField` using `{...rest}`.\n\nTherefore, to add any props to the `TextAreaFieldFF` or `TextAreaField`, add those props to the parent Final Form `Field` component.\n\nAlso see `TextArea` and `TextAreaField` for notes about props and implementation.\n\n```js\nimport { TextAreaFieldFF } from '@dhis2/ui'\n```\n\nPress **Submit** to see the form values logged to the console.\n";
23
- var _default = {
33
+ \`\`\`js
34
+ import { TextAreaFieldFF } 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: 'Text Area Field (Final Form)',
25
41
  component: _TextAreaFieldFF.TextAreaFieldFF,
26
42
  decorators: [_formDecorator.formDecorator],
@@ -32,31 +48,27 @@ 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
  component: _TextAreaFieldFF.TextAreaFieldFF,
45
61
  name: "agree",
46
62
  label: "Do you agree?"
47
63
  });
48
-
49
64
  exports.Default = Default;
50
-
51
65
  const Autogrow = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
52
66
  component: _TextAreaFieldFF.TextAreaFieldFF,
53
67
  name: "agree",
54
68
  label: "Do you agree?",
55
69
  autoGrow: true
56
70
  });
57
-
58
71
  exports.Autogrow = Autogrow;
59
-
60
72
  const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
61
73
  name: "agree",
62
74
  component: _TextAreaFieldFF.TextAreaFieldFF,
@@ -64,28 +76,22 @@ const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm
64
76
  validate: _index.hasValue,
65
77
  label: "Do you agree?"
66
78
  });
67
-
68
79
  exports.Required = Required;
69
-
70
80
  const Disabled = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
71
81
  name: "agree",
72
82
  component: _TextAreaFieldFF.TextAreaFieldFF,
73
83
  disabled: true,
74
84
  label: "Do you agree?"
75
85
  });
76
-
77
86
  exports.Disabled = Disabled;
78
-
79
87
  const HelpText = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
80
88
  name: "agree",
81
89
  component: _TextAreaFieldFF.TextAreaFieldFF,
82
90
  label: "Do you agree?",
83
91
  helpText: "Click to agree"
84
92
  });
85
-
86
93
  exports.HelpText = HelpText;
87
94
  HelpText.storyName = 'Help text';
88
-
89
95
  const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
90
96
  name: "valid",
91
97
  component: _TextAreaFieldFF.TextAreaFieldFF,
@@ -105,5 +111,4 @@ const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.
105
111
  error: true,
106
112
  validationText: "Validation text"
107
113
  }));
108
-
109
114
  exports.Statuses = Statuses;
@@ -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)('a TextArea with no text is rendered', () => {
6
5
  cy.visitStory('TextArea', 'Default');
7
6
  cy.verifyFormValue('comment', undefined);
@@ -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 empty, required TextArea is rendered', () => {
8
6
  cy.visitStory('TextArea', 'Required');
9
7
  cy.verifyFormValue('agree', undefined);
@@ -11,6 +11,7 @@ Array [
11
11
  "getIn",
12
12
  "setIn",
13
13
  "version",
14
+ "default",
14
15
  ]
15
16
  `;
16
17
 
@@ -22,6 +23,8 @@ exports[`final-form named export should re-export the expected type for configOp
22
23
 
23
24
  exports[`final-form named export should re-export the expected type for createForm 1`] = `"function"`;
24
25
 
26
+ exports[`final-form named export should re-export the expected type for default 1`] = `"object"`;
27
+
25
28
  exports[`final-form named export should re-export the expected type for fieldSubscriptionItems 1`] = `"object"`;
26
29
 
27
30
  exports[`final-form named export should re-export the expected type for formSubscriptionItems 1`] = `"object"`;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _index = require("../index.js");
4
-
5
4
  /* eslint-disable import/namespace */
5
+
6
6
  describe('final-form named export', () => {
7
7
  it('should re-export the expected exports', () => {
8
8
  const exports = Object.keys(_index.FinalForm);
@@ -4,61 +4,50 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.formDecorator = void 0;
7
-
8
7
  var _button = require("@dhis2-ui/button");
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
-
18
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
15
  const formProps = {
21
16
  onSubmit: values => {
22
17
  console.log('++++++++++++++++\n', 'Form was submitted with values:\n', values, '\n----------------');
23
18
  },
24
19
  mutators: {}
25
20
  };
26
-
27
21
  class FormWithSpyAndSubmit extends _react.default.Component {
28
22
  constructor() {
29
23
  super(...arguments);
30
-
31
24
  _defineProperty(this, "state", {
32
25
  cypressProps: {}
33
26
  });
34
-
35
27
  _defineProperty(this, "updateCypressProps", updateObj => {
36
- const cypressProps = { ...this.state.cypressProps,
28
+ const cypressProps = {
29
+ ...this.state.cypressProps,
37
30
  ...updateObj
38
31
  };
39
32
  this.setState({
40
33
  cypressProps
41
34
  });
42
35
  });
43
-
44
36
  _defineProperty(this, "clearCypressProps", () => {
45
37
  this.setState({
46
38
  cypressProps: {}
47
39
  });
48
40
  });
49
41
  }
50
-
51
42
  componentDidMount() {
52
43
  window.updateCypressProps = this.updateCypressProps;
53
44
  window.clearCypressProps = this.clearCypressProps;
54
45
  this.forceUpdate();
55
46
  }
56
-
57
47
  componentWillUnmount() {
58
48
  delete window.updateCypressProps;
59
49
  delete window.clearCypressProps;
60
50
  }
61
-
62
51
  render() {
63
52
  return /*#__PURE__*/_react.default.createElement(_reactFinalForm.Form, formProps, formRenderProps => /*#__PURE__*/_react.default.createElement("form", {
64
53
  onSubmit: formRenderProps.handleSubmit
@@ -78,15 +67,11 @@ class FormWithSpyAndSubmit extends _react.default.Component {
78
67
  });
79
68
  })));
80
69
  }
81
-
82
70
  }
83
-
84
71
  FormWithSpyAndSubmit.propTypes = {
85
72
  renderChildren: _propTypes.default.func.isRequired
86
73
  };
87
-
88
74
  const formDecorator = fn => /*#__PURE__*/_react.default.createElement(FormWithSpyAndSubmit, {
89
75
  renderChildren: fn
90
76
  });
91
-
92
77
  exports.formDecorator = formDecorator;
@@ -72,35 +72,20 @@ Object.defineProperty(exports, "TextAreaFieldFF", {
72
72
  return _TextAreaFieldFF.TextAreaFieldFF;
73
73
  }
74
74
  });
75
-
76
75
  var FinalForm = _interopRequireWildcard(require("final-form"));
77
-
78
76
  exports.FinalForm = FinalForm;
79
-
80
77
  var ReactFinalForm = _interopRequireWildcard(require("react-final-form"));
81
-
82
78
  exports.ReactFinalForm = ReactFinalForm;
83
-
84
79
  var _CheckboxFieldFF = require("./CheckboxFieldFF/CheckboxFieldFF.js");
85
-
86
80
  var _FileInputFieldFF = require("./FileInputFieldFF/FileInputFieldFF.js");
87
-
88
81
  var _InputFieldFF = require("./InputFieldFF/InputFieldFF.js");
89
-
90
82
  var _MultiSelectFieldFF = require("./MultiSelectFieldFF/MultiSelectFieldFF.js");
91
-
92
83
  var _SingleSelectFieldFF = require("./SingleSelectFieldFF/SingleSelectFieldFF.js");
93
-
94
84
  var _RadioFieldFF = require("./RadioFieldFF/RadioFieldFF.js");
95
-
96
85
  var _SwitchFieldFF = require("./SwitchFieldFF/SwitchFieldFF.js");
97
-
98
86
  var _TextAreaFieldFF = require("./TextAreaFieldFF/TextAreaFieldFF.js");
99
-
100
87
  var _FieldGroupFF = require("./FieldGroupFF/FieldGroupFF.js");
101
-
102
88
  var _index = require("./transformers/index.js");
103
-
104
89
  Object.keys(_index).forEach(function (key) {
105
90
  if (key === "default" || key === "__esModule") return;
106
91
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -112,9 +97,7 @@ Object.keys(_index).forEach(function (key) {
112
97
  }
113
98
  });
114
99
  });
115
-
116
100
  var _index2 = require("./validators/index.js");
117
-
118
101
  Object.keys(_index2).forEach(function (key) {
119
102
  if (key === "default" || key === "__esModule") return;
120
103
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -126,7 +109,5 @@ Object.keys(_index2).forEach(function (key) {
126
109
  }
127
110
  });
128
111
  });
129
-
130
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
131
-
132
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
112
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
113
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -4,79 +4,42 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _d2I18n = _interopRequireDefault(require("@dhis2/d2-i18n"));
9
-
10
8
  var _translations = _interopRequireDefault(require("./ar/translations.json"));
11
-
12
9
  var _translations2 = _interopRequireDefault(require("./ar_IQ/translations.json"));
13
-
14
10
  var _translations3 = _interopRequireDefault(require("./ckb/translations.json"));
15
-
16
11
  var _translations4 = _interopRequireDefault(require("./cs/translations.json"));
17
-
18
12
  var _translations5 = _interopRequireDefault(require("./da/translations.json"));
19
-
20
13
  var _translations6 = _interopRequireDefault(require("./en/translations.json"));
21
-
22
14
  var _translations7 = _interopRequireDefault(require("./es/translations.json"));
23
-
24
15
  var _translations8 = _interopRequireDefault(require("./es_419/translations.json"));
25
-
26
16
  var _translations9 = _interopRequireDefault(require("./fr/translations.json"));
27
-
28
17
  var _translations10 = _interopRequireDefault(require("./id/translations.json"));
29
-
30
18
  var _translations11 = _interopRequireDefault(require("./km/translations.json"));
31
-
32
19
  var _translations12 = _interopRequireDefault(require("./ko_KR/translations.json"));
33
-
34
20
  var _translations13 = _interopRequireDefault(require("./lo/translations.json"));
35
-
36
21
  var _translations14 = _interopRequireDefault(require("./my/translations.json"));
37
-
38
22
  var _translations15 = _interopRequireDefault(require("./nb/translations.json"));
39
-
40
23
  var _translations16 = _interopRequireDefault(require("./nl/translations.json"));
41
-
42
24
  var _translations17 = _interopRequireDefault(require("./prs/translations.json"));
43
-
44
25
  var _translations18 = _interopRequireDefault(require("./ps/translations.json"));
45
-
46
26
  var _translations19 = _interopRequireDefault(require("./pt/translations.json"));
47
-
48
27
  var _translations20 = _interopRequireDefault(require("./pt_BR/translations.json"));
49
-
50
28
  var _translations21 = _interopRequireDefault(require("./ro/translations.json"));
51
-
52
29
  var _translations22 = _interopRequireDefault(require("./ru/translations.json"));
53
-
54
30
  var _translations23 = _interopRequireDefault(require("./si/translations.json"));
55
-
56
31
  var _translations24 = _interopRequireDefault(require("./sv/translations.json"));
57
-
58
32
  var _translations25 = _interopRequireDefault(require("./tet/translations.json"));
59
-
60
33
  var _translations26 = _interopRequireDefault(require("./tg/translations.json"));
61
-
62
34
  var _translations27 = _interopRequireDefault(require("./uk/translations.json"));
63
-
64
35
  var _translations28 = _interopRequireDefault(require("./ur/translations.json"));
65
-
66
36
  var _translations29 = _interopRequireDefault(require("./uz_Latn/translations.json"));
67
-
68
37
  var _translations30 = _interopRequireDefault(require("./uz_UZ_Cyrl/translations.json"));
69
-
70
38
  var _translations31 = _interopRequireDefault(require("./uz_UZ_Latn/translations.json"));
71
-
72
39
  var _translations32 = _interopRequireDefault(require("./vi/translations.json"));
73
-
74
40
  var _translations33 = _interopRequireDefault(require("./zh/translations.json"));
75
-
76
41
  var _translations34 = _interopRequireDefault(require("./zh_CN/translations.json"));
77
-
78
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
79
-
42
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
80
43
  //------------------------------------------------------------------------------
81
44
  // <auto-generated>
82
45
  // This code was generated by d2-i18n-generate.
@@ -85,75 +48,40 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
85
48
  // the code is regenerated.
86
49
  // </auto-generated>
87
50
  //------------------------------------------------------------------------------
88
- const namespace = 'default';
89
51
 
52
+ const namespace = 'default';
90
53
  _d2I18n.default.addResources('ar', namespace, _translations.default);
91
-
92
54
  _d2I18n.default.addResources('ar_IQ', namespace, _translations2.default);
93
-
94
55
  _d2I18n.default.addResources('ckb', namespace, _translations3.default);
95
-
96
56
  _d2I18n.default.addResources('cs', namespace, _translations4.default);
97
-
98
57
  _d2I18n.default.addResources('da', namespace, _translations5.default);
99
-
100
58
  _d2I18n.default.addResources('en', namespace, _translations6.default);
101
-
102
59
  _d2I18n.default.addResources('es', namespace, _translations7.default);
103
-
104
60
  _d2I18n.default.addResources('es_419', namespace, _translations8.default);
105
-
106
61
  _d2I18n.default.addResources('fr', namespace, _translations9.default);
107
-
108
62
  _d2I18n.default.addResources('id', namespace, _translations10.default);
109
-
110
63
  _d2I18n.default.addResources('km', namespace, _translations11.default);
111
-
112
64
  _d2I18n.default.addResources('ko_KR', namespace, _translations12.default);
113
-
114
65
  _d2I18n.default.addResources('lo', namespace, _translations13.default);
115
-
116
66
  _d2I18n.default.addResources('my', namespace, _translations14.default);
117
-
118
67
  _d2I18n.default.addResources('nb', namespace, _translations15.default);
119
-
120
68
  _d2I18n.default.addResources('nl', namespace, _translations16.default);
121
-
122
69
  _d2I18n.default.addResources('prs', namespace, _translations17.default);
123
-
124
70
  _d2I18n.default.addResources('ps', namespace, _translations18.default);
125
-
126
71
  _d2I18n.default.addResources('pt', namespace, _translations19.default);
127
-
128
72
  _d2I18n.default.addResources('pt_BR', namespace, _translations20.default);
129
-
130
73
  _d2I18n.default.addResources('ro', namespace, _translations21.default);
131
-
132
74
  _d2I18n.default.addResources('ru', namespace, _translations22.default);
133
-
134
75
  _d2I18n.default.addResources('si', namespace, _translations23.default);
135
-
136
76
  _d2I18n.default.addResources('sv', namespace, _translations24.default);
137
-
138
77
  _d2I18n.default.addResources('tet', namespace, _translations25.default);
139
-
140
78
  _d2I18n.default.addResources('tg', namespace, _translations26.default);
141
-
142
79
  _d2I18n.default.addResources('uk', namespace, _translations27.default);
143
-
144
80
  _d2I18n.default.addResources('ur', namespace, _translations28.default);
145
-
146
81
  _d2I18n.default.addResources('uz_Latn', namespace, _translations29.default);
147
-
148
82
  _d2I18n.default.addResources('uz_UZ_Cyrl', namespace, _translations30.default);
149
-
150
83
  _d2I18n.default.addResources('uz_UZ_Latn', namespace, _translations31.default);
151
-
152
84
  _d2I18n.default.addResources('vi', namespace, _translations32.default);
153
-
154
85
  _d2I18n.default.addResources('zh', namespace, _translations33.default);
155
-
156
86
  _d2I18n.default.addResources('zh_CN', namespace, _translations34.default);
157
-
158
- var _default = _d2I18n.default;
159
- exports.default = _default;
87
+ var _default = exports.default = _d2I18n.default;
@@ -4,13 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createBlurHandler = void 0;
7
-
8
7
  const createBlurHandler = (input, onBlur) => (payload, event) => {
9
8
  input.onBlur(event);
10
-
11
9
  if (onBlur && typeof onBlur === 'function') {
12
10
  onBlur(payload, event);
13
11
  }
14
12
  };
15
-
16
13
  exports.createBlurHandler = createBlurHandler;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createChangeHandler = void 0;
7
7
  const PRIMITIVE_TYPES = new Set(['string', 'number', 'boolean']);
8
-
9
8
  const createChangeHandler = _ref => {
10
9
  let {
11
10
  onChange
@@ -26,5 +25,4 @@ const createChangeHandler = _ref => {
26
25
  }
27
26
  };
28
27
  };
29
-
30
28
  exports.createChangeHandler = createChangeHandler;
@@ -4,13 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createFocusHandler = void 0;
7
-
8
7
  const createFocusHandler = (input, onFocus) => (payload, event) => {
9
8
  input.onFocus(event);
10
-
11
9
  if (onFocus && typeof onFocus === 'function') {
12
10
  onFocus(payload, event);
13
11
  }
14
12
  };
15
-
16
13
  exports.createFocusHandler = createFocusHandler;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createSelectChangeHandler = void 0;
7
-
8
7
  const createSelectChangeHandler = _ref => {
9
8
  let {
10
9
  onChange
@@ -16,5 +15,4 @@ const createSelectChangeHandler = _ref => {
16
15
  onChange(selected);
17
16
  };
18
17
  };
19
-
20
18
  exports.createSelectChangeHandler = createSelectChangeHandler;
@@ -4,13 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createToggleChangeHandler = void 0;
7
-
8
7
  const createToggleChangeHandler = (input, onChange) => (payload, event) => {
9
8
  input.onChange(event);
10
-
11
9
  if (onChange && typeof onChange === 'function') {
12
10
  onChange(payload, event);
13
11
  }
14
12
  };
15
-
16
13
  exports.createToggleChangeHandler = createToggleChangeHandler;
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getValidationText = void 0;
7
-
8
7
  var _hasError = require("./hasError.js");
9
-
10
8
  const getValidationText = (meta, validationText, error) => {
11
9
  if (validationText) {
12
10
  return validationText;
13
11
  }
14
-
15
12
  if ((0, _hasError.hasError)(meta, error)) {
16
13
  if (meta.error) {
17
14
  return meta.error;
18
15
  }
19
-
20
16
  if (meta.submitError) {
21
17
  return meta.submitError;
22
18
  }
23
19
  }
24
-
25
20
  return '';
26
21
  };
27
-
28
22
  exports.getValidationText = getValidationText;
@@ -4,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.hasError = void 0;
7
-
8
7
  const hasError = (meta, error) => error || meta.touched && meta.invalid;
9
-
10
8
  exports.hasError = hasError;