ui-package--table-component-react

1.2.6 • Public • Published

Introduction:

This package implements models.

DefaultTable

Example:

import DefaultTable from 'ui-package--table-component-react'
import 'ui-package--table-component-react/src/Styles/SortComponent.scss'
import 'ui-package--table-component-react/src/Styles/TableComponent.scss'
 
const data = [
    {name: 'Alex', phone: '98234798234'},
    {name: 'Jimmy', phone: '09856745'},
    {name: 'Albert', phone: '02138366322132'},
    {name: 'Jone', phone: '76235464'},
    {name: 'Paul', phone: '627363'}
]
 
const builder = new TableBuilder()
const createColumnHeadFunc = () => (
  builder
    .getFactory()
    .addHeader('name')
    .addHeader('phone')
    .getHeaders()
)
const createColumnBodyFunc = () => (
  builder
    .getFactory()
    .addBody('name', entity.name)
    .addBody('phone', entity.phone)
    .getBodies()
)
builder.buildColumnManager(
  createColumnHeadFunc,
  createColumnBodyFunc
)
const table = builder.getTableFacade()
<DefaultTable
  entities={data}
  onSelectEntity={() => {}}
  table={table} />

Props:

Name Type Default Description
table TableFacadeAbstract null You can get its via TableBuilder
entities Array [] You need input your data
createHeadColumns Function null Should return array of ColumnHeadEntityInterface
createBodyColumns Function<Object> null Should return array of ColumnBodyEntityInterface
onSelectEntity Function<Object[], TableFacadeAbstract>
onSort Function<String, TableFacadeAbstract>
onDoubleClick Function<Event, Object, TableFacadeAbstract>
onClick Function<Event, Object, TableFacadeAbstract>
onContextMenu Function<Event, Object, TableFacadeAbstract>
comparison Function<Object, Object> (e, e2) => e === e2
className String
loaded Boolean It need you if you use async
theme String table-component__theme_default

Readme

Keywords

none

Package Sidebar

Install

npm i ui-package--table-component-react

Weekly Downloads

5

Version

1.2.6

License

MIT

Unpacked Size

102 kB

Total Files

39

Last publish

Collaborators

  • gothic-prince