@junyiacademy/ui-test 1.5.14 → 1.5.15
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.
|
@@ -9,6 +9,7 @@ const TextField_1 = require("@mui/material/TextField");
|
|
|
9
9
|
const Input_1 = require("@mui/material/Input");
|
|
10
10
|
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
11
11
|
const OutlinedInput_1 = require("@mui/material/OutlinedInput");
|
|
12
|
+
const FormHelperText_1 = require("@mui/material/FormHelperText");
|
|
12
13
|
//utils
|
|
13
14
|
const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
|
|
14
15
|
// self-defined-components
|
|
@@ -52,7 +53,16 @@ const TextField = (props) => {
|
|
|
52
53
|
var _a;
|
|
53
54
|
const hasEndAdornment = !!((_a = props === null || props === void 0 ? void 0 : props.InputProps) === null || _a === void 0 ? void 0 : _a.endAdornment);
|
|
54
55
|
const { InputLabelProps, InputProps } = props, otherProps = tslib_1.__rest(props, ["InputLabelProps", "InputProps"]);
|
|
55
|
-
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }),
|
|
56
|
+
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }), FormHelperTextProps: {
|
|
57
|
+
sx: (theme) => ({
|
|
58
|
+
[`&.${FormHelperText_1.formHelperTextClasses.root}`]: {
|
|
59
|
+
marginLeft: 0,
|
|
60
|
+
[`&.${Input_1.inputClasses.error}`]: {
|
|
61
|
+
color: theme.palette.error.main,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
}, InputProps: Object.assign({}, InputProps) }, otherProps)));
|
|
56
66
|
};
|
|
57
67
|
exports.TextField = TextField;
|
|
58
68
|
exports.default = exports.TextField;
|