This repository has been archived by the owner on Nov 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from vaiRk/v2.0.0
V2.0.0
- Loading branch information
Showing
14 changed files
with
310 additions
and
170 deletions.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"presets": ["react", "es2015", "stage-1"], | ||
"env": { | ||
"umd": { | ||
"plugins": [ | ||
"add-module-exports", | ||
"transform-es2015-modules-umd" | ||
] | ||
} | ||
} | ||
} |
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,6 @@ | ||
test | ||
src | ||
example | ||
webpack.config.js | ||
.babelrc | ||
.module-cache |
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
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,3 @@ | ||
{ | ||
"presets": ["react", "es2015", "stage-1"] | ||
} |
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
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
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
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,30 +1,43 @@ | ||
'use-strict'; | ||
'use strict'; | ||
|
||
var React = require('react'); | ||
var FixedDataTable = require('fixed-data-table'); | ||
var ResponsiveFixedDataTable = require('responsive-fixed-data-table'); | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import { Column, Cell } from 'fixed-data-table'; | ||
import ResponsiveFixedDataTable from 'responsive-fixed-data-table'; | ||
|
||
var Column = FixedDataTable.Column; | ||
|
||
var data = [ | ||
['a1', 'b1', 'c1'], | ||
['a2', 'b3', 'c2'], | ||
['a3', 'b3', 'c3'] | ||
const data = [ | ||
{ name: 'Olivia Dunham', email: '[email protected]' }, | ||
{ name: 'Walter Bishop', email: '[email protected]' }, | ||
{ name: 'Peter Bishop', email: '[email protected]' }, | ||
{ name: 'Astrid Farnsworth', email: '[email protected]' } | ||
]; | ||
|
||
function rowGetter(rowIndex) { | ||
return data[rowIndex]; | ||
class MyCell extends React.Component { | ||
render() { | ||
const { rowIndex, data, field, ...props } = this.props; | ||
return ( | ||
<Cell {...props}> | ||
{data[rowIndex][field]} | ||
</Cell> | ||
); | ||
} | ||
} | ||
|
||
React.render( | ||
render( | ||
<ResponsiveFixedDataTable | ||
rowHeight={40} | ||
rowGetter={rowGetter} | ||
rowsCount={data.length} | ||
width={500} | ||
height={200} | ||
headerHeight={60} > | ||
<Column label='Col 1' width={100} dataKey={0} /> | ||
<Column label="Col 2" width={400} dataKey={1} flexGrow={1} /> | ||
</ResponsiveFixedDataTable> | ||
, document.body); | ||
rowHeight={40} | ||
rowsCount={data.length} | ||
width={500} | ||
height={200} | ||
headerHeight={60} > | ||
<Column | ||
header={<Cell>Name</Cell>} | ||
cell={<MyCell data={data} field='name' />} | ||
width={200} /> | ||
<Column | ||
header={<Cell>Email</Cell>} | ||
cell={<MyCell data={data} field='email' />} | ||
width={400} | ||
flexGrow={1} /> | ||
</ResponsiveFixedDataTable> | ||
, document.getElementById('example-container')); |
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 @@ | ||
'use strict'; | ||
|
||
var webpack = require('webpack'); | ||
var path = require('path'); | ||
|
||
module.exports = { | ||
context: __dirname, | ||
entry: path.resolve(__dirname, 'src', 'responsive-table-example.js'), | ||
output: { | ||
path: path.resolve(__dirname, 'build', 'assets', 'js'), | ||
sourceMapFileName: '[file].map', | ||
filename: 'bundle.js', | ||
}, | ||
devtool: 'source-map', | ||
resolve: { | ||
extensions: ['', '.js'] | ||
}, | ||
module: { | ||
preLoaders: [ | ||
{ test: /\.js$/, include: /responsive-fixed-data-table/, loader: 'source-map' } | ||
], | ||
loaders: [ | ||
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' } | ||
] | ||
} | ||
} |
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,9 +1,14 @@ | ||
{ | ||
"name": "responsive-fixed-data-table", | ||
"version": "1.5.0", | ||
"version": "2.0.0", | ||
"author": "Viky Guerra <[email protected]>", | ||
"description": "Responsive utility wrapper for Facebook's Fixed-Data-Table", | ||
"main": "./lib/responsive-fixed-data-table.js", | ||
"main": "lib/responsive-fixed-data-table.js", | ||
"jsnext:main": "lib/responsive-fixed-data-table.es.js", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/vaiRk/responsive-fixed-data-table" | ||
|
@@ -21,24 +26,42 @@ | |
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"debounce": "^1.0.0" | ||
"lodash": "^4.3.0" | ||
}, | ||
"peerDependencies": { | ||
"fixed-data-table": ">=0.2.0", | ||
"react": ">=0.13" | ||
"fixed-data-table": ">=0.6.0", | ||
"react": ">=0.14", | ||
"react-dom": ">=0.14" | ||
}, | ||
"devDependencies": { | ||
"jsx-loader": "^0.13.2", | ||
"karma": "^0.12.36", | ||
"karma-chrome-launcher": "^0.1.12", | ||
"karma-jasmine": "^0.3.5", | ||
"karma-webpack": "^1.5.1", | ||
"react-tools": "^0.13.3", | ||
"webpack": "^1.9.11" | ||
"babel-core": "^6.5.2", | ||
"babel-loader": "^6.2.2", | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-plugin-transform-es2015-modules-umd": "^6.5.0", | ||
"babel-preset-es2015": "^6.5.0", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-preset-stage-1": "^6.5.0", | ||
"cross-env": "^1.0.7", | ||
"fixed-data-table": "^0.6.0", | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.21", | ||
"karma-chrome-launcher": "^0.2.2", | ||
"karma-jasmine": "^0.3.7", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^1.7.0", | ||
"ncp": "^2.0.0", | ||
"react": "^0.14.7", | ||
"react-addons-test-utils": "^0.14.7", | ||
"react-dom": "^0.14.7", | ||
"rimraf": "^2.5.1", | ||
"webpack": "^1.12.13" | ||
}, | ||
"scripts": { | ||
"prebuild": "rm -rf lib", | ||
"build": "./node_modules/.bin/jsx --no-cache-dir ./src ./lib", | ||
"prebuild": "rimraf lib", | ||
"build": "npm run build:umd && npm run build:umd:min && npm run build:es", | ||
"build:umd": "cross-env BABEL_ENV=umd webpack", | ||
"build:umd:min": "cross-env BABEL_ENV=umd NODE_ENV=production webpack", | ||
"build:es": "ncp src/responsive-fixed-data-table.js lib/responsive-fixed-data-table.es.js", | ||
"prepublish": "npm run build", | ||
"test": "./node_modules/karma/bin/karma start test/karma.conf.js", | ||
"test:debug": "./node_modules/karma/bin/karma start test/karma.conf.js --no-single-run --auto-watch --log-level debug" | ||
|
Oops, something went wrong.