Comparing version 4.6.2 to 4.7.0
@@ -42,5 +42,8 @@ 'use strict'; | ||
eventKey: _react2['default'].PropTypes.string, | ||
selectable: _react2['default'].PropTypes.bool | ||
selectable: _react2['default'].PropTypes.bool, | ||
children: _react2['default'].PropTypes.any | ||
}, | ||
mixins: [_MenuMixin2['default']], | ||
getDefaultProps: function getDefaultProps() { | ||
@@ -61,4 +64,2 @@ return { | ||
mixins: [_MenuMixin2['default']], | ||
getInitialState: function getInitialState() { | ||
@@ -219,2 +220,18 @@ var props = this.props; | ||
isInlineMode: function isInlineMode() { | ||
return this.props.mode === 'inline'; | ||
}, | ||
lastOpenSubMenu: function lastOpenSubMenu() { | ||
var _this2 = this; | ||
var lastOpen = []; | ||
if (this.state.openKeys.length) { | ||
lastOpen = this.instanceArray.filter(function (c) { | ||
return _this2.state.openKeys.indexOf(c.props.eventKey) !== -1; | ||
}); | ||
} | ||
return lastOpen[0]; | ||
}, | ||
renderMenuItem: function renderMenuItem(c, i) { | ||
@@ -237,18 +254,2 @@ var key = (0, _util.getKeyFromChildrenIndex)(c, this.props.eventKey, i); | ||
return this.renderRoot(props); | ||
}, | ||
isInlineMode: function isInlineMode() { | ||
return this.props.mode === 'inline'; | ||
}, | ||
lastOpenSubMenu: function lastOpenSubMenu() { | ||
var _this2 = this; | ||
var lastOpen = []; | ||
if (this.state.openKeys.length) { | ||
lastOpen = this.instanceArray.filter(function (c) { | ||
return _this2.state.openKeys.indexOf(c.props.eventKey) !== -1; | ||
}); | ||
} | ||
return lastOpen[0]; | ||
} | ||
@@ -255,0 +256,0 @@ }); |
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _reactDom = require('react-dom'); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
var _rcUtil = require('rc-util'); | ||
@@ -74,3 +78,4 @@ | ||
defaultOpenKeys: _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.string), | ||
openKeys: _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.string) | ||
openKeys: _react2['default'].PropTypes.arrayOf(_react2['default'].PropTypes.string), | ||
children: _react2['default'].PropTypes.any | ||
}, | ||
@@ -143,3 +148,3 @@ | ||
}, function () { | ||
(0, _domScrollIntoView2['default'])(_react2['default'].findDOMNode(activeItem), _react2['default'].findDOMNode(_this), { | ||
(0, _domScrollIntoView2['default'])(_reactDom2['default'].findDOMNode(activeItem), _reactDom2['default'].findDOMNode(_this), { | ||
onlyScrollIfNeeded: true | ||
@@ -230,8 +235,14 @@ }); | ||
} | ||
return _react2['default'].createElement( | ||
'ul', | ||
_extends({ style: props.style, | ||
'data-visible': props.visible | ||
}, domProps), | ||
_react2['default'].Children.map(props.children, this.renderMenuItem) | ||
return( | ||
// ESLint is not smart enough to konw that the type of `children` was checked. | ||
/*eslint-disable */ | ||
_react2['default'].createElement( | ||
'ul', | ||
_extends({ style: props.style, | ||
'data-visible': props.visible | ||
}, domProps), | ||
_react2['default'].Children.map(props.children, this.renderMenuItem) | ||
) | ||
/*eslint-enable */ | ||
); | ||
@@ -238,0 +249,0 @@ }, |
@@ -49,13 +49,13 @@ 'use strict'; | ||
getInitialState: function getInitialState() { | ||
this.isSubMenu = 1; | ||
getDefaultProps: function getDefaultProps() { | ||
return { | ||
defaultActiveFirst: false | ||
onMouseEnter: function onMouseEnter() {}, | ||
title: '' | ||
}; | ||
}, | ||
getDefaultProps: function getDefaultProps() { | ||
getInitialState: function getInitialState() { | ||
this.isSubMenu = 1; | ||
return { | ||
onMouseEnter: function onMouseEnter() {}, | ||
title: '' | ||
defaultActiveFirst: false | ||
}; | ||
@@ -209,2 +209,22 @@ }, | ||
saveMenuInstance: function saveMenuInstance(c) { | ||
this.menuInstance = c; | ||
}, | ||
addKeyPath: function addKeyPath(info) { | ||
return (0, _objectAssign2['default'])({}, info, { | ||
keyPath: info.keyPath.concat(this.props.eventKey) | ||
}); | ||
}, | ||
triggerOpenChange: function triggerOpenChange(open, type) { | ||
var key = this.props.eventKey; | ||
this.onOpenChange({ | ||
key: key, | ||
item: this, | ||
trigger: type, | ||
open: open | ||
}); | ||
}, | ||
renderChildren: function renderChildren(children) { | ||
@@ -293,22 +313,2 @@ var props = this.props; | ||
); | ||
}, | ||
saveMenuInstance: function saveMenuInstance(c) { | ||
this.menuInstance = c; | ||
}, | ||
addKeyPath: function addKeyPath(info) { | ||
return (0, _objectAssign2['default'])({}, info, { | ||
keyPath: info.keyPath.concat(this.props.eventKey) | ||
}); | ||
}, | ||
triggerOpenChange: function triggerOpenChange(open, type) { | ||
var key = this.props.eventKey; | ||
this.onOpenChange({ | ||
key: key, | ||
item: this, | ||
trigger: type, | ||
open: open | ||
}); | ||
} | ||
@@ -315,0 +315,0 @@ }); |
@@ -13,5 +13,5 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _reactDom = require('react-dom'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactDom2 = _interopRequireDefault(_reactDom); | ||
@@ -46,3 +46,3 @@ exports['default'] = { | ||
// don't do anything. | ||
if (_rcUtil2['default'].Dom.contains(_react2['default'].findDOMNode(this), e.target)) { | ||
if (_rcUtil2['default'].Dom.contains(_reactDom2['default'].findDOMNode(this), e.target)) { | ||
return; | ||
@@ -49,0 +49,0 @@ } |
@@ -42,3 +42,4 @@ 'use strict'; | ||
closeSubMenuOnMouseLeave: _react2['default'].PropTypes.bool, | ||
visible: _react2['default'].PropTypes.bool | ||
visible: _react2['default'].PropTypes.bool, | ||
children: _react2['default'].PropTypes.any | ||
}, | ||
@@ -45,0 +46,0 @@ |
{ | ||
"name": "rc-menu", | ||
"version": "4.6.2", | ||
"version": "4.7.0", | ||
"description": "menu ui component for react", | ||
@@ -47,6 +47,8 @@ "keywords": [ | ||
"font-awesome": "~4.2.0", | ||
"precommit-hook": "^1.0.7", | ||
"pre-commit": "1.x", | ||
"rc-server": "3.x", | ||
"rc-tools": "4.x", | ||
"react": "~0.13.0", | ||
"react": "~0.14.0", | ||
"react-addons-test-utils": "~0.14.1", | ||
"react-dom": "~0.14.0", | ||
"velocity-animate": "~1.2.2" | ||
@@ -56,9 +58,9 @@ }, | ||
"dom-scroll-into-view": "1.x", | ||
"object-assign": "3.x", | ||
"rc-animate": "1.x", | ||
"object-assign": "4.x", | ||
"rc-animate": "2.x", | ||
"rc-util": "2.x" | ||
}, | ||
"precommit": [ | ||
"pre-commit": [ | ||
"lint" | ||
] | ||
} |
@@ -42,3 +42,3 @@ # rc-menu | ||
var MenuItem = Menu.Item; | ||
React.render(<Menu> | ||
ReactDOM.render(<Menu> | ||
<MenuItem>1</MenuItem> | ||
@@ -308,2 +308,2 @@ <SubMenu title="2"> | ||
rc-menu is released under the MIT license. | ||
rc-menu is released under the MIT license. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66095
1532
308
9
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedraf@3.4.1(transitive)
+ Addedrc-animate@2.11.1(transitive)
+ Addedrc-util@4.21.1(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedshallowequal@1.1.0(transitive)
- Removedobject-assign@3.0.0(transitive)
- Removedrc-animate@1.3.0(transitive)
Updatedobject-assign@4.x
Updatedrc-animate@2.x