x-ui-design 0.7.80 → 0.7.82
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/esm/types/types/menu.d.ts +5 -0
- package/dist/index.esm.js +7 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.tsx +0 -2
- package/lib/components/Menu/Item/Item.tsx +8 -1
- package/lib/types/menu.ts +1 -0
- package/package.json +1 -1
- package/src/app/page.tsx +3 -13
|
@@ -13,6 +13,11 @@ export type ItemType = DefaultProps & {
|
|
|
13
13
|
type?: string;
|
|
14
14
|
selected?: boolean;
|
|
15
15
|
itemKey?: string;
|
|
16
|
+
onClick?: (info: {
|
|
17
|
+
key: string;
|
|
18
|
+
keyPath: string[];
|
|
19
|
+
domEvent?: MouseEvent;
|
|
20
|
+
}) => void;
|
|
16
21
|
};
|
|
17
22
|
export type SubMenuItem = DefaultProps & {
|
|
18
23
|
key: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -1601,7 +1601,6 @@ const Checkbox = ({
|
|
|
1601
1601
|
onChange?.(e);
|
|
1602
1602
|
};
|
|
1603
1603
|
useEffect(() => {
|
|
1604
|
-
console.log(checked);
|
|
1605
1604
|
if (checked !== undefined) {
|
|
1606
1605
|
setInternalChecked(checked);
|
|
1607
1606
|
}
|
|
@@ -4440,7 +4439,8 @@ const MenuItem = ({
|
|
|
4440
4439
|
extra,
|
|
4441
4440
|
selected,
|
|
4442
4441
|
className = '',
|
|
4443
|
-
prefixCls = prefixClsMenu
|
|
4442
|
+
prefixCls = prefixClsMenu,
|
|
4443
|
+
onClick
|
|
4444
4444
|
}) => {
|
|
4445
4445
|
const menuContext = useContext(MenuContext);
|
|
4446
4446
|
if (!menuContext) {
|
|
@@ -4450,6 +4450,11 @@ const MenuItem = ({
|
|
|
4450
4450
|
if (disabled) {
|
|
4451
4451
|
return;
|
|
4452
4452
|
}
|
|
4453
|
+
onClick?.({
|
|
4454
|
+
key: itemKey,
|
|
4455
|
+
keyPath: [itemKey],
|
|
4456
|
+
domEvent: e
|
|
4457
|
+
});
|
|
4453
4458
|
menuContext?.onItemClick(itemKey, e);
|
|
4454
4459
|
};
|
|
4455
4460
|
return /*#__PURE__*/React.createElement("li", {
|