@etsoo/materialui 1.5.16 → 1.5.18
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 +12 -0
- package/lib/cjs/LinkEx.js +15 -0
- package/lib/cjs/ScrollerListEx.d.ts +1 -1
- package/lib/cjs/ScrollerListEx.js +2 -1
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/mjs/LinkEx.d.ts +12 -0
- package/lib/mjs/LinkEx.js +12 -0
- package/lib/mjs/ScrollerListEx.d.ts +1 -1
- package/lib/mjs/ScrollerListEx.js +2 -1
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +1 -1
- package/src/LinkEx.tsx +17 -0
- package/src/ScrollerListEx.tsx +6 -3
- package/src/index.ts +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LinkProps } from "@mui/material";
|
|
2
|
+
import { Link as RouterLink } from "react-router";
|
|
3
|
+
/**
|
|
4
|
+
* Extended link component props
|
|
5
|
+
*/
|
|
6
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component">;
|
|
7
|
+
/**
|
|
8
|
+
* Extended link component
|
|
9
|
+
* @param props Props
|
|
10
|
+
* @returns Component
|
|
11
|
+
*/
|
|
12
|
+
export declare function LinkEx(props: LinkExProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkEx = LinkEx;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_router_1 = require("react-router");
|
|
7
|
+
/**
|
|
8
|
+
* Extended link component
|
|
9
|
+
* @param props Props
|
|
10
|
+
* @returns Component
|
|
11
|
+
*/
|
|
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 });
|
|
15
|
+
}
|
|
@@ -29,7 +29,7 @@ export interface ScrollerListExInnerItemRendererProps<T> extends ListChildCompon
|
|
|
29
29
|
* 2. Static sets
|
|
30
30
|
* 3. Dynamic left & right margin calculation
|
|
31
31
|
*/
|
|
32
|
-
export type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number, object]) | [number, number] | [number, object, number?];
|
|
32
|
+
export type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number, object]) | [number, number] | [number, object, (number | string)?];
|
|
33
33
|
/**
|
|
34
34
|
* Extended ScrollerList Props
|
|
35
35
|
*/
|
|
@@ -58,7 +58,8 @@ const defaultMargin = (margin, horizon) => {
|
|
|
58
58
|
marginBottom: half
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
if (horizon >= 0)
|
|
61
|
+
if ((typeof horizon === "number" && horizon >= 0) ||
|
|
62
|
+
(typeof horizon === "string" && /^-?\d+/.test(horizon))) {
|
|
62
63
|
return {
|
|
63
64
|
marginLeft: horizon,
|
|
64
65
|
marginRight: horizon,
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export * from "./InputTipField";
|
|
|
68
68
|
export * from "./IntInputField";
|
|
69
69
|
export * from "./ItemList";
|
|
70
70
|
export * from "./LineChart";
|
|
71
|
+
export * from "./LinkEx";
|
|
71
72
|
export * from "./ListChooser";
|
|
72
73
|
export * from "./ListItemRightIcon";
|
|
73
74
|
export * from "./ListMoreDisplay";
|
package/lib/cjs/index.js
CHANGED
|
@@ -84,6 +84,7 @@ __exportStar(require("./InputTipField"), exports);
|
|
|
84
84
|
__exportStar(require("./IntInputField"), exports);
|
|
85
85
|
__exportStar(require("./ItemList"), exports);
|
|
86
86
|
__exportStar(require("./LineChart"), exports);
|
|
87
|
+
__exportStar(require("./LinkEx"), exports);
|
|
87
88
|
__exportStar(require("./ListChooser"), exports);
|
|
88
89
|
__exportStar(require("./ListItemRightIcon"), exports);
|
|
89
90
|
__exportStar(require("./ListMoreDisplay"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LinkProps } from "@mui/material";
|
|
2
|
+
import { Link as RouterLink } from "react-router";
|
|
3
|
+
/**
|
|
4
|
+
* Extended link component props
|
|
5
|
+
*/
|
|
6
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component">;
|
|
7
|
+
/**
|
|
8
|
+
* Extended link component
|
|
9
|
+
* @param props Props
|
|
10
|
+
* @returns Component
|
|
11
|
+
*/
|
|
12
|
+
export declare function LinkEx(props: LinkExProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from "@mui/material";
|
|
3
|
+
import { Link as RouterLink } from "react-router";
|
|
4
|
+
/**
|
|
5
|
+
* Extended link component
|
|
6
|
+
* @param props Props
|
|
7
|
+
* @returns Component
|
|
8
|
+
*/
|
|
9
|
+
export function LinkEx(props) {
|
|
10
|
+
const { underline = "hover", ...rest } = props;
|
|
11
|
+
return _jsx(Link, { component: RouterLink, underline: underline, ...rest });
|
|
12
|
+
}
|
|
@@ -29,7 +29,7 @@ export interface ScrollerListExInnerItemRendererProps<T> extends ListChildCompon
|
|
|
29
29
|
* 2. Static sets
|
|
30
30
|
* 3. Dynamic left & right margin calculation
|
|
31
31
|
*/
|
|
32
|
-
export type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number, object]) | [number, number] | [number, object, number?];
|
|
32
|
+
export type ScrollerListExItemSize = ((index: number) => [number, number] | [number, number, object]) | [number, number] | [number, object, (number | string)?];
|
|
33
33
|
/**
|
|
34
34
|
* Extended ScrollerList Props
|
|
35
35
|
*/
|
|
@@ -52,7 +52,8 @@ const defaultMargin = (margin, horizon) => {
|
|
|
52
52
|
marginBottom: half
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
if (horizon >= 0)
|
|
55
|
+
if ((typeof horizon === "number" && horizon >= 0) ||
|
|
56
|
+
(typeof horizon === "string" && /^-?\d+/.test(horizon))) {
|
|
56
57
|
return {
|
|
57
58
|
marginLeft: horizon,
|
|
58
59
|
marginRight: horizon,
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export * from "./InputTipField";
|
|
|
68
68
|
export * from "./IntInputField";
|
|
69
69
|
export * from "./ItemList";
|
|
70
70
|
export * from "./LineChart";
|
|
71
|
+
export * from "./LinkEx";
|
|
71
72
|
export * from "./ListChooser";
|
|
72
73
|
export * from "./ListItemRightIcon";
|
|
73
74
|
export * from "./ListMoreDisplay";
|
package/lib/mjs/index.js
CHANGED
|
@@ -68,6 +68,7 @@ export * from "./InputTipField";
|
|
|
68
68
|
export * from "./IntInputField";
|
|
69
69
|
export * from "./ItemList";
|
|
70
70
|
export * from "./LineChart";
|
|
71
|
+
export * from "./LinkEx";
|
|
71
72
|
export * from "./ListChooser";
|
|
72
73
|
export * from "./ListItemRightIcon";
|
|
73
74
|
export * from "./ListMoreDisplay";
|
package/package.json
CHANGED
package/src/LinkEx.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Link, LinkProps } from "@mui/material";
|
|
2
|
+
import { Link as RouterLink } from "react-router";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extended link component props
|
|
6
|
+
*/
|
|
7
|
+
export type LinkExProps = Omit<LinkProps<typeof RouterLink>, "component">;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Extended link component
|
|
11
|
+
* @param props Props
|
|
12
|
+
* @returns Component
|
|
13
|
+
*/
|
|
14
|
+
export function LinkEx(props: LinkExProps) {
|
|
15
|
+
const { underline = "hover", ...rest } = props;
|
|
16
|
+
return <Link component={RouterLink} underline={underline} {...rest} />;
|
|
17
|
+
}
|
package/src/ScrollerListEx.tsx
CHANGED
|
@@ -48,7 +48,7 @@ const createGridStyle = (
|
|
|
48
48
|
|
|
49
49
|
// Default margin
|
|
50
50
|
// horizon: null means full horizontal margin, -1 means all half, >=0 means left/right
|
|
51
|
-
const defaultMargin = (margin: object, horizon?: number) => {
|
|
51
|
+
const defaultMargin = (margin: object, horizon?: number | string) => {
|
|
52
52
|
const half = MUGlobal.half(margin);
|
|
53
53
|
|
|
54
54
|
if (horizon == null) {
|
|
@@ -61,7 +61,10 @@ const defaultMargin = (margin: object, horizon?: number) => {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
if (
|
|
64
|
+
if (
|
|
65
|
+
(typeof horizon === "number" && horizon >= 0) ||
|
|
66
|
+
(typeof horizon === "string" && /^-?\d+/.test(horizon))
|
|
67
|
+
) {
|
|
65
68
|
return {
|
|
66
69
|
marginLeft: horizon,
|
|
67
70
|
marginRight: horizon,
|
|
@@ -113,7 +116,7 @@ export interface ScrollerListExInnerItemRendererProps<T>
|
|
|
113
116
|
export type ScrollerListExItemSize =
|
|
114
117
|
| ((index: number) => [number, number] | [number, number, object])
|
|
115
118
|
| [number, number]
|
|
116
|
-
| [number, object, number?];
|
|
119
|
+
| [number, object, (number | string)?];
|
|
117
120
|
|
|
118
121
|
/**
|
|
119
122
|
* Extended ScrollerList Props
|
package/src/index.ts
CHANGED
|
@@ -73,6 +73,7 @@ export * from "./InputTipField";
|
|
|
73
73
|
export * from "./IntInputField";
|
|
74
74
|
export * from "./ItemList";
|
|
75
75
|
export * from "./LineChart";
|
|
76
|
+
export * from "./LinkEx";
|
|
76
77
|
export * from "./ListChooser";
|
|
77
78
|
export * from "./ListItemRightIcon";
|
|
78
79
|
export * from "./ListMoreDisplay";
|