Comparing version 7.0.11 to 7.0.12
@@ -121,6 +121,6 @@ 'use strict'; | ||
var _props = this.props; | ||
var prefixCls = _props.prefixCls; | ||
var styles = _props.styles; | ||
var inkBarAnimated = _props.inkBarAnimated; | ||
var _props = this.props, | ||
prefixCls = _props.prefixCls, | ||
styles = _props.styles, | ||
inkBarAnimated = _props.inkBarAnimated; | ||
@@ -127,0 +127,0 @@ var className = prefixCls + '-ink-bar'; |
@@ -65,5 +65,5 @@ 'use strict'; | ||
var minOffset = navWrapNodeWH - navNodeWH; | ||
var _state = this.state; | ||
var next = _state.next; | ||
var prev = _state.prev; | ||
var _state = this.state, | ||
next = _state.next, | ||
prev = _state.prev; | ||
@@ -112,3 +112,3 @@ if (minOffset >= 0) { | ||
setOffset: function setOffset(offset) { | ||
var checkNextPrev = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; | ||
var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
@@ -173,5 +173,5 @@ var target = Math.min(0, offset); | ||
scrollToActiveTab: function scrollToActiveTab() { | ||
var _refs = this.refs; | ||
var activeTab = _refs.activeTab; | ||
var navWrap = _refs.navWrap; | ||
var _refs = this.refs, | ||
activeTab = _refs.activeTab, | ||
navWrap = _refs.navWrap; | ||
@@ -211,8 +211,8 @@ if (activeTab) { | ||
var _state2 = this.state; | ||
var next = _state2.next; | ||
var prev = _state2.prev; | ||
var _props = this.props; | ||
var prefixCls = _props.prefixCls; | ||
var scrollAnimated = _props.scrollAnimated; | ||
var _state2 = this.state, | ||
next = _state2.next, | ||
prev = _state2.prev; | ||
var _props = this.props, | ||
prefixCls = _props.prefixCls, | ||
scrollAnimated = _props.scrollAnimated; | ||
@@ -219,0 +219,0 @@ var nextButton = void 0; |
@@ -34,6 +34,6 @@ 'use strict'; | ||
function computeIndex(_ref) { | ||
var maxIndex = _ref.maxIndex; | ||
var startIndex = _ref.startIndex; | ||
var delta = _ref.delta; | ||
var viewSize = _ref.viewSize; | ||
var maxIndex = _ref.maxIndex, | ||
startIndex = _ref.startIndex, | ||
delta = _ref.delta, | ||
viewSize = _ref.viewSize; | ||
@@ -90,7 +90,7 @@ var index = startIndex + -delta / viewSize; | ||
onPanStart: function onPanStart() { | ||
var _props = this.props; | ||
var tabBarPosition = _props.tabBarPosition; | ||
var children = _props.children; | ||
var activeKey = _props.activeKey; | ||
var animated = _props.animated; | ||
var _props = this.props, | ||
tabBarPosition = _props.tabBarPosition, | ||
children = _props.children, | ||
activeKey = _props.activeKey, | ||
animated = _props.animated; | ||
@@ -130,5 +130,5 @@ var startIndex = this.startIndex = (0, _utils.getActiveIndex)(children, activeKey); | ||
end: function end(e, swipe) { | ||
var _props2 = this.props; | ||
var tabBarPosition = _props2.tabBarPosition; | ||
var animated = _props2.animated; | ||
var _props2 = this.props, | ||
tabBarPosition = _props2.tabBarPosition, | ||
animated = _props2.animated; | ||
@@ -170,6 +170,6 @@ this.startDrag = false; | ||
render: function render() { | ||
var _props3 = this.props; | ||
var tabBarPosition = _props3.tabBarPosition; | ||
var hammerOptions = _props3.hammerOptions; | ||
var animated = _props3.animated; | ||
var _props3 = this.props, | ||
tabBarPosition = _props3.tabBarPosition, | ||
hammerOptions = _props3.hammerOptions, | ||
animated = _props3.animated; | ||
@@ -176,0 +176,0 @@ var direction = {}; |
@@ -85,8 +85,8 @@ 'use strict'; | ||
var _props = this.props; | ||
var prefixCls = _props.prefixCls; | ||
var onKeyDown = _props.onKeyDown; | ||
var className = _props.className; | ||
var extraContent = _props.extraContent; | ||
var style = _props.style; | ||
var _props = this.props, | ||
prefixCls = _props.prefixCls, | ||
onKeyDown = _props.onKeyDown, | ||
className = _props.className, | ||
extraContent = _props.extraContent, | ||
style = _props.style; | ||
@@ -93,0 +93,0 @@ var cls = (0, _classnames3["default"])((_classnames = {}, (0, _defineProperty3["default"])(_classnames, prefixCls + '-bar', 1), (0, _defineProperty3["default"])(_classnames, className, !!className), _classnames)); |
@@ -68,7 +68,7 @@ 'use strict'; | ||
var props = this.props; | ||
var prefixCls = props.prefixCls; | ||
var children = props.children; | ||
var activeKey = props.activeKey; | ||
var tabBarPosition = props.tabBarPosition; | ||
var animated = props.animated; | ||
var prefixCls = props.prefixCls, | ||
children = props.children, | ||
activeKey = props.activeKey, | ||
tabBarPosition = props.tabBarPosition, | ||
animated = props.animated; | ||
var style = props.style; | ||
@@ -75,0 +75,0 @@ |
@@ -39,6 +39,6 @@ 'use strict'; | ||
var props = this.props; | ||
var className = props.className; | ||
var destroyInactiveTabPane = props.destroyInactiveTabPane; | ||
var active = props.active; | ||
var forceRender = props.forceRender; | ||
var className = props.className, | ||
destroyInactiveTabPane = props.destroyInactiveTabPane, | ||
active = props.active, | ||
forceRender = props.forceRender; | ||
@@ -45,0 +45,0 @@ this._isActived = this._isActived || active; |
@@ -143,7 +143,7 @@ 'use strict'; | ||
var props = this.props; | ||
var prefixCls = props.prefixCls; | ||
var tabBarPosition = props.tabBarPosition; | ||
var className = props.className; | ||
var renderTabContent = props.renderTabContent; | ||
var renderTabBar = props.renderTabBar; | ||
var prefixCls = props.prefixCls, | ||
tabBarPosition = props.tabBarPosition, | ||
className = props.className, | ||
renderTabContent = props.renderTabContent, | ||
renderTabBar = props.renderTabBar; | ||
@@ -150,0 +150,0 @@ 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)); |
@@ -23,3 +23,7 @@ 'use strict'; | ||
function toArray(children) { | ||
// allow [c,[a,b]] | ||
if (Array.isArray(children)) { | ||
return children.filter(function (c) { | ||
return !!c; | ||
}); | ||
} | ||
var c = []; | ||
@@ -35,9 +39,10 @@ _react2["default"].Children.forEach(children, function (child) { | ||
function getActiveIndex(children, activeKey) { | ||
var c = toArray(children); | ||
for (var i = 0; i < c.length; i++) { | ||
if (c[i].key === activeKey) { | ||
return i; | ||
var activeIndex = -1; | ||
_react2["default"].Children.forEach(children, function (child, index) { | ||
if (child.key === activeKey) { | ||
activeIndex = index; | ||
} | ||
} | ||
return -1; | ||
}); | ||
return activeIndex; | ||
} | ||
@@ -44,0 +49,0 @@ |
{ | ||
"name": "rc-tabs", | ||
"version": "7.0.11", | ||
"version": "7.0.12", | ||
"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
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
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
56909
1515
1