@portnet/ui 0.0.101 → 0.0.103
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/components/inputs/PuiAutocomplete.js +3 -0
- package/dist/components/inputs/PuiDateField.js +4 -1
- package/dist/components/inputs/PuiDateTimeField.js +4 -1
- package/dist/components/inputs/PuiFileField.js +3 -0
- package/dist/components/inputs/PuiTextField.js +3 -0
- package/dist/components/others/PuiFormikForm.js +7 -4
- package/package.json +1 -1
|
@@ -145,6 +145,9 @@ const PuiStandardAutocomplete = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
145
145
|
label: label,
|
|
146
146
|
error: error,
|
|
147
147
|
helperText: helperText,
|
|
148
|
+
inputProps: _objectSpread(_objectSpread({}, params.inputProps), {}, {
|
|
149
|
+
name
|
|
150
|
+
}),
|
|
148
151
|
InputProps: _objectSpread(_objectSpread({}, params.InputProps), {}, {
|
|
149
152
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
150
153
|
children: [loading && !disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
@@ -108,7 +108,10 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
108
108
|
onBlur: onBlur,
|
|
109
109
|
helperText: helperText
|
|
110
110
|
}, params), {}, {
|
|
111
|
-
error: params.error || error
|
|
111
|
+
error: params.error || error,
|
|
112
|
+
inputProps: {
|
|
113
|
+
name
|
|
114
|
+
}
|
|
112
115
|
}))
|
|
113
116
|
}, rest));
|
|
114
117
|
});
|
|
@@ -103,7 +103,10 @@ const PuiStandardDateTimeField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
103
103
|
onBlur: onBlur,
|
|
104
104
|
helperText: helperText
|
|
105
105
|
}, params), {}, {
|
|
106
|
-
error: params.error || error
|
|
106
|
+
error: params.error || error,
|
|
107
|
+
inputProps: {
|
|
108
|
+
name
|
|
109
|
+
}
|
|
107
110
|
}))
|
|
108
111
|
}, rest));
|
|
109
112
|
});
|
|
@@ -94,6 +94,9 @@ const PuiStandardFileField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
94
94
|
focused: focused,
|
|
95
95
|
fullWidth: fullWidth,
|
|
96
96
|
helperText: helperText,
|
|
97
|
+
inputProps: {
|
|
98
|
+
name
|
|
99
|
+
},
|
|
97
100
|
InputProps: _objectSpread({
|
|
98
101
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
99
102
|
children: buttonText
|
|
@@ -18,7 +18,8 @@ const PuiFormikForm = _ref => {
|
|
|
18
18
|
const {
|
|
19
19
|
isSubmitting,
|
|
20
20
|
isValid,
|
|
21
|
-
isValidating
|
|
21
|
+
isValidating,
|
|
22
|
+
errors
|
|
22
23
|
} = (0, _formik.useFormikContext)();
|
|
23
24
|
React.useEffect(() => {
|
|
24
25
|
if (isSubmitting || isValidating) {
|
|
@@ -26,16 +27,18 @@ const PuiFormikForm = _ref => {
|
|
|
26
27
|
}
|
|
27
28
|
}, [isSubmitting, isValidating]);
|
|
28
29
|
React.useEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
const errorsKeys = Object.keys(errors);
|
|
31
|
+
if (verifyError && !isValid && !isValidating && errorsKeys.length !== 0) {
|
|
32
|
+
const element = document.querySelector("[name='".concat(errorsKeys[0], "']"));
|
|
31
33
|
if (Boolean(element)) {
|
|
32
34
|
element.scrollIntoView({
|
|
33
35
|
behavior: "smooth",
|
|
34
36
|
block: "center"
|
|
35
37
|
});
|
|
36
38
|
}
|
|
39
|
+
setVerifyError(false);
|
|
37
40
|
}
|
|
38
|
-
}, [verifyError, isValid, isValidating]);
|
|
41
|
+
}, [verifyError, isValid, isValidating, errors]);
|
|
39
42
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Form, {
|
|
40
43
|
children: children
|
|
41
44
|
});
|