glud-component
Advanced tools
Comparing version 0.0.19 to 0.0.21
@@ -59,7 +59,10 @@ 'use strict'; | ||
}); | ||
}, _this.onClickTab = function (tab) { | ||
}, _this.onClickTab = function (_ref2) { | ||
var tab = _ref2.tab, | ||
name = _ref2.name; | ||
_this.setState({ | ||
tabActive: tab | ||
}); | ||
_this.props.onClick(tab); | ||
_this.props.onClick(tab, name); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
@@ -97,2 +100,3 @@ } | ||
return _react2.default.createElement(_TabItem2.default, { | ||
name: child.props.name, | ||
title: child.props.title, | ||
@@ -128,6 +132,9 @@ icon: child.props.icon, | ||
fullwidth: _propTypes2.default.bool, | ||
/** | ||
* Return (tab, tabName) | ||
*/ | ||
onClick: _propTypes2.default.func | ||
}, _class.defaultProps = { | ||
defaultActive: 1, | ||
onClick: function onClick() { | ||
onClick: function onClick(tab, tabName) { | ||
return null; | ||
@@ -134,0 +141,0 @@ } |
@@ -45,2 +45,3 @@ 'use strict'; | ||
var _props = this.props, | ||
name = _props.name, | ||
title = _props.title, | ||
@@ -58,5 +59,8 @@ icon = _props.icon, | ||
'li', | ||
{ className: classes, onClick: function onClick() { | ||
return _onClick(index + 1); | ||
} }, | ||
{ | ||
className: classes, | ||
onClick: function onClick() { | ||
return _onClick({ tab: index + 1, name: name }); | ||
} | ||
}, | ||
_react2.default.createElement( | ||
@@ -82,2 +86,3 @@ 'a', | ||
}(_react.PureComponent), _class.propTypes = { | ||
name: _propTypes2.default.string, | ||
title: _propTypes2.default.string, | ||
@@ -84,0 +89,0 @@ icon: _propTypes2.default.string, |
{ | ||
"name": "glud-component", | ||
"version": "0.0.19", | ||
"version": "0.0.21", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": { |
1438340
5048