@etsoo/materialui 1.5.43 → 1.5.44

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.
@@ -11,8 +11,8 @@ const TextField_1 = __importDefault(require("@mui/material/TextField"));
11
11
  * @param props Props
12
12
  */
13
13
  function EmailInput(props) {
14
- props.slotProps ??= {};
15
- props.slotProps.htmlInput ??= { maxLength: 128 };
14
+ // Destruct
15
+ const { slotProps, ...rest } = props;
16
16
  // Layout
17
- return (0, jsx_runtime_1.jsx)(TextField_1.default, { type: "email", fullWidth: true, ...props });
17
+ return ((0, jsx_runtime_1.jsx)(TextField_1.default, { type: "email", fullWidth: true, slotProps: { htmlInput: { maxLength: 128 }, ...slotProps }, ...rest }));
18
18
  }
@@ -5,8 +5,8 @@ import TextField from "@mui/material/TextField";
5
5
  * @param props Props
6
6
  */
7
7
  export function EmailInput(props) {
8
- props.slotProps ??= {};
9
- props.slotProps.htmlInput ??= { maxLength: 128 };
8
+ // Destruct
9
+ const { slotProps, ...rest } = props;
10
10
  // Layout
11
- return _jsx(TextField, { type: "email", fullWidth: true, ...props });
11
+ return (_jsx(TextField, { type: "email", fullWidth: true, slotProps: { htmlInput: { maxLength: 128 }, ...slotProps }, ...rest }));
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.43",
3
+ "version": "1.5.44",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -10,9 +10,16 @@ export type EmailInputProps = Omit<TextFieldProps, "type"> & {};
10
10
  * @param props Props
11
11
  */
12
12
  export function EmailInput(props: EmailInputProps) {
13
- props.slotProps ??= {};
14
- props.slotProps.htmlInput ??= { maxLength: 128 };
13
+ // Destruct
14
+ const { slotProps, ...rest } = props;
15
15
 
16
16
  // Layout
17
- return <TextField type="email" fullWidth {...props} />;
17
+ return (
18
+ <TextField
19
+ type="email"
20
+ fullWidth
21
+ slotProps={{ htmlInput: { maxLength: 128 }, ...slotProps }}
22
+ {...rest}
23
+ />
24
+ );
18
25
  }