@zat-design/sisyphus-react 4.7.0-beta.2 → 4.7.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.
@@ -65,7 +65,7 @@ const LineFields = (props) => {
65
65
  ...listeners,
66
66
  className: "pro-form-list-drag-handle",
67
67
  ref: setActivatorNodeRef,
68
- children: /* @__PURE__ */ jsx(ProIcon, { component: dragSvg, size: 20, color: "#949599" })
68
+ children: /* @__PURE__ */ jsx(ProIcon, { component: dragSvg, size: 16 })
69
69
  }
70
70
  ),
71
71
  /* @__PURE__ */ jsx(Row, { className: "pro-form-list-fields", gutter: isLess ? 0 : 24, children: /* @__PURE__ */ jsx(
@@ -35,12 +35,17 @@
35
35
 
36
36
  .pro-form-list-drag-handle {
37
37
  display: flex;
38
+ flex-shrink: 0;
38
39
  align-items: center;
39
40
  height: 32px;
40
41
  margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
41
42
  padding: 0;
42
43
  padding-right: @zaui-space-size-sm;
43
44
  border: none;
45
+
46
+ .pro-icon {
47
+ cursor: move;
48
+ }
44
49
  }
45
50
 
46
51
  > .pro-form-list-fields {
@@ -279,7 +279,17 @@ const Render = (props) => {
279
279
  const internalItemRender = {
280
280
  mark: "pro_table_render",
281
281
  render: (inputProps, doms) => /* @__PURE__ */ jsxs(Fragment, { children: [
282
- /* @__PURE__ */ jsx(Space, { size: 0, style: { marginTop: 8 }, children: formItemProps.above }),
282
+ /* @__PURE__ */ jsx(
283
+ Space,
284
+ {
285
+ size: 0,
286
+ style: {
287
+ marginTop: 8,
288
+ marginBottom: type === "ProUpload" && lastComponentProps.uploadType === "image" ? 8 : void 0
289
+ },
290
+ children: formItemProps.above
291
+ }
292
+ ),
283
293
  /* @__PURE__ */ jsxs(
284
294
  "div",
285
295
  {
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useContext } from "react";
2
+ import { useContext, useEffect, useState } from "react";
3
3
  import { Popover, Tooltip } from "antd";
4
4
  import classnames from "classnames";
5
5
  import { Link as RouterLink } from "react-router-dom";
@@ -10,149 +10,201 @@ import { getUrlParams, getPathNameKey, findMenuItemByKey } from "../../../../uti
10
10
  const Link = RouterLink;
11
11
  const FoldMenu = (props) => {
12
12
  const { style, dataSource, onMenuClick } = props;
13
- const { menus, iconfontUrl, notice, collapsed, headerHeight } = dataSource;
13
+ const {
14
+ menus,
15
+ iconfontUrl,
16
+ notice,
17
+ collapsed,
18
+ headerHeight,
19
+ collapsedMenuShowLabel = false
20
+ } = dataSource;
14
21
  const pathNamePrefix = `/${window.location.pathname.split("/")[1]}`;
22
+ const [activeHoverKey, setActiveHoverKey] = useState(null);
23
+ useEffect(() => {
24
+ setActiveHoverKey(null);
25
+ }, [collapsed, collapsedMenuShowLabel]);
26
+ const handleHoverOpenChange = (key, open) => {
27
+ setActiveHoverKey((current) => open ? key : current === key ? null : current);
28
+ };
15
29
  const noticeCls = classnames({
16
30
  "pro-layout-menu-tooltip": true,
17
31
  "pro-layout-menu-tooltip-has-notice": notice,
18
- "pro-layout-menu-tooltip-nav-open": collapsed
32
+ "pro-layout-menu-tooltip-nav-open": collapsed,
33
+ "pro-layout-menu-tooltip-show-label": collapsedMenuShowLabel
19
34
  });
20
35
  const { selectedPath, onSelected, menuSelectedPath } = useContext(LayoutContext) || {
21
36
  selectedPath: "",
22
37
  onSelected: () => {
23
38
  }
24
39
  };
25
- return /* @__PURE__ */ jsx("div", { className: "pro-layout-menu-fold", style: { ...style }, children: /* @__PURE__ */ jsx("ul", { className: "pro-layout-menu-fold-list", style: { ...style }, children: menus.filter((item) => !item.hideInMenu).map((item, index) => {
26
- var _a;
27
- const { id, url, name, icon, imgUrl, imgActiveUrl, children } = item;
28
- const toPath = item.redirectUrl || item.url;
29
- const selectedMenu = getUrlParams("activeMenu");
30
- const pathToMatch = menuSelectedPath ?? (selectedPath || selectedMenu || window.location.pathname);
31
- const currentKeyIdPath = pathToMatch ? getPathNameKey({ menus, pathName: pathToMatch }) || [] : [];
32
- const cls = classnames({
33
- active: currentKeyIdPath.includes(id)
34
- });
35
- const hasChildrenMenu = Array.isArray(children) && children.length;
36
- const LiNode = /* @__PURE__ */ jsx("li", { id: (_a = url == null ? void 0 : url.split("/")) == null ? void 0 : _a[1], className: `${cls} pro-layout-menu-fold-li`, children: /* @__PURE__ */ jsxs("div", { children: [
37
- imgUrl ? /* @__PURE__ */ jsx(
38
- "img",
39
- {
40
- className: "pro-layout-icon",
41
- src: pathNamePrefix === url ? imgActiveUrl || imgUrl : imgUrl,
42
- alt: "icon"
43
- }
44
- ) : /* @__PURE__ */ jsx(
45
- ProIcon,
40
+ return /* @__PURE__ */ jsx(
41
+ "div",
42
+ {
43
+ className: classnames("pro-layout-menu-fold", {
44
+ "pro-layout-menu-fold-show-label": collapsedMenuShowLabel
45
+ }),
46
+ style: { ...style },
47
+ children: /* @__PURE__ */ jsx(
48
+ "ul",
46
49
  {
47
- type: icon || "",
48
- size: "20px",
49
- color: currentKeyIdPath.includes(id) ? "#fff" : void 0
50
- }
51
- ),
52
- /* @__PURE__ */ jsx("h2", { children: name })
53
- ] }) });
54
- return hasChildrenMenu ? /* @__PURE__ */ jsx(
55
- Popover,
56
- {
57
- mouseEnterDelay: 0,
58
- content: /* @__PURE__ */ jsx(SideMenu, { dataSource: { ...dataSource, menus: item }, onMenuClick }),
59
- color: "#fff",
60
- classNames: { root: noticeCls },
61
- styles: {
62
- content: {
63
- marginTop: headerHeight - 64,
64
- height: `calc(100vh - ${headerHeight + (notice ? 32 : 0) + 12}px)`,
65
- overflow: "hidden"
66
- }
67
- },
68
- placement: "rightTop",
69
- children: /* @__PURE__ */ jsx(
70
- "span",
71
- {
72
- onClick: (e) => {
73
- const menuItem = findMenuItemByKey(menus, String(id));
74
- const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
75
- let shouldActivate = true;
76
- if (onMenuClick) {
77
- const result = onMenuClick({
78
- item: menuItem,
79
- key: String(id),
80
- keyPath: menuKeyPath
81
- });
82
- if (result === false) {
83
- shouldActivate = false;
84
- }
85
- }
86
- if (shouldActivate) {
87
- onSelected({
88
- selectedPath: toPath
89
- });
90
- }
91
- },
92
- children: LiNode
93
- }
94
- )
95
- },
96
- `${id}-${name}`
97
- ) : !collapsed ? /* @__PURE__ */ jsx(Tooltip, { placement: "right", title: name, children: /* @__PURE__ */ jsx(
98
- "span",
99
- {
100
- onClickCapture: (e) => {
101
- const menuItem = findMenuItemByKey(menus, String(id));
102
- const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
103
- let shouldActivate = true;
104
- if (onMenuClick) {
105
- const result = onMenuClick({
106
- item: menuItem,
107
- key: String(id),
108
- keyPath: menuKeyPath
109
- });
110
- if (result === false) {
111
- shouldActivate = false;
112
- }
113
- }
114
- if (shouldActivate) {
115
- onSelected({
116
- selectedPath: toPath
50
+ className: "pro-layout-menu-fold-list",
51
+ style: { ...style },
52
+ onScroll: () => setActiveHoverKey(null),
53
+ children: menus.filter((item) => !item.hideInMenu).map((item, index) => {
54
+ var _a;
55
+ const { id, url, name, icon, imgUrl, imgActiveUrl, children } = item;
56
+ const hoverKey = String(id);
57
+ const hoverOpen = !collapsed && activeHoverKey === hoverKey;
58
+ const nameCharacters = Array.from(name || "");
59
+ const label = collapsedMenuShowLabel && !collapsed && nameCharacters.length > 4 ? `${nameCharacters.slice(0, 4).join("")}...` : name;
60
+ const toPath = item.redirectUrl || item.url;
61
+ const selectedMenu = getUrlParams("activeMenu");
62
+ const pathToMatch = menuSelectedPath ?? (selectedPath || selectedMenu || window.location.pathname);
63
+ const currentKeyIdPath = pathToMatch ? getPathNameKey({ menus, pathName: pathToMatch }) || [] : [];
64
+ const cls = classnames({
65
+ active: currentKeyIdPath.includes(id)
117
66
  });
118
- } else {
119
- e.preventDefault();
120
- e.stopPropagation();
121
- }
122
- },
123
- children: /* @__PURE__ */ jsx(Link, { to: toPath, children: LiNode })
124
- }
125
- ) }, `${id}-${name}`) : /* @__PURE__ */ jsx(
126
- "span",
127
- {
128
- onClickCapture: (e) => {
129
- const menuItem = findMenuItemByKey(menus, String(id));
130
- const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
131
- let shouldActivate = true;
132
- if (onMenuClick) {
133
- const result = onMenuClick({
134
- item: menuItem,
135
- key: String(id),
136
- keyPath: menuKeyPath
137
- });
138
- if (result === false) {
139
- shouldActivate = false;
140
- }
141
- }
142
- if (shouldActivate) {
143
- onSelected({
144
- selectedPath: toPath
145
- });
146
- } else {
147
- e.preventDefault();
148
- e.stopPropagation();
149
- }
150
- },
151
- children: /* @__PURE__ */ jsx(Link, { to: toPath, children: LiNode })
152
- },
153
- `${id}-${name}`
154
- );
155
- }) }) });
67
+ const hasChildrenMenu = Array.isArray(children) && children.length;
68
+ const LiNode = /* @__PURE__ */ jsx("li", { id: (_a = url == null ? void 0 : url.split("/")) == null ? void 0 : _a[1], className: `${cls} pro-layout-menu-fold-li`, children: /* @__PURE__ */ jsxs("div", { children: [
69
+ imgUrl ? /* @__PURE__ */ jsx(
70
+ "img",
71
+ {
72
+ className: "pro-layout-icon",
73
+ src: pathNamePrefix === url ? imgActiveUrl || imgUrl : imgUrl,
74
+ alt: "icon"
75
+ }
76
+ ) : /* @__PURE__ */ jsx(
77
+ ProIcon,
78
+ {
79
+ type: icon || "",
80
+ size: "20px",
81
+ color: currentKeyIdPath.includes(id) ? "#fff" : void 0
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx("h2", { title: name, "aria-label": name, children: label })
85
+ ] }) });
86
+ return hasChildrenMenu ? /* @__PURE__ */ jsx(
87
+ Popover,
88
+ {
89
+ mouseEnterDelay: 0,
90
+ open: hoverOpen,
91
+ onOpenChange: (open) => handleHoverOpenChange(hoverKey, open),
92
+ content: /* @__PURE__ */ jsx(SideMenu, { dataSource: { ...dataSource, menus: item }, onMenuClick }),
93
+ color: "#fff",
94
+ classNames: { root: noticeCls },
95
+ styles: {
96
+ // 立即隐藏退场中的旧浮层,避免快速移动时动画叠加。
97
+ root: { display: hoverOpen ? void 0 : "none" },
98
+ content: {
99
+ marginTop: headerHeight - 64,
100
+ height: `calc(100vh - ${headerHeight + (notice ? 32 : 0) + 12}px)`,
101
+ overflow: "hidden"
102
+ }
103
+ },
104
+ placement: "rightTop",
105
+ children: /* @__PURE__ */ jsx(
106
+ "span",
107
+ {
108
+ onClick: (e) => {
109
+ const menuItem = findMenuItemByKey(menus, String(id));
110
+ const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
111
+ let shouldActivate = true;
112
+ if (onMenuClick) {
113
+ const result = onMenuClick({
114
+ item: menuItem,
115
+ key: String(id),
116
+ keyPath: menuKeyPath
117
+ });
118
+ if (result === false) {
119
+ shouldActivate = false;
120
+ }
121
+ }
122
+ if (shouldActivate) {
123
+ onSelected({
124
+ selectedPath: toPath
125
+ });
126
+ }
127
+ },
128
+ children: LiNode
129
+ }
130
+ )
131
+ },
132
+ `${id}-${name}`
133
+ ) : !collapsed ? /* @__PURE__ */ jsx(
134
+ Tooltip,
135
+ {
136
+ placement: "right",
137
+ title: name,
138
+ mouseEnterDelay: 0,
139
+ open: hoverOpen,
140
+ onOpenChange: (open) => handleHoverOpenChange(hoverKey, open),
141
+ styles: { root: { display: hoverOpen ? void 0 : "none" } },
142
+ children: /* @__PURE__ */ jsx(
143
+ "span",
144
+ {
145
+ onClickCapture: (e) => {
146
+ const menuItem = findMenuItemByKey(menus, String(id));
147
+ const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
148
+ let shouldActivate = true;
149
+ if (onMenuClick) {
150
+ const result = onMenuClick({
151
+ item: menuItem,
152
+ key: String(id),
153
+ keyPath: menuKeyPath
154
+ });
155
+ if (result === false) {
156
+ shouldActivate = false;
157
+ }
158
+ }
159
+ if (shouldActivate) {
160
+ onSelected({
161
+ selectedPath: toPath
162
+ });
163
+ } else {
164
+ e.preventDefault();
165
+ e.stopPropagation();
166
+ }
167
+ },
168
+ children: /* @__PURE__ */ jsx(Link, { to: toPath, children: LiNode })
169
+ }
170
+ )
171
+ },
172
+ `${id}-${name}`
173
+ ) : /* @__PURE__ */ jsx(
174
+ "span",
175
+ {
176
+ onClickCapture: (e) => {
177
+ const menuItem = findMenuItemByKey(menus, String(id));
178
+ const menuKeyPath = (menuItem == null ? void 0 : menuItem.keyIdPath) ? menuItem.keyIdPath.map((id2) => String(id2)) : [String(id)];
179
+ let shouldActivate = true;
180
+ if (onMenuClick) {
181
+ const result = onMenuClick({
182
+ item: menuItem,
183
+ key: String(id),
184
+ keyPath: menuKeyPath
185
+ });
186
+ if (result === false) {
187
+ shouldActivate = false;
188
+ }
189
+ }
190
+ if (shouldActivate) {
191
+ onSelected({
192
+ selectedPath: toPath
193
+ });
194
+ } else {
195
+ e.preventDefault();
196
+ e.stopPropagation();
197
+ }
198
+ },
199
+ children: /* @__PURE__ */ jsx(Link, { to: toPath, children: LiNode })
200
+ },
201
+ `${id}-${name}`
202
+ );
203
+ })
204
+ }
205
+ )
206
+ }
207
+ );
156
208
  };
157
209
  var FoldMenu_default = FoldMenu;
158
210
  export {
@@ -1,17 +1,33 @@
1
1
  @import '../../../../../../style/variables.less';
2
+ @import '../../../../../style/variables.less';
2
3
 
3
4
  .pro-layout-menu-fold-list {
4
5
  padding-top: 4px;
6
+ overflow-x: hidden;
5
7
  overflow-y: auto;
6
8
 
9
+ // 两种宽度共用细滚动条,菜单项不随滚动条出现而挤窄。
10
+ &::-webkit-scrollbar {
11
+ width: 4px;
12
+ }
13
+
14
+ &::-webkit-scrollbar-thumb {
15
+ background: rgba(0, 0, 0, 0.2);
16
+ border-radius: 2px;
17
+ }
18
+
19
+ a {
20
+ text-decoration: none;
21
+ }
22
+
7
23
  li {
8
- width: 100%;
24
+ width: @pro-layout-menu-fold-width;
9
25
  min-height: 48px;
10
26
  padding: 12px;
11
27
  overflow: hidden;
12
28
  text-overflow: ellipsis;
13
29
 
14
- div {
30
+ > div {
15
31
  display: flex;
16
32
  align-items: center;
17
33
  justify-content: center;
@@ -34,8 +50,14 @@
34
50
 
35
51
  h2 {
36
52
  display: none;
37
- flex-grow: 1;
38
- margin-bottom: 0;
53
+ margin: 0;
54
+ padding: 0;
55
+ color: inherit;
56
+ font-size: 12px;
57
+ font-weight: normal;
58
+ line-height: 17px;
59
+ text-align: center;
60
+ white-space: nowrap;
39
61
  opacity: 1;
40
62
  transition:
41
63
  opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
@@ -54,14 +76,6 @@
54
76
  color: #909090;
55
77
  }
56
78
 
57
- h2 {
58
- display: inline-block;
59
- padding-left: var(--zaui-space-size-sm, 8px);
60
- color: var(--zaui-base-bg, #ffffff);
61
- font-weight: normal;
62
- font-size: var(--zaui-font-size-md, 14px);
63
- }
64
-
65
79
  &.active {
66
80
  background-color: var(--zaui-brand, #006aff);
67
81
 
@@ -74,6 +88,27 @@
74
88
  }
75
89
  }
76
90
 
91
+ .pro-layout-menu-fold-show-label .pro-layout-menu-fold-list {
92
+ padding-top: 8px;
93
+
94
+ li {
95
+ width: @pro-layout-menu-label-width;
96
+ height: 56px;
97
+ margin-bottom: 4px;
98
+ padding: 8px 4px;
99
+
100
+ > div {
101
+ flex-direction: column;
102
+ gap: 3px;
103
+
104
+ h2 {
105
+ display: block;
106
+ width: 64px;
107
+ }
108
+ }
109
+ }
110
+ }
111
+
77
112
  .pro-layout-menu-tooltip {
78
113
  top: 64px !important;
79
114
  transform: none !important;
@@ -92,13 +127,13 @@
92
127
 
93
128
  .pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open.@{ant-prefix}-popover-placement-rightBottom,
94
129
  .pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open.@{ant-prefix}-popover-placement-rightTop {
95
- left: 220px !important;
130
+ left: @pro-layout-menu-open-width !important;
96
131
  }
97
132
 
98
133
  .pro-layout-menu-tooltip.@{ant-prefix}-popover-placement-rightBottom,
99
134
  .pro-layout-menu-tooltip.@{ant-prefix}-popover-placement-rightTop {
100
135
  position: fixed;
101
- left: 49px !important;
136
+ left: (@pro-layout-menu-fold-width + 1px) !important;
102
137
  z-index: 99;
103
138
  padding-left: 0;
104
139
 
@@ -111,6 +146,10 @@
111
146
  padding: 0;
112
147
  }
113
148
 
149
+ .pro-layout-menu-tooltip.pro-layout-menu-tooltip-show-label {
150
+ left: (@pro-layout-menu-label-width + 1px) !important;
151
+ }
152
+
114
153
  .pro-layout-menu-tooltip .@{ant-prefix}-popover-content > .@{ant-prefix}-popover-arrow {
115
154
  display: none;
116
155
  }
@@ -1,6 +1,6 @@
1
1
  import type { FC, ReactNode } from 'react';
2
2
  import type { ProLayoutType } from '../../../propTypes';
3
- type MenuProps = Pick<ProLayoutType, 'mode' | 'headerHeight' | 'dataSource' | 'iconfontUrl' | 'collapsed' | 'notice' | 'pure' | 'sideMenuFooterRender' | 'onMenuClick'> & {
3
+ type MenuProps = Pick<ProLayoutType, 'mode' | 'headerHeight' | 'dataSource' | 'iconfontUrl' | 'collapsed' | 'collapsedMenuShowLabel' | 'notice' | 'pure' | 'sideMenuFooterRender' | 'onMenuClick'> & {
4
4
  sideMenuHeaderRender?: ReactNode;
5
5
  onToggle?: () => void;
6
6
  };
@@ -29,6 +29,7 @@ const Menu = (props) => {
29
29
  dataSource,
30
30
  iconfontUrl,
31
31
  collapsed,
32
+ collapsedMenuShowLabel = false,
32
33
  notice,
33
34
  onToggle,
34
35
  pure,
@@ -149,6 +150,7 @@ const Menu = (props) => {
149
150
  height: headerHeight + (notice ? 32 : 0) + 48,
150
151
  notice,
151
152
  collapsed,
153
+ collapsedMenuShowLabel,
152
154
  headerHeight
153
155
  },
154
156
  onMenuClick,
@@ -26,34 +26,9 @@
26
26
  transform: rotate(45deg);
27
27
  }
28
28
 
29
- &.pro-layout-menu-no-collapsed {
30
- .pro-layout-menu-fold-li {
31
- display: flex;
32
- align-items: center;
33
- justify-content: center;
34
-
35
- div {
36
- width: 20px;
37
- }
38
-
39
- a {
40
- width: 20px;
41
- }
42
-
43
- h2 {
44
- display: inline-block;
45
- white-space: nowrap;
46
- opacity: 0;
47
- transition:
48
- opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
49
- color 0.3s;
50
- }
51
- }
52
- }
53
-
54
29
  &.pro-layout-menu-collapsed {
55
30
  .pro-layout-content {
56
- margin-left: 220px !important;
31
+ margin-left: @pro-layout-menu-open-width !important;
57
32
 
58
33
  .pro-layout-content {
59
34
  margin-left: 0 !important;
@@ -84,7 +59,7 @@
84
59
  top: 64px;
85
60
  left: 0;
86
61
  z-index: 50;
87
- width: 48px;
62
+ width: @pro-layout-menu-fold-size;
88
63
  height: 100vh;
89
64
  min-height: 100%;
90
65
  padding: 0;
@@ -96,14 +71,14 @@
96
71
  width 0.3s cubic-bezier(0.2, 0, 0, 1) 0s;
97
72
 
98
73
  &.pro-layout-menu-open {
99
- width: 220px;
74
+ width: @pro-layout-menu-open-width;
100
75
  background-color: #f7f9fd;
101
76
  }
102
77
  }
103
78
 
104
79
  .pro-layout-menu.pro-layout-menu-open .pro-layout-menu-collapsed {
105
80
  left: 0;
106
- width: 220px;
81
+ width: @pro-layout-menu-open-width;
107
82
  }
108
83
 
109
84
  .pro-layout-menu.pro-layout-menu-open .pro-layout-menu-collapsed img {
@@ -118,7 +93,7 @@
118
93
  display: flex;
119
94
  align-items: center;
120
95
  justify-content: center;
121
- width: 48px;
96
+ width: @pro-layout-menu-fold-size;
122
97
  height: 48px;
123
98
  background: #f7f9fd;
124
99
  transition: all 0.3s ease;
@@ -135,6 +110,6 @@
135
110
  }
136
111
 
137
112
  .pro-layout-menu-open ~ .pro-layout-content {
138
- margin-left: 220px !important;
113
+ margin-left: @pro-layout-menu-open-width !important;
139
114
  }
140
115
  }
@@ -31,6 +31,7 @@ const ProLayout = (props) => {
31
31
  target,
32
32
  onCollapsedChange,
33
33
  collapsed: propsCollapsed = false,
34
+ collapsedMenuShowLabel = false,
34
35
  onMenuClick,
35
36
  // Header组件需要的props
36
37
  headerTitleRender,
@@ -243,6 +244,7 @@ const ProLayout = (props) => {
243
244
  dataSource: Array.isArray(menus) ? { menus } : menus,
244
245
  iconfontUrl,
245
246
  collapsed,
247
+ collapsedMenuShowLabel,
246
248
  notice,
247
249
  onToggle: () => {
248
250
  toggle();
@@ -275,6 +277,7 @@ const ProLayout = (props) => {
275
277
  "pro-layout": true,
276
278
  "pro-layout-light": true,
277
279
  "pro-layout-pure": typeof pure === "boolean" ? pure : (pure == null ? void 0 : pure.topMenu) || (pure == null ? void 0 : pure.leftMenu),
280
+ "pro-layout-show-collapsed-menu-label": collapsedMenuShowLabel,
278
281
  [`${className}`]: className
279
282
  }),
280
283
  style: {
@@ -218,6 +218,11 @@ interface ProLayoutBaseProps {
218
218
  * @default false
219
219
  */
220
220
  collapsed?: boolean;
221
+ /**
222
+ * @description 收起时显示菜单名称并使用 72px 侧栏;默认仅显示图标,宽度 48px
223
+ * @default false
224
+ */
225
+ collapsedMenuShowLabel?: boolean;
221
226
  /**
222
227
  * @description 菜单拼接路径前缀
223
228
  * @default ""