reactstrap
Advanced tools
Comparing version 0.8.0 to 1.0.0
@@ -0,1 +1,17 @@ | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/reactstrap/reactstrap/compare/0.8.0...v1.0.0) (2016-03-27) | ||
### Code Refactoring | ||
* **components:** standardize custom tag names ([494e4ec](https://github.com/reactstrap/reactstrap/commit/494e4ec)) | ||
### BREAKING CHANGES | ||
* components: `El` prop is now `tag`. This standardizes the way | ||
custom elements should render their html “tags”. | ||
<a name="0.8.0"></a> | ||
@@ -2,0 +18,0 @@ # [0.8.0](https://github.com/reactstrap/reactstrap/compare/0.7.2...v0.8.0) (2016-03-27) |
@@ -9,3 +9,3 @@ import React, { PropTypes } from 'react'; | ||
disabled: PropTypes.bool, | ||
El: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
onClick: PropTypes.func, | ||
@@ -16,3 +16,4 @@ size: PropTypes.string | ||
const defaultProps = { | ||
color: 'primary' | ||
color: 'primary', | ||
tag: 'button' | ||
}; | ||
@@ -38,13 +39,11 @@ | ||
render() { | ||
const { | ||
let { | ||
active, | ||
block, | ||
children, | ||
className, | ||
color, | ||
El, | ||
size, | ||
tag: Tag, | ||
...attributes | ||
} = this.props; | ||
let Tag = 'button'; | ||
@@ -60,5 +59,3 @@ const classes = classNames( | ||
if (El) { | ||
Tag = El; | ||
} else if (attributes.href) { | ||
if (attributes.href && Tag === 'button') { | ||
Tag = 'a'; | ||
@@ -68,7 +65,3 @@ } | ||
return ( | ||
<Tag {...attributes} | ||
className={classes} | ||
onClick={this.onClick}> | ||
{children} | ||
</Tag> | ||
<Tag {...attributes} className={classes} onClick={this.onClick}/> | ||
); | ||
@@ -75,0 +68,0 @@ } |
@@ -158,3 +158,3 @@ import React, { PropTypes } from 'react'; | ||
group, | ||
'tag': TagName, | ||
'tag': Tag, | ||
...attributes | ||
@@ -174,6 +174,6 @@ } = omit(this.props, ['children', 'isOpen']); | ||
return ( | ||
<TagName {...attributes} | ||
<Tag {...attributes} | ||
className={classes}> | ||
{this.renderChildren()} | ||
</TagName> | ||
</Tag> | ||
); | ||
@@ -180,0 +180,0 @@ } |
import React, { PropTypes } from 'react'; | ||
import classNames from 'classnames'; | ||
import omit from 'lodash.omit'; | ||
@@ -9,3 +8,3 @@ const propTypes = { | ||
divider: PropTypes.bool, | ||
El: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]), | ||
header: PropTypes.bool, | ||
@@ -16,2 +15,6 @@ isOpen: PropTypes.bool, | ||
const defaultProps = { | ||
tag: 'button' | ||
}; | ||
class DropdownItem extends React.Component { | ||
@@ -46,9 +49,7 @@ constructor(props) { | ||
render() { | ||
let Tagname = 'button'; | ||
const tabIndex = this.getTabIndex(); | ||
const { | ||
let { | ||
className, | ||
children, | ||
divider, | ||
El, | ||
tag: Tag, | ||
header, | ||
@@ -67,26 +68,15 @@ ...props } = this.props; | ||
if (El) { | ||
return ( | ||
<El {...props} | ||
tabIndex={tabIndex} | ||
className={classes} | ||
onClick={this.onClick}> | ||
{children} | ||
</El> | ||
); | ||
if (Tag === 'button') { | ||
if (header) { | ||
Tag = 'h6'; | ||
} else if (divider) { | ||
Tag = 'div'; | ||
} | ||
} | ||
if (header) { | ||
Tagname = 'h6'; | ||
} else if (divider) { | ||
Tagname = 'div'; | ||
} | ||
return ( | ||
<Tagname {...props} | ||
<Tag {...props} | ||
tabIndex={tabIndex} | ||
className={classes} | ||
onClick={this.onClick}> | ||
{children} | ||
</Tagname> | ||
onClick={this.onClick}/> | ||
); | ||
@@ -97,3 +87,4 @@ } | ||
DropdownItem.propTypes = propTypes; | ||
DropdownItem.defaultProps = defaultProps; | ||
export default DropdownItem; |
{ | ||
"name": "reactstrap", | ||
"version": "0.8.0", | ||
"version": "1.0.0", | ||
"description": "React Bootstrap 4 components compatible with React 0.14.x and 15.x", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1286385
12659