@kne/system-layout 0.1.0-alpha.10 → 0.1.0-alpha.11
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/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +13 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -118,11 +118,19 @@ const Menu = ({
|
|
|
118
118
|
const hasGroup = item.group && item.group !== ((_items = items[index - 1]) == null ? void 0 : _items.group);
|
|
119
119
|
return /*#__PURE__*/jsxs("div", {
|
|
120
120
|
title: item.label,
|
|
121
|
-
onClick:
|
|
121
|
+
onClick: e => {
|
|
122
122
|
onChange && onChange(item, {
|
|
123
123
|
menuOpen,
|
|
124
124
|
base: _base
|
|
125
125
|
});
|
|
126
|
+
if (typeof item.onClick === 'function') {
|
|
127
|
+
item.onClick(item, {
|
|
128
|
+
menuOpen,
|
|
129
|
+
base: _base,
|
|
130
|
+
event: e
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
126
134
|
if (item.path) {
|
|
127
135
|
navigate(ensureSlash(`${_base}${item.path}`));
|
|
128
136
|
}
|
|
@@ -147,14 +155,14 @@ const Menu = ({
|
|
|
147
155
|
fontClassName: "system"
|
|
148
156
|
});
|
|
149
157
|
}
|
|
150
|
-
if (
|
|
158
|
+
if (/*#__PURE__*/isValidElement(icon)) {
|
|
159
|
+
return icon;
|
|
160
|
+
}
|
|
161
|
+
if (isPlainObject(icon) && typeof icon.type === 'string') {
|
|
151
162
|
return /*#__PURE__*/jsx(Icon, _extends({}, icon, {
|
|
152
163
|
className: classnames('menu-item-icon', style$1['menu-item-icon'])
|
|
153
164
|
}));
|
|
154
165
|
}
|
|
155
|
-
if (/*#__PURE__*/isValidElement(icon)) {
|
|
156
|
-
return icon;
|
|
157
|
-
}
|
|
158
166
|
return null;
|
|
159
167
|
})(icon), menuOpen && item.label]
|
|
160
168
|
})]
|