PromoCursed/node_modules/.cache/babel-loader/4f800adc755331ac79aa7781aa24609a400a93a9cff297ca225ba9f8bae79589.json

1 line
5.7 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import Menu, { MenuItem } from 'rc-menu';\nimport * as React from 'react';\nimport MentionsContext from \"./MentionsContext\";\n/**\n * We only use Menu to display the candidate.\n * The focus is controlled by textarea to make accessibility easy.\n */\nfunction DropdownMenu(props) {\n var _React$useContext = React.useContext(MentionsContext),\n notFoundContent = _React$useContext.notFoundContent,\n activeIndex = _React$useContext.activeIndex,\n setActiveIndex = _React$useContext.setActiveIndex,\n selectOption = _React$useContext.selectOption,\n onFocus = _React$useContext.onFocus,\n onBlur = _React$useContext.onBlur;\n var prefixCls = props.prefixCls,\n options = props.options;\n var activeOption = options[activeIndex] || {};\n return /*#__PURE__*/React.createElement(Menu, {\n prefixCls: \"\".concat(prefixCls, \"-menu\"),\n activeKey: activeOption.key,\n onSelect: function onSelect(_ref) {\n var key = _ref.key;\n var option = options.find(function (_ref2) {\n var optionKey = _ref2.key;\n return optionKey === key;\n });\n selectOption(option);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }, options.map(function (option, index) {\n var key = option.key,\n disabled = option.disabled,\n className = option.className,\n style = option.style,\n label = option.label;\n return /*#__PURE__*/React.createElement(MenuItem, {\n key: key,\n disabled: disabled,\n className: className,\n style: style,\n onMouseEnter: function onMouseEnter() {\n setActiveIndex(index);\n }\n }, label);\n }), !options.length && /*#__PURE__*/React.createElement(MenuItem, {\n disabled: true\n }, notFoundContent));\n}\nexport default DropdownMenu;","map":{"version":3,"names":["Menu","MenuItem","React","MentionsContext","DropdownMenu","props","_React$useContext","useContext","notFoundContent","activeIndex","setActiveIndex","selectOption","onFocus","onBlur","prefixCls","options","activeOption","createElement","concat","activeKey","key","onSelect","_ref","option","find","_ref2","optionKey","map","index","disabled","className","style","label","onMouseEnter","length"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-mentions/es/DropdownMenu.js"],"sourcesContent":["import Menu, { MenuItem } from 'rc-menu';\nimport * as React from 'react';\nimport MentionsContext from \"./MentionsContext\";\n/**\n * We only use Menu to display the candidate.\n * The focus is controlled by textarea to make accessibility easy.\n */\nfunction DropdownMenu(props) {\n var _React$useContext = React.useContext(MentionsContext),\n notFoundContent = _React$useContext.notFoundContent,\n activeIndex = _React$useContext.activeIndex,\n setActiveIndex = _React$useContext.setActiveIndex,\n selectOption = _React$useContext.selectOption,\n onFocus = _React$useContext.onFocus,\n onBlur = _React$useContext.onBlur;\n var prefixCls = props.prefixCls,\n options = props.options;\n var activeOption = options[activeIndex] || {};\n return /*#__PURE__*/React.createElement(Menu, {\n prefixCls: \"\".concat(prefixCls, \"-menu\"),\n activeKey: activeOption.key,\n onSelect: function onSelect(_ref) {\n var key = _ref.key;\n var option = options.find(function (_ref2) {\n var optionKey = _ref2.key;\n return optionKey === key;\n });\n selectOption(option);\n },\n onFocus: onFocus,\n onBlur: onBlur\n }, options.map(function (option, index) {\n var key = option.key,\n disabled = option.disabled,\n className = option.className,\n style = option.style,\n label = option.label;\n return /*#__PURE__*/React.createElement(MenuItem, {\n key: key,\n disabled: disabled,\n className: className,\n style: style,\n onMouseEnter: function onMouseEnter() {\n setActiveIndex(index);\n }\n }, label);\n }), !options.length && /*#__PURE__*/React.createElement(MenuItem, {\n disabled: true\n }, notFound