1.0.34 • Published 6 years ago
react-pretty-treeview v1.0.34
react-pretty-treeview
Install
npm i --save react-pretty-treeview
Update Table
Update | version | date |
---|---|---|
Can customize style in component | 1.0.18 | 16 May 2018 |
Can use element class for customize style | 1.0.21 | 17 May 2018 |
Fixed bugs style | 1.0.23 | 18 May 2018 |
Add custom style | 1.0.24 | 18 May 2018 |
Clean file | 1.0.25 | 19 May 2018 |
Add .npmignore | 1.0.26 | 19 May 2018 |
Props
Props | Type | Required | default | Description |
---|---|---|---|---|
childName | String | none | childs | - |
labelName | String | none | name | - |
labelStyle | String | none | - | - |
treeStyle | String | none | - | - |
activeName | String | none | - | - |
data | Array or Object if use immutable ( fromJS ) | yes | - | - |
onSelected | Function , Response (childObject, rootIndex, selectedName, dataList, rootKeyName, rootKey) => console.log(childObject, rootIndex, selectedName, dataList, rootKeyName, rootKey) | yes | - | - |
Import for using
import TreeView from 'react-pretty-treeview';
<TreeView
labelStyle=''
treeStyle=''
activeName='revlon-lipstick'
data={[
{
name: 'revlon test',
description: '',
status: 'disable',
open: true,
itemSize: 5,
createdDate: 1522846151,
updatedDate: 1522897770,
childs: []
}
]}
onSelected={ action('onSelected')}
/>
Custom style
//style for treeview node
span.tree-view-node:first-child:before{
content: '';
width: 1px;
height: 100%;
position: absolute;
left: -15px;
top: 0px;
background-color: #ddd;
}
span.tree-view-node:last-child:before{
content: '';
width: 1px;
height: 0%;
position: absolute;
left: -15px;
top: 0px;
background-color: #ddd;
}
span.tree-view-node span{
padding-top: 10px;
margin-left: 30px;
position: relative;
list-style: none;
display: block;
}
//style for treeview label
.tree-view-label{
cursor: pointer;
padding: 5px 15px;
display: inline-block;
position: relative;
background-color: #eee;
}
.tree-view-label:hover{
background: rgba(0,0,0,0.05);
}
.tree-view-label:before{
content: '';
width: 1px;
height: 82%;
position: absolute;
left: -15px;
top: -10px;
background-color: #ddd;
}
.tree-view-label:after{
content: '';
width: 15px;
height: 1px;
position: absolute;
left: -15px;
top: 50%;
background-color: #ddd;
}
.tree-view-label.active{
background-color: #ddd;
color: #333;
}
.tree-view-label.active:hover{
background: #eee;
}
1.0.34
6 years ago
1.0.33
6 years ago
1.0.32
6 years ago
1.0.31
6 years ago
1.0.30
6 years ago
1.0.29
6 years ago
1.0.28
6 years ago
1.0.27
6 years ago
1.0.26
6 years ago
1.0.25
6 years ago
1.0.24
6 years ago
1.0.23
6 years ago
1.0.22
6 years ago
1.0.21
6 years ago
1.0.20
6 years ago
1.0.19
6 years ago
1.0.18
6 years ago
1.0.17
6 years ago
1.0.16
6 years ago
1.0.15
6 years ago
1.0.14
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.1-0.1
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
1.0.0
6 years ago