1.2.6 • Published 6 years ago
ui-package--table-component-react v1.2.6
Introduction:
This package implements models.
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 |
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.4
6 years ago
1.1.3
6 years ago
1.1.0
6 years ago
1.0.13
6 years ago
1.0.12
6 years ago
1.0.11
6 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago