@etsoo/materialui 1.6.0 → 1.6.1
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/DownUpButton.d.ts +38 -0
- package/lib/cjs/DownUpButton.js +22 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/mjs/DownUpButton.d.ts +38 -0
- package/lib/mjs/DownUpButton.js +16 -0
- package/lib/mjs/index.d.ts +1 -0
- package/lib/mjs/index.js +1 -0
- package/package.json +3 -3
- package/src/DownUpButton.tsx +73 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
|
2
|
+
/**
|
|
3
|
+
* Down & Up Button Props
|
|
4
|
+
*/
|
|
5
|
+
export type DownUpButtonProps = Omit<ButtonGroupProps, "orientation"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Is down button disabled
|
|
8
|
+
*/
|
|
9
|
+
downDisabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Down button label
|
|
12
|
+
*/
|
|
13
|
+
downLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Is up button disabled
|
|
16
|
+
*/
|
|
17
|
+
upDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Up button label
|
|
20
|
+
*/
|
|
21
|
+
upLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Down button click handler
|
|
24
|
+
* @param event Mouse click event
|
|
25
|
+
*/
|
|
26
|
+
onDownClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Up button click handler
|
|
29
|
+
* @param event Mouse click event
|
|
30
|
+
*/
|
|
31
|
+
onUpClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Down & Up Button
|
|
35
|
+
* @param props Props
|
|
36
|
+
* @returns Component
|
|
37
|
+
*/
|
|
38
|
+
export declare function DownUpButton(props: DownUpButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DownUpButton = DownUpButton;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
9
|
+
const ButtonGroup_1 = __importDefault(require("@mui/material/ButtonGroup"));
|
|
10
|
+
const ReactApp_1 = require("./app/ReactApp");
|
|
11
|
+
/**
|
|
12
|
+
* Down & Up Button
|
|
13
|
+
* @param props Props
|
|
14
|
+
* @returns Component
|
|
15
|
+
*/
|
|
16
|
+
function DownUpButton(props) {
|
|
17
|
+
// Global app
|
|
18
|
+
const app = (0, ReactApp_1.useAppContext)();
|
|
19
|
+
// Destruct
|
|
20
|
+
const { size = "small", downDisabled, downLabel = app?.get("moveDown") ?? "Down", upDisabled, upLabel = app?.get("moveUp") ?? "Up", onDownClick, onUpClick, ...rest } = props;
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(ButtonGroup_1.default, { orientation: "vertical", size: size, ...rest, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { disabled: upDisabled, onClick: onUpClick, children: upLabel }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: downDisabled, onClick: onDownClick, children: downLabel })] }));
|
|
22
|
+
}
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export * from "./DataSteps";
|
|
|
55
55
|
export * from "./DataTable";
|
|
56
56
|
export * from "./DialogButton";
|
|
57
57
|
export * from "./DnDList";
|
|
58
|
+
export * from "./DownUpButton";
|
|
58
59
|
export * from "./DraggablePaperComponent";
|
|
59
60
|
export * from "./EmailInput";
|
|
60
61
|
export * from "./ErrorAlert";
|
package/lib/cjs/index.js
CHANGED
|
@@ -71,6 +71,7 @@ __exportStar(require("./DataSteps"), exports);
|
|
|
71
71
|
__exportStar(require("./DataTable"), exports);
|
|
72
72
|
__exportStar(require("./DialogButton"), exports);
|
|
73
73
|
__exportStar(require("./DnDList"), exports);
|
|
74
|
+
__exportStar(require("./DownUpButton"), exports);
|
|
74
75
|
__exportStar(require("./DraggablePaperComponent"), exports);
|
|
75
76
|
__exportStar(require("./EmailInput"), exports);
|
|
76
77
|
__exportStar(require("./ErrorAlert"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
|
2
|
+
/**
|
|
3
|
+
* Down & Up Button Props
|
|
4
|
+
*/
|
|
5
|
+
export type DownUpButtonProps = Omit<ButtonGroupProps, "orientation"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Is down button disabled
|
|
8
|
+
*/
|
|
9
|
+
downDisabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Down button label
|
|
12
|
+
*/
|
|
13
|
+
downLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Is up button disabled
|
|
16
|
+
*/
|
|
17
|
+
upDisabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Up button label
|
|
20
|
+
*/
|
|
21
|
+
upLabel?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Down button click handler
|
|
24
|
+
* @param event Mouse click event
|
|
25
|
+
*/
|
|
26
|
+
onDownClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Up button click handler
|
|
29
|
+
* @param event Mouse click event
|
|
30
|
+
*/
|
|
31
|
+
onUpClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Down & Up Button
|
|
35
|
+
* @param props Props
|
|
36
|
+
* @returns Component
|
|
37
|
+
*/
|
|
38
|
+
export declare function DownUpButton(props: DownUpButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import ButtonGroup from "@mui/material/ButtonGroup";
|
|
4
|
+
import { useAppContext } from "./app/ReactApp";
|
|
5
|
+
/**
|
|
6
|
+
* Down & Up Button
|
|
7
|
+
* @param props Props
|
|
8
|
+
* @returns Component
|
|
9
|
+
*/
|
|
10
|
+
export function DownUpButton(props) {
|
|
11
|
+
// Global app
|
|
12
|
+
const app = useAppContext();
|
|
13
|
+
// Destruct
|
|
14
|
+
const { size = "small", downDisabled, downLabel = app?.get("moveDown") ?? "Down", upDisabled, upLabel = app?.get("moveUp") ?? "Up", onDownClick, onUpClick, ...rest } = props;
|
|
15
|
+
return (_jsxs(ButtonGroup, { orientation: "vertical", size: size, ...rest, children: [_jsx(Button, { disabled: upDisabled, onClick: onUpClick, children: upLabel }), _jsx(Button, { disabled: downDisabled, onClick: onDownClick, children: downLabel })] }));
|
|
16
|
+
}
|
package/lib/mjs/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export * from "./DataSteps";
|
|
|
55
55
|
export * from "./DataTable";
|
|
56
56
|
export * from "./DialogButton";
|
|
57
57
|
export * from "./DnDList";
|
|
58
|
+
export * from "./DownUpButton";
|
|
58
59
|
export * from "./DraggablePaperComponent";
|
|
59
60
|
export * from "./EmailInput";
|
|
60
61
|
export * from "./ErrorAlert";
|
package/lib/mjs/index.js
CHANGED
|
@@ -55,6 +55,7 @@ export * from "./DataSteps";
|
|
|
55
55
|
export * from "./DataTable";
|
|
56
56
|
export * from "./DialogButton";
|
|
57
57
|
export * from "./DnDList";
|
|
58
|
+
export * from "./DownUpButton";
|
|
58
59
|
export * from "./DraggablePaperComponent";
|
|
59
60
|
export * from "./EmailInput";
|
|
60
61
|
export * from "./ErrorAlert";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@dnd-kit/sortable": "^10.0.0",
|
|
41
41
|
"@emotion/react": "^11.14.0",
|
|
42
42
|
"@emotion/styled": "^11.14.1",
|
|
43
|
-
"@etsoo/appscript": "^1.6.
|
|
43
|
+
"@etsoo/appscript": "^1.6.52",
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.66",
|
|
45
|
-
"@etsoo/react": "^1.8.
|
|
45
|
+
"@etsoo/react": "^1.8.69",
|
|
46
46
|
"@etsoo/shared": "^1.2.80",
|
|
47
47
|
"@mui/icons-material": "^7.3.7",
|
|
48
48
|
"@mui/material": "^7.3.7",
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Button from "@mui/material/Button";
|
|
2
|
+
import ButtonGroup, { ButtonGroupProps } from "@mui/material/ButtonGroup";
|
|
3
|
+
import { useAppContext } from "./app/ReactApp";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Down & Up Button Props
|
|
7
|
+
*/
|
|
8
|
+
export type DownUpButtonProps = Omit<ButtonGroupProps, "orientation"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Is down button disabled
|
|
11
|
+
*/
|
|
12
|
+
downDisabled?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Down button label
|
|
16
|
+
*/
|
|
17
|
+
downLabel?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Is up button disabled
|
|
21
|
+
*/
|
|
22
|
+
upDisabled?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Up button label
|
|
26
|
+
*/
|
|
27
|
+
upLabel?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Down button click handler
|
|
31
|
+
* @param event Mouse click event
|
|
32
|
+
*/
|
|
33
|
+
onDownClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Up button click handler
|
|
37
|
+
* @param event Mouse click event
|
|
38
|
+
*/
|
|
39
|
+
onUpClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Down & Up Button
|
|
44
|
+
* @param props Props
|
|
45
|
+
* @returns Component
|
|
46
|
+
*/
|
|
47
|
+
export function DownUpButton(props: DownUpButtonProps) {
|
|
48
|
+
// Global app
|
|
49
|
+
const app = useAppContext();
|
|
50
|
+
|
|
51
|
+
// Destruct
|
|
52
|
+
const {
|
|
53
|
+
size = "small",
|
|
54
|
+
downDisabled,
|
|
55
|
+
downLabel = app?.get("moveDown") ?? "Down",
|
|
56
|
+
upDisabled,
|
|
57
|
+
upLabel = app?.get("moveUp") ?? "Up",
|
|
58
|
+
onDownClick,
|
|
59
|
+
onUpClick,
|
|
60
|
+
...rest
|
|
61
|
+
} = props;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<ButtonGroup orientation="vertical" size={size} {...rest}>
|
|
65
|
+
<Button disabled={upDisabled} onClick={onUpClick}>
|
|
66
|
+
{upLabel}
|
|
67
|
+
</Button>
|
|
68
|
+
<Button disabled={downDisabled} onClick={onDownClick}>
|
|
69
|
+
{downLabel}
|
|
70
|
+
</Button>
|
|
71
|
+
</ButtonGroup>
|
|
72
|
+
);
|
|
73
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -61,6 +61,7 @@ export * from "./DataSteps";
|
|
|
61
61
|
export * from "./DataTable";
|
|
62
62
|
export * from "./DialogButton";
|
|
63
63
|
export * from "./DnDList";
|
|
64
|
+
export * from "./DownUpButton";
|
|
64
65
|
export * from "./DraggablePaperComponent";
|
|
65
66
|
export * from "./EmailInput";
|
|
66
67
|
export * from "./ErrorAlert";
|