1 line
9.3 KiB
JSON
1 line
9.3 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/components/TreeDemo.js\";\n\nimport React, { useState, useEffect } from 'react';\nimport { Tree } from 'primereact/tree';\nimport { TreeTable } from 'primereact/treetable';\nimport { Column } from 'primereact/column';\nimport { NodeService } from '../service/NodeService';\n\nvar TreeDemo = function TreeDemo() {\n var _useState = useState([]),\n _useState2 = _slicedToArray(_useState, 2),\n treeNodes = _useState2[0],\n setTreeNodes = _useState2[1];\n\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n selectedTreeNodeKeys = _useState4[0],\n setSelectedTreeNodeKeys = _useState4[1];\n\n var _useState5 = useState([]),\n _useState6 = _slicedToArray(_useState5, 2),\n treeTableNodes = _useState6[0],\n setTreeTableNodes = _useState6[1];\n\n var _useState7 = useState([]),\n _useState8 = _slicedToArray(_useState7, 2),\n selectedTreeTableNodeKeys = _useState8[0],\n setSelectedTreeTableNodeKeys = _useState8[1];\n\n useEffect(function () {\n var nodeService = new NodeService();\n nodeService.getTreeNodes().then(function (data) {\n return setTreeNodes(data);\n });\n nodeService.getTreeTableNodes().then(function (data) {\n return setTreeTableNodes(data);\n });\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"grid\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 21,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 21\n }\n }, \"Tree\"), /*#__PURE__*/React.createElement(Tree, {\n value: treeNodes,\n selectionMode: \"checkbox\",\n selectionKeys: selectedTreeNodeKeys,\n onSelectionChange: function onSelectionChange(e) {\n return setSelectedTreeNodeKeys(e.value);\n },\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 21\n }\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-12\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"card\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 17\n }\n }, /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 21\n }\n }, \"TreeTable\"), /*#__PURE__*/React.createElement(TreeTable, {\n value: treeTableNodes,\n header: \"FileSystem\",\n selectionMode: \"checkbox\",\n selectionKeys: selectedTreeTableNodeKeys,\n onSelectionChange: function onSelectionChange(e) {\n return setSelectedTreeTableNodeKeys(e.value);\n },\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 21\n }\n }, /*#__PURE__*/React.createElement(Column, {\n field: \"name\",\n header: \"Name\",\n expander: true,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 25\n }\n }), /*#__PURE__*/React.createElement(Column, {\n field: \"size\",\n header: \"Size\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 25\n }\n }), /*#__PURE__*/React.createElement(Column, {\n field: \"type\",\n header: \"Type\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 25\n }\n })))));\n};\n\nvar comparisonFn = function comparisonFn(prevProps, nextProps) {\n return prevProps.location.pathname === nextProps.location.pathname;\n};\n\nexport default React.memo(TreeDemo, comparisonFn);","map":{"version":3,"names":["React","useState","useEffect","Tree","TreeTable","Column","NodeService","TreeDemo","treeNodes","setTreeNodes","selectedTreeNodeKeys","setSelectedTreeNodeKeys","treeTableNodes","setTreeTableNodes","selectedTreeTableNodeKeys","setSelectedTreeTableNodeKeys","nodeService","getTreeNodes","then","data","getTreeTableNodes","e","value","comparisonFn","prevProps","nextProps","location","pathname","memo"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/components/TreeDemo.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Tree } from 'primereact/tree';\nimport { TreeTable } from 'primereact/treetable';\nimport { Column } from 'primereact/column';\nimport { NodeService } from '../service/NodeService';\n\nconst TreeDemo = () => {\n const [treeNodes, setTreeNodes] = useState([]);\n const [selectedTreeNodeKeys, setSelectedTreeNodeKeys] = useState(null);\n const [treeTableNodes, setTreeTableNodes] = useState([]);\n const [selectedTreeTableNodeKeys, setSelectedTreeTableNodeKeys] = useState([]);\n\n useEffect(() => {\n const nodeService = new NodeService();\n nodeService.getTreeNodes().then(data => setTreeNodes(data));\n nodeService.getTreeTableNodes().then(data => setTreeTableNodes(data));\n }, []);\n\n return (\n <div className=\"grid\">\n <div className=\"col-12\">\n <div className=\"card\">\n <h5>Tree</h5>\n <Tree value={treeNodes} selectionMode=\"checkbox\" selectionKeys={selectedTreeNodeKeys} onSelectionChange={(e) => setSelectedTreeNodeKeys(e.value)}/>\n </div>\n </div>\n <div className=\"col-12\">\n <div className=\"card\">\n <h5>TreeTable</h5>\n <TreeTable value={treeTableNodes} header=\"FileSystem\" selectionMode=\"checkbox\" selectionKeys={selectedTreeTableNodeKeys} onSelectionChange={(e) => setSelectedTreeTableNodeKeys(e.value)}>\n <Column field=\"name\" header=\"Name\" expander/>\n <Column field=\"size\" header=\"Size\"/>\n <Column field=\"type\" header=\"Type\"/>\n </TreeTable>\n </div>\n </div>\n </div>\n )\n}\n\nconst comparisonFn = function (prevProps, nextProps) {\n return prevProps.location.pathname === nextProps.location.pathname;\n};\n\nexport default React.memo(TreeDemo, comparisonFn);\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,IAAT,QAAqB,iBAArB;AACA,SAASC,SAAT,QAA0B,sBAA1B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,GAAM;EACnB,gBAAkCN,QAAQ,CAAC,EAAD,CAA1C;EAAA;EAAA,IAAOO,SAAP;EAAA,IAAkBC,YAAlB;;EACA,iBAAwDR,QAAQ,CAAC,IAAD,CAAhE;EAAA;EAAA,IAAOS,oBAAP;EAAA,IAA6BC,uBAA7B;;EACA,iBAA4CV,QAAQ,CAAC,EAAD,CAApD;EAAA;EAAA,IAAOW,cAAP;EAAA,IAAuBC,iBAAvB;;EACA,iBAAkEZ,QAAQ,CAAC,EAAD,CAA1E;EAAA;EAAA,IAAOa,yBAAP;EAAA,IAAkCC,4BAAlC;;EAEAb,SAAS,CAAC,YAAM;IACZ,IAAMc,WAAW,GAAG,IAAIV,WAAJ,EAApB;IACAU,WAAW,CAACC,YAAZ,GAA2BC,IAA3B,CAAgC,UAAAC,IAAI;MAAA,OAAIV,YAAY,CAACU,IAAD,CAAhB;IAAA,CAApC;IACAH,WAAW,CAACI,iBAAZ,GAAgCF,IAAhC,CAAqC,UAAAC,IAAI;MAAA,OAAIN,iBAAiB,CAACM,IAAD,CAArB;IAAA,CAAzC;EACH,CAJQ,EAIN,EAJM,CAAT;EAMA,oBACI;IAAK,SAAS,EAAC,MAAf;IAAA;IAAA;MAAA;MAAA;MAAA;IAAA;EAAA,gBACI;IAAK,SAAS,EAAC,QAAf;I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