Comparing version 9.0.3 to 9.1.0
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
@@ -6,2 +7,3 @@ import React, { cloneElement } from 'react'; | ||
import warning from 'warning'; | ||
import pickAttrs from 'rc-util/es/pickAttrs'; | ||
@@ -20,7 +22,8 @@ export default { | ||
var props = this.props; | ||
var children = props.panels; | ||
var activeKey = props.activeKey; | ||
var _props = this.props, | ||
children = _props.panels, | ||
activeKey = _props.activeKey, | ||
prefixCls = _props.prefixCls; | ||
var rst = []; | ||
var prefixCls = props.prefixCls; | ||
@@ -64,9 +67,10 @@ React.Children.forEach(children, function (child) { | ||
getRootNode: function getRootNode(contents) { | ||
var _props = this.props, | ||
prefixCls = _props.prefixCls, | ||
onKeyDown = _props.onKeyDown, | ||
className = _props.className, | ||
extraContent = _props.extraContent, | ||
style = _props.style, | ||
tabBarPosition = _props.tabBarPosition; | ||
var _props2 = this.props, | ||
prefixCls = _props2.prefixCls, | ||
onKeyDown = _props2.onKeyDown, | ||
className = _props2.className, | ||
extraContent = _props2.extraContent, | ||
style = _props2.style, | ||
tabBarPosition = _props2.tabBarPosition, | ||
restProps = _objectWithoutProperties(_props2, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition']); | ||
@@ -87,3 +91,3 @@ var cls = classnames(prefixCls + '-bar', _defineProperty({}, className, !!className)); | ||
'div', | ||
{ | ||
_extends({ | ||
role: 'tablist', | ||
@@ -95,3 +99,3 @@ className: cls, | ||
style: style | ||
}, | ||
}, pickAttrs(restProps)), | ||
children | ||
@@ -98,0 +102,0 @@ ); |
@@ -0,2 +1,4 @@ | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; | ||
import React from 'react'; | ||
@@ -6,2 +8,3 @@ import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
import pickAttrs from 'rc-util/es/pickAttrs'; | ||
@@ -24,10 +27,15 @@ var TabPane = createReactClass({ | ||
var props = this.props; | ||
var className = props.className, | ||
destroyInactiveTabPane = props.destroyInactiveTabPane, | ||
active = props.active, | ||
forceRender = props.forceRender; | ||
var _props = this.props, | ||
className = _props.className, | ||
destroyInactiveTabPane = _props.destroyInactiveTabPane, | ||
active = _props.active, | ||
forceRender = _props.forceRender, | ||
rootPrefixCls = _props.rootPrefixCls, | ||
style = _props.style, | ||
children = _props.children, | ||
placeholder = _props.placeholder, | ||
restProps = _objectWithoutProperties(_props, ['className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); | ||
this._isActived = this._isActived || active; | ||
var prefixCls = props.rootPrefixCls + '-tabpane'; | ||
var prefixCls = rootPrefixCls + '-tabpane'; | ||
var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-inactive', !active), _defineProperty(_classnames, prefixCls + '-active', active), _defineProperty(_classnames, className, className), _classnames)); | ||
@@ -37,9 +45,9 @@ var isRender = destroyInactiveTabPane ? active : this._isActived; | ||
'div', | ||
{ | ||
style: props.style, | ||
_extends({ | ||
style: style, | ||
role: 'tabpanel', | ||
'aria-hidden': props.active ? 'false' : 'true', | ||
'aria-hidden': active ? 'false' : 'true', | ||
className: cls | ||
}, | ||
isRender || forceRender ? props.children : props.placeholder | ||
}, pickAttrs(restProps)), | ||
isRender || forceRender ? children : placeholder | ||
); | ||
@@ -46,0 +54,0 @@ } |
@@ -0,2 +1,4 @@ | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
import _defineProperty from 'babel-runtime/helpers/defineProperty'; | ||
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; | ||
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
@@ -8,2 +10,3 @@ import _createClass from 'babel-runtime/helpers/createClass'; | ||
import PropTypes from 'prop-types'; | ||
import pickAttrs from 'rc-util/es/pickAttrs'; | ||
import KeyCode from './KeyCode'; | ||
@@ -65,4 +68,3 @@ import TabPane from './TabPane'; | ||
} else if (!activeKeyIsValid(nextProps, this.state.activeKey)) { | ||
// https://github.com/ant-design/ant-design/issues/7093 | ||
this.setState({ | ||
this.setState({ | ||
activeKey: getDefaultActiveKey(nextProps) | ||
@@ -78,2 +80,3 @@ }); | ||
var props = this.props; | ||
var prefixCls = props.prefixCls, | ||
@@ -83,3 +86,5 @@ tabBarPosition = props.tabBarPosition, | ||
renderTabContent = props.renderTabContent, | ||
renderTabBar = props.renderTabBar; | ||
renderTabBar = props.renderTabBar, | ||
destroyInactiveTabPane = props.destroyInactiveTabPane, | ||
restProps = _objectWithoutProperties(props, ['prefixCls', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane']); | ||
@@ -101,3 +106,3 @@ var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-' + tabBarPosition, 1), _defineProperty(_classnames, className, !!className), _classnames)); | ||
activeKey: this.state.activeKey, | ||
destroyInactiveTabPane: props.destroyInactiveTabPane, | ||
destroyInactiveTabPane: destroyInactiveTabPane, | ||
children: props.children, | ||
@@ -112,6 +117,6 @@ onChange: this.setActiveKey, | ||
'div', | ||
{ | ||
_extends({ | ||
className: cls, | ||
style: props.style | ||
}, | ||
}, pickAttrs(restProps)), | ||
contents | ||
@@ -118,0 +123,0 @@ ); |
# History | ||
---- | ||
## 9.1.0 / 2017-08-13 | ||
* Support add data-* to Tabs dom. | ||
## 9.0.0 / 2017-08-04 | ||
@@ -5,0 +9,0 @@ |
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
@@ -28,2 +32,6 @@ | ||
var _pickAttrs = require('rc-util/lib/pickAttrs'); | ||
var _pickAttrs2 = _interopRequireDefault(_pickAttrs); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -43,7 +51,8 @@ | ||
var props = this.props; | ||
var children = props.panels; | ||
var activeKey = props.activeKey; | ||
var _props = this.props, | ||
children = _props.panels, | ||
activeKey = _props.activeKey, | ||
prefixCls = _props.prefixCls; | ||
var rst = []; | ||
var prefixCls = props.prefixCls; | ||
@@ -87,9 +96,10 @@ _react2['default'].Children.forEach(children, function (child) { | ||
getRootNode: function getRootNode(contents) { | ||
var _props = this.props, | ||
prefixCls = _props.prefixCls, | ||
onKeyDown = _props.onKeyDown, | ||
className = _props.className, | ||
extraContent = _props.extraContent, | ||
style = _props.style, | ||
tabBarPosition = _props.tabBarPosition; | ||
var _props2 = this.props, | ||
prefixCls = _props2.prefixCls, | ||
onKeyDown = _props2.onKeyDown, | ||
className = _props2.className, | ||
extraContent = _props2.extraContent, | ||
style = _props2.style, | ||
tabBarPosition = _props2.tabBarPosition, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props2, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition']); | ||
@@ -110,3 +120,3 @@ var cls = (0, _classnames3['default'])(prefixCls + '-bar', (0, _defineProperty3['default'])({}, className, !!className)); | ||
'div', | ||
{ | ||
(0, _extends3['default'])({ | ||
role: 'tablist', | ||
@@ -118,3 +128,3 @@ className: cls, | ||
style: style | ||
}, | ||
}, (0, _pickAttrs2['default'])(restProps)), | ||
children | ||
@@ -121,0 +131,0 @@ ); |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
@@ -12,2 +16,6 @@ | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _react = require('react'); | ||
@@ -29,2 +37,6 @@ | ||
var _pickAttrs = require('rc-util/lib/pickAttrs'); | ||
var _pickAttrs2 = _interopRequireDefault(_pickAttrs); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
@@ -48,10 +60,15 @@ | ||
var props = this.props; | ||
var className = props.className, | ||
destroyInactiveTabPane = props.destroyInactiveTabPane, | ||
active = props.active, | ||
forceRender = props.forceRender; | ||
var _props = this.props, | ||
className = _props.className, | ||
destroyInactiveTabPane = _props.destroyInactiveTabPane, | ||
active = _props.active, | ||
forceRender = _props.forceRender, | ||
rootPrefixCls = _props.rootPrefixCls, | ||
style = _props.style, | ||
children = _props.children, | ||
placeholder = _props.placeholder, | ||
restProps = (0, _objectWithoutProperties3['default'])(_props, ['className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); | ||
this._isActived = this._isActived || active; | ||
var prefixCls = props.rootPrefixCls + '-tabpane'; | ||
var prefixCls = rootPrefixCls + '-tabpane'; | ||
var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls, 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-inactive', !active), (0, _defineProperty3['default'])(_classnames, prefixCls + '-active', active), (0, _defineProperty3['default'])(_classnames, className, className), _classnames)); | ||
@@ -61,9 +78,9 @@ var isRender = destroyInactiveTabPane ? active : this._isActived; | ||
'div', | ||
{ | ||
style: props.style, | ||
(0, _extends3['default'])({ | ||
style: style, | ||
role: 'tabpanel', | ||
'aria-hidden': props.active ? 'false' : 'true', | ||
'aria-hidden': active ? 'false' : 'true', | ||
className: cls | ||
}, | ||
isRender || forceRender ? props.children : props.placeholder | ||
}, (0, _pickAttrs2['default'])(restProps)), | ||
isRender || forceRender ? children : placeholder | ||
); | ||
@@ -70,0 +87,0 @@ } |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); | ||
@@ -12,2 +16,6 @@ | ||
var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); | ||
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
@@ -37,2 +45,6 @@ | ||
var _pickAttrs = require('rc-util/lib/pickAttrs'); | ||
var _pickAttrs2 = _interopRequireDefault(_pickAttrs); | ||
var _KeyCode = require('./KeyCode'); | ||
@@ -120,3 +132,5 @@ | ||
renderTabContent = props.renderTabContent, | ||
renderTabBar = props.renderTabBar; | ||
renderTabBar = props.renderTabBar, | ||
destroyInactiveTabPane = props.destroyInactiveTabPane, | ||
restProps = (0, _objectWithoutProperties3['default'])(props, ['prefixCls', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane']); | ||
@@ -138,3 +152,3 @@ var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls, 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-' + tabBarPosition, 1), (0, _defineProperty3['default'])(_classnames, className, !!className), _classnames)); | ||
activeKey: this.state.activeKey, | ||
destroyInactiveTabPane: props.destroyInactiveTabPane, | ||
destroyInactiveTabPane: destroyInactiveTabPane, | ||
children: props.children, | ||
@@ -149,6 +163,6 @@ onChange: this.setActiveKey, | ||
'div', | ||
{ | ||
(0, _extends3['default'])({ | ||
className: cls, | ||
style: props.style | ||
}, | ||
}, (0, _pickAttrs2['default'])(restProps)), | ||
contents | ||
@@ -155,0 +169,0 @@ ); |
{ | ||
"name": "rc-tabs", | ||
"version": "9.0.3", | ||
"version": "9.1.0", | ||
"description": "tabs ui component for react", | ||
@@ -13,2 +13,3 @@ "keywords": [ | ||
"es", | ||
"dist", | ||
"assets/index.css" | ||
@@ -29,5 +30,12 @@ ], | ||
"config": { | ||
"port": 8002 | ||
"port": 8002, | ||
"entry": { | ||
"rc-tabs": [ | ||
"./src/index.js", | ||
"./assets/index.less" | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
"dist": "rc-tools run dist", | ||
"build": "rc-tools run build", | ||
@@ -37,3 +45,2 @@ "compile": "rc-tools run compile --babel-runtime", | ||
"start": "rc-tools run server", | ||
"start:preact": "cross-env DEMO_ENV=preact rc-tools run server", | ||
"pub": "rc-tools run pub --babel-runtime", | ||
@@ -86,4 +93,5 @@ "lint": "rc-tools run lint", | ||
"rc-hammerjs": "~0.6.0", | ||
"rc-util": "^4.0.4", | ||
"warning": "^3.0.0" | ||
} | ||
} |
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
567337
44
8294
7
1
28
2
+ Addedrc-util@^4.0.4
+ Addedadd-dom-event-listener@1.1.0(transitive)
+ Addedrc-util@4.21.1(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedshallowequal@1.1.0(transitive)