1 line
17 KiB
JSON
1 line
17 KiB
JSON
|
{"ast":null,"code":"import _slicedToArray from \"/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\n\nvar _this = this,\n _jsxFileName = \"/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/AppMenu.js\";\n\nimport React, { useState } from 'react';\nimport { NavLink } from 'react-router-dom';\nimport { CSSTransition } from 'react-transition-group';\nimport classNames from 'classnames';\nimport { Ripple } from \"primereact/ripple\";\nimport { Badge } from 'primereact/badge';\n\nvar AppSubmenu = function AppSubmenu(props) {\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n activeIndex = _useState2[0],\n setActiveIndex = _useState2[1];\n\n var onMenuItemClick = function onMenuItemClick(event, item, index) {\n //avoid processing disabled items\n if (item.disabled) {\n event.preventDefault();\n return true;\n } //execute command\n\n\n if (item.command) {\n item.command({\n originalEvent: event,\n item: item\n });\n }\n\n if (index === activeIndex) setActiveIndex(null);else setActiveIndex(index);\n\n if (props.onMenuItemClick) {\n props.onMenuItemClick({\n originalEvent: event,\n item: item\n });\n }\n };\n\n var onKeyDown = function onKeyDown(event) {\n if (event.code === 'Enter' || event.code === 'Space') {\n event.preventDefault();\n event.target.click();\n }\n };\n\n var renderLinkContent = function renderLinkContent(item) {\n var submenuIcon = item.items && /*#__PURE__*/React.createElement(\"i\", {\n className: \"pi pi-fw pi-angle-down menuitem-toggle-icon\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 41\n }\n });\n var badge = item.badge && /*#__PURE__*/React.createElement(Badge, {\n value: item.badge,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 35\n }\n });\n return /*#__PURE__*/React.createElement(React.Fragment, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"i\", {\n className: item.icon,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 17\n }\n }), /*#__PURE__*/React.createElement(\"span\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 17\n }\n }, item.label), submenuIcon, badge, /*#__PURE__*/React.createElement(Ripple, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 17\n }\n }));\n };\n\n var renderLink = function renderLink(item, i) {\n var content = renderLinkContent(item);\n\n if (item.to) {\n return /*#__PURE__*/React.createElement(NavLink, {\n \"aria-label\": item.label,\n onKeyDown: onKeyDown,\n role: \"menuitem\",\n className: \"p-ripple\",\n activeClassName: \"router-link-active router-link-exact-active\",\n to: item.to,\n onClick: function onClick(e) {\n return onMenuItemClick(e, item, i);\n },\n exact: true,\n target: item.target,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }\n }, content);\n } else {\n return /*#__PURE__*/React.createElement(\"a\", {\n tabIndex: \"0\",\n \"aria-label\": item.label,\n onKeyDown: onKeyDown,\n role: \"menuitem\",\n href: item.url,\n className: \"p-ripple\",\n onClick: function onClick(e) {\n return onMenuItemClick(e, item, i);\n },\n target: i
|