@dhis2/ui-forms 8.2.0 → 8.2.3

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 (119) hide show
  1. package/build/cjs/CheckboxFieldFF/CheckboxFieldFF.js +24 -21
  2. package/build/cjs/CheckboxFieldFF/CheckboxFieldFF.stories.js +3 -27
  3. package/build/cjs/FieldGroupFF/FieldGroupFF.js +7 -6
  4. package/build/cjs/FieldGroupFF/FieldGroupFF.stories.js +3 -13
  5. package/build/cjs/FileInputFieldFF/FileInputFieldFF.js +17 -18
  6. package/build/cjs/FileInputFieldFF/FileInputFieldFF.stories.e2e.js +12 -8
  7. package/build/cjs/FileInputFieldFF/FileInputFieldFF.stories.js +3 -27
  8. package/build/cjs/InputFieldFF/InputFieldFF.js +27 -24
  9. package/build/cjs/InputFieldFF/InputFieldFF.stories.js +3 -27
  10. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.js +15 -14
  11. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.stories.e2e.js +13 -10
  12. package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +3 -29
  13. package/build/cjs/RadioFieldFF/RadioFieldFF.js +24 -21
  14. package/build/cjs/RadioFieldFF/RadioFieldFF.stories.js +3 -27
  15. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.js +15 -14
  16. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.e2e.js +13 -10
  17. package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +3 -29
  18. package/build/cjs/SwitchFieldFF/SwitchFieldFF.js +24 -21
  19. package/build/cjs/SwitchFieldFF/SwitchFieldFF.stories.js +3 -27
  20. package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.js +26 -23
  21. package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.stories.js +3 -27
  22. package/build/cjs/formDecorator.js +6 -5
  23. package/build/cjs/index.js +12 -11
  24. package/build/cjs/locales/ar/translations.json +0 -1
  25. package/build/cjs/locales/ar_IQ/translations.json +0 -1
  26. package/build/cjs/locales/ckb/translations.json +0 -1
  27. package/build/cjs/locales/cs/translations.json +0 -1
  28. package/build/cjs/locales/da/translations.json +0 -1
  29. package/build/cjs/locales/en/translations.json +0 -1
  30. package/build/cjs/locales/es/translations.json +0 -1
  31. package/build/cjs/locales/fr/translations.json +0 -1
  32. package/build/cjs/locales/id/translations.json +0 -1
  33. package/build/cjs/locales/km/translations.json +0 -1
  34. package/build/cjs/locales/lo/translations.json +0 -1
  35. package/build/cjs/locales/my/translations.json +0 -1
  36. package/build/cjs/locales/nb/translations.json +0 -1
  37. package/build/cjs/locales/prs/translations.json +0 -1
  38. package/build/cjs/locales/ps/translations.json +0 -1
  39. package/build/cjs/locales/pt/translations.json +0 -1
  40. package/build/cjs/locales/pt_BR/translations.json +0 -1
  41. package/build/cjs/locales/ru/translations.json +0 -1
  42. package/build/cjs/locales/sv/translations.json +0 -1
  43. package/build/cjs/locales/tet/translations.json +0 -1
  44. package/build/cjs/locales/tg/translations.json +0 -1
  45. package/build/cjs/locales/uk/translations.json +0 -1
  46. package/build/cjs/locales/ur/translations.json +0 -1
  47. package/build/cjs/locales/uz/translations.json +0 -1
  48. package/build/cjs/locales/uz_Latn/translations.json +0 -1
  49. package/build/cjs/locales/vi/translations.json +0 -1
  50. package/build/cjs/locales/zh/translations.json +0 -1
  51. package/build/cjs/locales/zh_CN/translations.json +0 -1
  52. package/build/cjs/shared/helpers/createChangeHandler.js +19 -16
  53. package/build/cjs/shared/helpers/createSelectChangeHandler.js +10 -6
  54. package/build/cjs/shared/propTypes.js +1 -1
  55. package/build/cjs/transformers/arrayWithIdObjects.js +6 -3
  56. package/build/cjs/validators/__tests__/createPattern.test.js +1 -1
  57. package/build/cjs/validators/composeValidators.js +10 -2
  58. package/build/cjs/validators/helpers/index.js +1 -1
  59. package/build/cjs/validators/number.js +1 -1
  60. package/build/cjs/validators/string.js +1 -1
  61. package/build/cjs/validators/test-helpers/index.js +2 -2
  62. package/build/cjs/validators/url.js +1 -1
  63. package/build/es/CheckboxFieldFF/CheckboxFieldFF.js +24 -21
  64. package/build/es/CheckboxFieldFF/CheckboxFieldFF.stories.js +2 -26
  65. package/build/es/FieldGroupFF/FieldGroupFF.js +7 -6
  66. package/build/es/FieldGroupFF/FieldGroupFF.stories.js +2 -12
  67. package/build/es/FileInputFieldFF/FileInputFieldFF.js +17 -18
  68. package/build/es/FileInputFieldFF/FileInputFieldFF.stories.e2e.js +12 -8
  69. package/build/es/FileInputFieldFF/FileInputFieldFF.stories.js +2 -26
  70. package/build/es/InputFieldFF/InputFieldFF.js +27 -24
  71. package/build/es/InputFieldFF/InputFieldFF.stories.js +2 -26
  72. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.js +15 -14
  73. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.stories.e2e.js +13 -10
  74. package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +2 -28
  75. package/build/es/RadioFieldFF/RadioFieldFF.js +24 -21
  76. package/build/es/RadioFieldFF/RadioFieldFF.stories.js +2 -26
  77. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.js +15 -14
  78. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.stories.e2e.js +13 -10
  79. package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +2 -28
  80. package/build/es/SwitchFieldFF/SwitchFieldFF.js +24 -21
  81. package/build/es/SwitchFieldFF/SwitchFieldFF.stories.js +2 -26
  82. package/build/es/TextAreaFieldFF/TextAreaFieldFF.js +26 -23
  83. package/build/es/TextAreaFieldFF/TextAreaFieldFF.stories.js +2 -26
  84. package/build/es/formDecorator.js +6 -5
  85. package/build/es/locales/ar/translations.json +0 -1
  86. package/build/es/locales/ar_IQ/translations.json +0 -1
  87. package/build/es/locales/ckb/translations.json +0 -1
  88. package/build/es/locales/cs/translations.json +0 -1
  89. package/build/es/locales/da/translations.json +0 -1
  90. package/build/es/locales/en/translations.json +0 -1
  91. package/build/es/locales/es/translations.json +0 -1
  92. package/build/es/locales/fr/translations.json +0 -1
  93. package/build/es/locales/id/translations.json +0 -1
  94. package/build/es/locales/km/translations.json +0 -1
  95. package/build/es/locales/lo/translations.json +0 -1
  96. package/build/es/locales/my/translations.json +0 -1
  97. package/build/es/locales/nb/translations.json +0 -1
  98. package/build/es/locales/prs/translations.json +0 -1
  99. package/build/es/locales/ps/translations.json +0 -1
  100. package/build/es/locales/pt/translations.json +0 -1
  101. package/build/es/locales/pt_BR/translations.json +0 -1
  102. package/build/es/locales/ru/translations.json +0 -1
  103. package/build/es/locales/sv/translations.json +0 -1
  104. package/build/es/locales/tet/translations.json +0 -1
  105. package/build/es/locales/tg/translations.json +0 -1
  106. package/build/es/locales/uk/translations.json +0 -1
  107. package/build/es/locales/ur/translations.json +0 -1
  108. package/build/es/locales/uz/translations.json +0 -1
  109. package/build/es/locales/uz_Latn/translations.json +0 -1
  110. package/build/es/locales/vi/translations.json +0 -1
  111. package/build/es/locales/zh/translations.json +0 -1
  112. package/build/es/locales/zh_CN/translations.json +0 -1
  113. package/build/es/shared/helpers/createChangeHandler.js +19 -16
  114. package/build/es/shared/helpers/createSelectChangeHandler.js +10 -6
  115. package/build/es/transformers/arrayWithIdObjects.js +6 -3
  116. package/build/es/validators/__tests__/createPattern.test.js +1 -1
  117. package/build/es/validators/composeValidators.js +10 -2
  118. package/build/es/validators/test-helpers/index.js +1 -1
  119. package/package.json +10 -10
@@ -19,20 +19,21 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
 
20
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
21
 
22
- const SingleSelectFieldFF = ({
23
- error,
24
- input,
25
- loading,
26
- meta,
27
- onBlur,
28
- onFocus,
29
- options,
30
- showLoadingStatus,
31
- showValidStatus,
32
- valid,
33
- validationText,
34
- ...rest
35
- }) => {
22
+ const SingleSelectFieldFF = _ref => {
23
+ let {
24
+ error,
25
+ input,
26
+ loading,
27
+ meta,
28
+ onBlur,
29
+ onFocus,
30
+ options,
31
+ showLoadingStatus,
32
+ showValidStatus,
33
+ valid,
34
+ validationText,
35
+ ...rest
36
+ } = _ref;
36
37
  return /*#__PURE__*/_react.default.createElement(_select.SingleSelectField, _extends({}, rest, {
37
38
  name: input.name,
38
39
  error: (0, _helpers.hasError)(meta, error),
@@ -22,13 +22,16 @@ const defaultOptions = [{
22
22
  options: {
23
23
  showPanel: false
24
24
  }
25
- }).add('Required', (_, {
26
- cypressProps
27
- }) => /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
28
- required: true,
29
- name: "singleSelect",
30
- label: "Single select",
31
- component: _SingleSelectFieldFF.SingleSelectFieldFF,
32
- validate: _index.hasValue,
33
- options: cypressProps.options || defaultOptions
34
- }));
25
+ }).add('Required', (_, _ref) => {
26
+ let {
27
+ cypressProps
28
+ } = _ref;
29
+ return /*#__PURE__*/_react2.default.createElement(_reactFinalForm.Field, {
30
+ required: true,
31
+ name: "singleSelect",
32
+ label: "Single select",
33
+ component: _SingleSelectFieldFF.SingleSelectFieldFF,
34
+ validate: _index.hasValue,
35
+ options: cypressProps.options || defaultOptions
36
+ });
37
+ });
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.InitialValue = exports.Default = exports.default = void 0;
6
+ exports.default = exports.InitialValue = exports.Default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -17,33 +17,7 @@ var _SingleSelectFieldFF = require("./SingleSelectFieldFF.js");
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- const description = `
21
- The \`SingleSelectFieldFF\` is a wrapper around a \`SingleSelectField\` that enables it to work with Final Form, the preferred library for form validation and utilities in DHIS 2 apps.
22
-
23
- #### Final Form
24
-
25
- See how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).
26
-
27
- 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={SingleSelectFieldFF} />\`. See the code samples below for examples.
28
-
29
- #### Props
30
-
31
- The props shown in the table below are generally provided to the \`SingleSelectFieldFF\` wrapper by the Final Form \`Field\`.
32
-
33
- Note that any props beyond the API of the \`Field\` component will be spread to the \`SingleSelectFieldFF\`, which passes any extra props to the underlying \`SingleSelectField\` using \`{...rest}\`.
34
-
35
- Therefore, to add any props to the \`SingleSelectFieldFF\` or \`SingleSelectField\`, add those props to the parent Final Form \`Field\` component.
36
-
37
- Also see \`SingleSelect\` and \`SingleSelectField\` for notes about props and implementation.
38
-
39
- \`\`\`js
40
- import { SingleSelectFieldFF } from '@dhis2/ui'
41
- \`\`\`
42
-
43
- Press **Submit** to see the form values logged to the console.
44
-
45
- _**Note:** Dropdowns may not appear correctly on this page. See the affected demos in the 'Canvas' tab for propper dropdown placement._
46
- `;
20
+ const description = "\nThe `SingleSelectFieldFF` is a wrapper around a `SingleSelectField` 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={SingleSelectFieldFF} />`. See the code samples below for examples.\n\n#### Props\n\nThe props shown in the table below are generally provided to the `SingleSelectFieldFF` wrapper by the Final Form `Field`.\n\nNote that any props beyond the API of the `Field` component will be spread to the `SingleSelectFieldFF`, which passes any extra props to the underlying `SingleSelectField` using `{...rest}`.\n\nTherefore, to add any props to the `SingleSelectFieldFF` or `SingleSelectField`, add those props to the parent Final Form `Field` component.\n\nAlso see `SingleSelect` and `SingleSelectField` for notes about props and implementation.\n\n```js\nimport { SingleSelectFieldFF } from '@dhis2/ui'\n```\n\nPress **Submit** to see the form values logged to the console.\n\n_**Note:** Dropdowns may not appear correctly on this page. See the affected demos in the 'Canvas' tab for propper dropdown placement._\n";
47
21
  const options = [{
48
22
  value: '1',
49
23
  label: 'one'
@@ -76,7 +50,7 @@ const options = [{
76
50
  label: 'ten'
77
51
  }];
78
52
  var _default = {
79
- title: 'Forms/Single Select/Single Select Field (Final Form)',
53
+ title: 'Single Select Field (Final Form)',
80
54
  component: _SingleSelectFieldFF.SingleSelectFieldFF,
81
55
  decorators: [_formDecorator.formDecorator],
82
56
  parameters: {
@@ -19,27 +19,30 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
 
20
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
21
 
22
- const SwitchFieldFF = ({
23
- error,
24
- input,
25
- meta,
26
- showValidStatus,
27
- valid,
28
- validationText,
29
- onBlur,
30
- onFocus,
31
- ...rest
32
- }) => /*#__PURE__*/_react.default.createElement(_switch.SwitchField, _extends({}, rest, {
33
- checked: input.checked,
34
- name: input.name,
35
- value: input.value,
36
- error: (0, _helpers.hasError)(meta, error),
37
- valid: (0, _helpers.isValid)(meta, valid, showValidStatus),
38
- validationText: (0, _helpers.getValidationText)(meta, validationText, error),
39
- onFocus: (0, _helpers.createFocusHandler)(input, onFocus),
40
- onChange: (0, _helpers.createToggleChangeHandler)(input),
41
- onBlur: (0, _helpers.createBlurHandler)(input, onBlur)
42
- }));
22
+ const SwitchFieldFF = _ref => {
23
+ let {
24
+ error,
25
+ input,
26
+ meta,
27
+ showValidStatus,
28
+ valid,
29
+ validationText,
30
+ onBlur,
31
+ onFocus,
32
+ ...rest
33
+ } = _ref;
34
+ return /*#__PURE__*/_react.default.createElement(_switch.SwitchField, _extends({}, rest, {
35
+ checked: input.checked,
36
+ name: input.name,
37
+ value: input.value,
38
+ error: (0, _helpers.hasError)(meta, error),
39
+ valid: (0, _helpers.isValid)(meta, valid, showValidStatus),
40
+ validationText: (0, _helpers.getValidationText)(meta, validationText, error),
41
+ onFocus: (0, _helpers.createFocusHandler)(input, onFocus),
42
+ onChange: (0, _helpers.createToggleChangeHandler)(input),
43
+ onBlur: (0, _helpers.createBlurHandler)(input, onBlur)
44
+ }));
45
+ };
43
46
 
44
47
  exports.SwitchFieldFF = SwitchFieldFF;
45
48
  SwitchFieldFF.propTypes = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ValueWhenChecked = exports.Statuses = exports.HelpText = exports.Disabled = exports.Required = exports.Default = exports.default = void 0;
6
+ exports.default = exports.ValueWhenChecked = exports.Statuses = exports.Required = exports.HelpText = exports.Disabled = exports.Default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -19,33 +19,9 @@ var _SwitchFieldFF = require("./SwitchFieldFF.js");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const description = `
23
- The \`SwitchFieldFF\` is a wrapper around a \`SwitchField\` that enables it to work with Final Form, the preferred library for form validation and utilities in DHIS 2 apps.
24
-
25
- #### Final Form
26
-
27
- See how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).
28
-
29
- 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={SwitchFieldFF} />\`. See the code samples below for examples.
30
-
31
- #### Props
32
-
33
- The props shown in the table below are generally provided to the \`SwitchFieldFF\` wrapper by the Final Form \`Field\`.
34
-
35
- Note that any props beyond the API of the \`Field\` component will be spread to the \`SwitchFieldFF\`, which passes any extra props to the underlying \`SwitchField\` using \`{...rest}\`.
36
-
37
- Therefore, to add any props to the \`SwitchFieldFF\` or \`SwitchField\`, add those props to the parent Final Form \`Field\` component.
38
-
39
- Also see \`Switch\` and \`SwitchField\` for notes about props and implementation.
40
-
41
- \`\`\`js
42
- import { SwitchFieldFF } from '@dhis2/ui'
43
- \`\`\`
44
-
45
- Press **Submit** to see the form values logged to the console.
46
- `;
22
+ const description = "\nThe `SwitchFieldFF` is a wrapper around a `SwitchField` 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={SwitchFieldFF} />`. See the code samples below for examples.\n\n#### Props\n\nThe props shown in the table below are generally provided to the `SwitchFieldFF` wrapper by the Final Form `Field`.\n\nNote that any props beyond the API of the `Field` component will be spread to the `SwitchFieldFF`, which passes any extra props to the underlying `SwitchField` using `{...rest}`.\n\nTherefore, to add any props to the `SwitchFieldFF` or `SwitchField`, add those props to the parent Final Form `Field` component.\n\nAlso see `Switch` and `SwitchField` for notes about props and implementation.\n\n```js\nimport { SwitchFieldFF } from '@dhis2/ui'\n```\n\nPress **Submit** to see the form values logged to the console.\n";
47
23
  var _default = {
48
- title: 'Forms/Switch/Switch Field (Final Form)',
24
+ title: 'Switch Field (Final Form)',
49
25
  component: _SwitchFieldFF.SwitchFieldFF,
50
26
  decorators: [_formDecorator.formDecorator],
51
27
  parameters: {
@@ -19,29 +19,32 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
 
20
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
21
 
22
- const TextAreaFieldFF = ({
23
- input,
24
- meta,
25
- error,
26
- showValidStatus,
27
- valid,
28
- validationText,
29
- onBlur,
30
- onFocus,
31
- loading,
32
- showLoadingStatus,
33
- ...rest
34
- }) => /*#__PURE__*/_react.default.createElement(_textArea.TextAreaField, _extends({}, rest, {
35
- name: input.name,
36
- error: (0, _helpers.hasError)(meta, error),
37
- valid: (0, _helpers.isValid)(meta, valid, showValidStatus),
38
- loading: (0, _helpers.isLoading)(meta, loading, showLoadingStatus),
39
- validationText: (0, _helpers.getValidationText)(meta, validationText, error),
40
- onFocus: (0, _helpers.createFocusHandler)(input, onFocus),
41
- onChange: (0, _helpers.createChangeHandler)(input),
42
- onBlur: (0, _helpers.createBlurHandler)(input, onBlur),
43
- value: input.value
44
- }));
22
+ const TextAreaFieldFF = _ref => {
23
+ let {
24
+ input,
25
+ meta,
26
+ error,
27
+ showValidStatus,
28
+ valid,
29
+ validationText,
30
+ onBlur,
31
+ onFocus,
32
+ loading,
33
+ showLoadingStatus,
34
+ ...rest
35
+ } = _ref;
36
+ return /*#__PURE__*/_react.default.createElement(_textArea.TextAreaField, _extends({}, rest, {
37
+ name: input.name,
38
+ error: (0, _helpers.hasError)(meta, error),
39
+ valid: (0, _helpers.isValid)(meta, valid, showValidStatus),
40
+ loading: (0, _helpers.isLoading)(meta, loading, showLoadingStatus),
41
+ validationText: (0, _helpers.getValidationText)(meta, validationText, error),
42
+ onFocus: (0, _helpers.createFocusHandler)(input, onFocus),
43
+ onChange: (0, _helpers.createChangeHandler)(input),
44
+ onBlur: (0, _helpers.createBlurHandler)(input, onBlur),
45
+ value: input.value
46
+ }));
47
+ };
45
48
 
46
49
  exports.TextAreaFieldFF = TextAreaFieldFF;
47
50
  TextAreaFieldFF.propTypes = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Statuses = exports.HelpText = exports.Disabled = exports.Required = exports.Autogrow = exports.Default = exports.default = void 0;
6
+ exports.default = exports.Statuses = exports.Required = exports.HelpText = exports.Disabled = exports.Default = exports.Autogrow = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -19,33 +19,9 @@ var _TextAreaFieldFF = require("./TextAreaFieldFF.js");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- const description = `
23
- 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.
24
-
25
- #### Final Form
26
-
27
- See how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).
28
-
29
- 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.
30
-
31
- #### Props
32
-
33
- The props shown in the table below are generally provided to the \`TextAreaFieldFF\` wrapper by the Final Form \`Field\`.
34
-
35
- 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}\`.
36
-
37
- Therefore, to add any props to the \`TextAreaFieldFF\` or \`TextAreaField\`, add those props to the parent Final Form \`Field\` component.
38
-
39
- Also see \`TextArea\` and \`TextAreaField\` for notes about props and implementation.
40
-
41
- \`\`\`js
42
- import { TextAreaFieldFF } from '@dhis2/ui'
43
- \`\`\`
44
-
45
- Press **Submit** to see the form values logged to the console.
46
- `;
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";
47
23
  var _default = {
48
- title: 'Forms/Text Area/Text Area Field (Final Form)',
24
+ title: 'Text Area Field (Final Form)',
49
25
  component: _TextAreaFieldFF.TextAreaFieldFF,
50
26
  decorators: [_formDecorator.formDecorator],
51
27
  parameters: {
@@ -25,8 +25,8 @@ const formProps = {
25
25
  };
26
26
 
27
27
  class FormWithSpyAndSubmit extends _react.default.Component {
28
- constructor(...args) {
29
- super(...args);
28
+ constructor() {
29
+ super(...arguments);
30
30
 
31
31
  _defineProperty(this, "state", {
32
32
  cypressProps: {}
@@ -68,9 +68,10 @@ class FormWithSpyAndSubmit extends _react.default.Component {
68
68
  }), /*#__PURE__*/_react.default.createElement(_button.Button, {
69
69
  primary: true,
70
70
  type: "submit"
71
- }, "Submit"), /*#__PURE__*/_react.default.createElement(_reactFinalForm.FormSpy, null, ({
72
- values
73
- }) => {
71
+ }, "Submit"), /*#__PURE__*/_react.default.createElement(_reactFinalForm.FormSpy, null, _ref => {
72
+ let {
73
+ values
74
+ } = _ref;
74
75
  window.formValues = values;
75
76
  return /*#__PURE__*/_react.default.createElement("span", {
76
77
  className: "form-spy-internal"
@@ -22,12 +22,19 @@ Object.defineProperty(exports, "CheckboxFieldFF", {
22
22
  return _CheckboxFieldFF.CheckboxFieldFF;
23
23
  }
24
24
  });
25
+ Object.defineProperty(exports, "FieldGroupFF", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _FieldGroupFF.FieldGroupFF;
29
+ }
30
+ });
25
31
  Object.defineProperty(exports, "FileInputFieldFF", {
26
32
  enumerable: true,
27
33
  get: function () {
28
34
  return _FileInputFieldFF.FileInputFieldFF;
29
35
  }
30
36
  });
37
+ exports.FinalForm = void 0;
31
38
  Object.defineProperty(exports, "InputFieldFF", {
32
39
  enumerable: true,
33
40
  get: function () {
@@ -40,16 +47,17 @@ Object.defineProperty(exports, "MultiSelectFieldFF", {
40
47
  return _MultiSelectFieldFF.MultiSelectFieldFF;
41
48
  }
42
49
  });
43
- Object.defineProperty(exports, "SingleSelectFieldFF", {
50
+ Object.defineProperty(exports, "RadioFieldFF", {
44
51
  enumerable: true,
45
52
  get: function () {
46
- return _SingleSelectFieldFF.SingleSelectFieldFF;
53
+ return _RadioFieldFF.RadioFieldFF;
47
54
  }
48
55
  });
49
- Object.defineProperty(exports, "RadioFieldFF", {
56
+ exports.ReactFinalForm = void 0;
57
+ Object.defineProperty(exports, "SingleSelectFieldFF", {
50
58
  enumerable: true,
51
59
  get: function () {
52
- return _RadioFieldFF.RadioFieldFF;
60
+ return _SingleSelectFieldFF.SingleSelectFieldFF;
53
61
  }
54
62
  });
55
63
  Object.defineProperty(exports, "SwitchFieldFF", {
@@ -64,13 +72,6 @@ Object.defineProperty(exports, "TextAreaFieldFF", {
64
72
  return _TextAreaFieldFF.TextAreaFieldFF;
65
73
  }
66
74
  });
67
- Object.defineProperty(exports, "FieldGroupFF", {
68
- enumerable: true,
69
- get: function () {
70
- return _FieldGroupFF.FieldGroupFF;
71
- }
72
- });
73
- exports.ReactFinalForm = exports.FinalForm = void 0;
74
75
 
75
76
  var FinalForm = _interopRequireWildcard(require("final-form"));
76
77
 
@@ -2,7 +2,6 @@
2
2
  "Upload file": "تحميل الملف",
3
3
  "Upload files": "تحميل الملفات",
4
4
  "Remove": "إزلة",
5
- "No file(s) selected yet": "لم يتم تحديد ملف (ملفات) حتى الآن",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "إزالة",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "لابردن",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Nahrát soubor",
3
3
  "Upload files": "Nahrát soubory",
4
4
  "Remove": "Odebrat",
5
- "No file(s) selected yet": "Zatím není (nejsou) vybrány žádné soubory",
6
5
  "Please provide an alpha-numeric value": "Uveďte alfanumerickou hodnotu",
7
6
  "Please provide a boolean value": "Zadejte prosím booleovskou hodnotu",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "Zadejte prosím mezi {{lowerBound}} a {{upperBound}} znaky",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "Remove",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Upload file",
3
3
  "Upload files": "Upload files",
4
4
  "Remove": "Remove",
5
- "No file(s) selected yet": "No file(s) selected yet",
6
5
  "Please provide an alpha-numeric value": "Please provide an alpha-numeric value",
7
6
  "Please provide a boolean value": "Please provide a boolean value",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "Please enter between {{lowerBound}} and {{upperBound}} characters",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Subir archivo",
3
3
  "Upload files": "Subir archivos",
4
4
  "Remove": "Eliminar",
5
- "No file(s) selected yet": "Ningún archivo (s) seleccionado (s) todavía",
6
5
  "Please provide an alpha-numeric value": "Proporcione un valor alfanumérico.",
7
6
  "Please provide a boolean value": "Proporcione un valor booleano",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "Ingresa entre {{lowerBound}} y {{upperBound}} caracteres",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Charger fichier",
3
3
  "Upload files": "",
4
4
  "Remove": "Supprimer",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "Hapus",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "យកចេញ",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "ໂຫຼດເອກະສານ",
3
3
  "Upload files": "",
4
4
  "Remove": "ລົບອອກ",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "ဖယ်ရှားခြင်း",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Last opp fil",
3
3
  "Upload files": "",
4
4
  "Remove": "Fjern",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "بارگیری فایل",
3
3
  "Upload files": "",
4
4
  "Remove": "حذف",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "فایل پورته کړئ",
3
3
  "Upload files": "",
4
4
  "Remove": "لرې کول",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Carregar arquivo",
3
3
  "Upload files": "",
4
4
  "Remove": "Remover",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Carregar arquivo",
3
3
  "Upload files": "",
4
4
  "Remove": "Remover",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Загрузить файл",
3
3
  "Upload files": "",
4
4
  "Remove": "Убрать",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "Avlägsna",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "Hasai",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Боркунии файл",
3
3
  "Upload files": "",
4
4
  "Remove": "Тоза кардан",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "Прибрати",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "",
3
3
  "Upload files": "",
4
4
  "Remove": "حذف",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",
@@ -2,7 +2,6 @@
2
2
  "Upload file": "Файлни юклаш",
3
3
  "Upload files": "",
4
4
  "Remove": "Олиб ташлаш",
5
- "No file(s) selected yet": "",
6
5
  "Please provide an alpha-numeric value": "",
7
6
  "Please provide a boolean value": "",
8
7
  "Please enter between {{lowerBound}} and {{upperBound}} characters": "",