@etsoo/materialui 1.6.63 → 1.6.65
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/lib/cjs/LinkEx.d.ts +8 -2
- package/lib/cjs/LinkEx.js +2 -2
- package/lib/mjs/LinkEx.d.ts +8 -2
- package/lib/mjs/LinkEx.js +2 -2
- package/package.json +2 -2
- package/src/LinkEx.tsx +15 -3
package/lib/cjs/LinkEx.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { LinkProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { Link as RouterLink } from "react-router";
|
|
3
4
|
/**
|
|
4
5
|
* Extended link component props
|
|
5
6
|
*/
|
|
6
|
-
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"
|
|
7
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Disabled or not
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
7
13
|
/**
|
|
8
14
|
* Extended link component
|
|
9
15
|
* @param props Props
|
|
10
16
|
* @returns Component
|
|
11
17
|
*/
|
|
12
|
-
export declare function LinkEx(props: LinkExProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function LinkEx(props: LinkExProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
package/lib/cjs/LinkEx.js
CHANGED
|
@@ -10,6 +10,6 @@ const react_router_1 = require("react-router");
|
|
|
10
10
|
* @returns Component
|
|
11
11
|
*/
|
|
12
12
|
function LinkEx(props) {
|
|
13
|
-
const { underline = "hover", ...rest } = props;
|
|
14
|
-
return (0, jsx_runtime_1.jsx)(material_1.Link, { component: react_router_1.Link, underline: underline, ...rest });
|
|
13
|
+
const { children, disabled, underline = "hover", ...rest } = props;
|
|
14
|
+
return disabled ? (children) : ((0, jsx_runtime_1.jsx)(material_1.Link, { component: react_router_1.Link, underline: underline, ...rest, children: children }));
|
|
15
15
|
}
|
package/lib/mjs/LinkEx.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { LinkProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { Link as RouterLink } from "react-router";
|
|
3
4
|
/**
|
|
4
5
|
* Extended link component props
|
|
5
6
|
*/
|
|
6
|
-
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"
|
|
7
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"> & {
|
|
8
|
+
/**
|
|
9
|
+
* Disabled or not
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
7
13
|
/**
|
|
8
14
|
* Extended link component
|
|
9
15
|
* @param props Props
|
|
10
16
|
* @returns Component
|
|
11
17
|
*/
|
|
12
|
-
export declare function LinkEx(props: LinkExProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function LinkEx(props: LinkExProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
package/lib/mjs/LinkEx.js
CHANGED
|
@@ -7,6 +7,6 @@ import { Link as RouterLink } from "react-router";
|
|
|
7
7
|
* @returns Component
|
|
8
8
|
*/
|
|
9
9
|
export function LinkEx(props) {
|
|
10
|
-
const { underline = "hover", ...rest } = props;
|
|
11
|
-
return _jsx(Link, { component: RouterLink, underline: underline, ...rest });
|
|
10
|
+
const { children, disabled, underline = "hover", ...rest } = props;
|
|
11
|
+
return disabled ? (children) : (_jsx(Link, { component: RouterLink, underline: underline, ...rest, children: children }));
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.65",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@etsoo/shared": "^1.2.84",
|
|
47
47
|
"@mui/icons-material": "^9.0.1",
|
|
48
48
|
"@mui/material": "^9.0.1",
|
|
49
|
-
"@mui/x-data-grid": "^9.
|
|
49
|
+
"@mui/x-data-grid": "^9.3.0",
|
|
50
50
|
"chart.js": "^4.5.1",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"dompurify": "^3.4.5",
|
package/src/LinkEx.tsx
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { Link, LinkProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { Link as RouterLink } from "react-router";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Extended link component props
|
|
6
7
|
*/
|
|
7
|
-
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"
|
|
8
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Disabled or not
|
|
11
|
+
*/
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Extended link component
|
|
@@ -12,6 +18,12 @@ export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component">;
|
|
|
12
18
|
* @returns Component
|
|
13
19
|
*/
|
|
14
20
|
export function LinkEx(props: LinkExProps) {
|
|
15
|
-
const { underline = "hover", ...rest } = props;
|
|
16
|
-
return
|
|
21
|
+
const { children, disabled, underline = "hover", ...rest } = props;
|
|
22
|
+
return disabled ? (
|
|
23
|
+
children
|
|
24
|
+
) : (
|
|
25
|
+
<Link component={RouterLink} underline={underline} {...rest}>
|
|
26
|
+
{children}
|
|
27
|
+
</Link>
|
|
28
|
+
);
|
|
17
29
|
}
|