kbc-react-components
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -17,2 +17,6 @@ 'use strict'; | ||
var _Protected = require('../Protected'); | ||
var _Protected2 = _interopRequireDefault(_Protected); | ||
var TreeNode = _react2['default'].createClass({ | ||
@@ -25,2 +29,4 @@ displayName: 'TreeNode', | ||
concealedKeys: ['password'], | ||
render: function render() { | ||
@@ -55,2 +61,14 @@ return _react2['default'].createElement( | ||
renderValue: function renderValue(value, key) { | ||
if (this.concealedKeys.indexOf(key) >= 0) { | ||
return _react2['default'].createElement( | ||
_Protected2['default'], | ||
null, | ||
value | ||
); | ||
} else { | ||
return value; | ||
} | ||
}, | ||
renderLeaf: function renderLeaf(value, key) { | ||
@@ -66,6 +84,5 @@ return _react2['default'].createElement( | ||
': ', | ||
value | ||
this.renderValue(value, key) | ||
); | ||
} | ||
}); | ||
@@ -72,0 +89,0 @@ |
{ | ||
"name": "kbc-react-components", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Keboola UI React Components Library", | ||
@@ -20,3 +20,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"babel": "~5.4.3", | ||
"babel": "~5.6.10", | ||
"immutable": "^3.7.3" | ||
@@ -23,0 +23,0 @@ }, |
import React from 'react'; | ||
import Immutable from 'immutable'; | ||
import Protected from '../Protected'; | ||
@@ -9,7 +10,9 @@ const TreeNode = React.createClass({ | ||
concealedKeys: ["password"], | ||
render() { | ||
return ( | ||
<ul> | ||
{this.props.data.map(this.renderRow, this)} | ||
</ul> | ||
<ul> | ||
{this.props.data.map(this.renderRow, this)} | ||
</ul> | ||
); | ||
@@ -29,4 +32,4 @@ }, | ||
<span> | ||
<strong>{key}</strong> | ||
<TreeNode data={value}/> | ||
<strong>{key}</strong> | ||
<TreeNode data={value}/> | ||
</span> | ||
@@ -36,12 +39,21 @@ ); | ||
renderValue(value, key) { | ||
if (this.concealedKeys.indexOf(key) >= 0) { | ||
return ( | ||
<Protected>{value}</Protected> | ||
); | ||
} else { | ||
return value; | ||
} | ||
}, | ||
renderLeaf(value, key) { | ||
return ( | ||
<span> | ||
<strong>{key}</strong>: {value} | ||
</span> | ||
<strong>{key}</strong>: {this.renderValue(value, key)} | ||
</span> | ||
); | ||
} | ||
}); | ||
export default TreeNode; | ||
export default TreeNode; |
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
13912
438