<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alaa Essam</title>
    <description>The latest articles on DEV Community by Alaa Essam (@super3laa).</description>
    <link>https://dev.to/super3laa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F542112%2F9d7dc74e-c6b4-4bc2-ba27-7e97df12a856.jpeg</url>
      <title>DEV Community: Alaa Essam</title>
      <link>https://dev.to/super3laa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/super3laa"/>
    <language>en</language>
    <item>
      <title>SuperList Module</title>
      <dc:creator>Alaa Essam</dc:creator>
      <pubDate>Sat, 23 Apr 2022 22:35:29 +0000</pubDate>
      <link>https://dev.to/super3laa/superlist-module-5dhg</link>
      <guid>https://dev.to/super3laa/superlist-module-5dhg</guid>
      <description>&lt;p&gt;SuperList Module Helps create your front-end in seconds&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search , Filter , Sort and Paginate with easy integration with your backend API&lt;/li&gt;
&lt;li&gt;Smooth Clean Design and Responsive, MUI based 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PmG7sZvW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nm0u1s37fn7uefohuys.png" alt="FrontEnd" width="880" height="495"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;$ npm i @superalaa/superlist&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import  SuperList  from  'SuperList';
import {data} from  './data.js'
function  App() {
    return (
    &amp;lt;&amp;gt;
        &amp;lt;SuperList  data={data}  /&amp;gt;
    &amp;lt;/&amp;gt;
    );
}
export  default  App; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://codesandbox.io/s/superlist-module-kh08ut?file=/src/data.js"&gt;Live Exmaple in Code SandBox &lt;/a&gt;&lt;br&gt;
Try Editing in data.js to get your head around the API docs&lt;/p&gt;

&lt;h2&gt;
  
  
  API documentation
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;pageName&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Title of your page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pageSummary&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;Summary or description of your page&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;primaryColor&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;The primary color in the module to make the design more adaptive to your theme Ex: primaryColor:"#673ab7"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;searchAttributes&lt;/td&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;enables the filter part in the search bar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;searchTitle&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;the search input title to help user what are they searching for&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;searchNameQuery&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;for backend purposes when you submit API request the search field data will be in object with property of the searchNameQuery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;searchAttributesData&lt;/td&gt;
&lt;td&gt;Array&lt;/td&gt;
&lt;td&gt;The filter part in search bar is an array of objects   for example Object has properties name,label and options for select  { name:"city",label:"City",options: [{ value:  'Alexandria', label:  'Alexandria' },{ value:  'Cairo', label:  'Cairo' },]},&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;categorySection&lt;/td&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;category section on the left side of the page to enables you filter all the data with specific attributes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;categorySubHeader&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;SubHeader for the category section&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;categories&lt;/td&gt;
&lt;td&gt;Array&lt;/td&gt;
&lt;td&gt;Array of Objects ;Object properties are title,name,categoryIcon with bool value in case you need to add an icon , Icon prop takes Component ,nested propert is bool if you want the menu to be nested with sub categories, subCategories property takes array for objects with same params&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sort&lt;/td&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;enables you to sort the list&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sortMenu&lt;/td&gt;
&lt;td&gt;Array&lt;/td&gt;
&lt;td&gt;Array of Object for example [       {title:"Amount High to Low",name:"amount",sort:"DESC"},{title:"Amount Low to High",name:"amount",sort:"ASC"}]&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;print&lt;/td&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;in case you need to print you rows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;addButtonTitle&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;The add button text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;addButtonOnClickFunction&lt;/td&gt;
&lt;td&gt;function&lt;/td&gt;
&lt;td&gt;pass function whatever you wanna do when you click the button&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;headerItem&lt;/td&gt;
&lt;td&gt;bool&lt;/td&gt;
&lt;td&gt;in case you want have a header for you records&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;headerItemComponent&lt;/td&gt;
&lt;td&gt;JS Component&lt;/td&gt;
&lt;td&gt;the header component&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;listItemComponent&lt;/td&gt;
&lt;td&gt;JS Component&lt;/td&gt;
&lt;td&gt;your record component design with get a param props.content will have your record data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;API&lt;/td&gt;
&lt;td&gt;String&lt;/td&gt;
&lt;td&gt;your backend API will ge a GET Request with query params of everything that happens in the module serch,sort,filter,pagination data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Back End Example using Express
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    app.get('/invoices',async  function(req,res){
        let  query = req.query;
        const  limit = parseInt(req.query.limit)
        const  offset = parseInt(req.query.offset)
        let  filters = JSON.parse(query.filter)
        if (filters.client){
            filters.client = {[Op.like]:`%${filters.client}%`}
        }
        let  dbObj = {
            where:filters,
            limit,
            offset,
        }
        if(req.query.sort){
            let  sort = JSON.parse(query.sort);
            dbObj.order = [sort]
        }
        let {count,rows} = await models.invoices.findAndCountAll(dbObj);
        res.send({count,rows}).status(200);
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@superalaa/superlist"&gt;NPM&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Super3laa/SuperList/tree/master/superlist"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>npm</category>
    </item>
  </channel>
</rss>
