Methods
calculateRange(data, pageSize) → {Array}
Calculate the range of the table
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array.<Object> | Global Data |
pageSize |
Number | Page size |
- Source:
Returns:
An array containing page numbers
- Type
- Array
EntriesDisplayer(props) → {React.ReactElement}
Component for the entries counter
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | Current page number Properties
|
Returns:
- Type
- React.ReactElement
Footer(props) → {React.ReactElement}
Component for the footer section
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
handleOrdering(key, ordering, setOrdering) → {void}
Handle table ordering, called when user click on any th
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | |
ordering |
Object | Object containing the targeted property and the order |
setOrdering |
function | Update ordering values |
- Source:
Returns:
Update the ordering state
- Type
- void
Header(props) → {React.ReactElement}
Component for the header section
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
Pagination(props) → {React.ReactElement}
Component for the pagination section
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
ReactTable(props) → {React.ReactElement}
React table main component
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
SelectPageSize(props) → {React.ReactElement}
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
Returns:
- Type
- React.ReactElement
sliceData(data, currentPage, pageSize) → {Array}
Calculate the slice of data to display
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array.<Object> | Global data |
currentPage |
Number | The current Page Number |
pageSize |
Number | The Page size |
- Source:
Returns:
A slice of data
- Type
- Array
Table(props) → {React.ReactElement}
Component for the table
Parameters:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
TableBody(props) → {React.ReactElement}
Table body component
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
TableHeader(props) → {React.ReactElement}
Table header component
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
TableSearch(props) → {React.ReactElement}
Component for the search section
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object |
Properties
|
- Source:
Returns:
- Type
- React.ReactElement
useOrdering(data, ordering) → {Array.<object>}
Custom hook used to sort the data
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array.<object> | Data to sort |
ordering |
Object | Example: { order: "ascending", property: "firstName" } |
- Source:
Returns:
Sorted data
- Type
- Array.<object>
usePagination(data, currentPage, pageSize, ordering) → {Object}
Custom hook used for pagination
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array.<Object> | Data |
currentPage |
Number | Current page number |
pageSize |
Number | Page size |
ordering |
Object | Example: { order: "ascending", property: "firstName" } |
- Source:
Returns:
Object containing a data slice and the table range
- Type
- Object
useSearch(data, searchString) → {Array.<Object>}
Custom hook used to filter the array
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array.<Object> | globalData |
searchString |
String | Search string from the input search |
- Source:
Returns:
Filtered data
- Type
- Array.<Object>