@etsoo/materialui 1.5.42 → 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.
@@ -2,7 +2,7 @@ import { ButtonProps } from "@mui/material/Button";
2
2
  /**
3
3
  * ButtonLink props
4
4
  */
5
- export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
5
+ export type ButtonLinkProps<T = unknown> = Omit<ButtonProps, "href" | "onClick"> & {
6
6
  /**
7
7
  * To href
8
8
  */
@@ -10,11 +10,11 @@ export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
10
10
  /**
11
11
  * Link state
12
12
  */
13
- state?: any;
13
+ state?: T;
14
14
  };
15
15
  /**
16
16
  * ButtonLink
17
17
  * @param props Props
18
18
  * @returns Component
19
19
  */
20
- export declare function ButtonLink(props: ButtonLinkProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function ButtonLink<T = unknown>(props: ButtonLinkProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -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
  }
@@ -2,7 +2,7 @@ import { IconButtonProps } from "@mui/material/IconButton";
2
2
  /**
3
3
  * IconButtonLink props
4
4
  */
5
- export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
5
+ export type IconButtonLinkProps<T = unknown> = Omit<IconButtonProps, "href" | "onClick"> & {
6
6
  /**
7
7
  * To href
8
8
  */
@@ -10,11 +10,11 @@ export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
10
10
  /**
11
11
  * Link state
12
12
  */
13
- state?: any;
13
+ state?: T;
14
14
  };
15
15
  /**
16
16
  * IconButtonLink
17
17
  * @param props Props
18
18
  * @returns Component
19
19
  */
20
- export declare function IconButtonLink(props: IconButtonLinkProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function IconButtonLink<T = unknown>(props: IconButtonLinkProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { ButtonProps } from "@mui/material/Button";
2
2
  /**
3
3
  * ButtonLink props
4
4
  */
5
- export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
5
+ export type ButtonLinkProps<T = unknown> = Omit<ButtonProps, "href" | "onClick"> & {
6
6
  /**
7
7
  * To href
8
8
  */
@@ -10,11 +10,11 @@ export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
10
10
  /**
11
11
  * Link state
12
12
  */
13
- state?: any;
13
+ state?: T;
14
14
  };
15
15
  /**
16
16
  * ButtonLink
17
17
  * @param props Props
18
18
  * @returns Component
19
19
  */
20
- export declare function ButtonLink(props: ButtonLinkProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function ButtonLink<T = unknown>(props: ButtonLinkProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -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
  }
@@ -2,7 +2,7 @@ import { IconButtonProps } from "@mui/material/IconButton";
2
2
  /**
3
3
  * IconButtonLink props
4
4
  */
5
- export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
5
+ export type IconButtonLinkProps<T = unknown> = Omit<IconButtonProps, "href" | "onClick"> & {
6
6
  /**
7
7
  * To href
8
8
  */
@@ -10,11 +10,11 @@ export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
10
10
  /**
11
11
  * Link state
12
12
  */
13
- state?: any;
13
+ state?: T;
14
14
  };
15
15
  /**
16
16
  * IconButtonLink
17
17
  * @param props Props
18
18
  * @returns Component
19
19
  */
20
- export declare function IconButtonLink(props: IconButtonLinkProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function IconButtonLink<T = unknown>(props: IconButtonLinkProps<T>): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.5.42",
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",
@@ -42,7 +42,7 @@
42
42
  "@emotion/styled": "^11.14.0",
43
43
  "@etsoo/appscript": "^1.6.32",
44
44
  "@etsoo/notificationbase": "^1.1.60",
45
- "@etsoo/react": "^1.8.42",
45
+ "@etsoo/react": "^1.8.43",
46
46
  "@etsoo/shared": "^1.2.70",
47
47
  "@mui/icons-material": "^7.0.2",
48
48
  "@mui/material": "^7.0.2",
@@ -4,7 +4,10 @@ import { useNavigate } from "react-router-dom";
4
4
  /**
5
5
  * ButtonLink props
6
6
  */
7
- export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
7
+ export type ButtonLinkProps<T = unknown> = Omit<
8
+ ButtonProps,
9
+ "href" | "onClick"
10
+ > & {
8
11
  /**
9
12
  * To href
10
13
  */
@@ -13,7 +16,7 @@ export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
13
16
  /**
14
17
  * Link state
15
18
  */
16
- state?: any;
19
+ state?: T;
17
20
  };
18
21
 
19
22
  /**
@@ -21,7 +24,7 @@ export type ButtonLinkProps = Omit<ButtonProps, "href" | "onClick"> & {
21
24
  * @param props Props
22
25
  * @returns Component
23
26
  */
24
- export function ButtonLink(props: ButtonLinkProps) {
27
+ export function ButtonLink<T = unknown>(props: ButtonLinkProps<T>) {
25
28
  // Destruct
26
29
  const { href, state, ...rest } = props;
27
30
 
@@ -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
  }
@@ -4,7 +4,10 @@ import { useNavigate } from "react-router";
4
4
  /**
5
5
  * IconButtonLink props
6
6
  */
7
- export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
7
+ export type IconButtonLinkProps<T = unknown> = Omit<
8
+ IconButtonProps,
9
+ "href" | "onClick"
10
+ > & {
8
11
  /**
9
12
  * To href
10
13
  */
@@ -13,7 +16,7 @@ export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
13
16
  /**
14
17
  * Link state
15
18
  */
16
- state?: any;
19
+ state?: T;
17
20
  };
18
21
 
19
22
  /**
@@ -21,7 +24,7 @@ export type IconButtonLinkProps = Omit<IconButtonProps, "href" | "onClick"> & {
21
24
  * @param props Props
22
25
  * @returns Component
23
26
  */
24
- export function IconButtonLink(props: IconButtonLinkProps) {
27
+ export function IconButtonLink<T = unknown>(props: IconButtonLinkProps<T>) {
25
28
  // Destruct
26
29
  const { href, state, ...rest } = props;
27
30