npm.io
1.6.2 • Published 5 years ago

@omegasoft/tree-transfer-list

Licence
MIT
Version
1.6.2
Deps
12
Size
979 kB
Vulns
0
Weekly
0

Tree Transfer

Explore the docs »

Repository · Report Bug · Request Feature

Table of Contents

About The Project

React tree transfer Component with antd
Fork from https://github.com/glud123/tree-transfer (last updated at 9 May 2018)

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites
  • npm
npm install npm@latest -g
Installation
  1. Clone the repo
git clone https://github.com/ComptiaVertigo/tree-transfer.git
  1. Install NPM packages
npm install
  1. Run
npm run dev

Usage

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import {TreeTransfer,getAllTreeData} from 'tree-transfer';
const Data = [
	{
		"key": "0-0",
		"title": "T0-0"
	},
	{
		"key": "0-0-0",
		"title": "T0-0-0",
		"parentKey": "0-0"
	},
	{
		"key": "0-0-0-0",
		"title": "T0-0-0-0",
		"parentKey": "0-0-0"
	},
	{
		"key": "0-0-0-0-0",
		"title": "T0-0-0-0-0",
		"parentKey": "0-0-0-0"
	}
];
const leftTree = Data;
const rightTree = [];

class App extends Component {
	constructor(props) {
		super(props);
	}

	componentWillMount() {}
	handleClick =()=>{
		console.log(getAllTreeData());
	}
	render() {
		return (<div style={{ height: '500px' }}>
				<TreeTransfer 
				placeholder={'Search'}
				showSearch={true} 
				treeWidth={250}
				treeHeight={400}
				getAllTreeData={getAllTreeData} leftTreeData={ leftTree } rightTreeData={ rightTree} 
				leftTitle={'Left'} 
				rightTitle={'Right'}/>	
				<button onClick={this.handleClick}>Tree</button>
			</div>
		);
	}
}
ReactDOM.render(<App />,document.querySelector('#app'));

// transferBtns
[{
	key: 'allToRight',
	name: '>>',
	className: ''
},
{
	key: 'toRight',
	name: '>',
	className: ''
},
{
	key: 'tolLeft',
	name: '<',
	className: ''
},
{
	key: 'allToLeft',
	name: '<<',
	className: ''
}]

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Project Link: ComptiaVertigo/tree-transfer

Keywords