07642dddc01509ee59a67eca146eb17f.json 11.2 KB
Newer Older
1
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\reportForm\\\\assign\\\\Assign.js\",\n    _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport \"./assign.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Assign = () => {\n  _s();\n\n  const [appState, changeState] = useState({\n    activeObjects: null,\n    rootDirectoryObjects: [{\n      id: \"Personal projects\"\n    }, {\n      id: \"Shared projects\"\n    }],\n    SubDirectoryObjects: [{\n      personalProjectObjects: {\n        id: \"MyApp\",\n        type: \"personal\",\n        id: \"MyOtherApp\",\n        type: \"personal\"\n      }\n    }, {\n      sharedProjectObjects: {\n        id: \"ReactApp\",\n        type: \"shared\",\n        id: \"Very big ReactApp\",\n        type: \"shared\"\n      }\n    }]\n  });\n\n  const toggleActive = (directory, index) => {\n    if (directory[index] === appState.activeObjects) {\n      changeState({ ...appState,\n        activeObjects: null\n      });\n    } else {\n      changeState({ ...appState,\n        activeObjects: directory[index]\n      });\n    }\n  };\n\n  const toggleActiveStyles = (directory, index) => {\n    if (directory[index] === appState.activeObjects) {\n      return \"active\";\n    } else return \"inactive\";\n  };\n\n  const RootDirectoryItems = (parentDirectories, childDirectories) => {\n    return /*#__PURE__*/_jsxDEV(\"ul\", {\n      className: \"rootDirectory\",\n      children: parentDirectories.map((elements, index) => /*#__PURE__*/_jsxDEV(\"li\", {\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: toggleActiveStyles(parentDirectories, index),\n          onClick: () => {\n            toggleActive(parentDirectories, index);\n          },\n          children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"folder\",\n            className: \"folder-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 36,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", parentDirectories[index].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 37,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"chevron-right\",\n            className: \"arrow-right-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 38,\n            columnNumber: 15\n          }, this)]\n        }, index, true, {\n          fileName: _jsxFileName,\n          lineNumber: 35,\n          columnNumber: 13\n        }, this), parentDirectories[index] === appState.activeObjects ? console.log(childDirectories[0]) : null]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 34,\n        columnNumber: 11\n      }, this))\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 32,\n      columnNumber: 7\n    }, this);\n  };\n\n  const SubDirectoryItems = directory => {\n    return /*#__PURE__*/_jsxDEV(\"ul\", {\n      className: \"projectListDirectory\",\n      children: directory.map((elements, index) => /*#__PURE__*/_jsxDEV(\"li\", {\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: toggleActiveStyles(directory, index),\n          onClick: () => {\n            toggleActive(directory, index);\n          },\n          children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"folder\",\n            className: \"folder-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 57,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n            children: [\"\\xA0 \", directory[index].id, \" \\xA0\"]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 58,\n            columnNumber: 15\n          }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n            icon: \"chevron-right\",\n            className: \"arrow-right-icon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 59,\n            columnNumber: 15\n          }, this)]\n        }, index, true, {\n          fileName: _jsxFileName,\n          lineNumber: 56,\n          columnNumber: 13\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 55,\n        columnNumber: 11\n      }, this))\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 53,\n      columnNumber: 7\n    }, this);\n  };\n\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"assignSelectContainer\",\n    children: RootDirectoryItems(appState.rootDirectoryObjects, appState.SubDirectoryObjects)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 68,\n    columnNumber: 5\n  }, this);\n};\n\n_s(Assign, \"Qm44hRlidRqEH8YJhLTl1myXtWo=\");\n\n_c = Assign;\nexport default Assign;\n\nvar _c;\n\n$RefreshReg$(_c, \"Assign\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/reportForm/assign/Assign.js"],"names":["React","useState","FontAwesomeIcon","Assign","appState","changeState","activeObjects","rootDirectoryObjects","id","SubDirectoryObjects","personalProjectObjects","type","sharedProjectObjects","toggleActive","directory","index","toggleActiveStyles","RootDirectoryItems","parentDirectories","childDirectories","map","elements","console","log","SubDirectoryItems"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0BJ,QAAQ,CAAC;AACvCK,IAAAA,aAAa,EAAE,IADwB;AAEvCC,IAAAA,oBAAoB,EAAE,CAAC;AAAEC,MAAAA,EAAE,EAAE;AAAN,KAAD,EAA8B;AAAEA,MAAAA,EAAE,EAAE;AAAN,KAA9B,CAFiB;AAGvCC,IAAAA,mBAAmB,EAAE,CACnB;AAAEC,MAAAA,sBAAsB,EAAE;AAAEF,QAAAA,EAAE,EAAE,OAAN;AAAeG,QAAAA,IAAI,EAAE,UAArB;AAAiCH,QAAAA,EA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kBAHF;AAAA,WAAUO,KAAV;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cADD;AADH;AAAA;AAAA;AAAA;AAAA,YADF;AAaD,GAdD;;AAgBA,sBACE;AAAK,IAAA,SAAS,EAAC,uBAAf;AAAA,cACGE,kBAAkB,CAACb,QAAQ,CAACG,oBAAV,EAAgCH,QAAQ,CAACK,mBAAzC;AADrB;AAAA;AAAA;AAAA;AAAA,UADF;AAKD,CAnED;;GAAMN,M;;KAAAA,M;AAqEN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport \"./assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n  const [appState, changeState] = useState({\r\n    activeObjects: null,\r\n    rootDirectoryObjects: [{ id: \"Personal projects\" }, { id: \"Shared projects\" }],\r\n    SubDirectoryObjects: [\r\n      { personalProjectObjects: { id: \"MyApp\", type: \"personal\", id: \"MyOtherApp\", type: \"personal\" } },\r\n      { sharedProjectObjects: { id: \"ReactApp\", type: \"shared\", id: \"Very big ReactApp\", type: \"shared\" } }\r\n    ],\r\n  })\r\n\r\n  const toggleActive = (directory, index) => {\r\n    if (directory[index] === appState.activeObjects) {\r\n      changeState({ ...appState, activeObjects: null })\r\n    }\r\n    else {\r\n      changeState({ ...appState, activeObjects: (directory[index]) })\r\n    }\r\n  }\r\n\r\n  const toggleActiveStyles = (directory, index) => {\r\n    if (directory[index] === appState.activeObjects) {\r\n      return \"active\"\r\n    } else return \"inactive\"\r\n  }\r\n\r\n  const RootDirectoryItems = (parentDirectories, childDirectories) => {\r\n    return (\r\n      < ul className=\"rootDirectory\" >\r\n        {parentDirectories.map((elements, index) => (\r\n          <li>\r\n            <div key={index} className={toggleActiveStyles(parentDirectories, index)} onClick={() => { toggleActive(parentDirectories, index) }} >\r\n              <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n              <a>&nbsp; {parentDirectories[index].id} &nbsp;</a>\r\n              <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n            </div>\r\n            {\r\n              parentDirectories[index] === appState.activeObjects ?\r\n                console.log(childDirectories[0]) :\r\n                null\r\n            }\r\n          </li>\r\n        ))}\r\n      </ul >\r\n    )\r\n  }\r\n\r\n  const SubDirectoryItems = (directory) => {\r\n    return (\r\n      <ul className=\"projectListDirectory\">\r\n        {directory.map((elements, index) => (\r\n          <li>\r\n            <div key={index} className={toggleActiveStyles(directory, index)} onClick={() => { toggleActive(directory, index) }} >\r\n              <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n              <a>&nbsp; {directory[index].id} &nbsp;</a>\r\n              <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n            </div>\r\n          </li>\r\n        ))}\r\n      </ul >\r\n    )\r\n  }\r\n\r\n  return (\r\n    <div className=\"assignSelectContainer\">\r\n      {RootDirectoryItems(appState.rootDirectoryObjects, appState.SubDirectoryObjects)}\r\n    </div >\r\n  )\r\n}\r\n\r\nexport default Assign"]},"metadata":{},"sourceType":"module"}