react-virtualized
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -6,11 +6,13 @@ { | ||
"user": "bvaughn", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"scripts": { | ||
"build": "npm run clean && npm run build:webpack", | ||
"build": "npm run build:webpack", | ||
"build:webpack": "NODE_ENV=production NODE_PATH='source/modules' webpack --config webpack.config.prod.js", | ||
"clean": "rimraf build", | ||
"deploy-gh-pages": "node scripts/deploy_gh_pages.js", | ||
"deploy-gh-pages": "node scripts/deploy-gh-pages", | ||
"lint": "standard", | ||
"postbuild": "node scripts/post-build", | ||
"prebuild": "npm run lint && npm run clean", | ||
"postpublish": "npm run deploy-gh-pages", | ||
"prepublish": "npm run build", | ||
"postpublish": "npm run deploy-gh-pages", | ||
"start": "node devServer.js", | ||
@@ -58,2 +60,3 @@ "test": "npm run lint && npm run test:unit", | ||
"devDependencies": { | ||
"autoprefixer": "^6.1.1", | ||
"babel": "^5.8.29", | ||
@@ -60,0 +63,0 @@ "babel-core": "^5.4.7", |
@@ -1,10 +0,92 @@ | ||
# Installation | ||
Demos available here: | ||
http://bvaughn.github.io/react-virtualized/ | ||
Install this component using NPM like so: | ||
```bash | ||
Getting started | ||
--------------- | ||
Install `react-virtualized` using npm. | ||
```shell | ||
npm install react-virtualized --save | ||
``` | ||
# License | ||
### VirtualScroll Example | ||
```javascript | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { VirtualScroll } from 'react-virtualized'; | ||
// List data as an array of strings | ||
const list = [ | ||
'Brian Vaughn' | ||
// And so on... | ||
]; | ||
// Render your list | ||
ReactDOM.render( | ||
<VirtualScroll | ||
width={300} | ||
height={300} | ||
rowsCount={list.size} | ||
rowHeight={20} | ||
rowRenderer={index => list[index]} | ||
/>, | ||
document.getElementById('example') | ||
); | ||
``` | ||
### FlexTable Example | ||
```javascript | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { FlexTable, FlexColumn } from 'react-virtualized'; | ||
// Table data as a array of objects | ||
const list = [ | ||
{ name: 'Brian Vaughn', description: 'Software engineer' | ||
// And so on... | ||
]; | ||
// Render your table | ||
ReactDOM.render( | ||
<FlexTable | ||
width={300} | ||
height={300} | ||
headerHeight={20} | ||
rowHeight={30} | ||
rowsCount={list.length} | ||
rowGetter={index => list[index]} | ||
> | ||
<FlexColumn | ||
label='Name' | ||
dataKey='name' | ||
width={100} | ||
/> | ||
<FlexColumn | ||
width={200} | ||
label='Description' | ||
dataKey='description' | ||
/> | ||
</FlexTable>, | ||
document.getElementById('example') | ||
); | ||
``` | ||
Contributions | ||
------------ | ||
Use [GitHub issues](https://github.com/bvaughn/react-virtualized/issues) for requests. | ||
I actively welcome pull requests; learn how to [contribute](https://github.com/bvaughn/react-virtualized/blob/master/CONTRIBUTING.md). | ||
Changelog | ||
--------- | ||
Changes are tracked in the [changelog](https://github.com/bvaughn/react-virtualized/blob/master/CHANGELOG.md). | ||
License | ||
--------- | ||
*react-virtualized* is available under the MIT License. |
@@ -8,3 +8,3 @@ require('babel/register') | ||
function main() { | ||
function main () { | ||
ghpages.publish( | ||
@@ -11,0 +11,0 @@ config.output.path, |
@@ -11,7 +11,7 @@ var fs = require('fs-extra') | ||
replace({ | ||
regex: /script src="[^"]+"/, | ||
replacement: 'script src="demo.js"', | ||
paths: [dest], | ||
recursive: false, | ||
silent: true, | ||
}); | ||
regex: /script src="[^"]+"/, | ||
replacement: 'script src="demo.js"', | ||
paths: [dest], | ||
recursive: false, | ||
silent: true | ||
}) |
@@ -6,4 +6,3 @@ import { render } from 'react-dom' | ||
render( | ||
( | ||
render(( | ||
<div> | ||
@@ -10,0 +9,0 @@ <VirtualScrollExample/> |
@@ -94,3 +94,3 @@ /** @flow */ | ||
name='virtualScrollHeight' | ||
onChange={event => this.setState({ virtualScrollHeight: Number.parseInt(event.target.value, 10) || 1 })} | ||
onChange={event => this.setState({ virtualScrollHeight: parseInt(event.target.value, 10) || 1 })} | ||
value={virtualScrollHeight}/> | ||
@@ -101,3 +101,3 @@ | ||
name='virtualScrollRowHeight' | ||
onChange={event => this.setState({ virtualScrollRowHeight: Number.parseInt(event.target.value, 10) || 1 })} | ||
onChange={event => this.setState({ virtualScrollRowHeight: parseInt(event.target.value, 10) || 1 })} | ||
value={virtualScrollRowHeight}/> | ||
@@ -108,3 +108,3 @@ | ||
name='virtualScrollHeaderHeight' | ||
onChange={event => this.setState({ virtualScrollHeaderHeight: Number.parseInt(event.target.value, 10) || 1 })} | ||
onChange={event => this.setState({ virtualScrollHeaderHeight: parseInt(event.target.value, 10) || 1 })} | ||
value={virtualScrollHeaderHeight}/> | ||
@@ -157,3 +157,3 @@ </div> | ||
_onRowsCountChange (event) { | ||
let rowsCount = Number.parseInt(event.target.value, 10) || 0 | ||
let rowsCount = parseInt(event.target.value, 10) || 0 | ||
rowsCount = Math.max(0, Math.min(this._list.size, rowsCount)) | ||
@@ -166,5 +166,5 @@ | ||
const { rowsCount } = this.state | ||
let scrollToIndex = Math.min(rowsCount - 1, Number.parseInt(event.target.value, 10)) | ||
let scrollToIndex = Math.min(rowsCount - 1, parseInt(event.target.value, 10)) | ||
if (Number.isNaN(scrollToIndex)) { | ||
if (isNaN(scrollToIndex)) { | ||
scrollToIndex = undefined | ||
@@ -171,0 +171,0 @@ } |
@@ -63,3 +63,3 @@ /** | ||
name='virtualScrollHeight' | ||
onChange={event => this.setState({ virtualScrollHeight: Number.parseInt(event.target.value, 10) || 1 })} | ||
onChange={event => this.setState({ virtualScrollHeight: parseInt(event.target.value, 10) || 1 })} | ||
value={virtualScrollHeight}/> | ||
@@ -70,3 +70,3 @@ | ||
name='virtualScrollRowHeight' | ||
onChange={event => this.setState({ virtualScrollRowHeight: Number.parseInt(event.target.value, 10) || 1 })} | ||
onChange={event => this.setState({ virtualScrollRowHeight: parseInt(event.target.value, 10) || 1 })} | ||
value={virtualScrollRowHeight}/> | ||
@@ -89,3 +89,3 @@ </div> | ||
_onRowsCountChange (event) { | ||
let rowsCount = Number.parseInt(event.target.value, 10) || 0 | ||
let rowsCount = parseInt(event.target.value, 10) || 0 | ||
rowsCount = Math.max(0, Math.min(this._list.length, rowsCount)) | ||
@@ -98,5 +98,5 @@ | ||
const { rowsCount } = this.state | ||
let scrollToIndex = Math.min(rowsCount - 1, Number.parseInt(event.target.value, 10)) | ||
let scrollToIndex = Math.min(rowsCount - 1, parseInt(event.target.value, 10)) | ||
if (Number.isNaN(scrollToIndex)) { | ||
if (isNaN(scrollToIndex)) { | ||
scrollToIndex = undefined | ||
@@ -103,0 +103,0 @@ } |
@@ -0,1 +1,2 @@ | ||
const autoprefixer = require('autoprefixer') | ||
const path = require('path') | ||
@@ -28,7 +29,10 @@ const webpack = require('webpack') | ||
test: /\.less$/, | ||
loaders: ['style', 'css', 'less'], | ||
loaders: ['style', 'css', 'postcss', 'less'], | ||
include: path.join(__dirname, 'source') | ||
} | ||
] | ||
} | ||
}, | ||
postcss: [ | ||
autoprefixer({ browsers: ['last 2 versions'] }) | ||
] | ||
} |
@@ -0,1 +1,2 @@ | ||
const autoprefixer = require('autoprefixer') | ||
var path = require('path') | ||
@@ -36,7 +37,10 @@ var webpack = require('webpack') | ||
test: /\.less$/, | ||
loaders: ['style', 'css', 'less'], | ||
loaders: ['style', 'css', 'postcss', 'less'], | ||
include: path.join(__dirname, 'source') | ||
} | ||
] | ||
} | ||
}, | ||
postcss: [ | ||
autoprefixer({ browsers: ['last 2 versions'] }) | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68084
31
1369
93
41