UNPKG

sk-antd

Version:
74 lines (58 loc) 3.79 kB
import "antd/es/menu/style"; import _Menu from "antd/es/menu"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } import PropTypes from 'prop-types'; import { SK } from 'sk-js'; import OriginMenu from './OriginMenu'; import AntdComp from '../AntdComp'; var SubMenu = _Menu.SubMenu; SubMenu.defaultProps = SK.extends(true, {}, { disabled: false }, OriginMenu.defaultProps, SubMenu.defaultProps, {}); SubMenu.propTypes = SK.extends(true, { //https://github.com/react-component/menu/blob/master/src/SubMenu.jsx#L36 onItemHover: PropTypes.func }, { //https://ant.design/components/menu-cn/#Menu.SubMenu // children: PropTypes.array, disabled: PropTypes.bool, //key: PropTypes.string,//Warning: SKMenuItem: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props) title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), onTitleClick: PropTypes.func, //https://github.com/react-component/menu#menusubmenu-props eventKey: PropTypes.string, onMouseEnter: PropTypes.func, onMouseLeave: PropTypes.func, onTitleMouseEnter: PropTypes.func, onTitleMouseLeave: PropTypes.func }, OriginMenu.propTypes, SubMenu.propTypes, {}); SubMenu.NON_SK_COMP_NAME = 'SubMenu'; var SKSubMenu = /*#__PURE__*/ function (_AntdComp) { _inherits(SKSubMenu, _AntdComp); function SKSubMenu() { var _getPrototypeOf2; var _this; _classCallCheck(this, SKSubMenu); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SKSubMenu)).call.apply(_getPrototypeOf2, [this].concat(args))); _this.SK_COMP_NAME = SKSubMenu.SK_COMP_NAME; return _this; } return SKSubMenu; }(AntdComp); SKSubMenu.SK_COMP_NAME = 'SKSubMenu'; SKSubMenu.defaultProps = SK.extends(true, {}, AntdComp.defaultProps, SubMenu.defaultProps, { compTag: _Menu.SubMenu }); SKSubMenu.propTypes = SK.extends(true, {}, AntdComp.propTypes, SubMenu.propTypes, {}); export { SKSubMenu as default };