Comparing version 8.1.1 to 9.0.0
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
import React from 'react'; | ||
import React, { cloneElement } from 'react'; | ||
import classnames from 'classnames'; | ||
import warning from 'warning'; | ||
var tabBarExtraContentStyle = { | ||
float: 'right' | ||
}; | ||
export default { | ||
@@ -66,4 +62,2 @@ getDefaultProps: function getDefaultProps() { | ||
getRootNode: function getRootNode(contents) { | ||
var _classnames; | ||
var _props = this.props, | ||
@@ -74,5 +68,12 @@ prefixCls = _props.prefixCls, | ||
extraContent = _props.extraContent, | ||
style = _props.style; | ||
style = _props.style, | ||
tabBarPosition = _props.tabBarPosition; | ||
var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls + '-bar', 1), _defineProperty(_classnames, className, !!className), _classnames)); | ||
var cls = classnames(prefixCls + '-bar', _defineProperty({}, className, !!className)); | ||
var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; | ||
var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; | ||
var children = [cloneElement(extraContent, { | ||
key: 'extra', | ||
style: _extends({}, tabBarExtraContentStyle, extraContent.props.style) | ||
}), cloneElement(contents, { key: 'content' })]; | ||
return React.createElement( | ||
@@ -88,13 +89,5 @@ 'div', | ||
}, | ||
extraContent ? React.createElement( | ||
'div', | ||
{ | ||
style: tabBarExtraContentStyle, | ||
key: 'extra' | ||
}, | ||
extraContent | ||
) : null, | ||
contents | ||
topOrBottom ? children : children.reverse() | ||
); | ||
} | ||
}; |
# History | ||
---- | ||
## 9.0.0 / 2017-08-04 | ||
* Refactor extraContent dom structure. | ||
## 7.1.0 / 2016-12-06 | ||
@@ -54,2 +58,2 @@ | ||
`improved` [#4](https://github.com/react-component/tabs/issues/4) lazy render on initial render and update | ||
`improved` [#4](https://github.com/react-component/tabs/issues/4) lazy render on initial render and update |
@@ -29,6 +29,2 @@ 'use strict'; | ||
var tabBarExtraContentStyle = { | ||
float: 'right' | ||
}; | ||
exports['default'] = { | ||
@@ -89,4 +85,2 @@ getDefaultProps: function getDefaultProps() { | ||
getRootNode: function getRootNode(contents) { | ||
var _classnames; | ||
var _props = this.props, | ||
@@ -97,5 +91,12 @@ prefixCls = _props.prefixCls, | ||
extraContent = _props.extraContent, | ||
style = _props.style; | ||
style = _props.style, | ||
tabBarPosition = _props.tabBarPosition; | ||
var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-bar', 1), (0, _defineProperty3['default'])(_classnames, className, !!className), _classnames)); | ||
var cls = (0, _classnames3['default'])(prefixCls + '-bar', (0, _defineProperty3['default'])({}, className, !!className)); | ||
var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; | ||
var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; | ||
var children = [(0, _react.cloneElement)(extraContent, { | ||
key: 'extra', | ||
style: (0, _extends3['default'])({}, tabBarExtraContentStyle, extraContent.props.style) | ||
}), (0, _react.cloneElement)(contents, { key: 'content' })]; | ||
return _react2['default'].createElement( | ||
@@ -111,11 +112,3 @@ 'div', | ||
}, | ||
extraContent ? _react2['default'].createElement( | ||
'div', | ||
{ | ||
style: tabBarExtraContentStyle, | ||
key: 'extra' | ||
}, | ||
extraContent | ||
) : null, | ||
contents | ||
topOrBottom ? children : children.reverse() | ||
); | ||
@@ -122,0 +115,0 @@ } |
{ | ||
"name": "rc-tabs", | ||
"version": "8.1.1", | ||
"version": "9.0.0", | ||
"description": "tabs ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
121990
3266