{"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/IconsDemo.js\";\n\nimport React, { useEffect, useState } from 'react';\nimport axios from 'axios';\nimport { InputText } from 'primereact/inputtext';\nimport { CodeHighlight } from './CodeHighlight';\n\nvar IconsDemo = function IconsDemo() {\n var _useState = useState([]),\n _useState2 = _slicedToArray(_useState, 2),\n icons = _useState2[0],\n setIcons = _useState2[1];\n\n var _useState3 = useState([]),\n _useState4 = _slicedToArray(_useState3, 2),\n filteredIcons = _useState4[0],\n setFilteredIcons = _useState4[1];\n\n useEffect(function () {\n axios.get('assets/demo/data/icons.json').then(function (res) {\n var icons = res.data.icons;\n icons.sort(function (icon1, icon2) {\n if (icon1.properties.name < icon2.properties.name) return -1;else if (icon1.properties.name < icon2.properties.name) return 1;else return 0;\n });\n setIcons(icons);\n setFilteredIcons(icons);\n });\n }, []);\n\n var onFilter = function onFilter(event) {\n if (!event.target.value) {\n setFilteredIcons(icons);\n } else {\n setFilteredIcons(icons.filter(function (it) {\n return it.icon.tags[0].includes(event.target.value);\n }));\n }\n };\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"card docs\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 9\n }\n }, /*#__PURE__*/React.createElement(\"h4\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 13\n }\n }, \"Icons\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 13\n }\n }, \"PrimeReact components internally use \", /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://github.com/primefaces/primeicons\",\n className: \"font-medium\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 53\n }\n }, \"PrimeIcons\"), \" library, the official icons suite from \", /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://www.primetek.com.tr\",\n className: \"font-medium\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 182\n }\n }, \"PrimeTek\"), \".\"), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 13\n }\n }, \"Download\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }\n }, \"PrimeIcons is available at npm, run the following command to download it to your project.\"), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 1\n }\n }, \"\\nnpm install primeicons --save\\n\"), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 13\n }\n }, \"Getting Started\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 13\n }\n }, \"PrimeIcons use the \", /*#__PURE__*/React.createElement(\"strong\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 35\n }\n }, \"pi pi-{icon}\"), \" syntax such as \", /*#__PURE__*/React.createElement(\"strong\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 90\n }\n }, \"pi pi-check\"), \". A standalone icon can be displayed using an element like \", /*#__PURE__*/React.createElement(\"i\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 70\n }\n }, \"i\"), \" or \", /*#__PURE__*/React.createElement(\"i\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 82\n }\n }, \"span\")), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 1\n }\n }, \"\\n\\n\\n\"), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }\n }, \"Size\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }\n }, \"Size of the icons can easily be changed using font-size property.\"), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 1\n }\n }, \"\\n\\n\"), /*#__PURE__*/React.createElement(\"i\", {\n className: \"pi pi-check\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 13\n }\n }), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 1\n }\n }, \"\\n\\n\"), /*#__PURE__*/React.createElement(\"i\", {\n className: \"pi pi-check\",\n style: {\n fontSize: '2rem'\n },\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 13\n }\n }), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 13\n }\n }, \"Spinning Animation\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 13\n }\n }, \"Special pi-spin class applies continuous rotation to an icon.\"), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 1\n }\n }, \"\\n\\n\"), /*#__PURE__*/React.createElement(\"i\", {\n className: \"pi pi-spin pi-spinner\",\n style: {\n fontSize: '2rem'\n },\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 13\n }\n }), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 13\n }\n }, \"Constants\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 13\n }\n }, \"PrimeIcons constants API is provided to easily choose an icon with typescript e.g. when defining a menu model.\"), /*#__PURE__*/React.createElement(CodeHighlight, {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 1\n }\n }, \"\\n
\\n\"), /*#__PURE__*/React.createElement(CodeHighlight, {\n lang: \"js\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 1\n }\n }, \"\\nimport {PrimeIcons} from 'primereact/api';\\n\\nconst items = [\\n {\\n label: 'Update',\\n icon: PrimeIcons.REFRESH,\\n to: '/update'\\n },\\n {\\n label: 'Delete',\\n icon: PrimeIcons.TIMES,\\n to: '/delete'\\n }\\n]\\n\"), /*#__PURE__*/React.createElement(\"h5\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 13\n }\n }, \"List of Icons\"), /*#__PURE__*/React.createElement(\"p\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 13\n }\n }, \"Here is the current list of PrimeIcons, more icons are added periodically. You may also \", /*#__PURE__*/React.createElement(\"a\", {\n href: \"https://github.com/primefaces/primeicons/issues\",\n className: \"font-medium\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 104\n }\n }, \"request new icons\"), \" at the issue tracker.\"), /*#__PURE__*/React.createElement(\"div\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 13\n }\n }, /*#__PURE__*/React.createElement(InputText, {\n type: \"text\",\n className: \"w-full p-3 mt-3 mb-5\",\n onInput: onFilter,\n placeholder: \"Search an icon\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 17\n }\n })), /*#__PURE__*/React.createElement(\"div\", {\n className: \"grid icons-list text-center\",\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 13\n }\n }, filteredIcons && filteredIcons.map(function (iconMeta) {\n var icon = iconMeta.icon,\n properties = iconMeta.properties;\n return icon.tags.indexOf('deprecate') === -1 && /*#__PURE__*/React.createElement(\"div\", {\n className: \"col-6 sm:col-4 lg:col-3 xl:col-2 pb-5\",\n key: properties.name,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 128,\n columnNumber: 29\n }\n }, /*#__PURE__*/React.createElement(\"i\", {\n className: \"text-2xl mb-2 pi pi-\" + properties.name,\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 33\n }\n }), /*#__PURE__*/React.createElement(\"div\", {\n __self: _this,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 130,\n columnNumber: 33\n }\n }, \"pi-\", properties.name));\n })));\n};\n\nvar comparisonFn = function comparisonFn(prevProps, nextProps) {\n return prevProps.location.pathname === nextProps.location.pathname;\n};\n\nexport default React.memo(IconsDemo, comparisonFn);","map":{"version":3,"names":["React","useEffect","useState","axios","InputText","CodeHighlight","IconsDemo","icons","setIcons","filteredIcons","setFilteredIcons","get","then","res","data","sort","icon1","icon2","properties","name","onFilter","event","target","value","filter","it","icon","tags","includes","fontSize","map","iconMeta","indexOf","comparisonFn","prevProps","nextProps","location","pathname","memo"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/src/components/IconsDemo.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport axios from 'axios';\nimport { InputText } from 'primereact/inputtext';\nimport { CodeHighlight } from './CodeHighlight';\n\nconst IconsDemo = () => {\n const [icons, setIcons] = useState([]);\n const [filteredIcons, setFilteredIcons] = useState([]);\n\n useEffect(() => {\n axios.get('assets/demo/data/icons.json').then(res => {\n let icons = res.data.icons;\n icons.sort((icon1, icon2) => {\n if (icon1.properties.name < icon2.properties.name)\n return -1;\n else if (icon1.properties.name < icon2.properties.name)\n return 1;\n else\n return 0;\n });\n\n setIcons(icons);\n setFilteredIcons(icons);\n });\n }, []);\n\n const onFilter = (event) => {\n if (!event.target.value) {\n setFilteredIcons(icons);\n }\n else {\n setFilteredIcons(icons.filter( it => {\n return it.icon.tags[0].includes(event.target.value);\n }));\n }\n }\n\n return (\nPrimeReact components internally use PrimeIcons library, the official icons suite from PrimeTek.
\n\nPrimeIcons is available at npm, run the following command to download it to your project.
\nPrimeIcons use the pi pi-{icon} syntax such as pi pi-check.\n A standalone icon can be displayed using an element like i or span
\n\nSize of the icons can easily be changed using font-size property.
\n\nSpecial pi-spin class applies continuous rotation to an icon.
\nPrimeIcons constants API is provided to easily choose an icon with typescript e.g. when defining a menu model.
\nHere is the current list of PrimeIcons, more icons are added periodically. You may also request new icons at the issue tracker.
\n\n