0.0.5 • Published 2 years ago

@savvycom/dynamic-table v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Installation

// with npm

npm install @savvycom/dynamic-table

  

// with yarn

yarn add @savvycom/dynamic-table

Usage

Here is a quick example to get you started, it's all you need:

Yes, it's really all you need to get started as you can see in this live and interactive demo:

Edit Button

Components

NameDescription
TableUITable data
FilterTable filter
NavigationUIHorizontal Navigation bar
PaginationUIPagination
SidebarSidebar

API

TableUI

NameTypeDescription
columnResponseArray<Column< object >>column names of table
dataResponseArray< object >data
apistringurl to call api
sortConfigISortField or Nullconfig sorted fields
onHandleSortFunctionhandling sorted fields
totalPagenumberThe total number of pages.
totalCountnumberThe total number of items.
allowFilterbooleanenable filter.
allowPaginationbooleanenable pagination.
onChangePageFunctionon handle changing page
onHandleFilterFunctionon handle filtering

Filter

NameTypeDescription
conditionIFiltercondition of filter
onHandleFilterFunctionhandling filter
columnsArray<Column< object >>columned filter

PaginationUI

NameTypeDescription
currentPageIndexnumbercurrent page index number
pageCountnumberhandling filter
onChangePageFunctionon handle change page number

License

This project is licensed under the terms of the

MIT license.