Comparing version 9.14.0 to 9.14.1
@@ -18,3 +18,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function getOffset(mode, isRootLevel, isRtl, which) { | ||
var _offsets; | ||
var _inline, _horizontal, _vertical, _offsets; | ||
var prev = 'prev'; | ||
@@ -31,5 +31,5 @@ var next = 'next'; | ||
} | ||
var inline = _defineProperty(_defineProperty({}, UP, prev), DOWN, next); | ||
var horizontal = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, LEFT, isRtl ? next : prev), RIGHT, isRtl ? prev : next), DOWN, children), ENTER, children); | ||
var vertical = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, UP, prev), DOWN, next), ENTER, children), ESC, parent), LEFT, isRtl ? children : parent), RIGHT, isRtl ? parent : children); | ||
var inline = (_inline = {}, _defineProperty(_inline, UP, prev), _defineProperty(_inline, DOWN, next), _inline); | ||
var horizontal = (_horizontal = {}, _defineProperty(_horizontal, LEFT, isRtl ? next : prev), _defineProperty(_horizontal, RIGHT, isRtl ? prev : next), _defineProperty(_horizontal, DOWN, children), _defineProperty(_horizontal, ENTER, children), _horizontal); | ||
var vertical = (_vertical = {}, _defineProperty(_vertical, UP, prev), _defineProperty(_vertical, DOWN, next), _defineProperty(_vertical, ENTER, children), _defineProperty(_vertical, ESC, parent), _defineProperty(_vertical, LEFT, isRtl ? children : parent), _defineProperty(_vertical, RIGHT, isRtl ? parent : children), _vertical); | ||
var offsets = { | ||
@@ -270,4 +270,4 @@ inline: inline, | ||
// Pass origin key down event | ||
originOnKeyDown === null || originOnKeyDown === void 0 || originOnKeyDown(e); | ||
originOnKeyDown === null || originOnKeyDown === void 0 ? void 0 : originOnKeyDown(e); | ||
}; | ||
} |
@@ -15,3 +15,3 @@ import * as React from 'react'; | ||
ret.onMouseEnter = function (domEvent) { | ||
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({ | ||
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({ | ||
key: eventKey, | ||
@@ -23,3 +23,3 @@ domEvent: domEvent | ||
ret.onMouseLeave = function (domEvent) { | ||
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({ | ||
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({ | ||
key: eventKey, | ||
@@ -26,0 +26,0 @@ domEvent: domEvent |
@@ -67,3 +67,5 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
var isSubPathKey = useCallback(function (pathKeys, eventKey) { | ||
return pathKeys.some(function (pathKey) { | ||
return pathKeys.filter(function (item) { | ||
return item !== undefined; | ||
}).some(function (pathKey) { | ||
var pathKeyList = getKeyPath(pathKey, true); | ||
@@ -70,0 +72,0 @@ return pathKeyList.includes(eventKey); |
@@ -45,3 +45,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _childList$; | ||
var _childList$, _classNames; | ||
var _ref = props, | ||
@@ -139,3 +139,3 @@ _ref$prefixCls = _ref.prefixCls, | ||
setMergedOpenKeys(keys); | ||
onOpenChange === null || onOpenChange === void 0 || onOpenChange(keys); | ||
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(keys); | ||
} | ||
@@ -266,3 +266,3 @@ if (forceFlush) { | ||
var _elementToFocus$focus; | ||
elementToFocus === null || elementToFocus === void 0 || (_elementToFocus$focus = elementToFocus.focus) === null || _elementToFocus$focus === void 0 || _elementToFocus$focus.call(elementToFocus, options); | ||
elementToFocus === null || elementToFocus === void 0 ? void 0 : (_elementToFocus$focus = elementToFocus.focus) === null || _elementToFocus$focus === void 0 ? void 0 : _elementToFocus$focus.call(elementToFocus, options); | ||
} | ||
@@ -317,5 +317,5 @@ } | ||
if (exist) { | ||
onDeselect === null || onDeselect === void 0 || onDeselect(selectInfo); | ||
onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectInfo); | ||
} else { | ||
onSelect === null || onSelect === void 0 || onSelect(selectInfo); | ||
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectInfo); | ||
} | ||
@@ -335,3 +335,3 @@ } | ||
var onInternalClick = useMemoCallback(function (info) { | ||
onClick === null || onClick === void 0 || onClick(warnItemProp(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info)); | ||
triggerSelection(info); | ||
@@ -400,3 +400,3 @@ }); | ||
itemComponent: MenuItem, | ||
className: classNames(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), "".concat(prefixCls, "-rtl"), isRtl), rootClassName), | ||
className: classNames(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), isRtl), _classNames), rootClassName), | ||
dir: direction, | ||
@@ -403,0 +403,0 @@ style: style, |
@@ -66,2 +66,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
var InternalMenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classNames; | ||
var style = props.style, | ||
@@ -135,7 +136,7 @@ className = props.className, | ||
var info = getEventInfo(e); | ||
onClick === null || onClick === void 0 || onClick(warnItemProp(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info)); | ||
onItemClick(info); | ||
}; | ||
var onInternalKeyDown = function onInternalKeyDown(e) { | ||
onKeyDown === null || onKeyDown === void 0 || onKeyDown(e); | ||
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); | ||
if (e.which === KeyCode.ENTER) { | ||
@@ -145,3 +146,3 @@ var info = getEventInfo(e); | ||
// Legacy. Key will also trigger click event | ||
onClick === null || onClick === void 0 || onClick(warnItemProp(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info)); | ||
onItemClick(info); | ||
@@ -157,3 +158,3 @@ } | ||
onActive(eventKey); | ||
onFocus === null || onFocus === void 0 || onFocus(e); | ||
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e); | ||
}; | ||
@@ -176,3 +177,3 @@ | ||
style: _objectSpread(_objectSpread({}, directionStyle), style), | ||
className: classNames(itemCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(itemCls, "-active"), active), "".concat(itemCls, "-selected"), selected), "".concat(itemCls, "-disabled"), mergedDisabled), className), | ||
className: classNames(itemCls, (_classNames = {}, _defineProperty(_classNames, "".concat(itemCls, "-active"), active), _defineProperty(_classNames, "".concat(itemCls, "-selected"), selected), _defineProperty(_classNames, "".concat(itemCls, "-disabled"), mergedDisabled), _classNames), className), | ||
onClick: onInternalClick, | ||
@@ -179,0 +180,0 @@ onKeyDown: onInternalKeyDown, |
@@ -11,3 +11,3 @@ import * as React from 'react'; | ||
} | ||
declare const MenuItemGroup: React.ForwardRefExoticComponent<Omit<MenuItemGroupProps, "ref"> & React.RefAttributes<HTMLLIElement>>; | ||
declare const MenuItemGroup: React.ForwardRefExoticComponent<Pick<MenuItemGroupProps, "children" | "style" | "className" | "title" | "eventKey" | "warnKey"> & React.RefAttributes<HTMLLIElement>>; | ||
export default MenuItemGroup; |
@@ -13,3 +13,3 @@ import * as React from 'react'; | ||
} | ||
declare const SubMenu: React.ForwardRefExoticComponent<Omit<SubMenuProps, "ref"> & React.RefAttributes<HTMLLIElement>>; | ||
declare const SubMenu: React.ForwardRefExoticComponent<Pick<SubMenuProps, "type" | "children" | "disabled" | "rootClassName" | "itemIcon" | "expandIcon" | "onMouseEnter" | "onMouseLeave" | "popupClassName" | "popupOffset" | "popupStyle" | "onClick" | "onTitleClick" | "onTitleMouseEnter" | "onTitleMouseLeave" | "style" | "className" | "title" | "internalPopupClose" | "eventKey" | "warnKey"> & React.RefAttributes<HTMLLIElement>>; | ||
export default SubMenu; |
@@ -26,2 +26,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
var InternalSubMenu = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classNames; | ||
var style = props.style, | ||
@@ -104,3 +105,3 @@ className = props.className, | ||
triggerChildrenActive(true); | ||
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({ | ||
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({ | ||
key: eventKey, | ||
@@ -112,3 +113,3 @@ domEvent: domEvent | ||
triggerChildrenActive(false); | ||
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({ | ||
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({ | ||
key: eventKey, | ||
@@ -138,3 +139,3 @@ domEvent: domEvent | ||
} | ||
onTitleClick === null || onTitleClick === void 0 || onTitleClick({ | ||
onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick({ | ||
key: eventKey, | ||
@@ -152,3 +153,3 @@ domEvent: e | ||
var onMergedItemClick = useMemoCallback(function (info) { | ||
onClick === null || onClick === void 0 || onClick(warnItemProp(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info)); | ||
onItemClick(info); | ||
@@ -240,3 +241,3 @@ }); | ||
style: style, | ||
className: classNames(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(subMenuPrefixCls, "-open"), open), "".concat(subMenuPrefixCls, "-active"), mergedActive), "".concat(subMenuPrefixCls, "-selected"), childrenSelected), "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled)), | ||
className: classNames(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, (_classNames = {}, _defineProperty(_classNames, "".concat(subMenuPrefixCls, "-open"), open), _defineProperty(_classNames, "".concat(subMenuPrefixCls, "-active"), mergedActive), _defineProperty(_classNames, "".concat(subMenuPrefixCls, "-selected"), childrenSelected), _defineProperty(_classNames, "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled), _classNames)), | ||
onMouseEnter: onInternalMouseEnter, | ||
@@ -243,0 +244,0 @@ onMouseLeave: onInternalMouseLeave |
@@ -11,5 +11,6 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
var IdContext = exports.IdContext = /*#__PURE__*/React.createContext(null); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var IdContext = /*#__PURE__*/React.createContext(null); | ||
exports.IdContext = IdContext; | ||
function getMenuId(uuid, eventKey) { | ||
@@ -16,0 +17,0 @@ if (uuid === undefined) { |
@@ -16,5 +16,6 @@ "use strict"; | ||
var _excluded = ["children", "locked"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
var MenuContext = exports.MenuContext = /*#__PURE__*/React.createContext(null); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var MenuContext = /*#__PURE__*/React.createContext(null); | ||
exports.MenuContext = MenuContext; | ||
function mergeProps(origin, target) { | ||
@@ -21,0 +22,0 @@ var clone = (0, _objectSpread2.default)({}, origin); |
@@ -13,4 +13,4 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var EmptyList = []; | ||
@@ -20,3 +20,4 @@ | ||
var PathRegisterContext = exports.PathRegisterContext = /*#__PURE__*/React.createContext(null); | ||
var PathRegisterContext = /*#__PURE__*/React.createContext(null); | ||
exports.PathRegisterContext = PathRegisterContext; | ||
function useMeasure() { | ||
@@ -27,3 +28,4 @@ return React.useContext(PathRegisterContext); | ||
// ========================= Path Tracker ========================== | ||
var PathTrackerContext = exports.PathTrackerContext = /*#__PURE__*/React.createContext(EmptyList); | ||
var PathTrackerContext = /*#__PURE__*/React.createContext(EmptyList); | ||
exports.PathTrackerContext = PathTrackerContext; | ||
function useFullPath(eventKey) { | ||
@@ -38,2 +40,3 @@ var parentKeyPath = React.useContext(PathTrackerContext); | ||
var PathUserContext = exports.PathUserContext = /*#__PURE__*/React.createContext(null); | ||
var PathUserContext = /*#__PURE__*/React.createContext(null); | ||
exports.PathUserContext = PathUserContext; |
@@ -9,5 +9,6 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var PrivateContext = /*#__PURE__*/React.createContext({}); | ||
var _default = exports.default = PrivateContext; | ||
var _default = PrivateContext; | ||
exports.default = _default; |
@@ -13,4 +13,4 @@ "use strict"; | ||
var _PathContext = require("./context/PathContext"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function Divider(_ref) { | ||
@@ -17,0 +17,0 @@ var className = _ref.className, |
@@ -17,4 +17,4 @@ "use strict"; | ||
var _IdContext = require("../context/IdContext"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// destruct to reduce minify size | ||
@@ -31,3 +31,3 @@ var LEFT = _KeyCode.default.LEFT, | ||
function getOffset(mode, isRootLevel, isRtl, which) { | ||
var _offsets; | ||
var _inline, _horizontal, _vertical, _offsets; | ||
var prev = 'prev'; | ||
@@ -44,5 +44,5 @@ var next = 'next'; | ||
} | ||
var inline = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, UP, prev), DOWN, next); | ||
var horizontal = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, LEFT, isRtl ? next : prev), RIGHT, isRtl ? prev : next), DOWN, children), ENTER, children); | ||
var vertical = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, UP, prev), DOWN, next), ENTER, children), ESC, parent), LEFT, isRtl ? children : parent), RIGHT, isRtl ? parent : children); | ||
var inline = (_inline = {}, (0, _defineProperty2.default)(_inline, UP, prev), (0, _defineProperty2.default)(_inline, DOWN, next), _inline); | ||
var horizontal = (_horizontal = {}, (0, _defineProperty2.default)(_horizontal, LEFT, isRtl ? next : prev), (0, _defineProperty2.default)(_horizontal, RIGHT, isRtl ? prev : next), (0, _defineProperty2.default)(_horizontal, DOWN, children), (0, _defineProperty2.default)(_horizontal, ENTER, children), _horizontal); | ||
var vertical = (_vertical = {}, (0, _defineProperty2.default)(_vertical, UP, prev), (0, _defineProperty2.default)(_vertical, DOWN, next), (0, _defineProperty2.default)(_vertical, ENTER, children), (0, _defineProperty2.default)(_vertical, ESC, parent), (0, _defineProperty2.default)(_vertical, LEFT, isRtl ? children : parent), (0, _defineProperty2.default)(_vertical, RIGHT, isRtl ? parent : children), _vertical); | ||
var offsets = { | ||
@@ -148,3 +148,3 @@ inline: inline, | ||
} | ||
var refreshElements = exports.refreshElements = function refreshElements(keys, id) { | ||
var refreshElements = function refreshElements(keys, id) { | ||
var elements = new Set(); | ||
@@ -167,2 +167,3 @@ var key2element = new Map(); | ||
}; | ||
exports.refreshElements = refreshElements; | ||
function useAccessibility(mode, activeKey, isRtl, id, containerRef, getKeys, getKeyPath, triggerActiveKey, triggerAccessibilityOpen, originOnKeyDown) { | ||
@@ -285,4 +286,4 @@ var rafRef = React.useRef(); | ||
// Pass origin key down event | ||
originOnKeyDown === null || originOnKeyDown === void 0 || originOnKeyDown(e); | ||
originOnKeyDown === null || originOnKeyDown === void 0 ? void 0 : originOnKeyDown(e); | ||
}; | ||
} |
@@ -10,4 +10,4 @@ "use strict"; | ||
var _MenuContext = require("../context/MenuContext"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function useActive(eventKey, disabled, onMouseEnter, onMouseLeave) { | ||
@@ -25,3 +25,3 @@ var _React$useContext = React.useContext(_MenuContext.MenuContext), | ||
ret.onMouseEnter = function (domEvent) { | ||
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({ | ||
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({ | ||
key: eventKey, | ||
@@ -33,3 +33,3 @@ domEvent: domEvent | ||
ret.onMouseLeave = function (domEvent) { | ||
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({ | ||
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({ | ||
key: eventKey, | ||
@@ -36,0 +36,0 @@ domEvent: domEvent |
@@ -10,4 +10,4 @@ "use strict"; | ||
var _MenuContext = require("../context/MenuContext"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function useDirectionStyle(level) { | ||
@@ -14,0 +14,0 @@ var _React$useContext = React.useContext(_MenuContext.MenuContext), |
@@ -12,8 +12,7 @@ "use strict"; | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var React = _react; | ||
var React = _interopRequireWildcard(require("react")); | ||
var _warning = _interopRequireDefault(require("rc-util/lib/warning")); | ||
var _timeUtil = require("../utils/timeUtil"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var PATH_SPLIT = '__RC_UTIL_PATH_SPLIT__'; | ||
@@ -26,3 +25,4 @@ var getPathStr = function getPathStr(keyPath) { | ||
}; | ||
var OVERFLOW_KEY = exports.OVERFLOW_KEY = 'rc-menu-more'; | ||
var OVERFLOW_KEY = 'rc-menu-more'; | ||
exports.OVERFLOW_KEY = OVERFLOW_KEY; | ||
function useKeyRecords() { | ||
@@ -32,4 +32,4 @@ var _React$useState = React.useState({}), | ||
internalForceUpdate = _React$useState2[1]; | ||
var key2pathRef = (0, _react.useRef)(new Map()); | ||
var path2keyRef = (0, _react.useRef)(new Map()); | ||
var key2pathRef = (0, React.useRef)(new Map()); | ||
var path2keyRef = (0, React.useRef)(new Map()); | ||
var _React$useState3 = React.useState([]), | ||
@@ -39,4 +39,4 @@ _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2), | ||
setOverflowKeys = _React$useState4[1]; | ||
var updateRef = (0, _react.useRef)(0); | ||
var destroyRef = (0, _react.useRef)(false); | ||
var updateRef = (0, React.useRef)(0); | ||
var destroyRef = (0, React.useRef)(false); | ||
var forceUpdate = function forceUpdate() { | ||
@@ -47,3 +47,3 @@ if (!destroyRef.current) { | ||
}; | ||
var registerPath = (0, _react.useCallback)(function (key, keyPath) { | ||
var registerPath = (0, React.useCallback)(function (key, keyPath) { | ||
// Warning for invalidate or duplicated `key` | ||
@@ -66,3 +66,3 @@ if (process.env.NODE_ENV !== 'production') { | ||
}, []); | ||
var unregisterPath = (0, _react.useCallback)(function (key, keyPath) { | ||
var unregisterPath = (0, React.useCallback)(function (key, keyPath) { | ||
var connectedPath = getPathStr(keyPath); | ||
@@ -72,6 +72,6 @@ path2keyRef.current.delete(connectedPath); | ||
}, []); | ||
var refreshOverflowKeys = (0, _react.useCallback)(function (keys) { | ||
var refreshOverflowKeys = (0, React.useCallback)(function (keys) { | ||
setOverflowKeys(keys); | ||
}, []); | ||
var getKeyPath = (0, _react.useCallback)(function (eventKey, includeOverflow) { | ||
var getKeyPath = (0, React.useCallback)(function (eventKey, includeOverflow) { | ||
var fullPath = key2pathRef.current.get(eventKey) || ''; | ||
@@ -84,4 +84,6 @@ var keys = getPathKeys(fullPath); | ||
}, [overflowKeys]); | ||
var isSubPathKey = (0, _react.useCallback)(function (pathKeys, eventKey) { | ||
return pathKeys.some(function (pathKey) { | ||
var isSubPathKey = (0, React.useCallback)(function (pathKeys, eventKey) { | ||
return pathKeys.filter(function (item) { | ||
return item !== undefined; | ||
}).some(function (pathKey) { | ||
var pathKeyList = getKeyPath(pathKey, true); | ||
@@ -102,3 +104,3 @@ return pathKeyList.includes(eventKey); | ||
*/ | ||
var getSubPathKeys = (0, _react.useCallback)(function (key) { | ||
var getSubPathKeys = (0, React.useCallback)(function (key) { | ||
var connectedPath = "".concat(key2pathRef.current.get(key)).concat(PATH_SPLIT); | ||
@@ -105,0 +107,0 @@ var pathKeys = new Set(); |
@@ -9,4 +9,4 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
/** | ||
@@ -13,0 +13,0 @@ * Cache callback function that always return same ref instead. |
@@ -12,4 +12,4 @@ "use strict"; | ||
var _useMergedState3 = _interopRequireDefault(require("rc-util/lib/hooks/useMergedState")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var uniquePrefix = Math.random().toFixed(5).toString().slice(2); | ||
@@ -16,0 +16,0 @@ var internalId = 0; |
@@ -11,4 +11,4 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function Icon(_ref) { | ||
@@ -15,0 +15,0 @@ var icon = _ref.icon, |
@@ -61,2 +61,3 @@ "use strict"; | ||
ExportMenu.Divider = _Divider.default; | ||
var _default = exports.default = ExportMenu; | ||
var _default = ExportMenu; | ||
exports.default = _default; |
@@ -20,4 +20,3 @@ "use strict"; | ||
var _warning = _interopRequireDefault(require("rc-util/lib/warning")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var React = _react; | ||
var React = _interopRequireWildcard(require("react")); | ||
var _reactDom = require("react-dom"); | ||
@@ -37,4 +36,4 @@ var _IdContext = require("./context/IdContext"); | ||
var _excluded = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem", "_internalComponents"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
/** | ||
@@ -51,8 +50,6 @@ * Menu modify after refactor: | ||
* - collapsedWidth: Seems this logic should be handle by antd Layout.Sider | ||
*/ | ||
// optimize for render | ||
*/ // optimize for render | ||
var EMPTY_LIST = []; | ||
var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _childList$; | ||
var _childList$, _classNames; | ||
var _ref = props, | ||
@@ -150,3 +147,3 @@ _ref$prefixCls = _ref.prefixCls, | ||
setMergedOpenKeys(keys); | ||
onOpenChange === null || onOpenChange === void 0 || onOpenChange(keys); | ||
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(keys); | ||
} | ||
@@ -260,3 +257,3 @@ if (forceFlush) { | ||
}); | ||
(0, _react.useImperativeHandle)(ref, function () { | ||
(0, React.useImperativeHandle)(ref, function () { | ||
return { | ||
@@ -278,3 +275,3 @@ list: containerRef.current, | ||
var _elementToFocus$focus; | ||
elementToFocus === null || elementToFocus === void 0 || (_elementToFocus$focus = elementToFocus.focus) === null || _elementToFocus$focus === void 0 || _elementToFocus$focus.call(elementToFocus, options); | ||
elementToFocus === null || elementToFocus === void 0 ? void 0 : (_elementToFocus$focus = elementToFocus.focus) === null || _elementToFocus$focus === void 0 ? void 0 : _elementToFocus$focus.call(elementToFocus, options); | ||
} | ||
@@ -329,5 +326,5 @@ } | ||
if (exist) { | ||
onDeselect === null || onDeselect === void 0 || onDeselect(selectInfo); | ||
onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectInfo); | ||
} else { | ||
onSelect === null || onSelect === void 0 || onSelect(selectInfo); | ||
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectInfo); | ||
} | ||
@@ -347,3 +344,3 @@ } | ||
var onInternalClick = (0, _useMemoCallback.default)(function (info) { | ||
onClick === null || onClick === void 0 || onClick((0, _warnUtil.warnItemProp)(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick((0, _warnUtil.warnItemProp)(info)); | ||
triggerSelection(info); | ||
@@ -412,3 +409,3 @@ }); | ||
itemComponent: _MenuItem.default, | ||
className: (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), "".concat(prefixCls, "-rtl"), isRtl), rootClassName), | ||
className: (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-root"), "".concat(prefixCls, "-").concat(internalMode), className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-inline-collapsed"), internalInlineCollapsed), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-rtl"), isRtl), _classNames), rootClassName), | ||
dir: direction, | ||
@@ -499,2 +496,3 @@ style: style, | ||
}); | ||
var _default = exports.default = Menu; | ||
var _default = Menu; | ||
exports.default = _default; |
@@ -36,4 +36,4 @@ "use strict"; | ||
_excluded3 = ["active"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// Since Menu event provide the `info.item` which point to the MenuItem node instance. | ||
@@ -77,2 +77,3 @@ // We have to use class component here. | ||
var InternalMenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classNames; | ||
var style = props.style, | ||
@@ -146,7 +147,7 @@ className = props.className, | ||
var info = getEventInfo(e); | ||
onClick === null || onClick === void 0 || onClick((0, _warnUtil.warnItemProp)(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick((0, _warnUtil.warnItemProp)(info)); | ||
onItemClick(info); | ||
}; | ||
var onInternalKeyDown = function onInternalKeyDown(e) { | ||
onKeyDown === null || onKeyDown === void 0 || onKeyDown(e); | ||
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); | ||
if (e.which === _KeyCode.default.ENTER) { | ||
@@ -156,3 +157,3 @@ var info = getEventInfo(e); | ||
// Legacy. Key will also trigger click event | ||
onClick === null || onClick === void 0 || onClick((0, _warnUtil.warnItemProp)(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick((0, _warnUtil.warnItemProp)(info)); | ||
onItemClick(info); | ||
@@ -168,3 +169,3 @@ } | ||
onActive(eventKey); | ||
onFocus === null || onFocus === void 0 || onFocus(e); | ||
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e); | ||
}; | ||
@@ -187,3 +188,3 @@ | ||
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, directionStyle), style), | ||
className: (0, _classnames.default)(itemCls, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(itemCls, "-active"), active), "".concat(itemCls, "-selected"), selected), "".concat(itemCls, "-disabled"), mergedDisabled), className), | ||
className: (0, _classnames.default)(itemCls, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(itemCls, "-active"), active), (0, _defineProperty2.default)(_classNames, "".concat(itemCls, "-selected"), selected), (0, _defineProperty2.default)(_classNames, "".concat(itemCls, "-disabled"), mergedDisabled), _classNames), className), | ||
onClick: onInternalClick, | ||
@@ -230,2 +231,3 @@ onKeyDown: onInternalKeyDown, | ||
} | ||
var _default = exports.default = /*#__PURE__*/React.forwardRef(MenuItem); | ||
var _default = /*#__PURE__*/React.forwardRef(MenuItem); | ||
exports.default = _default; |
@@ -11,3 +11,3 @@ import * as React from 'react'; | ||
} | ||
declare const MenuItemGroup: React.ForwardRefExoticComponent<Omit<MenuItemGroupProps, "ref"> & React.RefAttributes<HTMLLIElement>>; | ||
declare const MenuItemGroup: React.ForwardRefExoticComponent<Pick<MenuItemGroupProps, "children" | "style" | "className" | "title" | "eventKey" | "warnKey"> & React.RefAttributes<HTMLLIElement>>; | ||
export default MenuItemGroup; |
@@ -18,4 +18,4 @@ "use strict"; | ||
var _excluded = ["className", "title", "eventKey", "children"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var InternalMenuItemGroup = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
@@ -63,2 +63,3 @@ var className = props.className, | ||
} | ||
var _default = exports.default = MenuItemGroup; | ||
var _default = MenuItemGroup; | ||
exports.default = _default; |
@@ -11,3 +11,3 @@ "use strict"; | ||
}; | ||
var placements = exports.placements = { | ||
var placements = { | ||
topLeft: { | ||
@@ -46,3 +46,4 @@ points: ['bl', 'tl'], | ||
}; | ||
var placementsRtl = exports.placementsRtl = { | ||
exports.placements = placements; | ||
var placementsRtl = { | ||
topLeft: { | ||
@@ -81,2 +82,4 @@ points: ['bl', 'tl'], | ||
}; | ||
var _default = exports.default = placements; | ||
exports.placementsRtl = placementsRtl; | ||
var _default = placements; | ||
exports.default = _default; |
@@ -13,3 +13,3 @@ import * as React from 'react'; | ||
} | ||
declare const SubMenu: React.ForwardRefExoticComponent<Omit<SubMenuProps, "ref"> & React.RefAttributes<HTMLLIElement>>; | ||
declare const SubMenu: React.ForwardRefExoticComponent<Pick<SubMenuProps, "type" | "children" | "disabled" | "rootClassName" | "itemIcon" | "expandIcon" | "onMouseEnter" | "onMouseLeave" | "popupClassName" | "popupOffset" | "popupStyle" | "onClick" | "onTitleClick" | "onTitleMouseEnter" | "onTitleMouseLeave" | "style" | "className" | "title" | "internalPopupClose" | "eventKey" | "warnKey"> & React.RefAttributes<HTMLLIElement>>; | ||
export default SubMenu; |
@@ -33,5 +33,6 @@ "use strict"; | ||
_excluded2 = ["active"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var InternalSubMenu = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classNames; | ||
var style = props.style, | ||
@@ -114,3 +115,3 @@ className = props.className, | ||
triggerChildrenActive(true); | ||
onMouseEnter === null || onMouseEnter === void 0 || onMouseEnter({ | ||
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter({ | ||
key: eventKey, | ||
@@ -122,3 +123,3 @@ domEvent: domEvent | ||
triggerChildrenActive(false); | ||
onMouseLeave === null || onMouseLeave === void 0 || onMouseLeave({ | ||
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave({ | ||
key: eventKey, | ||
@@ -148,3 +149,3 @@ domEvent: domEvent | ||
} | ||
onTitleClick === null || onTitleClick === void 0 || onTitleClick({ | ||
onTitleClick === null || onTitleClick === void 0 ? void 0 : onTitleClick({ | ||
key: eventKey, | ||
@@ -162,3 +163,3 @@ domEvent: e | ||
var onMergedItemClick = (0, _useMemoCallback.default)(function (info) { | ||
onClick === null || onClick === void 0 || onClick((0, _warnUtil.warnItemProp)(info)); | ||
onClick === null || onClick === void 0 ? void 0 : onClick((0, _warnUtil.warnItemProp)(info)); | ||
onItemClick(info); | ||
@@ -250,3 +251,3 @@ }); | ||
style: style, | ||
className: (0, _classnames.default)(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(subMenuPrefixCls, "-open"), open), "".concat(subMenuPrefixCls, "-active"), mergedActive), "".concat(subMenuPrefixCls, "-selected"), childrenSelected), "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled)), | ||
className: (0, _classnames.default)(subMenuPrefixCls, "".concat(subMenuPrefixCls, "-").concat(mode), className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(subMenuPrefixCls, "-open"), open), (0, _defineProperty2.default)(_classNames, "".concat(subMenuPrefixCls, "-active"), mergedActive), (0, _defineProperty2.default)(_classNames, "".concat(subMenuPrefixCls, "-selected"), childrenSelected), (0, _defineProperty2.default)(_classNames, "".concat(subMenuPrefixCls, "-disabled"), mergedDisabled), _classNames)), | ||
onMouseEnter: onInternalMouseEnter, | ||
@@ -311,2 +312,3 @@ onMouseLeave: onInternalMouseLeave | ||
} | ||
var _default = exports.default = SubMenu; | ||
var _default = SubMenu; | ||
exports.default = _default; |
@@ -17,4 +17,4 @@ "use strict"; | ||
var _SubMenuList = _interopRequireDefault(require("./SubMenuList")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function InlineSubMenuList(_ref) { | ||
@@ -21,0 +21,0 @@ var id = _ref.id, |
@@ -19,4 +19,4 @@ "use strict"; | ||
var _motionUtil = require("../utils/motionUtil"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var popupPlacementMap = { | ||
@@ -23,0 +23,0 @@ horizontal: 'bottomLeft', |
@@ -15,4 +15,4 @@ "use strict"; | ||
var _excluded = ["className", "children"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var InternalSubMenuList = function InternalSubMenuList(_ref, ref) { | ||
@@ -36,2 +36,3 @@ var className = _ref.className, | ||
SubMenuList.displayName = 'SubMenuList'; | ||
var _default = exports.default = SubMenuList; | ||
var _default = SubMenuList; | ||
exports.default = _default; |
@@ -12,4 +12,4 @@ "use strict"; | ||
var React = _interopRequireWildcard(require("react")); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function parseChildren(children, keyPath) { | ||
@@ -16,0 +16,0 @@ return (0, _toArray.default)(children).map(function (child, index) { |
@@ -20,4 +20,4 @@ "use strict"; | ||
var _excluded = ["label", "children", "key", "type"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function convertItemsToNodes(list, components) { | ||
@@ -24,0 +24,0 @@ var MergedMenuItem = components.item, |
{ | ||
"name": "rc-menu", | ||
"version": "9.14.0", | ||
"version": "9.14.1", | ||
"description": "menu ui component for react", | ||
@@ -69,3 +69,3 @@ "keywords": [ | ||
"less": "^4.1.3", | ||
"np": "^9.0.0", | ||
"np": "^10.0.5", | ||
"rc-test": "^7.0.14", | ||
@@ -72,0 +72,0 @@ "react": "^18.3.1", |
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
255178
96
5206