@hi-ui/menu 4.0.0-beta.7 → 4.0.0
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/Expander.js +3 -4
- package/lib/cjs/Menu.js +202 -56
- package/lib/cjs/MenuItem.js +74 -58
- package/lib/cjs/context.js +1 -2
- package/lib/cjs/index.js +1 -2
- package/lib/cjs/styles/index.scss.js +3 -4
- package/lib/cjs/util.js +1 -2
- package/lib/esm/Expander.js +1 -2
- package/lib/esm/Menu.js +193 -53
- package/lib/esm/MenuItem.js +26 -10
- package/lib/esm/context.js +2 -3
- package/lib/esm/index.js +1 -2
- package/lib/esm/styles/index.scss.js +4 -6
- package/lib/esm/util.js +1 -2
- package/lib/types/Menu.d.ts +67 -5
- package/lib/types/MenuItem.d.ts +4 -1
- package/lib/types/context.d.ts +2 -1
- package/lib/types/types.d.ts +12 -2
- package/package.json +21 -16
- package/lib/cjs/Expander.js.map +0 -1
- package/lib/cjs/Menu.js.map +0 -1
- package/lib/cjs/MenuItem.js.map +0 -1
- package/lib/cjs/context.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/styles/index.scss.js.map +0 -1
- package/lib/cjs/util.js.map +0 -1
- package/lib/esm/Expander.js.map +0 -1
- package/lib/esm/Menu.js.map +0 -1
- package/lib/esm/MenuItem.js.map +0 -1
- package/lib/esm/context.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/styles/index.scss.js.map +0 -1
- package/lib/esm/util.js.map +0 -1
package/lib/cjs/MenuItem.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -48,6 +48,12 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
48
48
|
var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
|
|
49
49
|
|
|
50
50
|
var MENU_PREFIX = classname.getPrefixCls('menu');
|
|
51
|
+
var hiddenStyle = {
|
|
52
|
+
position: 'absolute',
|
|
53
|
+
opacity: 0,
|
|
54
|
+
order: 9999,
|
|
55
|
+
visibility: 'hidden'
|
|
56
|
+
};
|
|
51
57
|
var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
52
58
|
var _cx, _cx2;
|
|
53
59
|
|
|
@@ -62,11 +68,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
62
68
|
level = _a$level === void 0 ? 1 : _a$level,
|
|
63
69
|
children = _a.children,
|
|
64
70
|
parentIds = _a.parentIds,
|
|
65
|
-
|
|
71
|
+
_a$hidden = _a.hidden,
|
|
72
|
+
hidden = _a$hidden === void 0 ? false : _a$hidden,
|
|
73
|
+
render = _a.render,
|
|
74
|
+
raw = _a.raw,
|
|
75
|
+
rest = tslib.__rest(_a, ["prefixCls", "className", "icon", "title", "disabled", "id", "level", "children", "parentIds", "hidden", "render", "raw"]);
|
|
66
76
|
|
|
67
77
|
var itemRef = React.useRef(null);
|
|
68
78
|
|
|
69
|
-
var _useContext = React.useContext(context[
|
|
79
|
+
var _useContext = React.useContext(context["default"]),
|
|
70
80
|
placement = _useContext.placement,
|
|
71
81
|
expandedType = _useContext.expandedType,
|
|
72
82
|
showAllSubMenus = _useContext.showAllSubMenus,
|
|
@@ -83,10 +93,11 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
83
93
|
|
|
84
94
|
var hasChildren = typeAssertion.isArrayNonEmpty(children);
|
|
85
95
|
var mergedRef = useMergeRefs.useMergeRefs(itemRef, ref);
|
|
86
|
-
return /*#__PURE__*/React__default[
|
|
96
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("li", Object.assign({
|
|
87
97
|
ref: mergedRef,
|
|
88
|
-
className: classname.cx(prefixCls + "-item", (_cx = {}, _cx[prefixCls + "-item__inner--mini"] = mini, _cx[prefixCls + "-item--disabled"] = disabled, _cx[prefixCls + "-item--active"] = placement === 'horizontal' && (activeId === id || (activeParents === null || activeParents === void 0 ? void 0 : activeParents.includes(id))) && level === 1, _cx), className)
|
|
89
|
-
|
|
98
|
+
className: classname.cx(prefixCls + "-item", (_cx = {}, _cx[prefixCls + "-item__inner--mini"] = mini, _cx[prefixCls + "-item--disabled"] = disabled, _cx[prefixCls + "-item--active"] = placement === 'horizontal' && (activeId === id || (activeParents === null || activeParents === void 0 ? void 0 : activeParents.includes(id))) && level === 1, _cx), className),
|
|
99
|
+
style: hidden ? hiddenStyle : undefined
|
|
100
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
90
101
|
className: classname.cx(prefixCls + "-item__inner", (_cx2 = {}, _cx2[prefixCls + "-item__inner--active"] = activeId === id, _cx2[prefixCls + "-item__inner--active-p"] = activeParents === null || activeParents === void 0 ? void 0 : activeParents.includes(id), _cx2[prefixCls + "-item__inner--expanded"] = expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id), _cx2)),
|
|
91
102
|
onClick: function onClick() {
|
|
92
103
|
if (typeAssertion.isArrayNonEmpty(children)) {
|
|
@@ -95,7 +106,8 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
95
106
|
}
|
|
96
107
|
} else {
|
|
97
108
|
if (clickMenu) {
|
|
98
|
-
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
clickMenu(id, raw);
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
if (closeAllPopper && !(placement === 'vertical' && expandedType === 'collapse' && mini === false)) {
|
|
@@ -106,39 +118,44 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
106
118
|
}, placement === 'vertical' && expandedType === 'collapse' && !mini ? renderIndent({
|
|
107
119
|
prefixCls: prefixCls + "-item",
|
|
108
120
|
depth: level - 1
|
|
109
|
-
}) : null, icon ? /*#__PURE__*/React__default[
|
|
121
|
+
}) : null, icon ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
110
122
|
className: prefixCls + "-item__icon"
|
|
111
|
-
}, icon) : null, /*#__PURE__*/React__default[
|
|
123
|
+
}, icon) : null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
112
124
|
className: prefixCls + "-item__content"
|
|
113
|
-
},
|
|
125
|
+
}, typeAssertion.isFunction(render) ? render({
|
|
126
|
+
id: id,
|
|
127
|
+
icon: icon,
|
|
128
|
+
title: title
|
|
129
|
+
}) : title), hasChildren && !mini && placement === 'vertical' && expandedType === 'collapse' && !showAllSubMenus && ((expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)) ? /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
114
130
|
prefixCls: prefixCls + "-item",
|
|
115
131
|
direction: "up"
|
|
116
|
-
}) : /*#__PURE__*/React__default[
|
|
132
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
117
133
|
prefixCls: prefixCls + "-item",
|
|
118
134
|
direction: "down"
|
|
119
|
-
})), hasChildren && mini && level > 1 && placement === 'vertical' ? /*#__PURE__*/React__default[
|
|
135
|
+
})), hasChildren && mini && level > 1 && placement === 'vertical' ? /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
120
136
|
prefixCls: prefixCls + "-item"
|
|
121
|
-
}) : null, hasChildren && !mini && placement === 'vertical' && (expandedType === 'pop' || showAllSubMenus) ? /*#__PURE__*/React__default[
|
|
137
|
+
}) : null, hasChildren && !mini && placement === 'vertical' && (expandedType === 'pop' || showAllSubMenus) ? /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
122
138
|
prefixCls: prefixCls + "-item"
|
|
123
|
-
}) : null, hasChildren && placement === 'horizontal' && level > 1 ? /*#__PURE__*/React__default[
|
|
139
|
+
}) : null, hasChildren && placement === 'horizontal' && level > 1 ? /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
124
140
|
prefixCls: prefixCls + "-item"
|
|
125
|
-
}) : null, hasChildren && placement === 'horizontal' && level === 1 && ((expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)) ? /*#__PURE__*/React__default[
|
|
141
|
+
}) : null, hasChildren && placement === 'horizontal' && level === 1 && ((expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)) ? /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
126
142
|
prefixCls: prefixCls + "-item",
|
|
127
143
|
direction: "up"
|
|
128
|
-
}) : /*#__PURE__*/React__default[
|
|
144
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
129
145
|
prefixCls: prefixCls + "-item",
|
|
130
146
|
direction: "down"
|
|
131
|
-
}))), hasChildren && placement === 'vertical' && !mini && !showAllSubMenus && expandedType === 'collapse' ? /*#__PURE__*/React__default[
|
|
147
|
+
}))), hasChildren && placement === 'vertical' && !mini && !showAllSubMenus && expandedType === 'collapse' ? /*#__PURE__*/React__default["default"].createElement(Expander.Expander, {
|
|
132
148
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id))
|
|
133
|
-
}, /*#__PURE__*/React__default[
|
|
149
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
134
150
|
className: prefixCls + "-submenu"
|
|
135
151
|
}, children.map(function (child) {
|
|
136
|
-
return /*#__PURE__*/React__default[
|
|
152
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
137
153
|
key: child.id,
|
|
138
154
|
level: level + 1,
|
|
139
|
-
parentIds: _parentIds
|
|
155
|
+
parentIds: _parentIds,
|
|
156
|
+
raw: child
|
|
140
157
|
}));
|
|
141
|
-
}))) : null), hasChildren && placement === 'vertical' && mini && !showAllSubMenus && expandedType === 'collapse' && (level === 1 ? /*#__PURE__*/React__default[
|
|
158
|
+
}))) : null), hasChildren && placement === 'vertical' && mini && !showAllSubMenus && expandedType === 'collapse' && (level === 1 ? /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
142
159
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
143
160
|
attachEl: itemRef.current,
|
|
144
161
|
placement: 'right-start',
|
|
@@ -148,15 +165,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
148
165
|
closePopper(id);
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
|
-
}, /*#__PURE__*/React__default[
|
|
168
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
152
169
|
className: prefixCls + "-popmenu"
|
|
153
170
|
}, children.map(function (child) {
|
|
154
|
-
return /*#__PURE__*/React__default[
|
|
171
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
155
172
|
key: child.id,
|
|
156
173
|
level: level + 1,
|
|
157
174
|
parentIds: _parentIds
|
|
158
175
|
}));
|
|
159
|
-
}))) : /*#__PURE__*/React__default[
|
|
176
|
+
}))) : /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
160
177
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
161
178
|
attachEl: itemRef.current,
|
|
162
179
|
placement: 'right-start',
|
|
@@ -167,15 +184,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
167
184
|
closePopper(id);
|
|
168
185
|
}
|
|
169
186
|
}
|
|
170
|
-
}, /*#__PURE__*/React__default[
|
|
187
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
171
188
|
className: prefixCls + "-popmenu"
|
|
172
189
|
}, children.map(function (child) {
|
|
173
|
-
return /*#__PURE__*/React__default[
|
|
190
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
174
191
|
key: child.id,
|
|
175
192
|
level: level + 1,
|
|
176
193
|
parentIds: _parentIds
|
|
177
194
|
}));
|
|
178
|
-
})))), hasChildren && placement === 'vertical' && !showAllSubMenus && expandedType === 'pop' && (level === 1 ? /*#__PURE__*/React__default[
|
|
195
|
+
})))), hasChildren && placement === 'vertical' && !showAllSubMenus && expandedType === 'pop' && (level === 1 ? /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
179
196
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
180
197
|
attachEl: itemRef.current,
|
|
181
198
|
placement: 'right-start',
|
|
@@ -185,15 +202,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
185
202
|
closePopper(id);
|
|
186
203
|
}
|
|
187
204
|
}
|
|
188
|
-
}, /*#__PURE__*/React__default[
|
|
205
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
189
206
|
className: prefixCls + "-popmenu"
|
|
190
207
|
}, children.map(function (child) {
|
|
191
|
-
return /*#__PURE__*/React__default[
|
|
208
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
192
209
|
key: child.id,
|
|
193
210
|
level: level + 1,
|
|
194
211
|
parentIds: _parentIds
|
|
195
212
|
}));
|
|
196
|
-
}))) : /*#__PURE__*/React__default[
|
|
213
|
+
}))) : /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
197
214
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
198
215
|
attachEl: itemRef.current,
|
|
199
216
|
disabledPortal: true,
|
|
@@ -204,15 +221,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
204
221
|
closePopper(id);
|
|
205
222
|
}
|
|
206
223
|
}
|
|
207
|
-
}, /*#__PURE__*/React__default[
|
|
224
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
208
225
|
className: prefixCls + "-popmenu"
|
|
209
226
|
}, children.map(function (child) {
|
|
210
|
-
return /*#__PURE__*/React__default[
|
|
227
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
211
228
|
key: child.id,
|
|
212
229
|
level: level + 1,
|
|
213
230
|
parentIds: _parentIds
|
|
214
231
|
}));
|
|
215
|
-
})))), hasChildren && placement === 'vertical' && showAllSubMenus ? /*#__PURE__*/React__default[
|
|
232
|
+
})))), hasChildren && placement === 'vertical' && showAllSubMenus ? /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
216
233
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
217
234
|
attachEl: itemRef.current,
|
|
218
235
|
placement: 'right-start',
|
|
@@ -222,21 +239,21 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
222
239
|
closePopper(id);
|
|
223
240
|
}
|
|
224
241
|
}
|
|
225
|
-
}, /*#__PURE__*/React__default[
|
|
242
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
226
243
|
className: prefixCls + "-fat-menu"
|
|
227
244
|
}, children.map(function (child) {
|
|
228
|
-
return /*#__PURE__*/React__default[
|
|
245
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
229
246
|
key: child.id,
|
|
230
247
|
className: prefixCls + "-fat-menu__group"
|
|
231
|
-
}, /*#__PURE__*/React__default[
|
|
248
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
232
249
|
className: prefixCls + "-group-item"
|
|
233
|
-
}, child.title), child && typeAssertion.isArrayNonEmpty(child.children) ? /*#__PURE__*/React__default[
|
|
250
|
+
}, child.title), child && typeAssertion.isArrayNonEmpty(child.children) ? /*#__PURE__*/React__default["default"].createElement("ul", null, child.children.map(function (item) {
|
|
234
251
|
var _cx3;
|
|
235
252
|
|
|
236
|
-
return /*#__PURE__*/React__default[
|
|
253
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
237
254
|
onClick: function onClick() {
|
|
238
255
|
if (clickMenu) {
|
|
239
|
-
clickMenu(item.id);
|
|
256
|
+
clickMenu(item.id, item);
|
|
240
257
|
}
|
|
241
258
|
|
|
242
259
|
if (closePopper) {
|
|
@@ -247,7 +264,7 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
247
264
|
key: item.id
|
|
248
265
|
}, item.title);
|
|
249
266
|
})) : null);
|
|
250
|
-
}))) : null, hasChildren && placement === 'horizontal' && !showAllSubMenus && (level === 1 ? /*#__PURE__*/React__default[
|
|
267
|
+
}))) : null, hasChildren && placement === 'horizontal' && !showAllSubMenus && (level === 1 ? /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
251
268
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
252
269
|
attachEl: itemRef.current,
|
|
253
270
|
placement: level === 1 ? 'bottom-start' : 'right-start',
|
|
@@ -257,15 +274,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
257
274
|
closePopper(id);
|
|
258
275
|
}
|
|
259
276
|
}
|
|
260
|
-
}, /*#__PURE__*/React__default[
|
|
277
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
261
278
|
className: prefixCls + "-popmenu"
|
|
262
279
|
}, children.map(function (child) {
|
|
263
|
-
return /*#__PURE__*/React__default[
|
|
280
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
264
281
|
key: child.id,
|
|
265
282
|
level: level + 1,
|
|
266
283
|
parentIds: _parentIds
|
|
267
284
|
}));
|
|
268
|
-
}))) : /*#__PURE__*/React__default[
|
|
285
|
+
}))) : /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
269
286
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
270
287
|
attachEl: itemRef.current,
|
|
271
288
|
disabledPortal: true,
|
|
@@ -276,15 +293,15 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
276
293
|
closePopper(id);
|
|
277
294
|
}
|
|
278
295
|
}
|
|
279
|
-
}, /*#__PURE__*/React__default[
|
|
296
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
280
297
|
className: prefixCls + "-popmenu"
|
|
281
298
|
}, children.map(function (child) {
|
|
282
|
-
return /*#__PURE__*/React__default[
|
|
299
|
+
return /*#__PURE__*/React__default["default"].createElement(MenuItem, Object.assign({}, child, {
|
|
283
300
|
key: child.id,
|
|
284
301
|
level: level + 1,
|
|
285
302
|
parentIds: _parentIds
|
|
286
303
|
}));
|
|
287
|
-
})))), hasChildren && placement === 'horizontal' && showAllSubMenus ? /*#__PURE__*/React__default[
|
|
304
|
+
})))), hasChildren && placement === 'horizontal' && showAllSubMenus ? /*#__PURE__*/React__default["default"].createElement(Popper__default["default"], {
|
|
288
305
|
visible: !!(expandedIds === null || expandedIds === void 0 ? void 0 : expandedIds.includes(id)),
|
|
289
306
|
attachEl: itemRef.current,
|
|
290
307
|
placement: 'bottom-start',
|
|
@@ -294,22 +311,22 @@ var MenuItem = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
294
311
|
closePopper(id);
|
|
295
312
|
}
|
|
296
313
|
}
|
|
297
|
-
}, /*#__PURE__*/React__default[
|
|
314
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
298
315
|
className: prefixCls + "-fat-menu"
|
|
299
316
|
}, children.map(function (child) {
|
|
300
|
-
return /*#__PURE__*/React__default[
|
|
317
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
301
318
|
key: child.id,
|
|
302
319
|
className: prefixCls + "-fat-menu__group"
|
|
303
|
-
}, /*#__PURE__*/React__default[
|
|
320
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
304
321
|
className: prefixCls + "-group-item"
|
|
305
|
-
}, child.title), child && typeAssertion.isArrayNonEmpty(child.children) ? /*#__PURE__*/React__default[
|
|
322
|
+
}, child.title), child && typeAssertion.isArrayNonEmpty(child.children) ? /*#__PURE__*/React__default["default"].createElement("ul", null, child.children.map(function (item) {
|
|
306
323
|
var _cx4;
|
|
307
324
|
|
|
308
|
-
return /*#__PURE__*/React__default[
|
|
325
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
309
326
|
className: classname.cx(prefixCls + "-item", (_cx4 = {}, _cx4[prefixCls + "-item--active"] = activeId === item.id, _cx4)),
|
|
310
327
|
onClick: function onClick() {
|
|
311
328
|
if (clickMenu) {
|
|
312
|
-
clickMenu(item.id);
|
|
329
|
+
clickMenu(item.id, item);
|
|
313
330
|
}
|
|
314
331
|
|
|
315
332
|
if (closePopper) {
|
|
@@ -333,18 +350,18 @@ var Arrow = function Arrow(_ref) {
|
|
|
333
350
|
|
|
334
351
|
switch (direction) {
|
|
335
352
|
case 'up':
|
|
336
|
-
icon = /*#__PURE__*/React__default[
|
|
353
|
+
icon = /*#__PURE__*/React__default["default"].createElement(icons.UpOutlined, null);
|
|
337
354
|
break;
|
|
338
355
|
|
|
339
356
|
case 'down':
|
|
340
|
-
icon = /*#__PURE__*/React__default[
|
|
357
|
+
icon = /*#__PURE__*/React__default["default"].createElement(icons.DownOutlined, null);
|
|
341
358
|
break;
|
|
342
359
|
|
|
343
360
|
default:
|
|
344
|
-
icon = /*#__PURE__*/React__default[
|
|
361
|
+
icon = /*#__PURE__*/React__default["default"].createElement(icons.RightOutlined, null);
|
|
345
362
|
}
|
|
346
363
|
|
|
347
|
-
return /*#__PURE__*/React__default[
|
|
364
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
348
365
|
className: prefixCls + "__arrow"
|
|
349
366
|
}, icon);
|
|
350
367
|
};
|
|
@@ -357,7 +374,7 @@ var renderIndent = function renderIndent(_ref2) {
|
|
|
357
374
|
var prefixCls = _ref2.prefixCls,
|
|
358
375
|
depth = _ref2.depth;
|
|
359
376
|
return arrayUtils.times(depth, function (index) {
|
|
360
|
-
return /*#__PURE__*/React__default[
|
|
377
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
361
378
|
className: prefixCls + "__indent",
|
|
362
379
|
key: index
|
|
363
380
|
});
|
|
@@ -365,4 +382,3 @@ var renderIndent = function renderIndent(_ref2) {
|
|
|
365
382
|
};
|
|
366
383
|
|
|
367
384
|
exports.MenuItem = MenuItem;
|
|
368
|
-
//# sourceMappingURL=MenuItem.js.map
|
package/lib/cjs/context.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -17,4 +17,3 @@ var React = require('react');
|
|
|
17
17
|
|
|
18
18
|
var MenuContext = /*#__PURE__*/React.createContext({});
|
|
19
19
|
exports["default"] = MenuContext;
|
|
20
|
-
//# sourceMappingURL=context.js.map
|
package/lib/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -19,4 +19,3 @@ var Menu = require('./Menu.js');
|
|
|
19
19
|
|
|
20
20
|
exports.Menu = Menu.Menu;
|
|
21
21
|
exports["default"] = Menu.Menu;
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
Object.defineProperty(exports, '__esModule', {
|
|
13
13
|
value: true
|
|
14
14
|
});
|
|
15
|
-
var css_248z = "@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n@use 'sass:map';\n.hi-v4-menu-fat-menu {\n background-color: var(--hi-v4-color-static-white, #fff);\n margin: 0;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n padding: var(--hi-v4-spacing-4, 8px);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n color: var(--hi-v4-color-gray-700, #1f2733);\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n -ms-flex-wrap: wrap;\n flex-wrap: wrap; }\n.hi-v4-menu-fat-menu__group:not(:last-of-type) {\n margin-right: var(--hi-v4-spacing-18, 36px); }\n.hi-v4-menu-fat-menu .hi-v4-menu-group-item {\n height: 40px;\n margin: 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 var(--hi-v4-spacing-6, 12px);\n color: var(--hi-v4-color-gray-500, #929aa6); }\n.hi-v4-menu-fat-menu .hi-v4-menu-item {\n height: 40px;\n margin: 0;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px); }\n.hi-v4-menu-fat-menu .hi-v4-menu-item--active {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));\n background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }\n.hi-v4-menu-fat-menu .hi-v4-menu-item:not(.hi-v4-menu-item--active):hover {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu-fat-menu ul {\n padding: 0;\n margin: 0; }\n.hi-v4-menu-fat-menu ul li {\n list-style-type: none; }\n.hi-v4-menu-popmenu {\n background-color: var(--hi-v4-color-static-white, #fff);\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n margin: 0;\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n padding: var(--hi-v4-spacing-4, 8px);\n color: var(--hi-v4-color-gray-700, #1f2733);\n width: 216px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n.hi-v4-menu-popmenu .hi-v4-menu-item {\n height: 40px;\n margin: 0; }\n.hi-v4-menu-popmenu .hi-v4-menu-item__inner {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n height: 40px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin-bottom: var(--hi-v4-spacing-4, 8px);\n padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px);\n border-radius: var(--hi-v4-border-radius-normal, 4px); }\n.hi-v4-menu-popmenu .hi-v4-menu-item__inner--active {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));\n background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }\n.hi-v4-menu-popmenu .hi-v4-menu-item__inner--active-p {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu-popmenu .hi-v4-menu-item__inner--expanded {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu-popmenu .hi-v4-menu-item__inner:not(.hi-v4-menu-item__inner--active):hover {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu-popmenu .hi-v4-menu-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n padding-right: var(--hi-v4-spacing-4, 8px); }\n.hi-v4-menu {\n background-color: var(--hi-v4-color-static-white, #fff);\n color: var(--hi-v4-color-gray-700, #1f2733);\n font-size: var(--hi-v4-text-size-normal, 0.875rem);\n line-height: var(--hi-v4-text-lineheight-normal, 1.375rem);\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n.hi-v4-menu ul {\n margin: 0;\n padding: 0; }\n.hi-v4-menu-item {\n list-style: none;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n cursor: pointer;\n -webkit-transition: all 0.3s;\n transition: all 0.3s; }\n.hi-v4-menu-item__icon {\n color: var(--hi-v4-color-gray-500, #929aa6);\n -webkit-margin-end: var(--hi-v4-spacing-4, 8px);\n margin-inline-end: var(--hi-v4-spacing-4, 8px); }\n.hi-v4-menu-item__icon svg[class^=hi-v4-icon] {\n font-size: var(--hi-v4-text-size-lg, 1rem); }\n.hi-v4-menu-item__arrow {\n color: var(--hi-v4-color-gray-500, #929aa6);\n font-size: var(--hi-v4-text-size-lg, 1rem); }\n.hi-v4-menu-item__indent {\n display: inline-block;\n width: 24px;\n height: 100%;\n -ms-flex-negative: 0;\n flex-shrink: 0; }\n.hi-v4-menu__wrapper {\n padding: 0;\n margin: 0; }\n.hi-v4-menu--horizontal {\n width: 100%;\n overflow-x: auto; }\n.hi-v4-menu--horizontal .hi-v4-menu__wrapper {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n overflow: visible;\n width: -webkit-max-content;\n width: -moz-max-content;\n width: max-content;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n.hi-v4-menu--horizontal .hi-v4-menu-item {\n margin: 0 var(--hi-v4-spacing-10, 20px);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 56px;\n border: none;\n font-size: var(--hi-v4-text-size-lg, 1rem); }\n.hi-v4-menu--horizontal .hi-v4-menu-item__arrow {\n -webkit-margin-start: var(--hi-v4-spacing-2, 4px);\n margin-inline-start: var(--hi-v4-spacing-2, 4px); }\n.hi-v4-menu--horizontal .hi-v4-menu-item:hover {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item:hover .hi-v4-menu-item__inner {\n border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item--active {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item--active .hi-v4-menu-item__inner {\n border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item--active .hi-v4-menu-item__icon {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item--active-p {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item--active-p .hi-v4-menu-item__icon {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item__inner {\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n border-bottom: 2px solid transparent; }\n.hi-v4-menu--horizontal .hi-v4-menu-item__inner--expanded {\n border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--horizontal .hi-v4-menu-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n white-space: nowrap;\n max-width: none; }\n.hi-v4-menu--vertical {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n padding: var(--hi-v4-spacing-4, 8px);\n width: 216px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n height: 100%;\n -webkit-transition: width 0.3s;\n transition: width 0.3s; }\n.hi-v4-menu--vertical .hi-v4-menu__wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n overflow: auto; }\n.hi-v4-menu--vertical.hi-v4-menu--mini {\n width: 56px;\n overflow-x: hidden; }\n.hi-v4-menu--vertical.hi-v4-menu--popup .hi-v4-menu-item__inner--expanded {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu--vertical .hi-v4-menu__toggle {\n width: 40px;\n cursor: pointer;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n color: var(--hi-v4-color-gray-500, #929aa6);\n height: 40px; }\n.hi-v4-menu--vertical .hi-v4-menu__toggle:hover {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n height: 40px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin-bottom: var(--hi-v4-spacing-4, 8px);\n padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px);\n border-radius: var(--hi-v4-border-radius-normal, 4px);\n -webkit-transition: all 0.3s;\n transition: all 0.3s; }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner--active {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));\n background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner--active .hi-v4-menu-item__icon {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner--active-p {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner--active-p .hi-v4-menu-item__icon {\n color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }\n.hi-v4-menu--vertical .hi-v4-menu-item__inner:not(.hi-v4-menu-item__inner--active):hover {\n background-color: var(--hi-v4-color-gray-100, #f2f4f7); }\n.hi-v4-menu--vertical .hi-v4-menu-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1 1;\n flex: 1 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-indent: 0.5px; }\n";
|
|
15
|
+
var css_248z = ".hi-v4-menu-fat-menu {background-color: var(--hi-v4-color-static-white, #fff);margin: 0;font-size: var(--hi-v4-text-size-md, 0.875rem);padding: var(--hi-v4-spacing-4, 8px);display: -webkit-box;display: -ms-flexbox;display: flex;color: var(--hi-v4-color-gray-700, #1f2733);border-radius: var(--hi-v4-border-radius-md, 4px);-ms-flex-wrap: wrap;flex-wrap: wrap; }.hi-v4-menu-fat-menu__group:not(:last-of-type) {margin-right: var(--hi-v4-spacing-18, 36px); }.hi-v4-menu-fat-menu .hi-v4-menu-group-item {height: 40px;margin: 0;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;padding: 0 var(--hi-v4-spacing-6, 12px);color: var(--hi-v4-color-gray-500, #929aa6); }.hi-v4-menu-fat-menu .hi-v4-menu-item {height: 40px;margin: 0;border-radius: var(--hi-v4-border-radius-md, 4px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px); }.hi-v4-menu-fat-menu .hi-v4-menu-item--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-menu-fat-menu .hi-v4-menu-item:not(.hi-v4-menu-item--active):hover {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu-fat-menu ul {padding: 0;margin: 0; }.hi-v4-menu-fat-menu ul li {list-style-type: none; }.hi-v4-menu-popmenu {background-color: var(--hi-v4-color-static-white, #fff);border-radius: var(--hi-v4-border-radius-md, 4px);margin: 0;font-size: var(--hi-v4-text-size-md, 0.875rem);padding: var(--hi-v4-spacing-4, 8px);color: var(--hi-v4-color-gray-700, #1f2733);width: 216px;-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-menu-popmenu .hi-v4-menu-item {height: 40px;margin: 0; }.hi-v4-menu-popmenu .hi-v4-menu-item__inner {-webkit-box-sizing: border-box;box-sizing: border-box;height: 40px;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;margin-bottom: var(--hi-v4-spacing-4, 8px);padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px);border-radius: var(--hi-v4-border-radius-md, 4px); }.hi-v4-menu-popmenu .hi-v4-menu-item__inner--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-menu-popmenu .hi-v4-menu-item__inner--active-p {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu-popmenu .hi-v4-menu-item__inner--expanded {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu-popmenu .hi-v4-menu-item__inner:not(.hi-v4-menu-item__inner--active):hover {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu-popmenu .hi-v4-menu-item__content {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width: 100%;padding-right: var(--hi-v4-spacing-4, 8px); }.hi-v4-menu {background-color: var(--hi-v4-color-static-white, #fff);color: var(--hi-v4-color-gray-700, #1f2733);font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-menu ul {margin: 0;padding: 0; }.hi-v4-menu-item {list-style: none;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: pointer;-webkit-transition: all 0.3s;transition: all 0.3s; }.hi-v4-menu-item__icon {color: var(--hi-v4-color-gray-500, #929aa6);-webkit-margin-end: var(--hi-v4-spacing-4, 8px);margin-inline-end: var(--hi-v4-spacing-4, 8px); }.hi-v4-menu-item__icon svg[class^=hi-v4-icon] {font-size: var(--hi-v4-text-size-lg, 1rem); }.hi-v4-menu-item__arrow {color: var(--hi-v4-color-gray-500, #929aa6);font-size: var(--hi-v4-text-size-lg, 1rem); }.hi-v4-menu-item__indent {display: inline-block;width: 24px;height: 100%;-ms-flex-negative: 0;flex-shrink: 0; }.hi-v4-menu__wrapper {padding: 0;margin: 0; }.hi-v4-menu--horizontal {width: 100%;overflow: hidden; }.hi-v4-menu--horizontal .hi-v4-menu__wrapper {display: -webkit-box;display: -ms-flexbox;display: flex;overflow: visible;width: -webkit-max-content;width: -moz-max-content;width: max-content;-webkit-box-sizing: border-box;box-sizing: border-box; }.hi-v4-menu--horizontal .hi-v4-menu-item {padding: 0 var(--hi-v4-spacing-10, 20px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;-webkit-box-align: center;-ms-flex-align: center;align-items: center;height: 56px;border: none;font-size: var(--hi-v4-text-size-lg, 1rem); }.hi-v4-menu--horizontal .hi-v4-menu-item__arrow {-webkit-margin-start: var(--hi-v4-spacing-2, 4px);margin-inline-start: var(--hi-v4-spacing-2, 4px); }.hi-v4-menu--horizontal .hi-v4-menu-item:hover {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item:hover .hi-v4-menu-item__inner {border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item--active .hi-v4-menu-item__inner {border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item--active .hi-v4-menu-item__icon {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item--active-p {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item--active-p .hi-v4-menu-item__icon {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item__inner {height: 100%;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-sizing: border-box;box-sizing: border-box;border-bottom: 2px solid transparent; }.hi-v4-menu--horizontal .hi-v4-menu-item__inner--expanded {border-bottom: 2px solid var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--horizontal .hi-v4-menu-item__content {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;white-space: nowrap;max-width: none; }.hi-v4-menu--vertical {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;padding: var(--hi-v4-spacing-4, 8px);width: 216px;-webkit-box-sizing: border-box;box-sizing: border-box;height: 100%;-webkit-transition: width 0.3s;transition: width 0.3s; }.hi-v4-menu--vertical .hi-v4-menu__wrapper {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;overflow: auto; }.hi-v4-menu--vertical.hi-v4-menu--mini {width: 56px;overflow-x: hidden; }.hi-v4-menu--vertical.hi-v4-menu--popup .hi-v4-menu-item__inner--expanded {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu--vertical .hi-v4-menu__toggle {width: 40px;cursor: pointer;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;-webkit-box-pack: center;-ms-flex-pack: center;justify-content: center;border-radius: var(--hi-v4-border-radius-md, 4px);color: var(--hi-v4-color-gray-500, #929aa6);height: 40px;-ms-flex-negative: 0;flex-shrink: 0;-webkit-transition-duration: var(--hi-v4-motion-duration-normal, 200ms);transition-duration: var(--hi-v4-motion-duration-normal, 200ms);-webkit-transition-timing-function: var(--hi-v4-motion-bezier-easing, cubic-bezier(0.37, 0.02, 0.34, 1));transition-timing-function: var(--hi-v4-motion-bezier-easing, cubic-bezier(0.37, 0.02, 0.34, 1));-webkit-transition-property: background-color;transition-property: background-color; }.hi-v4-menu--vertical .hi-v4-menu__toggle:hover {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu--vertical .hi-v4-menu-item__inner {-webkit-box-sizing: border-box;box-sizing: border-box;height: 40px;display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;margin-bottom: var(--hi-v4-spacing-4, 8px);padding: 0 var(--hi-v4-spacing-4, 8px) 0 var(--hi-v4-spacing-6, 12px);border-radius: var(--hi-v4-border-radius-md, 4px);-webkit-transition: all 0.3s;transition: all 0.3s; }.hi-v4-menu--vertical .hi-v4-menu-item__inner--active {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa));background-color: var(--hi-v4-color-primary-50, var(--hi-v4-color-brandblue-50, #e2f3fe)); }.hi-v4-menu--vertical .hi-v4-menu-item__inner--active .hi-v4-menu-item__icon {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--vertical .hi-v4-menu-item__inner--active-p {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--vertical .hi-v4-menu-item__inner--active-p .hi-v4-menu-item__icon {color: var(--hi-v4-color-primary-500, var(--hi-v4-color-brandblue-500, #237ffa)); }.hi-v4-menu--vertical .hi-v4-menu-item__inner:not(.hi-v4-menu-item__inner--active):hover {background-color: var(--hi-v4-color-gray-100, #f2f4f7); }.hi-v4-menu--vertical .hi-v4-menu-item__content {-webkit-box-flex: 1;-ms-flex: 1 1;flex: 1 1;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;text-indent: 0.5px; }";
|
|
16
16
|
|
|
17
|
-
var __styleInject__ = require('
|
|
17
|
+
var __styleInject__ = require('inject-head-style')["default"];
|
|
18
18
|
|
|
19
19
|
__styleInject__(css_248z);
|
|
20
20
|
|
|
21
21
|
exports["default"] = css_248z;
|
|
22
|
-
//# sourceMappingURL=index.scss.js.map
|
package/lib/cjs/util.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -45,4 +45,3 @@ var getAncestorIds = function getAncestorIds(id, data, arr) {
|
|
|
45
45
|
|
|
46
46
|
exports.getAncestorIds = getAncestorIds;
|
|
47
47
|
exports.getParentId = getParentId;
|
|
48
|
-
//# sourceMappingURL=util.js.map
|
package/lib/esm/Expander.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @hi-ui/menu
|
|
3
3
|
* https://github.com/XiaoMi/hiui/tree/master/packages/ui/menu#readme
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) HiUI <mi-hiui@xiaomi.com>.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -49,4 +49,3 @@ var Expander = function Expander(_ref) {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
export { Expander };
|
|
52
|
-
//# sourceMappingURL=Expander.js.map
|