@szhsin/react-menu
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -91,4 +91,10 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
direction: PropTypes.oneOf(['left', 'right', 'top', 'bottom']), | ||
children: PropTypes.node.isRequired, | ||
onClick: PropTypes.func | ||
}); | ||
var menuDefaultPropsBase = { | ||
animation: true, | ||
align: 'start', | ||
direction: 'bottom' | ||
}; | ||
@@ -310,3 +316,4 @@ var defineName = function defineName(component, name) { | ||
var MenuButton = defineName(React__default.memo(React__default.forwardRef(function MenuButton(_ref, ref) { | ||
var className = _ref.className, | ||
var id = _ref.id, | ||
className = _ref.className, | ||
styles = _ref.styles, | ||
@@ -322,2 +329,3 @@ isOpen = _ref.isOpen, | ||
return /*#__PURE__*/React__default.createElement("button", { | ||
id: id, | ||
className: bem(menuButtonClass, null, modifiers)(className), | ||
@@ -335,4 +343,6 @@ style: flatStyles(styles, modifiers), | ||
MenuButton.propTypes = _extends({}, stylePropTypes, { | ||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
isOpen: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
children: PropTypes.node.isRequired, | ||
onClick: PropTypes.func, | ||
@@ -1031,6 +1041,5 @@ onKeyDown: PropTypes.func | ||
}); | ||
Menu.defaultProps = { | ||
animation: true, | ||
Menu.defaultProps = _extends({}, menuDefaultPropsBase, { | ||
keepMounted: true | ||
}; | ||
}); | ||
@@ -1082,4 +1091,3 @@ var ControlledMenu = React__default.memo(function ControlledMenu(_ref) { | ||
}); | ||
ControlledMenu.defaultProps = { | ||
animation: true, | ||
ControlledMenu.defaultProps = _extends({}, menuDefaultPropsBase, { | ||
isMounted: true, | ||
@@ -1089,3 +1097,3 @@ menuItemFocus: { | ||
} | ||
}; | ||
}); | ||
@@ -1261,3 +1269,4 @@ var SubMenu = defineName(React__default.memo(function SubMenu(_ref) { | ||
keepMounted: PropTypes.bool, | ||
label: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
label: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
children: PropTypes.node.isRequired, | ||
onChange: PropTypes.func | ||
@@ -1408,3 +1417,3 @@ }); | ||
disabled: PropTypes.bool, | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
onClick: PropTypes.func | ||
@@ -1466,2 +1475,3 @@ }); | ||
value: PropTypes.any, | ||
children: PropTypes.node.isRequired, | ||
onChange: PropTypes.func | ||
@@ -1468,0 +1478,0 @@ }); |
@@ -88,4 +88,10 @@ import React, { useState, useReducer, useCallback, useMemo, useContext, useRef, useLayoutEffect, useEffect } from 'react'; | ||
direction: PropTypes.oneOf(['left', 'right', 'top', 'bottom']), | ||
children: PropTypes.node.isRequired, | ||
onClick: PropTypes.func | ||
}); | ||
var menuDefaultPropsBase = { | ||
animation: true, | ||
align: 'start', | ||
direction: 'bottom' | ||
}; | ||
@@ -307,3 +313,4 @@ var defineName = function defineName(component, name) { | ||
var MenuButton = defineName(React.memo(React.forwardRef(function MenuButton(_ref, ref) { | ||
var className = _ref.className, | ||
var id = _ref.id, | ||
className = _ref.className, | ||
styles = _ref.styles, | ||
@@ -319,2 +326,3 @@ isOpen = _ref.isOpen, | ||
return /*#__PURE__*/React.createElement("button", { | ||
id: id, | ||
className: bem(menuButtonClass, null, modifiers)(className), | ||
@@ -332,4 +340,6 @@ style: flatStyles(styles, modifiers), | ||
MenuButton.propTypes = _extends({}, stylePropTypes, { | ||
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), | ||
isOpen: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
children: PropTypes.node.isRequired, | ||
onClick: PropTypes.func, | ||
@@ -1028,6 +1038,5 @@ onKeyDown: PropTypes.func | ||
}); | ||
Menu.defaultProps = { | ||
animation: true, | ||
Menu.defaultProps = _extends({}, menuDefaultPropsBase, { | ||
keepMounted: true | ||
}; | ||
}); | ||
@@ -1079,4 +1088,3 @@ var ControlledMenu = React.memo(function ControlledMenu(_ref) { | ||
}); | ||
ControlledMenu.defaultProps = { | ||
animation: true, | ||
ControlledMenu.defaultProps = _extends({}, menuDefaultPropsBase, { | ||
isMounted: true, | ||
@@ -1086,3 +1094,3 @@ menuItemFocus: { | ||
} | ||
}; | ||
}); | ||
@@ -1258,3 +1266,4 @@ var SubMenu = defineName(React.memo(function SubMenu(_ref) { | ||
keepMounted: PropTypes.bool, | ||
label: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
label: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
children: PropTypes.node.isRequired, | ||
onChange: PropTypes.func | ||
@@ -1405,3 +1414,3 @@ }); | ||
disabled: PropTypes.bool, | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired, | ||
onClick: PropTypes.func | ||
@@ -1463,2 +1472,3 @@ }); | ||
value: PropTypes.any, | ||
children: PropTypes.node.isRequired, | ||
onChange: PropTypes.func | ||
@@ -1465,0 +1475,0 @@ }); |
{ | ||
"name": "@szhsin/react-menu", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "React menu components", | ||
@@ -5,0 +5,0 @@ "author": "Zheng Song", |
Sorry, the diff of this file is not supported yet
102434
2930