Skip to content

ui-package/table-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction:

This package was created to separate Views and Models. This package implements logic. Thus, you need create View.

Package ui-package--table-component-react implements these models.

Solutions:

  • You can use one model to create table for any frameworks. It can solve issue to supporting application with a few frameworks (like React and React Native).
  • Simple testing.
  • Simple extending. You can add or edit behavior. You can override models so, to it keep settings of table.

Example:

const builder = new TableBuilder()
const headColumnsFactory = () => (
  builder
    .getFactory()
    .addHeader('name')
    .addHeader('phone')
    .getHeaders()
)
const bodyColumnsFactory = (entity) => (
  builder
    .getFactory()
    .addBody('name', entity.name)
    .addBody('phone', entity.phone)
    .getBodies()
)
builder.buildColumnManager(headColumnsFactory, bodyColumnsFactory)
const table = builder.getTableFacade()
table.getSortManager().by('name') // DESC
table.getSortManager().by('name') // ASC
table.getSortManager().by('name') // DESC
table.getSortManager().by('phone', TABLE_SORT_ASC)
table.getSortManager().by('phone', TABLE_SORT_DESC)
table.getDensityManager().setDensity(3)
table.getPaginationManager().setCurrentPage(34)
table.getPaginationManager().next(entities)

// it returns sorted, filtered, paginated entities, 
table.getEntities(entities)

Models:

TableBuilder

SortManager

PaginationManager

DensityManager

DataSelectorManager

ResetManager

RenderManager

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •