-
Notifications
You must be signed in to change notification settings - Fork 20
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
Closed
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
e55bcc9
add gulp (for windows folk)
7dae6e3
test page with (hacky) edit working
8f80f4c
row index as a property
4228205
Add ActiveCell to state and pass to row/cell
b13f049
remove editable cell, moved that to another branch
bfd4ea5
alternate cell keyboard events using a mixin
059bf59
use native keyup
2658ffa
link to docs
55d8b60
fix cloneWithProps on rowRenderer - we were passing a func, not an obj
ef129d0
test page with (hacky) edit working
bd5af0a
row index as a property
3ca8b1a
add jsx transform to gulpfile
malonecj 4f31739
ignore example build file
malonecj d71c942
use gulp to load an example
malonecj 08c2fd3
keyboard nav basically working. needs refactoring, and left key is br…
f5defcd
keyboard and mouse working
f047376
working grid and gulp. next step yeoman
edb361a
link to examples
77ebcab
ignore dist folder
7138760
ignore build / dist folders
3c7263b
fix main example
b969a1d
update grid height
0bfbb08
fix watch
ae34485
push all props through
b4964d3
use the browsers on scroll, not a custom reworking of it
b4024a3
out with the old
069d816
scroll fixed, still has an issue on horizontal scroll by keyboard nav
8b3fef9
further tweaks to scrollbar
ec1cf46
upgrade to react v11
e3c7b77
working with v0.11.0
42163b5
Fully working with v11
dbefc41
bump to react 0.11.1
597059c
Adding tests
b4b4897
get tests for scrol by key in
4b9ba7f
add docs back in
0602bec
add makefile, standalone and themes back in
3db2571
eslint back in
567fb6c
updates to keyboard nav for v11
02cb77e
remove underscore dependency
8a0faba
Update readme / package files
49a3d42
Update Viewport.js
malonecj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
# 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/adazzle/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 forked from [Prometheus Research](http://prometheusresearch.github.io/react-grid) which has some [good examples](http://prometheusresearch.github.io/react-grid/examples/locked-columns.html) | ||
This version is created by [adazzle](https://www.adazzle.com) and 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 proof of concept, there are a fair amount of [things todo](https://github.com/adazzle/react-grid/issues/5) but feel free to comment, add [an issue](https://github.com/adazzle/react-grid/issues) or submit a [pull request](https://github.com/adazzle/react-grid/pulls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "react-grid", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/adazzle/react-grid", | ||
"authors": [ | ||
"Steve Baker <[email protected]>" | ||
], | ||
"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": {} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')); | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have the wrong repo here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep - as I said at the top of the PR, this wasnt really designed to be a PR back to the base fork - hence being 4 or 5 major alterations in one
But I'll clean that up