@kne/system-layout 0.1.0-alpha.10 → 0.1.0-alpha.13
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.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +16 -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,17 @@ const Menu = ({
|
|
|
147
155
|
fontClassName: "system"
|
|
148
156
|
});
|
|
149
157
|
}
|
|
150
|
-
if (
|
|
158
|
+
if (/*#__PURE__*/isValidElement(icon)) {
|
|
159
|
+
return /*#__PURE__*/jsx("span", {
|
|
160
|
+
className: classnames('menu-item-icon', style$1['menu-item-icon']),
|
|
161
|
+
children: icon
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (isPlainObject(icon) && typeof icon.type === 'string') {
|
|
151
165
|
return /*#__PURE__*/jsx(Icon, _extends({}, icon, {
|
|
152
166
|
className: classnames('menu-item-icon', style$1['menu-item-icon'])
|
|
153
167
|
}));
|
|
154
168
|
}
|
|
155
|
-
if (/*#__PURE__*/isValidElement(icon)) {
|
|
156
|
-
return icon;
|
|
157
|
-
}
|
|
158
169
|
return null;
|
|
159
170
|
})(icon), menuOpen && item.label]
|
|
160
171
|
})]
|