import _extends from"babel-runtime/helpers/extends";import _classCallCheck from"babel-runtime/helpers/classCallCheck";import _createClass from"babel-runtime/helpers/createClass";import _possibleConstructorReturn from"babel-runtime/helpers/possibleConstructorReturn";import _inherits from"babel-runtime/helpers/inherits";import*as React from"react";import*as PropTypes from"prop-types";import{SubMenu as RcSubMenu}from"rc-menu";import classNames from"classnames";var SubMenu=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onKeyDown=function(t){e.subMenu.onKeyDown(t)},e.saveSubMenu=function(t){e.subMenu=t},e}return _inherits(t,e),_createClass(t,[{key:"render",value:function(){var e=this.props,t=e.rootPrefixCls,r=e.className,s=this.context.dtdMenuTheme;return React.createElement(RcSubMenu,_extends({},this.props,{ref:this.saveSubMenu,popupClassName:classNames(t+"-"+s,r)}))}}]),t}(React.Component);SubMenu.contextTypes={dtdMenuTheme:PropTypes.string};export default SubMenu;