rc-lib-ui 1.0.21 → 1.0.22
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.
|
@@ -6,5 +6,6 @@ export interface MuiMenuProps extends DrawerProps {
|
|
|
6
6
|
initWidth: number;
|
|
7
7
|
minWidthColumn: Pick<CSSObject, 'width'>;
|
|
8
8
|
};
|
|
9
|
+
styleList?: 'variant1' | 'variant2';
|
|
9
10
|
}
|
|
10
11
|
export declare const MuiMenu: import('@emotion/styled').StyledComponent<DrawerProps & import('@mui/system').MUIStyledCommonProps<Theme> & MuiMenuProps, {}, {}>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { styled as p, Drawer as c } from "@mui/material";
|
|
2
|
-
const
|
|
2
|
+
const e = (i, n, t = !0) => ({
|
|
3
3
|
width: n,
|
|
4
|
-
...
|
|
4
|
+
...t && {
|
|
5
5
|
transition: i.transitions.create("width", {
|
|
6
6
|
easing: i.transitions.easing.sharp,
|
|
7
7
|
duration: i.transitions.duration.enteringScreen
|
|
8
8
|
})
|
|
9
9
|
},
|
|
10
10
|
overflow: "hidden"
|
|
11
|
-
}),
|
|
12
|
-
...
|
|
11
|
+
}), a = (i, n, t = !0) => ({
|
|
12
|
+
...t && {
|
|
13
13
|
transition: i.transitions.create("width", {
|
|
14
14
|
easing: i.transitions.easing.sharp,
|
|
15
15
|
duration: i.transitions.duration.leavingScreen
|
|
@@ -21,30 +21,30 @@ const a = (i, n, r = !0) => ({
|
|
|
21
21
|
// [theme.breakpoints.up('sm')]: {
|
|
22
22
|
// width: `calc(${theme.spacing(8)} + 1px)`,
|
|
23
23
|
// },
|
|
24
|
-
}),
|
|
25
|
-
shouldForwardProp: (i) => !["open", "isWrapText", "columnMenu", "isRight"].includes(i)
|
|
24
|
+
}), u = p(c, {
|
|
25
|
+
shouldForwardProp: (i) => !["open", "isWrapText", "columnMenu", "isRight", "styleList"].includes(i)
|
|
26
26
|
})(
|
|
27
|
-
({ theme: i, open: n, isRight:
|
|
28
|
-
const d =
|
|
27
|
+
({ theme: i, open: n, isRight: t, columnMenu: o }) => {
|
|
28
|
+
const d = t ? "Left" : "Right", r = o.initWidth, s = o.minWidthColumn;
|
|
29
29
|
return {
|
|
30
|
-
width:
|
|
30
|
+
width: r,
|
|
31
31
|
position: "relative",
|
|
32
32
|
zIndex: 0,
|
|
33
33
|
flexShrink: 0,
|
|
34
34
|
whiteSpace: "nowrap",
|
|
35
35
|
boxSizing: "border-box",
|
|
36
36
|
[`border${d}`]: `1px solid ${i.palette.divider}`,
|
|
37
|
-
...
|
|
38
|
-
...n ?
|
|
37
|
+
...t ? { order: 1 } : { order: 0 },
|
|
38
|
+
...n ? e(i, r) : a(i, s),
|
|
39
39
|
"& .MuiDrawer-paper": {
|
|
40
40
|
position: "static",
|
|
41
41
|
// при isWrapText - при открытии меню текст сжатый и значки смешаются поэтому ставим условие
|
|
42
|
-
...n ?
|
|
42
|
+
...n ? e(i, r) : a(i, s)
|
|
43
43
|
// ...(open ? openedMixin(theme, initWidth) : closedMixin(theme, isWrapText ? { width: initWidth } : minWidth))
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
u as MuiMenu
|
|
50
50
|
};
|