react-mdl
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/react-mdl/react-mdl/compare/v2.0.2...v2.1.0) (2020-01-24) | ||
### Features | ||
* add `field` on `TableHeader` to separate column name from data field ([83cba81](https://github.com/react-mdl/react-mdl/commit/83cba81)) | ||
<a name="2.0.2"></a> | ||
@@ -7,0 +17,0 @@ ## [2.0.2](https://github.com/react-mdl/react-mdl/compare/v2.0.1...v2.0.2) (2020-01-06) |
@@ -82,6 +82,7 @@ 'use strict'; | ||
var className = !column.numeric ? 'mdl-data-table__cell--non-numeric' : ''; | ||
var field = column.field || column.name; | ||
return _react2.default.createElement( | ||
'td', | ||
{ key: column.name, className: className }, | ||
column.cellFormatter ? column.cellFormatter(row[column.name], row, idx) : row[column.name] | ||
column.cellFormatter ? column.cellFormatter(row[field], row, idx) : row[field] | ||
); | ||
@@ -88,0 +89,0 @@ } |
@@ -33,2 +33,3 @@ 'use strict'; | ||
name: _propTypes2.default.string.isRequired, | ||
field: _propTypes2.default.string, | ||
numeric: _propTypes2.default.bool, | ||
@@ -57,2 +58,3 @@ onClick: _propTypes2.default.func, | ||
delete otherProps.sortFn; | ||
delete otherProps.field; | ||
@@ -59,0 +61,0 @@ var classes = (0, _classnames2.default)({ |
{ | ||
"name": "react-mdl", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "React Components for Material Design Lite", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -28,5 +28,6 @@ import React from 'react'; | ||
const className = !column.numeric ? 'mdl-data-table__cell--non-numeric' : ''; | ||
const field = column.field || column.name; | ||
return ( | ||
<td key={column.name} className={className}> | ||
{column.cellFormatter ? column.cellFormatter(row[column.name], row, idx) : row[column.name]} | ||
{column.cellFormatter ? column.cellFormatter(row[field], row, idx) : row[field]} | ||
</td> | ||
@@ -33,0 +34,0 @@ ); |
@@ -10,2 +10,3 @@ import React from 'react'; | ||
name: PropTypes.string.isRequired, | ||
field: PropTypes.string, | ||
numeric: PropTypes.bool, | ||
@@ -26,2 +27,3 @@ onClick: PropTypes.func, | ||
delete otherProps.sortFn; | ||
delete otherProps.field; | ||
@@ -28,0 +30,0 @@ const classes = classNames({ |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
44758520
43978
2