1 line
32 KiB
JSON
1 line
32 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/ListDemo.js\";\n\nimport React, { useState, useEffect } from 'react';\nimport { DataView, DataViewLayoutOptions } from 'primereact/dataview';\nimport { Button } from 'primereact/button';\nimport { Dropdown } from 'primereact/dropdown';\nimport { Rating } from 'primereact/rating';\nimport { PickList } from 'primereact/picklist';\nimport { OrderList } from 'primereact/orderlist';\nimport { ProductService } from '../service/ProductService';\n\nvar ListDemo = function ListDemo() {\n var listValue = [{\n name: 'San Francisco',\n code: 'SF'\n }, {\n name: 'London',\n code: 'LDN'\n }, {\n name: 'Paris',\n code: 'PRS'\n }, {\n name: 'Istanbul',\n code: 'IST'\n }, {\n name: 'Berlin',\n code: 'BRL'\n }, {\n name: 'Barcelona',\n code: 'BRC'\n }, {\n name: 'Rome',\n code: 'RM'\n }];\n\n var _useState = useState(listValue),\n _useState2 = _slicedToArray(_useState, 2),\n picklistSourceValue = _useState2[0],\n setPicklistSourceValue = _useState2[1];\n\n var _useState3 = useState([]),\n _useState4 = _slicedToArray(_useState3, 2),\n picklistTargetValue = _useState4[0],\n setPicklistTargetValue = _useState4[1];\n\n var _useState5 = useState(listValue),\n _useState6 = _slicedToArray(_useState5, 2),\n orderlistValue = _useState6[0],\n setOrderlistValue = _useState6[1];\n\n var _useState7 = useState(null),\n _useState8 = _slicedToArray(_useState7, 2),\n dataviewValue = _useState8[0],\n setDataviewValue = _useState8[1];\n\n var _useState9 = useState('grid'),\n _useState10 = _slicedToArray(_useState9, 2),\n layout = _useState10[0],\n setLayout = _useState10[1];\n\n var _useState11 = useState(null),\n _useState12 = _slicedToArray(_useState11, 2),\n sortKey = _useState12[0],\n setSortKey = _useState12[1];\n\n var _useState13 = useState(null),\n _useState14 = _slicedToArray(_useState13, 2),\n sortOrder = _useState14[0],\n setSortOrder = _useState14[1];\n\n var _useState15 = useState(null),\n _useState16 = _slicedToArray(_useState15, 2),\n sortField = _useState16[0],\n setSortField = _useState16[1];\n\n var sortOptions = [{\n label: 'Price High to Low',\n value: '!price'\n }, {\n label: 'Price Low to High',\n value: 'price'\n }];\n useEffect(function () {\n var productService = new ProductService();\n productService.getProducts().then(function (data) {\n return setDataviewValue(data);\n });\n }, []);\n\n var onSortChange = function onSortChange(event) {\n var value = event.value;\n\n if (value.indexOf('!') === 0) {\n setSortOrder(-1);\n setSortField(value.substring(1, value.length));\n setSortKey(value);\n } else {\n setSortOrder(1);\n setSortField(value);\n setSortKey(value);\n }\n };\n\n var dataviewHeader = /*#__PURE__*/React.createElement(\"div\", {\n className: \"grid grid-nogutter\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-6\",\n style: {\n textAlign: 'left'\n },\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(Dropdown, {\n value: sortKey,\n options: sortOptions,\n optionLabel: \"label\",\n placeholder: \"Sort By Price\",\n onChange: onSortChange,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 17\n }\n })), /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-6\",\n style: {\n
|