Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BD2KGenomics/react-data-components
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: carlosrocha/react-data-components
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Sep 4, 2015

  1. add numeric sort

    shizukukun committed Sep 4, 2015
    Copy the full SHA
    0ecbec9 View commit details

Commits on Sep 8, 2015

  1. Merge pull request carlosrocha#10 from shizukukun/master

    add numeric sort
    carlosrocha committed Sep 8, 2015
    Copy the full SHA
    b69e8e6 View commit details
  2. Copy the full SHA
    36ba92a View commit details

Commits on Sep 14, 2015

  1. use lodash for sorting

    carlosrocha committed Sep 14, 2015
    Copy the full SHA
    72fd918 View commit details

Commits on Oct 30, 2015

  1. Copy the full SHA
    3022ee6 View commit details
  2. Copy the full SHA
    faf761a View commit details
  3. Copy the full SHA
    376e289 View commit details
  4. Copy the full SHA
    53b03e0 View commit details
  5. Removed babel-cli from deps

    bsalex committed Oct 30, 2015
    Copy the full SHA
    518c6bc View commit details
  6. Copy the full SHA
    35b611d View commit details
  7. Changed package.json main

    bsalex committed Oct 30, 2015
    Copy the full SHA
    bb90310 View commit details
  8. Copy the full SHA
    eb2cb11 View commit details

Commits on Nov 1, 2015

  1. Fix for tests

    bsalex committed Nov 1, 2015
    Copy the full SHA
    c26a59f View commit details

Commits on Nov 6, 2015

  1. Copy the full SHA
    c97aeb1 View commit details

Commits on Nov 20, 2015

  1. Copy the full SHA
    7c874d4 View commit details
  2. Copy the full SHA
    a2ee64b View commit details
  3. Copy the full SHA
    adbc64f View commit details
  4. 0.6.0

    carlosrocha committed Nov 20, 2015
    Copy the full SHA
    305db88 View commit details
  5. Update changelog

    carlosrocha committed Nov 20, 2015
    Copy the full SHA
    4c2e720 View commit details

Commits on Jun 26, 2016

  1. Copy the full SHA
    b6a590f View commit details
  2. Update dependencies

    carlosrocha committed Jun 26, 2016
    Copy the full SHA
    f81ea3c View commit details

Commits on Jun 27, 2016

  1. Update more dependencies

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    8925517 View commit details
  2. Update tests

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    e655d72 View commit details
  3. Add babel-cli

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    b76e0fd View commit details
  4. Fix dependencies

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    a09f810 View commit details
  5. Use d3-request

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    42683c8 View commit details
  6. More linting

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    72a543c View commit details
  7. Remove useless components

    carlosrocha committed Jun 27, 2016
    Copy the full SHA
    c81a0ff View commit details

Commits on Jun 28, 2016

  1. Add size badge

    carlosrocha committed Jun 28, 2016
    Copy the full SHA
    a1240e1 View commit details
  2. ES2016ify

    carlosrocha committed Jun 28, 2016
    Copy the full SHA
    351bb99 View commit details

Commits on Jul 1, 2016

  1. First try with redux

    carlosrocha committed Jul 1, 2016
    Copy the full SHA
    1f8e6a9 View commit details

Commits on Jul 3, 2016

  1. Remove lodash.some

    carlosrocha committed Jul 3, 2016
    Copy the full SHA
    e9c0426 View commit details
  2. Remove lodash.sortby

    carlosrocha committed Jul 3, 2016
    Copy the full SHA
    c8c7812 View commit details

Commits on Jul 6, 2016

  1. Copy the full SHA
    5a763f0 View commit details
  2. Add load data test

    carlosrocha committed Jul 6, 2016
    Copy the full SHA
    d7f3ab2 View commit details
  3. Copy the full SHA
    78a4034 View commit details

Commits on Jul 10, 2016

  1. Copy the full SHA
    7355913 View commit details
  2. Fix tests

    carlosrocha committed Jul 10, 2016
    Copy the full SHA
    50f8cd4 View commit details
  3. Simplify filter method

    carlosrocha committed Jul 10, 2016
    Copy the full SHA
    d758cec View commit details
  4. Copy the full SHA
    706c37b View commit details
  5. Optimize sort function

    carlosrocha committed Jul 10, 2016
    Copy the full SHA
    ff9fccf View commit details
  6. Add initial sorting

    carlosrocha committed Jul 10, 2016
    Copy the full SHA
    d2c98a6 View commit details

Commits on Jul 11, 2016

  1. Copy the full SHA
    234aec5 View commit details

Commits on Jul 12, 2016

  1. Remove dist from git

    carlosrocha committed Jul 12, 2016
    Copy the full SHA
    3edd343 View commit details
  2. Remove ReactDOM reference

    carlosrocha committed Jul 12, 2016
    Copy the full SHA
    46cfeaa View commit details

Commits on Jul 14, 2016

  1. Some code cleaning

    carlosrocha committed Jul 14, 2016
    Copy the full SHA
    95bea40 View commit details

Commits on Jul 17, 2016

  1. Add redux example

    carlosrocha committed Jul 17, 2016
    Copy the full SHA
    17f45ff View commit details
  2. Remove flux example

    carlosrocha committed Jul 17, 2016
    Copy the full SHA
    05f3bc9 View commit details
  3. Copy the full SHA
    0406cc8 View commit details
  4. Copy the full SHA
    6b1bd2c View commit details
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"es2015",
"react",
"stage-1"
]
}
29 changes: 0 additions & 29 deletions .eslintrc

This file was deleted.

46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const OFF = 0;
const WARNING = 1;
const ERROR = 2;

module.exports = {
parser: 'babel-eslint',

plugins: [
'react',
],

parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},

env: {
browser: true,
node: true,
jasmine: true,
es6: true,
},

globals: {
jest: false,
},

rules: {
'strict': OFF,
'quotes': [ERROR, 'single'],
'max-len': [ERROR, 80],
'curly': [ERROR, 'multi-line'],
'eqeqeq': [ERROR, 'smart'],
'block-scoped-var': ERROR,
'semi': [WARNING, 'always'],
'space-before-blocks': [WARNING, 'always'],
'space-in-parens': [OFF, 'never'],
'comma-dangle': [ERROR, 'only-multiline'],
'no-underscore-dangle': 0,
'no-delete-var': ERROR,
'react/jsx-uses-react': 1,
},
};
9 changes: 9 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ignore]

[include]

[libs]

[options]
esproposal.class_instance_fields=enable
esproposal.class_static_fields=enable
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,4 +3,5 @@
node_modules
lib
coverage
dist
npm-debug.log
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: node_js

node_js:
- "iojs"

- "6.2.2"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.0.0
Overall just internal changes.
* Remove DataMixin in favor of a component.
* Use a reducer for changes of data.
* Use React 15.

## 0.6.0
* Support for React 0.14.
* Use lodash for sorting.

## 0.5.0
* Pass down `buildRowOptions` to Table.

## 0.4.0

* Reinitialize state when props change. (Fixes #5).
55 changes: 12 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,23 +2,29 @@

[![Build Status](https://travis-ci.org/carlosrocha/react-data-components.svg?branch=master)](https://travis-ci.org/carlosrocha/react-data-components)

DataTable: [Live demo and source](https://jsbin.com/ziyawu/9/edit?js,output)
DataTable: [Live demo and source](https://jsfiddle.net/carlosrocha/xgde4uh0/)

SelectableTable: [Live demo and source](https://jsbin.com/yokara/edit?js,output)
SelectableTable: [Live demo and source](https://jsfiddle.net/carlosrocha/p9pouh1v/)

## Getting started

```sh
npm install react-data-components --save
```

This component requires Bootstrap stylesheet and Font Awesome fonts, in addition
to the [stylesheet for headers](css/table-twbs.css). If you are using Webpack
and the `css-loader` you can also require the css
with `require('react-data-components/css/table-twbs.css')`.

### Using the default implementation

The default implementation includes a filter for case insensitive global search,
pagination and page size.

```javascript
var React = require('react');
var ReactDOM = require('react-dom');
var DataTable = require('react-data-components').DataTable;

var columns = [
@@ -34,53 +40,16 @@ var data = [
// [ 'name value', 'city value', 'address value', 'phone value' ]
];

React.render((
ReactDOM.render((
<DataTable
className="container"
keys={[ 'name', 'address' ]}
keys="name"
columns={columns}
initialData={data}
initialPageLength={5}
initialSortBy={{ prop: 'city', order: 'descending' }}
pageLengthOptions={[ 5, 20, 50 ]}
/>
), document.body);
), document.getElementById('root'));
```

See [complete example](example/table/main.js), see [Flux example](example/flux/).

## DataMixin options

#### `keys: Array<string> | string`
Properties that make each row unique, e.g. an id.

#### `columns: Array<ColumnOption>`
See `Table` column options.

#### `pageLengthOptions: Array<number>`

#### `initialData: Array<object | Array<any>>`

#### `initialPageLength: number`

#### `initialSortBy: { prop: string | number, order: string }`

## Table column options

#### `title: string`
The title to display on the header.

#### `prop: string | number`
The name of the property or index on the data.

#### `render: (val: any, row: any) => any`
Function to render a different component.

#### `className: string | (val: any, row: any) => string`
Class name for the td.

#### `defaultContent: string`

#### `sortable: boolean`
See [complete example](example/table/main.js).

#### `width: string | number`
1 change: 0 additions & 1 deletion dist/react-data-components.min.js

This file was deleted.

1 change: 1 addition & 0 deletions example/data.json

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions example/flux/AppConstants.js

This file was deleted.

93 changes: 0 additions & 93 deletions example/flux/DataStore.js

This file was deleted.

3 changes: 0 additions & 3 deletions example/flux/Dispatcher.js

This file was deleted.

Loading