1.0.2 • Published 7 years ago

react-drag-list-wi v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

react-drag-list


React DraggableList Component

NPM version build status Test coverage gemnasium deps npm download

Development

npm install typings -g
npm install
typings install
npm start

Example

http://localhost:8000/examples/

online example: http://front-ender.me/react-drag-list/

install

react-drag-list

Usage

var ReactDragList = require('react-drag-list');
var React = require('react');
React.render(
  <ReactDragList
    dataSource={['row1', 'row2', 'row3']}
    row={(record, index) => <div>index + record</div>}
  />, container);

API

props

NameTypeDefaultDescription
prefixClsstringrc-draggable-listThe draggable list dom node's prefixCls
classNamestringadditional className for draggable list
styleobjectRoot style for draggable list element. Such as width, height
rowClassNamestringadditional className for draggable list row item
dataSourceany[]data record array to be rendered
rowfunction(record, index): ReactNoderow data to be rendered
handlesbooleanfalseshow drag handles
animationstring150ms, animation speed moving items when sorting, 0 — without animation
onUpdatefunction(event: Object)called when sorting list changed
ghostClassstringadditional className for the drop placeholder
chosenClassstringadditional className for the chosen item
dragClassstringadditional className for the dragging item

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

react-drag-list is released under the MIT license.