@rhc-shared-components/form-multi-select-component 0.0.2 → 0.0.4
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.
- package/dist/index.js +5 -2
- package/dist/index.modern.js +5 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -61,7 +61,8 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
61
61
|
var _useFormikContext = formik.useFormikContext(),
|
|
62
62
|
isSubmitting = _useFormikContext.isSubmitting,
|
|
63
63
|
setFieldValue = _useFormikContext.setFieldValue,
|
|
64
|
-
validateField = _useFormikContext.validateField
|
|
64
|
+
validateField = _useFormikContext.validateField,
|
|
65
|
+
setFieldTouched = _useFormikContext.setFieldTouched;
|
|
65
66
|
|
|
66
67
|
var _React$useState = React__namespace.useState(false),
|
|
67
68
|
isOpen = _React$useState[0],
|
|
@@ -85,6 +86,8 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
85
86
|
setFieldValue(rest.name, [].concat(value, [selection]));
|
|
86
87
|
validateField(rest.name);
|
|
87
88
|
}
|
|
89
|
+
|
|
90
|
+
setFieldTouched(rest.name, true);
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
React__namespace.useEffect(function () {
|
|
@@ -102,7 +105,7 @@ var FormMultiSelectInput = function FormMultiSelectInput(_ref) {
|
|
|
102
105
|
};
|
|
103
106
|
|
|
104
107
|
return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(formGroupContainer.FormGroupContainer, {
|
|
105
|
-
validated: meta.error ? reactCore.ValidatedOptions.error : reactCore.ValidatedOptions["default"],
|
|
108
|
+
validated: meta.touched && meta.error ? reactCore.ValidatedOptions.error : reactCore.ValidatedOptions["default"],
|
|
106
109
|
helperTextInvalid: meta.error,
|
|
107
110
|
isRequired: isRequired,
|
|
108
111
|
fieldId: rest.name,
|
package/dist/index.modern.js
CHANGED
|
@@ -41,7 +41,8 @@ const FormMultiSelectInput = _ref => {
|
|
|
41
41
|
const {
|
|
42
42
|
isSubmitting,
|
|
43
43
|
setFieldValue,
|
|
44
|
-
validateField
|
|
44
|
+
validateField,
|
|
45
|
+
setFieldTouched
|
|
45
46
|
} = useFormikContext();
|
|
46
47
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
47
48
|
const [selected, setSelected] = React.useState([]);
|
|
@@ -58,6 +59,8 @@ const FormMultiSelectInput = _ref => {
|
|
|
58
59
|
setFieldValue(rest.name, [...value, selection]);
|
|
59
60
|
validateField(rest.name);
|
|
60
61
|
}
|
|
62
|
+
|
|
63
|
+
setFieldTouched(rest.name, true);
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
React.useEffect(() => {
|
|
@@ -75,7 +78,7 @@ const FormMultiSelectInput = _ref => {
|
|
|
75
78
|
};
|
|
76
79
|
|
|
77
80
|
return React.createElement(React.Fragment, null, React.createElement(FormGroupContainer, {
|
|
78
|
-
validated: meta.error ? ValidatedOptions.error : ValidatedOptions.default,
|
|
81
|
+
validated: meta.touched && meta.error ? ValidatedOptions.error : ValidatedOptions.default,
|
|
79
82
|
helperTextInvalid: meta.error,
|
|
80
83
|
isRequired: isRequired,
|
|
81
84
|
fieldId: rest.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhc-shared-components/form-multi-select-component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "project description",
|
|
5
5
|
"author": "shkale",
|
|
6
6
|
"license": "MIT",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "a8ed9cc748eefbfdd57bfae01aef27dd11ea0f0b"
|
|
81
81
|
}
|