Skip to content

pchange/rc-simple-sheet

Repository files navigation

rc-simple-sheet


React SimpleSheet

NPM version build status Test coverage gemnasium deps node version npm download

Screenshot

Browser Support

IE Chrome Firefox Opera Safari
IE 8 + IE 8+ ✔ Chrome 31.0+ ✔ Firefox 31.0+ ✔ Opera 30.0+ ✔ Safari 7.0+ ✔

Install

rc-simple-sheet

Usage

var SimpleSheet = require('rc-simple-sheet');
var React = require('react');
var ReactDOM = require('react-dom');
ReactDOM.render(<SimpleSheet />, container);

Examples

npm start and then go to http://localhost:8000/examples

Online examples: http://pchange.github.io/rc-simple-sheet/examples/

API

Props

name type default description
value array [] components value, if should be as array with elem object link `{row: 0, column: 5, render: ({ record, row, column }) => {console.log('record', record, 'row', row, 'column', column); return (
value
); } }`
onChange Function callback when value changed initiative
selectionCell array '' components selectionCell value, if should be as array with elem object link `{row: 0, column: 5}`
onSelectionCellChange Function callback when selectionCell changed initiative
className string '' additional className at container
rows array [{label: 1, index: 1, }, {label: 2, index: 2, }, ], row define, index must be unique
columns array [{label: 1, index: 1, }, {label: 2, index: 2, }, ], column define, index must be unique
ySelect boolen true select cell when mouse draging y coordinate
xSelect boolen true select cell when mouse draging x coordinate
rowHeight number 30 change row Height whth this props
cellWidth number 50 change cell Width whth this props
labelCellWidth number 50 change label Cell Width whth this props
selectedAppend boolen false if true, append selectionCell cell when click or drag. if false, recount selectionCell and abandon the old selection
cellSelectClassName string '' add className to selection Cell

Development

npm install
npm start

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

License

rc-simple-sheet is released under the MIT license.