katoikia-app/web-ui/web-react/node_modules/.cache/babel-loader/0ee716112b71bcbfa04b128f34c...

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: item.target,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 17\n }\n }, content);\n }\n };\n\n var items = props.items && props.items.map(function (item, i) {\n var active = activeIndex === i;\n var styleClass = classNames(item.badgeStyleClass, {\n 'layout-menuitem-category': props.root,\n 'active-menuitem': active && !item.to\n });\n\n if (props.root) {\n return /*#__PURE__*/React.createElement(\"li\", {\n className: styleClass,\n key: i,\n role: \"none\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 17\n }\n }, props.root === true && /*#__PURE__*/React.createElement(React.Fragment, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 45\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"layout-menuitem-root-text\",\n \"aria-label\": item.label,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 25\n }\n }, item.label), /*#__PURE__*/React.createElement(AppSubmenu, {\n items: item.items,\n onMenuItemClick: props.onMenuItemClick,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 25\n }\n })));\n } else {\n return /*#__PURE__*/React.createElement(\"li\", {\n className: styleClass,\n key: i,\n role: \"none\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 17\n }\n }, renderLink(item, i), /*#__PURE__*/React.createElement(CSSTransition, {\n classNames: \"layout-submenu-wrapper\",\n timeout: {\n enter: 1000,\n exit: 450\n },\n in: active,\n unmountOnExit: true,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 21\n }\n }, /*#__PURE__*/React.createElement(AppSubmenu, {\n items: item.items,\n onMenuItemClick: props.onMenuItemClick,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 25\n }\n })));\n }\n });\n return items ? /*#__PURE__*/React.createElement(\"ul\", {\n className: props.className,\n role: \"menu\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 104,\n columnNumber: 20\n }\n }, items) : null;\n};\n\nexport var AppMenu = function AppMenu(props) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"layout-menu-container\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(AppSubmenu, {\n items: props.model,\n className: \"layout-menu\",\n onMenuItemClick: props.onMenuItemClick,\n root: true,\n role: \"menu\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }\n }), /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://www.primefaces.org/primeblocks-react\",\n className: \"block mt-3\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"img\", {\n alt: \"primeblocks\",\n className: \"w-full\",\n src: props.layoutColorMode === 'light' ? 'assets/layout/images/banner-primeblocks.png' : 'assets/layout/images/banner-primeblocks-dark.png',\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 17\n }\n })));\n};","map":{"version":3,"names":["React","useState","NavLink","CSSTransition","classNames","Ripple","Badge","AppSubmenu","props","activeIndex","setActiveIndex","onMenuItemClick","event","item","index","disabled","preventDefault","command","originalEvent","onKeyDown","code","target","click","renderLinkContent","submenuIcon","items","badge","icon","label","renderLink","i","content","to","e","url","map","active","styleClass","badgeStyleClass","root","enter","exit","className","AppMenu","model","layoutColorMode"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/AppMenu.js"],"sourcesContent":["import 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\nconst AppSubmenu = (props) => {\n\n const [activeIndex, setActiveIndex] = useState(null)\n\n const onMenuItemClick = (event, item, index) => {\n //avoid processing disabled items\n if (item.disabled) {\n event.preventDefault();\n return true;\n }\n\n //execute command\n if (item.command) {\n item.command({ originalEvent: event, item: item });\n }\n\n if (index === activeIndex)\n setActiveIndex(null);\n else\n setActiveIndex(index);\n\n if (props.onMenuItemClick) {\n props.onMenuItemClick({\n originalEvent: event,\n item: item\n });\n }\n }\n\n const onKeyDown = (event) => {\n if (event.code === 'Enter' || event.code === 'Space'){\n event.preventDefault();\n event.target.click();\n }\n }\n\n const renderLinkContent = (item) => {\n let submenuIcon = item.items && <i className=\"pi pi-fw pi-angle-down menuitem-toggle-icon\"></i>;\n let badge = item.badge && <Badge value={item.badge} />\n\n return (\n <React.Fragment>\n <i className={item.icon}></i>\n <span>{item.label}</span>\n {submenuIcon}\n {badge}\n <Ripple/>\n </React.Fragment>\n );\n }\n\n const renderLink = (item, i) => {\n let content = renderLinkContent(item);\n\n if (item.to) {\n return (\n <NavLink aria-label={item.label} onKeyDown={onKeyDown} role=\"menuitem\" className=\"p-ripple\" activeClassName=\"router-link-active router-link-exact-active\" to={item.to} onClick={(e) => onMenuItemClick(e, item, i)} exact target={item.target}>\n {content}\n </NavLink>\n )\n }\n else {\n return (\n <a tabIndex=\"0\" aria-label={item.label} onKeyDown={onKeyDown} role=\"menuitem\" href={item.url} className=\"p-ripple\" onClick={(e) => onMenuItemClick(e, item, i)} target={item.target}>\n {content}\n </a>\n );\n }\n }\n\n let items = props.items && props.items.map((item, i) => {\n let active = activeIndex === i;\n let styleClass = classNames(item.badgeStyleClass, {'layout-menuitem-category': props.root, 'active-menuitem': active && !item.to });\n\n if(props.root) {\n return (\n <li className={styleClass} key={i} role=\"none\">\n {props.root === true && <React.Fragment>\n <div className=\"layout-menuitem-root-text\" aria-label={item.label}>{item.label}</div>\n <AppSubmenu items={item.items} onMenuItemClick={props.onMenuItemClick} />\n </React.Fragment>}\n </li>\n );\n }\n else {\n return (\n <li className={styleClass} key={i} role=\"none\">\n {renderLink(item, i)}\n <CSSTransition classNames=\"layout-submenu-wrapper\" timeout={{ enter: 1000, exit: 450 }} in={active} unmountOnExit>\n <AppSubmenu items={item.items} onMenuItemClick={props.onMenuItemClick} />\n </CSSTransition>\n </li>\n );\n }\n });\n\n return items ? <ul className={props.className} role=\"menu\">{items}</ul> : null;\n}\n\nexport const AppMenu = (props) => {\n\n return (\n <div className=\"layout-menu-container\">\n <AppSubmenu items={props.model} className=\"layout-menu\" onMenuItemClick={props.onMenuItemClick} root={true} role=\"menu\" />\n <a href=\"https://www.primefaces.org/primeblocks-react\" className=\"block mt-3\">\n <img alt=\"primeblocks\" className=\"w-full\"\n src={props.layoutColorMode === 'light' ? 'assets/layout/images/banner-primeblocks.png' : 'assets/layout/images/banner-primeblocks-dark.png'}/>\n </a>\n </div>\n );\n}\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,aAAT,QAA8B,wBAA9B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,MAAR,QAAqB,mBAArB;AACA,SAASC,KAAT,QAAsB,kBAAtB;;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAW;EAE1B,gBAAsCP,QAAQ,CAAC,IAAD,CAA9C;EAAA;EAAA,IAAOQ,WAAP;EAAA,IAAoBC,cAApB;;EAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAQC,IAAR,EAAcC,KAAd,EAAwB;IAC5C;IACA,IAAID,IAAI,CAACE,QAAT,EAAmB;MACfH,KAAK,CAACI,cAAN;MACA,OAAO,IAAP;IACH,CAL2C,CAO5C;;;IACA,IAAIH,IAAI,CAACI,OAAT,EAAkB;MACdJ,IAAI,CAACI,OAAL,CAAa;QAAEC,aAAa,EAAEN,KAAjB;QAAwBC,IAAI,EAAEA;MAA9B,CAAb;IACH;;IAED,IAAIC,KAAK,KAAKL,WAAd,EACIC,cAAc,CAAC,IAAD,CAAd,CADJ,KAGIA,cAAc,CAACI,KAAD,CAAd;;IAEJ,IAAIN,KAAK,CAACG,eAAV,EAA2B;MACvBH,KAAK,CAACG,eAAN,CAAsB;QAClBO,aAAa,EAAEN,KADG;QAElBC,IAAI,EAAEA;MAFY,CAAtB;IAIH;EACJ,CAvBD;;EAyBA,IAAMM,SAAS,GAAG,SAAZA,SAAY,CAACP,KAAD,EAAW;IACzB,IAAIA,KAAK,CAACQ,IAAN,KAAe,OAAf,IAA0BR,KAAK,CAACQ,IAAN,KAA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