Browse Source

Merge branch 'master' into antd-3.0

pull/8064/head
afc163 7 years ago
parent
commit
d96284c798
  1. 24
      components/menu/MenuItem.tsx
  2. 2
      components/menu/__tests__/__snapshots__/demo.test.js.snap
  3. 2
      components/menu/demo/switch-mode.md
  4. 4
      package.json

24
components/menu/MenuItem.tsx

@ -3,22 +3,22 @@ import { Item } from 'rc-menu';
import PropTypes from 'prop-types';
import Tooltip from '../tooltip';
const MenuItem: any = (props, { inlineCollapsed }) => {
return (
<Tooltip
class MenuItem extends React.Component<any, any> {
static contextTypes = {
inlineCollapsed: PropTypes.bool,
};
static isMenuItem = 1;
render() {
const { inlineCollapsed } = this.context;
const props = this.props;
return <Tooltip
title={inlineCollapsed && props.level === 1 ? props.children : ''}
placement="right"
overlayClassName={`${props.rootPrefixCls}-inline-collapsed-tooltip`}
>
<Item {...props} />
</Tooltip>
);
};
MenuItem.contextTypes = {
inlineCollapsed: PropTypes.bool,
};
MenuItem.isMenuItem = 1;
</Tooltip>;
}
}
export default MenuItem;

2
components/menu/__tests__/__snapshots__/demo.test.js.snap

@ -582,7 +582,7 @@ exports[`renders ./components/menu/demo/switch-mode.md correctly 1`] = `
<div
aria-expanded="false"
aria-haspopup="true"
aria-owns="sub2$Menu"
aria-owns="sub1-2$Menu"
class="ant-menu-submenu-title"
style="padding-left:48px"
title="Submenu"

2
components/menu/demo/switch-mode.md

@ -58,7 +58,7 @@ class Sider extends React.Component {
<SubMenu key="sub1" title={<span><Icon type="appstore" /><span>Navigation Three</span></span>}>
<Menu.Item key="3">Option 3</Menu.Item>
<Menu.Item key="4">Option 4</Menu.Item>
<SubMenu key="sub2" title="Submenu">
<SubMenu key="sub1-2" title="Submenu">
<Menu.Item key="5">Option 5</Menu.Item>
<Menu.Item key="6">Option 6</Menu.Item>
</SubMenu>

4
package.json

@ -76,8 +76,8 @@
"rc-tree-select": "~1.10.2",
"rc-upload": "~2.4.0",
"rc-util": "^4.0.4",
"react-lazy-load": "^3.0.10",
"react-slick": "~0.15.0",
"react-lazy-load": "^3.0.12",
"react-slick": "~0.15.4",
"shallowequal": "^1.0.1",
"warning": "~3.0.0"
},

Loading…
Cancel
Save