@dhis2/ui-forms 9.11.0 → 9.11.1-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/CheckboxFieldFF/{CheckboxFieldFF.stories.e2e.js → CheckboxFieldFF.e2e.stories.js} +22 -15
- package/build/cjs/CheckboxFieldFF/CheckboxFieldFF.js +2 -12
- package/build/cjs/CheckboxFieldFF/{CheckboxFieldFF.stories.js → CheckboxFieldFF.prod.stories.js} +29 -24
- package/build/cjs/CheckboxFieldFF/features/can_toggle_a_boolean/index.js +0 -1
- package/build/cjs/CheckboxFieldFF/features/can_toggle_a_value/index.js +0 -1
- package/build/cjs/CheckboxFieldFF/features/common/index.js +0 -1
- package/build/cjs/CheckboxFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/FieldGroupFF/FieldGroupFF.js +1 -10
- package/build/cjs/FieldGroupFF/{FieldGroupFF.stories.js → FieldGroupFF.prod.stories.js} +11 -12
- package/build/cjs/FileInputFieldFF/{FileInputFieldFF.stories.e2e.js → FileInputFieldFF.e2e.stories.js} +45 -56
- package/build/cjs/FileInputFieldFF/FileInputFieldFF.js +2 -19
- package/build/cjs/FileInputFieldFF/{FileInputFieldFF.stories.js → FileInputFieldFF.prod.stories.js} +29 -22
- package/build/cjs/FileInputFieldFF/features/accepts_file/index.js +0 -1
- package/build/cjs/FileInputFieldFF/features/common/index.js +0 -1
- package/build/cjs/FileInputFieldFF/features/displays_error/index.js +0 -1
- package/build/cjs/InputFieldFF/InputFieldFF.e2e.stories.js +30 -0
- package/build/cjs/InputFieldFF/InputFieldFF.js +2 -12
- package/build/cjs/InputFieldFF/{InputFieldFF.stories.js → InputFieldFF.prod.stories.js} +29 -22
- package/build/cjs/InputFieldFF/features/can_set_a_value/index.js +0 -1
- package/build/cjs/InputFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/MultiSelectFieldFF/{MultiSelectFieldFF.stories.e2e.js → MultiSelectFieldFF.e2e.stories.js} +15 -17
- package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.js +3 -15
- package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.prod.stories.js +107 -0
- package/build/cjs/MultiSelectFieldFF/features/can_set_a_value/index.js +0 -1
- package/build/cjs/MultiSelectFieldFF/features/common/index.js +1 -2
- package/build/cjs/MultiSelectFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/RadioFieldFF/RadioFieldFF.e2e.stories.js +45 -0
- package/build/cjs/RadioFieldFF/RadioFieldFF.js +2 -12
- package/build/cjs/RadioFieldFF/{RadioFieldFF.stories.js → RadioFieldFF.prod.stories.js} +29 -16
- package/build/cjs/RadioFieldFF/features/can_set_a_value/index.js +0 -1
- package/build/cjs/RadioFieldFF/features/common/index.js +0 -1
- package/build/cjs/RadioFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.e2e.stories.js +39 -0
- package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.js +2 -12
- package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.prod.stories.js +106 -0
- package/build/cjs/SingleSelectFieldFF/features/can_set_a_value/index.js +0 -1
- package/build/cjs/SingleSelectFieldFF/features/common/index.js +0 -1
- package/build/cjs/SingleSelectFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/SwitchFieldFF/SwitchFieldFF.e2e.stories.js +56 -0
- package/build/cjs/SwitchFieldFF/SwitchFieldFF.js +2 -12
- package/build/cjs/SwitchFieldFF/{SwitchFieldFF.stories.js → SwitchFieldFF.prod.stories.js} +29 -24
- package/build/cjs/SwitchFieldFF/features/can_toggle_a_boolean/index.js +0 -1
- package/build/cjs/SwitchFieldFF/features/can_toggle_a_value/index.js +0 -1
- package/build/cjs/SwitchFieldFF/features/common/index.js +0 -1
- package/build/cjs/SwitchFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.e2e.stories.js +30 -0
- package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.js +2 -12
- package/build/cjs/TextAreaFieldFF/{TextAreaFieldFF.stories.js → TextAreaFieldFF.prod.stories.js} +29 -24
- package/build/cjs/TextAreaFieldFF/features/can_set_a_value/index.js +0 -1
- package/build/cjs/TextAreaFieldFF/features/displays_error/index.js +0 -2
- package/build/cjs/__tests__/__snapshots__/index.test.js.snap +3 -0
- package/build/cjs/__tests__/index.test.js +1 -1
- package/build/cjs/formDecorator.js +6 -21
- package/build/cjs/index.js +2 -21
- package/build/cjs/locales/index.js +3 -75
- package/build/cjs/shared/helpers/createBlurHandler.js +0 -3
- package/build/cjs/shared/helpers/createChangeHandler.js +0 -2
- package/build/cjs/shared/helpers/createFocusHandler.js +0 -3
- package/build/cjs/shared/helpers/createSelectChangeHandler.js +0 -2
- package/build/cjs/shared/helpers/createToggleChangeHandler.js +0 -3
- package/build/cjs/shared/helpers/getValidationText.js +0 -6
- package/build/cjs/shared/helpers/hasError.js +0 -2
- package/build/cjs/shared/helpers/isLoading.js +0 -2
- package/build/cjs/shared/helpers/isValid.js +0 -2
- package/build/cjs/shared/helpers.js +0 -9
- package/build/cjs/shared/propTypes.js +7 -20
- package/build/cjs/transformers/arrayWithIdObjects.js +2 -6
- package/build/cjs/transformers/index.js +0 -1
- package/build/cjs/validators/__tests__/alphaNumeric.test.js +0 -2
- package/build/cjs/validators/__tests__/boolean.test.js +0 -2
- package/build/cjs/validators/__tests__/composeValidators.test.js +0 -3
- package/build/cjs/validators/__tests__/createCharacterLengthRange.test.js +6 -6
- package/build/cjs/validators/__tests__/createEqualTo.test.js +0 -3
- package/build/cjs/validators/__tests__/createMaxCharacterLength.test.js +1 -2
- package/build/cjs/validators/__tests__/createMaxNumber.test.js +1 -2
- package/build/cjs/validators/__tests__/createMinCharacterLength.test.js +1 -2
- package/build/cjs/validators/__tests__/createMinNumber.test.js +1 -2
- package/build/cjs/validators/__tests__/createNumberRange.test.js +0 -3
- package/build/cjs/validators/__tests__/createPattern.test.js +1 -3
- package/build/cjs/validators/__tests__/dhis2Password.test.js +0 -2
- package/build/cjs/validators/__tests__/dhis2Username.test.js +0 -2
- package/build/cjs/validators/__tests__/email.test.js +7 -6
- package/build/cjs/validators/__tests__/hasValue.test.js +0 -2
- package/build/cjs/validators/__tests__/integer.test.js +0 -2
- package/build/cjs/validators/__tests__/internationalPhoneNumber.test.js +6 -5
- package/build/cjs/validators/__tests__/number.test.js +0 -2
- package/build/cjs/validators/__tests__/string.test.js +0 -2
- package/build/cjs/validators/__tests__/url.test.js +1 -2
- package/build/cjs/validators/alphaNumeric.js +2 -11
- package/build/cjs/validators/boolean.js +2 -10
- package/build/cjs/validators/composeValidators.js +0 -4
- package/build/cjs/validators/createCharacterLengthRange.js +1 -8
- package/build/cjs/validators/createEqualTo.js +1 -8
- package/build/cjs/validators/createMaxCharacterLength.js +1 -6
- package/build/cjs/validators/createMaxNumber.js +1 -6
- package/build/cjs/validators/createMinCharacterLength.js +1 -6
- package/build/cjs/validators/createMinNumber.js +1 -6
- package/build/cjs/validators/createNumberRange.js +1 -8
- package/build/cjs/validators/createPattern.js +2 -10
- package/build/cjs/validators/dhis2Password.js +6 -28
- package/build/cjs/validators/dhis2Username.js +2 -11
- package/build/cjs/validators/email.js +3 -11
- package/build/cjs/validators/hasValue.js +2 -10
- package/build/cjs/validators/helpers/index.js +1 -16
- package/build/cjs/validators/index.js +0 -20
- package/build/cjs/validators/integer.js +3 -10
- package/build/cjs/validators/internationalPhoneNumber.js +8 -14
- package/build/cjs/validators/number.js +2 -10
- package/build/cjs/validators/string.js +2 -10
- package/build/cjs/validators/test-helpers/index.js +1 -6
- package/build/cjs/validators/url.js +2 -11
- package/build/es/CheckboxFieldFF/{CheckboxFieldFF.stories.e2e.js → CheckboxFieldFF.e2e.stories.js} +14 -7
- package/build/es/CheckboxFieldFF/CheckboxFieldFF.js +1 -3
- package/build/es/CheckboxFieldFF/{CheckboxFieldFF.stories.js → CheckboxFieldFF.prod.stories.js} +29 -3
- package/build/es/FieldGroupFF/FieldGroupFF.js +0 -2
- package/build/es/FieldGroupFF/{FieldGroupFF.stories.js → FieldGroupFF.prod.stories.js} +11 -1
- package/build/es/FileInputFieldFF/{FileInputFieldFF.stories.e2e.js → FileInputFieldFF.e2e.stories.js} +14 -16
- package/build/es/FileInputFieldFF/FileInputFieldFF.js +1 -8
- package/build/es/FileInputFieldFF/{FileInputFieldFF.stories.js → FileInputFieldFF.prod.stories.js} +29 -3
- package/build/es/InputFieldFF/{InputFieldFF.stories.e2e.js → InputFieldFF.e2e.stories.js} +8 -4
- package/build/es/InputFieldFF/InputFieldFF.js +1 -3
- package/build/es/InputFieldFF/{InputFieldFF.stories.js → InputFieldFF.prod.stories.js} +29 -3
- package/build/es/MultiSelectFieldFF/{MultiSelectFieldFF.stories.e2e.js → MultiSelectFieldFF.e2e.stories.js} +7 -7
- package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.js +2 -6
- package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.prod.stories.js +98 -0
- package/build/es/MultiSelectFieldFF/features/common/index.js +1 -1
- package/build/es/RadioFieldFF/{RadioFieldFF.stories.e2e.js → RadioFieldFF.e2e.stories.js} +6 -3
- package/build/es/RadioFieldFF/RadioFieldFF.js +1 -3
- package/build/es/RadioFieldFF/{RadioFieldFF.stories.js → RadioFieldFF.prod.stories.js} +29 -3
- package/build/es/SingleSelectFieldFF/{SingleSelectFieldFF.stories.e2e.js → SingleSelectFieldFF.e2e.stories.js} +10 -6
- package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.js +1 -3
- package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.prod.stories.js +97 -0
- package/build/es/SwitchFieldFF/{SwitchFieldFF.stories.e2e.js → SwitchFieldFF.e2e.stories.js} +14 -7
- package/build/es/SwitchFieldFF/SwitchFieldFF.js +1 -3
- package/build/es/SwitchFieldFF/{SwitchFieldFF.stories.js → SwitchFieldFF.prod.stories.js} +29 -3
- package/build/es/TextAreaFieldFF/{TextAreaFieldFF.stories.e2e.js → TextAreaFieldFF.e2e.stories.js} +8 -4
- package/build/es/TextAreaFieldFF/TextAreaFieldFF.js +1 -3
- package/build/es/TextAreaFieldFF/{TextAreaFieldFF.stories.js → TextAreaFieldFF.prod.stories.js} +29 -3
- package/build/es/__tests__/__snapshots__/index.test.js.snap +3 -0
- package/build/es/__tests__/index.test.js +1 -0
- package/build/es/formDecorator.js +5 -12
- package/build/es/index.js +2 -2
- package/build/es/shared/helpers/createBlurHandler.js +0 -2
- package/build/es/shared/helpers/createChangeHandler.js +0 -2
- package/build/es/shared/helpers/createFocusHandler.js +0 -2
- package/build/es/shared/helpers/createSelectChangeHandler.js +0 -1
- package/build/es/shared/helpers/createToggleChangeHandler.js +0 -2
- package/build/es/shared/helpers/getValidationText.js +0 -5
- package/build/es/shared/helpers/hasError.js +0 -1
- package/build/es/shared/helpers/isLoading.js +0 -1
- package/build/es/shared/helpers/isValid.js +0 -1
- package/build/es/transformers/arrayWithIdObjects.js +0 -2
- package/build/es/validators/__tests__/createCharacterLengthRange.test.js +6 -3
- package/build/es/validators/__tests__/createMaxCharacterLength.test.js +1 -0
- package/build/es/validators/__tests__/createMaxNumber.test.js +1 -0
- package/build/es/validators/__tests__/createMinCharacterLength.test.js +1 -0
- package/build/es/validators/__tests__/createMinNumber.test.js +1 -0
- package/build/es/validators/__tests__/createPattern.test.js +1 -1
- package/build/es/validators/__tests__/email.test.js +7 -4
- package/build/es/validators/__tests__/internationalPhoneNumber.test.js +6 -3
- package/build/es/validators/__tests__/url.test.js +1 -0
- package/build/es/validators/alphaNumeric.js +0 -2
- package/build/es/validators/boolean.js +0 -2
- package/build/es/validators/composeValidators.js +0 -2
- package/build/es/validators/createCharacterLengthRange.js +0 -2
- package/build/es/validators/createEqualTo.js +0 -2
- package/build/es/validators/createMaxCharacterLength.js +0 -2
- package/build/es/validators/createMaxNumber.js +0 -2
- package/build/es/validators/createMinCharacterLength.js +0 -2
- package/build/es/validators/createMinNumber.js +0 -2
- package/build/es/validators/createNumberRange.js +0 -2
- package/build/es/validators/createPattern.js +0 -3
- package/build/es/validators/dhis2Password.js +3 -12
- package/build/es/validators/dhis2Username.js +0 -2
- package/build/es/validators/email.js +1 -2
- package/build/es/validators/hasValue.js +0 -2
- package/build/es/validators/integer.js +3 -4
- package/build/es/validators/internationalPhoneNumber.js +7 -7
- package/build/es/validators/number.js +0 -2
- package/build/es/validators/string.js +0 -2
- package/build/es/validators/test-helpers/index.js +1 -4
- package/build/es/validators/url.js +2 -3
- package/package.json +13 -13
- package/build/cjs/InputFieldFF/InputFieldFF.stories.e2e.js +0 -27
- package/build/cjs/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +0 -91
- package/build/cjs/RadioFieldFF/RadioFieldFF.stories.e2e.js +0 -45
- package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.e2e.js +0 -37
- package/build/cjs/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +0 -90
- package/build/cjs/SwitchFieldFF/SwitchFieldFF.stories.e2e.js +0 -49
- package/build/cjs/TextAreaFieldFF/TextAreaFieldFF.stories.e2e.js +0 -27
- package/build/es/MultiSelectFieldFF/MultiSelectFieldFF.stories.js +0 -70
- package/build/es/SingleSelectFieldFF/SingleSelectFieldFF.stories.js +0 -69
@@ -4,41 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.FileInputFieldFF = void 0;
|
7
|
-
|
8
7
|
var _fileInput = require("@dhis2-ui/file-input");
|
9
|
-
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
11
|
-
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
13
|
-
|
14
10
|
var _index = _interopRequireDefault(require("../locales/index.js"));
|
15
|
-
|
16
11
|
var _helpers = require("../shared/helpers.js");
|
17
|
-
|
18
12
|
var _propTypes2 = require("../shared/propTypes.js");
|
19
|
-
|
20
|
-
function
|
21
|
-
|
22
|
-
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); }
|
23
|
-
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
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); }
|
24
15
|
const btnLabel = _index.default.t('Upload file');
|
25
|
-
|
26
16
|
const btnLabelMulti = _index.default.t('Upload files');
|
27
|
-
|
28
17
|
const dedupeAndConcat = (currentFiles, newFileList) => {
|
29
18
|
return [...currentFiles, ...newFileList].reduceRight((acc, file) => {
|
30
19
|
if (!acc.unique.has(file.name)) {
|
31
20
|
acc.unique.add(file.name);
|
32
21
|
acc.files.unshift(file);
|
33
22
|
}
|
34
|
-
|
35
23
|
return acc;
|
36
24
|
}, {
|
37
25
|
files: [],
|
38
26
|
unique: new Set()
|
39
27
|
}).files;
|
40
28
|
};
|
41
|
-
|
42
29
|
const createChangeHandler = (input, multifile) => _ref => {
|
43
30
|
let {
|
44
31
|
files
|
@@ -50,13 +37,11 @@ const createChangeHandler = (input, multifile) => _ref => {
|
|
50
37
|
const value = multifile ? dedupeAndConcat(currentFiles, files) : [...files];
|
51
38
|
input.onChange(value);
|
52
39
|
};
|
53
|
-
|
54
40
|
const createRemoveHandler = (input, fileToDelete) => () => {
|
55
41
|
const files = input.value.filter(file => file !== fileToDelete);
|
56
42
|
const value = files.length > 0 ? files : '';
|
57
43
|
input.onChange(value);
|
58
44
|
};
|
59
|
-
|
60
45
|
const FileInputFieldFF = _ref2 => {
|
61
46
|
let {
|
62
47
|
buttonLabel,
|
@@ -87,12 +72,10 @@ const FileInputFieldFF = _ref2 => {
|
|
87
72
|
removeText: _index.default.t('Remove')
|
88
73
|
})));
|
89
74
|
};
|
90
|
-
|
91
75
|
exports.FileInputFieldFF = FileInputFieldFF;
|
92
76
|
FileInputFieldFF.propTypes = {
|
93
77
|
/** `input` props provided by Final Form `Field` */
|
94
78
|
input: _propTypes2.inputPropType.isRequired,
|
95
|
-
|
96
79
|
/** `meta` props provided by Final Form `Field` */
|
97
80
|
meta: _propTypes2.metaPropType.isRequired,
|
98
81
|
buttonLabel: _propTypes.default.string,
|
package/build/cjs/FileInputFieldFF/{FileInputFieldFF.stories.js → FileInputFieldFF.prod.stories.js}
RENAMED
@@ -4,24 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = exports.WithValues = exports.Required = exports.PreventPlaceholder = exports.Multifile = 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 _FileInputFieldFF = require("./FileInputFieldFF.js");
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
const description = `
|
15
|
+
The \`FileInputFieldFF\` is a wrapper around a \`FileInputField\` that enables it to work with Final Form, the preferred library in DHIS 2 apps for form validation and utilities.
|
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={FileInputFieldFF} />\`. See the code samples below for examples.
|
22
|
+
|
23
|
+
#### Props
|
24
|
+
|
25
|
+
The props shown in the table below are generally provided to the \`FileInputFieldFF\` wrapper by the Final Form \`Field\`.
|
26
|
+
|
27
|
+
Note that any props beyond the API of the \`Field\` component will be spread to the \`FileInputFieldFF\`, which passes any extra props to the underlying \`FileInputField\` using \`{...rest}\`.
|
19
28
|
|
20
|
-
|
29
|
+
Therefore, to add any props to the \`FileInputFieldFF\` or \`FileInputField\`, add those props to the parent Final Form \`Field\` component.
|
21
30
|
|
22
|
-
|
31
|
+
Also see \`FileInput\` and \`FileInputField\` for notes about props and implementation.
|
32
|
+
|
33
|
+
\`\`\`js
|
34
|
+
import { FileInputFieldFF } from '@dhis2/ui'
|
35
|
+
\`\`\`
|
36
|
+
|
37
|
+
Press **Submit** to see the form values logged to the console.
|
38
|
+
`;
|
23
39
|
const files = [new File([], 'file1.txt'), new File([], 'file2.txt')];
|
24
|
-
var _default = {
|
40
|
+
var _default = exports.default = {
|
25
41
|
title: 'File Input Field (Final Form)',
|
26
42
|
component: _FileInputFieldFF.FileInputFieldFF,
|
27
43
|
decorators: [_formDecorator.formDecorator],
|
@@ -33,22 +49,20 @@ var _default = {
|
|
33
49
|
}
|
34
50
|
},
|
35
51
|
argTypes: {
|
36
|
-
input: {
|
52
|
+
input: {
|
53
|
+
..._propTypes.inputArgType
|
37
54
|
},
|
38
|
-
meta: {
|
55
|
+
meta: {
|
56
|
+
..._propTypes.metaArgType
|
39
57
|
}
|
40
58
|
}
|
41
59
|
};
|
42
|
-
exports.default = _default;
|
43
|
-
|
44
60
|
const Default = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
45
61
|
component: _FileInputFieldFF.FileInputFieldFF,
|
46
62
|
name: "upload",
|
47
63
|
label: "This is a file upload"
|
48
64
|
});
|
49
|
-
|
50
65
|
exports.Default = Default;
|
51
|
-
|
52
66
|
const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
53
67
|
component: _FileInputFieldFF.FileInputFieldFF,
|
54
68
|
name: "upload",
|
@@ -56,18 +70,14 @@ const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm
|
|
56
70
|
required: true,
|
57
71
|
validate: _index.hasValue
|
58
72
|
});
|
59
|
-
|
60
73
|
exports.Required = Required;
|
61
|
-
|
62
74
|
const Multifile = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
63
75
|
component: _FileInputFieldFF.FileInputFieldFF,
|
64
76
|
name: "upload",
|
65
77
|
label: "This is a file upload",
|
66
78
|
multifile: true
|
67
79
|
});
|
68
|
-
|
69
80
|
exports.Multifile = Multifile;
|
70
|
-
|
71
81
|
const WithValues = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
72
82
|
component: _FileInputFieldFF.FileInputFieldFF,
|
73
83
|
name: "upload",
|
@@ -77,16 +87,13 @@ const WithValues = () => /*#__PURE__*/_react.default.createElement(_reactFinalFo
|
|
77
87
|
initialValue: files,
|
78
88
|
validate: _index.hasValue
|
79
89
|
});
|
80
|
-
|
81
90
|
exports.WithValues = WithValues;
|
82
91
|
WithValues.storyName = 'With values';
|
83
|
-
|
84
92
|
const PreventPlaceholder = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
85
93
|
component: _FileInputFieldFF.FileInputFieldFF,
|
86
94
|
name: "upload",
|
87
95
|
label: "This is a file upload",
|
88
96
|
placeholder: ""
|
89
97
|
});
|
90
|
-
|
91
98
|
exports.PreventPlaceholder = PreventPlaceholder;
|
92
99
|
PreventPlaceholder.storyName = 'Prevent placeholder';
|
@@ -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)('a file with the wrong file type is provided', () => {
|
6
5
|
cy.get('[name="fileTxt"]').uploadSingleFile('md', 'FileInput/file.md');
|
7
6
|
});
|
@@ -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 _InputFieldFF = require("./InputFieldFF.js");
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
13
|
+
var _default = exports.default = {
|
14
|
+
title: 'Testing:InputFieldFF',
|
15
|
+
decorators: [_formDecorator.formDecorator]
|
16
|
+
};
|
17
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
18
|
+
component: _InputFieldFF.InputFieldFF,
|
19
|
+
name: "agree",
|
20
|
+
label: "Do you agree?"
|
21
|
+
});
|
22
|
+
exports.Default = Default;
|
23
|
+
const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
24
|
+
name: "agree",
|
25
|
+
component: _InputFieldFF.InputFieldFF,
|
26
|
+
required: true,
|
27
|
+
validate: _index.hasValue,
|
28
|
+
label: "Do you agree?"
|
29
|
+
});
|
30
|
+
exports.Required = Required;
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.InputFieldFF = void 0;
|
7
|
-
|
8
7
|
var _input = require("@dhis2-ui/input");
|
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
|
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 InputFieldFF = _ref => {
|
23
15
|
let {
|
24
16
|
input,
|
@@ -46,12 +38,10 @@ const InputFieldFF = _ref => {
|
|
46
38
|
value: input.value
|
47
39
|
}));
|
48
40
|
};
|
49
|
-
|
50
41
|
exports.InputFieldFF = InputFieldFF;
|
51
42
|
InputFieldFF.propTypes = {
|
52
43
|
/** `input` props received from Final Form `Field` */
|
53
44
|
input: _propTypes2.inputPropType.isRequired,
|
54
|
-
|
55
45
|
/** `meta` props received from Final Form `Field` */
|
56
46
|
meta: _propTypes2.metaPropType.isRequired,
|
57
47
|
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 = 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 _InputFieldFF = require("./InputFieldFF.js");
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
const description = `
|
15
|
+
The \`InputFieldFF\` is a wrapper around a \`InputField\` 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={InputFieldFF} />\`. See the code samples below for examples.
|
22
|
+
|
23
|
+
#### Props
|
24
|
+
|
25
|
+
The props shown in the table below are generally provided to the \`InputFieldFF\` wrapper by the Final Form \`Field\`.
|
26
|
+
|
27
|
+
Note that any props beyond the API of the \`Field\` component will be spread to the \`InputFieldFF\`, which passes any extra props to the underlying \`InputField\` using \`{...rest}\`.
|
19
28
|
|
20
|
-
|
29
|
+
Therefore, to add any props to the \`InputFieldFF\` or \`InputField\`, add those props to the parent Final Form \`Field\` component.
|
21
30
|
|
22
|
-
|
23
|
-
|
31
|
+
Also see \`InputField\` for notes about props and implementation.
|
32
|
+
|
33
|
+
\`\`\`js
|
34
|
+
import { InputFieldFF } 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: 'Input Field (Final Form)',
|
25
41
|
component: _InputFieldFF.InputFieldFF,
|
26
42
|
decorators: [_formDecorator.formDecorator],
|
@@ -32,22 +48,20 @@ var _default = {
|
|
32
48
|
}
|
33
49
|
},
|
34
50
|
argTypes: {
|
35
|
-
input: {
|
51
|
+
input: {
|
52
|
+
..._propTypes.inputArgType
|
36
53
|
},
|
37
|
-
meta: {
|
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: _InputFieldFF.InputFieldFF,
|
45
61
|
name: "agree",
|
46
62
|
label: "Do you agree?"
|
47
63
|
});
|
48
|
-
|
49
64
|
exports.Default = Default;
|
50
|
-
|
51
65
|
const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
52
66
|
name: "agree",
|
53
67
|
component: _InputFieldFF.InputFieldFF,
|
@@ -55,28 +69,22 @@ const Required = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm
|
|
55
69
|
validate: _index.hasValue,
|
56
70
|
label: "Do you agree?"
|
57
71
|
});
|
58
|
-
|
59
72
|
exports.Required = Required;
|
60
|
-
|
61
73
|
const Disabled = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
62
74
|
name: "agree",
|
63
75
|
component: _InputFieldFF.InputFieldFF,
|
64
76
|
disabled: true,
|
65
77
|
label: "Do you agree?"
|
66
78
|
});
|
67
|
-
|
68
79
|
exports.Disabled = Disabled;
|
69
|
-
|
70
80
|
const HelpText = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
71
81
|
name: "agree",
|
72
82
|
component: _InputFieldFF.InputFieldFF,
|
73
83
|
label: "Do you agree?",
|
74
84
|
helpText: "Click to agree"
|
75
85
|
});
|
76
|
-
|
77
86
|
exports.HelpText = HelpText;
|
78
87
|
HelpText.storyName = 'Help text';
|
79
|
-
|
80
88
|
const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
81
89
|
name: "valid",
|
82
90
|
component: _InputFieldFF.InputFieldFF,
|
@@ -96,5 +104,4 @@ const Statuses = () => /*#__PURE__*/_react.default.createElement(_react.default.
|
|
96
104
|
error: true,
|
97
105
|
validationText: "Validation text"
|
98
106
|
}));
|
99
|
-
|
100
107
|
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 Input with no text is rendered', () => {
|
6
5
|
cy.visitStory('Testing:InputFieldFF', 'Default');
|
7
6
|
cy.verifyFormValue('agree', 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 Input is rendered', () => {
|
8
6
|
cy.visitStory('Testing:InputFieldFF', 'Required');
|
9
7
|
cy.verifyFormValue('agree', undefined);
|
@@ -1,19 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = exports.Required = 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 _MultiSelectFieldFF = require("./MultiSelectFieldFF.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
|
const defaultOptions = [{
|
18
14
|
value: 'first',
|
19
15
|
label: 'First'
|
@@ -21,15 +17,16 @@ const defaultOptions = [{
|
|
21
17
|
value: 'second',
|
22
18
|
label: 'Second'
|
23
19
|
}];
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
20
|
+
var _default = exports.default = {
|
21
|
+
title: 'MultiSelectFieldFF',
|
22
|
+
component: _MultiSelectFieldFF.MultiSelectFieldFF,
|
23
|
+
decorators: [_formDecorator.formDecorator]
|
24
|
+
};
|
25
|
+
const Required = (_, _ref) => {
|
29
26
|
let {
|
30
27
|
cypressProps
|
31
28
|
} = _ref;
|
32
|
-
return /*#__PURE__*/
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
33
30
|
required: true,
|
34
31
|
name: "multiSelect",
|
35
32
|
label: "Multi select",
|
@@ -37,4 +34,5 @@ const defaultOptions = [{
|
|
37
34
|
validate: _index.hasValue,
|
38
35
|
options: cypressProps.options || defaultOptions
|
39
36
|
});
|
40
|
-
}
|
37
|
+
};
|
38
|
+
exports.Required = Required;
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MultiSelectFieldFF = void 0;
|
7
|
-
|
8
7
|
var _select = require("@dhis2-ui/select");
|
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
|
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 MultiSelectFieldFF = _ref => {
|
23
15
|
let {
|
24
16
|
error,
|
@@ -43,19 +35,15 @@ const MultiSelectFieldFF = _ref => {
|
|
43
35
|
onFocus: (0, _helpers.createFocusHandler)(input, onFocus),
|
44
36
|
onChange: (0, _helpers.createSelectChangeHandler)(input),
|
45
37
|
onBlur: (0, _helpers.createBlurHandler)(input, onBlur),
|
46
|
-
selected: input.value || []
|
47
|
-
/* input.value is an empty string initially, so we're providing an empty array if falsey */
|
48
|
-
|
38
|
+
selected: input.value || [] /* input.value is an empty string initially, so we're providing an empty array if falsey */
|
49
39
|
}), options.map(option => /*#__PURE__*/_react.default.createElement(_select.MultiSelectOption, _extends({
|
50
40
|
key: option.value
|
51
41
|
}, option))));
|
52
42
|
};
|
53
|
-
|
54
43
|
exports.MultiSelectFieldFF = MultiSelectFieldFF;
|
55
44
|
MultiSelectFieldFF.propTypes = {
|
56
45
|
/** `input` props provided by Final Form `Field` */
|
57
46
|
input: _propTypes2.inputPropType.isRequired,
|
58
|
-
|
59
47
|
/** `meta` props provided by Final Form `Field` */
|
60
48
|
meta: _propTypes2.metaPropType.isRequired,
|
61
49
|
error: _propTypes.default.bool,
|
@@ -0,0 +1,107 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = exports.InitialValue = 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 _propTypes = require("../shared/propTypes.js");
|
11
|
+
var _MultiSelectFieldFF = require("./MultiSelectFieldFF.js");
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
13
|
+
const description = `
|
14
|
+
The \`MultiSelectFieldFF\` is a wrapper around a \`MultiSelectField\` that enables it to work with Final Form, the preferred library for form validation and utilities in DHIS 2 apps.
|
15
|
+
|
16
|
+
#### Final Form
|
17
|
+
|
18
|
+
See how to use Final Form at [Final Form - Getting Started](https://final-form.org/docs/react-final-form/getting-started).
|
19
|
+
|
20
|
+
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={MultiSelectFieldFF} />\`. See the code samples below for examples.
|
21
|
+
|
22
|
+
#### Props
|
23
|
+
|
24
|
+
The props shown in the table below are generally provided to the \`MultiSelectFieldFF\` wrapper by the Final Form \`Field\`.
|
25
|
+
|
26
|
+
Note that any props beyond the API of the \`Field\` component will be spread to the \`MultiSelectFieldFF\`, which passes any extra props to the underlying \`MultiSelectField\` using \`{...rest}\`.
|
27
|
+
|
28
|
+
Therefore, to add any props to the \`MultiSelectFieldFF\` or \`MultiSelectField\`, add those props to the parent Final Form \`Field\` component.
|
29
|
+
|
30
|
+
Also see \`MultiSelect\` and \`MultiSelectField\` for notes about props and implementation.
|
31
|
+
|
32
|
+
\`\`\`js
|
33
|
+
import { MultiSelectFieldFF } from '@dhis2/ui'
|
34
|
+
\`\`\`
|
35
|
+
|
36
|
+
Press **Submit** to see the form values logged to the console.
|
37
|
+
|
38
|
+
_**Note:** Dropdowns may not appear correctly on this page. See the affected demos in the 'Canvas' tab for propper dropdown placement._
|
39
|
+
`;
|
40
|
+
const options = [{
|
41
|
+
value: '1',
|
42
|
+
label: 'one'
|
43
|
+
}, {
|
44
|
+
value: '2',
|
45
|
+
label: 'two'
|
46
|
+
}, {
|
47
|
+
value: '3',
|
48
|
+
label: 'three'
|
49
|
+
}, {
|
50
|
+
value: '4',
|
51
|
+
label: 'four'
|
52
|
+
}, {
|
53
|
+
value: '5',
|
54
|
+
label: 'five'
|
55
|
+
}, {
|
56
|
+
value: '6',
|
57
|
+
label: 'six'
|
58
|
+
}, {
|
59
|
+
value: '7',
|
60
|
+
label: 'seven'
|
61
|
+
}, {
|
62
|
+
value: '8',
|
63
|
+
label: 'eight'
|
64
|
+
}, {
|
65
|
+
value: '9',
|
66
|
+
label: 'nine'
|
67
|
+
}, {
|
68
|
+
value: '10',
|
69
|
+
label: 'ten'
|
70
|
+
}];
|
71
|
+
const initialValue = ['3', '4', '9', '10'];
|
72
|
+
var _default = exports.default = {
|
73
|
+
title: 'Multi Select Field (Final Form)',
|
74
|
+
component: _MultiSelectFieldFF.MultiSelectFieldFF,
|
75
|
+
decorators: [_formDecorator.formDecorator],
|
76
|
+
parameters: {
|
77
|
+
docs: {
|
78
|
+
description: {
|
79
|
+
component: description
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
argTypes: {
|
84
|
+
input: {
|
85
|
+
..._propTypes.inputArgType
|
86
|
+
},
|
87
|
+
meta: {
|
88
|
+
..._propTypes.metaArgType
|
89
|
+
}
|
90
|
+
}
|
91
|
+
};
|
92
|
+
const Default = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
93
|
+
component: _MultiSelectFieldFF.MultiSelectFieldFF,
|
94
|
+
name: "agree",
|
95
|
+
label: "Do you agree?",
|
96
|
+
options: options
|
97
|
+
});
|
98
|
+
exports.Default = Default;
|
99
|
+
const InitialValue = () => /*#__PURE__*/_react.default.createElement(_reactFinalForm.Field, {
|
100
|
+
component: _MultiSelectFieldFF.MultiSelectFieldFF,
|
101
|
+
name: "agree",
|
102
|
+
label: "Do you agree?",
|
103
|
+
options: options,
|
104
|
+
initialValue: initialValue
|
105
|
+
});
|
106
|
+
exports.InitialValue = InitialValue;
|
107
|
+
InitialValue.storyName = 'InitialValue';
|
@@ -1,9 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _cypressCucumberPreprocessor = require("@badeball/cypress-cucumber-preprocessor");
|
4
|
-
|
5
4
|
(0, _cypressCucumberPreprocessor.Given)('a required MultiSelect with no selected value', () => {
|
6
|
-
cy.visitStory('
|
5
|
+
cy.visitStory('MultiSelectFieldFF', 'Required');
|
7
6
|
cy.getFormValue('multiSelect');
|
8
7
|
cy.verifyFormValue('multiSelect', undefined);
|
9
8
|
});
|
@@ -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.When)('the user submits the form', () => {
|
8
6
|
cy.get('button[type="submit"]').click();
|
9
7
|
});
|