<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> Home</title> <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script> <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> <script src="./build/entry.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous"> <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css"> <link type="text/css" rel="stylesheet" href="styles/app.min.css"> <link type="text/css" rel="stylesheet" href="styles/iframe.css"> <link type="text/css" rel="stylesheet" href=""> <script async defer src="https://buttons.github.io/buttons.js"></script> </head> <body class="layout small-header"> <div id="stickyNavbarOverlay"></div> <div class="top-nav"> <div class="inner"> <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false"> <span aria-hidden="true"></span> <span aria-hidden="true"></span> <span aria-hidden="true"></span> </a> <div class="logo"> <a href="index.html"> <h1 class="navbar-item">Argent Bank - Documentation</h1> </a> </div> <div class="menu"> <div class="navigation"> <a href="index.html" class="link" > Documentation </a> </div> </div> </div> </div> <div id="main"> <div class="sidebar " id="sidebarNav" > <nav> <h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Components</h2><h3>Components</h3><ul><li><a href="DataTable.html">DataTable</a></li><li><a href="Pagination.html">Pagination</a></li></ul></div> </nav> </div> <div class="core" id="main-content-wrapper"> <div class="content"> <header class="page-title"> <p></p> <h1>Home</h1> </header> <h3> </h3> <section> <article><h1>react-ab-dataTable</h1> <p><em>Was made for a student projet for OpenClassrooms.</em></p> <p>This library is a react component to render a table using two arrays of objects.</p> <p>The table can be sorted, filtered (using a search input), paginated and the number of row can be change (all can be disable).</p> <p><a href="https://arthurblanc.github.io/react-ab-data-table/">Documentation</a></p> <h2>Installation</h2> <p>Run the following command:</p> <pre class="prettyprint source"><code># If you use npm: npm install react-ab-data-table # If you use yarn: yarn add react-ab-data-table </code></pre> <h2>Usage</h2> <pre class="prettyprint source"><code>import { DataTable } from "react-ab-data-table"; const App = () => { const columns = [ { name: "First Name", id: "firstName", sortable: true }, { name: "Last Name", id: "lastName", sortable: true }, { name: "City", id: "city", sortable: true }, { name: "Birthday", id: "birthday", sortable: true }, ]; const data = [ { firstName: "John", lastName: "Doe", city: "New York", birthday: "1980-01-02" }, { firstName: "Jane", lastName: "Doe", city: "Los Angeles", birthday: "1985-02-14" }, { firstName: "John", lastName: "Smith", city: "Chicago", birthday: "1970-11-22" }, { firstName: "Jane", lastName: "Smith", city: "Houston", birthday: "1975-09-30" }, ]; return ( <main> <DataTable columns={columns} data={data} tableId="employee" sortId="lastName" /> </main> ); }; </code></pre> <h3>Columns array</h3> <p>This array is use to render the head columns</p> <ul> <li>name: the name of the column displayed in the table header</li> <li>id: the id of the column</li> <li>sortable: boolean, if the column is sortable</li> <li>headColSpan: size of the column in the header bodyColSpan: size of the column in the body</li> </ul> <h3>Data array</h3> <p>This array must contain the data of the table, every object will be a row.</p> <p>The key must be the id of the column and the value will be the data in the row/column.</p> <h2>Props list</h2> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Required</th> <th>Description</th> <th>Default</th> </tr> </thead> <tbody> <tr> <td>data</td> <td>arrayOf</td> <td>Yes</td> <td>The data to be displayed in the table</td> <td></td> </tr> <tr> <td>columns</td> <td>arrayOf</td> <td>Yes</td> <td>The columns to be displayed in the table</td> <td></td> </tr> <tr> <td>tableId</td> <td>string</td> <td>Yes</td> <td>The id of the table</td> <td></td> </tr> <tr> <td>sortId</td> <td>string</td> <td>No</td> <td>The id of the column to be sorted</td> <td>function()</td> </tr> <tr> <td>itemsPerPageOptions</td> <td>array</td> <td>No</td> <td>The options for the items per page dropdown</td> <td>[10, 25, 50, 100]</td> </tr> <tr> <td>itemsPerPageSelectionEnabled</td> <td>bool</td> <td>No</td> <td>Whether the items per page dropdown should be enabled</td> <td>true</td> </tr> <tr> <td>searchEnabled</td> <td>bool</td> <td>No</td> <td>Whether the search input should be enabled</td> <td>true</td> </tr> <tr> <td>sortSelectionEnabled</td> <td>bool</td> <td>No</td> <td>Whether the sort dropdown should be enabled</td> <td>true</td> </tr> <tr> <td>tableInfoEnabled</td> <td>bool</td> <td>No</td> <td>Whether the table info should be enabled</td> <td>true</td> </tr> <tr> <td>paginationEnabled</td> <td>bool</td> <td>No</td> <td>Whether the pagination should be enabled</td> <td>true</td> </tr> <tr> <td>dataTablesWrapperClassName</td> <td>string</td> <td>No</td> <td>The class name of the wrapper div</td> <td>"data-tables-wrapper"</td> </tr> <tr> <td>dataTablesLengthClassName</td> <td>string</td> <td>No</td> <td>The class name of the length div</td> <td>"data-tables-length"</td> </tr> <tr> <td>dataTablesLengthLabelClassName</td> <td>string</td> <td>No</td> <td>The class name of the length label</td> <td>"data-tables-length-label"</td> </tr> <tr> <td>dataTablesLengthSelectClassName</td> <td>string</td> <td>No</td> <td>The class name of the length select</td> <td>"data-tables-length-select"</td> </tr> <tr> <td>dataTablesLengthOptionClassName</td> <td>string</td> <td>No</td> <td>The class name of the length options</td> <td>"data-tables-length-option"</td> </tr> <tr> <td>dataTablesSearchWrapperClassName</td> <td>string</td> <td>No</td> <td>The class name of the search wrapper div</td> <td>"data-tables-search-wrapper"</td> </tr> <tr> <td>dataTablesSearchLabelClassName</td> <td>string</td> <td>No</td> <td>The class name of the search label</td> <td>"form-label"</td> </tr> <tr> <td>dataTablesSearchInputClassName</td> <td>string</td> <td>No</td> <td>The class name of the search input</td> <td>"form-input"</td> </tr> <tr> <td>dataTablesInfoClassName</td> <td>string</td> <td>No</td> <td>The class name of the info div</td> <td>"data-tables-info"</td> </tr> <tr> <td>dataTablesPaginateClassName</td> <td>string</td> <td>No</td> <td>The class name of the paginate div</td> <td>"data-tables-paginate"</td> </tr> <tr> <td>dataTableClassName</td> <td>string</td> <td>No</td> <td>The class name of the table</td> <td>"data-table"</td> </tr> <tr> <td>dataTableHeaderClassName</td> <td>string</td> <td>No</td> <td>The class name of the table header</td> <td>"data-table-header"</td> </tr> <tr> <td>dataTableHeaderTrClassName</td> <td>string</td> <td>No</td> <td>The class name of the table header tr</td> <td>"data-table-header-tr"</td> </tr> <tr> <td>dataTableHeaderThClassName</td> <td>string</td> <td>No</td> <td>The class name of the table header th</td> <td>"data-table-header-th"</td> </tr> <tr> <td>dataTableHeaderSortedClassName</td> <td>string</td> <td>No</td> <td>The class name of the table header th sorted</td> <td>"sorting"</td> </tr> <tr> <td>dataTableBodyClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body</td> <td>"data-table-body"</td> </tr> <tr> <td>dataTableBodyTrClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body tr</td> <td>"data-table-body-tr"</td> </tr> <tr> <td>dataTableBodyTdClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body td</td> <td>"data-table-body-td"</td> </tr> <tr> <td>dataTableBodyTdSortedClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body td sorted</td> <td>"sorting_1"</td> </tr> <tr> <td>dataTableBodyTdEmptyClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body td empty</td> <td>"data-tables-empty"</td> </tr> <tr> <td>dataTableBodyOddRowClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body tr odd</td> <td>"odd"</td> </tr> <tr> <td>dataTableBodyEvenRowClassName</td> <td>string</td> <td>No</td> <td>The class name of the table body tr even</td> <td>"even"</td> </tr> </tbody> </table> <h2>Author</h2> <p><strong>Arthur Blanc</strong> : <a href="https://github.com/ArthurBlanc/"><strong>GitHub</strong></a> - <a href="https://abcoding.fr/"><strong>Portfolio</strong></a></p></article> </section> </div> <footer class="footer"> <div class="content has-text-centered"> <p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a></p> <p class="sidebar-created-by"> <a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by <a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a> </p> </div> </footer> </div> <div id="side-nav" class="side-nav"> </div> </div> <script src="scripts/app.min.js"></script> <script>PR.prettyPrint();</script> <script src="scripts/linenumber.js"> </script> </body> </html>