hrm_ui_lib 2.0.0-alpha.19 → 2.0.0-alpha.20
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { useForm } from 'react-hook-form';
|
|
4
4
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -70,13 +70,6 @@ var FormContainer = function FormContainer(props) {
|
|
|
70
70
|
formId = props.formId,
|
|
71
71
|
onSubmit = props.onSubmit,
|
|
72
72
|
language = props.language;
|
|
73
|
-
useEffect(function () {
|
|
74
|
-
if (validationScheme) {
|
|
75
|
-
console.log('Validation scheme changed');
|
|
76
|
-
reset();
|
|
77
|
-
trigger();
|
|
78
|
-
}
|
|
79
|
-
}, [validationScheme]);
|
|
80
73
|
var _useForm = useForm({
|
|
81
74
|
mode: mode,
|
|
82
75
|
resolver: yupResolver(validationScheme),
|
|
@@ -110,7 +103,8 @@ var FormContainer = function FormContainer(props) {
|
|
|
110
103
|
return /*#__PURE__*/React.createElement("form", {
|
|
111
104
|
onSubmit: handleSubmit(customSubmit),
|
|
112
105
|
id: formId,
|
|
113
|
-
className: classNames('form-container', className)
|
|
106
|
+
className: classNames('form-container', className),
|
|
107
|
+
key: language
|
|
114
108
|
}, /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
115
109
|
value: {
|
|
116
110
|
trigger: trigger,
|
|
@@ -132,8 +126,7 @@ var FormContainer = function FormContainer(props) {
|
|
|
132
126
|
onSubmit: function onSubmit() {
|
|
133
127
|
return handleSubmit(customSubmit)();
|
|
134
128
|
}
|
|
135
|
-
}
|
|
136
|
-
key: language
|
|
129
|
+
}
|
|
137
130
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, children, buttonConfigs && /*#__PURE__*/React.createElement("div", {
|
|
138
131
|
className: "form-container__buttons"
|
|
139
132
|
}, buttonConfigs.map(function (buttonConfig, index) {
|