Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding keyboard nav, tests, gulp, react 0.11.1 #12

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
e55bcc9
add gulp (for windows folk)
Jul 7, 2014
7dae6e3
test page with (hacky) edit working
Jul 7, 2014
8f80f4c
row index as a property
Jul 7, 2014
4228205
Add ActiveCell to state and pass to row/cell
Jul 7, 2014
b13f049
remove editable cell, moved that to another branch
Jul 7, 2014
bfd4ea5
alternate cell keyboard events using a mixin
Jul 8, 2014
059bf59
use native keyup
Jul 14, 2014
2658ffa
link to docs
Jul 7, 2014
55d8b60
fix cloneWithProps on rowRenderer - we were passing a func, not an obj
Jul 7, 2014
ef129d0
test page with (hacky) edit working
Jul 7, 2014
bd5af0a
row index as a property
Jul 7, 2014
3ca8b1a
add jsx transform to gulpfile
malonecj Jul 8, 2014
4f31739
ignore example build file
malonecj Jul 8, 2014
d71c942
use gulp to load an example
malonecj Jul 8, 2014
08c2fd3
keyboard nav basically working. needs refactoring, and left key is br…
Jul 14, 2014
f5defcd
keyboard and mouse working
Jul 15, 2014
f047376
working grid and gulp. next step yeoman
Jul 16, 2014
edb361a
link to examples
Jul 22, 2014
77ebcab
ignore dist folder
Jul 22, 2014
7138760
ignore build / dist folders
Jul 22, 2014
3c7263b
fix main example
Jul 22, 2014
b969a1d
update grid height
Jul 22, 2014
0bfbb08
fix watch
Jul 22, 2014
ae34485
push all props through
Jul 22, 2014
b4964d3
use the browsers on scroll, not a custom reworking of it
Jul 22, 2014
b4024a3
out with the old
Jul 22, 2014
069d816
scroll fixed, still has an issue on horizontal scroll by keyboard nav
Jul 23, 2014
8b3fef9
further tweaks to scrollbar
Jul 23, 2014
ec1cf46
upgrade to react v11
Jul 22, 2014
e3c7b77
working with v0.11.0
Jul 22, 2014
42163b5
Fully working with v11
Jul 29, 2014
dbefc41
bump to react 0.11.1
Jul 29, 2014
597059c
Adding tests
Jul 28, 2014
b4b4897
get tests for scrol by key in
Jul 29, 2014
4b9ba7f
add docs back in
Jul 29, 2014
0602bec
add makefile, standalone and themes back in
Jul 29, 2014
3db2571
eslint back in
Jul 29, 2014
567fb6c
updates to keyboard nav for v11
Jul 29, 2014
02cb77e
remove underscore dependency
Jul 29, 2014
8a0faba
Update readme / package files
Jul 29, 2014
49a3d42
Update Viewport.js
malonecj Jul 31, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
node_modules
bower_components
docs/build
standalone/react-grid.min.js
standalone/react-grid.js
**/build
dist
build
examples/build
22 changes: 22 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"node": true,

"boss": true,
"curly": true,
"devel": true,
"eqnull": true,
"expr": true,
"funcscope": true,
"globalstrict": true,
"laxcomma": true,
"laxbreak": true,
"loopfunc": true,
"newcap": false,
"noempty": true,
"nonstandard": true,
"onecase": true,
"regexdash": true,
"trailing": true,
"undef": true,
"unused": "vars"
}
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# React Grid

Data grid for [React][].
Data grid for [React](http://facebook.github.io/react)


## Getting started
0. you'll need node, and an editor. Till visual studio does JSX, we think Atom.io is the best, so if you dont already, grab them:

choco install atom
choco install nodejs.install *if typing npm gives you an error*
git clone https://github.com/prometheusresearch/react-grid *in the root directory you want your files in*
cd .\react-grid

1. You'll also need Gulp which will perform build tasks such as jsx compilation (specified in gulpfile.js) - Go get it:

npm install -g gulp
npm install --save-dev gulp

2. Install Project Dependencies from package.json file

npm install

3. Run gulp. It compiles your jsx, jshint, packs your scripts up, and fires up a local webserver and opens the start page

gulp

Have a look in the gulpfile for other commands or add your own

## Credits

React Grid is free software created by [Prometheus Research][] and is released
under the MIT.
React Grid is from [Prometheus Research](http://prometheusresearch.github.io/react-grid) and there are some [good examples](http://prometheusresearch.github.io/react-grid/examples/locked-columns.html)
Contributions from [adazzle](https://www.adazzle.com)
It is released under the [MIT](LICENCE).

For more details, see the [React docs](http://facebook.github.io/react/), especially [thinking in react](http://facebook.github.io/react/docs/thinking-in-react.html)

[React]: http://facebook.github.io/react/
[Prometheus Research, LLC]: http://prometheusresearch.com
## Work in progress
This is still a work in progress but feel free to comment, add [an issue](https://github.com/prometheusresearch/react-grid/issues) or submit a [pull request](https://github.com/prometheusresearch/react-grid/pulls)
27 changes: 27 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "react-grid",
"version": "0.0.0",
"homepage": "https://github.com/prometheusresearch/react-grid",
"authors": [
"Prometheus Research https://github.com/prometheusresearch",
"Adazzle https://github.com/adazzle"
],
"moduleType": [],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"directory": "ext",
"dependencies": {
"jasmine": "~2.0.1",
"underscore": "~1.6.0",
"requirejs": "~2.1.14",
"jquery": "~2.1.1"
},
"devDependencies": {}
}
20 changes: 10 additions & 10 deletions docs/contents/styles/sortable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions examples/example1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html>
<body>
react grid

<div id="sandbox"></div>
<script type="text/javascript" src="/build/js/examples/example1.jsx"></script>



</body>
</html>
17 changes: 17 additions & 0 deletions examples/excelGrid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html>
<head>
<style>
div.active-cell {
background-color: #ccc;
font-weight:bold;
}
</style>
</head>
<body>
<p>Grid with keyboard navigation</p>
<div id="sandbox"></div>
<script type="text/javascript" src="/build/js/examples/excelGrid.jsx"></script>


</body>
</html>
49 changes: 49 additions & 0 deletions examples/jsx/example1.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* @jsx React.DOM
*/
(function() {

var React = require('react');
var ReactGrid = require('../../lib/Grid.js');

'use strict';

function rows(start, end) {
var rows = [];
for (var i = start; i < end; i++) {
rows.push([i, 'Name ' + i, 'Surname ' + i]);
}
return rows;
}

var columns = [
{
name: '№',
width: '10%',
key: 0,
locked:true
},
{
name: 'Name',
width: '40%',
resizeable: true,
key: 1
},
{
name: 'Surname',
width: '50%',
resizeable: true,
key: 2
}
];


React.renderComponent(
<ReactGrid
columns={columns}
length={30000}
rows={rows}
rowHeight={40}/>,
document.getElementById('sandbox'));

})();
69 changes: 69 additions & 0 deletions examples/jsx/excelGrid.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* @jsx React.DOM
*/
'use strict';
var ExcelGrid = require('../../lib/ExcelGrid');
var React = require('React');

var data = [];
for (var i = 0; i < 2000; i++) {
data.push({
'key': i,
'supplier':{'value':'Supplier ' + i, 'editing':true},
'format': 'fmt ' + i,
'start':'start',
'end':'end',
'price':i });
};


function rows(start, end) {
return data.slice(start, end);
}

var columns = [

{
idx: 0,
name: 'Supplier',
key: 'supplier',
width: 300,
locked: true,
},
{
idx: 1,
name: 'Format',
key: 'format',
width: 350,
},
{
idx: 2,
name: 'Start',
key: 'start',
width: 250,
},
{
idx: 3,
name: 'End',
key: 'end',
width: 250,
},
{
idx: 4,
name: 'Cost',
key: 'cost',
width: 200,
}
];


var renderGrid = function(containerId) {
containerId = containerId || 'sandbox';
var grid = ExcelGrid({columns:columns, rows: rows, length: data.length, height: 400});
React.renderComponent(grid,
document.getElementById(containerId));
};
renderGrid();

//force a global react object, for chrome dev tools if nothing else
window.React = window.React || React;
Loading