@etsoo/materialui 1.6.63 → 1.6.64
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 +6 -1
- package/lib/cjs/LinkEx.js +6 -2
- package/lib/mjs/LinkEx.d.ts +6 -1
- package/lib/mjs/LinkEx.js +3 -2
- package/package.json +2 -2
- package/src/LinkEx.tsx +15 -3
package/lib/cjs/LinkEx.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { Link as RouterLink } from "react-router";
|
|
|
3
3
|
/**
|
|
4
4
|
* Extended link component props
|
|
5
5
|
*/
|
|
6
|
-
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"
|
|
6
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Disabled or not
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
7
12
|
/**
|
|
8
13
|
* Extended link component
|
|
9
14
|
* @param props Props
|
package/lib/cjs/LinkEx.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.LinkEx = LinkEx;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const material_1 = require("@mui/material");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
6
10
|
const react_router_1 = require("react-router");
|
|
7
11
|
/**
|
|
8
12
|
* Extended link component
|
|
@@ -10,6 +14,6 @@ const react_router_1 = require("react-router");
|
|
|
10
14
|
* @returns Component
|
|
11
15
|
*/
|
|
12
16
|
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 });
|
|
17
|
+
const { children, disabled, underline = "hover", ...rest } = props;
|
|
18
|
+
return disabled ? ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: children })) : ((0, jsx_runtime_1.jsx)(material_1.Link, { component: react_router_1.Link, underline: underline, ...rest, children: children }));
|
|
15
19
|
}
|
package/lib/mjs/LinkEx.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { Link as RouterLink } from "react-router";
|
|
|
3
3
|
/**
|
|
4
4
|
* Extended link component props
|
|
5
5
|
*/
|
|
6
|
-
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"
|
|
6
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Disabled or not
|
|
9
|
+
*/
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
7
12
|
/**
|
|
8
13
|
* Extended link component
|
|
9
14
|
* @param props Props
|
package/lib/mjs/LinkEx.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Link } from "@mui/material";
|
|
3
|
+
import React from "react";
|
|
3
4
|
import { Link as RouterLink } from "react-router";
|
|
4
5
|
/**
|
|
5
6
|
* Extended link component
|
|
@@ -7,6 +8,6 @@ import { Link as RouterLink } from "react-router";
|
|
|
7
8
|
* @returns Component
|
|
8
9
|
*/
|
|
9
10
|
export function LinkEx(props) {
|
|
10
|
-
const { underline = "hover", ...rest } = props;
|
|
11
|
-
return _jsx(Link, { component: RouterLink, underline: underline, ...rest });
|
|
11
|
+
const { children, disabled, underline = "hover", ...rest } = props;
|
|
12
|
+
return disabled ? (_jsx(React.Fragment, { children: children })) : (_jsx(Link, { component: RouterLink, underline: underline, ...rest, children: children }));
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.64",
|
|
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
|
+
<React.Fragment>{children}</React.Fragment>
|
|
24
|
+
) : (
|
|
25
|
+
<Link component={RouterLink} underline={underline} {...rest}>
|
|
26
|
+
{children}
|
|
27
|
+
</Link>
|
|
28
|
+
);
|
|
17
29
|
}
|