11f09fbb6028ff9e44e6a02ca2289a13.json
37.8 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport { Provider, create } from 'mini-store';\nimport omit from 'omit.js';\nimport SubPopupMenu, { getActiveKey } from './SubPopupMenu';\nimport { noop } from './util';\nimport { getMotion } from './utils/legacyUtil';\n\nvar Menu = /*#__PURE__*/function (_React$Component) {\n _inherits(Menu, _React$Component);\n\n var _super = _createSuper(Menu);\n\n function Menu(props) {\n var _this;\n\n _classCallCheck(this, Menu);\n\n _this = _super.call(this, props);\n\n _this.onSelect = function (selectInfo) {\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props;\n\n if (props.selectable) {\n // root menu\n var _this$store$getState = _this.store.getState(),\n _selectedKeys = _this$store$getState.selectedKeys;\n\n var selectedKey = selectInfo.key;\n\n if (props.multiple) {\n _selectedKeys = _selectedKeys.concat([selectedKey]);\n } else {\n _selectedKeys = [selectedKey];\n }\n\n if (!('selectedKeys' in props)) {\n _this.store.setState({\n selectedKeys: _selectedKeys\n });\n }\n\n props.onSelect(_objectSpread(_objectSpread({}, selectInfo), {}, {\n selectedKeys: _selectedKeys\n }));\n }\n };\n\n _this.onClick = function (e) {\n var mode = _this.getRealMenuMode();\n\n var _assertThisInitialize2 = _assertThisInitialized(_this),\n store = _assertThisInitialize2.store,\n onOpenChange = _assertThisInitialize2.props.onOpenChange;\n\n if (mode !== 'inline' && !('openKeys' in _this.props)) {\n // closing vertical popup submenu after click it\n store.setState({\n openKeys: []\n });\n onOpenChange([]);\n }\n\n _this.props.onClick(e);\n }; // onKeyDown needs to be exposed as a instance method\n // e.g., in rc-select, we need to navigate menu item while\n // current active item is rc-select input box rather than the menu itself\n\n\n _this.onKeyDown = function (e, callback) {\n _this.innerMenu.getWrappedInstance().onKeyDown(e, callback);\n };\n\n _this.onOpenChange = function (event) {\n var _assertThisInitialize3 = _assertThisInitialized(_this),\n props = _assertThisInitialize3.props;\n\n var openKeys = _this.store.getState().openKeys.concat();\n\n var changed = false;\n\n var processSingle = function processSingle(e) {\n var oneChanged = false;\n\n if (e.open) {\n oneChanged = openKeys.indexOf(e.key) === -1;\n\n if (oneChanged) {\n openKeys.push(e.key);\n }\n } else {\n var index = openKeys.indexOf(e.key);\n oneChanged = index !== -1;\n\n if (oneChanged) {\n openKeys.splice(index, 1);\n }\n }\n\n changed = changed || oneChanged;\n };\n\n if (Array.isArray(event)) {\n // batch change call\n event.forEach(processSingle);\n } else {\n processSingle(event);\n }\n\n if (changed) {\n if (!('openKeys' in _this.props)) {\n _this.store.setState({\n openKeys: openKeys\n });\n }\n\n props.onOpenChange(openKeys);\n }\n };\n\n _this.onDeselect = function (selectInfo) {\n var _assertThisInitialize4 = _assertThisInitialized(_this),\n props = _assertThisInitialize4.props;\n\n if (props.selectable) {\n var _selectedKeys2 = _this.store.getState().selectedKeys.concat();\n\n var selectedKey = selectInfo.key;\n\n var index = _selectedKeys2.indexOf(selectedKey);\n\n if (index !== -1) {\n _selectedKeys2.splice(index, 1);\n }\n\n if (!('selectedKeys' in props)) {\n _this.store.setState({\n selectedKeys: _selectedKeys2\n });\n }\n\n props.onDeselect(_objectSpread(_objectSpread({}, selectInfo), {}, {\n selectedKeys: _selectedKeys2\n }));\n }\n }; // Restore vertical mode when menu is collapsed responsively when mounted\n // https://github.com/ant-design/ant-design/issues/13104\n // TODO: not a perfect solution,\n // looking a new way to avoid setting switchingModeFromInline in this situation\n\n\n _this.onMouseEnter = function (e) {\n _this.restoreModeVerticalFromInline();\n\n var onMouseEnter = _this.props.onMouseEnter;\n\n if (onMouseEnter) {\n onMouseEnter(e);\n }\n };\n\n _this.onTransitionEnd = function (e) {\n // when inlineCollapsed menu width animation finished\n // https://github.com/ant-design/ant-design/issues/12864\n var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function\n // https://github.com/ant-design/ant-design/issues/15699\n\n var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal,\n // unless during an animation.\n\n var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for <Menu style={{ width: '100%' }} />,\n // the width transition won't trigger when menu is collapsed\n // https://github.com/ant-design/ant-design-pro/issues/2783\n\n var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0;\n\n if (widthCollapsed || iconScaled) {\n _this.restoreModeVerticalFromInline();\n }\n };\n\n _this.setInnerMenu = function (node) {\n _this.innerMenu = node;\n };\n\n _this.isRootMenu = true;\n var selectedKeys = props.defaultSelectedKeys;\n var openKeys = props.defaultOpenKeys;\n\n if ('selectedKeys' in props) {\n selectedKeys = props.selectedKeys || [];\n }\n\n if ('openKeys' in props) {\n openKeys = props.openKeys || [];\n }\n\n _this.store = create({\n selectedKeys: selectedKeys,\n openKeys: openKeys,\n activeKey: {\n '0-menu-': getActiveKey(props, props.activeKey)\n }\n });\n _this.state = {\n switchingModeFromInline: false,\n prevProps: props,\n inlineOpenKeys: [],\n store: _this.store\n };\n return _this;\n }\n\n _createClass(Menu, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateMiniStore();\n this.updateMenuDisplay();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n siderCollapsed = _this$props.siderCollapsed,\n inlineCollapsed = _this$props.inlineCollapsed,\n onOpenChange = _this$props.onOpenChange;\n\n if (!prevProps.inlineCollapsed && inlineCollapsed || !prevProps.siderCollapsed && siderCollapsed) {\n onOpenChange([]);\n }\n\n this.updateMiniStore();\n this.updateMenuDisplay();\n }\n }, {\n key: \"updateMenuDisplay\",\n value: function updateMenuDisplay() {\n var collapsedWidth = this.props.collapsedWidth,\n store = this.store,\n prevOpenKeys = this.prevOpenKeys; // https://github.com/ant-design/ant-design/issues/8587\n\n var hideMenu = this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');\n\n if (hideMenu) {\n this.prevOpenKeys = store.getState().openKeys.concat();\n this.store.setState({\n openKeys: []\n });\n } else if (prevOpenKeys) {\n this.store.setState({\n openKeys: prevOpenKeys\n });\n this.prevOpenKeys = null;\n }\n }\n }, {\n key: \"getRealMenuMode\",\n value: function getRealMenuMode() {\n var mode = this.props.mode;\n var switchingModeFromInline = this.state.switchingModeFromInline;\n var inlineCollapsed = this.getInlineCollapsed();\n\n if (switchingModeFromInline && inlineCollapsed) {\n return 'inline';\n }\n\n return inlineCollapsed ? 'vertical' : mode;\n }\n }, {\n key: \"getInlineCollapsed\",\n value: function getInlineCollapsed() {\n var _this$props2 = this.props,\n inlineCollapsed = _this$props2.inlineCollapsed,\n siderCollapsed = _this$props2.siderCollapsed;\n\n if (siderCollapsed !== undefined) {\n return siderCollapsed;\n }\n\n return inlineCollapsed;\n }\n }, {\n key: \"restoreModeVerticalFromInline\",\n value: function restoreModeVerticalFromInline() {\n var switchingModeFromInline = this.state.switchingModeFromInline;\n\n if (switchingModeFromInline) {\n this.setState({\n switchingModeFromInline: false\n });\n }\n }\n }, {\n key: \"updateMiniStore\",\n value: function updateMiniStore() {\n if ('selectedKeys' in this.props) {\n this.store.setState({\n selectedKeys: this.props.selectedKeys || []\n });\n }\n\n if ('openKeys' in this.props) {\n this.store.setState({\n openKeys: this.props.openKeys || []\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var props = _objectSpread({}, omit(this.props, ['collapsedWidth', 'siderCollapsed', 'defaultMotions']));\n\n var mode = this.getRealMenuMode();\n props.className += \" \".concat(props.prefixCls, \"-root\");\n\n if (props.direction === 'rtl') {\n props.className += \" \".concat(props.prefixCls, \"-rtl\");\n }\n\n props = _objectSpread(_objectSpread({}, props), {}, {\n mode: mode,\n onClick: this.onClick,\n onOpenChange: this.onOpenChange,\n onDeselect: this.onDeselect,\n onSelect: this.onSelect,\n onMouseEnter: this.onMouseEnter,\n onTransitionEnd: this.onTransitionEnd,\n parentMenu: this,\n motion: getMotion(this.props, this.state, mode)\n });\n delete props.openAnimation;\n delete props.openTransitionName;\n return React.createElement(Provider, {\n store: this.store\n }, React.createElement(SubPopupMenu, Object.assign({}, props, {\n ref: this.setInnerMenu\n }), this.props.children));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var prevProps = prevState.prevProps,\n store = prevState.store;\n var prevStoreState = store.getState();\n var newStoreState = {};\n var newState = {\n prevProps: nextProps\n };\n\n if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') {\n newState.switchingModeFromInline = true;\n }\n\n if ('openKeys' in nextProps) {\n newStoreState.openKeys = nextProps.openKeys;\n } else {\n // [Legacy] Old code will return after `openKeys` changed.\n // Not sure the reason, we should keep this logic still.\n if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) {\n newState.switchingModeFromInline = true;\n newState.inlineOpenKeys = prevStoreState.openKeys;\n newStoreState.openKeys = [];\n }\n\n if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) {\n newStoreState.openKeys = prevState.inlineOpenKeys;\n newState.inlineOpenKeys = [];\n }\n }\n\n if (Object.keys(newStoreState).length) {\n store.setState(newStoreState);\n }\n\n return newState;\n }\n }]);\n\n return Menu;\n}(React.Component);\n\nMenu.defaultProps = {\n selectable: true,\n onClick: noop,\n onSelect: noop,\n onOpenChange: noop,\n onDeselect: noop,\n defaultSelectedKeys: [],\n defaultOpenKeys: [],\n subMenuOpenDelay: 0.1,\n subMenuCloseDelay: 0.1,\n triggerSubMenuAction: 'hover',\n prefixCls: 'rc-menu',\n className: '',\n mode: 'vertical',\n style: {},\n builtinPlacements: {},\n overflowedIndicator: React.createElement(\"span\", null, \"\\xB7\\xB7\\xB7\")\n};\nexport default Menu;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-menu/es/Menu.js"],"names":["_objectSpread","_classCallCheck","_createClass","_assertThisInitialized","_inherits","_createSuper","React","Provider","create","omit","SubPopupMenu","getActiveKey","noop","getMotion","Menu","_React$Component","_super","props","_this","call","onSelect","selectInfo","_assertThisInitialize","selectable","_this$store$getState","store","getState","_selectedKeys","selectedKeys","selectedKey","key","multiple","concat","setState","onClick","e","mode","getRealMenuMode","_assertThisInitialize2","onOpenChange","openKeys","onKeyDown","callback","innerMenu","getWrappedInstance","event","_assertThisInitialize3","changed","processSingle","oneChanged","open","indexOf","push","index","splice","Array","isArray","forEach","onDeselect","_assertThisInitialize4","_selectedKeys2","onMouseEnter","restoreModeVerticalFromInline","onTransitionEnd","widthCollapsed","propertyName","target","currentTarget","className","classNameValue","Object","prototype","toString","animVal","iconScaled","setInnerMenu","node","isRootMenu","defaultSelectedKeys","defaultOpenKeys","activeKey","state","switchingModeFromInline","prevProps","inlineOpenKeys","value","componentDidMount","updateMiniStore","updateMenuDisplay","componentDidUpdate","_this$props","siderCollapsed","inlineCollapsed","collapsedWidth","prevOpenKeys","hideMenu","getInlineCollapsed","_this$props2","undefined","render","prefixCls","direction","parentMenu","motion","openAnimation","openTransitionName","createElement","assign","ref","children","getDerivedStateFromProps","nextProps","prevState","prevStoreState","newStoreState","newState","keys","length","Component","defaultProps","subMenuOpenDelay","subMenuCloseDelay","triggerSubMenuAction","style","builtinPlacements","overflowedIndicator"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,wCAAzB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,SAAP,MAAs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oB;AAClBhG,EAAAA,UAAU,EAAE,IADM;AAElBW,EAAAA,OAAO,EAAEtB,IAFS;AAGlBQ,EAAAA,QAAQ,EAAER,IAHQ;AAIlB2B,EAAAA,YAAY,EAAE3B,IAJI;AAKlB8C,EAAAA,UAAU,EAAE9C,IALM;AAMlBkE,EAAAA,mBAAmB,EAAE,EANH;AAOlBC,EAAAA,eAAe,EAAE,EAPC;AAQlByC,EAAAA,gBAAgB,EAAE,GARA;AASlBC,EAAAA,iBAAiB,EAAE,GATD;AAUlBC,EAAAA,oBAAoB,EAAE,OAVJ;AAWlBtB,EAAAA,SAAS,EAAE,SAXO;AAYlBhC,EAAAA,SAAS,EAAE,EAZO;AAalBhC,EAAAA,IAAI,EAAE,UAbY;AAclBuF,EAAAA,KAAK,EAAE,EAdW;AAelBC,EAAAA,iBAAiB,EAAE,EAfD;AAgBlBC,EAAAA,mBAAmB,EAAEvH,KAAK,CAACoG,aAAN,CAAoB,MAApB,EAA4B,IAA5B,EAAkC,cAAlC;AAhBH,CAApB;AAkBA,eAAe5F,IAAf","sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/esm/createSuper\";\nimport * as React from 'react';\nimport { Provider, create } from 'mini-store';\nimport omit from 'omit.js';\nimport SubPopupMenu, { getActiveKey } from './SubPopupMenu';\nimport { noop } from './util';\nimport { getMotion } from './utils/legacyUtil';\n\nvar Menu = /*#__PURE__*/function (_React$Component) {\n _inherits(Menu, _React$Component);\n\n var _super = _createSuper(Menu);\n\n function Menu(props) {\n var _this;\n\n _classCallCheck(this, Menu);\n\n _this = _super.call(this, props);\n\n _this.onSelect = function (selectInfo) {\n var _assertThisInitialize = _assertThisInitialized(_this),\n props = _assertThisInitialize.props;\n\n if (props.selectable) {\n // root menu\n var _this$store$getState = _this.store.getState(),\n _selectedKeys = _this$store$getState.selectedKeys;\n\n var selectedKey = selectInfo.key;\n\n if (props.multiple) {\n _selectedKeys = _selectedKeys.concat([selectedKey]);\n } else {\n _selectedKeys = [selectedKey];\n }\n\n if (!('selectedKeys' in props)) {\n _this.store.setState({\n selectedKeys: _selectedKeys\n });\n }\n\n props.onSelect(_objectSpread(_objectSpread({}, selectInfo), {}, {\n selectedKeys: _selectedKeys\n }));\n }\n };\n\n _this.onClick = function (e) {\n var mode = _this.getRealMenuMode();\n\n var _assertThisInitialize2 = _assertThisInitialized(_this),\n store = _assertThisInitialize2.store,\n onOpenChange = _assertThisInitialize2.props.onOpenChange;\n\n if (mode !== 'inline' && !('openKeys' in _this.props)) {\n // closing vertical popup submenu after click it\n store.setState({\n openKeys: []\n });\n onOpenChange([]);\n }\n\n _this.props.onClick(e);\n }; // onKeyDown needs to be exposed as a instance method\n // e.g., in rc-select, we need to navigate menu item while\n // current active item is rc-select input box rather than the menu itself\n\n\n _this.onKeyDown = function (e, callback) {\n _this.innerMenu.getWrappedInstance().onKeyDown(e, callback);\n };\n\n _this.onOpenChange = function (event) {\n var _assertThisInitialize3 = _assertThisInitialized(_this),\n props = _assertThisInitialize3.props;\n\n var openKeys = _this.store.getState().openKeys.concat();\n\n var changed = false;\n\n var processSingle = function processSingle(e) {\n var oneChanged = false;\n\n if (e.open) {\n oneChanged = openKeys.indexOf(e.key) === -1;\n\n if (oneChanged) {\n openKeys.push(e.key);\n }\n } else {\n var index = openKeys.indexOf(e.key);\n oneChanged = index !== -1;\n\n if (oneChanged) {\n openKeys.splice(index, 1);\n }\n }\n\n changed = changed || oneChanged;\n };\n\n if (Array.isArray(event)) {\n // batch change call\n event.forEach(processSingle);\n } else {\n processSingle(event);\n }\n\n if (changed) {\n if (!('openKeys' in _this.props)) {\n _this.store.setState({\n openKeys: openKeys\n });\n }\n\n props.onOpenChange(openKeys);\n }\n };\n\n _this.onDeselect = function (selectInfo) {\n var _assertThisInitialize4 = _assertThisInitialized(_this),\n props = _assertThisInitialize4.props;\n\n if (props.selectable) {\n var _selectedKeys2 = _this.store.getState().selectedKeys.concat();\n\n var selectedKey = selectInfo.key;\n\n var index = _selectedKeys2.indexOf(selectedKey);\n\n if (index !== -1) {\n _selectedKeys2.splice(index, 1);\n }\n\n if (!('selectedKeys' in props)) {\n _this.store.setState({\n selectedKeys: _selectedKeys2\n });\n }\n\n props.onDeselect(_objectSpread(_objectSpread({}, selectInfo), {}, {\n selectedKeys: _selectedKeys2\n }));\n }\n }; // Restore vertical mode when menu is collapsed responsively when mounted\n // https://github.com/ant-design/ant-design/issues/13104\n // TODO: not a perfect solution,\n // looking a new way to avoid setting switchingModeFromInline in this situation\n\n\n _this.onMouseEnter = function (e) {\n _this.restoreModeVerticalFromInline();\n\n var onMouseEnter = _this.props.onMouseEnter;\n\n if (onMouseEnter) {\n onMouseEnter(e);\n }\n };\n\n _this.onTransitionEnd = function (e) {\n // when inlineCollapsed menu width animation finished\n // https://github.com/ant-design/ant-design/issues/12864\n var widthCollapsed = e.propertyName === 'width' && e.target === e.currentTarget; // Fix SVGElement e.target.className.indexOf is not a function\n // https://github.com/ant-design/ant-design/issues/15699\n\n var className = e.target.className; // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal,\n // unless during an animation.\n\n var classNameValue = Object.prototype.toString.call(className) === '[object SVGAnimatedString]' ? className.animVal : className; // Fix for <Menu style={{ width: '100%' }} />,\n // the width transition won't trigger when menu is collapsed\n // https://github.com/ant-design/ant-design-pro/issues/2783\n\n var iconScaled = e.propertyName === 'font-size' && classNameValue.indexOf('anticon') >= 0;\n\n if (widthCollapsed || iconScaled) {\n _this.restoreModeVerticalFromInline();\n }\n };\n\n _this.setInnerMenu = function (node) {\n _this.innerMenu = node;\n };\n\n _this.isRootMenu = true;\n var selectedKeys = props.defaultSelectedKeys;\n var openKeys = props.defaultOpenKeys;\n\n if ('selectedKeys' in props) {\n selectedKeys = props.selectedKeys || [];\n }\n\n if ('openKeys' in props) {\n openKeys = props.openKeys || [];\n }\n\n _this.store = create({\n selectedKeys: selectedKeys,\n openKeys: openKeys,\n activeKey: {\n '0-menu-': getActiveKey(props, props.activeKey)\n }\n });\n _this.state = {\n switchingModeFromInline: false,\n prevProps: props,\n inlineOpenKeys: [],\n store: _this.store\n };\n return _this;\n }\n\n _createClass(Menu, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateMiniStore();\n this.updateMenuDisplay();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props = this.props,\n siderCollapsed = _this$props.siderCollapsed,\n inlineCollapsed = _this$props.inlineCollapsed,\n onOpenChange = _this$props.onOpenChange;\n\n if (!prevProps.inlineCollapsed && inlineCollapsed || !prevProps.siderCollapsed && siderCollapsed) {\n onOpenChange([]);\n }\n\n this.updateMiniStore();\n this.updateMenuDisplay();\n }\n }, {\n key: \"updateMenuDisplay\",\n value: function updateMenuDisplay() {\n var collapsedWidth = this.props.collapsedWidth,\n store = this.store,\n prevOpenKeys = this.prevOpenKeys; // https://github.com/ant-design/ant-design/issues/8587\n\n var hideMenu = this.getInlineCollapsed() && (collapsedWidth === 0 || collapsedWidth === '0' || collapsedWidth === '0px');\n\n if (hideMenu) {\n this.prevOpenKeys = store.getState().openKeys.concat();\n this.store.setState({\n openKeys: []\n });\n } else if (prevOpenKeys) {\n this.store.setState({\n openKeys: prevOpenKeys\n });\n this.prevOpenKeys = null;\n }\n }\n }, {\n key: \"getRealMenuMode\",\n value: function getRealMenuMode() {\n var mode = this.props.mode;\n var switchingModeFromInline = this.state.switchingModeFromInline;\n var inlineCollapsed = this.getInlineCollapsed();\n\n if (switchingModeFromInline && inlineCollapsed) {\n return 'inline';\n }\n\n return inlineCollapsed ? 'vertical' : mode;\n }\n }, {\n key: \"getInlineCollapsed\",\n value: function getInlineCollapsed() {\n var _this$props2 = this.props,\n inlineCollapsed = _this$props2.inlineCollapsed,\n siderCollapsed = _this$props2.siderCollapsed;\n\n if (siderCollapsed !== undefined) {\n return siderCollapsed;\n }\n\n return inlineCollapsed;\n }\n }, {\n key: \"restoreModeVerticalFromInline\",\n value: function restoreModeVerticalFromInline() {\n var switchingModeFromInline = this.state.switchingModeFromInline;\n\n if (switchingModeFromInline) {\n this.setState({\n switchingModeFromInline: false\n });\n }\n }\n }, {\n key: \"updateMiniStore\",\n value: function updateMiniStore() {\n if ('selectedKeys' in this.props) {\n this.store.setState({\n selectedKeys: this.props.selectedKeys || []\n });\n }\n\n if ('openKeys' in this.props) {\n this.store.setState({\n openKeys: this.props.openKeys || []\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var props = _objectSpread({}, omit(this.props, ['collapsedWidth', 'siderCollapsed', 'defaultMotions']));\n\n var mode = this.getRealMenuMode();\n props.className += \" \".concat(props.prefixCls, \"-root\");\n\n if (props.direction === 'rtl') {\n props.className += \" \".concat(props.prefixCls, \"-rtl\");\n }\n\n props = _objectSpread(_objectSpread({}, props), {}, {\n mode: mode,\n onClick: this.onClick,\n onOpenChange: this.onOpenChange,\n onDeselect: this.onDeselect,\n onSelect: this.onSelect,\n onMouseEnter: this.onMouseEnter,\n onTransitionEnd: this.onTransitionEnd,\n parentMenu: this,\n motion: getMotion(this.props, this.state, mode)\n });\n delete props.openAnimation;\n delete props.openTransitionName;\n return React.createElement(Provider, {\n store: this.store\n }, React.createElement(SubPopupMenu, Object.assign({}, props, {\n ref: this.setInnerMenu\n }), this.props.children));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var prevProps = prevState.prevProps,\n store = prevState.store;\n var prevStoreState = store.getState();\n var newStoreState = {};\n var newState = {\n prevProps: nextProps\n };\n\n if (prevProps.mode === 'inline' && nextProps.mode !== 'inline') {\n newState.switchingModeFromInline = true;\n }\n\n if ('openKeys' in nextProps) {\n newStoreState.openKeys = nextProps.openKeys;\n } else {\n // [Legacy] Old code will return after `openKeys` changed.\n // Not sure the reason, we should keep this logic still.\n if (nextProps.inlineCollapsed && !prevProps.inlineCollapsed || nextProps.siderCollapsed && !prevProps.siderCollapsed) {\n newState.switchingModeFromInline = true;\n newState.inlineOpenKeys = prevStoreState.openKeys;\n newStoreState.openKeys = [];\n }\n\n if (!nextProps.inlineCollapsed && prevProps.inlineCollapsed || !nextProps.siderCollapsed && prevProps.siderCollapsed) {\n newStoreState.openKeys = prevState.inlineOpenKeys;\n newState.inlineOpenKeys = [];\n }\n }\n\n if (Object.keys(newStoreState).length) {\n store.setState(newStoreState);\n }\n\n return newState;\n }\n }]);\n\n return Menu;\n}(React.Component);\n\nMenu.defaultProps = {\n selectable: true,\n onClick: noop,\n onSelect: noop,\n onOpenChange: noop,\n onDeselect: noop,\n defaultSelectedKeys: [],\n defaultOpenKeys: [],\n subMenuOpenDelay: 0.1,\n subMenuCloseDelay: 0.1,\n triggerSubMenuAction: 'hover',\n prefixCls: 'rc-menu',\n className: '',\n mode: 'vertical',\n style: {},\n builtinPlacements: {},\n overflowedIndicator: React.createElement(\"span\", null, \"\\xB7\\xB7\\xB7\")\n};\nexport default Menu;"]},"metadata":{},"sourceType":"module"}