react-treelist
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -0,0 +0,0 @@ var args = process.argv.splice(2); |
{ | ||
"name": "react-treelist", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A React treelist component to display data in tree structure.", | ||
@@ -61,4 +61,5 @@ "main": "dist/react-treelist.js", | ||
"dateformat": "^1.0.12", | ||
"lodash": "^4.17.2" | ||
"lodash": "^4.17.2", | ||
"object-hash": "^1.2.0" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # react-treelist [![Build Status](https://travis-ci.org/maheshsenni/react-treelist.svg?branch=master)](https://travis-ci.org/maheshsenni/react-treelist) |
@@ -0,0 +0,0 @@ var webpack = require('webpack'); |
@@ -44,11 +44,28 @@ import React from 'react'; | ||
let counter = 1; | ||
class App extends React.Component { | ||
constructor() { | ||
super(); | ||
this.rerender = this.rerender.bind(this); | ||
} | ||
rerender() { | ||
console.log('rerender clicked'); | ||
console.log(DATA[0].firstName); | ||
DATA[0].firstName = 'Updated ' + counter++; | ||
this.forceUpdate(); | ||
} | ||
render () { | ||
return ( | ||
<TreeList | ||
data={DATA} | ||
columns={COLUMNS} | ||
options={OPTIONS} | ||
id={'id'} | ||
parentId={'parentId'}></TreeList> | ||
<div> | ||
<button onClick={this.rerender}>Update</button> | ||
<TreeList | ||
data={DATA} | ||
columns={COLUMNS} | ||
options={OPTIONS} | ||
id={'id'} | ||
parentId={'parentId'}></TreeList> | ||
</div> | ||
); | ||
@@ -55,0 +72,0 @@ } |
@@ -138,7 +138,9 @@ import '../css/body.css'; | ||
// 'data' in future | ||
return nextState.scrollTop !== this.state.scrollTop || | ||
const shouldUpdate = nextState.scrollTop !== this.state.scrollTop || | ||
nextState.scrollLeft !== this.state.scrollLeft || | ||
nextProps.width !== this.props.width || | ||
nextState.expandedRows.length !== this.state.expandedRows.length || | ||
nextProps.updateHash.sort !== this.props.updateHash.sort; | ||
nextProps.updateHash !== this.props.updateHash; | ||
console.log('should update? ', shouldUpdate); | ||
return shouldUpdate; | ||
} | ||
@@ -191,3 +193,3 @@ | ||
onHScroll: PropTypes.func.isRequired, | ||
updateHash: PropTypes.object, | ||
updateHash: PropTypes.string, | ||
expandAll: PropTypes.bool, | ||
@@ -194,0 +196,0 @@ itemHeight: PropTypes.number |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
export const DndTypes = { | ||
RESIZE_HANDLE: 'resize_handle' | ||
}; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import React, { Component, PropTypes } from 'react'; |
@@ -0,0 +0,0 @@ import '../css/row-cell.css'; |
@@ -0,0 +0,0 @@ import '../css/row-indent.css'; |
import '../css/treegrid.css'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import hash from 'object-hash'; | ||
import Header from './Header'; | ||
@@ -121,6 +122,9 @@ import Body from './Body'; | ||
// construct update keys | ||
const updateHash = { | ||
const updateHash = hash({ | ||
data: renderData, | ||
sort: JSON.stringify(this.state.sortedColumns) | ||
}; | ||
}); | ||
console.log('Update hash: ', typeof updateHash); | ||
return ( | ||
@@ -127,0 +131,0 @@ <div className='tgrid'> |
@@ -0,0 +0,0 @@ export function is_null(data, filterKey) { |
@@ -0,0 +0,0 @@ export { |
@@ -0,0 +0,0 @@ export const OPTIONS_STRING = [{ |
@@ -0,0 +0,0 @@ import { getTree, getFilteredDisplayRows } from './TreeUtils'; |
@@ -0,0 +0,0 @@ export function number_eq(data, filterKey, filterValue) { |
@@ -0,0 +0,0 @@ // Solution to detect scrollbar width from |
@@ -0,0 +0,0 @@ import sortBy from 'lodash/sortBy'; |
@@ -0,0 +0,0 @@ export function string_eq(data, filterKey, filterValue) { |
@@ -0,0 +0,0 @@ const getRowsWithChildren = function(data, idField, parentIdField) { |
@@ -0,0 +0,0 @@ export const DATA = [ { id: 0, |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ var webpack = require('webpack'); |
@@ -0,0 +0,0 @@ var webpack = require('webpack'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
370939
57
3720
0
5
+ Addedobject-hash@^1.2.0
+ Addedobject-hash@1.3.1(transitive)