@m4l/components 0.0.0 → 0.0.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/dist/components/SplitLayout/index.d.ts +3 -0
- package/dist/components/SplitLayout/index.js +130 -0
- package/dist/components/SplitLayout/styles.d.ts +4 -0
- package/dist/components/SplitLayout/types.d.ts +9 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/mui_extended/MenuActions/styles.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -6
- package/dist/react-splitter-layout.js +165 -0
- package/dist/vendor.js +17 -0
- package/package.json +6 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { S as SplitterLayout } from "../../react-splitter-layout.js";
|
|
2
|
+
import { styled } from "@mui/material/styles";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
const WrapperSplit = styled("div")(({
|
|
5
|
+
theme
|
|
6
|
+
}) => ({
|
|
7
|
+
display: "flex",
|
|
8
|
+
flexDirection: "column",
|
|
9
|
+
position: "relative",
|
|
10
|
+
flexGrow: 1,
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
"& .splitter-layout": {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
display: "flex",
|
|
15
|
+
flexDirection: "row",
|
|
16
|
+
width: "100%",
|
|
17
|
+
height: "100%",
|
|
18
|
+
overflow: "hidden"
|
|
19
|
+
},
|
|
20
|
+
"& .splitter-layout .layout-pane": {
|
|
21
|
+
position: "relative",
|
|
22
|
+
flex: "0 0 auto",
|
|
23
|
+
overflow: "auto"
|
|
24
|
+
},
|
|
25
|
+
"& .splitter-layout .layout-pane.layout-pane-primary": {
|
|
26
|
+
flex: "1 1 auto"
|
|
27
|
+
},
|
|
28
|
+
"& .splitter-layout.layout-changing": {
|
|
29
|
+
cursor: "col-resize"
|
|
30
|
+
},
|
|
31
|
+
"& .splitter-layout > .layout-splitter": {
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
backgroundColor: theme.palette.divider,
|
|
35
|
+
zIndex: "1",
|
|
36
|
+
boxSizing: "border-box",
|
|
37
|
+
backgroundClip: "padding-box",
|
|
38
|
+
width: "11px",
|
|
39
|
+
margin: "0 5px",
|
|
40
|
+
borderLeft: "5px solid hsla(0, 0%, 100%, 0)",
|
|
41
|
+
borderRight: "5px solid hsla(0, 0%, 100%, 0)",
|
|
42
|
+
cursor: "col-resize",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
height: "100%"
|
|
45
|
+
},
|
|
46
|
+
"& .splitter-layout .layout-splitter:before": {
|
|
47
|
+
content: `""`,
|
|
48
|
+
height: "45px",
|
|
49
|
+
width: "4px",
|
|
50
|
+
top: "calc(50% - 22.5px)",
|
|
51
|
+
position: "absolute",
|
|
52
|
+
background: theme.palette.grey[500],
|
|
53
|
+
borderRadius: "6px"
|
|
54
|
+
},
|
|
55
|
+
"& .splitter-layout > .layout-splitter:hover": {
|
|
56
|
+
borderLeft: `5px solid ${theme.palette.grey[5008]}`,
|
|
57
|
+
borderRight: `5px solid ${theme.palette.grey[5008]}`
|
|
58
|
+
},
|
|
59
|
+
"& .splitter-layout.splitter-layout-vertical.layout-changing": {
|
|
60
|
+
cursor: "row-resize"
|
|
61
|
+
},
|
|
62
|
+
"& .splitter-layout.splitter-layout-vertical > .layout-splitter": {
|
|
63
|
+
height: "11px !important",
|
|
64
|
+
width: "100% !important",
|
|
65
|
+
margin: "5px 0",
|
|
66
|
+
borderTop: "5px solid hsla(0, 0%, 100%, 0)",
|
|
67
|
+
borderBottom: "5px solid hsla(0, 0%, 100%, 0)",
|
|
68
|
+
cursor: "row-resize"
|
|
69
|
+
},
|
|
70
|
+
"& .splitter-layout.splitter-layout-vertical .layout-splitter:before": {
|
|
71
|
+
width: "45px !important",
|
|
72
|
+
height: "4px !important",
|
|
73
|
+
left: "calc(50% - 22.5px)",
|
|
74
|
+
top: "unset"
|
|
75
|
+
},
|
|
76
|
+
"& .splitter-layout > .layout-splitter:hover:before, .splitter-layout.layout-changing > .layout-splitter:before": {
|
|
77
|
+
background: theme.palette.primary.main
|
|
78
|
+
},
|
|
79
|
+
"& .splitter-layout.splitter-layout-vertical": {
|
|
80
|
+
flexDirection: "column"
|
|
81
|
+
},
|
|
82
|
+
"& .splitter-layout.splitter-layout-vertical > .layout-splitter:hover": {
|
|
83
|
+
borderTop: `5px solid ${theme.palette.grey[5008]}`,
|
|
84
|
+
borderBottom: `5px solid ${theme.palette.grey[5008]}`
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
const SplitMaster = styled("div")(() => ({
|
|
88
|
+
display: "flex",
|
|
89
|
+
flexDirection: "column",
|
|
90
|
+
position: "relative",
|
|
91
|
+
width: "100%",
|
|
92
|
+
height: "100%",
|
|
93
|
+
overflow: "hidden"
|
|
94
|
+
}));
|
|
95
|
+
const SplitDetail = styled("div")(() => ({
|
|
96
|
+
display: "flex",
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
overflow: "hidden",
|
|
99
|
+
position: "absolute",
|
|
100
|
+
left: "0px",
|
|
101
|
+
right: "0px",
|
|
102
|
+
top: "0px",
|
|
103
|
+
bottom: "0px"
|
|
104
|
+
}));
|
|
105
|
+
function SplitLayout(props) {
|
|
106
|
+
const {
|
|
107
|
+
splitPosition,
|
|
108
|
+
firstPart,
|
|
109
|
+
secondPart,
|
|
110
|
+
secondParrtInitialSize = 50,
|
|
111
|
+
percentage = true
|
|
112
|
+
} = props;
|
|
113
|
+
return /* @__PURE__ */ jsx(WrapperSplit, {
|
|
114
|
+
id: "WrapperSplit",
|
|
115
|
+
className: `split_${splitPosition}`,
|
|
116
|
+
children: /* @__PURE__ */ jsxs(SplitterLayout, {
|
|
117
|
+
vertical: splitPosition === "vertical",
|
|
118
|
+
percentage,
|
|
119
|
+
secondaryInitialSize: secondParrtInitialSize,
|
|
120
|
+
children: [/* @__PURE__ */ jsx(SplitMaster, {
|
|
121
|
+
id: "splitMaster",
|
|
122
|
+
children: typeof firstPart === "function" ? firstPart() : firstPart
|
|
123
|
+
}), splitPosition !== "none" && /* @__PURE__ */ jsx(SplitDetail, {
|
|
124
|
+
id: "detail",
|
|
125
|
+
children: typeof secondPart === "function" ? secondPart() : secondPart
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
export { SplitLayout as S };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const WrapperSplit: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
+
export declare const SplitMaster: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
+
export declare const SplitDetail: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type SplitPosition = 'vertical' | 'horizontal' | 'none';
|
|
3
|
+
export interface SplitLayoutProps {
|
|
4
|
+
splitPosition: SplitPosition;
|
|
5
|
+
percentage?: boolean;
|
|
6
|
+
secondParrtInitialSize?: number;
|
|
7
|
+
firstPart: ((props?: any) => JSX.Element) | ReactNode;
|
|
8
|
+
secondPart: ((props?: any) => JSX.Element) | ReactNode;
|
|
9
|
+
}
|
|
@@ -26,5 +26,5 @@ export declare const WrapperMenuActions: import("@emotion/styled").StyledCompone
|
|
|
26
26
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
27
27
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
28
28
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
-
},
|
|
29
|
+
}, "color" | "sx" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "disabled" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
30
30
|
export declare const LabelMemuItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './components
|
|
1
|
+
export * from './components';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
export { B as BoxIcon } from "./components/mui_extended/BoxIcon/index.js";
|
|
2
|
+
export { M as MenuPopover } from "./components/mui_extended/MenuPopover/index.js";
|
|
3
|
+
export { B as Breadcrumbs } from "./components/mui_extended/Breadcrumbs/index.js";
|
|
4
|
+
export { M as MenuActions } from "./components/mui_extended/MenuActions/index.js";
|
|
5
|
+
export { S as SplitLayout } from "./components/SplitLayout/index.js";
|
|
1
6
|
import "@mui/material/Box";
|
|
2
7
|
import "react/jsx-runtime";
|
|
3
|
-
|
|
8
|
+
import "@mui/material/styles";
|
|
9
|
+
import "@mui/material";
|
|
4
10
|
import "react";
|
|
5
11
|
import "@m4l/core";
|
|
6
|
-
import "@mui/material";
|
|
7
12
|
import "react-router-dom";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import "@mui/material/styles";
|
|
13
|
+
import "./react-splitter-layout.js";
|
|
14
|
+
import "./vendor.js";
|
|
15
|
+
import "prop-types";
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { g as getDefaultExportFromCjs } from "./vendor.js";
|
|
2
|
+
import require$$0 from "prop-types";
|
|
3
|
+
import require$$1 from "react";
|
|
4
|
+
var lib = { exports: {} };
|
|
5
|
+
(function(module, exports) {
|
|
6
|
+
!function(e, t) {
|
|
7
|
+
module.exports = t(require$$0, require$$1);
|
|
8
|
+
}(window, function(e, t) {
|
|
9
|
+
return function(e2) {
|
|
10
|
+
var t2 = {};
|
|
11
|
+
function n(o) {
|
|
12
|
+
if (t2[o])
|
|
13
|
+
return t2[o].exports;
|
|
14
|
+
var r = t2[o] = { i: o, l: false, exports: {} };
|
|
15
|
+
return e2[o].call(r.exports, r, r.exports, n), r.l = true, r.exports;
|
|
16
|
+
}
|
|
17
|
+
return n.m = e2, n.c = t2, n.d = function(e3, t3, o) {
|
|
18
|
+
n.o(e3, t3) || Object.defineProperty(e3, t3, { enumerable: true, get: o });
|
|
19
|
+
}, n.r = function(e3) {
|
|
20
|
+
typeof Symbol != "undefined" && Symbol.toStringTag && Object.defineProperty(e3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e3, "__esModule", { value: true });
|
|
21
|
+
}, n.t = function(e3, t3) {
|
|
22
|
+
if (1 & t3 && (e3 = n(e3)), 8 & t3)
|
|
23
|
+
return e3;
|
|
24
|
+
if (4 & t3 && typeof e3 == "object" && e3 && e3.__esModule)
|
|
25
|
+
return e3;
|
|
26
|
+
var o = /* @__PURE__ */ Object.create(null);
|
|
27
|
+
if (n.r(o), Object.defineProperty(o, "default", { enumerable: true, value: e3 }), 2 & t3 && typeof e3 != "string")
|
|
28
|
+
for (var r in e3)
|
|
29
|
+
n.d(o, r, function(t4) {
|
|
30
|
+
return e3[t4];
|
|
31
|
+
}.bind(null, r));
|
|
32
|
+
return o;
|
|
33
|
+
}, n.n = function(e3) {
|
|
34
|
+
var t3 = e3 && e3.__esModule ? function() {
|
|
35
|
+
return e3.default;
|
|
36
|
+
} : function() {
|
|
37
|
+
return e3;
|
|
38
|
+
};
|
|
39
|
+
return n.d(t3, "a", t3), t3;
|
|
40
|
+
}, n.o = function(e3, t3) {
|
|
41
|
+
return Object.prototype.hasOwnProperty.call(e3, t3);
|
|
42
|
+
}, n.p = "", n(n.s = 2);
|
|
43
|
+
}([function(t2, n) {
|
|
44
|
+
t2.exports = e;
|
|
45
|
+
}, function(e2, n) {
|
|
46
|
+
e2.exports = t;
|
|
47
|
+
}, function(e2, t2, n) {
|
|
48
|
+
e2.exports = n(3);
|
|
49
|
+
}, function(e2, t2, n) {
|
|
50
|
+
n.r(t2);
|
|
51
|
+
var o = n(1), r = n.n(o), i = n(0), a = n.n(i);
|
|
52
|
+
function s(e3) {
|
|
53
|
+
var t3 = e3.size || 0, n2 = e3.percentage ? "%" : "px", o2 = "layout-pane", i2 = {};
|
|
54
|
+
return e3.primary ? o2 += " layout-pane-primary" : e3.vertical ? i2.height = "".concat(t3).concat(n2) : i2.width = "".concat(t3).concat(n2), r.a.createElement("div", { className: o2, style: i2 }, e3.children);
|
|
55
|
+
}
|
|
56
|
+
s.propTypes = { vertical: a.a.bool, primary: a.a.bool, size: a.a.number, percentage: a.a.bool, children: a.a.oneOfType([a.a.arrayOf(a.a.node), a.a.node]) }, s.defaultProps = { vertical: false, primary: false, size: 0, percentage: false, children: [] };
|
|
57
|
+
var c = s;
|
|
58
|
+
function l(e3) {
|
|
59
|
+
return (l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e4) {
|
|
60
|
+
return typeof e4;
|
|
61
|
+
} : function(e4) {
|
|
62
|
+
return e4 && typeof Symbol == "function" && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
|
|
63
|
+
})(e3);
|
|
64
|
+
}
|
|
65
|
+
function u(e3, t3) {
|
|
66
|
+
for (var n2 = 0; n2 < t3.length; n2++) {
|
|
67
|
+
var o2 = t3[n2];
|
|
68
|
+
o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, o2.key, o2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function p(e3) {
|
|
72
|
+
return (p = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
|
|
73
|
+
return e4.__proto__ || Object.getPrototypeOf(e4);
|
|
74
|
+
})(e3);
|
|
75
|
+
}
|
|
76
|
+
function d(e3, t3) {
|
|
77
|
+
return (d = Object.setPrototypeOf || function(e4, t4) {
|
|
78
|
+
return e4.__proto__ = t4, e4;
|
|
79
|
+
})(e3, t3);
|
|
80
|
+
}
|
|
81
|
+
function h(e3) {
|
|
82
|
+
if (e3 === void 0)
|
|
83
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
84
|
+
return e3;
|
|
85
|
+
}
|
|
86
|
+
function f() {
|
|
87
|
+
if (document.body.createTextRange) {
|
|
88
|
+
var e3 = document.body.createTextRange();
|
|
89
|
+
e3.collapse(), e3.select();
|
|
90
|
+
} else
|
|
91
|
+
window.getSelection ? window.getSelection().empty ? window.getSelection().empty() : window.getSelection().removeAllRanges && window.getSelection().removeAllRanges() : document.selection && document.selection.empty();
|
|
92
|
+
}
|
|
93
|
+
var y = function(e3) {
|
|
94
|
+
function t3(e4) {
|
|
95
|
+
var n3, o3, r2;
|
|
96
|
+
return function(e5, t4) {
|
|
97
|
+
if (!(e5 instanceof t4))
|
|
98
|
+
throw new TypeError("Cannot call a class as a function");
|
|
99
|
+
}(this, t3), o3 = this, (n3 = !(r2 = p(t3).call(this, e4)) || l(r2) !== "object" && typeof r2 != "function" ? h(o3) : r2).handleResize = n3.handleResize.bind(h(h(n3))), n3.handleMouseMove = n3.handleMouseMove.bind(h(h(n3))), n3.handleMouseUp = n3.handleMouseUp.bind(h(h(n3))), n3.handleTouchMove = n3.handleTouchMove.bind(h(h(n3))), n3.handleSplitterMouseDown = n3.handleSplitterMouseDown.bind(h(h(n3))), n3.state = { secondaryPaneSize: 0, resizing: false }, n3;
|
|
100
|
+
}
|
|
101
|
+
var n2, o2;
|
|
102
|
+
return function(e4, t4) {
|
|
103
|
+
if (typeof t4 != "function" && t4 !== null)
|
|
104
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
105
|
+
e4.prototype = Object.create(t4 && t4.prototype, { constructor: { value: e4, writable: true, configurable: true } }), t4 && d(e4, t4);
|
|
106
|
+
}(t3, r.a.Component), n2 = t3, (o2 = [{ key: "componentDidMount", value: function() {
|
|
107
|
+
var e4;
|
|
108
|
+
if (window.addEventListener("resize", this.handleResize), document.addEventListener("mouseup", this.handleMouseUp), document.addEventListener("mousemove", this.handleMouseMove), document.addEventListener("touchend", this.handleMouseUp), document.addEventListener("touchmove", this.handleTouchMove), this.props.secondaryInitialSize !== void 0)
|
|
109
|
+
e4 = this.props.secondaryInitialSize;
|
|
110
|
+
else {
|
|
111
|
+
var t4, n3 = this.container.getBoundingClientRect();
|
|
112
|
+
t4 = this.splitter ? this.splitter.getBoundingClientRect() : { width: 4, height: 4 }, e4 = this.getSecondaryPaneSize(n3, t4, { left: n3.left + (n3.width - t4.width) / 2, top: n3.top + (n3.height - t4.height) / 2 }, false);
|
|
113
|
+
}
|
|
114
|
+
this.setState({ secondaryPaneSize: e4 });
|
|
115
|
+
} }, { key: "componentDidUpdate", value: function(e4, t4) {
|
|
116
|
+
t4.secondaryPaneSize !== this.state.secondaryPaneSize && this.props.onSecondaryPaneSizeChange && this.props.onSecondaryPaneSizeChange(this.state.secondaryPaneSize), t4.resizing !== this.state.resizing && (this.state.resizing ? this.props.onDragStart && this.props.onDragStart() : this.props.onDragEnd && this.props.onDragEnd());
|
|
117
|
+
} }, { key: "componentWillUnmount", value: function() {
|
|
118
|
+
window.removeEventListener("resize", this.handleResize), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("touchend", this.handleMouseUp), document.removeEventListener("touchmove", this.handleTouchMove);
|
|
119
|
+
} }, { key: "getSecondaryPaneSize", value: function(e4, t4, n3, o3) {
|
|
120
|
+
var r2, i2, a2, s2;
|
|
121
|
+
this.props.vertical ? (r2 = e4.height, i2 = t4.height, a2 = n3.top - e4.top) : (r2 = e4.width, i2 = t4.width, a2 = n3.left - e4.left), o3 && (a2 -= i2 / 2), a2 < 0 ? a2 = 0 : a2 > r2 - i2 && (a2 = r2 - i2);
|
|
122
|
+
var c2 = r2 - i2 - (s2 = this.props.primaryIndex === 1 ? a2 : r2 - i2 - a2);
|
|
123
|
+
return this.props.percentage && (s2 = 100 * s2 / r2, c2 = 100 * c2 / r2, i2 = 100 * i2 / r2, r2 = 100), c2 < this.props.primaryMinSize ? s2 = Math.max(s2 - (this.props.primaryMinSize - c2), 0) : s2 < this.props.secondaryMinSize && (s2 = Math.min(r2 - i2 - this.props.primaryMinSize, this.props.secondaryMinSize)), s2;
|
|
124
|
+
} }, { key: "handleResize", value: function() {
|
|
125
|
+
if (this.splitter && !this.props.percentage) {
|
|
126
|
+
var e4 = this.container.getBoundingClientRect(), t4 = this.splitter.getBoundingClientRect(), n3 = this.getSecondaryPaneSize(e4, t4, { left: t4.left, top: t4.top }, false);
|
|
127
|
+
this.setState({ secondaryPaneSize: n3 });
|
|
128
|
+
}
|
|
129
|
+
} }, { key: "handleMouseMove", value: function(e4) {
|
|
130
|
+
if (this.state.resizing) {
|
|
131
|
+
var t4 = this.container.getBoundingClientRect(), n3 = this.splitter.getBoundingClientRect(), o3 = this.getSecondaryPaneSize(t4, n3, { left: e4.clientX, top: e4.clientY }, true);
|
|
132
|
+
f(), this.setState({ secondaryPaneSize: o3 });
|
|
133
|
+
}
|
|
134
|
+
} }, { key: "handleTouchMove", value: function(e4) {
|
|
135
|
+
this.handleMouseMove(e4.changedTouches[0]);
|
|
136
|
+
} }, { key: "handleSplitterMouseDown", value: function() {
|
|
137
|
+
f(), this.setState({ resizing: true });
|
|
138
|
+
} }, { key: "handleMouseUp", value: function() {
|
|
139
|
+
this.setState(function(e4) {
|
|
140
|
+
return e4.resizing ? { resizing: false } : null;
|
|
141
|
+
});
|
|
142
|
+
} }, { key: "render", value: function() {
|
|
143
|
+
var e4 = this, t4 = "splitter-layout";
|
|
144
|
+
this.props.customClassName && (t4 += " ".concat(this.props.customClassName)), this.props.vertical && (t4 += " splitter-layout-vertical"), this.state.resizing && (t4 += " layout-changing");
|
|
145
|
+
var n3 = r.a.Children.toArray(this.props.children).slice(0, 2);
|
|
146
|
+
n3.length === 0 && n3.push(r.a.createElement("div", null));
|
|
147
|
+
for (var o3 = [], i2 = this.props.primaryIndex !== 0 && this.props.primaryIndex !== 1 ? 0 : this.props.primaryIndex, a2 = 0; a2 < n3.length; ++a2) {
|
|
148
|
+
var s2 = true, l2 = null;
|
|
149
|
+
n3.length > 1 && a2 !== i2 && (s2 = false, l2 = this.state.secondaryPaneSize), o3.push(r.a.createElement(c, { vertical: this.props.vertical, percentage: this.props.percentage, primary: s2, size: l2 }, n3[a2]));
|
|
150
|
+
}
|
|
151
|
+
return r.a.createElement("div", { className: t4, ref: function(t5) {
|
|
152
|
+
e4.container = t5;
|
|
153
|
+
} }, o3[0], o3.length > 1 && r.a.createElement("div", { role: "separator", className: "layout-splitter", ref: function(t5) {
|
|
154
|
+
e4.splitter = t5;
|
|
155
|
+
}, onMouseDown: this.handleSplitterMouseDown, onTouchStart: this.handleSplitterMouseDown }), o3.length > 1 && o3[1]);
|
|
156
|
+
} }]) && u(n2.prototype, o2), t3;
|
|
157
|
+
}();
|
|
158
|
+
y.propTypes = { customClassName: a.a.string, vertical: a.a.bool, percentage: a.a.bool, primaryIndex: a.a.number, primaryMinSize: a.a.number, secondaryInitialSize: a.a.number, secondaryMinSize: a.a.number, onDragStart: a.a.func, onDragEnd: a.a.func, onSecondaryPaneSizeChange: a.a.func, children: a.a.arrayOf(a.a.node) }, y.defaultProps = { customClassName: "", vertical: false, percentage: false, primaryIndex: 0, primaryMinSize: 0, secondaryInitialSize: void 0, secondaryMinSize: 0, onDragStart: null, onDragEnd: null, onSecondaryPaneSizeChange: null, children: [] };
|
|
159
|
+
var m = y;
|
|
160
|
+
t2.default = m;
|
|
161
|
+
}]);
|
|
162
|
+
});
|
|
163
|
+
})(lib);
|
|
164
|
+
const SplitterLayout = /* @__PURE__ */ getDefaultExportFromCjs(lib.exports);
|
|
165
|
+
export { SplitterLayout as S };
|
package/dist/vendor.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "@mui/material/Box";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "./components/mui_extended/MenuPopover/index.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "@m4l/core";
|
|
6
|
+
import "@mui/material";
|
|
7
|
+
import "react-router-dom";
|
|
8
|
+
import "./components/mui_extended/MenuActions/index.js";
|
|
9
|
+
import "prop-types";
|
|
10
|
+
import "./react-splitter-layout.js";
|
|
11
|
+
import "./components/SplitLayout/index.js";
|
|
12
|
+
import "./components/mui_extended/BoxIcon/index.js";
|
|
13
|
+
import "./components/mui_extended/Breadcrumbs/index.js";
|
|
14
|
+
function getDefaultExportFromCjs(x) {
|
|
15
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
16
|
+
}
|
|
17
|
+
export { getDefaultExportFromCjs as g };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@m4l/core": "^0.0.26",
|
|
22
22
|
"@mui/material": "^5.8.7",
|
|
23
|
+
"prop-types": "^15.8.1",
|
|
23
24
|
"react": "^17.0.0 || 18.x",
|
|
24
25
|
"react-dom": "^18.0.0",
|
|
25
|
-
"react-router-dom":"^6.3.0"
|
|
26
|
+
"react-router-dom": "^6.3.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@emotion/styled": "^11.9.3",
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"@types/node": "^17.0.40",
|
|
35
36
|
"@types/react": "^18.0.0",
|
|
36
37
|
"@types/react-dom": "^18.0.0",
|
|
38
|
+
"@types/react-splitter-layout": "^3.0.2",
|
|
37
39
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
38
40
|
"@typescript-eslint/parser": "^5.27.1",
|
|
39
41
|
"@vitejs/plugin-react": "^1.3.2",
|
|
@@ -47,6 +49,8 @@
|
|
|
47
49
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
48
50
|
"eslint-plugin-unused-imports": "^2.0.0",
|
|
49
51
|
"prettier": "^2.6.2",
|
|
52
|
+
"prop-types": "^15.8.1",
|
|
53
|
+
"react-splitter-layout": "^4.0.0",
|
|
50
54
|
"rollup-plugin-terser": "^7.0.2",
|
|
51
55
|
"typescript": "^4.6.3",
|
|
52
56
|
"vite": "^2.9.9",
|